@qratilabs/qrati-connect 2.3.3 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/README.md +2 -2
- package/element/{AuthLayout-BQsxj8DA.js → AuthLayout-D6yq2Myx.js} +1 -1
- package/element/ContentsPage-DCloOu7i.js +1 -0
- package/element/{CuratePage-l_53kq1u.js → CuratePage-C1XBJnxN.js} +1 -1
- package/element/Dialog-Bqed17jN.js +1 -0
- package/element/{DotLottiePlayer-DWbmlHl0.js → DotLottiePlayer-Ciqi1a0X.js} +1 -1
- package/element/EventHeaderAdminButtons-YVIZ2jNS.js +1 -0
- package/element/{FolderBreadcrumb-DgOZR2JO.js → FolderBreadcrumb-C8gAI_F2.js} +1 -1
- package/element/{ForgotPasswordPage-CIz3_X-3.js → ForgotPasswordPage-BLiFYU8r.js} +1 -1
- package/element/{InputField-DybXE_Ab.js → InputField-VxKss-ap.js} +1 -1
- package/element/{LazyLoadImage-8X8b06AJ.js → LazyLoadImage-CJQhdLtk.js} +1 -1
- package/element/{LeaderboardPage-Bphjksy_.js → LeaderboardPage-C_PNMUnE.js} +1 -1
- package/element/LoginPage-BlmrppsE.js +1 -0
- package/element/{NCMVHL6D-CBCgRwdZ.js → NCMVHL6D-Di9F8hV1.js} +1 -1
- package/element/{PublicEvents-RN-_fsl2.js → PublicEvents-C0iy0Ff1.js} +1 -1
- package/element/RegisterPage-BDawpnhD.js +1 -0
- package/element/{SocialLoginButton-DpBl7dWg.js → SocialLoginButton-DCZbdhrb.js} +1 -1
- package/element/{UploadPage-B7BieTEU.js → UploadPage-DKqtebrs.js} +1 -1
- package/element/{VideoPlayer-Bk8Hao3q.js → VideoPlayer-D-zTM_L9.js} +1 -1
- package/element/element.es.js +1 -1
- package/element/{heic2any-DLQd-wQs.js → heic2any-CPi_UmKl.js} +1 -1
- package/element/index-BEtvIXWu.js +1 -0
- package/element/{index-DI8B7D73.js → index-Cg2z7-F2.js} +1 -1
- package/element/index-ar7jHNfV.js +1 -0
- package/element/{index.esm-CAQX5kI5.js → index.esm-DMnv_TeJ.js} +1 -1
- package/element/{photoswipe-Coj-X7bR.js → photoswipe-BaMjvcSX.js} +1 -1
- package/element/styles.css +1 -1
- package/element/{tslib.es6-C9bR68b3.js → tslib.es6-CMp2KRLs.js} +1 -1
- package/element/{useOrgAccess-CnN4aiYB.js → useOrgAccess-59e03fsS.js} +1 -1
- package/element/web.es.js +1 -1
- package/package.json +16 -15
- package/react/0096QSNF.js +1 -0
- package/react/{Y9TU3Znq.js → 0VQzlcgi.js} +1 -1
- package/react/{Pcjql-py.js → BNMtxstZ.js} +1 -1
- package/react/{CfZ5_7x-.js → BYvYuEdt.js} +1 -1
- package/react/{DvDETl8u.js → Bags6A1F.js} +1 -1
- package/react/BozcWsGg.js +1 -0
- package/react/{jRrpvD0D.js → C4OAItgB.js} +1 -1
- package/react/{Dwry3hNI.js → C6KOByxs.js} +1 -1
- package/react/{BO8jvMXn.js → CKtJREoH.js} +1 -1
- package/react/{B1neVlFZ.js → C__pEwjz.js} +1 -1
- package/react/CaxUtbJe.js +1 -0
- package/react/ChmTNpp8.js +1 -0
- package/react/{CZp0lmKh.js → CyG7wrJo.js} +1 -1
- package/react/{D6nR1wv_.js → Cyl2KafN.js} +1 -1
- package/react/{DrqnWQLs.js → D4GskBrt.js} +1 -1
- package/react/{rZy1FKOQ.js → D9rOYW-1.js} +1 -1
- package/react/{Gbk2zO2l.js → DXMc4AHM.js} +1 -1
- package/react/DdTWd9NL.js +1 -0
- package/react/De-cdzUn.js +1 -0
- package/react/{IbMHxVCj.js → DqWiakim.js} +1 -1
- package/react/{DYrfBufu.js → DwbNwe-K.js} +1 -1
- package/react/G275Ly1Q.js +1 -0
- package/react/{Ply2G2qz.js → YYrpqjgS.js} +1 -1
- package/react/index.es.js +1 -2
- package/react/{DyklTvwE.js → sVnMjM13.js} +1 -1
- package/react/styles.css +1 -0
- package/react/{CXu6PHUW.js → zUd27y38.js} +1 -1
- package/umd/web.umd.js +106 -242
- package/element/ContentsPage-BswZWICC.js +0 -16
- package/element/Dialog-xRPAHU1U.js +0 -1
- package/element/EventHeaderAdminButtons-DpqqYPmp.js +0 -10
- package/element/LoginPage-CHzBIQEq.js +0 -1
- package/element/RegisterPage-7WLryyTX.js +0 -1
- package/element/index-DzVrt1C0.js +0 -14
- package/element/index-JyoNGo8S.js +0 -107
- package/react/BbIY3X7C.js +0 -1
- package/react/CN2vdtYT.js +0 -1
- package/react/Cg1c9zqH.js +0 -22
- package/react/DBnzOELO.js +0 -30
- package/react/D_imcCpv.js +0 -16
- package/react/DvOl03h5.js +0 -19
- package/react/fuEo08KS.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,c as t}from"./
|
|
1
|
+
import{j as e,c as t}from"./ChmTNpp8.js";import{useRef as s,useState as r,useCallback as c,useEffect as l}from"react";const n=({src:n,thumbnailUrl:o,playing:a=!1,controls:u=!1,playsInline:i=!0,fit:q="cover",muted:h=!0,showFullscreen:m=!0,onClick:d,onPlay:v,onPause:T,onEnd:p})=>{const w=s(null),x=s(null),[f,g]=r(!0),j=s(typeof window<"u"&&window.matchMedia("(hover: hover)").matches),b=c(()=>{a?T?.():v?.()},[a,T,v]),y=c(()=>{if(!w.current)return;const e=w.current;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen()},[]);return l(()=>{const e=w.current;if(!e)return;const t=()=>{try{a&&e.play().catch(()=>{})}catch(e){console.error("Error handling video play:",e)}};return e.addEventListener("canplay",t),()=>e.removeEventListener("canplay",t)},[a]),l(()=>{const e=w.current;if(e){try{a?(e.play().catch(()=>{}),j.current||(x.current=setTimeout(()=>g(!1),1e3))):(e.pause(),g(!0))}catch(e){console.error("Error controlling video playback:",e)}return()=>{x.current&&(clearTimeout(x.current),x.current=null)}}},[a]),e.jsxs("div",{className:"qc:hover:cursor-pointer qc:relative qc:size-full",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:[e.jsx("video",{ref:w,className:t("qc:size-full",`qc:object-${q}`),src:n,muted:h,poster:o,controls:u,playsInline:i,onEnded:p,onClick:d,children:"Your browser does not support the video tag."}),!u&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"qc:absolute qc:left-0 qc:top-0 qc:flex qc:size-full qc:items-center qc:justify-center",children:f&&e.jsx("button",{onClick:b,className:"qc:text-white","aria-label":a?"Pause":"Play",children:a?e.jsxs("svg",{className:"qc:absolute qc:inset-0 qc:m-auto qc:size-12",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",e.jsx("path",{fill:"white",d:"M16 19q-.825 0-1.412-.587T14 17V7q0-.825.588-1.412T16 5t1.413.588T18 7v10q0 .825-.587 1.413T16 19m-8 0q-.825 0-1.412-.587T6 17V7q0-.825.588-1.412T8 5t1.413.588T10 7v10q0 .825-.587 1.413T8 19"})]}):e.jsxs("svg",{className:"qc:absolute qc:inset-0 qc:m-auto qc:size-12",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",e.jsx("path",{fill:"white",d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})," "]})})}),f&&m&&e.jsx("button",{onClick:y,className:"qc:absolute qc:right-3 qc:top-3 qc:size-8 qc:rounded-lg qc:p-2 qc:text-white","aria-label":"Enter fullscreen",children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"qc:size-6",children:[" ",e.jsx("path",{fill:"currentColor",d:"M5 19h2q.425 0 .713.288T8 20t-.288.713T7 21H4q-.425 0-.712-.288T3 20v-3q0-.425.288-.712T4 16t.713.288T5 17zm14 0v-2q0-.425.288-.712T20 16t.713.288T21 17v3q0 .425-.288.713T20 21h-3q-.425 0-.712-.288T16 20t.288-.712T17 19zM5 5v2q0 .425-.288.713T4 8t-.712-.288T3 7V4q0-.425.288-.712T4 3h3q.425 0 .713.288T8 4t-.288.713T7 5zm14 0h-2q-.425 0-.712-.288T16 4t.288-.712T17 3h3q.425 0 .713.288T21 4v3q0 .425-.288.713T20 8t-.712-.288T19 7z"})," "]})})]})]})};export{n as V};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as a,u as s,j as c,S as e,N as r,g as t,c as q,P as i,T as l,a1 as d,a2 as o}from"./
|
|
1
|
+
import{d as a,u as s,j as c,S as e,N as r,g as t,c as q,P as i,T as l,a1 as d,a2 as o}from"./ChmTNpp8.js";import"react";const n=()=>{const n=a(),{initializing:m,organization:x,user:h}=s();return m?c.jsxs("div",{className:"qc:mx-auto qc:max-w-lg qc:space-y-8 qc:py-8",children:[c.jsx(e,{className:"qc:h-8"}),c.jsx(e,{className:"qc:h-8"}),c.jsx(e,{className:"qc:h-8"}),c.jsx(e,{className:"qc:h-8"})]}):!x||x?.customAuth?null:h?c.jsx(r,{replace:!0,to:n?.state?.referrer||"/"}):c.jsxs("div",{className:"qc:bg-background qc:mx-auto qc:mt-24 qc:min-h-[80vh] qc:max-w-md",children:[c.jsxs("div",{className:"qc:my-8 qc:flex qc:w-full qc:justify-around",children:[c.jsx(t,{to:i.LOGIN,state:n?.state,className:q(n.pathname===i.LOGIN?"qc:border-primary":"qc:border-border","qc:flex-1 qc:border-2 qc:border-x-0 qc:border-t-0 qc:pb-2"),children:c.jsx(l,{variant:"h5",align:"center",children:"Login"})}),c.jsx(t,{to:i.REGISTER,state:n?.state,className:q(n.pathname===i.REGISTER?"qc:border-primary":"qc:border-border","qc:flex-1 qc:border-2 qc:border-x-0 qc:border-t-0 qc:pb-2"),children:c.jsx(l,{variant:"h5",align:"center",children:"Register"})})]}),c.jsx(d,{}),c.jsx("div",{className:"qc:mt-12",children:c.jsx(o,{})})]})};export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{R as e,u as t,e as n,s as r,k as o,i,X as l,j as s,I as a,O as u,U as c,c as d,T as f,d as p,A as m,a as h,Z as g,y as v,P as y}from"./ChmTNpp8.js";import*as b from"react";import w,{useRef as E,useCallback as x,useEffect as T,useState as S,useMemo as O,useLayoutEffect as P,useContext as A,createContext as I,forwardRef as L,Fragment as R,isValidElement as C,cloneElement as F,createElement as M,useId as N,useSyncExternalStore as k}from"react";import{u as D,T as q}from"./DqWiakim.js";import*as _ from"react-dom";import{createPortal as j,flushSync as H}from"react-dom";const V=s=>{const a=e(),{props:{organizationId:u}}=t(),{role:c,isSuper:d}=D(),{isLoading:f,data:p,isError:m,error:h}=n({queryKey:[r.EVENT_IN_REVIEW_COUNT(s?.slug)],queryFn:async()=>{try{const e=await o.get(i.GET_CONTENTS_COUNT,{searchParams:{eventSlug:s?.slug,filter:`status:${l.IN_REVIEW}`},headers:{"x-org-id":u}}).json();if(e.error)throw new Error(e.error);return e.data}catch(e){throw new Error(e?.message||e||"Failed to fetch in review count")}},staleTime:0,enabled:!!c||d});return{loading:f,inReviewCount:p,error:m?h:null,increment:()=>{a.setQueryData([r.EVENT_IN_REVIEW_COUNT(s?.slug)],e=>e+1)},decrement:()=>{a.setQueryData([r.EVENT_IN_REVIEW_COUNT(s?.slug)],e=>e-1)}}},B=e=>e&&e.length>0?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():"",W=typeof document<"u"?w.useLayoutEffect:()=>{};var U;const G=null!==(U=w.useInsertionEffect)&&void 0!==U?U:W;const $=e=>{var t;return null!==(t=e?.ownerDocument)&&void 0!==t?t:document},K=e=>e&&"window"in e&&e.window===e?e:$(e).defaultView||window;function z(e,t){return!(!t||!e)&&e.contains(t)}const Y=(e=document)=>e.activeElement;function Q(e){return e.target}function X(e){var t;if(typeof window>"u"||null==window.navigator)return!1;let n=null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.brands;return Array.isArray(n)&&n.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function J(e){var t;return typeof window<"u"&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}function Z(e){if("test"===process.env.NODE_ENV)return e;let t=null;return()=>(null==t&&(t=e()),t)}const ee=Z(function(){return J(/^Mac/i)}),te=Z(function(){return J(/^iPhone/i)}),ne=Z(function(){return J(/^iPad/i)||ee()&&navigator.maxTouchPoints>1}),re=Z(function(){return te()||ne()});Z(function(){return ee()||re()}),Z(function(){return X(/AppleWebKit/i)&&!oe()});const oe=Z(function(){return X(/Chrome/i)}),ie=Z(function(){return X(/Android/i)});function le(){let e=E(new Map),t=x((t,n,r,o)=>{let i=o?.once?(...t)=>{e.current.delete(r),r(...t)}:r;e.current.set(r,{type:n,eventTarget:t,fn:i,options:o}),t.addEventListener(n,i,o)},[]),n=x((t,n,r,o)=>{var i;let l=(null===(i=e.current.get(r))||void 0===i?void 0:i.fn)||r;t.removeEventListener(n,l,o),e.current.delete(r)},[]),r=x(()=>{e.current.forEach((e,t)=>{n(e.eventTarget,e.type,t,e.options)})},[n]);return T(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function se(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function ae(e){let t=E({isFocused:!1,observer:null});W(()=>{const e=t.current;return()=>{e.observer&&(e.observer.disconnect(),e.observer=null)}},[]);let n=function(e){const t=E(null);return G(()=>{t.current=e},[e]),x((...e)=>{const n=t.current;return n?.(...e)},[])}(t=>{e?.(t)});return x(e=>{if(e.target instanceof HTMLButtonElement||e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||e.target instanceof HTMLSelectElement){t.current.isFocused=!0;let r=e.target,o=e=>{if(t.current.isFocused=!1,r.disabled){let t=se(e);n(t)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};r.addEventListener("focusout",o,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&r.disabled){var e;null===(e=t.current.observer)||void 0===e||e.disconnect();let n=r===document.activeElement?null:document.activeElement;r.dispatchEvent(new FocusEvent("blur",{relatedTarget:n})),r.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:n}))}}),t.current.observer.observe(r,{attributes:!0,attributeFilter:["disabled"]})}},[n])}Z(function(){return X(/Firefox/i)});let ue=null,ce=new Set,de=new Map,fe=!1,pe=!1;const me={Tab:!0,Escape:!0};function he(e,t){for(let n of ce)n(e,t)}function ge(e){fe=!0,function(e){return!(e.metaKey||!ee()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key)}(e)&&(ue="keyboard",he("keyboard",e))}function ve(e){ue="pointer",("mousedown"===e.type||"pointerdown"===e.type)&&(fe=!0,he("pointer",e))}function ye(e){(function(e){return!(""!==e.pointerType||!e.isTrusted)||(ie()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)})(e)&&(fe=!0,ue="virtual")}function be(e){e.target===window||e.target===document||!e.isTrusted||(!fe&&!pe&&(ue="virtual",he("virtual",e)),fe=!1,pe=!1)}function we(){fe=!1,pe=!0}function Ee(e){if(typeof window>"u"||typeof document>"u"||de.get(K(e)))return;const t=K(e),n=$(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){fe=!0,r.apply(this,arguments)},n.addEventListener("keydown",ge,!0),n.addEventListener("keyup",ge,!0),n.addEventListener("click",ye,!0),t.addEventListener("focus",be,!0),t.addEventListener("blur",we,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",ve,!0),n.addEventListener("pointermove",ve,!0),n.addEventListener("pointerup",ve,!0)):"test"===process.env.NODE_ENV&&(n.addEventListener("mousedown",ve,!0),n.addEventListener("mousemove",ve,!0),n.addEventListener("mouseup",ve,!0)),t.addEventListener("beforeunload",()=>{xe(e)},{once:!0}),de.set(t,{focus:r})}const xe=(e,t)=>{const n=K(e),r=$(e);t&&r.removeEventListener("DOMContentLoaded",t),de.has(n)&&(n.HTMLElement.prototype.focus=de.get(n).focus,r.removeEventListener("keydown",ge,!0),r.removeEventListener("keyup",ge,!0),r.removeEventListener("click",ye,!0),n.removeEventListener("focus",be,!0),n.removeEventListener("blur",we,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",ve,!0),r.removeEventListener("pointermove",ve,!0),r.removeEventListener("pointerup",ve,!0)):"test"===process.env.NODE_ENV&&(r.removeEventListener("mousedown",ve,!0),r.removeEventListener("mousemove",ve,!0),r.removeEventListener("mouseup",ve,!0)),de.delete(n))};function Te(){return"pointer"!==ue}typeof document<"u"&&function(e){const t=$(e);let n;"loading"!==t.readyState?Ee(e):(n=()=>{Ee(e)},t.addEventListener("DOMContentLoaded",n))}();const Se=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Oe(e,t,n){Ee(),T(()=>{let t=(t,r)=>{(function(e,t,n){let r=$(n?.target);const o=typeof window<"u"?K(n?.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?K(n?.target).HTMLTextAreaElement:HTMLTextAreaElement,l=typeof window<"u"?K(n?.target).HTMLElement:HTMLElement,s=typeof window<"u"?K(n?.target).KeyboardEvent:KeyboardEvent;return!((e=e||r.activeElement instanceof o&&!Se.has(r.activeElement.type)||r.activeElement instanceof i||r.activeElement instanceof l&&r.activeElement.isContentEditable)&&"keyboard"===t&&n instanceof s&&!me[n.key])})(!!n?.isTextInput,t,r)&&e(Te())};return ce.add(t),()=>{ce.delete(t)}},t)}function Pe(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=E({isFocusWithin:!1}),{addGlobalListener:l,removeAllGlobalListeners:s}=le(),a=x(e=>{e.currentTarget.contains(e.target)&&i.current.isFocusWithin&&!e.currentTarget.contains(e.relatedTarget)&&(i.current.isFocusWithin=!1,s(),n&&n(e),o&&o(!1))},[n,o,i,s]),u=ae(a),c=x(e=>{if(!e.currentTarget.contains(e.target))return;const t=$(e.target),n=Y(t);if(!i.current.isFocusWithin&&n===Q(e.nativeEvent)){r&&r(e),o&&o(!0),i.current.isFocusWithin=!0,u(e);let n=e.currentTarget;l(t,"focus",e=>{if(i.current.isFocusWithin&&!z(n,e.target)){let r=new t.defaultView.FocusEvent("blur",{relatedTarget:e.target});!function(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}(r,n);let o=se(r);a(o)}},{capture:!0})}},[r,o,u,l,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:a}}}let Ae=!1,Ie=0;function Le(){Ae=!0,setTimeout(()=>{Ae=!1},50)}function Re(e){"touch"===e.pointerType&&Le()}function Ce(){if(!(typeof document>"u"))return 0===Ie&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",Re):"test"===process.env.NODE_ENV&&document.addEventListener("touchend",Le)),Ie++,()=>{Ie--,!(Ie>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Re):"test"===process.env.NODE_ENV&&document.removeEventListener("touchend",Le))}}function Fe(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=E({isFocused:!1,isFocusVisible:t||Te()}),[i,l]=S(!1),[s,a]=S(()=>o.current.isFocused&&o.current.isFocusVisible),u=x(()=>a(o.current.isFocused&&o.current.isFocusVisible),[]),c=x(e=>{o.current.isFocused=e,l(e),u()},[u]);Oe(e=>{o.current.isFocusVisible=e,u()},[],{isTextInput:n});let{focusProps:d}=function(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=x(e=>{if(e.target===e.currentTarget)return r&&r(e),o&&o(!1),!0},[r,o]),l=ae(i),s=x(e=>{const t=$(e.target),r=t?Y(t):Y();e.target===e.currentTarget&&r===Q(e.nativeEvent)&&(n&&n(e),o&&o(!0),l(e))},[o,n,l]);return{focusProps:{onFocus:!t&&(n||o||r)?s:void 0,onBlur:t||!r&&!o?void 0:i}}}({isDisabled:r,onFocusChange:c}),{focusWithinProps:f}=Pe({isDisabled:!r,onFocusWithinChange:c});return{isFocused:i,isFocusVisible:s,focusProps:r?f:d}}var Me=Object.defineProperty,Ne=(e,t,n)=>(((e,t,n)=>{t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);let ke=new class{constructor(){Ne(this,"current",this.detect()),Ne(this,"handoffState","pending"),Ne(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}};function De(e){var t;return ke.isServer?null:null==e?document:null!=(t=e?.ownerDocument)?t:document}function qe(e){var t,n;return ke.isServer?null:null==e?document:null!=(n=null==(t=e?.getRootNode)?void 0:t.call(e))?n:document}function _e(e){var t,n;return null!=(n=null==(t=qe(e))?void 0:t.activeElement)?n:null}function je(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}function He(){let e=[],t={addEventListener:(e,n,r,o)=>(e.addEventListener(n,r,o),t.add(()=>e.removeEventListener(n,r,o))),requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add(()=>cancelAnimationFrame(n))},nextFrame:(...e)=>t.requestAnimationFrame(()=>t.requestAnimationFrame(...e)),setTimeout(...e){let n=setTimeout(...e);return t.add(()=>clearTimeout(n))},microTask(...e){let n={current:!0};return je(()=>{n.current&&e[0]()}),t.add(()=>{n.current=!1})},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add(()=>{Object.assign(e.style,{[t]:r})})},group(e){let t=He();return e(t),this.add(()=>t.dispose())},add:t=>(e.includes(t)||e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}),dispose(){for(let t of e.splice(0))t()}};return t}function Ve(){let[e]=S(He);return T(()=>()=>e.dispose(),[e]),e}let Be=(e,t)=>{ke.isServer?T(e,t):P(e,t)};function We(e){let t=E(e);return Be(()=>{t.current=e},[e]),t}let Ue=function(e){let t=We(e);return w.useCallback((...e)=>t.current(...e),[t])};function Ge(e){return O(()=>e,Object.values(e))}let $e=I(void 0);function Ke(){return A($e)}function ze(...e){return Array.from(new Set(e.flatMap(e=>"string"==typeof e?e.split(" "):[]))).filter(Boolean).join(" ")}function Ye(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Ye),r}var Qe,Xe=((Qe=Xe||{})[Qe.None=0]="None",Qe[Qe.RenderStrategy=1]="RenderStrategy",Qe[Qe.Static=2]="Static",Qe),Je=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Je||{});function Ze(){let e=function(){let e=E([]),t=x(t=>{for(let n of e.current)null!=n&&("function"==typeof n?n(t):n.current=t)},[]);return(...n)=>{if(!n.every(e=>null==e))return e.current=n,t}}();return x(t=>function({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:l,mergeRefs:s}){s=s??tt;let a=nt(t,e);if(i)return et(a,n,r,l,s);let u=o??0;if(2&u){let{static:e=!1,...t}=a;if(e)return et(t,n,r,l,s)}if(1&u){let{unmount:e=!0,...t}=a;return Ye(e?0:1,{0:()=>null,1:()=>et({...t,hidden:!0,style:{display:"none"}},n,r,l,s)})}return et(a,n,r,l,s)}({mergeRefs:e,...t}),[e])}function et(e,t={},n,r,o){let{as:i=n,children:l,refName:s="ref",...a}=lt(e,["unmount","static"]),u=void 0!==e.ref?{[s]:e.ref}:{},c="function"==typeof l?l(t):l;"className"in a&&a.className&&"function"==typeof a.className&&(a.className=a.className(t)),a["aria-labelledby"]&&a["aria-labelledby"]===a.id&&(a["aria-labelledby"]=void 0);let d={};if(t){let e=!1,n=[];for(let[r,o]of Object.entries(t))"boolean"==typeof o&&(e=!0),!0===o&&n.push(r.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`));if(e){d["data-headlessui-state"]=n.join(" ");for(let e of n)d[`data-${e}`]=""}}if(at(i)&&(Object.keys(it(a)).length>0||Object.keys(it(d)).length>0)){if(!(!C(c)||Array.isArray(c)&&c.length>1||function(e){return at(e.type)}(c))){let e=c.props,t=e?.className,n="function"==typeof t?(...e)=>ze(t(...e),a.className):ze(t,a.className),r=n?{className:n}:{},i=nt(c.props,it(lt(a,["ref"])));for(let e in d)e in i&&delete d[e];return F(c,Object.assign({},i,d,u,{ref:o(st(c),u.ref)},r))}if(Object.keys(it(a)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(it(a)).concat(Object.keys(it(d))).map(e=>` - ${e}`).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(e=>` - ${e}`).join("\n")].join("\n"))}return M(i,Object.assign({},lt(a,["ref"]),!at(i)&&u,!at(i)&&d),c)}function tt(...e){return e.every(e=>null==e)?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}function nt(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])for(let e in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(e)&&(n[e]=[e=>{var t;return null==(t=e?.preventDefault)?void 0:t.call(e)}]);for(let e in n)Object.assign(t,{[e](t,...r){let o=n[e];for(let e of o){if((t instanceof Event||t?.nativeEvent instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function rt(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];for(let e in n)Object.assign(t,{[e](...t){let r=n[e];for(let e of r)e?.(...t)}});return t}function ot(e){var t;return Object.assign(L(e),{displayName:null!=(t=e.displayName)?t:e.name})}function it(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function lt(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}function st(e){return w.version.split(".")[0]>="19"?e.props.ref:e.ref}function at(e){return e===R||e===Symbol.for("react.fragment")}let ut=I(void 0);function ct(e){return"object"==typeof e&&null!==e&&"nodeType"in e}function dt(e){return ct(e)&&"tagName"in e}function ft(e){return dt(e)&&"accessKey"in e}function pt(e){return dt(e)&&"tabIndex"in e}function mt(e){return ft(e)&&"INPUT"===e.nodeName}function ht(e){return ft(e)&&"LABEL"===e.nodeName}function gt(e){return ft(e)&&"FIELDSET"===e.nodeName}function vt(e){return ft(e)&&"LEGEND"===e.nodeName}function yt(e){let t=e.parentElement,n=null;for(;t&&!gt(t);)vt(t)&&(n=t),t=t.parentElement;let r=""===t?.getAttribute("disabled");return(!r||!function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(vt(t))return!1;t=t.previousElementSibling}return!0}(n))&&r}let bt=Symbol();function wt(...e){let t=E(e);T(()=>{t.current=e},[e]);let n=Ue(e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)});return e.every(e=>null==e||e?.[bt])?void 0:n}let Et=I(null);function xt(){let e=A(Et);if(null===e){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,xt),e}return e}Et.displayName="DescriptionContext";let Tt=ot(function(e,t){let n=N(),r=Ke(),{id:o=`headlessui-description-${n}`,...i}=e,l=xt(),s=wt(t);Be(()=>l.register(o),[o,l.register]);let a=Ge({...l.slot,disabled:r||!1}),u={ref:s,...l.props,id:o};return Ze()({ourProps:u,theirProps:i,slot:a,defaultTag:"p",name:l.name||"Description"})});Object.assign(Tt,{});var St=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(St||{});let Ot=I(null);function Pt(){let e=A(Ot);if(null===e){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,Pt),e}return e}function At({inherit:e=!1}={}){let t=function(){var e,t;let n=null!=(t=null==(e=A(Ot))?void 0:e.value)?t:void 0;return n}(),[n,r]=S([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,O(()=>function(e){let t=Ue(e=>(r(t=>[...t,e]),()=>r(t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))),n=O(()=>({register:t,slot:e.slot,name:e.name,props:e.props,value:e.value}),[t,e.slot,e.name,e.props,e.value]);return w.createElement(Ot.Provider,{value:n},e.children)},[r])]}Ot.displayName="LabelContext";let It=ot(function(e,t){var n;let r=N(),o=Pt(),i=A(ut),l=Ke(),{id:s=`headlessui-label-${r}`,htmlFor:a=i??(null==(n=o.props)?void 0:n.htmlFor),passive:u=!1,...c}=e,d=wt(t);Be(()=>o.register(s),[s,o.register]);let f=Ue(e=>{let t=e.currentTarget;if((e.target===e.currentTarget||!function(e){return!!dt(e)&&e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]')}(e.target))&&(ht(t)&&e.preventDefault(),o.props&&"onClick"in o.props&&"function"==typeof o.props.onClick&&o.props.onClick(e),ht(t))){let e=document.getElementById(t.htmlFor);if(e){let t=e.getAttribute("disabled");if("true"===t||""===t)return;let n=e.getAttribute("aria-disabled");if("true"===n||""===n)return;(mt(e)&&("file"===e.type||"radio"===e.type||"checkbox"===e.type)||"radio"===e.role||"checkbox"===e.role||"switch"===e.role)&&e.click(),e.focus({preventScroll:!0})}}}),p=Ge({...o.slot,disabled:l||!1}),m={ref:d,...o.props,id:s,htmlFor:a,onClick:f};return u&&("onClick"in m&&(delete m.htmlFor,delete m.onClick),"onClick"in c&&delete c.onClick),Ze()({ourProps:m,theirProps:c,slot:p,defaultTag:a?"label":"div",name:o.name||"Label"})});function Lt(e){if(null===e)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Rt(e,t,n=!1){let[r,o]=S(()=>Lt(t));return Be(()=>{if(!t||!e)return;let n=He();return n.requestAnimationFrame(function e(){n.requestAnimationFrame(e),o(e=>{let n=Lt(t);return n.width===e.width&&n.height===e.height?e:n})}),()=>{n.dispose()}},[t,e]),n?{width:`${r.width}px`,height:`${r.height}px`}:r}Object.assign(It,{});var Ct=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(Ct||{});let Ft=class extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return void 0===t&&(t=this.factory(e),this.set(e,t)),t}};var Mt,Nt,kt,Dt=Object.defineProperty,qt=(e,t,n)=>(((e,t,n)=>{t in e?Dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,t+"",n),n),_t=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},jt=(e,t,n)=>(_t(e,t,"read from private field"),n?n.call(e):t.get(e)),Ht=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Vt=(e,t,n,r)=>(_t(e,t,"write to private field"),t.set(e,n),n);let Bt=class{constructor(e){Ht(this,Mt,{}),Ht(this,Nt,new Ft(()=>new Set)),Ht(this,kt,new Set),qt(this,"disposables",He()),Vt(this,Mt,e),ke.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return jt(this,Mt)}subscribe(e,t){if(ke.isServer)return()=>{};let n={selector:e,callback:t,current:e(jt(this,Mt))};return jt(this,kt).add(n),this.disposables.add(()=>{jt(this,kt).delete(n)})}on(e,t){return ke.isServer?()=>{}:(jt(this,Nt).get(e).add(t),this.disposables.add(()=>{jt(this,Nt).get(e).delete(t)}))}send(e){let t=this.reduce(jt(this,Mt),e);if(t!==jt(this,Mt)){Vt(this,Mt,t);for(let e of jt(this,kt)){let t=e.selector(jt(this,Mt));Wt(e.current,t)||(e.current=t,e.callback(t))}for(let t of jt(this,Nt).get(e.type))t(jt(this,Mt),e)}}};function Wt(e,t){return!!Object.is(e,t)||"object"==typeof e&&null!==e&&"object"==typeof t&&null!==t&&(Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&Ut(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size===t.size&&Ut(e.entries(),t.entries()):!(!Gt(e)||!Gt(t))&&Ut(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()))}function Ut(e,t){for(;;){let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}}function Gt(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return null===t||null===Object.getPrototypeOf(t)}function $t(e){let[t,n]=e(),r=He();return(...e)=>{t(...e),r.dispose(),r.microTask(n)}}Mt=new WeakMap,Nt=new WeakMap,kt=new WeakMap;var Kt=Object.defineProperty,zt=(e,t,n)=>(((e,t,n)=>{t in e?Kt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),Yt=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(Yt||{});let Qt={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(-1!==o){let t=e.stack.slice();return t.splice(o,1),t.push(n),r=t,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(-1===r)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}},Xt=class e extends Bt{constructor(){super(...arguments),zt(this,"actions",{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),zt(this,"selectors",{isTop:(e,t)=>e.stack[e.stack.length-1]===t,inStack:(e,t)=>e.stack.includes(t)})}static new(){return new e({stack:[]})}reduce(e,t){return Ye(t.type,Qt,e,t)}};const Jt=new Ft(()=>Xt.new());var Zt,en={exports:{}},tn={};var nn,rn,on={};var ln=(rn||(rn=1,"production"===process.env.NODE_ENV?en.exports=function(){if(Zt)return tn;Zt=1;var e=w,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useSyncExternalStore,r=e.useRef,o=e.useEffect,i=e.useMemo,l=e.useDebugValue;return tn.useSyncExternalStoreWithSelector=function(e,s,a,u,c){var d=r(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=i(function(){function e(e){if(!o){if(o=!0,n=e,e=u(e),void 0!==c&&f.hasValue){var i=f.value;if(c(i,e))return r=i}return r=e}if(i=r,t(n,e))return i;var l=u(e);return void 0!==c&&c(i,l)?(n=e,i):(n=e,r=l)}var n,r,o=!1,i=void 0===a?null:a;return[function(){return e(s())},null===i?void 0:function(){return e(i())}]},[s,a,u,c]);var p=n(e,d[0],d[1]);return o(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},tn}():en.exports=(nn||(nn=1,"production"!==process.env.NODE_ENV&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=w,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useSyncExternalStore,r=e.useRef,o=e.useEffect,i=e.useMemo,l=e.useDebugValue;on.useSyncExternalStoreWithSelector=function(e,s,a,u,c){var d=r(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=i(function(){function e(e){if(!o){if(o=!0,n=e,e=u(e),void 0!==c&&f.hasValue){var i=f.value;if(c(i,e))return r=i}return r=e}if(i=r,t(n,e))return i;var l=u(e);return void 0!==c&&c(i,l)?(n=e,i):(n=e,r=l)}var n,r,o=!1,i=void 0===a?null:a;return[function(){return e(s())},null===i?void 0:function(){return e(i())}]},[s,a,u,c]);var p=n(e,d[0],d[1]);return o(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),on)),en.exports);function sn(e,t,n=Wt){return ln.useSyncExternalStoreWithSelector(Ue(t=>e.subscribe(an,t)),Ue(()=>e.state),Ue(()=>e.state),Ue(t),n)}function an(e){return e}function un(e,t){let n=N(),r=Jt.get(t),[o,i]=sn(r,x(e=>[r.selectors.isTop(e,n),r.selectors.inStack(e,n)],[r,n]));return Be(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),!!e&&(!i||o)}let cn=new Map,dn=new Map;function fn(e){var t;let n=null!=(t=dn.get(e))?t:0;return dn.set(e,n+1),0!==n||(cn.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0),()=>pn(e)}function pn(e){var t;let n=null!=(t=dn.get(e))?t:1;if(1===n?dn.delete(e):dn.set(e,n-1),1!==n)return;let r=cn.get(e);r&&(null===r["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,cn.delete(e))}let mn=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),hn=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var gn=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(gn||{}),vn=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(vn||{}),yn=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(yn||{});function bn(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(mn)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var wn=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(wn||{});function En(e,t=0){var n;return e!==(null==(n=De(e))?void 0:n.body)&&Ye(t,{0:()=>e.matches(mn),1(){let t=e;for(;null!==t;){if(t.matches(mn))return!0;t=t.parentElement}return!1}})}function xn(e){He().nextFrame(()=>{let t=_e(e);t&&pt(t)&&!En(t,0)&&function(e){e?.focus({preventScroll:!0})}(e)})}var Tn=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Tn||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{1===e.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===e.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let Sn=["textarea","input"].join(",");function On(e,t=e=>e){return e.slice().sort((e,n)=>{let r=t(e),o=t(n);if(null===r||null===o)return 0;let i=r.compareDocumentPosition(o);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Pn(e,t,n=(null===e?document.body:qe(e))){return function(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?qe(e[0]):document:qe(e),l=Array.isArray(e)?n?On(e):e:64&t?function(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(hn)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}(e):bn(e);o.length>0&&l.length>1&&(l=l.filter(e=>!o.some(t=>null!=t&&"current"in t?t?.current===e:t===e))),r=r??i?.activeElement;let s,a=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,l.indexOf(r))-1;if(4&t)return Math.max(0,l.indexOf(r))+1;if(8&t)return l.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=32&t?{preventScroll:!0}:{},d=0,f=l.length;do{if(d>=f||d+f<=0)return 0;let e=u+d;if(16&t)e=(e+f)%f;else{if(e<0)return 3;if(e>=f)return 1}s=l[e],s?.focus(c),d+=a}while(s!==_e(s));return 6&t&&function(e){var t,n;return null!=(n=null==(t=e?.matches)?void 0:t.call(e,Sn))&&n}(s)&&s.select(),2}(bn(n),t,{relativeTo:e})}function An(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function In(){return An()||/Android/gi.test(window.navigator.userAgent)}function Ln(e,t,n,r){let o=We(n);T(()=>{if(e)return document.addEventListener(t,n,r),()=>document.removeEventListener(t,n,r);function n(e){o.current(e)}},[e,t,r])}function Rn(e,t,n){let r=We(n),o=x(function(e,n){if(e.defaultPrevented)return;let o=n(e);if(null===o||!o.getRootNode().contains(o)||!o.isConnected)return;let i=function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(t);for(let t of i)if(null!==t&&(t.contains(o)||e.composed&&e.composedPath().includes(t)))return;return!En(o,wn.Loose)&&-1!==o.tabIndex&&e.preventDefault(),r.current(e,o)},[r,t]),i=E(null);Ln(e,"pointerdown",e=>{var t,n;In()||(i.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)},!0),Ln(e,"pointerup",e=>{if(In()||!i.current)return;let t=i.current;return i.current=null,o(e,()=>t)},!0);let l=E({x:0,y:0});Ln(e,"touchstart",e=>{l.current.x=e.touches[0].clientX,l.current.y=e.touches[0].clientY},!0),Ln(e,"touchend",e=>{let t=e.changedTouches[0].clientX,n=e.changedTouches[0].clientY;if(!(Math.abs(t-l.current.x)>=30||Math.abs(n-l.current.y)>=30))return o(e,()=>pt(e.target)?e.target:null)},!0),function(e,t,n,r){let o=We(n);T(()=>{if(e)return window.addEventListener(t,n,r),()=>window.removeEventListener(t,n,r);function n(e){o.current(e)}},[e,t,r])}(e,"blur",e=>o(e,()=>function(e){return ft(e)&&"IFRAME"===e.nodeName}(window.document.activeElement)?window.document.activeElement:null),!0)}function Cn(...e){return O(()=>De(...e),[...e])}var Fn=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(Fn||{});const Mn={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}};function Nn(e,t){return O(()=>{var n;if(e.type)return e.type;let r=null!=(n=e.as)?n:"button";return"string"==typeof r&&"button"===r.toLowerCase()||"BUTTON"===t?.tagName&&!t.hasAttribute("type")?"button":void 0},[e.type,e.as,t])}function kn(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=null!=(n=t.defaultView)?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),i=Math.max(0,e-o);n.style(r,"paddingRight",`${i}px`)}}}function Dn(){return An()?{before({doc:e,d:t,meta:n}){function r(e){for(let t of n().containers)for(let n of t())if(n.contains(e))return!0;return!1}t.microTask(()=>{var n;if("auto"!==window.getComputedStyle(e.documentElement).scrollBehavior){let n=He();n.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>n.dispose()))}let o=null!=(n=window.scrollY)?n:window.pageYOffset,i=null;t.addEventListener(e,"click",t=>{if(pt(t.target))try{let n=t.target.closest("a");if(!n)return;let{hash:o}=new URL(n.href),l=e.querySelector(o);pt(l)&&!r(l)&&(i=l)}catch{}},!0),t.group(n=>{t.addEventListener(e,"touchstart",e=>{if(n.dispose(),pt(e.target)&&function(e){return dt(e)&&"style"in e}(e.target))if(r(e.target)){let t=e.target;for(;t.parentElement&&r(t.parentElement);)t=t.parentElement;n.style(t,"overscrollBehavior","contain")}else n.style(e.target,"touchAction","none")})}),t.addEventListener(e,"touchmove",e=>{if(pt(e.target)){if(mt(e.target))return;if(r(e.target)){let t=e.target;for(;t.parentElement&&""!==t.dataset.headlessuiPortal&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;""===t.dataset.headlessuiPortal&&e.preventDefault()}else e.preventDefault()}},{passive:!1}),t.add(()=>{var e;let t=null!=(e=window.scrollY)?e:window.pageYOffset;o!==t&&window.scrollTo(0,o),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{}}function qn(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let _n=function(e,t){let n=e(),r=new Set;return{getSnapshot:()=>n,subscribe:e=>(r.add(e),()=>r.delete(e)),dispatch(e,...o){let i=t[e].call(n,...o);i&&(n=i,r.forEach(e=>e()))}}}(()=>new Map,{PUSH(e,t){var n;let r=null!=(n=this.get(e))?n:{doc:e,count:0,d:He(),meta:new Set,computedMeta:{}};return r.count++,r.meta.add(t),r.computedMeta=qn(r.meta),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=qn(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta:()=>e.computedMeta},n=[Dn(),kn(),{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}];n.forEach(({before:e})=>e?.(t)),n.forEach(({after:e})=>e?.(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});function jn(e,t,n=()=>({containers:[]})){let r=function(e){return k(e.subscribe,e.getSnapshot,e.getSnapshot)}(_n),o=t?r.get(t):void 0,i=!!o&&o.count>0;return Be(()=>{if(t&&e)return _n.dispatch("PUSH",t,n),()=>_n.dispatch("POP",t,n)},[e,t]),i}function Hn(e){return[e.screenX,e.screenY]}var Vn,Bn;_n.subscribe(()=>{let e=_n.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e="hidden"===t.get(n.doc),r=0!==n.count;(r&&!e||!r&&e)&&_n.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),0===n.count&&_n.dispatch("TEARDOWN",n)}}),typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&"test"===(null==(Vn=null==process?void 0:process.env)?void 0:Vn.NODE_ENV)&&typeof(null==(Bn=Element?.prototype)?void 0:Bn.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join("\n")),[]});var Wn=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(Wn||{});function Un(e){let t={};for(let n in e)!0===e[n]&&(t[`data-${n}`]="");return t}function Gn(e,t,n,r){let[o,i]=S(n),{hasFlag:l,addFlag:s,removeFlag:a}=function(e=0){let[t,n]=S(e),r=x(e=>n(e),[]),o=x(e=>n(t=>t|e),[]),i=x(e=>(t&e)===e,[t]),l=x(e=>n(t=>t&~e),[]),s=x(e=>n(t=>t^e),[]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:l,toggleFlag:s}}(e&&o?3:0),u=E(!1),c=E(!1),d=Ve();return Be(()=>{var o;if(e)return n&&i(!0),t?(null==(o=r?.start)||o.call(r,n),function(e,{prepare:t,run:n,done:r,inFlight:o}){let i=He();return function(e,{inFlight:t,prepare:n}){if(null!=t&&t.current)return void n();let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{n(),i.requestAnimationFrame(()=>{i.add(function(e,t){var n,r;let o=He();if(!e)return o.dispose;let i=!1;o.add(()=>{i=!0});let l=null!=(r=null==(n=e.getAnimations)?void 0:n.call(e).filter(e=>e instanceof CSSTransition))?r:[];return 0===l.length?(t(),o.dispose):(Promise.allSettled(l.map(e=>e.finished)).then(()=>{i||t()}),o.dispose)}(e,r))})}),i.dispose}(t,{inFlight:u,prepare(){c.current?c.current=!1:c.current=u.current,u.current=!0,!c.current&&(n?(s(3),a(4)):(s(4),a(2)))},run(){c.current?n?(a(3),s(4)):(a(4),s(3)):n?a(1):s(1)},done(){var e;c.current&&function(e){var t,n;return(null!=(n=null==(t=e.getAnimations)?void 0:t.call(e))?n:[]).some(e=>e instanceof CSSTransition&&"finished"!==e.playState)}(t)||(u.current=!1,a(7),n||i(!1),null==(e=r?.end)||e.call(r,n))}})):void(n&&s(3))},[e,n,t,d]),e?[o,{closed:l(1),enter:l(2),leave:l(4),transition:l(2)||l(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function $n(){return typeof window<"u"}function Kn(e){return Qn(e)?(e.nodeName||"").toLowerCase():"#document"}function zn(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Yn(e){var t;return null==(t=(Qn(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Qn(e){return!!$n()&&(e instanceof Node||e instanceof zn(e).Node)}function Xn(e){return!!$n()&&(e instanceof Element||e instanceof zn(e).Element)}function Jn(e){return!!$n()&&(e instanceof HTMLElement||e instanceof zn(e).HTMLElement)}function Zn(e){return!(!$n()||typeof ShadowRoot>"u")&&(e instanceof ShadowRoot||e instanceof zn(e).ShadowRoot)}const er=new Set(["inline","contents"]);function tr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=pr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!er.has(o)}const nr=new Set(["table","td","th"]);function rr(e){return nr.has(Kn(e))}const or=[":popover-open",":modal"];function ir(e){return or.some(t=>{try{return e.matches(t)}catch{return!1}})}const lr=["transform","translate","scale","rotate","perspective"],sr=["transform","translate","scale","rotate","perspective","filter"],ar=["paint","layout","strict","content"];function ur(e){const t=cr(),n=Xn(e)?pr(e):e;return lr.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||sr.some(e=>(n.willChange||"").includes(e))||ar.some(e=>(n.contain||"").includes(e))}function cr(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const dr=new Set(["html","body","#document"]);function fr(e){return dr.has(Kn(e))}function pr(e){return zn(e).getComputedStyle(e)}function mr(e){return Xn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hr(e){if("html"===Kn(e))return e;const t=e.assignedSlot||e.parentNode||Zn(e)&&e.host||Yn(e);return Zn(t)?t.host:t}function gr(e){const t=hr(e);return fr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Jn(t)&&tr(t)?t:gr(t)}function vr(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=gr(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=zn(o);if(i){const e=yr(l);return t.concat(l,l.visualViewport||[],tr(o)?o:[],e&&n?vr(e):[])}return t.concat(o,vr(o,[],n))}function yr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const br=["top","right","bottom","left"],wr=Math.min,Er=Math.max,xr=Math.round,Tr=Math.floor,Sr=e=>({x:e,y:e}),Or={left:"right",right:"left",bottom:"top",top:"bottom"},Pr={start:"end",end:"start"};function Ar(e,t,n){return Er(e,wr(t,n))}function Ir(e,t){return"function"==typeof e?e(t):e}function Lr(e){return e.split("-")[0]}function Rr(e){return e.split("-")[1]}function Cr(e){return"x"===e?"y":"x"}function Fr(e){return"y"===e?"height":"width"}const Mr=new Set(["top","bottom"]);function Nr(e){return Mr.has(Lr(e))?"y":"x"}function kr(e){return Cr(Nr(e))}function Dr(e){return e.replace(/start|end/g,e=>Pr[e])}const qr=["left","right"],_r=["right","left"],jr=["top","bottom"],Hr=["bottom","top"];function Vr(e,t,n,r){const o=Rr(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?_r:qr:t?qr:_r;case"left":case"right":return t?jr:Hr;default:return[]}}(Lr(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(Dr)))),i}function Br(e){return e.replace(/left|right|bottom|top/g,e=>Or[e])}function Wr(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Ur(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Gr(e,t,n){let{reference:r,floating:o}=e;const i=Nr(t),l=kr(t),s=Fr(l),a=Lr(t),u="y"===i,c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/2;let p;switch(a){case"top":p={x:c,y:r.y-o.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Rr(t)){case"start":p[l]-=f*(n&&u?-1:1);break;case"end":p[l]+=f*(n&&u?-1:1)}return p}async function $r(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:s,strategy:a}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Ir(t,e),m=Wr(p),h=s[f?"floating"===d?"reference":"floating":d],g=Ur(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:a})),v="floating"===d?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},w=Ur(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:a}):v);return{top:(g.top-w.top+m.top)/b.y,bottom:(w.bottom-g.bottom+m.bottom)/b.y,left:(g.left-w.left+m.left)/b.x,right:(w.right-g.right+m.right)/b.x}}function Kr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zr(e){return br.some(t=>e[t]>=0)}const Yr=new Set(["left","top"]);function Qr(e){const t=pr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Jn(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,s=xr(n)!==i||xr(r)!==l;return s&&(n=i,r=l),{width:n,height:r,$:s}}function Xr(e){return Xn(e)?e:e.contextElement}function Jr(e){const t=Xr(e);if(!Jn(t))return Sr(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Qr(t);let l=(i?xr(n.width):n.width)/r,s=(i?xr(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const Zr=Sr(0);function eo(e){const t=zn(e);return cr()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Zr}function to(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Xr(e);let l=Sr(1);t&&(r?Xn(r)&&(l=Jr(r)):l=Jr(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==zn(e))&&t}(i,n,r)?eo(i):Sr(0);let a=(o.left+s.x)/l.x,u=(o.top+s.y)/l.y,c=o.width/l.x,d=o.height/l.y;if(i){const e=zn(i),t=r&&Xn(r)?zn(r):r;let n=e,o=yr(n);for(;o&&r&&t!==n;){const e=Jr(o),t=o.getBoundingClientRect(),r=pr(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;a*=e.x,u*=e.y,c*=e.x,d*=e.y,a+=i,u+=l,n=zn(o),o=yr(n)}}return Ur({width:c,height:d,x:a,y:u})}function no(e,t){const n=mr(e).scrollLeft;return t?t.left+n:to(Yn(e)).left+n}function ro(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-no(e,n),y:n.top+t.scrollTop}}const oo=new Set(["absolute","fixed"]);function io(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=zn(e),r=Yn(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,s=0,a=0;if(o){i=o.width,l=o.height;const e=cr();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,a=o.offsetTop)}const u=no(r);if(u<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,l=Math.abs(r.clientWidth-t.clientWidth-o);l<=25&&(i-=l)}else u<=25&&(i+=u);return{width:i,height:l,x:s,y:a}}(e,n);else if("document"===t)r=function(e){const t=Yn(e),n=mr(e),r=e.ownerDocument.body,o=Er(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Er(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+no(e);const s=-n.scrollTop;return"rtl"===pr(r).direction&&(l+=Er(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:s}}(Yn(e));else if(Xn(t))r=function(e,t){const n=to(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Jn(e)?Jr(e):Sr(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=eo(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ur(r)}function lo(e,t){const n=hr(e);return!(n===t||!Xn(n)||fr(n))&&("fixed"===pr(n).position||lo(n,t))}function so(e,t){const n=t.get(e);if(n)return n;let r=vr(e,[],!1).filter(e=>Xn(e)&&"body"!==Kn(e)),o=null;const i="fixed"===pr(e).position;let l=i?hr(e):e;for(;Xn(l)&&!fr(l);){const t=pr(l),n=ur(l);!n&&"fixed"===t.position&&(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&oo.has(o.position)||tr(l)&&!n&&lo(e,l))?r=r.filter(e=>e!==l):o=t,l=hr(l)}return t.set(e,r),r}function ao(e,t,n){const r=Jn(t),o=Yn(t),i="fixed"===n,l=to(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const a=Sr(0);function u(){a.x=no(o)}if(r||!r&&!i)if(("body"!==Kn(t)||tr(o))&&(s=mr(t)),r){const e=to(t,!0,i,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&u();i&&!r&&o&&u();const c=!o||r||i?Sr(0):ro(o,s);return{x:l.left+s.scrollLeft-a.x-c.x,y:l.top+s.scrollTop-a.y-c.y,width:l.width,height:l.height}}function uo(e){return"static"===pr(e).position}function co(e,t){if(!Jn(e)||"fixed"===pr(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Yn(e)===n&&(n=n.ownerDocument.body),n}function fo(e,t){const n=zn(e);if(ir(e))return n;if(!Jn(e)){let t=hr(e);for(;t&&!fr(t);){if(Xn(t)&&!uo(t))return t;t=hr(t)}return n}let r=co(e,t);for(;r&&rr(r)&&uo(r);)r=co(r,t);return r&&fr(r)&&uo(r)&&!ur(r)?n:r||function(e){let t=hr(e);for(;Jn(t)&&!fr(t);){if(ur(t))return t;if(ir(t))return null;t=hr(t)}return null}(e)||n}const po={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=Yn(r),s=!!t&&ir(t.floating);if(r===l||s&&i)return n;let a={scrollLeft:0,scrollTop:0},u=Sr(1);const c=Sr(0),d=Jn(r);if((d||!d&&!i)&&(("body"!==Kn(r)||tr(l))&&(a=mr(r)),Jn(r))){const e=to(r);u=Jr(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}const f=!l||d||i?Sr(0):ro(l,a);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-a.scrollTop*u.y+c.y+f.y}},getDocumentElement:Yn,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?ir(t)?[]:so(t,this._c):[].concat(n),r],l=i[0],s=i.reduce((e,n)=>{const r=io(t,n,o);return e.top=Er(r.top,e.top),e.right=wr(r.right,e.right),e.bottom=wr(r.bottom,e.bottom),e.left=Er(r.left,e.left),e},io(t,l,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:fo,getElementRects:async function(e){const t=this.getOffsetParent||fo,n=this.getDimensions,r=await n(e.floating);return{reference:ao(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Qr(e);return{width:t,height:n}},getScale:Jr,isElement:Xn,isRTL:function(e){return"rtl"===pr(e).direction}};function mo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ho(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:a=!1}=r,u=Xr(e),c=o||i?[...u?vr(u):[],...vr(t)]:[];c.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=u&&s?function(e,t){let n,r=null;const o=Yn(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function l(s,a){void 0===s&&(s=!1),void 0===a&&(a=1),i();const u=e.getBoundingClientRect(),{left:c,top:d,width:f,height:p}=u;if(s||t(),!f||!p)return;const m={rootMargin:-Tr(d)+"px "+-Tr(o.clientWidth-(c+f))+"px "+-Tr(o.clientHeight-(d+p))+"px "+-Tr(c)+"px",threshold:Er(0,wr(1,a))||1};let h=!0;function g(t){const r=t[0].intersectionRatio;if(r!==a){if(!h)return l();r?l(!1,r):n=setTimeout(()=>{l(!1,1e-7)},1e3)}1===r&&!mo(u,e.getBoundingClientRect())&&l(),h=!1}try{r=new IntersectionObserver(g,{...m,root:o.ownerDocument})}catch{r=new IntersectionObserver(g,m)}r.observe(e)}(!0),i}(u,n):null;let f=-1,p=null;l&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),n()}),u&&!a&&p.observe(u),p.observe(t));let m,h=a?to(e):null;return a&&function t(){const r=to(e);h&&!mo(h,r)&&n(),h=r,m=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),d?.(),null==(e=p)||e.disconnect(),p=null,a&&cancelAnimationFrame(m)}}const go=$r,vo=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:s}=t,a=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=Lr(n),s=Rr(n),a="y"===Nr(n),u=Yr.has(l)?-1:1,c=i&&a?-1:1,d=Ir(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof m&&(p="end"===s?-1*m:m),a?{x:p*c,y:f*u}:{x:f*u,y:p*c}}(t,e);return l===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+a.x,y:i+a.y,data:{...a,placement:l}}}}},yo=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...a}=Ir(e,t),u={x:n,y:r},c=await $r(t,a),d=Nr(Lr(o)),f=Cr(d);let p=u[f],m=u[d];if(i){const e="y"===f?"bottom":"right";p=Ar(p+c["y"===f?"top":"left"],p,p-c[e])}if(l){const e="y"===d?"bottom":"right";m=Ar(m+c["y"===d?"top":"left"],m,m-c[e])}const h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:i,[d]:l}}}}}},bo=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:s,platform:a,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...g}=Ir(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=Lr(o),y=Nr(s),b=Lr(s)===s,w=await(null==a.isRTL?void 0:a.isRTL(u.floating)),E=f||(b||!h?[Br(s)]:function(e){const t=Br(e);return[Dr(e),t,Dr(t)]}(s)),x="none"!==m;!f&&x&&E.push(...Vr(s,h,m,w));const T=[s,...E],S=await $r(t,g),O=[];let P=(null==(r=i.flip)?void 0:r.overflows)||[];if(c&&O.push(S[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Rr(e),o=kr(e),i=Fr(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Br(l)),[l,Br(l)]}(o,l,w);O.push(S[e[0]],S[e[1]])}if(P=[...P,{placement:o,overflows:O}],!O.every(e=>e<=0)){var A,I;const e=((null==(A=i.flip)?void 0:A.index)||0)+1,t=T[e];if(t&&("alignment"!==d||y===Nr(t)||P.every(e=>Nr(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:P},reset:{placement:t}};let n=null==(I=P.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:I.placement;if(!n)switch(p){case"bestFit":{var L;const e=null==(L=P.filter(e=>{if(x){const t=Nr(e.placement);return t===y||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:L[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},wo=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:l,elements:s}=t,{apply:a=()=>{},...u}=Ir(e,t),c=await $r(t,u),d=Lr(o),f=Rr(o),p="y"===Nr(o),{width:m,height:h}=i.floating;let g,v;"top"===d||"bottom"===d?(g=d,v=f===(await(null==l.isRTL?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,g="end"===f?"top":"bottom");const y=h-c.top-c.bottom,b=m-c.left-c.right,w=wr(h-c[g],y),E=wr(m-c[v],b),x=!t.middlewareData.shift;let T=w,S=E;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(S=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(T=y),x&&!f){const e=Er(c.left,0),t=Er(c.right,0),n=Er(c.top,0),r=Er(c.bottom,0);p?S=m-2*(0!==e||0!==t?e+t:Er(c.left,c.right)):T=h-2*(0!==n||0!==r?n+r:Er(c.top,c.bottom))}await a({...t,availableWidth:S,availableHeight:T});const O=await l.getDimensions(s.floating);return m!==O.width||h!==O.height?{reset:{rects:!0}}:{}}}},Eo=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Ir(e,t);switch(r){case"referenceHidden":{const e=Kr(await $r(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:zr(e)}}}case"escaped":{const e=Kr(await $r(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:zr(e)}}}default:return{}}}}},xo=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:s,middlewareData:a}=t,{element:u,padding:c=0}=Ir(e,t)||{};if(null==u)return{};const d=Wr(c),f={x:n,y:r},p=kr(o),m=Fr(p),h=await l.getDimensions(u),g="y"===p,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",w=i.reference[m]+i.reference[p]-f[p]-i.floating[m],E=f[p]-i.reference[p],x=await(null==l.getOffsetParent?void 0:l.getOffsetParent(u));let T=x?x[b]:0;(!T||!await(null==l.isElement?void 0:l.isElement(x)))&&(T=s.floating[b]||i.floating[m]);const S=w/2-E/2,O=T/2-h[m]/2-1,P=wr(d[v],O),A=wr(d[y],O),I=P,L=T-h[m]-A,R=T/2-h[m]/2+S,C=Ar(I,R,L),F=!a.arrow&&null!=Rr(o)&&R!==C&&i.reference[m]/2-(R<I?P:A)-h[m]/2<0,M=F?R<I?R-I:R-L:0;return{[p]:f[p]+M,data:{[p]:C,centerOffset:R-C-M,...F&&{alignmentOffset:M}},reset:F}}}),To=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:l}=t,{offset:s=0,mainAxis:a=!0,crossAxis:u=!0}=Ir(e,t),c={x:n,y:r},d=Nr(o),f=Cr(d);let p=c[f],m=c[d];const h=Ir(s,t),g="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(a){const e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+g.mainAxis,n=i.reference[f]+i.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(u){var v,y;const e="y"===f?"width":"height",t=Yr.has(Lr(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=l.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=l.offset)?void 0:y[d])||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},So=(e,t,n)=>{const r=new Map,o={platform:po,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,s=i.filter(Boolean),a=await(null==l.isRTL?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=Gr(u,r,a),f=r,p={},m=0;for(let n=0;n<s.length;n++){const{name:i,fn:h}=s[n],{x:g,y:v,data:y,reset:b}=await h({x:c,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:u,platform:l,elements:{reference:e,floating:t}});c=g??c,d=v??d,p={...p,[i]:{...p[i],...y}},b&&m<=50&&(m++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(u=!0===b.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:c,y:d}=Gr(u,f,a))),n=-1)}return{x:c,y:d,placement:f,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var Oo=typeof document<"u"?P:function(){};function Po(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!Po(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(!("_owner"===n&&e.$$typeof||Po(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function Ao(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Io(e,t){const n=Ao(e);return Math.round(t*n)/n}function Lo(e){const t=b.useRef(e);return Oo(()=>{t.current=e}),t}function Ro(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:l}={},transform:s=!0,whileElementsMounted:a,open:u}=e,[c,d]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=b.useState(r);Po(f,r)||p(r);const[m,h]=b.useState(null),[g,v]=b.useState(null),y=b.useCallback(e=>{e!==T.current&&(T.current=e,h(e))},[]),w=b.useCallback(e=>{e!==S.current&&(S.current=e,v(e))},[]),E=i||m,x=l||g,T=b.useRef(null),S=b.useRef(null),O=b.useRef(c),P=null!=a,A=Lo(a),I=Lo(o),L=Lo(u),R=b.useCallback(()=>{if(!T.current||!S.current)return;const e={placement:t,strategy:n,middleware:f};I.current&&(e.platform=I.current),So(T.current,S.current,e).then(e=>{const t={...e,isPositioned:!1!==L.current};C.current&&!Po(O.current,t)&&(O.current=t,_.flushSync(()=>{d(t)}))})},[f,t,n,I,L]);Oo(()=>{!1===u&&O.current.isPositioned&&(O.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[u]);const C=b.useRef(!1);Oo(()=>(C.current=!0,()=>{C.current=!1}),[]),Oo(()=>{if(E&&(T.current=E),x&&(S.current=x),E&&x){if(A.current)return A.current(E,x,R);R()}},[E,x,R,A,P]);const F=b.useMemo(()=>({reference:T,floating:S,setReference:y,setFloating:w}),[y,w]),M=b.useMemo(()=>({reference:E,floating:x}),[E,x]),N=b.useMemo(()=>{const e={position:n,left:0,top:0};if(!M.floating)return e;const t=Io(M.floating,c.x),r=Io(M.floating,c.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...Ao(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,s,M.floating,c.x,c.y]);return b.useMemo(()=>({...c,update:R,refs:F,elements:M,floatingStyles:N}),[c,R,F,M,N])}const Co=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&function(e){return{}.hasOwnProperty.call(e,"current")}(n)?null!=n.current?xo({element:n.current,padding:r}).fn(t):{}:n?xo({element:n,padding:r}).fn(t):{}}}),Fo=(e,t)=>({...vo(e),options:[e,t]}),Mo=(e,t)=>({...yo(e),options:[e,t]}),No=(e,t)=>({...To(e),options:[e,t]}),ko=(e,t)=>({...bo(e),options:[e,t]}),Do=(e,t)=>({...wo(e),options:[e,t]}),qo=(e,t)=>({...Eo(e),options:[e,t]}),_o=(e,t)=>({...Co(e),options:[e,t]}),jo={...b},Ho=jo.useInsertionEffect||(e=>e());function Vo(e){const t=b.useRef(()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")});return Ho(()=>{t.current=e}),b.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}var Bo=typeof document<"u"?P:T;let Wo=!1,Uo=0;const Go=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Uo++;const $o=jo.useId||function(){const[e,t]=b.useState(()=>Wo?Go():void 0);return Bo(()=>{null==e&&t(Go())},[]),b.useEffect(()=>{Wo=!0},[]),e};let Ko;"production"!==process.env.NODE_ENV&&(Ko=new Set);const zo=b.createContext(null),Yo=b.createContext(null),Qo="data-floating-ui-focusable";function Xo(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=$o(),i=b.useRef({}),[l]=b.useState(()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter(e=>e!==n))||[])}}}()),s=null!=(()=>{var e;return(null==(e=b.useContext(zo))?void 0:e.id)||null})();if("production"!==process.env.NODE_ENV){const e=r.reference;e&&!Xn(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=Ko)&&e.has(o)||(null==(i=Ko)||i.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,u]=b.useState(r.reference),c=Vo((e,t,r)=>{i.current.openEvent=e?t:void 0,l.emit("openchange",{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=b.useMemo(()=>({setPositionReference:u}),[]),f=b.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return b.useMemo(()=>({dataRef:i,open:t,onOpenChange:c,elements:f,events:l,floatingId:o,refs:d}),[t,c,f,l,o,d])}function Jo(e){void 0===e&&(e={});const{nodeId:t}=e,n=Xo({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,l]=b.useState(null),[s,a]=b.useState(null),u=o?.domReference||i,c=b.useRef(null),d=b.useContext(Yo);Bo(()=>{u&&(c.current=u)},[u]);const f=Ro({...e,elements:{...o,...s&&{reference:s}}}),p=b.useCallback(e=>{const t=Xn(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a(t),f.refs.setReference(t)},[f.refs]),m=b.useCallback(e=>{(Xn(e)||null===e)&&(c.current=e,l(e)),(Xn(f.refs.reference.current)||null===f.refs.reference.current||null!==e&&!Xn(e))&&f.refs.setReference(e)},[f.refs]),h=b.useMemo(()=>({...f.refs,setReference:m,setPositionReference:p,domReference:c}),[f.refs,m,p]),g=b.useMemo(()=>({...f.elements,domReference:u}),[f.elements,u]),v=b.useMemo(()=>({...f,...r,refs:h,elements:g,nodeId:t}),[f,h,g,t,r]);return Bo(()=>{r.dataRef.current.floatingContext=v;const e=d?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),b.useMemo(()=>({...f,context:v,refs:h,elements:g}),[f,h,g,v])}const Zo="active",ei="selected";function ti(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[Zo]:t,[ei]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[Qo]:""},...i,...t.map(t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,i]=t;if(!o||![Zo,ei].includes(n))if(0===n.indexOf("on")){var l;if(r.has(n)||r.set(n,[]),"function"==typeof i)null==(l=r.get(n))||l.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map(e=>e(...o)).find(e=>void 0!==e)}}else e[n]=i}),e),{})}}function ni(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const ri=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:i=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:u,...c}=Ir(e,t),{rects:d,elements:{floating:f}}=t,p=n.current[l],m=u?.current||f,h=f.clientTop||m.clientTop,g=0!==f.clientTop,v=0!==m.clientTop,y=f===m;if("production"!==process.env.NODE_ENV&&(t.placement.startsWith("bottom")||function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=Ko)&&e.has(o)||(null==(i=Ko)||i.add(o),console.warn(o))}('`placement` side must be "bottom" when using the `inner`',"middleware.")),!p)return{};const b={...t,...await Fo(-p.offsetTop-f.clientTop-d.reference.height/2-p.offsetHeight/2-i).fn(t)},w=await go(ni(b,m.scrollHeight+h+f.clientTop),c),E=await go(b,{...c,elementContext:"reference"}),x=Er(0,w.top),T=b.y+x,S=(m.scrollHeight>m.clientHeight?e=>e:xr)(Er(0,m.scrollHeight+(g&&y||v?2*h:0)-x-Er(0,w.bottom)));if(m.style.maxHeight=S+"px",m.scrollTop=x,o){const e=m.offsetHeight<p.offsetHeight*wr(s,n.current.length)-1||E.top>=-a||E.bottom>=-a;_.flushSync(()=>o(e))}return r&&(r.current=await go(ni({...b,y:T},m.offsetHeight+h+f.clientTop),c)),{y:T}}});function oi(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:i,scrollRef:l,onChange:s}=t,a=Vo(s),u=b.useRef(!1),c=b.useRef(null),d=b.useRef(null);b.useEffect(()=>{if(!o)return;function e(e){if(e.ctrlKey||!t||null==i.current)return;const n=e.deltaY,r=i.current.top>=-.5,o=i.current.bottom>=-.5,l=t.scrollHeight-t.clientHeight,s=n<0?-1:1,u=n<0?"max":"min";t.scrollHeight<=t.clientHeight||(!r&&n>0||!o&&n<0?(e.preventDefault(),_.flushSync(()=>{a(e=>e+Math[u](n,l*s))})):/firefox/i.test(function(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+"/"+n}).join(" "):navigator.userAgent}())&&(t.scrollTop+=n))}const t=l?.current||r.floating;return n&&t?(t.addEventListener("wheel",e),requestAnimationFrame(()=>{c.current=t.scrollTop,null!=i.current&&(d.current={...i.current})}),()=>{c.current=null,d.current=null,t.removeEventListener("wheel",e)}):void 0},[o,n,r.floating,i,l,a]);const f=b.useMemo(()=>({onKeyDown(){u.current=!0},onWheel(){u.current=!1},onPointerMove(){u.current=!1},onScroll(){const e=l?.current||r.floating;if(i.current&&e&&u.current){if(null!==c.current){const t=e.scrollTop-c.current;(i.current.bottom<-.5&&t<-1||i.current.top<-.5&&t>1)&&_.flushSync(()=>a(e=>e+t))}requestAnimationFrame(()=>{c.current=e.scrollTop})}}}),[r.floating,a,i,l]);return b.useMemo(()=>o?{floating:f}:{},[o,f])}let ii=I({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});ii.displayName="FloatingContext";let li=I(null);li.displayName="PlacementContext";function si({children:e,enabled:t=!0}){let[n,r]=S(null),[o,i]=S(0),l=E(null),[s,a]=S(null);!function(e){Be(()=>{if(!e)return;let t=new MutationObserver(()=>{let t=window.getComputedStyle(e).maxHeight,n=parseFloat(t);if(isNaN(n))return;let r=parseInt(t);isNaN(r)||n!==r&&(e.style.maxHeight=`${Math.ceil(n)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}(s);let u=t&&null!==n&&null!==s,{to:c="bottom",gap:d=0,offset:f=0,padding:p=0,inner:m}=function(e,t){var n,r,o;let i=ai(null!=(n=e?.gap)?n:"var(--anchor-gap, 0)",t),l=ai(null!=(r=e?.offset)?r:"var(--anchor-offset, 0)",t),s=ai(null!=(o=e?.padding)?o:"var(--anchor-padding, 0)",t);return{...e,gap:i,offset:l,padding:s}}(n,s),[h,g="center"]=c.split(" ");Be(()=>{u&&i(0)},[u]);let{refs:v,floatingStyles:y,context:w}=Jo({open:u,placement:"selection"===h?"center"===g?"bottom":`bottom-${g}`:"center"===g?`${h}`:`${h}-${g}`,strategy:"absolute",transform:!1,middleware:[Fo({mainAxis:"selection"===h?0:d,crossAxis:f}),Mo({padding:p}),"selection"!==h&&ko({padding:p}),"selection"===h&&m?ri({...m,padding:p,overflowRef:l,offset:o,minItemsVisible:4,referenceOverflowThreshold:p,onFallbackChange(e){var t,n;if(!e)return;let r=w.elements.floating;if(!r)return;let o=parseFloat(getComputedStyle(r).scrollPaddingBottom)||0,l=Math.min(4,r.childElementCount),s=0,a=0;for(let e of null!=(n=null==(t=w.elements.floating)?void 0:t.childNodes)?n:[])if(ft(e)){let t=e.offsetTop,n=t+e.clientHeight+o,i=r.scrollTop,u=i+r.clientHeight;if(!(t>=i&&n<=u)){a=Math.max(0,Math.min(n,u)-Math.max(t,i)),s=e.clientHeight;break}l--}l>=1&&i(e=>{let t=s*l-a+o;return e>=t?e:t})}}):null,Do({padding:p,apply({availableWidth:e,availableHeight:t,elements:n}){Object.assign(n.floating.style,{overflow:"auto",maxWidth:`${e}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${t}px)`})}})].filter(Boolean),whileElementsMounted:ho}),[x=h,T=g]=w.placement.split("-");"selection"===h&&(x="selection");let P=O(()=>({anchor:[x,T].filter(Boolean).join(" ")}),[x,T]),A=oi(w,{overflowRef:l,onChange:i}),{getReferenceProps:I,getFloatingProps:L}=function(e){void 0===e&&(e=[]);const t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),o=b.useCallback(t=>ti(t,e,"reference"),t),i=b.useCallback(t=>ti(t,e,"floating"),n),l=b.useCallback(t=>ti(t,e,"item"),r);return b.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:l}),[o,i,l])}([A]),R=Ue(e=>{a(e),v.setFloating(e)});return b.createElement(li.Provider,{value:r},b.createElement(ii.Provider,{value:{setFloating:R,setReference:v.setReference,styles:y,getReferenceProps:I,getFloatingProps:L,slot:P}},e))}function ai(e,t,n=void 0){let r=Ve(),o=Ue((e,t)=>{if(null==e)return[n,null];if("number"==typeof e)return[e,null];if("string"==typeof e){if(!t)return[n,null];let o=ci(e,t);return[o,n=>{let i=ui(e);{let l=i.map(e=>window.getComputedStyle(t).getPropertyValue(e));r.requestAnimationFrame(function s(){r.nextFrame(s);let a=!1;for(let[e,n]of i.entries()){let r=window.getComputedStyle(t).getPropertyValue(n);if(l[e]!==r){l[e]=r,a=!0;break}}if(!a)return;let u=ci(e,t);o!==u&&(n(u),o=u)})}return r.dispose}]}return[n,null]}),i=O(()=>o(e,t)[0],[e,t]),[l=i,s]=S();return Be(()=>{let[n,r]=o(e,t);if(s(n),r)return r(s)},[e,t]),l}function ui(e){let t=/var\((.*)\)/.exec(e);if(t){let e=t[1].indexOf(",");if(-1===e)return[t[1]];let n=t[1].slice(0,e).trim(),r=t[1].slice(e+1).trim();return r?[n,...ui(r)]:[n]}return[]}function ci(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}let di=I(null);di.displayName="OpenClosedContext";var fi=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(fi||{});function pi(){return A(di)}function mi({value:e,children:t}){return w.createElement(di.Provider,{value:e},t)}var hi=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(hi||{});function gi(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:for(let e=0;e<n.length;++e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 1:-1===o&&(o=n.length);for(let e=o-1;e>=0;--e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 2:for(let e=o+1;e<n.length;++e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 3:for(let e=n.length-1;e>=0;--e)if(!t.resolveDisabled(n[e],e,n))return e;return r;case 4:for(let r=0;r<n.length;++r)if(t.resolveId(n[r],r,n)===e.id)return r;return r;case 5:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}}function vi(e){let t=Ue(e),n=E(!1);T(()=>(n.current=!1,()=>{n.current=!0,je(()=>{n.current&&t()})}),[t])}let yi=I(!1);function bi(e){let t=A(yi),n=A(Ti),[r,o]=S(()=>{var r;if(!t&&null!==n)return null!=(r=n.current)?r:null;if(ke.isServer)return null;let o=e?.getElementById("headlessui-portal-root");if(o)return o;if(null===e)return null;let i=e.createElement("div");return i.setAttribute("id","headlessui-portal-root"),e.body.appendChild(i)});return T(()=>{null!==r&&(null!=e&&e.body.contains(r)||null==e||e.body.appendChild(r))},[r,e]),T(()=>{t||null!==n&&o(n.current)},[n,o,t]),r}let wi=R,Ei=ot(function(e,t){let{ownerDocument:n=null,...r}=e,o=E(null),i=wt(function(e,t=!0){return Object.assign(e,{[bt]:t})}(e=>{o.current=e}),t),l=Cn(o.current),s=bi(n??l),a=A(Si),u=Ve(),c=Ze();return vi(()=>{var e;s&&s.childNodes.length<=0&&(null==(e=s.parentElement)||e.removeChild(s))}),s?j(w.createElement("div",{"data-headlessui-portal":"",ref:e=>{u.dispose(),a&&e&&u.add(a.register(e))}},c({ourProps:{ref:i},theirProps:r,slot:{},defaultTag:wi,name:"Portal"})),s):null});let xi=R,Ti=I(null);let Si=I(null),Oi=ot(function(e,t){let n=wt(t),{enabled:r=!0,ownerDocument:o,...i}=e,l=Ze();return r?w.createElement(Ei,{...i,ownerDocument:o,ref:n}):l({ourProps:{ref:n},theirProps:i,slot:{},defaultTag:wi,name:"Portal"})}),Pi=ot(function(e,t){let{target:n,...r}=e,o={ref:wt(t)},i=Ze();return w.createElement(Ti.Provider,{value:n},i({ourProps:o,theirProps:r,defaultTag:xi,name:"Popover.Group"}))}),Ai=Object.assign(Oi,{Group:Pi});const Ii={Idle:{kind:"Idle"},Tracked:e=>({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function Li(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function Ri(){let e=function(){let e=typeof document>"u";return"useSyncExternalStore"in b&&b.useSyncExternalStore(()=>()=>{},()=>!1,()=>!e)}(),[t,n]=b.useState(ke.isHandoffComplete);return t&&!1===ke.isHandoffComplete&&n(!1),b.useEffect(()=>{!0!==t&&n(!0)},[t]),b.useEffect(()=>ke.handoff(),[]),!e&&t}function Ci(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!at(null!=(t=e.as)?t:qi)||1===w.Children.count(e.children)}let Fi=I(null);Fi.displayName="TransitionContext";var Mi=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Mi||{});let Ni=I(null);function ki(e){return"children"in e?ki(e.children):e.current.filter(({el:e})=>null!==e.current).filter(({state:e})=>"visible"===e).length>0}function Di(e,t){let n=We(e),r=E([]),o=function(){let e=E(!1);return Be(()=>(e.current=!0,()=>{e.current=!1}),[]),e}(),i=Ve(),l=Ue((e,t=Je.Hidden)=>{let l=r.current.findIndex(({el:t})=>t===e);-1!==l&&(Ye(t,{[Je.Unmount](){r.current.splice(l,1)},[Je.Hidden](){r.current[l].state="hidden"}}),i.microTask(()=>{var e;!ki(r)&&o.current&&(null==(e=n.current)||e.call(n))}))}),s=Ue(e=>{let t=r.current.find(({el:t})=>t===e);return t?"visible"!==t.state&&(t.state="visible"):r.current.push({el:e,state:"visible"}),()=>l(e,Je.Unmount)}),a=E([]),u=E(Promise.resolve()),c=E({enter:[],leave:[]}),d=Ue((e,n,r)=>{a.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter(([t])=>t!==e)),t?.chains.current[n].push([e,new Promise(e=>{a.current.push(e)})]),t?.chains.current[n].push([e,new Promise(e=>{Promise.all(c.current[n].map(([e,t])=>t)).then(()=>e())})]),"enter"===n?u.current=u.current.then(()=>t?.wait.current).then(()=>r(n)):r(n)}),f=Ue((e,t,n)=>{Promise.all(c.current[t].splice(0).map(([e,t])=>t)).then(()=>{var e;null==(e=a.current.shift())||e()}).then(()=>n(t))});return O(()=>({children:r,register:s,unregister:l,onStart:d,onStop:f,wait:u,chains:c}),[s,l,r,d,f,c,u])}Ni.displayName="NestingContext";let qi=R,_i=Xe.RenderStrategy;let ji=ot(function(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,l=E(null),s=wt(...Ci(e)?[l,t]:null===t?[]:[t]);Ri();let a=pi();if(void 0===n&&null!==a&&(n=(a&fi.Open)===fi.Open),void 0===n)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,c]=S(n?"visible":"hidden"),d=Di(()=>{n||c("hidden")}),[f,p]=S(!0),m=E([n]);Be(()=>{!1!==f&&m.current[m.current.length-1]!==n&&(m.current.push(n),p(!1))},[m,n]);let h=O(()=>({show:n,appear:r,initial:f}),[n,r,f]);Be(()=>{n?c("visible"):!ki(d)&&null!==l.current&&c("hidden")},[n,d]);let g={unmount:o},v=Ue(()=>{var t;f&&p(!1),null==(t=e.beforeEnter)||t.call(e)}),y=Ue(()=>{var t;f&&p(!1),null==(t=e.beforeLeave)||t.call(e)}),b=Ze();return w.createElement(Ni.Provider,{value:d},w.createElement(Fi.Provider,{value:h},b({ourProps:{...g,as:R,children:w.createElement(Hi,{ref:s,...g,...i,beforeEnter:v,beforeLeave:y})},theirProps:{},defaultTag:R,features:_i,visible:"visible"===u,name:"Transition"})))}),Hi=ot(function(e,t){var n,r;let{transition:o=!0,beforeEnter:i,afterEnter:l,beforeLeave:s,afterLeave:a,enter:u,enterFrom:c,enterTo:d,entered:f,leave:p,leaveFrom:m,leaveTo:h,...g}=e,[v,y]=S(null),b=E(null),x=Ci(e),O=wt(...x?[b,t,y]:null===t?[]:[t]),P=null==(n=g.unmount)||n?Je.Unmount:Je.Hidden,{show:I,appear:L,initial:R}=function(){let e=A(Fi);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[C,F]=S(I?"visible":"hidden"),M=function(){let e=A(Ni);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:N,unregister:k}=M;Be(()=>N(b),[N,b]),Be(()=>{if(P===Je.Hidden&&b.current)return I&&"visible"!==C?void F("visible"):Ye(C,{hidden:()=>k(b),visible:()=>N(b)})},[C,b,N,k,I,P]);let D=Ri();Be(()=>{if(x&&D&&"visible"===C&&null===b.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[b,C,D,x]);let q=R&&!L,_=L&&I&&R,j=E(!1),H=Di(()=>{j.current||(F("hidden"),k(b))},M),V=Ue(e=>{j.current=!0;let t=e?"enter":"leave";H.onStart(b,t,e=>{"enter"===e?i?.():"leave"===e&&s?.()})}),B=Ue(e=>{let t=e?"enter":"leave";j.current=!1,H.onStop(b,t,e=>{"enter"===e?l?.():"leave"===e&&a?.()}),"leave"===t&&!ki(H)&&(F("hidden"),k(b))});T(()=>{x&&o||(V(I),B(I))},[I,x,o]);let W=!(!o||!x||!D||q),[,U]=Gn(W,v,I,{start:V,end:B}),G=it({ref:O,className:(null==(r=ze(g.className,_&&u,_&&c,U.enter&&u,U.enter&&U.closed&&c,U.enter&&!U.closed&&d,U.leave&&p,U.leave&&!U.closed&&m,U.leave&&U.closed&&h,!U.transition&&I&&f))?void 0:r.trim())||void 0,...Un(U)}),$=0;"visible"===C&&($|=fi.Open),"hidden"===C&&($|=fi.Closed),I&&"hidden"===C&&($|=fi.Opening),!I&&"visible"===C&&($|=fi.Closing);let K=Ze();return w.createElement(Ni.Provider,{value:H},w.createElement(mi,{value:$},K({ourProps:G,theirProps:g,defaultTag:qi,features:_i,visible:"visible"===C,name:"Transition.Child"})))}),Vi=ot(function(e,t){let n=null!==A(Fi),r=null!==pi();return w.createElement(w.Fragment,null,!n&&r?w.createElement(ji,{ref:t,...e}):w.createElement(Hi,{ref:t,...e}))}),Bi=Object.assign(ji,{Child:Vi,Root:ji}),Wi=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Ui(e){var t,n;let r=null!=(t=e.innerText)?t:"",o=e.cloneNode(!0);if(!ft(o))return r;let i=!1;for(let e of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))e.remove(),i=!0;let l=i?null!=(n=o.innerText)?n:"":r;return Wi.test(l)&&(l=l.replace(Wi,"")),l}function Gi(e){let t=E(""),n=E("");return Ue(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let i=function(e){let t=e.getAttribute("aria-label");if("string"==typeof t)return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let e=n.split(" ").map(e=>{let t=document.getElementById(e);if(t){let e=t.getAttribute("aria-label");return"string"==typeof e?e.trim():Ui(t).trim()}return null}).filter(Boolean);if(e.length>0)return e.join(", ")}return Ui(e).trim()}(r).trim().toLowerCase();return t.current=o,n.current=i,i})}var $i=Object.defineProperty,Ki=(e,t,n)=>(((e,t,n)=>{t in e?$i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),zi=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(zi||{}),Yi=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Yi||{}),Qi=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItems=5]="RegisterItems",e[e.UnregisterItems=6]="UnregisterItems",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetItemsElement=8]="SetItemsElement",e[e.SortItems=9]="SortItems",e[e.MarkButtonAsMoved=10]="MarkButtonAsMoved",e))(Qi||{});function Xi(e,t=e=>e){let n=null!==e.activeItemIndex?e.items[e.activeItemIndex]:null,r=On(t(e.items.slice()),e=>e.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return-1===o&&(o=null),{items:r,activeItemIndex:o}}let Ji={1(e){if(1===e.menuState)return e;let t=e.buttonElement?Ii.Tracked(Li(e.buttonElement)):e.buttonPositionState;return{...e,activeItemIndex:null,pendingFocus:{focus:hi.Nothing},menuState:1,buttonPositionState:t}},0:(e,t)=>0===e.menuState?e:{...e,__demoMode:!1,pendingFocus:t.focus,menuState:0,buttonPositionState:Ii.Idle},2:(e,t)=>{var n,r,o,i,l;if(1===e.menuState)return e;let s={...e,searchQuery:"",activationTrigger:null!=(n=t.trigger)?n:1,__demoMode:!1};if(t.focus===hi.Nothing)return{...s,activeItemIndex:null};if(t.focus===hi.Specific)return{...s,activeItemIndex:e.items.findIndex(e=>e.id===t.id)};if(t.focus===hi.Previous){let n=e.activeItemIndex;if(null!==n){let i=e.items[n].dataRef.current.domRef,l=gi(t,{resolveItems:()=>e.items,resolveActiveIndex:()=>e.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});if(null!==l){let t=e.items[l].dataRef.current.domRef;if((null==(r=i.current)?void 0:r.previousElementSibling)===t.current||null===(null==(o=t.current)?void 0:o.previousElementSibling))return{...s,activeItemIndex:l}}}}else if(t.focus===hi.Next){let n=e.activeItemIndex;if(null!==n){let r=e.items[n].dataRef.current.domRef,o=gi(t,{resolveItems:()=>e.items,resolveActiveIndex:()=>e.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});if(null!==o){let t=e.items[o].dataRef.current.domRef;if((null==(i=r.current)?void 0:i.nextElementSibling)===t.current||null===(null==(l=t.current)?void 0:l.nextElementSibling))return{...s,activeItemIndex:o}}}}let a=Xi(e),u=gi(t,{resolveItems:()=>a.items,resolveActiveIndex:()=>a.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...s,...a,activeItemIndex:u}},3:(e,t)=>{let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(null!==e.activeItemIndex?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find(e=>{var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))&&!e.dataRef.current.disabled}),i=o?e.items.indexOf(o):-1;return-1===i||i===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:i,activationTrigger:1}},4:e=>""===e.searchQuery?e:{...e,searchQuery:"",searchActiveItemIndex:null},5:(e,t)=>{let n=e.items.concat(t.items.map(e=>e)),r=e.activeItemIndex;return e.pendingFocus.focus!==hi.Nothing&&(r=gi(e.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>e.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled})),{...e,items:n,activeItemIndex:r,pendingFocus:{focus:hi.Nothing},pendingShouldSort:!0}},6:(e,t)=>{let n=e.items,r=[],o=new Set(t.items);for(let[e,t]of n.entries())if(o.has(t.id)&&(r.push(e),o.delete(t.id),0===o.size))break;if(r.length>0){n=n.slice();for(let e of r.reverse())n.splice(e,1)}return{...e,items:n,activationTrigger:1}},7:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},8:(e,t)=>e.itemsElement===t.element?e:{...e,itemsElement:t.element},9:e=>e.pendingShouldSort?{...e,...Xi(e),pendingShouldSort:!1}:e,10:e=>"Tracked"!==e.buttonPositionState.kind?e:{...e,buttonPositionState:Ii.Moved}};class Zi extends Bt{constructor(e){super(e),Ki(this,"actions",{registerItem:$t(()=>{let e=[],t=new Set;return[(n,r)=>{t.has(r)||(t.add(r),e.push({id:n,dataRef:r}))},()=>(t.clear(),this.send({type:5,items:e.splice(0)}))]}),unregisterItem:$t(()=>{let e=[];return[t=>e.push(t),()=>this.send({type:6,items:e.splice(0)})]})}),Ki(this,"selectors",{activeDescendantId(e){var t;let n=e.activeItemIndex,r=e.items;return null===n||null==(t=r[n])?void 0:t.id},isActive(e,t){var n;let r=e.activeItemIndex,o=e.items;return null!==r&&(null==(n=o[r])?void 0:n.id)===t},shouldScrollIntoView(e,t){return!e.__demoMode&&0===e.menuState&&0!==e.activationTrigger&&this.isActive(e,t)},didButtonMove:e=>"Moved"===e.buttonPositionState.kind}),this.on(5,()=>{this.disposables.requestAnimationFrame(()=>{this.send({type:9})})});{let e=this.state.id,t=Jt.get(null);this.disposables.add(t.on(Yt.Push,n=>{!t.selectors.isTop(n,e)&&0===this.state.menuState&&this.send({type:1})})),this.on(0,()=>t.actions.push(e)),this.on(1,()=>t.actions.pop(e))}this.disposables.group(e=>{this.on(1,t=>{t.buttonElement&&(e.dispose(),e.add(function(e,t,n){let r=He();if("Tracked"===t.kind){let o=function(){i!==Li(e)&&(r.dispose(),n())},{position:i}=t,l=new ResizeObserver(o);l.observe(e),r.add(()=>l.disconnect()),r.addEventListener(window,"scroll",o,{passive:!0}),r.addEventListener(window,"resize",o)}return()=>r.dispose()}(t.buttonElement,t.buttonPositionState,()=>{this.send({type:10})})))})})}static new({id:e,__demoMode:t=!1}){return new Zi({id:e,__demoMode:t,menuState:t?0:1,buttonElement:null,itemsElement:null,items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1,pendingShouldSort:!1,pendingFocus:{focus:hi.Nothing},buttonPositionState:Ii.Idle})}reduce(e,t){return Ye(t.type,Ji,e,t)}}const el=I(null);function tl(e){let t=A(el);if(null===t){let t=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,nl),t}return t}function nl({id:e,__demoMode:t=!1}){let n=O(()=>Zi.new({id:e,__demoMode:t}),[]);return vi(()=>n.dispose()),n}let rl=R;let ol=Xe.RenderStrategy|Xe.Static;let il=R;let ll=ot(function(e,t){let n=N(),{__demoMode:r=!1,...o}=e,i=nl({id:n,__demoMode:r}),[l,s,a]=sn(i,e=>[e.menuState,e.itemsElement,e.buttonElement]),u=wt(t),c=Jt.get(null);Rn(sn(c,x(e=>c.selectors.isTop(e,n),[c,n])),[a,s],(e,t)=>{var n;i.send({type:Qi.CloseMenu}),En(t,wn.Loose)||(e.preventDefault(),null==(n=i.state.buttonElement)||n.focus())});let d=Ue(()=>{i.send({type:Qi.CloseMenu})}),f=Ge({open:l===zi.Open,close:d}),p={ref:u},m=Ze();return w.createElement(si,null,w.createElement(el.Provider,{value:i},w.createElement(mi,{value:Ye(l,{[zi.Open]:fi.Open,[zi.Closed]:fi.Closed})},m({ourProps:p,theirProps:o,slot:f,defaultTag:rl,name:"Menu"}))))}),sl=ot(function(e,t){let n=tl("Menu.Button"),r=N(),{id:o=`headlessui-menu-button-${r}`,disabled:i=!1,autoFocus:l=!1,...s}=e,a=E(null),u=A(ii).getReferenceProps,c=wt(t,a,A(ii).setReference,Ue(e=>n.send({type:Qi.SetButtonElement,element:e}))),d=Ue(e=>{switch(e.key){case St.Space:case St.Enter:case St.ArrowDown:e.preventDefault(),e.stopPropagation(),n.send({type:Qi.OpenMenu,focus:{focus:hi.First}});break;case St.ArrowUp:e.preventDefault(),e.stopPropagation(),n.send({type:Qi.OpenMenu,focus:{focus:hi.Last}})}}),f=Ue(e=>{if(e.key===St.Space)e.preventDefault()}),[p,m,h]=sn(n,e=>[e.menuState,e.buttonElement,e.itemsElement]);!function(e,{trigger:t,action:n,close:r,select:o}){let i=E(null),l=E(null),s=E(null);Ln(e&&null!==t,"pointerdown",e=>{ct(e?.target)&&null!=t&&t.contains(e.target)&&(l.current=e.x,s.current=e.y,i.current=e.timeStamp)}),Ln(e&&null!==t,"pointerup",e=>{var t,a;let u=i.current;if(null===u||(i.current=null,!pt(e.target))||Math.abs(e.x-(null!=(t=l.current)?t:e.x))<5&&Math.abs(e.y-(null!=(a=s.current)?a:e.y))<5)return;let c=n(e);switch(c.kind){case 0:return;case 1:e.timeStamp-u>200&&(o(c.target),r());break;case 2:r()}},{capture:!0})}(p===zi.Open,{trigger:m,action:x(e=>{if(null!=m&&m.contains(e.target))return Mn.Ignore;let t=e.target.closest('[role="menuitem"]:not([data-disabled])');return ft(t)?Mn.Select(t):null!=h&&h.contains(e.target)?Mn.Ignore:Mn.Close},[m,h]),close:x(()=>n.send({type:Qi.CloseMenu}),[]),select:x(e=>e.click(),[])});let g=function(e){let t=E(null);return{onPointerDown:Ue(n=>{t.current=n.pointerType,!yt(n.currentTarget)&&"mouse"===n.pointerType&&n.button===Ct.Left&&(n.preventDefault(),e(n))}),onClick:Ue(n=>{"mouse"!==t.current&&(yt(n.currentTarget)||e(n))})}}(e=>{var t;i||(p===zi.Open?(H(()=>n.send({type:Qi.CloseMenu})),null==(t=a.current)||t.focus({preventScroll:!0})):(e.preventDefault(),n.send({type:Qi.OpenMenu,focus:{focus:hi.Nothing},trigger:Yi.Pointer})))}),{isFocusVisible:v,focusProps:y}=Fe({autoFocus:l}),{isHovered:b,hoverProps:w}=function(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,l]=S(!1),s=E({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;T(Ce,[]);let{addGlobalListener:a,removeAllGlobalListeners:u}=le(),{hoverProps:c,triggerHoverEnd:d}=O(()=>{let e=(e,r)=>{if(s.pointerType=r,o||"touch"===r||s.isHovered||!e.currentTarget.contains(e.target))return;s.isHovered=!0;let u=e.currentTarget;s.target=u,a($(e.target),"pointerover",e=>{s.isHovered&&s.target&&!z(s.target,e.target)&&i(e,e.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:u,pointerType:r}),n&&n(!0),l(!0)},i=(e,t)=>{let o=s.target;s.pointerType="",s.target=null,"touch"!==t&&s.isHovered&&o&&(s.isHovered=!1,u(),r&&r({type:"hoverend",target:o,pointerType:t}),n&&n(!1),l(!1))},c={};return typeof PointerEvent<"u"?(c.onPointerEnter=t=>{Ae&&"mouse"===t.pointerType||e(t,t.pointerType)},c.onPointerLeave=e=>{!o&&e.currentTarget.contains(e.target)&&i(e,e.pointerType)}):"test"===process.env.NODE_ENV&&(c.onTouchStart=()=>{s.ignoreEmulatedMouseEvents=!0},c.onMouseEnter=t=>{!s.ignoreEmulatedMouseEvents&&!Ae&&e(t,"mouse"),s.ignoreEmulatedMouseEvents=!1},c.onMouseLeave=e=>{!o&&e.currentTarget.contains(e.target)&&i(e,"mouse")}),{hoverProps:c,triggerHoverEnd:i}},[t,n,r,o,s,a,u]);return T(()=>{o&&d({currentTarget:s.target},s.pointerType)},[o]),{hoverProps:c,isHovered:i}}({isDisabled:i}),{pressed:P,pressProps:I}=function({disabled:e=!1}={}){let t=E(null),[n,r]=S(!1),o=Ve(),i=Ue(()=>{t.current=null,r(!1),o.dispose()}),l=Ue(e=>{if(o.dispose(),null===t.current){t.current=e.currentTarget,r(!0);{let n=De(e.currentTarget);o.addEventListener(n,"pointerup",i,!1),o.addEventListener(n,"pointermove",e=>{if(t.current){let n=function(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}(e);r(function(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}(n,t.current.getBoundingClientRect()))}},!1),o.addEventListener(n,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:l,onPointerUp:i,onClick:i}}}({disabled:i}),L=Ge({open:p===zi.Open,active:P||p===zi.Open,disabled:i,hover:b,focus:v,autofocus:l}),R=rt(u(),{ref:c,id:o,type:Nn(e,a.current),"aria-haspopup":"menu","aria-controls":h?.id,"aria-expanded":p===zi.Open,disabled:i||void 0,autoFocus:l,onKeyDown:d,onKeyUp:f},g,y,w,I);return Ze()({ourProps:R,theirProps:s,slot:L,defaultTag:"button",name:"Menu.Button"})}),al=ot(function(e,t){let n=N(),{id:r=`headlessui-menu-items-${n}`,anchor:o,portal:i=!1,modal:l=!0,transition:s=!1,...a}=e,u=function(e){return O(()=>e?"string"==typeof e?{to:e}:e:null,[e])}(o),c=tl("Menu.Items"),[d,f]=function(e=null){!1===e&&(e=null),"string"==typeof e&&(e={to:e});let t=A(li),n=O(()=>e,[JSON.stringify(e,(e,t)=>{var n;return null!=(n=t?.outerHTML)?n:t})]);Be(()=>{t?.(n??null)},[t,n]);let r=A(ii);return O(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}(u),p=function(){let{getFloatingProps:e,slot:t}=A(ii);return x((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}(),[m,h]=S(null),g=wt(t,u?d:null,Ue(e=>c.send({type:Qi.SetItemsElement,element:e})),h),[v,y]=sn(c,e=>[e.menuState,e.buttonElement]),b=Cn(y),P=Cn(m);u&&(i=!0);let I=pi(),[L,R]=Gn(s,m,null!==I?(I&fi.Open)===fi.Open:v===zi.Open);!function(e,t,n){let r=We(e=>{let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&n()});T(()=>{if(!e)return;let n=null===t?null:ft(t)?t:t.current;if(!n)return;let o=He();if(typeof ResizeObserver<"u"){let e=new ResizeObserver(()=>r.current(n));e.observe(n),o.add(()=>e.disconnect())}if(typeof IntersectionObserver<"u"){let e=new IntersectionObserver(()=>r.current(n));e.observe(n),o.add(()=>e.disconnect())}return()=>o.dispose()},[t,r,e])}(L,y,()=>{c.send({type:Qi.CloseMenu})});let C=sn(c,e=>e.__demoMode);!function(e,t,n=()=>[document.body]){jn(un(e,"scroll-lock"),t,e=>{var t;return{containers:[...null!=(t=e.containers)?t:[],n]}})}(!C&&(l&&v===zi.Open),P),function(e,{allowed:t,disallowed:n}={}){let r=un(e,"inert-others");Be(()=>{var e,o;if(!r)return;let i=He();for(let t of null!=(e=n?.())?e:[])t&&i.add(fn(t));let l=null!=(o=t?.())?o:[];for(let e of l){if(!e)continue;let t=De(e);if(!t)continue;let n=e.parentElement;for(;n&&n!==t.body;){for(let e of n.children)l.some(t=>e.contains(t))||i.add(fn(e));n=n.parentElement}}return i.dispose},[r,t,n])}(!C&&(l&&v===zi.Open),{allowed:x(()=>[y,m],[y,m])});let F=!sn(c,c.selectors.didButtonMove)&&L;T(()=>{let e=m;e&&v===zi.Open&&(function(e){return _e(e)===e}(e)||e.focus({preventScroll:!0}))},[v,m]),function(e,{container:t,accept:n,walk:r}){let o=E(n),i=E(r);T(()=>{o.current=n,i.current=r},[n,r]),Be(()=>{if(!t||!e)return;let n=De(t);if(!n)return;let r=o.current,l=i.current,s=Object.assign(e=>r(e),{acceptNode:r}),a=n.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,s,!1);for(;a.nextNode();)l(a.currentNode)},[t,e,o,i])}(v===zi.Open,{container:m,accept:e=>"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let M=Ve(),k=Ue(e=>{var t,n,r;switch(M.dispose(),e.key){case St.Space:if(""!==c.state.searchQuery)return e.preventDefault(),e.stopPropagation(),c.send({type:Qi.Search,value:e.key});case St.Enter:if(e.preventDefault(),e.stopPropagation(),null!==c.state.activeItemIndex){let{dataRef:e}=c.state.items[c.state.activeItemIndex];null==(n=null==(t=e.current)?void 0:t.domRef.current)||n.click()}c.send({type:Qi.CloseMenu}),xn(c.state.buttonElement);break;case St.ArrowDown:return e.preventDefault(),e.stopPropagation(),c.send({type:Qi.GoToItem,focus:hi.Next});case St.ArrowUp:return e.preventDefault(),e.stopPropagation(),c.send({type:Qi.GoToItem,focus:hi.Previous});case St.Home:case St.PageUp:return e.preventDefault(),e.stopPropagation(),c.send({type:Qi.GoToItem,focus:hi.First});case St.End:case St.PageDown:return e.preventDefault(),e.stopPropagation(),c.send({type:Qi.GoToItem,focus:hi.Last});case St.Escape:e.preventDefault(),e.stopPropagation(),H(()=>c.send({type:Qi.CloseMenu})),null==(r=c.state.buttonElement)||r.focus({preventScroll:!0});break;case St.Tab:e.preventDefault(),e.stopPropagation(),H(()=>c.send({type:Qi.CloseMenu})),Pn(c.state.buttonElement,e.shiftKey?gn.Previous:gn.Next);break;default:1===e.key.length&&(c.send({type:Qi.Search,value:e.key}),M.setTimeout(()=>c.send({type:Qi.ClearSearch}),350))}}),D=Ue(e=>{if(e.key===St.Space)e.preventDefault()}),q=Ge({open:v===zi.Open}),_=rt(u?p():{},{"aria-activedescendant":sn(c,c.selectors.activeDescendantId),"aria-labelledby":sn(c,e=>{var t;return null==(t=e.buttonElement)?void 0:t.id}),id:r,onKeyDown:k,onKeyUp:D,role:"menu",tabIndex:v===zi.Open?0:void 0,ref:g,style:{...a.style,...f,"--button-width":Rt(L,y,!0).width},...Un(R)}),j=Ze();return w.createElement(Ai,{enabled:!!i&&(e.static||L),ownerDocument:b},j({ourProps:_,theirProps:a,slot:q,defaultTag:"div",features:ol,visible:F,name:"Menu.Items"}))}),ul=ot(function(e,t){let n=N(),{id:r=`headlessui-menu-item-${n}`,disabled:o=!1,...i}=e,l=tl("Menu.Item"),s=sn(l,e=>l.selectors.isActive(e,r)),a=E(null),u=wt(t,a),c=sn(l,e=>l.selectors.shouldScrollIntoView(e,r));Be(()=>{if(c)return He().requestAnimationFrame(()=>{var e,t;null==(t=null==(e=a.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})},[c,a]);let d=Gi(a),f=E({disabled:o,domRef:a,get textValue(){return d()}});Be(()=>{f.current.disabled=o},[f,o]),Be(()=>(l.actions.registerItem(r,f),()=>l.actions.unregisterItem(r)),[f,r]);let p=Ue(()=>{l.send({type:Qi.CloseMenu})}),m=Ue(e=>{if(o)return e.preventDefault();l.send({type:Qi.CloseMenu}),xn(l.state.buttonElement)}),h=Ue(()=>{if(o)return l.send({type:Qi.GoToItem,focus:hi.Nothing});l.send({type:Qi.GoToItem,focus:hi.Specific,id:r})}),g=function(){let e=E([-1,-1]);return{wasMoved(t){let n=Hn(t);return(e.current[0]!==n[0]||e.current[1]!==n[1])&&(e.current=n,!0)},update(t){e.current=Hn(t)}}}(),v=Ue(e=>g.update(e)),y=Ue(e=>{g.wasMoved(e)&&(o||s||l.send({type:Qi.GoToItem,focus:hi.Specific,id:r,trigger:Yi.Pointer}))}),b=Ue(e=>{g.wasMoved(e)&&(o||s&&l.state.activationTrigger===Yi.Pointer&&l.send({type:Qi.GoToItem,focus:hi.Nothing}))}),[x,T]=At(),[P,A]=function(){let[e,t]=S([]);return[e.length>0?e.join(" "):void 0,O(()=>function(e){let n=Ue(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))),r=O(()=>({register:n,slot:e.slot,name:e.name,props:e.props,value:e.value}),[n,e.slot,e.name,e.props,e.value]);return w.createElement(Et.Provider,{value:r},e.children)},[t])]}(),I=Ge({active:s,focus:s,disabled:o,close:p}),L={id:r,ref:u,role:"menuitem",tabIndex:!0===o?void 0:-1,"aria-disabled":!0===o||void 0,"aria-labelledby":x,"aria-describedby":P,disabled:void 0,onClick:m,onFocus:h,onPointerEnter:v,onMouseEnter:v,onPointerMove:y,onMouseMove:y,onPointerLeave:b,onMouseLeave:b},R=Ze();return w.createElement(T,null,w.createElement(A,null,R({ourProps:L,theirProps:i,slot:I,defaultTag:il,name:"Menu.Item"})))}),cl=ot(function(e,t){let[n,r]=At(),o=e,i={ref:t,"aria-labelledby":n,role:"group"},l=Ze();return w.createElement(r,null,l({ourProps:i,theirProps:o,slot:{},defaultTag:"div",name:"Menu.Section"}))}),dl=ot(function(e,t){let n=N(),{id:r=`headlessui-menu-heading-${n}`,...o}=e,i=Pt();Be(()=>i.register(r),[r,i.register]);let l={id:r,ref:t,role:"presentation",...i.props};return Ze()({ourProps:l,theirProps:o,slot:{},defaultTag:"header",name:"Menu.Heading"})}),fl=ot(function(e,t){let n=e,r={ref:t,role:"separator"};return Ze()({ourProps:r,theirProps:n,slot:{},defaultTag:"div",name:"Menu.Separator"})}),pl=Object.assign(ll,{Button:sl,Items:al,Item:ul,Section:cl,Heading:dl,Separator:fl});const ml=({event:n})=>{const r=e(),{organization:l,user:p,props:{organizationId:m}}=t(),[h,g]=S(!1);return s.jsxs(pl,{as:"div",className:"qc:bg-background qc:relative",children:[s.jsx(sl,{className:"qc:relative qc:flex qc:items-center qc:focus:outline-none",children:s.jsx(q,{content:"Gallery layout",children:s.jsx(a,{size:"lg",name:h?"line-md:loading-loop":"material-symbols:grid-view-outline-rounded"})})}),s.jsx(Bi,{enter:"qc:transition qc:ease-out qc:duration-100",enterFrom:"qc:transform qc:opacity-0 qc:scale-95",enterTo:"qc:transform qc:opacity-100 qc:scale-100",leave:"qc:transition qc:ease-in qc:duration-75",leaveFrom:"qc:transform qc:opacity-100 qc:scale-100",leaveTo:"qc:transform qc:opacity-0 qc:scale-95",children:s.jsx(al,{modal:!1,style:u(l),className:"qc:bg-background qc:border-border qc:shadow-outer qc:absolute qc:right-0 qc:z-50 qc:mt-2 qc:w-44 qc:origin-top-right qc:rounded qc:border qc:p-2 qc:focus:outline-none",children:Object.values(c).map(e=>s.jsx(ul,{children:({focus:t})=>s.jsxs("button",{onClick:()=>(async e=>{g(!0);try{const t=new FormData;t.append("eventId",n._id),t.append("galleryLayout",e),await o.post(i.UPDATE_EVENT_LAYOUT,{body:t,headers:{"x-org-id":m,Authorization:p?`Bearer ${p.token}`:void 0}}),r.invalidateQueries([`event-data-${m}-${n?.slug}`])}catch(e){console.error(e)}g(!1)})(e),className:d("qc:flex qc:w-full qc:items-center qc:justify-between qc:gap-4 qc:rounded qc:p-2",t?"qc:bg-primary":""),children:[s.jsx(f,{variant:"h6",color:t?"a11y":"qc:primary",children:B(e)}),n.galleryLayout===e&&s.jsx(a,{name:"material-symbols:done-rounded",color:t?"a11y":"qc:primary"})]})},e))})})]})},hl=({event:e,onAutoscrollClick:n})=>{const r=p(),{organization:o}=t(),{role:i,isSuper:l}=D(),{inReviewCount:c}=V(e),b=O(()=>{const t=[];return(l||i&&i!==m.MODERATOR)&&t.push({title:"Deep search",icon:"material-symbols:category-search-outline-rounded",href:h.EVENT_DEEP_SEARCH(e?.slug),chip:"BETA"}),(l||i&&i!==m.MODERATOR)&&t.push({title:"Generate article",icon:"material-symbols:article-outline-rounded",href:h.EVENT_GENERATE_ARTICLE(e?.slug),chip:"BETA"}),e.visibility===g.PRIVATE&&(l||i)&&t.push({title:"Access requests",icon:"material-symbols:person-search-outline-rounded",href:h.EVENT_ACCESS_REQUESTS(e?.slug)}),(l||i&&i!==m.MODERATOR)&&t.push({title:"Shot inspector",icon:"material-symbols:camera-outline-rounded",href:h.EVENT_SHOT_INSPECTOR(e?.slug)}),e.engagementStyle===v.CONTEST&&(l||i&&i!==m.MODERATOR)&&t.push({title:"Curation details",icon:"material-symbols:person-celebrate-rounded",href:h.EVENT_CURATION_DETAILS(e?.slug)}),(l||i&&i!==m.MODERATOR)&&t.push({title:"Edit event",icon:"material-symbols:settings-outline-rounded",href:h.EVENT_SETTINGS_BASIC_DETAILS(e?.slug)}),t},[e,i,l]);return s.jsxs("div",{className:"qc:text-muted qc:sm:text-foreground qc:flex qc:flex-row qc:items-center qc:justify-end qc:gap-6 qc:pr-1 qc:sm:justify-between qc:sm:pr-4",children:[r?.pathname===y.GALLERY(e?.slug)&&document?.fullscreenEnabled&&n&&s.jsx(q,{content:"Kiosk mode",children:s.jsx("button",{onClick:n,className:"qc:hidden qc:sm:block",children:s.jsx(a,{name:"material-symbols:jamboard-kiosk-outline-rounded",size:"lg"})})}),r?.pathname===y.GALLERY(e?.slug)&&(l||i&&i!==m.MODERATOR)&&s.jsx(ml,{event:e}),(l||i)&&s.jsx(q,{content:"Review contents",children:s.jsxs("a",{target:"_blank",rel:"noreferrer",href:h.EVENT_REVIEW_CONTENTS(e?.slug),className:"qc:relative",children:[s.jsx(a,{name:"material-symbols:image-search-outline-rounded",size:"lg"}),c>0&&s.jsx("div",{className:"qc:bg-primary qc:text-primary-foreground qc:absolute qc:-right-2 qc:-top-2 qc:rounded-lg qc:px-1 qc:py-0 qc:text-xs",children:c})]})}),b.length>0&&s.jsxs(pl,{as:"div",className:"qc:bg-background qc:relative",children:[s.jsx(sl,{className:d("qc:relative qc:flex qc:items-center qc:focus:outline-none"),children:s.jsx(q,{content:"More options",children:s.jsx(a,{name:"material-symbols:more-vert",size:"lg"})})}),s.jsx(Bi,{enter:"qc:transition qc:ease-out qc:duration-100",enterFrom:"qc:transform qc:opacity-0 qc:scale-95",enterTo:"qc:transform qc:opacity-100 qc:scale-100",leave:"qc:transition qc:ease-in qc:duration-75",leaveFrom:"qc:transform qc:opacity-100 qc:scale-100",leaveTo:"qc:transform qc:opacity-0 qc:scale-95",children:s.jsx(al,{style:u(o),modal:!1,className:"qc:bg-background qc:border-border qc:shadow-outer qc:absolute qc:right-0 qc:z-50 qc:mt-2 qc:w-64 qc:origin-top-right qc:rounded qc:border qc:p-2 qc:focus:outline-none",children:b.map(e=>s.jsx(ul,{children:({focus:t})=>s.jsxs("a",{target:"_blank",href:e.href,className:d("qc:flex qc:items-center qc:justify-between qc:gap-4 qc:rounded qc:p-2",t?"qc:bg-primary":""),rel:"noreferrer",children:[s.jsxs("div",{className:"qc:flex qc:items-center qc:gap-3",children:[s.jsx(a,{name:e.icon,color:t?"a11y":"qc:primary"}),s.jsx(f,{variant:"h6",color:t?"a11y":"qc:primary",children:e.title})]}),e?.chip&&s.jsx("span",{className:"qc:bg-primary qc:text-primary-foreground qc:rounded-full qc:px-1.5 qc:py-0.5 qc:text-[0.5rem] qc:font-medium qc:sm:text-xs",children:e.chip})]})},e.href))})})]})]})};export{hl as E,Do as a,_o as b,ho as c,V as d,ko as f,qo as h,No as l,Fo as o,Mo as s,Ro as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,T as c,b as t,u as s,H as a,e as l,c as i,S as r,y as n,k as q,i as d}from"./
|
|
1
|
+
import{j as e,T as c,b as t,u as s,H as a,e as l,c as i,S as r,y as n,k as q,i as d}from"./ChmTNpp8.js";import"react";const o=({title:t,entries:s=[],showFloatingPoint:a=!1,hidePictures:l=!0})=>{const i=t.replace(/\s+/g,"-").toLowerCase(),r=e=>{if(!e)return"";const c=e.trim().split(" ");return 1===c.length?c[0]:`${c[0]} ${c[1][0]}.`};return e.jsxs("div",{className:"qc:border-border qc:mx-auto qc:flex qc:max-w-lg qc:flex-col qc:space-y-4 qc:rounded qc:border qc:p-4 qc:lg:space-y-8",children:[e.jsx(c,{variant:"h4",align:"center",color:"primary",children:t}),0===s.length?e.jsx(c,{variant:"h5",align:"center",color:"error",children:"Not available"}):e.jsxs("div",{className:"",children:[e.jsxs("div",{className:"qc:flex qc:w-full qc:items-end qc:justify-center qc:gap-4 qc:lg:gap-24",children:[s.length>1&&e.jsxs("div",{className:"qc:flex qc:flex-col qc:items-center qc:justify-center",children:[e.jsx("div",{className:"qc:bg-warning qc:text-primary-foreground qc:flex qc:size-16 qc:items-center qc:justify-center qc:rounded-full qc:text-2xl",children:"2"}),e.jsx("div",{className:"qc-text-primary qc-mt-3 qc-text-center qc-font-semibold",children:r(s[1].name)}),e.jsx("div",{className:"qc:text-foreground qc:text-primary qc:mt-1 qc:text-center qc:font-semibold",children:void 0===s[1].totalPoint?s[1].maxScore?.toFixed(a?2:0):s[1].totalPoint?.toFixed(a?2:0)})]}),s.length>0&&e.jsxs("div",{className:"qc:flex qc:flex-col qc:items-center qc:justify-center",children:[e.jsx("div",{className:"qc:bg-destructive qc:text-primary-foreground qc:flex qc:size-24 qc:items-center qc:justify-center qc:rounded-full qc:text-4xl",children:"1"}),e.jsx("div",{className:"qc-text-primary qc-mt-3 qc-text-center qc-font-semibold",children:r(s[0].name)}),e.jsx("div",{className:"qc:text-primary qc:mt-1 qc:text-center qc:font-semibold",children:void 0===s[0].totalPoint?s[0].maxScore?.toFixed(a?2:0):s[0].totalPoint?.toFixed(a?2:0)})]}),s.length>2&&e.jsxs("div",{className:"qc:flex qc:flex-col qc:items-center qc:justify-center",children:[e.jsx("div",{className:"qc:bg-success qc:text-primary-foreground qc:flex qc:size-16 qc:items-center qc:justify-center qc:rounded-full qc:text-2xl",children:"3"}),e.jsx("div",{className:"qc-text-primary qc-mt-3 qc-text-center qc-font-semibold",children:r(s[2].name)}),e.jsx("div",{className:"qc:text-foreground qc:text-primary qc:mt-1 qc:text-center qc:font-semibold",children:void 0===s[2].totalPoint?s[2].maxScore?.toFixed(a?2:0):s[2].totalPoint?.toFixed(a?2:0)})]})]}),e.jsx("div",{className:"qc:mt-6",children:e.jsx("div",{className:"qc:-my-2 qc:overflow-x-auto qc:sm:-mx-6 qc:lg:-mx-8",children:e.jsx("div",{className:"qc:inline-block qc:min-w-full qc:py-2 qc:align-middle qc:md:px-6 qc:lg:px-8",children:e.jsx("div",{className:"qc:shadow-outer qc:overflow-hidden qc:ring-1 qc:ring-black qc:ring-opacity-5 qc:md:rounded",children:e.jsx("table",{className:"qc:w-full qc:divide-y qc:divide-gray-300",children:e.jsx("tbody",{className:"qc:bg-background qc:bg-opacity-50",children:s.slice(3).map((c,t)=>e.jsxs("tr",{children:[e.jsx("td",{className:"qc:text-muted qc:whitespace-nowrap qc:py-4 qc:pl-4 qc:text-sm qc:font-medium",children:e.jsx("span",{className:"qc:px-2",children:t+4})}),e.jsx("td",{className:"qc:whitespace-nowrap qc:py-4",children:e.jsxs("div",{className:"qc:flex qc:items-center",children:[!l&&e.jsx("div",{className:"qc:size-8 qc:shrink-0"}),e.jsx("div",{className:"qc-ml-4",children:e.jsx("div",{className:"qc-text-primary qc-font-medium",children:r(c.name)})})]})}),e.jsx("td",{className:"qc:text-foreground qc:whitespace-nowrap qc:py-4 qc:pr-4 qc:text-right qc:text-base qc:font-medium qc:italic",children:void 0===c.totalPoint?c.maxScore?.toFixed(a?2:0):c.totalPoint?.toFixed(a?2:0)})]},`${i}-${t}`))})})})})})})]})]})},m=()=>{const{eventSlug:c}=t(),{props:{organizationId:m}}=s(),{event:x}=a({eventSlug:c}),{isLoading:f,data:g}=l({queryKey:[`leaderboard-${m}-${x?._id}`],queryFn:async()=>(await q.get(d.GET_LEADERBOARD,{headers:{"x-org-id":m},searchParams:{eventId:x?._id}}).json()).data,enabled:!!x});return f?e.jsxs("div",{className:i("qc:mt-4 qc:flex qc:bg-background qc:min-h-[80vh] qc:w-full qc:gap-8 qc:px-2 qc:py-4 qc:sm:px-0 qc:lg:gap-0 qc:lg:py-8",x?.engagementStyle===n.REACTION?"qc:flex-col-reverse qc:md:flex-row-reverse qc:md:justify-between":"qc:flex-col qc:md:flex-row"),children:[e.jsxs("div",{className:"qc:flex-1",children:[e.jsx(r,{className:"qc:h-64 qc:w-full qc:rounded"}),e.jsx(r,{className:"qc:h-64 qc:w-full qc:rounded"})]}),e.jsx("div",{className:"qc:flex-1",children:e.jsx(o,{title:x?.engagementStyle===n.REACTION?"Reaction Counts":"Top Rated Photos",showFloatingPoint:x?.engagementStyle===n.CONTEST,entries:g?.leaderboardByScore?.topRankers||[],pointName:x?.pointName})})]}):e.jsxs("div",{className:i("qc:mt-4 qc:flex qc:min-h-[80vh] qc:w-full qc:gap-8 qc:px-2 qc:py-4 qc:sm:px-0 qc:lg:gap-0 qc:lg:py-8",x?.engagementStyle===n.REACTION?"qc:flex-col-reverse qc:md:flex-row-reverse qc:md:justify-between":"qc:flex-col qc:md:flex-row"),children:[e.jsx("div",{className:"qc:flex-1",children:e.jsx(o,{title:"Point Leaders",entries:g?.leaderboardByPoint?.topRankers||[],pointName:x?.pointName})}),e.jsx("div",{className:"qc:flex-1",children:e.jsx(o,{title:x?.engagementStyle===n.REACTION?"Reaction Counts":"Top Rated Photos",showFloatingPoint:x?.engagementStyle===n.CONTEST,entries:g?.leaderboardByScore?.topRankers||[],pointName:x?.pointName})})]})};export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as t,r as i,c as s,g as e,p as o,s as n,a,b as r,d as h,t as p,f as l,Z as c,h as d,i as u,j as m,P as _,C as v,k as g}from"./D_imcCpv.js";class y{constructor(t){this.gestures=t,this.pswp=t.pswp,this.startPan={x:0,y:0}}start(){this.pswp.currSlide&&t(this.startPan,this.pswp.currSlide.pan),this.pswp.animations.stopAll()}change(){const{p1:t,prevP1:s,dragAxis:e}=this.gestures,{currSlide:o}=this.pswp;if("y"===e&&this.pswp.options.closeOnVerticalDrag&&o&&o.currZoomLevel<=o.zoomLevels.fit&&!this.gestures.isMultitouch){const i=o.pan.y+(t.y-s.y);if(!this.pswp.dispatch("verticalDrag",{panY:i}).defaultPrevented){this._setPanWithFriction("y",i,.6);const t=1-Math.abs(this._getVerticalDragRatio(o.pan.y));this.pswp.applyBgOpacity(t),o.applyCurrentZoomPan()}}else this._panOrMoveMainScroll("x")||(this._panOrMoveMainScroll("y"),o&&(i(o.pan),o.applyCurrentZoomPan()))}end(){const{velocity:t}=this.gestures,{mainScroll:i,currSlide:s}=this.pswp;let e=0;if(this.pswp.animations.stopAll(),i.isShifted()){const s=(i.x-i.getCurrSlideX())/this.pswp.viewportSize.x;t.x<-.5&&s<0||t.x<.1&&s<-.5?(e=1,t.x=Math.min(t.x,0)):(t.x>.5&&s>0||t.x>-.1&&s>.5)&&(e=-1,t.x=Math.max(t.x,0)),i.moveIndexBy(e,!0,t.x,!0)}s&&s.currZoomLevel>s.zoomLevels.max||this.gestures.isMultitouch?this.gestures.zoomLevels.correctZoomPan(!0):(this._finishPanGestureForAxis("x"),this._finishPanGestureForAxis("y"))}_finishPanGestureForAxis(t){const{velocity:i}=this.gestures,{currSlide:e}=this.pswp;if(!e)return;const{pan:o,bounds:n}=e,a=o[t],r=this.pswp.bgOpacity<1&&"y"===t,h=a+function(t,i){return t*i/(1-i)}(i[t],.995);if(r){const t=this._getVerticalDragRatio(a),i=this._getVerticalDragRatio(h);if(t<0&&i<-.4||t>0&&i>.4)return void this.pswp.close()}const p=n.correctPan(t,h);if(a===p)return;const l=p===h?1:.82,c=this.pswp.bgOpacity,d=p-a;this.pswp.animations.startSpring({name:"panGesture"+t,isPan:!0,start:a,end:p,velocity:i[t],dampingRatio:l,onUpdate:i=>{if(r&&this.pswp.bgOpacity<1){const t=1-(p-i)/d;this.pswp.applyBgOpacity(s(c+(1-c)*t,0,1))}o[t]=Math.floor(i),e.applyCurrentZoomPan()}})}_panOrMoveMainScroll(t){const{p1:i,dragAxis:s,prevP1:e,isMultitouch:o}=this.gestures,{currSlide:n,mainScroll:a}=this.pswp,r=i[t]-e[t],h=a.x+r;if(!r||!n)return!1;if("x"===t&&!n.isPannable()&&!o)return a.moveTo(h,!0),!0;const{bounds:p}=n,l=n.pan[t]+r;if(this.pswp.options.allowPanToNext&&"x"===s&&"x"===t&&!o){const i=a.getCurrSlideX(),s=a.x-i,e=r>0,o=!e;if(l>p.min[t]&&e){if(p.min[t]<=this.startPan[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,l)}else if(l<p.max[t]&&o){if(this.startPan[t]<=p.max[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,l)}else if(0!==s){if(s>0)return a.moveTo(Math.max(h,i),!0),!0;if(s<0)return a.moveTo(Math.min(h,i),!0),!0}else this._setPanWithFriction(t,l)}else"y"===t?!a.isShifted()&&p.min.y!==p.max.y&&this._setPanWithFriction(t,l):this._setPanWithFriction(t,l);return!1}_getVerticalDragRatio(t){return(t-(this.pswp.currSlide?.bounds.center.y??0))/(this.pswp.viewportSize.y/3)}_setPanWithFriction(t,i,s){const{currSlide:e}=this.pswp;if(!e)return;const{pan:o,bounds:n}=e;if(n.correctPan(t,i)!==i||s){const e=Math.round(i-o[t]);o[t]+=e*(s||.35)}else o[t]=i}}function w(t){return!!t.target.closest(".pswp__container")}class f{constructor(t){this.gestures=t}click(t,i){const s=i.target.classList,e=s.contains("pswp__img"),o=s.contains("pswp__item")||s.contains("pswp__zoom-wrap");e?this._doClickOrTapAction("imageClick",t,i):o&&this._doClickOrTapAction("bgClick",t,i)}tap(t,i){w(i)&&this._doClickOrTapAction("tap",t,i)}doubleTap(t,i){w(i)&&this._doClickOrTapAction("doubleTap",t,i)}_doClickOrTapAction(t,i,s){const{pswp:e}=this.gestures,{currSlide:o}=e,n=t+"Action",a=e.options[n];if(!e.dispatch(n,{point:i,originalEvent:s}).defaultPrevented){if("function"==typeof a)return void a.call(e,i,s);switch(a){case"close":case"next":e[a]();break;case"zoom":o?.toggleZoom(i);break;case"zoom-or-close":o?.isZoomable()&&o.zoomLevels.secondary!==o.zoomLevels.initial?o.toggleZoom(i):e.options.clickToCloseNonZoomable&&e.close();break;case"toggle-controls":this.gestures.pswp.element?.classList.toggle("pswp--ui-visible")}}}}function P(t,i,s){return t.x=(i.x+s.x)/2,t.y=(i.y+s.y)/2,t}class x{constructor(t){this.gestures=t,this._startPan={x:0,y:0},this._startZoomPoint={x:0,y:0},this._zoomPoint={x:0,y:0},this._wasOverFitZoomLevel=!1,this._startZoomLevel=1}start(){const{currSlide:i}=this.gestures.pswp;i&&(this._startZoomLevel=i.currZoomLevel,t(this._startPan,i.pan)),this.gestures.pswp.animations.stopAllPan(),this._wasOverFitZoomLevel=!1}change(){const{p1:t,startP1:i,p2:s,startP2:o,pswp:n}=this.gestures,{currSlide:a}=n;if(!a)return;const r=a.zoomLevels.min,h=a.zoomLevels.max;if(!a.isZoomable()||n.mainScroll.isShifted())return;P(this._startZoomPoint,i,o),P(this._zoomPoint,t,s);let p=1/e(i,o)*e(t,s)*this._startZoomLevel;if(p>a.zoomLevels.initial+a.zoomLevels.initial/15&&(this._wasOverFitZoomLevel=!0),p<r)if(n.options.pinchToClose&&!this._wasOverFitZoomLevel&&this._startZoomLevel<=a.zoomLevels.initial){const t=1-(r-p)/(r/1.2);n.dispatch("pinchClose",{bgOpacity:t}).defaultPrevented||n.applyBgOpacity(t)}else p=r-.15*(r-p);else p>h&&(p=h+.05*(p-h));a.pan.x=this._calculatePanForZoomLevel("x",p),a.pan.y=this._calculatePanForZoomLevel("y",p),a.setZoomLevel(p),a.applyCurrentZoomPan()}end(){const{pswp:t}=this.gestures,{currSlide:i}=t;(!i||i.currZoomLevel<i.zoomLevels.initial)&&!this._wasOverFitZoomLevel&&t.options.pinchToClose?t.close():this.correctZoomPan()}_calculatePanForZoomLevel(t,i){const s=i/this._startZoomLevel;return this._zoomPoint[t]-(this._startZoomPoint[t]-this._startPan[t])*s}correctZoomPan(i){const{pswp:e}=this.gestures,{currSlide:n}=e;if(!n?.isZoomable())return;0===this._zoomPoint.x&&(i=!0);const a=n.currZoomLevel;let r,h=!0;a<n.zoomLevels.initial?r=n.zoomLevels.initial:a>n.zoomLevels.max?r=n.zoomLevels.max:(h=!1,r=a);const p=e.bgOpacity,l=e.bgOpacity<1,c=t({x:0,y:0},n.pan);let d=t({x:0,y:0},c);i&&(this._zoomPoint.x=0,this._zoomPoint.y=0,this._startZoomPoint.x=0,this._startZoomPoint.y=0,this._startZoomLevel=a,t(this._startPan,c)),h&&(d={x:this._calculatePanForZoomLevel("x",r),y:this._calculatePanForZoomLevel("y",r)}),n.setZoomLevel(r),d={x:n.bounds.correctPan("x",d.x),y:n.bounds.correctPan("y",d.y)},n.setZoomLevel(a);const u=!o(d,c);if(!u&&!h&&!l)return n._setResolution(r),void n.applyCurrentZoomPan();e.animations.stopAllPan(),e.animations.startSpring({isPan:!0,start:0,end:1e3,velocity:0,dampingRatio:1,naturalFrequency:40,onUpdate:t=>{if(t/=1e3,u||h){if(u&&(n.pan.x=c.x+(d.x-c.x)*t,n.pan.y=c.y+(d.y-c.y)*t),h){const i=a+(r-a)*t;n.setZoomLevel(i)}n.applyCurrentZoomPan()}l&&e.bgOpacity<1&&e.applyBgOpacity(s(p+(1-p)*t,0,1))},onComplete:()=>{n._setResolution(r),n.applyCurrentZoomPan()}})}}class S{constructor(t){this.pswp=t,this.dragAxis=null,this.p1={x:0,y:0},this.p2={x:0,y:0},this.prevP1={x:0,y:0},this.prevP2={x:0,y:0},this.startP1={x:0,y:0},this.startP2={x:0,y:0},this.velocity={x:0,y:0},this._lastStartP1={x:0,y:0},this._intervalP1={x:0,y:0},this._numActivePoints=0,this._ongoingPointers=[],this._touchEventEnabled="ontouchstart"in window,this._pointerEventEnabled=!!window.PointerEvent,this.supportsTouch=this._touchEventEnabled||this._pointerEventEnabled&&navigator.maxTouchPoints>1,this._numActivePoints=0,this._intervalTime=0,this._velocityCalculated=!1,this.isMultitouch=!1,this.isDragging=!1,this.isZooming=!1,this.raf=null,this._tapTimer=null,this.supportsTouch||(t.options.allowPanToNext=!1),this.drag=new y(this),this.zoomLevels=new x(this),this.tapHandler=new f(this),t.on("bindEvents",()=>{t.events.add(t.scrollWrap,"click",this._onClick.bind(this)),this._pointerEventEnabled?this._bindEvents("pointer","down","up","cancel"):this._touchEventEnabled?(this._bindEvents("touch","start","end","cancel"),t.scrollWrap&&(t.scrollWrap.ontouchmove=()=>{},t.scrollWrap.ontouchend=()=>{})):this._bindEvents("mouse","down","up")})}_bindEvents(t,i,s,e){const{pswp:o}=this,{events:n}=o,a=e?t+e:"";n.add(o.scrollWrap,t+i,this.onPointerDown.bind(this)),n.add(window,t+"move",this.onPointerMove.bind(this)),n.add(window,t+s,this.onPointerUp.bind(this)),a&&n.add(o.scrollWrap,a,this.onPointerUp.bind(this))}onPointerDown(i){const s="mousedown"===i.type||"mouse"===i.pointerType;if(s&&i.button>0)return;const{pswp:e}=this;e.opener.isOpen?e.dispatch("pointerDown",{originalEvent:i}).defaultPrevented||(s&&(e.mouseDetected(),this._preventPointerEventBehaviour(i,"down")),e.animations.stopAll(),this._updatePoints(i,"down"),1===this._numActivePoints&&(this.dragAxis=null,t(this.startP1,this.p1)),this._numActivePoints>1?(this._clearTapTimer(),this.isMultitouch=!0):this.isMultitouch=!1):i.preventDefault()}onPointerMove(i){this._preventPointerEventBehaviour(i,"move"),this._numActivePoints&&(this._updatePoints(i,"move"),!this.pswp.dispatch("pointerMove",{originalEvent:i}).defaultPrevented&&(1!==this._numActivePoints||this.isDragging?this._numActivePoints>1&&!this.isZooming&&(this._finishDrag(),this.isZooming=!0,this._updateStartPoints(),this.zoomLevels.start(),this._rafStopLoop(),this._rafRenderLoop()):(this.dragAxis||this._calculateDragDirection(),this.dragAxis&&!this.isDragging&&(this.isZooming&&(this.isZooming=!1,this.zoomLevels.end()),this.isDragging=!0,this._clearTapTimer(),this._updateStartPoints(),this._intervalTime=Date.now(),this._velocityCalculated=!1,t(this._intervalP1,this.p1),this.velocity.x=0,this.velocity.y=0,this.drag.start(),this._rafStopLoop(),this._rafRenderLoop()))))}_finishDrag(){this.isDragging&&(this.isDragging=!1,this._velocityCalculated||this._updateVelocity(!0),this.drag.end(),this.dragAxis=null)}onPointerUp(t){this._numActivePoints&&(this._updatePoints(t,"up"),!this.pswp.dispatch("pointerUp",{originalEvent:t}).defaultPrevented&&(0===this._numActivePoints&&(this._rafStopLoop(),this.isDragging?this._finishDrag():!this.isZooming&&!this.isMultitouch&&this._finishTap(t)),this._numActivePoints<2&&this.isZooming&&(this.isZooming=!1,this.zoomLevels.end(),1===this._numActivePoints&&(this.dragAxis=null,this._updateStartPoints()))))}_rafRenderLoop(){(this.isDragging||this.isZooming)&&(this._updateVelocity(),this.isDragging?o(this.p1,this.prevP1)||this.drag.change():(!o(this.p1,this.prevP1)||!o(this.p2,this.prevP2))&&this.zoomLevels.change(),this._updatePrevPoints(),this.raf=requestAnimationFrame(this._rafRenderLoop.bind(this)))}_updateVelocity(i){const s=Date.now(),e=s-this._intervalTime;e<50&&!i||(this.velocity.x=this._getVelocity("x",e),this.velocity.y=this._getVelocity("y",e),this._intervalTime=s,t(this._intervalP1,this.p1),this._velocityCalculated=!0)}_finishTap(i){const{mainScroll:s}=this.pswp;if(s.isShifted())return void s.moveIndexBy(0,!0);if(i.type.indexOf("cancel")>0)return;if("mouseup"===i.type||"mouse"===i.pointerType)return void this.tapHandler.click(this.startP1,i);const o=this.pswp.options.doubleTapAction?300:0;this._tapTimer?(this._clearTapTimer(),e(this._lastStartP1,this.startP1)<25&&this.tapHandler.doubleTap(this.startP1,i)):(t(this._lastStartP1,this.startP1),this._tapTimer=setTimeout(()=>{this.tapHandler.tap(this.startP1,i),this._clearTapTimer()},o))}_clearTapTimer(){this._tapTimer&&(clearTimeout(this._tapTimer),this._tapTimer=null)}_getVelocity(t,i){const s=this.p1[t]-this._intervalP1[t];return Math.abs(s)>1&&i>5?s/i:0}_rafStopLoop(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null)}_preventPointerEventBehaviour(t,i){this.pswp.applyFilters("preventPointerEvent",!0,t,i)&&t.preventDefault()}_updatePoints(i,s){if(this._pointerEventEnabled){const e=i,o=this._ongoingPointers.findIndex(t=>t.id===e.pointerId);"up"===s&&o>-1?this._ongoingPointers.splice(o,1):"down"===s&&-1===o?this._ongoingPointers.push(this._convertEventPosToPoint(e,{x:0,y:0})):o>-1&&this._convertEventPosToPoint(e,this._ongoingPointers[o]),this._numActivePoints=this._ongoingPointers.length,this._numActivePoints>0&&t(this.p1,this._ongoingPointers[0]),this._numActivePoints>1&&t(this.p2,this._ongoingPointers[1])}else{const t=i;this._numActivePoints=0,t.type.indexOf("touch")>-1?t.touches&&t.touches.length>0&&(this._convertEventPosToPoint(t.touches[0],this.p1),this._numActivePoints++,t.touches.length>1&&(this._convertEventPosToPoint(t.touches[1],this.p2),this._numActivePoints++)):(this._convertEventPosToPoint(i,this.p1),"up"===s?this._numActivePoints=0:this._numActivePoints++)}}_updatePrevPoints(){t(this.prevP1,this.p1),t(this.prevP2,this.p2)}_updateStartPoints(){t(this.startP1,this.p1),t(this.startP2,this.p2),this._updatePrevPoints()}_calculateDragDirection(){if(this.pswp.mainScroll.isShifted())this.dragAxis="x";else{const t=Math.abs(this.p1.x-this.startP1.x)-Math.abs(this.p1.y-this.startP1.y);if(0!==t){const i=t>0?"x":"y";Math.abs(this.p1[i]-this.startP1[i])>=10&&(this.dragAxis=i)}}}_convertEventPosToPoint(t,i){return i.x=t.pageX-this.pswp.offset.x,i.y=t.pageY-this.pswp.offset.y,"pointerId"in t?i.id=t.pointerId:void 0!==t.identifier&&(i.id=t.identifier),i}_onClick(t){this.pswp.mainScroll.isShifted()&&(t.preventDefault(),t.stopPropagation())}}const b={Escape:27,z:90,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Tab:9},T=(t,i)=>i?t:b[t];class L{constructor(t){this.pswp=t,this._wasFocused=!1,t.on("bindEvents",()=>{t.options.trapFocus&&(t.options.initialPointerPos||this._focusRoot(),t.events.add(document,"focusin",this._onFocusIn.bind(this))),t.events.add(document,"keydown",this._onKeyDown.bind(this))});const i=document.activeElement;t.on("destroy",()=>{t.options.returnFocus&&i&&this._wasFocused&&i.focus()})}_focusRoot(){!this._wasFocused&&this.pswp.element&&(this.pswp.element.focus(),this._wasFocused=!0)}_onKeyDown(t){const{pswp:i}=this;if(i.dispatch("keydown",{originalEvent:t}).defaultPrevented||n(t))return;let s,e,o=!1;const a="key"in t;switch(a?t.key:t.keyCode){case T("Escape",a):i.options.escKey&&(s="close");break;case T("z",a):s="toggleZoom";break;case T("ArrowLeft",a):e="x";break;case T("ArrowUp",a):e="y";break;case T("ArrowRight",a):e="x",o=!0;break;case T("ArrowDown",a):o=!0,e="y";break;case T("Tab",a):this._focusRoot()}if(e){t.preventDefault();const{currSlide:n}=i;i.options.arrowKeys&&"x"===e&&i.getNumItems()>1?s=o?"next":"prev":n&&n.currZoomLevel>n.zoomLevels.fit&&(n.pan[e]+=o?-80:80,n.panTo(n.pan.x,n.pan.y))}s&&(t.preventDefault(),i[s]())}_onFocusIn(t){const{template:i}=this.pswp;i&&document!==t.target&&i!==t.target&&!i.contains(t.target)&&i.focus()}}class A{constructor(t){this.pswp=t,this.x=0,this.slideWidth=0,this._currPositionIndex=0,this._prevPositionIndex=0,this._containerShiftIndex=-1,this.itemHolders=[]}resize(t){const{pswp:i}=this,s=Math.round(i.viewportSize.x+i.viewportSize.x*i.options.spacing),e=s!==this.slideWidth;e&&(this.slideWidth=s,this.moveTo(this.getCurrSlideX())),this.itemHolders.forEach((i,s)=>{e&&a(i.el,(s+this._containerShiftIndex)*this.slideWidth),t&&i.slide&&i.slide.resize()})}resetPosition(){this._currPositionIndex=0,this._prevPositionIndex=0,this.slideWidth=0,this._containerShiftIndex=-1}appendHolders(){this.itemHolders=[];for(let t=0;t<3;t++){const i=r("pswp__item","div",this.pswp.container);i.setAttribute("role","group"),i.setAttribute("aria-roledescription","slide"),i.setAttribute("aria-hidden","true"),i.style.display=1===t?"block":"none",this.itemHolders.push({el:i})}}canBeSwiped(){return this.pswp.getNumItems()>1}moveIndexBy(t,i,s){const{pswp:e}=this;let o=e.potentialIndex+t;const n=e.getNumItems();if(e.canLoop()){o=e.getLoopedIndex(o);const i=(t+n)%n;t=i<=n/2?i:i-n}else o<0?o=0:o>=n&&(o=n-1),t=o-e.potentialIndex;e.potentialIndex=o,this._currPositionIndex-=t,e.animations.stopMainScroll();const a=this.getCurrSlideX();if(i){e.animations.startSpring({isMainScroll:!0,start:this.x,end:a,velocity:s||0,naturalFrequency:30,dampingRatio:1,onUpdate:t=>{this.moveTo(t)},onComplete:()=>{this.updateCurrItem(),e.appendHeavy()}});let t=e.potentialIndex-e.currIndex;if(e.canLoop()){const i=(t+n)%n;t=i<=n/2?i:i-n}Math.abs(t)>1&&this.updateCurrItem()}else this.moveTo(a),this.updateCurrItem();return!!t}getCurrSlideX(){return this.slideWidth*this._currPositionIndex}isShifted(){return this.x!==this.getCurrSlideX()}updateCurrItem(){const{pswp:t}=this,i=this._prevPositionIndex-this._currPositionIndex;if(!i)return;this._prevPositionIndex=this._currPositionIndex,t.currIndex=t.potentialIndex;let s,e=Math.abs(i);e>=3&&(this._containerShiftIndex+=i+(i>0?-3:3),e=3,this.itemHolders.forEach(t=>{t.slide?.destroy(),t.slide=void 0}));for(let o=0;o<e;o++)i>0?(s=this.itemHolders.shift(),s&&(this.itemHolders[2]=s,this._containerShiftIndex++,a(s.el,(this._containerShiftIndex+2)*this.slideWidth),t.setContent(s,t.currIndex-e+o+2))):(s=this.itemHolders.pop(),s&&(this.itemHolders.unshift(s),this._containerShiftIndex--,a(s.el,this._containerShiftIndex*this.slideWidth),t.setContent(s,t.currIndex+e-o-2)));Math.abs(this._containerShiftIndex)>50&&!this.isShifted()&&(this.resetPosition(),this.resize()),t.animations.stopAllPan(),this.itemHolders.forEach((t,i)=>{t.slide&&t.slide.setIsActive(1===i)}),t.currSlide=this.itemHolders[1]?.slide,t.contentLoader.updateLazy(i),t.currSlide&&t.currSlide.applyCurrentZoomPan(),t.dispatch("change")}moveTo(t,i){if(!this.pswp.canLoop()&&i){let i=(this.slideWidth*this._currPositionIndex-t)/this.slideWidth;i+=this.pswp.currIndex;const s=Math.round(t-this.x);(i<0&&s>0||i>=this.pswp.getNumItems()-1&&s<0)&&(t=this.x+.35*s)}this.x=t,this.pswp.container&&a(this.pswp.container,t),this.pswp.dispatch("moveMainScroll",{x:t,dragging:i??!1})}}const z=.003;class C{constructor(t){this.pswp=t,this.isClosed=!0,this.isOpen=!1,this.isClosing=!1,this.isOpening=!1,this._duration=void 0,this._useAnimation=!1,this._croppedZoom=!1,this._animateRootOpacity=!1,this._animateBgOpacity=!1,this._placeholder=void 0,this._opacityElement=void 0,this._cropContainer1=void 0,this._cropContainer2=void 0,this._thumbBounds=void 0,this._prepareOpen=this._prepareOpen.bind(this),t.on("firstZoomPan",this._prepareOpen)}open(){this._prepareOpen(),this._start()}close(){if(this.isClosed||this.isClosing||this.isOpening)return;const t=this.pswp.currSlide;this.isOpen=!1,this.isOpening=!1,this.isClosing=!0,this._duration=this.pswp.options.hideAnimationDuration,t&&t.currZoomLevel*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps(),setTimeout(()=>{this._start()},this._croppedZoom?30:0)}_prepareOpen(){if(this.pswp.off("firstZoomPan",this._prepareOpen),!this.isOpening){const t=this.pswp.currSlide;this.isOpening=!0,this.isClosing=!1,this._duration=this.pswp.options.showAnimationDuration,t&&t.zoomLevels.initial*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps()}}_applyStartProps(){const{pswp:t}=this,i=this.pswp.currSlide,{options:s}=t;if("fade"===s.showHideAnimationType?(s.showHideOpacity=!0,this._thumbBounds=void 0):"none"===s.showHideAnimationType?(s.showHideOpacity=!1,this._duration=0,this._thumbBounds=void 0):this.isOpening&&t._initialThumbBounds?this._thumbBounds=t._initialThumbBounds:this._thumbBounds=this.pswp.getThumbBounds(),this._placeholder=i?.getPlaceholderElement(),t.animations.stopAll(),this._useAnimation=!!(this._duration&&this._duration>50),this._animateZoom=!!this._thumbBounds&&i?.content.usePlaceholder()&&(!this.isClosing||!t.mainScroll.isShifted()),this._animateZoom?this._animateRootOpacity=s.showHideOpacity??!1:(this._animateRootOpacity=!0,this.isOpening&&i&&(i.zoomAndPanToInitial(),i.applyCurrentZoomPan())),this._animateBgOpacity=!this._animateRootOpacity&&this.pswp.options.bgOpacity>z,this._opacityElement=this._animateRootOpacity?t.element:t.bg,!this._useAnimation)return this._duration=0,this._animateZoom=!1,this._animateBgOpacity=!1,this._animateRootOpacity=!0,void(this.isOpening&&(t.element&&(t.element.style.opacity=String(z)),t.applyBgOpacity(1)));this._animateZoom&&this._thumbBounds&&this._thumbBounds.innerRect?(this._croppedZoom=!0,this._cropContainer1=this.pswp.container,this._cropContainer2=this.pswp.currSlide?.holderElement,t.container&&(t.container.style.overflow="hidden",t.container.style.width=t.viewportSize.x+"px")):this._croppedZoom=!1,this.isOpening?(this._animateRootOpacity?(t.element&&(t.element.style.opacity=String(z)),t.applyBgOpacity(1)):(this._animateBgOpacity&&t.bg&&(t.bg.style.opacity=String(z)),t.element&&(t.element.style.opacity="1")),this._animateZoom&&(this._setClosedStateZoomPan(),this._placeholder&&(this._placeholder.style.willChange="transform",this._placeholder.style.opacity=String(z)))):this.isClosing&&(t.mainScroll.itemHolders[0]&&(t.mainScroll.itemHolders[0].el.style.display="none"),t.mainScroll.itemHolders[2]&&(t.mainScroll.itemHolders[2].el.style.display="none"),this._croppedZoom&&0!==t.mainScroll.x&&(t.mainScroll.resetPosition(),t.mainScroll.resize()))}_start(){this.isOpening&&this._useAnimation&&this._placeholder&&"IMG"===this._placeholder.tagName?new Promise(t=>{let i=!1,s=!0;h(this._placeholder).finally(()=>{i=!0,s||t(!0)}),setTimeout(()=>{s=!1,i&&t(!0)},50),setTimeout(t,250)}).finally(()=>this._initiate()):this._initiate()}_initiate(){this.pswp.element?.style.setProperty("--pswp-transition-duration",this._duration+"ms"),this.pswp.dispatch(this.isOpening?"openingAnimationStart":"closingAnimationStart"),this.pswp.dispatch("initialZoom"+(this.isOpening?"In":"Out")),this.pswp.element?.classList.toggle("pswp--ui-visible",this.isOpening),this.isOpening?(this._placeholder&&(this._placeholder.style.opacity="1"),this._animateToOpenState()):this.isClosing&&this._animateToClosedState(),this._useAnimation||this._onAnimationComplete()}_onAnimationComplete(){const{pswp:t}=this;this.isOpen=this.isOpening,this.isClosed=this.isClosing,this.isOpening=!1,this.isClosing=!1,t.dispatch(this.isOpen?"openingAnimationEnd":"closingAnimationEnd"),t.dispatch("initialZoom"+(this.isOpen?"InEnd":"OutEnd")),this.isClosed?t.destroy():this.isOpen&&(this._animateZoom&&t.container&&(t.container.style.overflow="visible",t.container.style.width="100%"),t.currSlide?.applyCurrentZoomPan())}_animateToOpenState(){const{pswp:t}=this;this._animateZoom&&(this._croppedZoom&&this._cropContainer1&&this._cropContainer2&&(this._animateTo(this._cropContainer1,"transform","translate3d(0,0,0)"),this._animateTo(this._cropContainer2,"transform","none")),t.currSlide&&(t.currSlide.zoomAndPanToInitial(),this._animateTo(t.currSlide.container,"transform",t.currSlide.getCurrentTransform()))),this._animateBgOpacity&&t.bg&&this._animateTo(t.bg,"opacity",String(t.options.bgOpacity)),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","1")}_animateToClosedState(){const{pswp:t}=this;this._animateZoom&&this._setClosedStateZoomPan(!0),this._animateBgOpacity&&t.bgOpacity>.01&&t.bg&&this._animateTo(t.bg,"opacity","0"),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","0")}_setClosedStateZoomPan(i){if(!this._thumbBounds)return;const{pswp:s}=this,{innerRect:e}=this._thumbBounds,{currSlide:o,viewportSize:n}=s;if(this._croppedZoom&&e&&this._cropContainer1&&this._cropContainer2){const t=-n.x+(this._thumbBounds.x-e.x)+e.w,s=-n.y+(this._thumbBounds.y-e.y)+e.h,o=n.x-e.w,r=n.y-e.h;i?(this._animateTo(this._cropContainer1,"transform",p(t,s)),this._animateTo(this._cropContainer2,"transform",p(o,r))):(a(this._cropContainer1,t,s),a(this._cropContainer2,o,r))}o&&(t(o.pan,e||this._thumbBounds),o.currZoomLevel=this._thumbBounds.w/o.width,i?this._animateTo(o.container,"transform",o.getCurrentTransform()):o.applyCurrentZoomPan())}_animateTo(t,i,s){if(!this._duration)return void(t.style[i]=s);const{animations:e}=this.pswp,o={duration:this._duration,easing:this.pswp.options.easing,onComplete:()=>{e.activeAnimations.length||this._onAnimationComplete()},target:t};o[i]=s,e.startTransition(o)}}class Z{constructor(t){this.pswp=t,t.events.add(t.element,"wheel",this._onWheel.bind(this))}_onWheel(t){t.preventDefault();const{currSlide:i}=this.pswp;let{deltaX:s,deltaY:e}=t;if(i&&!this.pswp.dispatch("wheel",{originalEvent:t}).defaultPrevented)if(t.ctrlKey||this.pswp.options.wheelToZoom){if(i.isZoomable()){let s=-e;1===t.deltaMode?s*=.05:s*=t.deltaMode?1:.002,s=2**s;const o=i.currZoomLevel*s;i.zoomTo(o,{x:t.clientX,y:t.clientY})}}else i.isPannable()&&(1===t.deltaMode&&(s*=18,e*=18),i.panTo(i.pan.x-s,i.pan.y-e))}}class I{constructor(t){this.slide=t,this.currZoomLevel=1,this.center={x:0,y:0},this.max={x:0,y:0},this.min={x:0,y:0}}update(t){this.currZoomLevel=t,this.slide.width?(this._updateAxis("x"),this._updateAxis("y"),this.slide.pswp.dispatch("calcBounds",{slide:this.slide})):this.reset()}_updateAxis(t){const{pswp:i}=this.slide,s=this.slide["x"===t?"width":"height"]*this.currZoomLevel,e=l("x"===t?"left":"top",i.options,i.viewportSize,this.slide.data,this.slide.index),o=this.slide.panAreaSize[t];this.center[t]=Math.round((o-s)/2)+e,this.max[t]=s>o?Math.round(o-s)+e:this.center[t],this.min[t]=s>o?e:this.center[t]}reset(){this.center.x=0,this.center.y=0,this.max.x=0,this.max.y=0,this.min.x=0,this.min.y=0}correctPan(t,i){return s(i,this.max[t],this.min[t])}}class O{constructor(t,i,s){this.data=t,this.index=i,this.pswp=s,this.isActive=i===s.currIndex,this.currentResolution=0,this.panAreaSize={x:0,y:0},this.pan={x:0,y:0},this.isFirstSlide=this.isActive&&!s.opener.isOpen,this.zoomLevels=new c(s.options,t,i,s),this.pswp.dispatch("gettingData",{slide:this,data:this.data,index:i}),this.content=this.pswp.contentLoader.getContentBySlide(this),this.container=r("pswp__zoom-wrap","div"),this.holderElement=null,this.currZoomLevel=1,this.width=this.content.width,this.height=this.content.height,this.heavyAppended=!1,this.bounds=new I(this),this.prevDisplayedWidth=-1,this.prevDisplayedHeight=-1,this.pswp.dispatch("slideInit",{slide:this})}setIsActive(t){t&&!this.isActive?this.activate():!t&&this.isActive&&this.deactivate()}append(t){this.holderElement=t,this.container.style.transformOrigin="0 0",this.data&&(this.calculateSize(),this.load(),this.updateContentSize(),this.appendHeavy(),this.holderElement.appendChild(this.container),this.zoomAndPanToInitial(),this.pswp.dispatch("firstZoomPan",{slide:this}),this.applyCurrentZoomPan(),this.pswp.dispatch("afterSetContent",{slide:this}),this.isActive&&this.activate())}load(){this.content.load(!1),this.pswp.dispatch("slideLoad",{slide:this})}appendHeavy(){const{pswp:t}=this;this.heavyAppended||!t.opener.isOpen||t.mainScroll.isShifted()||(this.isActive,0)||this.pswp.dispatch("appendHeavy",{slide:this}).defaultPrevented||(this.heavyAppended=!0,this.content.append(),this.pswp.dispatch("appendHeavyContent",{slide:this}))}activate(){this.isActive=!0,this.appendHeavy(),this.content.activate(),this.pswp.dispatch("slideActivate",{slide:this})}deactivate(){this.isActive=!1,this.content.deactivate(),this.currZoomLevel!==this.zoomLevels.initial&&this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize(),this.pswp.dispatch("slideDeactivate",{slide:this})}destroy(){this.content.hasSlide=!1,this.content.remove(),this.container.remove(),this.pswp.dispatch("slideDestroy",{slide:this})}resize(){this.currZoomLevel!==this.zoomLevels.initial&&this.isActive?(this.calculateSize(),this.bounds.update(this.currZoomLevel),this.panTo(this.pan.x,this.pan.y)):(this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize())}updateContentSize(t){const i=this.currentResolution||this.zoomLevels.initial;if(!i)return;const s=Math.round(this.width*i)||this.pswp.viewportSize.x,e=Math.round(this.height*i)||this.pswp.viewportSize.y;!this.sizeChanged(s,e)&&!t||this.content.setDisplayedSize(s,e)}sizeChanged(t,i){return(t!==this.prevDisplayedWidth||i!==this.prevDisplayedHeight)&&(this.prevDisplayedWidth=t,this.prevDisplayedHeight=i,!0)}getPlaceholderElement(){return this.content.placeholder?.element}zoomTo(t,e,o,n){const{pswp:a}=this;if(!this.isZoomable()||a.mainScroll.isShifted())return;a.dispatch("beforeZoomTo",{destZoomLevel:t,centerPoint:e,transitionDuration:o}),a.animations.stopAllPan();const r=this.currZoomLevel;n||(t=s(t,this.zoomLevels.min,this.zoomLevels.max)),this.setZoomLevel(t),this.pan.x=this.calculateZoomToPanOffset("x",e,r),this.pan.y=this.calculateZoomToPanOffset("y",e,r),i(this.pan);const h=()=>{this._setResolution(t),this.applyCurrentZoomPan()};o?a.animations.startTransition({isPan:!0,name:"zoomTo",target:this.container,transform:this.getCurrentTransform(),onComplete:h,duration:o,easing:a.options.easing}):h()}toggleZoom(t){this.zoomTo(this.currZoomLevel===this.zoomLevels.initial?this.zoomLevels.secondary:this.zoomLevels.initial,t,this.pswp.options.zoomAnimationDuration)}setZoomLevel(t){this.currZoomLevel=t,this.bounds.update(this.currZoomLevel)}calculateZoomToPanOffset(t,i,s){if(this.bounds.max[t]-this.bounds.min[t]===0)return this.bounds.center[t];i||(i=this.pswp.getViewportCenterPoint()),s||(s=this.zoomLevels.initial);const e=this.currZoomLevel/s;return this.bounds.correctPan(t,(this.pan[t]-i[t])*e+i[t])}panTo(t,i){this.pan.x=this.bounds.correctPan("x",t),this.pan.y=this.bounds.correctPan("y",i),this.applyCurrentZoomPan()}isPannable(){return!!this.width&&this.currZoomLevel>this.zoomLevels.fit}isZoomable(){return!!this.width&&this.content.isZoomable()}applyCurrentZoomPan(){this._applyZoomTransform(this.pan.x,this.pan.y,this.currZoomLevel),this===this.pswp.currSlide&&this.pswp.dispatch("zoomPanUpdate",{slide:this})}zoomAndPanToInitial(){this.currZoomLevel=this.zoomLevels.initial,this.bounds.update(this.currZoomLevel),t(this.pan,this.bounds.center),this.pswp.dispatch("initialZoomPan",{slide:this})}_applyZoomTransform(t,i,s){s/=this.currentResolution||this.zoomLevels.initial,a(this.container,t,i,s)}calculateSize(){const{pswp:i}=this;t(this.panAreaSize,d(i.options,i.viewportSize,this.data,this.index)),this.zoomLevels.update(this.width,this.height,this.panAreaSize),i.dispatch("calcSlideSize",{slide:this})}getCurrentTransform(){const t=this.currZoomLevel/(this.currentResolution||this.zoomLevels.initial);return p(this.pan.x,this.pan.y,t)}_setResolution(t){t!==this.currentResolution&&(this.currentResolution=t,this.updateContentSize(),this.pswp.dispatch("resolutionChanged"))}}function D(t,i,s){t.classList.add("pswp__button--arrow"),t.setAttribute("aria-controls","pswp__items"),i.on("change",()=>{i.options.loop||(t.disabled=s?!(i.currIndex<i.getNumItems()-1):!(i.currIndex>0))})}const E={name:"arrowPrev",className:"pswp__button--arrow--prev",title:"Previous",order:10,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<path d="M29 43l-3 3-16-16 16-16 3 3-13 13 13 13z" id="pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"prev",onInit:D},M={name:"arrowNext",className:"pswp__button--arrow--next",title:"Next",order:11,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<use xlink:href="#pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"next",onInit:(t,i)=>{D(t,i,!0)}},F={name:"close",title:"Close",order:20,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M24 10l-2-2-6 6-6-6-2 2 6 6-6 6 2 2 6-6 6 6 2-2-6-6z" id="pswp__icn-close"/>',outlineID:"pswp__icn-close"},onClick:"close"},B={name:"zoom",title:"Zoom",order:10,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M17.426 19.926a6 6 0 1 1 1.5-1.5L23 22.5 21.5 24l-4.074-4.074z" id="pswp__icn-zoom"/><path fill="currentColor" class="pswp__zoom-icn-bar-h" d="M11 16v-2h6v2z"/><path fill="currentColor" class="pswp__zoom-icn-bar-v" d="M13 12h2v6h-2z"/>',outlineID:"pswp__icn-zoom"},onClick:"toggleZoom"},R={name:"counter",order:5,onInit:(t,i)=>{i.on("change",()=>{t.innerText=i.currIndex+1+i.options.indexIndicatorSep+i.getNumItems()})}},k={name:"preloader",appendTo:"bar",order:7,html:{isCustomSVG:!0,inner:'<path fill-rule="evenodd" clip-rule="evenodd" d="M21.2 16a5.2 5.2 0 1 1-5.2-5.2V8a8 8 0 1 0 8 8h-2.8Z" id="pswp__icn-loading"/>',outlineID:"pswp__icn-loading"},onInit:(t,i)=>{let s,e=null;const o=i=>{s!==i&&(s=i,((i,s)=>{t.classList.toggle("pswp__preloader--"+i,s)})("active",i))},n=()=>{if(!i.currSlide?.content.isLoading())return o(!1),void(e&&(clearTimeout(e),e=null));e||(e=setTimeout(()=>{o(!!i.currSlide?.content.isLoading()),e=null},i.options.preloaderDelay))};i.on("change",n),i.on("loadComplete",t=>{i.currSlide===t.slide&&n()}),i.ui&&(i.ui.updatePreloaderVisibility=n)}};class H{constructor(t,i){const s=i.name||i.className;let e=i.html;if(!1===t.options[s])return;"string"==typeof t.options[s+"SVG"]&&(e=t.options[s+"SVG"]),t.dispatch("uiElementCreate",{data:i});let o="";i.isButton?(o+="pswp__button ",o+=i.className||`pswp__button--${i.name}`):o+=i.className||`pswp__${i.name}`;let n=i.isButton?i.tagName||"button":i.tagName||"div";n=n.toLowerCase();const a=r(o,n);if(i.isButton){"button"===n&&(a.type="button");let{title:e}=i;const{ariaLabel:o}=i;"string"==typeof t.options[s+"Title"]&&(e=t.options[s+"Title"]),e&&(a.title=e);const r=o||e;r&&a.setAttribute("aria-label",r)}a.innerHTML=function(t){if("string"==typeof t)return t;if(!t||!t.isCustomSVG)return"";const i=t;let s='<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 %d %d" width="%d" height="%d">';return s=s.split("%d").join(i.size||32),i.outlineID&&(s+='<use class="pswp__icn-shadow" xlink:href="#'+i.outlineID+'"/>'),s+=i.inner,s+="</svg>",s}(e),i.onInit&&i.onInit(a,t),i.onClick&&(a.onclick=s=>{"string"==typeof i.onClick?t[i.onClick]():"function"==typeof i.onClick&&i.onClick(s,a,t)});const h=i.appendTo||"bar";let p=t.element;"bar"===h?(t.topBar||(t.topBar=r("pswp__top-bar pswp__hide-on-close","div",t.scrollWrap)),p=t.topBar):(a.classList.add("pswp__hide-on-close"),"wrapper"===h&&(p=t.scrollWrap)),p?.appendChild(t.applyFilters("uiElement",a,i))}}function W(t,i){t.classList.toggle("pswp--zoomed-in",i)}class N{constructor(t){this.pswp=t,this.isRegistered=!1,this.uiElementsData=[],this.items=[],this.updatePreloaderVisibility=()=>{},this._lastUpdatedZoomLevel=void 0}init(){const{pswp:t}=this;this.isRegistered=!1,this.uiElementsData=[F,E,M,B,k,R],t.dispatch("uiRegister"),this.uiElementsData.sort((t,i)=>(t.order||0)-(i.order||0)),this.items=[],this.isRegistered=!0,this.uiElementsData.forEach(t=>{this.registerElement(t)}),t.on("change",()=>{t.element?.classList.toggle("pswp--one-slide",1===t.getNumItems())}),t.on("zoomPanUpdate",()=>this._onZoomPanUpdate())}registerElement(t){this.isRegistered?this.items.push(new H(this.pswp,t)):this.uiElementsData.push(t)}_onZoomPanUpdate(){const{template:t,currSlide:i,options:s}=this.pswp;if(this.pswp.opener.isClosing||!t||!i)return;let{currZoomLevel:e}=i;if(this.pswp.opener.isOpen||(e=i.zoomLevels.initial),e===this._lastUpdatedZoomLevel)return;this._lastUpdatedZoomLevel=e;const o=i.zoomLevels.initial-i.zoomLevels.secondary;if(Math.abs(o)<.01||!i.isZoomable())return W(t,!1),void t.classList.remove("pswp--zoom-allowed");t.classList.add("pswp--zoom-allowed");W(t,(e===i.zoomLevels.initial?i.zoomLevels.secondary:i.zoomLevels.initial)<=e),("zoom"===s.imageClickAction||"zoom-or-close"===s.imageClickAction)&&t.classList.add("pswp--click-to-zoom")}}const V="cubic-bezier(.4,0,.22,1)";class q{constructor(t){this.props=t;const{target:i,onComplete:s,transform:e,onFinish:o=()=>{},duration:n=333,easing:a=V}=t;this.onFinish=o;const r=e?"transform":"opacity",h=t[r]??"";this._target=i,this._onComplete=s,this._finished=!1,this._onTransitionEnd=this._onTransitionEnd.bind(this),this._helperTimeout=setTimeout(()=>{u(i,r,n,a),this._helperTimeout=setTimeout(()=>{i.addEventListener("transitionend",this._onTransitionEnd,!1),i.addEventListener("transitioncancel",this._onTransitionEnd,!1),this._helperTimeout=setTimeout(()=>{this._finalizeAnimation()},n+500),i.style[r]=h},30)},0)}_onTransitionEnd(t){t.target===this._target&&this._finalizeAnimation()}_finalizeAnimation(){this._finished||(this._finished=!0,this.onFinish(),this._onComplete&&this._onComplete())}destroy(){this._helperTimeout&&(clearTimeout(this._helperTimeout),this._helperTimeout=null),m(this._target),this._target.removeEventListener("transitionend",this._onTransitionEnd,!1),this._target.removeEventListener("transitioncancel",this._onTransitionEnd,!1),this._finished||this._finalizeAnimation()}}class U{constructor(t,i,s){this.velocity=1e3*t,this._dampingRatio=i||.75,this._naturalFrequency=s||12,this._dampedFrequency=this._naturalFrequency,this._dampingRatio<1&&(this._dampedFrequency*=Math.sqrt(1-this._dampingRatio*this._dampingRatio))}easeFrame(t,i){let s,e=0;i/=1e3;const o=Math.E**(-this._dampingRatio*this._naturalFrequency*i);if(1===this._dampingRatio)s=this.velocity+this._naturalFrequency*t,e=(t+s*i)*o,this.velocity=e*-this._naturalFrequency+s*o;else if(this._dampingRatio<1){s=1/this._dampedFrequency*(this._dampingRatio*this._naturalFrequency*t+this.velocity);const n=Math.cos(this._dampedFrequency*i),a=Math.sin(this._dampedFrequency*i);e=o*(t*n+s*a),this.velocity=e*-this._naturalFrequency*this._dampingRatio+o*(-this._dampedFrequency*t*a+this._dampedFrequency*s*n)}return e}}class G{constructor(t){this.props=t,this._raf=0;const{start:i,end:s,velocity:e,onUpdate:o,onComplete:n,onFinish:a=()=>{},dampingRatio:r,naturalFrequency:h}=t;this.onFinish=a;const p=new U(e,r,h);let l=Date.now(),c=i-s;const d=()=>{this._raf&&(c=p.easeFrame(c,Date.now()-l),Math.abs(c)<1&&Math.abs(p.velocity)<50?(o(s),n&&n(),this.onFinish()):(l=Date.now(),o(c+s),this._raf=requestAnimationFrame(d)))};this._raf=requestAnimationFrame(d)}destroy(){this._raf>=0&&cancelAnimationFrame(this._raf),this._raf=0}}class X{constructor(){this.activeAnimations=[]}startSpring(t){this._start(t,!0)}startTransition(t){this._start(t)}_start(t,i){const s=i?new G(t):new q(t);return this.activeAnimations.push(s),s.onFinish=()=>this.stop(s),s}stop(t){t.destroy();const i=this.activeAnimations.indexOf(t);i>-1&&this.activeAnimations.splice(i,1)}stopAll(){this.activeAnimations.forEach(t=>{t.destroy()}),this.activeAnimations=[]}stopAllPan(){this.activeAnimations=this.activeAnimations.filter(t=>!t.props.isPan||(t.destroy(),!1))}stopMainScroll(){this.activeAnimations=this.activeAnimations.filter(t=>!t.props.isMainScroll||(t.destroy(),!1))}isPanRunning(){return this.activeAnimations.some(t=>t.props.isPan)}}let K=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{K=!0}}))}catch{}class Y{constructor(){this._pool=[]}add(t,i,s,e){this._toggleListener(t,i,s,e)}remove(t,i,s,e){this._toggleListener(t,i,s,e,!0)}removeAll(){this._pool.forEach(t=>{this._toggleListener(t.target,t.type,t.listener,t.passive,!0,!0)}),this._pool=[]}_toggleListener(t,i,s,e,o,n){if(!t)return;const a=o?"removeEventListener":"addEventListener";i.split(" ").forEach(i=>{if(i){n||(o?this._pool=this._pool.filter(e=>e.type!==i||e.listener!==s||e.target!==t):this._pool.push({target:t,type:i,listener:s,passive:e}));const r=!!K&&{passive:e||!1};t[a](i,s,r)}})}}const j={allowPanToNext:!0,spacing:.1,loop:!0,pinchToClose:!0,closeOnVerticalDrag:!0,hideAnimationDuration:333,showAnimationDuration:333,zoomAnimationDuration:333,escKey:!0,arrowKeys:!0,trapFocus:!0,returnFocus:!0,maxWidthToAnimate:4e3,clickToCloseNonZoomable:!0,imageClickAction:"zoom-or-close",bgClickAction:"close",tapAction:"toggle-controls",doubleTapAction:"zoom",indexIndicatorSep:" / ",preloaderDelay:2e3,bgOpacity:.8,index:0,errorMsg:"The image cannot be loaded",preload:[1,2],easing:"cubic-bezier(.4,0,.22,1)"};class $ extends _{constructor(t){super(),this.options=this._prepareOptions(t||{}),this.offset={x:0,y:0},this._prevViewportSize={x:0,y:0},this.viewportSize={x:0,y:0},this.bgOpacity=1,this.currIndex=0,this.potentialIndex=0,this.isOpen=!1,this.isDestroying=!1,this.hasMouse=!1,this._initialItemData={},this._initialThumbBounds=void 0,this.topBar=void 0,this.element=void 0,this.template=void 0,this.container=void 0,this.scrollWrap=void 0,this.currSlide=void 0,this.events=new Y,this.animations=new X,this.mainScroll=new A(this),this.gestures=new S(this),this.opener=new C(this),this.keyboard=new L(this),this.contentLoader=new v(this)}init(){if(this.isOpen||this.isDestroying)return!1;this.isOpen=!0,this.dispatch("init"),this.dispatch("beforeOpen"),this._createMainStructure();let t="pswp--open";return this.gestures.supportsTouch&&(t+=" pswp--touch"),this.options.mainClass&&(t+=" "+this.options.mainClass),this.element&&(this.element.className+=" "+t),this.currIndex=this.options.index||0,this.potentialIndex=this.currIndex,this.dispatch("firstUpdate"),this.scrollWheel=new Z(this),(Number.isNaN(this.currIndex)||this.currIndex<0||this.currIndex>=this.getNumItems())&&(this.currIndex=0),this.gestures.supportsTouch||this.mouseDetected(),this.updateSize(),this.offset.y=window.pageYOffset,this._initialItemData=this.getItemData(this.currIndex),this.dispatch("gettingData",{index:this.currIndex,data:this._initialItemData,slide:void 0}),this._initialThumbBounds=this.getThumbBounds(),this.dispatch("initialLayout"),this.on("openingAnimationEnd",()=>{const{itemHolders:t}=this.mainScroll;t[0]&&(t[0].el.style.display="block",this.setContent(t[0],this.currIndex-1)),t[2]&&(t[2].el.style.display="block",this.setContent(t[2],this.currIndex+1)),this.appendHeavy(),this.contentLoader.updateLazy(),this.events.add(window,"resize",this._handlePageResize.bind(this)),this.events.add(window,"scroll",this._updatePageScrollOffset.bind(this)),this.dispatch("bindEvents")}),this.mainScroll.itemHolders[1]&&this.setContent(this.mainScroll.itemHolders[1],this.currIndex),this.dispatch("change"),this.opener.open(),this.dispatch("afterInit"),!0}getLoopedIndex(t){const i=this.getNumItems();return this.options.loop&&(t>i-1&&(t-=i),t<0&&(t+=i)),s(t,0,i-1)}appendHeavy(){this.mainScroll.itemHolders.forEach(t=>{t.slide?.appendHeavy()})}goTo(t){this.mainScroll.moveIndexBy(this.getLoopedIndex(t)-this.potentialIndex,!0)}next(){this.goTo(this.potentialIndex+1)}prev(){this.goTo(this.potentialIndex-1)}zoomTo(...t){this.currSlide?.zoomTo(...t)}toggleZoom(){this.currSlide?.toggleZoom()}close(){!this.opener.isOpen||this.isDestroying||(this.isDestroying=!0,this.dispatch("close"),this.events.removeAll(),this.opener.close())}destroy(){if(!this.isDestroying)return this.options.showHideAnimationType="none",void this.close();this.dispatch("destroy"),this._listeners={},this.scrollWrap&&(this.scrollWrap.ontouchmove=null,this.scrollWrap.ontouchend=null),this.element?.remove(),this.mainScroll.itemHolders.forEach(t=>{t.slide?.destroy()}),this.contentLoader.destroy(),this.events.removeAll()}refreshSlideContent(t){this.contentLoader.removeByIndex(t),this.mainScroll.itemHolders.forEach((i,s)=>{let e=(this.currSlide?.index??0)-1+s;this.canLoop()&&(e=this.getLoopedIndex(e)),e===t&&(this.setContent(i,t,!0),1===s&&(this.currSlide=i.slide,i.slide?.setIsActive(!0)))}),this.dispatch("change")}setContent(t,i,s){if(this.canLoop()&&(i=this.getLoopedIndex(i)),t.slide){if(t.slide.index===i&&!s)return;t.slide.destroy(),t.slide=void 0}if(!this.canLoop()&&(i<0||i>=this.getNumItems()))return;const e=this.getItemData(i);t.slide=new O(e,i,this),i===this.currIndex&&(this.currSlide=t.slide),t.slide.append(t.el)}getViewportCenterPoint(){return{x:this.viewportSize.x/2,y:this.viewportSize.y/2}}updateSize(i){if(this.isDestroying)return;const s=g(this.options,this);!i&&o(s,this._prevViewportSize)||(t(this._prevViewportSize,s),this.dispatch("beforeResize"),t(this.viewportSize,this._prevViewportSize),this._updatePageScrollOffset(),this.dispatch("viewportSize"),this.mainScroll.resize(this.opener.isOpen),!this.hasMouse&&window.matchMedia("(any-hover: hover)").matches&&this.mouseDetected(),this.dispatch("resize"))}applyBgOpacity(t){this.bgOpacity=Math.max(t,0),this.bg&&(this.bg.style.opacity=String(this.bgOpacity*this.options.bgOpacity))}mouseDetected(){this.hasMouse||(this.hasMouse=!0,this.element?.classList.add("pswp--has_mouse"))}_handlePageResize(){this.updateSize(),/iPhone|iPad|iPod/i.test(window.navigator.userAgent)&&setTimeout(()=>{this.updateSize()},500)}_updatePageScrollOffset(){this.setScrollOffset(0,window.pageYOffset)}setScrollOffset(t,i){this.offset.x=t,this.offset.y=i,this.dispatch("updateScrollOffset")}_createMainStructure(){this.element=r("pswp","div"),this.element.setAttribute("tabindex","-1"),this.element.setAttribute("role","dialog"),this.template=this.element,this.bg=r("pswp__bg","div",this.element),this.scrollWrap=r("pswp__scroll-wrap","section",this.element),this.container=r("pswp__container","div",this.scrollWrap),this.scrollWrap.setAttribute("aria-roledescription","carousel"),this.container.setAttribute("aria-live","off"),this.container.setAttribute("id","pswp__items"),this.mainScroll.appendHolders(),this.ui=new N(this),this.ui.init(),(this.options.appendToEl||document.body).appendChild(this.element)}getThumbBounds(){return function(t,i,s){const e=s.dispatch("thumbBounds",{index:t,itemData:i,instance:s});if(e.thumbBounds)return e.thumbBounds;const{element:o}=i;let n,a;if(o&&!1!==s.options.thumbSelector){const t=s.options.thumbSelector||"img";a=o.matches(t)?o:o.querySelector(t)}return a=s.applyFilters("thumbEl",a,i,t),a&&(n=i.thumbCropped?function(t,i,s){const e=t.getBoundingClientRect(),o=e.width/i,n=e.height/s,a=o>n?o:n,r=(e.width-i*a)/2,h=(e.height-s*a)/2,p={x:e.left+r,y:e.top+h,w:i*a};return p.innerRect={w:e.width,h:e.height,x:r,y:h},p}(a,i.width||i.w||0,i.height||i.h||0):function(t){const i=t.getBoundingClientRect();return{x:i.left,y:i.top,w:i.width}}(a)),s.applyFilters("thumbBounds",n,i,t)}(this.currIndex,this.currSlide?this.currSlide.data:this._initialItemData,this)}canLoop(){return this.options.loop&&this.getNumItems()>2}_prepareOptions(t){return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches&&(t.showHideAnimationType="none",t.zoomAnimationDuration=0),{...j,...t}}}export{$ as default};
|
|
1
|
+
import{e as t,r as i,c as s,g as e,p as o,s as n,a,b as r,d as h,t as p,f as l,Z as c,h as d,i as u,j as m,P as _,C as v,k as g}from"./De-cdzUn.js";class y{constructor(t){this.gestures=t,this.pswp=t.pswp,this.startPan={x:0,y:0}}start(){this.pswp.currSlide&&t(this.startPan,this.pswp.currSlide.pan),this.pswp.animations.stopAll()}change(){const{p1:t,prevP1:s,dragAxis:e}=this.gestures,{currSlide:o}=this.pswp;if("y"===e&&this.pswp.options.closeOnVerticalDrag&&o&&o.currZoomLevel<=o.zoomLevels.fit&&!this.gestures.isMultitouch){const i=o.pan.y+(t.y-s.y);if(!this.pswp.dispatch("verticalDrag",{panY:i}).defaultPrevented){this._setPanWithFriction("y",i,.6);const t=1-Math.abs(this._getVerticalDragRatio(o.pan.y));this.pswp.applyBgOpacity(t),o.applyCurrentZoomPan()}}else this._panOrMoveMainScroll("x")||(this._panOrMoveMainScroll("y"),o&&(i(o.pan),o.applyCurrentZoomPan()))}end(){const{velocity:t}=this.gestures,{mainScroll:i,currSlide:s}=this.pswp;let e=0;if(this.pswp.animations.stopAll(),i.isShifted()){const s=(i.x-i.getCurrSlideX())/this.pswp.viewportSize.x;t.x<-.5&&s<0||t.x<.1&&s<-.5?(e=1,t.x=Math.min(t.x,0)):(t.x>.5&&s>0||t.x>-.1&&s>.5)&&(e=-1,t.x=Math.max(t.x,0)),i.moveIndexBy(e,!0,t.x,!0)}s&&s.currZoomLevel>s.zoomLevels.max||this.gestures.isMultitouch?this.gestures.zoomLevels.correctZoomPan(!0):(this._finishPanGestureForAxis("x"),this._finishPanGestureForAxis("y"))}_finishPanGestureForAxis(t){const{velocity:i}=this.gestures,{currSlide:e}=this.pswp;if(!e)return;const{pan:o,bounds:n}=e,a=o[t],r=this.pswp.bgOpacity<1&&"y"===t,h=a+function(t,i){return t*i/(1-i)}(i[t],.995);if(r){const t=this._getVerticalDragRatio(a),i=this._getVerticalDragRatio(h);if(t<0&&i<-.4||t>0&&i>.4)return void this.pswp.close()}const p=n.correctPan(t,h);if(a===p)return;const l=p===h?1:.82,c=this.pswp.bgOpacity,d=p-a;this.pswp.animations.startSpring({name:"panGesture"+t,isPan:!0,start:a,end:p,velocity:i[t],dampingRatio:l,onUpdate:i=>{if(r&&this.pswp.bgOpacity<1){const t=1-(p-i)/d;this.pswp.applyBgOpacity(s(c+(1-c)*t,0,1))}o[t]=Math.floor(i),e.applyCurrentZoomPan()}})}_panOrMoveMainScroll(t){const{p1:i,dragAxis:s,prevP1:e,isMultitouch:o}=this.gestures,{currSlide:n,mainScroll:a}=this.pswp,r=i[t]-e[t],h=a.x+r;if(!r||!n)return!1;if("x"===t&&!n.isPannable()&&!o)return a.moveTo(h,!0),!0;const{bounds:p}=n,l=n.pan[t]+r;if(this.pswp.options.allowPanToNext&&"x"===s&&"x"===t&&!o){const i=a.getCurrSlideX(),s=a.x-i,e=r>0,o=!e;if(l>p.min[t]&&e){if(p.min[t]<=this.startPan[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,l)}else if(l<p.max[t]&&o){if(this.startPan[t]<=p.max[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,l)}else if(0!==s){if(s>0)return a.moveTo(Math.max(h,i),!0),!0;if(s<0)return a.moveTo(Math.min(h,i),!0),!0}else this._setPanWithFriction(t,l)}else"y"===t?!a.isShifted()&&p.min.y!==p.max.y&&this._setPanWithFriction(t,l):this._setPanWithFriction(t,l);return!1}_getVerticalDragRatio(t){return(t-(this.pswp.currSlide?.bounds.center.y??0))/(this.pswp.viewportSize.y/3)}_setPanWithFriction(t,i,s){const{currSlide:e}=this.pswp;if(!e)return;const{pan:o,bounds:n}=e;if(n.correctPan(t,i)!==i||s){const e=Math.round(i-o[t]);o[t]+=e*(s||.35)}else o[t]=i}}function w(t){return!!t.target.closest(".pswp__container")}class f{constructor(t){this.gestures=t}click(t,i){const s=i.target.classList,e=s.contains("pswp__img"),o=s.contains("pswp__item")||s.contains("pswp__zoom-wrap");e?this._doClickOrTapAction("imageClick",t,i):o&&this._doClickOrTapAction("bgClick",t,i)}tap(t,i){w(i)&&this._doClickOrTapAction("tap",t,i)}doubleTap(t,i){w(i)&&this._doClickOrTapAction("doubleTap",t,i)}_doClickOrTapAction(t,i,s){const{pswp:e}=this.gestures,{currSlide:o}=e,n=t+"Action",a=e.options[n];if(!e.dispatch(n,{point:i,originalEvent:s}).defaultPrevented){if("function"==typeof a)return void a.call(e,i,s);switch(a){case"close":case"next":e[a]();break;case"zoom":o?.toggleZoom(i);break;case"zoom-or-close":o?.isZoomable()&&o.zoomLevels.secondary!==o.zoomLevels.initial?o.toggleZoom(i):e.options.clickToCloseNonZoomable&&e.close();break;case"toggle-controls":this.gestures.pswp.element?.classList.toggle("pswp--ui-visible")}}}}function P(t,i,s){return t.x=(i.x+s.x)/2,t.y=(i.y+s.y)/2,t}class x{constructor(t){this.gestures=t,this._startPan={x:0,y:0},this._startZoomPoint={x:0,y:0},this._zoomPoint={x:0,y:0},this._wasOverFitZoomLevel=!1,this._startZoomLevel=1}start(){const{currSlide:i}=this.gestures.pswp;i&&(this._startZoomLevel=i.currZoomLevel,t(this._startPan,i.pan)),this.gestures.pswp.animations.stopAllPan(),this._wasOverFitZoomLevel=!1}change(){const{p1:t,startP1:i,p2:s,startP2:o,pswp:n}=this.gestures,{currSlide:a}=n;if(!a)return;const r=a.zoomLevels.min,h=a.zoomLevels.max;if(!a.isZoomable()||n.mainScroll.isShifted())return;P(this._startZoomPoint,i,o),P(this._zoomPoint,t,s);let p=1/e(i,o)*e(t,s)*this._startZoomLevel;if(p>a.zoomLevels.initial+a.zoomLevels.initial/15&&(this._wasOverFitZoomLevel=!0),p<r)if(n.options.pinchToClose&&!this._wasOverFitZoomLevel&&this._startZoomLevel<=a.zoomLevels.initial){const t=1-(r-p)/(r/1.2);n.dispatch("pinchClose",{bgOpacity:t}).defaultPrevented||n.applyBgOpacity(t)}else p=r-.15*(r-p);else p>h&&(p=h+.05*(p-h));a.pan.x=this._calculatePanForZoomLevel("x",p),a.pan.y=this._calculatePanForZoomLevel("y",p),a.setZoomLevel(p),a.applyCurrentZoomPan()}end(){const{pswp:t}=this.gestures,{currSlide:i}=t;(!i||i.currZoomLevel<i.zoomLevels.initial)&&!this._wasOverFitZoomLevel&&t.options.pinchToClose?t.close():this.correctZoomPan()}_calculatePanForZoomLevel(t,i){const s=i/this._startZoomLevel;return this._zoomPoint[t]-(this._startZoomPoint[t]-this._startPan[t])*s}correctZoomPan(i){const{pswp:e}=this.gestures,{currSlide:n}=e;if(!n?.isZoomable())return;0===this._zoomPoint.x&&(i=!0);const a=n.currZoomLevel;let r,h=!0;a<n.zoomLevels.initial?r=n.zoomLevels.initial:a>n.zoomLevels.max?r=n.zoomLevels.max:(h=!1,r=a);const p=e.bgOpacity,l=e.bgOpacity<1,c=t({x:0,y:0},n.pan);let d=t({x:0,y:0},c);i&&(this._zoomPoint.x=0,this._zoomPoint.y=0,this._startZoomPoint.x=0,this._startZoomPoint.y=0,this._startZoomLevel=a,t(this._startPan,c)),h&&(d={x:this._calculatePanForZoomLevel("x",r),y:this._calculatePanForZoomLevel("y",r)}),n.setZoomLevel(r),d={x:n.bounds.correctPan("x",d.x),y:n.bounds.correctPan("y",d.y)},n.setZoomLevel(a);const u=!o(d,c);if(!u&&!h&&!l)return n._setResolution(r),void n.applyCurrentZoomPan();e.animations.stopAllPan(),e.animations.startSpring({isPan:!0,start:0,end:1e3,velocity:0,dampingRatio:1,naturalFrequency:40,onUpdate:t=>{if(t/=1e3,u||h){if(u&&(n.pan.x=c.x+(d.x-c.x)*t,n.pan.y=c.y+(d.y-c.y)*t),h){const i=a+(r-a)*t;n.setZoomLevel(i)}n.applyCurrentZoomPan()}l&&e.bgOpacity<1&&e.applyBgOpacity(s(p+(1-p)*t,0,1))},onComplete:()=>{n._setResolution(r),n.applyCurrentZoomPan()}})}}class S{constructor(t){this.pswp=t,this.dragAxis=null,this.p1={x:0,y:0},this.p2={x:0,y:0},this.prevP1={x:0,y:0},this.prevP2={x:0,y:0},this.startP1={x:0,y:0},this.startP2={x:0,y:0},this.velocity={x:0,y:0},this._lastStartP1={x:0,y:0},this._intervalP1={x:0,y:0},this._numActivePoints=0,this._ongoingPointers=[],this._touchEventEnabled="ontouchstart"in window,this._pointerEventEnabled=!!window.PointerEvent,this.supportsTouch=this._touchEventEnabled||this._pointerEventEnabled&&navigator.maxTouchPoints>1,this._numActivePoints=0,this._intervalTime=0,this._velocityCalculated=!1,this.isMultitouch=!1,this.isDragging=!1,this.isZooming=!1,this.raf=null,this._tapTimer=null,this.supportsTouch||(t.options.allowPanToNext=!1),this.drag=new y(this),this.zoomLevels=new x(this),this.tapHandler=new f(this),t.on("bindEvents",()=>{t.events.add(t.scrollWrap,"click",this._onClick.bind(this)),this._pointerEventEnabled?this._bindEvents("pointer","down","up","cancel"):this._touchEventEnabled?(this._bindEvents("touch","start","end","cancel"),t.scrollWrap&&(t.scrollWrap.ontouchmove=()=>{},t.scrollWrap.ontouchend=()=>{})):this._bindEvents("mouse","down","up")})}_bindEvents(t,i,s,e){const{pswp:o}=this,{events:n}=o,a=e?t+e:"";n.add(o.scrollWrap,t+i,this.onPointerDown.bind(this)),n.add(window,t+"move",this.onPointerMove.bind(this)),n.add(window,t+s,this.onPointerUp.bind(this)),a&&n.add(o.scrollWrap,a,this.onPointerUp.bind(this))}onPointerDown(i){const s="mousedown"===i.type||"mouse"===i.pointerType;if(s&&i.button>0)return;const{pswp:e}=this;e.opener.isOpen?e.dispatch("pointerDown",{originalEvent:i}).defaultPrevented||(s&&(e.mouseDetected(),this._preventPointerEventBehaviour(i,"down")),e.animations.stopAll(),this._updatePoints(i,"down"),1===this._numActivePoints&&(this.dragAxis=null,t(this.startP1,this.p1)),this._numActivePoints>1?(this._clearTapTimer(),this.isMultitouch=!0):this.isMultitouch=!1):i.preventDefault()}onPointerMove(i){this._preventPointerEventBehaviour(i,"move"),this._numActivePoints&&(this._updatePoints(i,"move"),!this.pswp.dispatch("pointerMove",{originalEvent:i}).defaultPrevented&&(1!==this._numActivePoints||this.isDragging?this._numActivePoints>1&&!this.isZooming&&(this._finishDrag(),this.isZooming=!0,this._updateStartPoints(),this.zoomLevels.start(),this._rafStopLoop(),this._rafRenderLoop()):(this.dragAxis||this._calculateDragDirection(),this.dragAxis&&!this.isDragging&&(this.isZooming&&(this.isZooming=!1,this.zoomLevels.end()),this.isDragging=!0,this._clearTapTimer(),this._updateStartPoints(),this._intervalTime=Date.now(),this._velocityCalculated=!1,t(this._intervalP1,this.p1),this.velocity.x=0,this.velocity.y=0,this.drag.start(),this._rafStopLoop(),this._rafRenderLoop()))))}_finishDrag(){this.isDragging&&(this.isDragging=!1,this._velocityCalculated||this._updateVelocity(!0),this.drag.end(),this.dragAxis=null)}onPointerUp(t){this._numActivePoints&&(this._updatePoints(t,"up"),!this.pswp.dispatch("pointerUp",{originalEvent:t}).defaultPrevented&&(0===this._numActivePoints&&(this._rafStopLoop(),this.isDragging?this._finishDrag():!this.isZooming&&!this.isMultitouch&&this._finishTap(t)),this._numActivePoints<2&&this.isZooming&&(this.isZooming=!1,this.zoomLevels.end(),1===this._numActivePoints&&(this.dragAxis=null,this._updateStartPoints()))))}_rafRenderLoop(){(this.isDragging||this.isZooming)&&(this._updateVelocity(),this.isDragging?o(this.p1,this.prevP1)||this.drag.change():(!o(this.p1,this.prevP1)||!o(this.p2,this.prevP2))&&this.zoomLevels.change(),this._updatePrevPoints(),this.raf=requestAnimationFrame(this._rafRenderLoop.bind(this)))}_updateVelocity(i){const s=Date.now(),e=s-this._intervalTime;e<50&&!i||(this.velocity.x=this._getVelocity("x",e),this.velocity.y=this._getVelocity("y",e),this._intervalTime=s,t(this._intervalP1,this.p1),this._velocityCalculated=!0)}_finishTap(i){const{mainScroll:s}=this.pswp;if(s.isShifted())return void s.moveIndexBy(0,!0);if(i.type.indexOf("cancel")>0)return;if("mouseup"===i.type||"mouse"===i.pointerType)return void this.tapHandler.click(this.startP1,i);const o=this.pswp.options.doubleTapAction?300:0;this._tapTimer?(this._clearTapTimer(),e(this._lastStartP1,this.startP1)<25&&this.tapHandler.doubleTap(this.startP1,i)):(t(this._lastStartP1,this.startP1),this._tapTimer=setTimeout(()=>{this.tapHandler.tap(this.startP1,i),this._clearTapTimer()},o))}_clearTapTimer(){this._tapTimer&&(clearTimeout(this._tapTimer),this._tapTimer=null)}_getVelocity(t,i){const s=this.p1[t]-this._intervalP1[t];return Math.abs(s)>1&&i>5?s/i:0}_rafStopLoop(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null)}_preventPointerEventBehaviour(t,i){this.pswp.applyFilters("preventPointerEvent",!0,t,i)&&t.preventDefault()}_updatePoints(i,s){if(this._pointerEventEnabled){const e=i,o=this._ongoingPointers.findIndex(t=>t.id===e.pointerId);"up"===s&&o>-1?this._ongoingPointers.splice(o,1):"down"===s&&-1===o?this._ongoingPointers.push(this._convertEventPosToPoint(e,{x:0,y:0})):o>-1&&this._convertEventPosToPoint(e,this._ongoingPointers[o]),this._numActivePoints=this._ongoingPointers.length,this._numActivePoints>0&&t(this.p1,this._ongoingPointers[0]),this._numActivePoints>1&&t(this.p2,this._ongoingPointers[1])}else{const t=i;this._numActivePoints=0,t.type.indexOf("touch")>-1?t.touches&&t.touches.length>0&&(this._convertEventPosToPoint(t.touches[0],this.p1),this._numActivePoints++,t.touches.length>1&&(this._convertEventPosToPoint(t.touches[1],this.p2),this._numActivePoints++)):(this._convertEventPosToPoint(i,this.p1),"up"===s?this._numActivePoints=0:this._numActivePoints++)}}_updatePrevPoints(){t(this.prevP1,this.p1),t(this.prevP2,this.p2)}_updateStartPoints(){t(this.startP1,this.p1),t(this.startP2,this.p2),this._updatePrevPoints()}_calculateDragDirection(){if(this.pswp.mainScroll.isShifted())this.dragAxis="x";else{const t=Math.abs(this.p1.x-this.startP1.x)-Math.abs(this.p1.y-this.startP1.y);if(0!==t){const i=t>0?"x":"y";Math.abs(this.p1[i]-this.startP1[i])>=10&&(this.dragAxis=i)}}}_convertEventPosToPoint(t,i){return i.x=t.pageX-this.pswp.offset.x,i.y=t.pageY-this.pswp.offset.y,"pointerId"in t?i.id=t.pointerId:void 0!==t.identifier&&(i.id=t.identifier),i}_onClick(t){this.pswp.mainScroll.isShifted()&&(t.preventDefault(),t.stopPropagation())}}const b={Escape:27,z:90,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Tab:9},T=(t,i)=>i?t:b[t];class L{constructor(t){this.pswp=t,this._wasFocused=!1,t.on("bindEvents",()=>{t.options.trapFocus&&(t.options.initialPointerPos||this._focusRoot(),t.events.add(document,"focusin",this._onFocusIn.bind(this))),t.events.add(document,"keydown",this._onKeyDown.bind(this))});const i=document.activeElement;t.on("destroy",()=>{t.options.returnFocus&&i&&this._wasFocused&&i.focus()})}_focusRoot(){!this._wasFocused&&this.pswp.element&&(this.pswp.element.focus(),this._wasFocused=!0)}_onKeyDown(t){const{pswp:i}=this;if(i.dispatch("keydown",{originalEvent:t}).defaultPrevented||n(t))return;let s,e,o=!1;const a="key"in t;switch(a?t.key:t.keyCode){case T("Escape",a):i.options.escKey&&(s="close");break;case T("z",a):s="toggleZoom";break;case T("ArrowLeft",a):e="x";break;case T("ArrowUp",a):e="y";break;case T("ArrowRight",a):e="x",o=!0;break;case T("ArrowDown",a):o=!0,e="y";break;case T("Tab",a):this._focusRoot()}if(e){t.preventDefault();const{currSlide:n}=i;i.options.arrowKeys&&"x"===e&&i.getNumItems()>1?s=o?"next":"prev":n&&n.currZoomLevel>n.zoomLevels.fit&&(n.pan[e]+=o?-80:80,n.panTo(n.pan.x,n.pan.y))}s&&(t.preventDefault(),i[s]())}_onFocusIn(t){const{template:i}=this.pswp;i&&document!==t.target&&i!==t.target&&!i.contains(t.target)&&i.focus()}}class A{constructor(t){this.pswp=t,this.x=0,this.slideWidth=0,this._currPositionIndex=0,this._prevPositionIndex=0,this._containerShiftIndex=-1,this.itemHolders=[]}resize(t){const{pswp:i}=this,s=Math.round(i.viewportSize.x+i.viewportSize.x*i.options.spacing),e=s!==this.slideWidth;e&&(this.slideWidth=s,this.moveTo(this.getCurrSlideX())),this.itemHolders.forEach((i,s)=>{e&&a(i.el,(s+this._containerShiftIndex)*this.slideWidth),t&&i.slide&&i.slide.resize()})}resetPosition(){this._currPositionIndex=0,this._prevPositionIndex=0,this.slideWidth=0,this._containerShiftIndex=-1}appendHolders(){this.itemHolders=[];for(let t=0;t<3;t++){const i=r("pswp__item","div",this.pswp.container);i.setAttribute("role","group"),i.setAttribute("aria-roledescription","slide"),i.setAttribute("aria-hidden","true"),i.style.display=1===t?"block":"none",this.itemHolders.push({el:i})}}canBeSwiped(){return this.pswp.getNumItems()>1}moveIndexBy(t,i,s){const{pswp:e}=this;let o=e.potentialIndex+t;const n=e.getNumItems();if(e.canLoop()){o=e.getLoopedIndex(o);const i=(t+n)%n;t=i<=n/2?i:i-n}else o<0?o=0:o>=n&&(o=n-1),t=o-e.potentialIndex;e.potentialIndex=o,this._currPositionIndex-=t,e.animations.stopMainScroll();const a=this.getCurrSlideX();if(i){e.animations.startSpring({isMainScroll:!0,start:this.x,end:a,velocity:s||0,naturalFrequency:30,dampingRatio:1,onUpdate:t=>{this.moveTo(t)},onComplete:()=>{this.updateCurrItem(),e.appendHeavy()}});let t=e.potentialIndex-e.currIndex;if(e.canLoop()){const i=(t+n)%n;t=i<=n/2?i:i-n}Math.abs(t)>1&&this.updateCurrItem()}else this.moveTo(a),this.updateCurrItem();return!!t}getCurrSlideX(){return this.slideWidth*this._currPositionIndex}isShifted(){return this.x!==this.getCurrSlideX()}updateCurrItem(){const{pswp:t}=this,i=this._prevPositionIndex-this._currPositionIndex;if(!i)return;this._prevPositionIndex=this._currPositionIndex,t.currIndex=t.potentialIndex;let s,e=Math.abs(i);e>=3&&(this._containerShiftIndex+=i+(i>0?-3:3),e=3,this.itemHolders.forEach(t=>{t.slide?.destroy(),t.slide=void 0}));for(let o=0;o<e;o++)i>0?(s=this.itemHolders.shift(),s&&(this.itemHolders[2]=s,this._containerShiftIndex++,a(s.el,(this._containerShiftIndex+2)*this.slideWidth),t.setContent(s,t.currIndex-e+o+2))):(s=this.itemHolders.pop(),s&&(this.itemHolders.unshift(s),this._containerShiftIndex--,a(s.el,this._containerShiftIndex*this.slideWidth),t.setContent(s,t.currIndex+e-o-2)));Math.abs(this._containerShiftIndex)>50&&!this.isShifted()&&(this.resetPosition(),this.resize()),t.animations.stopAllPan(),this.itemHolders.forEach((t,i)=>{t.slide&&t.slide.setIsActive(1===i)}),t.currSlide=this.itemHolders[1]?.slide,t.contentLoader.updateLazy(i),t.currSlide&&t.currSlide.applyCurrentZoomPan(),t.dispatch("change")}moveTo(t,i){if(!this.pswp.canLoop()&&i){let i=(this.slideWidth*this._currPositionIndex-t)/this.slideWidth;i+=this.pswp.currIndex;const s=Math.round(t-this.x);(i<0&&s>0||i>=this.pswp.getNumItems()-1&&s<0)&&(t=this.x+.35*s)}this.x=t,this.pswp.container&&a(this.pswp.container,t),this.pswp.dispatch("moveMainScroll",{x:t,dragging:i??!1})}}const z=.003;class C{constructor(t){this.pswp=t,this.isClosed=!0,this.isOpen=!1,this.isClosing=!1,this.isOpening=!1,this._duration=void 0,this._useAnimation=!1,this._croppedZoom=!1,this._animateRootOpacity=!1,this._animateBgOpacity=!1,this._placeholder=void 0,this._opacityElement=void 0,this._cropContainer1=void 0,this._cropContainer2=void 0,this._thumbBounds=void 0,this._prepareOpen=this._prepareOpen.bind(this),t.on("firstZoomPan",this._prepareOpen)}open(){this._prepareOpen(),this._start()}close(){if(this.isClosed||this.isClosing||this.isOpening)return;const t=this.pswp.currSlide;this.isOpen=!1,this.isOpening=!1,this.isClosing=!0,this._duration=this.pswp.options.hideAnimationDuration,t&&t.currZoomLevel*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps(),setTimeout(()=>{this._start()},this._croppedZoom?30:0)}_prepareOpen(){if(this.pswp.off("firstZoomPan",this._prepareOpen),!this.isOpening){const t=this.pswp.currSlide;this.isOpening=!0,this.isClosing=!1,this._duration=this.pswp.options.showAnimationDuration,t&&t.zoomLevels.initial*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps()}}_applyStartProps(){const{pswp:t}=this,i=this.pswp.currSlide,{options:s}=t;if("fade"===s.showHideAnimationType?(s.showHideOpacity=!0,this._thumbBounds=void 0):"none"===s.showHideAnimationType?(s.showHideOpacity=!1,this._duration=0,this._thumbBounds=void 0):this.isOpening&&t._initialThumbBounds?this._thumbBounds=t._initialThumbBounds:this._thumbBounds=this.pswp.getThumbBounds(),this._placeholder=i?.getPlaceholderElement(),t.animations.stopAll(),this._useAnimation=!!(this._duration&&this._duration>50),this._animateZoom=!!this._thumbBounds&&i?.content.usePlaceholder()&&(!this.isClosing||!t.mainScroll.isShifted()),this._animateZoom?this._animateRootOpacity=s.showHideOpacity??!1:(this._animateRootOpacity=!0,this.isOpening&&i&&(i.zoomAndPanToInitial(),i.applyCurrentZoomPan())),this._animateBgOpacity=!this._animateRootOpacity&&this.pswp.options.bgOpacity>z,this._opacityElement=this._animateRootOpacity?t.element:t.bg,!this._useAnimation)return this._duration=0,this._animateZoom=!1,this._animateBgOpacity=!1,this._animateRootOpacity=!0,void(this.isOpening&&(t.element&&(t.element.style.opacity=String(z)),t.applyBgOpacity(1)));this._animateZoom&&this._thumbBounds&&this._thumbBounds.innerRect?(this._croppedZoom=!0,this._cropContainer1=this.pswp.container,this._cropContainer2=this.pswp.currSlide?.holderElement,t.container&&(t.container.style.overflow="hidden",t.container.style.width=t.viewportSize.x+"px")):this._croppedZoom=!1,this.isOpening?(this._animateRootOpacity?(t.element&&(t.element.style.opacity=String(z)),t.applyBgOpacity(1)):(this._animateBgOpacity&&t.bg&&(t.bg.style.opacity=String(z)),t.element&&(t.element.style.opacity="1")),this._animateZoom&&(this._setClosedStateZoomPan(),this._placeholder&&(this._placeholder.style.willChange="transform",this._placeholder.style.opacity=String(z)))):this.isClosing&&(t.mainScroll.itemHolders[0]&&(t.mainScroll.itemHolders[0].el.style.display="none"),t.mainScroll.itemHolders[2]&&(t.mainScroll.itemHolders[2].el.style.display="none"),this._croppedZoom&&0!==t.mainScroll.x&&(t.mainScroll.resetPosition(),t.mainScroll.resize()))}_start(){this.isOpening&&this._useAnimation&&this._placeholder&&"IMG"===this._placeholder.tagName?new Promise(t=>{let i=!1,s=!0;h(this._placeholder).finally(()=>{i=!0,s||t(!0)}),setTimeout(()=>{s=!1,i&&t(!0)},50),setTimeout(t,250)}).finally(()=>this._initiate()):this._initiate()}_initiate(){this.pswp.element?.style.setProperty("--pswp-transition-duration",this._duration+"ms"),this.pswp.dispatch(this.isOpening?"openingAnimationStart":"closingAnimationStart"),this.pswp.dispatch("initialZoom"+(this.isOpening?"In":"Out")),this.pswp.element?.classList.toggle("pswp--ui-visible",this.isOpening),this.isOpening?(this._placeholder&&(this._placeholder.style.opacity="1"),this._animateToOpenState()):this.isClosing&&this._animateToClosedState(),this._useAnimation||this._onAnimationComplete()}_onAnimationComplete(){const{pswp:t}=this;this.isOpen=this.isOpening,this.isClosed=this.isClosing,this.isOpening=!1,this.isClosing=!1,t.dispatch(this.isOpen?"openingAnimationEnd":"closingAnimationEnd"),t.dispatch("initialZoom"+(this.isOpen?"InEnd":"OutEnd")),this.isClosed?t.destroy():this.isOpen&&(this._animateZoom&&t.container&&(t.container.style.overflow="visible",t.container.style.width="100%"),t.currSlide?.applyCurrentZoomPan())}_animateToOpenState(){const{pswp:t}=this;this._animateZoom&&(this._croppedZoom&&this._cropContainer1&&this._cropContainer2&&(this._animateTo(this._cropContainer1,"transform","translate3d(0,0,0)"),this._animateTo(this._cropContainer2,"transform","none")),t.currSlide&&(t.currSlide.zoomAndPanToInitial(),this._animateTo(t.currSlide.container,"transform",t.currSlide.getCurrentTransform()))),this._animateBgOpacity&&t.bg&&this._animateTo(t.bg,"opacity",String(t.options.bgOpacity)),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","1")}_animateToClosedState(){const{pswp:t}=this;this._animateZoom&&this._setClosedStateZoomPan(!0),this._animateBgOpacity&&t.bgOpacity>.01&&t.bg&&this._animateTo(t.bg,"opacity","0"),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","0")}_setClosedStateZoomPan(i){if(!this._thumbBounds)return;const{pswp:s}=this,{innerRect:e}=this._thumbBounds,{currSlide:o,viewportSize:n}=s;if(this._croppedZoom&&e&&this._cropContainer1&&this._cropContainer2){const t=-n.x+(this._thumbBounds.x-e.x)+e.w,s=-n.y+(this._thumbBounds.y-e.y)+e.h,o=n.x-e.w,r=n.y-e.h;i?(this._animateTo(this._cropContainer1,"transform",p(t,s)),this._animateTo(this._cropContainer2,"transform",p(o,r))):(a(this._cropContainer1,t,s),a(this._cropContainer2,o,r))}o&&(t(o.pan,e||this._thumbBounds),o.currZoomLevel=this._thumbBounds.w/o.width,i?this._animateTo(o.container,"transform",o.getCurrentTransform()):o.applyCurrentZoomPan())}_animateTo(t,i,s){if(!this._duration)return void(t.style[i]=s);const{animations:e}=this.pswp,o={duration:this._duration,easing:this.pswp.options.easing,onComplete:()=>{e.activeAnimations.length||this._onAnimationComplete()},target:t};o[i]=s,e.startTransition(o)}}class Z{constructor(t){this.pswp=t,t.events.add(t.element,"wheel",this._onWheel.bind(this))}_onWheel(t){t.preventDefault();const{currSlide:i}=this.pswp;let{deltaX:s,deltaY:e}=t;if(i&&!this.pswp.dispatch("wheel",{originalEvent:t}).defaultPrevented)if(t.ctrlKey||this.pswp.options.wheelToZoom){if(i.isZoomable()){let s=-e;1===t.deltaMode?s*=.05:s*=t.deltaMode?1:.002,s=2**s;const o=i.currZoomLevel*s;i.zoomTo(o,{x:t.clientX,y:t.clientY})}}else i.isPannable()&&(1===t.deltaMode&&(s*=18,e*=18),i.panTo(i.pan.x-s,i.pan.y-e))}}class I{constructor(t){this.slide=t,this.currZoomLevel=1,this.center={x:0,y:0},this.max={x:0,y:0},this.min={x:0,y:0}}update(t){this.currZoomLevel=t,this.slide.width?(this._updateAxis("x"),this._updateAxis("y"),this.slide.pswp.dispatch("calcBounds",{slide:this.slide})):this.reset()}_updateAxis(t){const{pswp:i}=this.slide,s=this.slide["x"===t?"width":"height"]*this.currZoomLevel,e=l("x"===t?"left":"top",i.options,i.viewportSize,this.slide.data,this.slide.index),o=this.slide.panAreaSize[t];this.center[t]=Math.round((o-s)/2)+e,this.max[t]=s>o?Math.round(o-s)+e:this.center[t],this.min[t]=s>o?e:this.center[t]}reset(){this.center.x=0,this.center.y=0,this.max.x=0,this.max.y=0,this.min.x=0,this.min.y=0}correctPan(t,i){return s(i,this.max[t],this.min[t])}}class O{constructor(t,i,s){this.data=t,this.index=i,this.pswp=s,this.isActive=i===s.currIndex,this.currentResolution=0,this.panAreaSize={x:0,y:0},this.pan={x:0,y:0},this.isFirstSlide=this.isActive&&!s.opener.isOpen,this.zoomLevels=new c(s.options,t,i,s),this.pswp.dispatch("gettingData",{slide:this,data:this.data,index:i}),this.content=this.pswp.contentLoader.getContentBySlide(this),this.container=r("pswp__zoom-wrap","div"),this.holderElement=null,this.currZoomLevel=1,this.width=this.content.width,this.height=this.content.height,this.heavyAppended=!1,this.bounds=new I(this),this.prevDisplayedWidth=-1,this.prevDisplayedHeight=-1,this.pswp.dispatch("slideInit",{slide:this})}setIsActive(t){t&&!this.isActive?this.activate():!t&&this.isActive&&this.deactivate()}append(t){this.holderElement=t,this.container.style.transformOrigin="0 0",this.data&&(this.calculateSize(),this.load(),this.updateContentSize(),this.appendHeavy(),this.holderElement.appendChild(this.container),this.zoomAndPanToInitial(),this.pswp.dispatch("firstZoomPan",{slide:this}),this.applyCurrentZoomPan(),this.pswp.dispatch("afterSetContent",{slide:this}),this.isActive&&this.activate())}load(){this.content.load(!1),this.pswp.dispatch("slideLoad",{slide:this})}appendHeavy(){const{pswp:t}=this;this.heavyAppended||!t.opener.isOpen||t.mainScroll.isShifted()||(this.isActive,0)||this.pswp.dispatch("appendHeavy",{slide:this}).defaultPrevented||(this.heavyAppended=!0,this.content.append(),this.pswp.dispatch("appendHeavyContent",{slide:this}))}activate(){this.isActive=!0,this.appendHeavy(),this.content.activate(),this.pswp.dispatch("slideActivate",{slide:this})}deactivate(){this.isActive=!1,this.content.deactivate(),this.currZoomLevel!==this.zoomLevels.initial&&this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize(),this.pswp.dispatch("slideDeactivate",{slide:this})}destroy(){this.content.hasSlide=!1,this.content.remove(),this.container.remove(),this.pswp.dispatch("slideDestroy",{slide:this})}resize(){this.currZoomLevel!==this.zoomLevels.initial&&this.isActive?(this.calculateSize(),this.bounds.update(this.currZoomLevel),this.panTo(this.pan.x,this.pan.y)):(this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize())}updateContentSize(t){const i=this.currentResolution||this.zoomLevels.initial;if(!i)return;const s=Math.round(this.width*i)||this.pswp.viewportSize.x,e=Math.round(this.height*i)||this.pswp.viewportSize.y;!this.sizeChanged(s,e)&&!t||this.content.setDisplayedSize(s,e)}sizeChanged(t,i){return(t!==this.prevDisplayedWidth||i!==this.prevDisplayedHeight)&&(this.prevDisplayedWidth=t,this.prevDisplayedHeight=i,!0)}getPlaceholderElement(){return this.content.placeholder?.element}zoomTo(t,e,o,n){const{pswp:a}=this;if(!this.isZoomable()||a.mainScroll.isShifted())return;a.dispatch("beforeZoomTo",{destZoomLevel:t,centerPoint:e,transitionDuration:o}),a.animations.stopAllPan();const r=this.currZoomLevel;n||(t=s(t,this.zoomLevels.min,this.zoomLevels.max)),this.setZoomLevel(t),this.pan.x=this.calculateZoomToPanOffset("x",e,r),this.pan.y=this.calculateZoomToPanOffset("y",e,r),i(this.pan);const h=()=>{this._setResolution(t),this.applyCurrentZoomPan()};o?a.animations.startTransition({isPan:!0,name:"zoomTo",target:this.container,transform:this.getCurrentTransform(),onComplete:h,duration:o,easing:a.options.easing}):h()}toggleZoom(t){this.zoomTo(this.currZoomLevel===this.zoomLevels.initial?this.zoomLevels.secondary:this.zoomLevels.initial,t,this.pswp.options.zoomAnimationDuration)}setZoomLevel(t){this.currZoomLevel=t,this.bounds.update(this.currZoomLevel)}calculateZoomToPanOffset(t,i,s){if(this.bounds.max[t]-this.bounds.min[t]===0)return this.bounds.center[t];i||(i=this.pswp.getViewportCenterPoint()),s||(s=this.zoomLevels.initial);const e=this.currZoomLevel/s;return this.bounds.correctPan(t,(this.pan[t]-i[t])*e+i[t])}panTo(t,i){this.pan.x=this.bounds.correctPan("x",t),this.pan.y=this.bounds.correctPan("y",i),this.applyCurrentZoomPan()}isPannable(){return!!this.width&&this.currZoomLevel>this.zoomLevels.fit}isZoomable(){return!!this.width&&this.content.isZoomable()}applyCurrentZoomPan(){this._applyZoomTransform(this.pan.x,this.pan.y,this.currZoomLevel),this===this.pswp.currSlide&&this.pswp.dispatch("zoomPanUpdate",{slide:this})}zoomAndPanToInitial(){this.currZoomLevel=this.zoomLevels.initial,this.bounds.update(this.currZoomLevel),t(this.pan,this.bounds.center),this.pswp.dispatch("initialZoomPan",{slide:this})}_applyZoomTransform(t,i,s){s/=this.currentResolution||this.zoomLevels.initial,a(this.container,t,i,s)}calculateSize(){const{pswp:i}=this;t(this.panAreaSize,d(i.options,i.viewportSize,this.data,this.index)),this.zoomLevels.update(this.width,this.height,this.panAreaSize),i.dispatch("calcSlideSize",{slide:this})}getCurrentTransform(){const t=this.currZoomLevel/(this.currentResolution||this.zoomLevels.initial);return p(this.pan.x,this.pan.y,t)}_setResolution(t){t!==this.currentResolution&&(this.currentResolution=t,this.updateContentSize(),this.pswp.dispatch("resolutionChanged"))}}function D(t,i,s){t.classList.add("pswp__button--arrow"),t.setAttribute("aria-controls","pswp__items"),i.on("change",()=>{i.options.loop||(t.disabled=s?!(i.currIndex<i.getNumItems()-1):!(i.currIndex>0))})}const E={name:"arrowPrev",className:"pswp__button--arrow--prev",title:"Previous",order:10,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<path d="M29 43l-3 3-16-16 16-16 3 3-13 13 13 13z" id="pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"prev",onInit:D},M={name:"arrowNext",className:"pswp__button--arrow--next",title:"Next",order:11,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<use xlink:href="#pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"next",onInit:(t,i)=>{D(t,i,!0)}},F={name:"close",title:"Close",order:20,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M24 10l-2-2-6 6-6-6-2 2 6 6-6 6 2 2 6-6 6 6 2-2-6-6z" id="pswp__icn-close"/>',outlineID:"pswp__icn-close"},onClick:"close"},B={name:"zoom",title:"Zoom",order:10,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M17.426 19.926a6 6 0 1 1 1.5-1.5L23 22.5 21.5 24l-4.074-4.074z" id="pswp__icn-zoom"/><path fill="currentColor" class="pswp__zoom-icn-bar-h" d="M11 16v-2h6v2z"/><path fill="currentColor" class="pswp__zoom-icn-bar-v" d="M13 12h2v6h-2z"/>',outlineID:"pswp__icn-zoom"},onClick:"toggleZoom"},R={name:"counter",order:5,onInit:(t,i)=>{i.on("change",()=>{t.innerText=i.currIndex+1+i.options.indexIndicatorSep+i.getNumItems()})}},k={name:"preloader",appendTo:"bar",order:7,html:{isCustomSVG:!0,inner:'<path fill-rule="evenodd" clip-rule="evenodd" d="M21.2 16a5.2 5.2 0 1 1-5.2-5.2V8a8 8 0 1 0 8 8h-2.8Z" id="pswp__icn-loading"/>',outlineID:"pswp__icn-loading"},onInit:(t,i)=>{let s,e=null;const o=i=>{s!==i&&(s=i,((i,s)=>{t.classList.toggle("pswp__preloader--"+i,s)})("active",i))},n=()=>{if(!i.currSlide?.content.isLoading())return o(!1),void(e&&(clearTimeout(e),e=null));e||(e=setTimeout(()=>{o(!!i.currSlide?.content.isLoading()),e=null},i.options.preloaderDelay))};i.on("change",n),i.on("loadComplete",t=>{i.currSlide===t.slide&&n()}),i.ui&&(i.ui.updatePreloaderVisibility=n)}};class H{constructor(t,i){const s=i.name||i.className;let e=i.html;if(!1===t.options[s])return;"string"==typeof t.options[s+"SVG"]&&(e=t.options[s+"SVG"]),t.dispatch("uiElementCreate",{data:i});let o="";i.isButton?(o+="pswp__button ",o+=i.className||`pswp__button--${i.name}`):o+=i.className||`pswp__${i.name}`;let n=i.isButton?i.tagName||"button":i.tagName||"div";n=n.toLowerCase();const a=r(o,n);if(i.isButton){"button"===n&&(a.type="button");let{title:e}=i;const{ariaLabel:o}=i;"string"==typeof t.options[s+"Title"]&&(e=t.options[s+"Title"]),e&&(a.title=e);const r=o||e;r&&a.setAttribute("aria-label",r)}a.innerHTML=function(t){if("string"==typeof t)return t;if(!t||!t.isCustomSVG)return"";const i=t;let s='<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 %d %d" width="%d" height="%d">';return s=s.split("%d").join(i.size||32),i.outlineID&&(s+='<use class="pswp__icn-shadow" xlink:href="#'+i.outlineID+'"/>'),s+=i.inner,s+="</svg>",s}(e),i.onInit&&i.onInit(a,t),i.onClick&&(a.onclick=s=>{"string"==typeof i.onClick?t[i.onClick]():"function"==typeof i.onClick&&i.onClick(s,a,t)});const h=i.appendTo||"bar";let p=t.element;"bar"===h?(t.topBar||(t.topBar=r("pswp__top-bar pswp__hide-on-close","div",t.scrollWrap)),p=t.topBar):(a.classList.add("pswp__hide-on-close"),"wrapper"===h&&(p=t.scrollWrap)),p?.appendChild(t.applyFilters("uiElement",a,i))}}function W(t,i){t.classList.toggle("pswp--zoomed-in",i)}class N{constructor(t){this.pswp=t,this.isRegistered=!1,this.uiElementsData=[],this.items=[],this.updatePreloaderVisibility=()=>{},this._lastUpdatedZoomLevel=void 0}init(){const{pswp:t}=this;this.isRegistered=!1,this.uiElementsData=[F,E,M,B,k,R],t.dispatch("uiRegister"),this.uiElementsData.sort((t,i)=>(t.order||0)-(i.order||0)),this.items=[],this.isRegistered=!0,this.uiElementsData.forEach(t=>{this.registerElement(t)}),t.on("change",()=>{t.element?.classList.toggle("pswp--one-slide",1===t.getNumItems())}),t.on("zoomPanUpdate",()=>this._onZoomPanUpdate())}registerElement(t){this.isRegistered?this.items.push(new H(this.pswp,t)):this.uiElementsData.push(t)}_onZoomPanUpdate(){const{template:t,currSlide:i,options:s}=this.pswp;if(this.pswp.opener.isClosing||!t||!i)return;let{currZoomLevel:e}=i;if(this.pswp.opener.isOpen||(e=i.zoomLevels.initial),e===this._lastUpdatedZoomLevel)return;this._lastUpdatedZoomLevel=e;const o=i.zoomLevels.initial-i.zoomLevels.secondary;if(Math.abs(o)<.01||!i.isZoomable())return W(t,!1),void t.classList.remove("pswp--zoom-allowed");t.classList.add("pswp--zoom-allowed");W(t,(e===i.zoomLevels.initial?i.zoomLevels.secondary:i.zoomLevels.initial)<=e),("zoom"===s.imageClickAction||"zoom-or-close"===s.imageClickAction)&&t.classList.add("pswp--click-to-zoom")}}const V="cubic-bezier(.4,0,.22,1)";class q{constructor(t){this.props=t;const{target:i,onComplete:s,transform:e,onFinish:o=()=>{},duration:n=333,easing:a=V}=t;this.onFinish=o;const r=e?"transform":"opacity",h=t[r]??"";this._target=i,this._onComplete=s,this._finished=!1,this._onTransitionEnd=this._onTransitionEnd.bind(this),this._helperTimeout=setTimeout(()=>{u(i,r,n,a),this._helperTimeout=setTimeout(()=>{i.addEventListener("transitionend",this._onTransitionEnd,!1),i.addEventListener("transitioncancel",this._onTransitionEnd,!1),this._helperTimeout=setTimeout(()=>{this._finalizeAnimation()},n+500),i.style[r]=h},30)},0)}_onTransitionEnd(t){t.target===this._target&&this._finalizeAnimation()}_finalizeAnimation(){this._finished||(this._finished=!0,this.onFinish(),this._onComplete&&this._onComplete())}destroy(){this._helperTimeout&&(clearTimeout(this._helperTimeout),this._helperTimeout=null),m(this._target),this._target.removeEventListener("transitionend",this._onTransitionEnd,!1),this._target.removeEventListener("transitioncancel",this._onTransitionEnd,!1),this._finished||this._finalizeAnimation()}}class U{constructor(t,i,s){this.velocity=1e3*t,this._dampingRatio=i||.75,this._naturalFrequency=s||12,this._dampedFrequency=this._naturalFrequency,this._dampingRatio<1&&(this._dampedFrequency*=Math.sqrt(1-this._dampingRatio*this._dampingRatio))}easeFrame(t,i){let s,e=0;i/=1e3;const o=Math.E**(-this._dampingRatio*this._naturalFrequency*i);if(1===this._dampingRatio)s=this.velocity+this._naturalFrequency*t,e=(t+s*i)*o,this.velocity=e*-this._naturalFrequency+s*o;else if(this._dampingRatio<1){s=1/this._dampedFrequency*(this._dampingRatio*this._naturalFrequency*t+this.velocity);const n=Math.cos(this._dampedFrequency*i),a=Math.sin(this._dampedFrequency*i);e=o*(t*n+s*a),this.velocity=e*-this._naturalFrequency*this._dampingRatio+o*(-this._dampedFrequency*t*a+this._dampedFrequency*s*n)}return e}}class G{constructor(t){this.props=t,this._raf=0;const{start:i,end:s,velocity:e,onUpdate:o,onComplete:n,onFinish:a=()=>{},dampingRatio:r,naturalFrequency:h}=t;this.onFinish=a;const p=new U(e,r,h);let l=Date.now(),c=i-s;const d=()=>{this._raf&&(c=p.easeFrame(c,Date.now()-l),Math.abs(c)<1&&Math.abs(p.velocity)<50?(o(s),n&&n(),this.onFinish()):(l=Date.now(),o(c+s),this._raf=requestAnimationFrame(d)))};this._raf=requestAnimationFrame(d)}destroy(){this._raf>=0&&cancelAnimationFrame(this._raf),this._raf=0}}class X{constructor(){this.activeAnimations=[]}startSpring(t){this._start(t,!0)}startTransition(t){this._start(t)}_start(t,i){const s=i?new G(t):new q(t);return this.activeAnimations.push(s),s.onFinish=()=>this.stop(s),s}stop(t){t.destroy();const i=this.activeAnimations.indexOf(t);i>-1&&this.activeAnimations.splice(i,1)}stopAll(){this.activeAnimations.forEach(t=>{t.destroy()}),this.activeAnimations=[]}stopAllPan(){this.activeAnimations=this.activeAnimations.filter(t=>!t.props.isPan||(t.destroy(),!1))}stopMainScroll(){this.activeAnimations=this.activeAnimations.filter(t=>!t.props.isMainScroll||(t.destroy(),!1))}isPanRunning(){return this.activeAnimations.some(t=>t.props.isPan)}}let K=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{K=!0}}))}catch{}class Y{constructor(){this._pool=[]}add(t,i,s,e){this._toggleListener(t,i,s,e)}remove(t,i,s,e){this._toggleListener(t,i,s,e,!0)}removeAll(){this._pool.forEach(t=>{this._toggleListener(t.target,t.type,t.listener,t.passive,!0,!0)}),this._pool=[]}_toggleListener(t,i,s,e,o,n){if(!t)return;const a=o?"removeEventListener":"addEventListener";i.split(" ").forEach(i=>{if(i){n||(o?this._pool=this._pool.filter(e=>e.type!==i||e.listener!==s||e.target!==t):this._pool.push({target:t,type:i,listener:s,passive:e}));const r=!!K&&{passive:e||!1};t[a](i,s,r)}})}}const j={allowPanToNext:!0,spacing:.1,loop:!0,pinchToClose:!0,closeOnVerticalDrag:!0,hideAnimationDuration:333,showAnimationDuration:333,zoomAnimationDuration:333,escKey:!0,arrowKeys:!0,trapFocus:!0,returnFocus:!0,maxWidthToAnimate:4e3,clickToCloseNonZoomable:!0,imageClickAction:"zoom-or-close",bgClickAction:"close",tapAction:"toggle-controls",doubleTapAction:"zoom",indexIndicatorSep:" / ",preloaderDelay:2e3,bgOpacity:.8,index:0,errorMsg:"The image cannot be loaded",preload:[1,2],easing:"cubic-bezier(.4,0,.22,1)"};class $ extends _{constructor(t){super(),this.options=this._prepareOptions(t||{}),this.offset={x:0,y:0},this._prevViewportSize={x:0,y:0},this.viewportSize={x:0,y:0},this.bgOpacity=1,this.currIndex=0,this.potentialIndex=0,this.isOpen=!1,this.isDestroying=!1,this.hasMouse=!1,this._initialItemData={},this._initialThumbBounds=void 0,this.topBar=void 0,this.element=void 0,this.template=void 0,this.container=void 0,this.scrollWrap=void 0,this.currSlide=void 0,this.events=new Y,this.animations=new X,this.mainScroll=new A(this),this.gestures=new S(this),this.opener=new C(this),this.keyboard=new L(this),this.contentLoader=new v(this)}init(){if(this.isOpen||this.isDestroying)return!1;this.isOpen=!0,this.dispatch("init"),this.dispatch("beforeOpen"),this._createMainStructure();let t="pswp--open";return this.gestures.supportsTouch&&(t+=" pswp--touch"),this.options.mainClass&&(t+=" "+this.options.mainClass),this.element&&(this.element.className+=" "+t),this.currIndex=this.options.index||0,this.potentialIndex=this.currIndex,this.dispatch("firstUpdate"),this.scrollWheel=new Z(this),(Number.isNaN(this.currIndex)||this.currIndex<0||this.currIndex>=this.getNumItems())&&(this.currIndex=0),this.gestures.supportsTouch||this.mouseDetected(),this.updateSize(),this.offset.y=window.pageYOffset,this._initialItemData=this.getItemData(this.currIndex),this.dispatch("gettingData",{index:this.currIndex,data:this._initialItemData,slide:void 0}),this._initialThumbBounds=this.getThumbBounds(),this.dispatch("initialLayout"),this.on("openingAnimationEnd",()=>{const{itemHolders:t}=this.mainScroll;t[0]&&(t[0].el.style.display="block",this.setContent(t[0],this.currIndex-1)),t[2]&&(t[2].el.style.display="block",this.setContent(t[2],this.currIndex+1)),this.appendHeavy(),this.contentLoader.updateLazy(),this.events.add(window,"resize",this._handlePageResize.bind(this)),this.events.add(window,"scroll",this._updatePageScrollOffset.bind(this)),this.dispatch("bindEvents")}),this.mainScroll.itemHolders[1]&&this.setContent(this.mainScroll.itemHolders[1],this.currIndex),this.dispatch("change"),this.opener.open(),this.dispatch("afterInit"),!0}getLoopedIndex(t){const i=this.getNumItems();return this.options.loop&&(t>i-1&&(t-=i),t<0&&(t+=i)),s(t,0,i-1)}appendHeavy(){this.mainScroll.itemHolders.forEach(t=>{t.slide?.appendHeavy()})}goTo(t){this.mainScroll.moveIndexBy(this.getLoopedIndex(t)-this.potentialIndex,!0)}next(){this.goTo(this.potentialIndex+1)}prev(){this.goTo(this.potentialIndex-1)}zoomTo(...t){this.currSlide?.zoomTo(...t)}toggleZoom(){this.currSlide?.toggleZoom()}close(){!this.opener.isOpen||this.isDestroying||(this.isDestroying=!0,this.dispatch("close"),this.events.removeAll(),this.opener.close())}destroy(){if(!this.isDestroying)return this.options.showHideAnimationType="none",void this.close();this.dispatch("destroy"),this._listeners={},this.scrollWrap&&(this.scrollWrap.ontouchmove=null,this.scrollWrap.ontouchend=null),this.element?.remove(),this.mainScroll.itemHolders.forEach(t=>{t.slide?.destroy()}),this.contentLoader.destroy(),this.events.removeAll()}refreshSlideContent(t){this.contentLoader.removeByIndex(t),this.mainScroll.itemHolders.forEach((i,s)=>{let e=(this.currSlide?.index??0)-1+s;this.canLoop()&&(e=this.getLoopedIndex(e)),e===t&&(this.setContent(i,t,!0),1===s&&(this.currSlide=i.slide,i.slide?.setIsActive(!0)))}),this.dispatch("change")}setContent(t,i,s){if(this.canLoop()&&(i=this.getLoopedIndex(i)),t.slide){if(t.slide.index===i&&!s)return;t.slide.destroy(),t.slide=void 0}if(!this.canLoop()&&(i<0||i>=this.getNumItems()))return;const e=this.getItemData(i);t.slide=new O(e,i,this),i===this.currIndex&&(this.currSlide=t.slide),t.slide.append(t.el)}getViewportCenterPoint(){return{x:this.viewportSize.x/2,y:this.viewportSize.y/2}}updateSize(i){if(this.isDestroying)return;const s=g(this.options,this);!i&&o(s,this._prevViewportSize)||(t(this._prevViewportSize,s),this.dispatch("beforeResize"),t(this.viewportSize,this._prevViewportSize),this._updatePageScrollOffset(),this.dispatch("viewportSize"),this.mainScroll.resize(this.opener.isOpen),!this.hasMouse&&window.matchMedia("(any-hover: hover)").matches&&this.mouseDetected(),this.dispatch("resize"))}applyBgOpacity(t){this.bgOpacity=Math.max(t,0),this.bg&&(this.bg.style.opacity=String(this.bgOpacity*this.options.bgOpacity))}mouseDetected(){this.hasMouse||(this.hasMouse=!0,this.element?.classList.add("pswp--has_mouse"))}_handlePageResize(){this.updateSize(),/iPhone|iPad|iPod/i.test(window.navigator.userAgent)&&setTimeout(()=>{this.updateSize()},500)}_updatePageScrollOffset(){this.setScrollOffset(0,window.pageYOffset)}setScrollOffset(t,i){this.offset.x=t,this.offset.y=i,this.dispatch("updateScrollOffset")}_createMainStructure(){this.element=r("pswp","div"),this.element.setAttribute("tabindex","-1"),this.element.setAttribute("role","dialog"),this.template=this.element,this.bg=r("pswp__bg","div",this.element),this.scrollWrap=r("pswp__scroll-wrap","section",this.element),this.container=r("pswp__container","div",this.scrollWrap),this.scrollWrap.setAttribute("aria-roledescription","carousel"),this.container.setAttribute("aria-live","off"),this.container.setAttribute("id","pswp__items"),this.mainScroll.appendHolders(),this.ui=new N(this),this.ui.init(),(this.options.appendToEl||document.body).appendChild(this.element)}getThumbBounds(){return function(t,i,s){const e=s.dispatch("thumbBounds",{index:t,itemData:i,instance:s});if(e.thumbBounds)return e.thumbBounds;const{element:o}=i;let n,a;if(o&&!1!==s.options.thumbSelector){const t=s.options.thumbSelector||"img";a=o.matches(t)?o:o.querySelector(t)}return a=s.applyFilters("thumbEl",a,i,t),a&&(n=i.thumbCropped?function(t,i,s){const e=t.getBoundingClientRect(),o=e.width/i,n=e.height/s,a=o>n?o:n,r=(e.width-i*a)/2,h=(e.height-s*a)/2,p={x:e.left+r,y:e.top+h,w:i*a};return p.innerRect={w:e.width,h:e.height,x:r,y:h},p}(a,i.width||i.w||0,i.height||i.h||0):function(t){const i=t.getBoundingClientRect();return{x:i.left,y:i.top,w:i.width}}(a)),s.applyFilters("thumbBounds",n,i,t)}(this.currIndex,this.currSlide?this.currSlide.data:this._initialItemData,this)}canLoop(){return this.options.loop&&this.getNumItems()>2}_prepareOptions(t){return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches&&(t.showHideAnimationType="none",t.zoomAnimationDuration=0),{...j,...t}}}export{$ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,T as r,P as t,a,D as o,Q as s}from"./
|
|
1
|
+
import{c as e,T as r,P as t,a,D as o,Q as s}from"./BNMtxstZ.js";import{a5 as l,a6 as n,a7 as c}from"./ChmTNpp8.js";var u=u=>{const[i,d]=e({prefix:"TanstackQueryDevtools"}),m=l(),v=n(()=>{const e=i.theme_preference||r;return"system"!==e?e:m()});return c(s.Provider,{value:u,get children(){return c(t,{localStore:i,setLocalStore:d,get children(){return c(a.Provider,{value:v,get children(){return c(o,{localStore:i,setLocalStore:d})}})}})}})};export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as e,j as s,I as r,g as a,T as o}from"./
|
|
1
|
+
import{P as e,j as s,I as r,g as a,T as o}from"./ChmTNpp8.js";const l=(s,r)=>{const a=new Map;s?.forEach(e=>{a.set(e._id,e)});const o=[];let l=a.get(r);for(;l;)o.unshift({_id:l._id,name:l.name,href:e.FOLDER_EVENTS(l?._id),color:l.color}),l=a.get(l.parentFolderId);return o},c=({folder:e})=>s.jsxs("li",{className:"qc:flex qc:items-center",children:[s.jsx(r,{name:"material-symbols:arrow-forward-ios-rounded",size:"sm"}),s.jsxs(a,{to:e.href,className:"qc:flex qc:items-center qc:gap-2 qc:rounded qc:px-4 qc:py-1 qc:transition-colors qc:hover:bg-primary/10",children:[s.jsx(r,{name:"material-symbols:folder",size:"lg",style:{color:e.color}}),s.jsx(o,{variant:"h5",color:"secondary",className:"qc:whitespace-nowrap",children:e.name})]})]},e.name),n=({homeLink:e,data:o})=>s.jsxs("ol",{role:"list",className:"scrollbar-hide qc:flex qc:max-w-full qc:items-center qc:space-x-3 qc:overflow-y-scroll",children:[s.jsx("li",{children:s.jsxs(a,{to:e,className:"qc:text-foreground",children:[s.jsx(r,{name:"material-symbols:home-outline-rounded",size:"lg"}),s.jsx("span",{className:"qc:sr-only",children:"Home"})]})}),o?.map(e=>s.jsx(c,{folder:e},e._id))]});export{n as F,l as g};
|