talkweb 3.50.37 → 3.50.39
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/dist/index.es.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/js/{AddContact-CeX4oLhj.js → AddContact-geFB5uZu.js} +1 -1
- package/dist/js/{HamburgerMenu-dfTA643C.js → HamburgerMenu-Dnty8L_J.js} +1 -1
- package/dist/js/{ImageEditorModal-DbsdYQVv.js → ImageEditorModal-BE-kPsJd.js} +1 -1
- package/dist/js/{LoadingDots-Bhve_iKp.js → LoadingDots-CSbpS1Hq.js} +1 -1
- package/dist/js/{SearchContactBox-BGd95zZG.js → SearchContactBox-DCxa7Tq6.js} +1 -1
- package/dist/js/{StartCall-eJcDWulH.js → StartCall-BAc3hBgQ.js} +4 -4
- package/dist/js/{TypingView-CuPwigHA.js → TypingView-Cwu2sFsn.js} +1 -1
- package/dist/js/{boredGif-R2s_qhP7.js → boredGif-Bu2KwA3Z.js} +1 -1
- package/dist/js/{index-Du1-jpVq.js → index-BQxCMtTe.js} +1 -1
- package/dist/js/{index-Cz_W2Bpx.js → index-BartosUC.js} +41 -41
- package/dist/js/{index-BrFZ7lHw.js → index-Cb9BgC6O.js} +1 -1
- package/dist/js/{index-C55zkUMg.js → index-CdrvmdU9.js} +1 -1
- package/dist/js/{index-FH6APIiM.js → index-EIjPjN5k.js} +2 -2
- package/dist/js/{index-D57mr3fZ.js → index-tunuUxJO.js} +1 -1
- package/dist/js/{index-DxTp-3fp.js → index-vkicj3Qw.js} +1 -1
- package/dist/js/{main-CXfBH5gS.js → main-BiSoVrq9.js} +2 -2
- package/dist/js/{mic-BCmOzPl5.js → mic-Zn5tfKRn.js} +1 -1
- package/dist/js/{unescapeHtml-DGtjC5X0.js → unescapeHtml-Cw65I-c4.js} +1 -1
- package/dist/js/{useContactThread-DoR5yDuh.js → useContactThread-DFlOxXGB.js} +1 -1
- package/dist/js/{useCopyToClipboard-uKMC-KZD.js → useCopyToClipboard-CBpknd-Y.js} +1 -1
- package/dist/talkweb.css +1 -1
- package/package.json +4 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{b2 as e,j as t,S as n,x as r,aH as o,g as i,ae as a,I as l,b9 as c,ba as s,bb as u,al as d,am as h,aj as m,G as f,eE as p,C as v,eF as g,cC as b,cD as x,l as E,eG as w,e as C,eH as y,eI as N,cN as M,o as R,cM as I}from"./main-
|
|
1
|
+
import{b2 as e,j as t,S as n,x as r,aH as o,g as i,ae as a,I as l,b9 as c,ba as s,bb as u,al as d,am as h,aj as m,G as f,eE as p,C as v,eF as g,cC as b,cD as x,l as E,eG as w,e as C,eH as y,eI as N,cN as M,o as R,cM as I}from"./main-BiSoVrq9.js";import*as k from"react";import _,{memo as S,useState as L,useMemo as P,useCallback as A,useEffect as T,useRef as O}from"react";import{P as F,C as j,I as D,R as z,T as W}from"./index-CdrvmdU9.js";import{p as H,f as U,u as Y,Y as G,C as B}from"./LoadingDots-CSbpS1Hq.js";import{createPortal as Z}from"react-dom";function X(t){return e({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"m112 268 144 144 144-144M256 392V100"},child:[]}]})(t)}function V(t){return e({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M448 256 272 88v96C103.57 184 64 304.77 64 424c48.61-62.24 91.6-96 208-96v96z"},child:[]}]})(t)}function $(t){return e({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M58.79 439.13A16 16 0 0 1 48 424c0-73.1 14.68-131.56 43.65-173.77 35-51 90.21-78.46 164.35-81.87V88a16 16 0 0 1 27.05-11.57l176 168a16 16 0 0 1 0 23.14l-176 168A16 16 0 0 1 256 424v-79.77c-45 1.36-79 8.65-106.07 22.64-29.25 15.12-50.46 37.71-73.32 67a16 16 0 0 1-17.82 5.28z"},child:[]}]})(t)}function K(t){return e({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M240 424v-96c116.4 0 159.39 33.76 208 96 0-119.23-39.57-240-208-240V88L64 256z"},child:[]}]})(t)}function q(t){return e({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M448 440a16 16 0 0 1-12.61-6.15c-22.86-29.27-44.07-51.86-73.32-67C335 352.88 301 345.59 256 344.23V424a16 16 0 0 1-27 11.57l-176-168a16 16 0 0 1 0-23.14l176-168A16 16 0 0 1 256 88v80.36c74.14 3.41 129.38 30.91 164.35 81.87C449.32 292.44 464 350.9 464 424a16 16 0 0 1-16 16z"},child:[]}]})(t)}function J(t){return e({attr:{viewBox:"0 0 512 512"},child:[{tag:"circle",attr:{cx:"256",cy:"272",r:"64"},child:[]},{tag:"path",attr:{d:"M432 144h-59c-3 0-6.72-1.94-9.62-5l-25.94-40.94a15.52 15.52 0 0 0-1.37-1.85C327.11 85.76 315 80 302 80h-92c-13 0-25.11 5.76-34.07 16.21a15.52 15.52 0 0 0-1.37 1.85l-25.94 41c-2.22 2.42-5.34 5-8.62 5v-8a16 16 0 0 0-16-16h-24a16 16 0 0 0-16 16v8h-4a48.05 48.05 0 0 0-48 48V384a48.05 48.05 0 0 0 48 48h352a48.05 48.05 0 0 0 48-48V192a48.05 48.05 0 0 0-48-48zM256 368a96 96 0 1 1 96-96 96.11 96.11 0 0 1-96 96z"},child:[]}]})(t)}const Q=({handleChange:e,focus:o=!1})=>{const[i,a]=_.useState(""),l=_.useRef(null);return _.useEffect(()=>{o&&l.current?.focus()},[o]),/* @__PURE__ */t.jsxs("div",{className:"bg-bgInput flex gap-2 items-center px-3 py-4",children:[
|
|
2
2
|
/* @__PURE__ */t.jsx(n,{className:"text-[#aaaaaa]"}),
|
|
3
3
|
/* @__PURE__ */t.jsx("input",{ref:l,className:"min-w-0 bg-transparent text-invertBlackWhite focus:outline-none focus-visible:outline-none focus-visible:border-0",type:"text",placeholder:r.search,value:i,onChange:t=>{a(t.target.value),e(t.target.value)}})]})},ee=()=>{const e=document.querySelector("#main-input");e&&setTimeout(()=>{e.focus();const t=document.createRange(),n=window.getSelection();t.selectNodeContents(e),t.collapse(!1),n?.removeAllRanges(),n?.addRange(t),e.blur(),e.focus()},0)};function te(e){const t=document.createRange();t.selectNodeContents(e),t.collapse(!1);const n=window.getSelection();n?.removeAllRanges(),n?.addRange(t)}function ne(e){try{const t=JSON.parse(e);return{mimeType:t.file.mimeType,originName:o.sanitize(t.file.originalName)}}catch{return{mimeType:"",originName:""}}}const re=(e,t)=>{if(t.endsWith("/*")){const n=t.slice(0,-1);return e.startsWith(n)}return e===t};function oe(e){return!!e.pathname.includes("thread")||!(!e.pathname.includes("folders")||!e.search.includes("thread"))}const ie={HI_FIVE:1,LIKE:2,HAPPY:3,CRY:4,THUMBS_DOWN:5,RED_HEART:6,ANGRY_FACE:7,VERIFICATION:8,HEART_EYES:9,CLAPPING_HANDS:10,FACE_SCREAMING:11,FLUSHING_FACE:12,GRIMACING_FACE:13,NO_EXPRESSION_FACE:14,ROLF:15,FACEPALMING_GIRL:16,FACEPALMING_BOY:17,SWEARING_FACE:18,BLOWING_KISS_FACE:19,SEE_NO_EVIL_MONKEY:20,TULIP:21,GREEN_HEART:22,PURPLE_HEART:23,BD_CAKE:24,HUNDRED_POINT:25,ALARM:26,PARTY_POPPER:27,PERSON_WALKING:28,SMILING_POO:29,CRYING_LOUDLY_FACE:30};function ae(e){let t="",n="";switch(+e){case ie.HI_FIVE:n="🙏",t="c_1f64f";break;case ie.LIKE:n="👍",t="c_1f44d";break;case ie.HAPPY:n="😄",t="c_1f604";break;case ie.CRY:n="😢",t="c_1f622";break;case ie.THUMBS_DOWN:n="👎",t="c_1f44e";break;case ie.RED_HEART:n="❤️",t="c_2764";break;case ie.ANGRY_FACE:n="😡",t="c_1f621";break;case ie.VERIFICATION:n="✅",t="c_2705";break;case ie.HEART_EYES:n="😍",t="c_1f60d";break;case ie.CLAPPING_HANDS:n="👏",t="c_1f44f";break;case ie.FACE_SCREAMING:n="😱",t="c_1f631";break;case ie.FLUSHING_FACE:n="😳",t="c_1f633";break;case ie.GRIMACING_FACE:n="😬",t="c_1f62c";break;case ie.NO_EXPRESSION_FACE:n="😑",t="c_1f610";break;case ie.ROLF:n="🤣",t="c_1f923";break;case ie.FACEPALMING_GIRL:n="🤦♀️",t="c_1f926g";break;case ie.FACEPALMING_BOY:n="🤦♂️",t="c_1f926b";break;case ie.SWEARING_FACE:n="🤬",t="c_1f92c";break;case ie.BLOWING_KISS_FACE:n="😘",t="c_1f618";break;case ie.SEE_NO_EVIL_MONKEY:n="🙈",t="c_1f648";break;case ie.TULIP:n="💐",t="c_1f490";break;case ie.GREEN_HEART:n="💚",t="c_1f49a";break;case ie.PURPLE_HEART:n="💜",t="c_1f49c";break;case ie.BD_CAKE:n="🎂",t="c_1f382";break;case ie.HUNDRED_POINT:n="💯",t="c_1f4af";break;case ie.ALARM:n="🚨",t="c_1f6a8";break;case ie.PARTY_POPPER:n="🎉",t="c_1f389";break;case ie.PERSON_WALKING:n="🚶",t="c_1f6b6-200d-2642-fe0f";break;case ie.SMILING_POO:n="💩",t="c_1f4a9";break;case ie.CRYING_LOUDLY_FACE:n="😭",t="c_1f62d"}return{emoji:n,emojiClassName:t}}const{HI_FIVE:le,LIKE:ce,HAPPY:se,CRY:ue,THUMBS_DOWN:de,RED_HEART:he,ANGRY_FACE:me,VERIFICATION:fe,HEART_EYES:pe,CLAPPING_HANDS:ve,FACE_SCREAMING:ge,FLUSHING_FACE:be,GRIMACING_FACE:xe,NO_EXPRESSION_FACE:Ee,ROLF:we,FACEPALMING_GIRL:Ce,FACEPALMING_BOY:ye,SWEARING_FACE:Ne,BLOWING_KISS_FACE:Me,SEE_NO_EVIL_MONKEY:Re,TULIP:Ie,GREEN_HEART:ke,PURPLE_HEART:_e,BD_CAKE:Se,HUNDRED_POINT:Le,ALARM:Pe,PARTY_POPPER:Ae,PERSON_WALKING:Te,SMILING_POO:Oe,CRYING_LOUDLY_FACE:Fe}=ie,je=[le,ce,se,ue,de,he,me,fe,pe,ve,ge,be,xe,Ee,we,Ce,ye,Ne,Me,Re,Ie,ke,_e,Se,Le,Pe,Ae,Te,Oe,Fe],De=S(({messageId:e,onOpenChange:n})=>{const r=i(e=>e.threads.thread?.allowedReaction)??[],o=i(e=>e.threads.thread?.id??0),m=a(),[f,p]=L(!1),v=l(),g=i(e=>e.reaction.reactionSummaries)[e],b=g?.userReaction,x=r?.length?r:je,E=P(()=>f?x:x.slice(0,4),[f,x]),w=A(()=>{p(!0)},[]),C=A(()=>{p(!1),n(!1)},[]),y=A(t=>{f&&C(),b?b.reaction!==t?v(u({threadId:o,reactionId:b.id,reaction:t})):v(s({threadId:o,reactionId:b.id})):v(c({threadId:o,messageId:e,reaction:t}))},[v,f,C,e,o,b]);return T(()=>{const e=()=>{C()};return m.pathname&&!oe(m)&&C(),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("scroll",e,!0)}},[C,m.pathname]),/* @__PURE__ */t.jsx(F,{children:/* @__PURE__ */t.jsx(j,{onInteractOutside:C,onPointerDown:()=>{},className:`bg-bgReactionColor shadow-md overflow-y-auto ${f?"rounded-lg":"rounded-full"} text-right z-chatDropDown`,children:/* @__PURE__ */t.jsx(d.div,{initial:{scale:.6},animate:{scale:1,transition:{duration:.1}},children:/* @__PURE__ */t.jsxs("div",{className:`flex ${f?"w-[224px]":"w-auto"} flex-wrap px-[2px]`,children:[E.map(e=>{const n=b?.reaction===e;/* @__PURE__ */
|
|
4
|
-
return t.jsx("div",{className:"flex justify-center items-center mt-[2px]",children:/* @__PURE__ */t.jsx(D,{dir:"rtl",className:"mx-[4px] text-[12px] hover:text-accent rounded-full cursor-pointer text-text w-[36px] h-[36px] "+(n?"bg-[#bda587]":""),children:/* @__PURE__ */t.jsx("button",{type:"button",className:"flex justify-center items-center w-full h-full",onClick:()=>y(e),children:/* @__PURE__ */t.jsx("div",{className:"reaction-transition text-[20px]",children:H(ae(e).emoji,{className:"w-[20px]"})})})})},e)}),!f&&x.length>4&&/* @__PURE__ */t.jsx("div",{className:"flex justify-center items-center mt-[2px]",children:/* @__PURE__ */t.jsx("button",{type:"button",className:"mx-[4px] w-[30px] h-[30px] text-[#bda587] grid place-items-center rounded",onClick:w,"aria-label":"More reactions",title:"More",children:/* @__PURE__ */t.jsx(h,{})})})]})})})})}),ze=/* @__PURE__ */new Map;function We(e){const t=ze.get(e);return t&&(ze.delete(e),ze.set(e,t)),t}function He(e,t){if(ze.size>=1e3){const e=ze.keys().next().value;e&&ze.delete(e)}ze.set(e,t)}const Ue=_.memo(({size:e="LARGE",item:n,children:r})=>{const o=i(e=>e.appConfig.token,m),[a,l]=L(null),{id:c,fileLink:s}=P(()=>{let e;try{const t=JSON.parse(n.metadata);if(e=t?.file?.link,e?.includes("/nzh/drive/downloadImage")){const n=t?.fileHash;e="https://podspace.pod.ir/api/v2/images/"+n}}catch{}return{id:n.id,fileLink:e}},[n.id,n.metadata]),{search:u,cacheKey:d,requestUrl:h}=P(()=>{if(!s)return{search:"",cacheKey:"",requestUrl:""};const t=new URL(s),n=new URLSearchParams({size:e,quality:"1",crop:"false",forceConvert:"false"});t.search=n.toString();const r=t.search;return{search:r,cacheKey:`${c}::${r}`,requestUrl:t.toString()}},[s,c]),f=O(null);return T(()=>{if(!(c&&o&&s&&d&&h))return;const e=new AbortController;return(async()=>{try{const t=We(d);if(t){const e=URL.createObjectURL(t);return f.current=e,void l(e)}const n=await fetch(h,{headers:{Authorization:"Bearer "+o,Accept:"image/*"},signal:e.signal});if(!n.ok)return;const r=await n.blob();He(d,r);const i=URL.createObjectURL(r);f.current=i,l(i)}catch(t){}})(),()=>{e.abort(),f.current&&(URL.revokeObjectURL(f.current),f.current=null)}},[c,o,d,h,s]),r?/* @__PURE__ */t.jsx(t.Fragment,{children:r(a)}):""});function Ye(e,t=2){if(0===e)return"0 Bytes";const n=t<0?0:t,r=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,r)).toFixed(n))+" "+["Bytes","KB","MB","GB","TB"][r]}const Ge=e=>{const t=e.slice(-5).indexOf(".");if(-1===t)return{name:e,ext:""};const n=e.length-5+t;return{name:e.slice(0,n),ext:e.slice(n)}},Be=({file:e})=>{const
|
|
5
|
-
/* @__PURE__ */t.jsxs("div",{dir:"ltr",className:"whitespace-nowrap",children:[Ge(e?.originalName||e?.name||"").ext,
|
|
6
|
-
/* @__PURE__ */t.jsx("div",{className:"truncate",dir:"ltr",ref:n,children:Ge(e?.originalName||e?.name||"").name})]})})},Ze="carousel",Xe="controller",Ve="portal",$e="toolbar",Ke="captions",qe="fullscreen",Je="thumbnails",Qe="zoom",et="loading",tt="error",nt="complete",rt="flex_center",ot="no_scroll_padding",it="slide",at="slide_wrapper",lt="prev",ct="next",st="swipe",ut="close",dt="onPointerDown",ht="onPointerMove",mt="onPointerUp",ft="onPointerLeave",pt="onPointerCancel",vt="onKeyDown",gt="onWheel",bt="icon",xt="contain",Et="cover",wt="Unknown action type",Ct="yarl__";function yt(...e){return[...e].filter(Boolean).join(" ")}function Nt(e){return`${Ct}${e}`}function Mt(e){return`--${Ct}${e}`}function Rt(e,t){return`${e}${t?"_"+t:""}`}function It(e){return t=>Rt(e,t)}function kt(e,t){var n;return null!==(n=null==e?void 0:e[t])&&void 0!==n?n:t}function _t(e,t,n){return kt(e,"{index} of {total}").replace(/\{index}/g,""+(zt(n,t.length)+1)).replace(/\{total}/g,""+t.length)}function St(...e){return()=>{e.forEach(e=>{e()})}}function Lt(e,t,n){return()=>{const r=k.useContext(n);if(!r)throw Error(`${e} must be used within a ${t}.Provider`);return r}}function Pt(){return"undefined"!=typeof window}function At(e,t=0){const n=10**t;return Math.round((e+Number.EPSILON)*n)/n}function Tt(e){return void 0===e.type||"image"===e.type}function Ot(e,t){return e.imageFit===Et||e.imageFit!==xt&&t===Et}function Ft(e){return"string"==typeof e?Number.parseInt(e,10):e}function jt(e){if("number"==typeof e)return{pixel:e};if("string"==typeof e){const t=Ft(e);return e.endsWith("%")?{percent:t}:{pixel:t}}return{pixel:0}}function Dt(e,t){const n=jt(t),r=void 0!==n.percent?e.width/100*n.percent:n.pixel;return{width:Math.max(e.width-2*r,0),height:Math.max(e.height-2*r,0)}}function zt(e,t){return t>0?(e%t+t)%t:0}function Wt(e){return e.length>0}function Ht(e,t){return e[zt(t,e.length)]}function Ut(e,t){return Wt(e)?Ht(e,t):void 0}function Yt(e){return Tt(e)?e.src:void 0}function Gt(e,t,n){if(!n)return e;const{buttons:r,...o}=e,i=r.findIndex(e=>e===t),a=k.isValidElement(n)?k.cloneElement(n,{key:t},null):n;if(i>=0){const e=[...r];return e.splice(i,1,a),{buttons:e,...o}}return{buttons:[a,...r],...o}}function Bt(e,t,n=0){return Math.min(e.preload,Math.max(e.finite?t.length-1:Math.floor(t.length/2),n))}const Zt=Number(k.version.split(".")[0])>=19,Xt={open:!1,close:()=>{},index:0,slides:[],render:{},plugins:[],toolbar:{buttons:[ut]},labels:{},animation:{fade:250,swipe:500,easing:{fade:"ease",swipe:"ease-out",navigation:"ease-in-out"}},carousel:{finite:!1,preload:2,padding:"16px",spacing:"30%",imageFit:xt,imageProps:{}},controller:{ref:null,focus:!0,aria:!1,touchAction:"none",closeOnPullUp:!1,closeOnPullDown:!1,closeOnBackdropClick:!1,preventDefaultWheelX:!0,preventDefaultWheelY:!1,disableSwipeNavigation:!1},portal:{},noScroll:{disabled:!1},on:{},styles:{},className:""};function Vt(e,t){return{name:e,component:t}}function $t(e,t){return{module:e,children:t}}function Kt(e,t,n){return e.module.name===t?n(e):e.children?[$t(e.module,e.children.flatMap(e=>{var r;return null!==(r=Kt(e,t,n))&&void 0!==r?r:[]}))]:[e]}function qt(e,t,n){return e.flatMap(e=>{var r;return null!==(r=Kt(e,t,n))&&void 0!==r?r:[]})}const Jt=k.createContext(null),Qt=Lt("useA11yContext","A11yContext",Jt);function en({children:e}){const[t,n]=k.useState(!1),[r,o]=k.useState(!1),i=k.useMemo(()=>({focusWithin:t,trackFocusWithin:(e,t)=>{const r=r=>o=>{var i;o.currentTarget.contains(o.relatedTarget)||n(r),null===(i=r?e:t)||void 0===i||i(o)};return{onFocus:r(!0),onBlur:r(!1)}},autoPlaying:r,setAutoPlaying:o}),[t,r]);return k.createElement(Jt.Provider,{value:i},e)}const tn=k.createContext(null),nn=Lt("useDocument","DocumentContext",tn);function rn({nodeRef:e,children:t}){const n=k.useMemo(()=>{const t=t=>{var n;return(null===(n=t||e.current)||void 0===n?void 0:n.ownerDocument)||document};return{getOwnerDocument:t,getOwnerWindow:e=>{var n;return(null===(n=t(e))||void 0===n?void 0:n.defaultView)||window}}},[e]);return k.createElement(tn.Provider,{value:n},t)}const on=k.createContext(null),an=Lt("useEvents","EventsContext",on);function ln({children:e}){const[t]=k.useState({});k.useEffect(()=>()=>{Object.keys(t).forEach(e=>delete t[e])},[t]);const n=k.useMemo(()=>{const e=(e,n)=>{var r;null===(r=t[e])||void 0===r||r.splice(0,t[e].length,...t[e].filter(e=>e!==n))};return{publish:(...[e,n])=>{var r;null===(r=t[e])||void 0===r||r.forEach(e=>e(n))},subscribe:(n,r)=>(t[n]||(t[n]=[]),t[n].push(r),()=>e(n,r)),unsubscribe:e}},[t]);return k.createElement(on.Provider,{value:n},e)}const cn=k.createContext(null),sn=Lt("useLightboxProps","LightboxPropsContext",cn);function un({children:e,...t}){return k.createElement(cn.Provider,{value:t},e)}const dn=k.createContext(null),hn=Lt("useLightboxState","LightboxStateContext",dn),mn=k.createContext(null),fn=Lt("useLightboxDispatch","LightboxDispatchContext",mn);function pn(e,t){switch(t.type){case"swipe":{const{slides:n}=e,r=(null==t?void 0:t.increment)||0,o=e.globalIndex+r,i=zt(o,n.length);return{slides:n,currentIndex:i,globalIndex:o,currentSlide:Ut(n,i),animation:r||void 0!==t.duration?{increment:r,duration:t.duration,easing:t.easing}:void 0}}case"update":return t.slides!==e.slides||t.index!==e.currentIndex?{slides:t.slides,currentIndex:t.index,globalIndex:t.index,currentSlide:Ut(t.slides,t.index)}:e;default:throw Error(wt)}}function vn({slides:e,index:t,children:n}){const[r,o]=k.useReducer(pn,{slides:e,currentIndex:t,globalIndex:t,currentSlide:Ut(e,t)});k.useEffect(()=>{o({type:"update",slides:e,index:t})},[e,t]);const i=k.useMemo(()=>({...r,state:r,dispatch:o}),[r,o]);return k.createElement(mn.Provider,{value:o},k.createElement(dn.Provider,{value:i},n))}const gn=k.createContext(null),bn=Lt("useTimeouts","TimeoutsContext",gn);function xn({children:e}){const[t]=k.useState([]);k.useEffect(()=>()=>{t.forEach(e=>window.clearTimeout(e)),t.splice(0,t.length)},[t]);const n=k.useMemo(()=>{const e=e=>{t.splice(0,t.length,...t.filter(t=>t!==e))};return{setTimeout:(n,r)=>{const o=window.setTimeout(()=>{e(o),n()},r);return t.push(o),o},clearTimeout:t=>{void 0!==t&&(e(t),window.clearTimeout(t))}}},[t]);return k.createElement(gn.Provider,{value:n},e)}const En=k.forwardRef(function({label:e,className:t,icon:n,renderIcon:r,onClick:o,style:i,...a},l){const{styles:c,labels:s}=sn(),u=kt(s,e);return k.createElement("button",{ref:l,type:"button",title:u,"aria-label":u,className:yt(Nt("button"),t),onClick:o,style:{...i,...c.button},...a},r?r():k.createElement(n,{className:Nt(bt),style:c.icon}))});function wn(e,t){const n=e=>k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",...e},t);return n.displayName=e,n}function Cn(e,t){return wn(e,k.createElement("g",{fill:"currentColor"},k.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t))}function yn(e,t){return wn(e,k.createElement(k.Fragment,null,k.createElement("defs",null,k.createElement("mask",{id:"strike"},k.createElement("path",{d:"M0 0h24v24H0z",fill:"white"}),k.createElement("path",{d:"M0 0L24 24",stroke:"black",strokeWidth:4}))),k.createElement("path",{d:"M0.70707 2.121320L21.878680 23.292883",stroke:"currentColor",strokeWidth:2}),k.createElement("g",{fill:"currentColor",mask:"url(#strike)"},k.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t)))}const Nn=Cn("Close",k.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),Mn=Cn("Previous",k.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),Rn=Cn("Next",k.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),In=Cn("Loading",k.createElement(k.Fragment,null,Array.from({length:8}).map((e,t,n)=>k.createElement("line",{key:t,x1:"12",y1:"6.5",x2:"12",y2:"1.8",strokeLinecap:"round",strokeWidth:"2.6",stroke:"currentColor",strokeOpacity:1/n.length*(t+1),transform:`rotate(${360/n.length*t}, 12, 12)`})))),kn=Cn("Error",k.createElement("path",{d:"M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z"})),_n=Pt()?k.useLayoutEffect:k.useEffect;function Sn(){const[e,t]=k.useState(!1);return k.useEffect(()=>{var e,n;const r=null===(e=window.matchMedia)||void 0===e?void 0:e.call(window,"(prefers-reduced-motion: reduce)");t(null==r?void 0:r.matches);const o=e=>t(e.matches);return null===(n=null==r?void 0:r.addEventListener)||void 0===n||n.call(r,"change",o),()=>{var e;return null===(e=null==r?void 0:r.removeEventListener)||void 0===e?void 0:e.call(r,"change",o)}},[]),e}function Ln(e,t){const n=k.useRef(void 0),r=k.useRef(void 0),o=Sn();return _n(()=>{var i,a,l;if(e.current&&void 0!==n.current&&!o){const{keyframes:o,duration:s,easing:u,onfinish:d}=t(n.current,e.current.getBoundingClientRect(),function(e){let t=0,n=0,r=0;const o=window.getComputedStyle(e).transform.match(/matrix.*\((.+)\)/);if(o){const e=o[1].split(",").map(Ft);6===e.length?(t=e[4],n=e[5]):16===e.length&&(t=e[12],n=e[13],r=e[14])}return{x:t,y:n,z:r}}(e.current))||{};if(o&&s){null===(i=r.current)||void 0===i||i.cancel(),r.current=void 0;try{r.current=null===(l=(a=e.current).animate)||void 0===l?void 0:l.call(a,o,{duration:s,easing:u})}catch(c){}r.current&&(r.current.onfinish=()=>{r.current=void 0,null==d||d()})}}n.current=void 0}),{prepareAnimation:e=>{n.current=e},isAnimationPlaying:()=>{var e;return"running"===(null===(e=r.current)||void 0===e?void 0:e.playState)}}}function Pn(){const e=k.useRef(null),t=k.useRef(void 0),[n,r]=k.useState();return{setContainerRef:k.useCallback(n=>{e.current=n,t.current&&(t.current.disconnect(),t.current=void 0);const o=()=>{if(n){const e=window.getComputedStyle(n),t=e=>parseFloat(e)||0;r({width:Math.round(n.clientWidth-t(e.paddingLeft)-t(e.paddingRight)),height:Math.round(n.clientHeight-t(e.paddingTop)-t(e.paddingBottom))})}else r(void 0)};o(),n&&"undefined"!=typeof ResizeObserver&&(t.current=new ResizeObserver(o),t.current.observe(n))},[]),containerRef:e,containerRect:n}}function An(){const e=k.useRef(void 0),{setTimeout:t,clearTimeout:n}=bn();return k.useCallback((r,o)=>{n(e.current),e.current=t(r,o>0?o:0)},[t,n])}function Tn(e){const t=k.useRef(e);return _n(()=>{t.current=e}),k.useCallback((...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)},[])}function On(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function Fn(e,t){return k.useMemo(()=>null==e&&null==t?null:n=>{On(e,n),On(t,n)},[e,t])}function jn(e,t=!1){const n=k.useRef(!1);return _n(()=>{t&&n.current&&(n.current=!1,e())},[t,e]),{onFocus:k.useCallback(()=>{n.current=!0},[]),onBlur:k.useCallback(()=>{n.current=!1},[])}}function Dn(){const[e,t]=k.useState(!1);return _n(()=>{t("rtl"===window.getComputedStyle(window.document.documentElement).direction)},[]),e}function zn(){const[e]=k.useState({}),t=k.useCallback((t,n)=>{var r;null===(r=e[t])||void 0===r||r.forEach(e=>{n.isPropagationStopped()||e(n)})},[e]);return{registerSensors:k.useMemo(()=>({onPointerDown:e=>t(dt,e),onPointerMove:e=>t(ht,e),onPointerUp:e=>t(mt,e),onPointerLeave:e=>t(ft,e),onPointerCancel:e=>t(pt,e),onKeyDown:e=>t(vt,e),onKeyUp:e=>t("onKeyUp",e),onWheel:e=>t(gt,e)}),[t]),subscribeSensors:k.useCallback((t,n)=>(e[t]||(e[t]=[]),e[t].unshift(n),()=>{const r=e[t];r&&r.splice(0,r.length,...r.filter(e=>e!==n))}),[e])}}function Wn(e,t){const n=k.useRef(0),r=An(),o=Tn((...t)=>{n.current=Date.now(),e(t)});return k.useCallback((...e)=>{r(()=>{o(e)},t-(Date.now()-n.current))},[t,o,r])}const Hn=It("slide"),Un=It("slide_image");function Yn({slide:e,offset:t,render:n,rect:r,imageFit:o,imageProps:i,onClick:a,onLoad:l,onError:c,style:s}){var u,d,h,m,f,p,v,g;const[b,x]=k.useState(et),{publish:E}=an(),{setTimeout:w}=bn(),C=k.useRef(null);k.useEffect(()=>{0===t&&E((e=>"active-slide-"+e)(b))},[t,b,E]);const y=Tn(e=>{("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{e.parentNode&&(x(nt),w(()=>{null==l||l(e)},0))})}),N=k.useCallback(e=>{C.current=e,(null==e?void 0:e.complete)&&y(e)},[y]),M=k.useCallback(e=>{y(e.currentTarget)},[y]),R=Tn(()=>{x(tt),null==c||c()}),I=Ot(e,o),_=(e,t)=>Number.isFinite(e)?e:t,S=_(Math.max(...(null!==(d=null===(u=e.srcSet)||void 0===u?void 0:u.map(e=>e.width))&&void 0!==d?d:[]).concat(e.width?[e.width]:[]).filter(Boolean)),(null===(h=C.current)||void 0===h?void 0:h.naturalWidth)||0),L=_(Math.max(...(null!==(f=null===(m=e.srcSet)||void 0===m?void 0:m.map(e=>e.height))&&void 0!==f?f:[]).concat(e.height?[e.height]:[]).filter(Boolean)),(null===(p=C.current)||void 0===p?void 0:p.naturalHeight)||0),P=S&&L?{maxWidth:`min(${S}px, 100%)`,maxHeight:`min(${L}px, 100%)`}:{maxWidth:"100%",maxHeight:"100%"},A=null===(v=e.srcSet)||void 0===v?void 0:v.sort((e,t)=>e.width-t.width).map(e=>`${e.src} ${e.width}w`).join(", "),T=A&&r&&Pt()?Math.round(Math.min(r&&!I&&e.width&&e.height?r.height/e.height*e.width:Number.MAX_VALUE,r.width))+"px":void 0,{style:O,className:F,...j}=i||{};return k.createElement(k.Fragment,null,k.createElement("img",{ref:N,onLoad:M,onError:R,onClick:a,draggable:!1,className:yt(Nt(Un()),I&&Nt(Un("cover")),b!==nt&&Nt(Un("loading")),F),style:{...P,...s,...O},...j,alt:null!==(g=e.alt)&&void 0!==g?g:"",sizes:T,srcSet:A,src:e.src}),b!==nt&&k.createElement("div",{className:Nt(Hn("placeholder"))},b===et&&((null==n?void 0:n.iconLoading)?n.iconLoading():k.createElement(In,{className:yt(Nt(bt),Nt(Hn(et)))})),b===tt&&((null==n?void 0:n.iconError)?n.iconError():k.createElement(kn,{className:yt(Nt(bt),Nt(Hn(tt)))}))))}const Gn=k.forwardRef(function({className:e,children:t,onFocus:n,onBlur:r,...o},i){const a=k.useRef(null),{trackFocusWithin:l}=Qt();return k.createElement(rn,{nodeRef:a},k.createElement("div",{ref:Fn(i,a),className:yt(Nt("root"),e),...l(n,r),...o},t))});var Bn,Zn,Xn,Vn;function $n(e,t,n,r,o){k.useEffect(()=>o?()=>{}:St(e(dt,t),e(ht,n),e(mt,r),e(ft,r),e(pt,r)),[e,t,n,r,o])}(Zn=Bn||(Bn={}))[Zn.NONE=0]="NONE",Zn[Zn.SWIPE=1]="SWIPE",Zn[Zn.PULL=2]="PULL",Zn[Zn.ANIMATION=3]="ANIMATION",(Vn=Xn||(Xn={}))[Vn.NONE=0]="NONE",Vn[Vn.SWIPE=1]="SWIPE",Vn[Vn.PULL=2]="PULL";const Kn=It("container"),qn=k.createContext(null),Jn=Lt("useController","ControllerContext",qn),Qn=Vt(Xe,function({children:e,...t}){var n;const{carousel:r,animation:o,controller:i,on:a,styles:l,render:c}=t,{closeOnPullUp:s,closeOnPullDown:u,preventDefaultWheelX:d,preventDefaultWheelY:h}=i,[m,f]=k.useState(),p=hn(),v=fn(),[g,b]=k.useState(Bn.NONE),x=k.useRef(0),E=k.useRef(0),w=k.useRef(1),{registerSensors:C,subscribeSensors:y}=zn(),{subscribe:N,publish:M}=an(),R=An(),I=An(),_=An(),{containerRef:S,setContainerRef:L,containerRect:P}=Pn(),A=Fn(function({preventDefaultWheelX:e,preventDefaultWheelY:t}){const n=k.useRef(null),r=Tn(n=>{const r=Math.abs(n.deltaX)>Math.abs(n.deltaY);(r&&e||!r&&t||n.ctrlKey)&&n.preventDefault()});return k.useCallback(e=>{var t;e?e.addEventListener("wheel",r,{passive:!1}):null===(t=n.current)||void 0===t||t.removeEventListener("wheel",r),n.current=e},[r])}({preventDefaultWheelX:d,preventDefaultWheelY:h}),L),T=k.useRef(null),O=Fn(T,void 0),{getOwnerDocument:F}=nn(),j=Dn(),D=e=>(j?-1:1)*("number"==typeof e?e:1),z=Tn(()=>{var e;return null===(e=S.current)||void 0===e?void 0:e.focus()}),W=Tn(()=>t),H=Tn(()=>p),U=k.useCallback(e=>M(lt,e),[M]),Y=k.useCallback(e=>M(ct,e),[M]),G=k.useCallback(()=>M(ut),[M]),B=e=>!(r.finite&&(D(e)>0&&0===p.currentIndex||D(e)<0&&p.currentIndex===p.slides.length-1)),Z=e=>{var t;x.current=e,null===(t=S.current)||void 0===t||t.style.setProperty(Mt("swipe_offset"),Math.round(e)+"px")},X=e=>{var t,n;E.current=e,w.current=Math.min(Math.max(At(1-(u&&e>0?e:s&&e<0?-e:0)/60*.5,2),.5),1),null===(t=S.current)||void 0===t||t.style.setProperty(Mt("pull_offset"),Math.round(e)+"px"),null===(n=S.current)||void 0===n||n.style.setProperty(Mt("pull_opacity"),""+w.current)},{prepareAnimation:V}=Ln(T,(e,t,n)=>{if(T.current&&P)return{keyframes:[{transform:`translate(0, ${e.rect.y-t.y+n.y}px)`,opacity:e.opacity},{transform:"translate(0, 0)",opacity:1}],duration:e.duration,easing:o.easing.fade}}),$=(e,t)=>{if(s||u){X(e);let n=0;T.current&&(n=o.fade*(t?2:1),V({rect:T.current.getBoundingClientRect(),opacity:w.current,duration:n})),_(()=>{X(0),b(Bn.NONE)},n),b(Bn.ANIMATION),t||G()}},{prepareAnimation:K,isAnimationPlaying:q}=Ln(T,(e,t,n)=>{var o;if(T.current&&P&&(null===(o=p.animation)||void 0===o?void 0:o.duration)){const o=jt(r.spacing),i=(o.percent?o.percent*P.width/100:o.pixel)||0;return{keyframes:[{transform:`translate(${D(p.globalIndex-e.index)*(P.width+i)+e.rect.x-t.x+n.x}px, 0)`},{transform:"translate(0, 0)"}],duration:p.animation.duration,easing:p.animation.easing}}}),J=Tn(e=>{var t,n;const r=e.offset||0,i=r?o.swipe:null!==(t=o.navigation)&&void 0!==t?t:o.swipe,a=r||q()?o.easing.swipe:o.easing.navigation;let{direction:l}=e;const c=null!==(n=e.count)&&void 0!==n?n:1;let s=Bn.ANIMATION,u=i*c;if(!l){const t=null==P?void 0:P.width,n=e.duration||0,o=t?i/t*Math.abs(r):i;0!==c?(n<o?u=u/o*Math.max(n,o/5):t&&(u=i/t*(t-Math.abs(r))),l=D(r)>0?lt:ct):u=i/2}let d=0;l===lt?B(D(1))?d=-c:(s=Bn.NONE,u=i):l===ct&&(B(D(-1))?d=c:(s=Bn.NONE,u=i)),u=Math.round(u),I(()=>{Z(0),b(Bn.NONE)},u),T.current&&K({rect:T.current.getBoundingClientRect(),index:p.globalIndex}),b(s),M(st,{type:"swipe",increment:d,duration:u,easing:a})});k.useEffect(()=>{var e,t;(null===(e=p.animation)||void 0===e?void 0:e.increment)&&(null===(t=p.animation)||void 0===t?void 0:t.duration)&&R(()=>v({type:"swipe",increment:0}),p.animation.duration)},[p.animation,v,R]);const Q=[y,B,(null==P?void 0:P.width)||0,o.swipe,()=>b(Bn.SWIPE),e=>Z(e),(e,t)=>J({offset:e,duration:t,count:1}),e=>J({offset:e,count:0})],ee=[()=>{u&&b(Bn.PULL)},e=>X(e),e=>$(e),e=>$(e,!0)];!function({disableSwipeNavigation:e,closeOnBackdropClick:t},n,r,o,i,a,l,c,s,u,d,h,m,f,p,v){const g=k.useRef(0),b=k.useRef([]),x=k.useRef(void 0),E=k.useRef(0),w=k.useRef(Xn.NONE),C=k.useCallback(e=>{x.current===e.pointerId&&(x.current=void 0,w.current=Xn.NONE);const t=b.current;t.splice(0,t.length,...t.filter(t=>t.pointerId!==e.pointerId))},[]),y=k.useCallback(e=>{C(e),e.persist(),b.current.push(e)},[C]),N=k.useCallback(e=>b.current.find(({pointerId:t})=>e.pointerId===t),[]),M=Tn(e=>{y(e)}),R=(e,t)=>d&&e>t||u&&e<-t,I=Tn(e=>{const n=N(e);if(n)if(x.current===e.pointerId){const e=Date.now()-E.current,t=g.current;w.current===Xn.SWIPE?Math.abs(t)>.3*o||Math.abs(t)>5&&e<i?c(t,e):s(t):w.current===Xn.PULL&&(R(t,60)?f(t,e):p(t)),g.current=0,w.current=Xn.NONE}else{const{target:r}=e;t&&r instanceof HTMLElement&&r===n.target&&(r.classList.contains(Nt(it))||r.classList.contains(Nt(at)))&&v()}C(e)});$n(n,M,Tn(t=>{const n=N(t);if(n){const o=x.current===t.pointerId;if(0===t.buttons)return void(o&&0!==g.current?I(t):C(n));const i=t.clientX-n.clientX,c=t.clientY-n.clientY;if(void 0===x.current){const n=e=>{y(t),x.current=t.pointerId,E.current=Date.now(),w.current=e};Math.abs(i)>Math.abs(c)&&Math.abs(i)>30&&r(i)?e||(n(Xn.SWIPE),a()):Math.abs(c)>Math.abs(i)&&R(c,30)&&(n(Xn.PULL),h())}else o&&(w.current===Xn.SWIPE?(g.current=i,l(i)):w.current===Xn.PULL&&(g.current=c,m(c)))}}),I)}(i,...Q,s,u,...ee,G),function(e,t,n,r,o,i,a,l,c){const s=k.useRef(0),u=k.useRef(0),d=k.useRef(void 0),h=k.useRef(void 0),m=k.useRef(0),f=k.useRef(void 0),p=k.useRef(0),{setTimeout:v,clearTimeout:g}=bn(),b=k.useCallback(()=>{d.current&&(g(d.current),d.current=void 0)},[g]),x=k.useCallback(()=>{h.current&&(g(h.current),h.current=void 0)},[g]),E=Tn(()=>{e!==Bn.SWIPE&&(s.current=0,p.current=0,b(),x())});k.useEffect(E,[e,E]);const w=Tn(e=>{h.current=void 0,s.current===e&&c(s.current)}),C=Tn(t=>{if(t.ctrlKey)return;if(Math.abs(t.deltaY)>Math.abs(t.deltaX))return;const c=e=>{m.current=e,g(f.current),f.current=e>0?v(()=>{m.current=0,f.current=void 0},300):void 0};if(e===Bn.NONE){if(Math.abs(t.deltaX)<=1.2*Math.abs(m.current))return void c(t.deltaX);if(!n(-t.deltaX))return;if(u.current+=t.deltaX,b(),Math.abs(u.current)>30)u.current=0,c(0),p.current=Date.now(),i();else{const e=u.current;d.current=v(()=>{d.current=void 0,e===u.current&&(u.current=0)},o)}}else if(e===Bn.SWIPE){let e=s.current-t.deltaX;if(e=Math.min(Math.abs(e),r)*Math.sign(e),s.current=e,a(e),x(),Math.abs(e)>.2*r)return c(t.deltaX),void l(e,Date.now()-p.current);h.current=v(()=>w(e),2*o)}else c(t.deltaX)});k.useEffect(()=>t(gt,C),[t,C])}(g,...Q);const te=Tn(()=>{i.focus&&F().querySelector(`.${Nt(Ve)} .${Nt(Kn())}`)&&z()});k.useEffect(te,[te]);const ne=Tn(()=>{var e;null===(e=a.view)||void 0===e||e.call(a,{index:p.currentIndex})});k.useEffect(ne,[p.globalIndex,ne]),k.useEffect(()=>St(N(lt,e=>J({direction:lt,...e})),N(ct,e=>J({direction:ct,...e})),N(st,e=>v(e))),[N,J,v]);const re=k.useMemo(()=>({prev:U,next:Y,close:G,focus:z,slideRect:P?Dt(P,r.padding):{width:0,height:0},containerRect:P||{width:0,height:0},subscribeSensors:y,containerRef:S,setCarouselRef:O,toolbarWidth:m,setToolbarWidth:f}),[U,Y,G,z,y,P,S,O,m,f,r.padding]);return k.useImperativeHandle(i.ref,()=>({prev:U,next:Y,close:G,focus:z,getLightboxProps:W,getLightboxState:H}),[U,Y,G,z,W,H]),k.createElement("div",{ref:A,className:yt(Nt(Kn()),Nt(rt)),style:{...g===Bn.SWIPE?{[Mt("swipe_offset")]:Math.round(x.current)+"px"}:null,...g===Bn.PULL?{[Mt("pull_offset")]:Math.round(E.current)+"px",[Mt("pull_opacity")]:""+w.current}:null,..."none"!==i.touchAction?{[Mt("controller_touch_action")]:i.touchAction}:null,...l.container},tabIndex:-1,...C},P&&k.createElement(qn.Provider,{value:re},e,null===(n=c.controls)||void 0===n?void 0:n.call(c)))});function er(e){return Rt(Ze,e)}function tr(e){return Rt(it,e)}function nr({slide:e,offset:t}){const n=k.useRef(null),{currentIndex:r,slides:o}=hn(),{slideRect:i,focus:a}=Jn(),{render:l,carousel:{imageFit:c,imageProps:s},on:{click:u},styles:{slide:d},labels:h}=sn(),{getOwnerDocument:m}=nn(),f=0!==t;return k.useEffect(()=>{var e;f&&(null===(e=n.current)||void 0===e?void 0:e.contains(m().activeElement))&&a()},[f,a,m]),k.createElement("div",{ref:n,className:yt(Nt(tr()),!f&&Nt(tr("current")),Nt(rt)),...(p=f,{inert:Zt?p:p?"":void 0}),style:d,role:"group","aria-roledescription":kt(h,"Slide"),"aria-label":_t(h,o,r+t)},(()=>{var n,o,a,d;let h=null===(n=l.slide)||void 0===n?void 0:n.call(l,{slide:e,offset:t,rect:i});return!h&&Tt(e)&&(h=k.createElement(Yn,{slide:e,offset:t,render:l,rect:i,imageFit:c,imageProps:s,onClick:f?void 0:()=>null==u?void 0:u({index:r})})),h?k.createElement(k.Fragment,null,null===(o=l.slideHeader)||void 0===o?void 0:o.call(l,{slide:e}),(null!==(a=l.slideContainer)&&void 0!==a?a:({children:e})=>e)({slide:e,children:h}),null===(d=l.slideFooter)||void 0===d?void 0:d.call(l,{slide:e})):null})());var p}function rr(){const e=sn().styles.slide;return k.createElement("div",{className:Nt(it),style:e})}const or=Vt(Ze,function({carousel:e,labels:t}){const{slides:n,currentIndex:r,globalIndex:o}=hn(),{setCarouselRef:i}=Jn(),{autoPlaying:a,focusWithin:l}=Qt(),c=jt(e.spacing),s=jt(e.padding),u=Bt(e,n,1),d=[];if(Wt(n))for(let h=r-u;h<=r+u;h+=1){const t=Ht(n,h),i=o-r+h,a=e.finite&&(h<0||h>n.length-1);d.push(a?{key:i}:{key:[""+i,Yt(t)].filter(Boolean).join("|"),offset:h-r,slide:t})}return k.createElement("div",{ref:i,className:yt(Nt(er()),d.length>0&&Nt(er("with_slides"))),style:{[""+Mt(er("slides_count"))]:d.length,[""+Mt(er("spacing_px"))]:c.pixel||0,[""+Mt(er("spacing_percent"))]:c.percent||0,[""+Mt(er("padding_px"))]:s.pixel||0,[""+Mt(er("padding_percent"))]:s.percent||0},role:"region","aria-live":a&&!l?"off":"polite","aria-roledescription":kt(t,"Carousel"),"aria-label":kt(t,"Photo gallery")},d.map(({key:e,slide:t,offset:n})=>t?k.createElement(nr,{key:e,slide:t,offset:n}):k.createElement(rr,{key:e})))});function ir(){const{carousel:e}=sn(),{slides:t,currentIndex:n}=hn();return{prevDisabled:0===t.length||e.finite&&0===n,nextDisabled:0===t.length||e.finite&&n===t.length-1}}function ar(e){var t;const n=Dn(),{publish:r}=an(),{animation:o}=sn(),{prevDisabled:i,nextDisabled:a}=ir(),l=(null!==(t=o.navigation)&&void 0!==t?t:o.swipe)/2,c=Wn(()=>r(lt),l),s=Wn(()=>r(ct),l),u=Tn(e=>{switch(e.key){case"Escape":r(ut);break;case"ArrowLeft":(n?a:i)||(n?s:c)();break;case"ArrowRight":(n?i:a)||(n?c:s)()}});k.useEffect(()=>e(vt,u),[e,u])}function lr({label:e,icon:t,renderIcon:n,action:r,onClick:o,disabled:i,style:a}){return k.createElement(En,{label:e,icon:t,renderIcon:n,className:Nt("navigation_"+r),disabled:i,onClick:o,style:a,...jn(Jn().focus,i)})}const cr=Vt("navigation",function({render:{buttonPrev:e,buttonNext:t,iconPrev:n,iconNext:r},styles:o}){const{prev:i,next:a,subscribeSensors:l}=Jn(),{prevDisabled:c,nextDisabled:s}=ir();return ar(l),k.createElement(k.Fragment,null,e?e():k.createElement(lr,{label:"Previous",action:lt,icon:Mn,renderIcon:n,style:o.navigationPrev,disabled:c,onClick:i}),t?t():k.createElement(lr,{label:"Next",action:ct,icon:Rn,renderIcon:r,style:o.navigationNext,disabled:s,onClick:a}))}),sr=Nt("no_scroll"),ur=Nt(ot);function dr(e){return"style"in e}function hr(e,t,n){const r=window.getComputedStyle(e),o=n?"padding-left":"padding-right",i=n?r.paddingLeft:r.paddingRight,a=e.style.getPropertyValue(o);return e.style.setProperty(o,(Ft(i)||0)+t+"px"),()=>{a?e.style.setProperty(o,a):e.style.removeProperty(o)}}const mr=Vt("no-scroll",function({noScroll:{disabled:e},children:t}){const n=Dn(),{getOwnerDocument:r,getOwnerWindow:o}=nn();return k.useEffect(()=>{if(e)return()=>{};const t=[],i=o(),{body:a,documentElement:l}=r(),c=Math.round(i.innerWidth-l.clientWidth);if(c>0){t.push(hr(a,c,n));const e=a.getElementsByTagName("*");for(let r=0;r<e.length;r+=1){const o=e[r];dr(o)&&"fixed"===i.getComputedStyle(o).getPropertyValue("position")&&!o.classList.contains(ur)&&t.push(hr(o,c,n))}}return a.classList.add(sr),()=>{a.classList.remove(sr),t.forEach(e=>e())}},[n,e,r,o]),k.createElement(k.Fragment,null,t)});function fr(e){return Rt(Ve,e)}function pr(e,t,n){const r=e.getAttribute(t);return e.setAttribute(t,n),()=>{r?e.setAttribute(t,r):e.removeAttribute(t)}}const vr=Vt(Ve,function({children:e,animation:t,styles:n,className:r,on:o,portal:i,close:a,labels:l}){const[c,s]=k.useState(!1),[u,d]=k.useState(!1),h=k.useRef([]),m=k.useRef(null),{setTimeout:f}=bn(),{subscribe:p}=an(),v=Sn()?0:t.fade;k.useEffect(()=>(s(!0),()=>{s(!1),d(!1)}),[]);const g=Tn(()=>{h.current.forEach(e=>e()),h.current=[]}),b=Tn(()=>{var e;d(!1),g(),null===(e=o.exiting)||void 0===e||e.call(o),f(()=>{var e;null===(e=o.exited)||void 0===e||e.call(o),a()},v)});k.useEffect(()=>p(ut,b),[p,b]);const x=Tn(e=>{var t,n,r;!function(e){e.scrollTop}(e),d(!0),null===(t=o.entering)||void 0===t||t.call(o);const i=null!==(r=null===(n=e.parentNode)||void 0===n?void 0:n.children)&&void 0!==r?r:[];for(let o=0;o<i.length;o+=1){const t=i[o];-1===["TEMPLATE","SCRIPT","STYLE"].indexOf(t.tagName)&&t!==e&&(h.current.push(pr(t,"inert","")),h.current.push(pr(t,"aria-hidden","true")))}h.current.push(()=>{var e,t;null===(t=null===(e=m.current)||void 0===e?void 0:e.focus)||void 0===t||t.call(e)}),f(()=>{var e;null===(e=o.entered)||void 0===e||e.call(o)},v)}),E=k.useCallback(e=>{e?x(e):g()},[x,g]);return c?Z(k.createElement(Gn,{ref:E,className:yt(r,Nt(fr()),Nt(ot),u&&Nt(fr("open"))),"aria-modal":!0,role:"dialog","aria-label":kt(l,"Lightbox"),style:{...t.fade!==Xt.animation.fade?{[Mt("fade_animation_duration")]:v+"ms"}:null,...t.easing.fade!==Xt.animation.easing.fade?{[Mt("fade_animation_timing_function")]:t.easing.fade}:null,...n.root},onFocus:e=>{m.current||(m.current=e.relatedTarget)}},e),i.root||document.body):null}),gr=Vt("root",function({children:e}){return k.createElement(k.Fragment,null,e)}),br=Vt($e,function({toolbar:{buttons:e},render:{buttonClose:t,iconClose:n},styles:r}){const{close:o,setToolbarWidth:i}=Jn(),{setContainerRef:a,containerRect:l}=Pn();return _n(()=>{i(null==l?void 0:l.width)},[i,null==l?void 0:l.width]),k.createElement("div",{ref:a,style:r.toolbar,className:Nt(Rt($e,void 0))},null==e?void 0:e.map(e=>e===ut?t?t():k.createElement(En,{key:ut,label:"Close",icon:Nn,renderIcon:n,onClick:o}):e))});function xr(e,t){var n;return k.createElement(e.module.component,{key:e.module.name,...t},null===(n=e.children)||void 0===n?void 0:n.map(e=>xr(e,t)))}function Er(e,t={}){const{easing:n,...r}=e,{easing:o,...i}=t;return{easing:{...n,...o},...r,...i}}function wr({carousel:e,animation:t,render:n,toolbar:r,controller:o,noScroll:i,on:a,plugins:l,slides:c,index:s,...u}){const{animation:d,carousel:h,render:m,toolbar:f,controller:p,noScroll:v,on:g,slides:b,index:x,plugins:E,...w}=Xt,{config:C,augmentation:y}=function(e,t=[],n=[]){let r=e;const o=e=>{const t=[...r];for(;t.length>0;){const n=t.pop();if((null==n?void 0:n.module.name)===e)return!0;(null==n?void 0:n.children)&&t.push(...n.children)}return!1},i=(e,t)=>{r=""!==e?qt(r,e,e=>[$t(t,[e])]):[$t(t,r)]},a=(e,t)=>{r=qt(r,e,e=>[$t(e.module,[$t(t,e.children)])])},l=(e,t,n)=>{r=qt(r,e,e=>{var r;return[$t(e.module,[...n?[$t(t)]:[],...null!==(r=e.children)&&void 0!==r?r:[],...n?[]:[$t(t)]])]})},c=(e,t,n)=>{r=qt(r,e,e=>[...n?[$t(t)]:[],e,...n?[]:[$t(t)]])},s=e=>{a(Xe,e)},u=(e,t)=>{r=qt(r,e,e=>[$t(t,e.children)])},d=e=>{r=qt(r,e,e=>e.children)},h=e=>{n.push(e)};return t.forEach(e=>{e({contains:o,addParent:i,append:a,addChild:l,addSibling:c,addModule:s,replace:u,remove:d,augment:h})}),{config:r,augmentation:e=>n.reduce((e,t)=>t(e),e)}}([$t(vr,[$t(mr,[$t(Qn,[$t(or),$t(br),$t(cr)])])])],l||E),N=y({animation:Er(d,t),carousel:{...h,...e},render:{...m,...n},toolbar:{...f,...r},controller:{...p,...o},noScroll:{...v,...i},on:{...g,...a},...w,...u});return N.open?k.createElement(un,{...N},k.createElement(vn,{slides:c||b,index:Ft(s||x)},k.createElement(xn,null,k.createElement(ln,null,k.createElement(en,null,xr($t(gr,C),N)))))):null}const Cr={download:void 0},yr=e=>({...Cr,...e});function Nr(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(t){const n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(n)}}function Mr(e,t){const n=document.createElement("a");n.rel="noopener",n.download=t||"",n.download||(n.target="_blank"),"string"==typeof e?(n.href=e,n.origin!==window.location.origin?function(e){const t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(n){}return t.status>=200&&t.status<=299}(n.href)?function(e,t){const n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=()=>{Mr(n.response,t)},n.onerror=()=>{},n.send()}(e,t):(n.target="_blank",Nr(n)):Nr(n)):(n.href=URL.createObjectURL(e),setTimeout(()=>URL.revokeObjectURL(n.href),3e4),setTimeout(()=>Nr(n),0))}const Rr=Cn("DownloadIcon",k.createElement("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z"}));function Ir(){const{render:e,on:t,download:n}=sn(),{download:r}=yr(n),{currentSlide:o,currentIndex:i}=hn();if(e.buttonDownload)return k.createElement(k.Fragment,null,e.buttonDownload());const a=o&&(o.downloadUrl||"string"==typeof o.download&&o.download||"object"==typeof o.download&&o.download.url||Tt(o)&&o.src)||void 0,l=r?!1!==(null==o?void 0:o.download):!!a,c=()=>{if(o&&a){const e=o.downloadFilename||"object"==typeof o.download&&o.download.filename||void 0;Mr(a,e)}};return k.createElement(En,{label:"Download",icon:Rr,renderIcon:e.iconDownload,disabled:!l,onClick:()=>{var e;o&&((r||c)({slide:o,saveAs:Mr}),null===(e=t.download)||void 0===e||e.call(t,{index:i}))}})}function kr({augment:e}){e(({toolbar:e,download:t,...n})=>({toolbar:Gt(e,"download",k.createElement(Ir,null)),download:yr(t),...n}))}const _r=e=>Nt("slide_"+e),Sr={descriptionTextAlign:"start",descriptionMaxLines:3,showToggle:!1,hidden:!1},Lr=e=>({...Sr,...e}),Pr=k.createContext(null),Ar=Lt("useCaptions","CaptionsContext",Pr);function Tr({captions:e,children:t}){const{ref:n,hidden:r}=Lr(e),[o,i]=k.useState(!r),a=k.useMemo(()=>({visible:o,show:()=>i(!0),hide:()=>i(!1)}),[o]);return k.useImperativeHandle(n,()=>a,[a]),k.createElement(Pr.Provider,{value:a},t)}function Or({title:e}){const{toolbarWidth:t}=Jn(),{styles:n}=sn(),{visible:r}=Ar();return r?k.createElement("div",{role:"heading","aria-level":2,style:n.captionsTitleContainer,className:yt(_r("captions_container"),_r("title_container"))},k.createElement("div",{className:_r("title"),style:{...t?{[Mt("toolbar_width")]:t+"px"}:null,...n.captionsTitle}},e)):null}function Fr({description:e}){const{descriptionTextAlign:t,descriptionMaxLines:n}=function(){const{captions:e}=sn();return Lr(e)}(),{styles:r,labels:o}=sn(),{visible:i}=Ar();return i?k.createElement("div",{style:r.captionsDescriptionContainer,className:yt(_r("captions_container"),_r("description_container"))},k.createElement("div",{className:_r("description"),style:{..."start"!==t||3!==n?{[Mt("slide_description_text_align")]:t,[Mt("slide_description_max_lines")]:n}:null,...r.captionsDescription},role:"paragraph","aria-roledescription":kt(o,"Caption")},"string"==typeof e?e.split("\n").flatMap((e,t)=>[...t>0?[k.createElement("br",{key:t})]:[],e]):e)):null}const jr=()=>k.createElement(k.Fragment,null,k.createElement("path",{strokeWidth:2,stroke:"currentColor",strokeLinejoin:"round",fill:"none",d:"M3 5l18 0l0 14l-18 0l0-14z"}),k.createElement("path",{d:"M7 15h3c.55 0 1-.45 1-1v-1H9.5v.5h-2v-3h2v.5H11v-1c0-.55-.45-1-1-1H7c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1zm7 0h3c.55 0 1-.45 1-1v-1h-1.5v.5h-2v-3h2v.5H18v-1c0-.55-.45-1-1-1h-3c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1z"})),Dr=Cn("CaptionsVisible",jr()),zr=yn("CaptionsVisible",jr());function Wr(){const{visible:e,show:t,hide:n}=Ar(),{render:r}=sn();return r.buttonCaptions?k.createElement(k.Fragment,null,r.buttonCaptions({visible:e,show:t,hide:n})):k.createElement(En,{label:e?"Hide captions":"Show captions",icon:e?Dr:zr,renderIcon:e?r.iconCaptionsVisible:r.iconCaptionsHidden,onClick:e?n:t})}function Hr({augment:e,addModule:t}){e(({captions:e,render:{slideFooter:t,...n},toolbar:r,...o})=>{const i=Lr(e);return{render:{slideFooter:({slide:e})=>k.createElement(k.Fragment,null,null==t?void 0:t({slide:e}),e.title&&k.createElement(Or,{title:e.title}),e.description&&k.createElement(Fr,{description:e.description})),...n},toolbar:Gt(r,Ke,i.showToggle?k.createElement(Wr,null):null),captions:i,...o}}),t(Vt(Ke,Tr))}const Ur={separator:"/",container:{}},Yr=e=>({...Ur,...e});function Gr({counter:e}){const{slides:t,currentIndex:n}=hn(),{separator:r,container:{className:o,...i},className:a,...l}=Yr(e);return 0===t.length?null:k.createElement("div",{className:yt(Nt("counter"),o||a),...l,...i,"aria-hidden":!0},n+1," ",r," ",t.length)}function Br({augment:e,addChild:t}){e(({counter:e,...t})=>({counter:Yr(e),...t})),t(Xe,Vt("counter",Gr))}const Zr={ref:null,position:"bottom",width:120,height:80,border:1,borderRadius:4,padding:4,gap:16,imageFit:"contain",vignette:!0,hidden:!1,showToggle:!1},Xr=e=>({...Zr,...e});function Vr(){const{thumbnails:e}=sn();return Xr(e)}const $r=e=>Rt(Je,e),Kr=e=>$r(Rt("thumbnail",e)),qr=Cn("VideoThumbnail",k.createElement("path",{d:"M10 16.5l6-4.5-6-4.5v9zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"})),Jr=Cn("UnknownThumbnail",k.createElement("path",{d:"M23 18V6c0-1.1-.9-2-2-2H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zM8.5 12.5l2.5 3.01L14.5 11l4.5 6H5l3.5-4.5z"})),Qr=It("active"),eo=It("fadein"),to=It("fadeout"),no=It("placeholder"),ro="delay",oo="duration";function io({slide:e,index:t,onClick:n,fadeIn:r,fadeOut:o,placeholder:i,onLoseFocus:a}){const l=k.useRef(null),{render:c,styles:s,labels:u}=sn(),{slides:d,globalIndex:h}=hn(),{getOwnerDocument:m}=nn(),{width:f,height:p,imageFit:v}=Vr(),g={width:f,height:p},b=t===h,x=Tn(a);return k.useEffect(()=>{o&&m().activeElement===l.current&&x()},[o,x,m]),k.createElement("button",{ref:l,type:"button",className:yt(Nt(rt),Nt(Kr()),b&&Nt(Kr(Qr())),r&&Nt(Kr(eo())),o&&Nt(Kr(to())),i&&Nt(Kr(no()))),style:{...r?{[Mt(Kr(eo(oo)))]:r.duration+"ms",[Mt(Kr(eo(ro)))]:r.delay+"ms"}:null,...o?{[Mt(Kr(to(oo)))]:o.duration+"ms",[Mt(Kr(to(ro)))]:o.delay+"ms"}:null,...s.thumbnail},onClick:n,"aria-current":!!b||void 0,"aria-label":_t(u,d,t)},e&&function({slide:e,render:t,rect:n,imageFit:r}){var o;const i=null===(o=t.thumbnail)||void 0===o?void 0:o.call(t,{slide:e,render:t,rect:n,imageFit:r});if(i)return i;const a={render:t,rect:n,imageFit:r};if(e.thumbnail)return k.createElement(Yn,{slide:{src:e.thumbnail},...a});if(Tt(e))return k.createElement(Yn,{slide:e,...a});const l=Nt(Kr(bt));return"video"===e.type?k.createElement(k.Fragment,null,e.poster&&k.createElement(Yn,{slide:{src:e.poster},...a}),k.createElement(qr,{className:l})):k.createElement(Jr,{className:l})}({slide:e,render:c,rect:g,imageFit:v}))}function ao(e){return["top","bottom"].includes(e)}function lo(e,t){return t+2*(e.border+e.padding)+e.gap}function co(e){const{thumbnail:t,poster:n}=e||{thumbnail:"placeholder"};return"string"==typeof t&&t||"string"==typeof n&&n||e&&Yt(e)||void 0}function so({visible:e,containerRef:t}){const n=k.useRef(null),r=Dn(),{publish:o,subscribe:i}=an(),{carousel:a,styles:l,labels:c}=sn(),{slides:s,globalIndex:u,animation:d}=hn(),{registerSensors:h,subscribeSensors:m}=zn();ar(m);const f=Vr(),{position:p,width:v,height:g,border:b,borderStyle:x,borderColor:E,borderRadius:w,padding:C,gap:y,vignette:N}=f,M=void 0!==(null==d?void 0:d.duration)&&(null==d?void 0:d.increment)||0,R=(null==d?void 0:d.duration)||0,{prepareAnimation:I}=Ln(n,e=>({keyframes:ao(p)?[{transform:`translateX(${(r?-1:1)*lo(f,v)*M+e}px)`},{transform:"translateX(0)"}]:[{transform:`translateY(${lo(f,g)*M+e}px)`},{transform:"translateY(0)"}],duration:R,easing:null==d?void 0:d.easing})),_=Tn(()=>{let e=0;if(t.current&&n.current){const r=t.current.getBoundingClientRect(),o=n.current.getBoundingClientRect();e=ao(p)?o.left-r.left-(r.width-o.width)/2:o.top-r.top-(r.height-o.height)/2}I(e)});k.useEffect(()=>St(i(st,_)),[i,_]);const S=Bt(a,s),L=[];if(Wt(s))for(let k=u-S-Math.abs(M);k<=u+S+Math.abs(M);k+=1){const e=a.finite&&(k<0||k>s.length-1)||M<0&&k<u-S||M>0&&k>u+S?null:Ht(s,k),t=[""+k,co(e)].filter(Boolean).join("|");L.push({key:t,index:k,slide:e})}return k.createElement("div",{className:yt(Nt($r("container")),Nt(rt)),style:{...e?null:{display:"none"},...120!==v?{[Mt(Kr("width"))]:v+"px"}:null,...80!==g?{[Mt(Kr("height"))]:g+"px"}:null,...1!==b?{[Mt(Kr("border"))]:b+"px"}:null,...x?{[Mt(Kr("border_style"))]:x}:null,...E?{[Mt(Kr("border_color"))]:E}:null,...4!==w?{[Mt(Kr("border_radius"))]:w+"px"}:null,...4!==C?{[Mt(Kr("padding"))]:C+"px"}:null,...16!==y?{[Mt(Kr("gap"))]:y+"px"}:null,...l.thumbnailsContainer}},k.createElement("nav",{ref:n,style:l.thumbnailsTrack,className:yt(Nt($r("track")),Nt(rt)),"aria-label":kt(c,"Thumbnails"),tabIndex:-1,...h},L.map(({key:e,index:t,slide:r})=>{const i=R/Math.abs(M||1),a=M>0&&t>u+S-M&&t<=u+S||M<0&&t<u-S-M&&t>=u-S?{duration:i,delay:((M>0?t-(u+S-M):u-S-M-t)-1)*i}:void 0,l=M>0&&t<u-S||M<0&&t>u+S?{duration:i,delay:(M>0?M-(u-S-t):-M-(t-(u+S)))*i}:void 0;return k.createElement(io,{key:e,index:t,slide:r,fadeIn:a,fadeOut:l,placeholder:!r,onClick:(c=t,()=>{c>u?o(ct,{count:c-u}):c<u&&o(lt,{count:u-c})}),onLoseFocus:()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.focus()}});var c})),N&&k.createElement("div",{className:Nt($r("vignette"))}))}const uo=k.createContext(null),ho=Lt("useThumbnails","ThumbnailsContext",uo);function mo({children:e,...t}){const{ref:n,position:r,hidden:o}=Xr(t.thumbnails),[i,a]=k.useState(!o),l=k.useRef(null),c=k.useMemo(()=>({visible:i,show:()=>a(!0),hide:()=>a(!1)}),[i]);return k.useImperativeHandle(n,()=>c,[c]),k.createElement(un,{...t},k.createElement(uo.Provider,{value:c},k.createElement("div",{ref:l,className:yt(Nt($r()),Nt($r(""+r)))},["start","top"].includes(r)&&k.createElement(so,{containerRef:l,visible:i}),k.createElement("div",{className:Nt($r("wrapper"))},e),["end","bottom"].includes(r)&&k.createElement(so,{containerRef:l,visible:i}))))}const fo=()=>k.createElement(k.Fragment,null,k.createElement("path",{strokeWidth:2,stroke:"currentColor",strokeLinejoin:"round",fill:"none",d:"M3 5l18 0l0 14l-18 0l0-14z"}),k.createElement("path",{d:"M5 14h4v3h-4zM10 14h4v3h-4zM15 14h4v3h-4z"})),po=Cn("ThumbnailsVisible",fo()),vo=yn("ThumbnailsHidden",fo());function go(){const{visible:e,show:t,hide:n}=ho(),{render:r}=sn();return r.buttonThumbnails?k.createElement(k.Fragment,null,r.buttonThumbnails({visible:e,show:t,hide:n})):k.createElement(En,{label:e?"Hide thumbnails":"Show thumbnails",icon:e?po:vo,renderIcon:e?r.iconThumbnailsVisible:r.iconThumbnailsHidden,onClick:e?n:t})}function bo({augment:e,contains:t,append:n,addParent:r}){e(({thumbnails:e,toolbar:t,...n})=>{const r=Xr(e);return{toolbar:Gt(t,Je,r.showToggle?k.createElement(go,null):null),thumbnails:r,...n}});const o=Vt(Je,mo);t(qe)?n(qe,o):r(Xe,o)}const xo={minZoom:1,maxZoomPixelRatio:1,zoomInMultiplier:2,doubleTapDelay:300,doubleClickDelay:500,doubleClickMaxStops:2,keyboardMoveDistance:50,wheelZoomDistanceFactor:100,pinchZoomDistanceFactor:100,scrollToZoom:!1};function Eo(e){return Math.min(Math.max(e,Number.EPSILON),1)}function wo(e){const{minZoom:t,...n}={...xo,...e};return{minZoom:Eo(t),...n}}function Co(){const{zoom:e}=sn();return wo(e)}function yo(e,t){return((e.clientX-t.clientX)**2+(e.clientY-t.clientY)**2)**.5}function No(e,t,n=100,r=2){return e*Math.min(1+Math.abs(t/n),r)**Math.sign(t)}const Mo=k.createContext(null),Ro=Lt("useZoom","ZoomControllerContext",Mo);function Io({children:e}){const[t,n]=k.useState(),{slideRect:r}=Jn(),{ref:o,minZoom:i}=Co(),{imageRect:a,maxZoom:l}=function(e,t){var n,r;let o={width:0,height:0},i={width:0,height:0};const{currentSlide:a}=hn(),{imageFit:l}=sn().carousel,{maxZoomPixelRatio:c}=Co();if(e&&a){const s={...a,...t};if(Tt(s)){const t=Ot(s,l),a=Math.max(...((null===(n=s.srcSet)||void 0===n?void 0:n.map(e=>e.width))||[]).concat(s.width?[s.width]:[])),u=Math.max(...((null===(r=s.srcSet)||void 0===r?void 0:r.map(e=>e.height))||[]).concat(s.height?[s.height]:[]));a>0&&u>0&&e.width>0&&e.height>0&&(i=t?{width:Math.round(Math.min(a,e.width/e.height*u)),height:Math.round(Math.min(u,e.height/e.width*a))}:{width:a,height:u},i={width:i.width*c,height:i.height*c},o=t?{width:Math.min(e.width,i.width,a),height:Math.min(e.height,i.height,u)}:{width:Math.round(Math.min(e.width,e.height/u*a,a)),height:Math.round(Math.min(e.height,e.width/a*u,u))})}}return{imageRect:o,maxZoom:o.width?Math.max(At(i.width/o.width,5),1):1}}(r,null==t?void 0:t.imageDimensions),{zoom:c,offsetX:s,offsetY:u,disabled:d,changeZoom:h,changeOffsets:m,zoomIn:f,zoomOut:p}=function(e,t,n){const[r,o]=k.useState(1),[i,a]=k.useState(0),[l,c]=k.useState(0),s=function(e,t,n,r){const o=k.useRef(void 0),i=k.useRef(void 0),{zoom:a}=sn().animation,l=Sn(),c=Tn(()=>{var c,s,u;if(null===(c=o.current)||void 0===c||c.cancel(),o.current=void 0,i.current&&(null==r?void 0:r.current)){try{o.current=null===(u=(s=r.current).animate)||void 0===u?void 0:u.call(s,[{transform:i.current},{transform:`scale(${e}) translateX(${t}px) translateY(${n}px)`}],{duration:l?0:null!=a?a:500,easing:o.current?"ease-out":"ease-in-out"})}catch(d){}i.current=void 0,o.current&&(o.current.onfinish=()=>{o.current=void 0})}});return _n(c,[e,t,n,c]),k.useCallback(()=>{i.current=(null==r?void 0:r.current)?window.getComputedStyle(r.current).transform:void 0},[r])}(r,i,l,n),{currentSlide:u,globalIndex:d}=hn(),{containerRect:h,slideRect:m}=Jn(),{minZoom:f,zoomInMultiplier:p}=Co(),v=u&&Tt(u)?u.src:void 0,g=!v||!(null==n?void 0:n.current);_n(()=>{o(1),a(0),c(0)},[d,v]);const b=k.useCallback((t,n,o)=>{const s=o||r,u=i-(t||0),d=l-(n||0),h=(e.width*s-m.width)/2/s,f=(e.height*s-m.height)/2/s;a(Math.min(Math.abs(u),Math.max(h,0))*Math.sign(u)),c(Math.min(Math.abs(d),Math.max(f,0))*Math.sign(d))},[r,i,l,m,e.width,e.height]),x=k.useCallback((e,n,i,a)=>{const l=At(Math.min(Math.max(e+.001<t?e:t,f),t),5);l!==r&&(n||s(),b(i?i*(1/r-1/l):0,a?a*(1/r-1/l):0,l),o(l))},[r,f,t,b,s]),E=Tn(()=>{r>1&&(r>t&&x(t,!0),b())});_n(E,[h.width,h.height,E]);const w=k.useCallback(()=>{const e=r*p;x(r<1&&e>1?1:e)},[r,p,x]),C=k.useCallback(()=>{const e=r/p;x(r>1&&e<1?1:e)},[r,p,x]);return{zoom:r,offsetX:i,offsetY:l,disabled:g,changeOffsets:b,changeZoom:x,zoomIn:w,zoomOut:C}}(a,l,null==t?void 0:t.zoomWrapperRef);!function(e,t){const{on:n}=sn(),r=Tn(()=>{var r;t||null===(r=n.zoom)||void 0===r||r.call(n,{zoom:e})});k.useEffect(r,[e,r])}(c,d),function(e,t,n,r,o,i,a,l,c){const s=k.useRef([]),u=k.useRef(0),d=k.useRef(void 0),{globalIndex:h}=hn(),{getOwnerWindow:m}=nn(),{containerRef:f,subscribeSensors:p}=Jn(),{keyboardMoveDistance:v,zoomInMultiplier:g,wheelZoomDistanceFactor:b,scrollToZoom:x,doubleTapDelay:E,doubleClickDelay:w,doubleClickMaxStops:C,pinchZoomDistanceFactor:y}=Co(),N=k.useCallback(e=>{if(f.current){const{pageX:t,pageY:n}=e,{scrollX:r,scrollY:o}=m(),{left:i,top:a,width:l,height:c}=f.current.getBoundingClientRect();return[t-i-r-l/2,n-a-o-c/2]}return[]},[f,m]),M=Tn(t=>{const{key:n,metaKey:r,ctrlKey:c}=t,s=r||c,u=()=>{t.preventDefault(),t.stopPropagation()};if(e>1){const e=(e,t)=>{u(),l(e,t)};"ArrowDown"===n?e(0,v):"ArrowUp"===n?e(0,-v):"ArrowLeft"===n?e(-v,0):"ArrowRight"===n&&e(v,0)}"+"===n||s&&"="===n?(u(),o()):"-"===n||s&&"_"===n?(u(),i()):s&&"0"===n&&(u(),a(1))}),R=Tn(t=>{if((t.ctrlKey||x)&&Math.abs(t.deltaY)>Math.abs(t.deltaX))return t.stopPropagation(),void a(No(e,-t.deltaY,b),!0,...N(t));e>1&&(t.stopPropagation(),x||l(t.deltaX,t.deltaY))}),I=k.useCallback(e=>{const t=s.current;t.splice(0,t.length,...t.filter(t=>t.pointerId!==e.pointerId))},[]),_=k.useCallback(e=>{I(e),e.persist(),s.current.push(e)},[I]),S=Tn(r=>{var o;const i=s.current;if("mouse"===r.pointerType&&r.buttons>1||!(null===(o=null==c?void 0:c.current)||void 0===o?void 0:o.contains(r.target)))return;e>1&&r.stopPropagation();const{timeStamp:l}=r;0===i.length&&l-u.current<("touch"===r.pointerType?E:w)?(u.current=0,a(e>=1?e!==n?e*Math.max(n**(1/C),g):1:e!==t?e/Math.max(t**(-1/C),g):1,!1,...N(r))):u.current=l,_(r),2===i.length&&(d.current=yo(i[0],i[1]))}),L=Tn(t=>{const n=s.current,r=n.find(e=>e.pointerId===t.pointerId);if(2===n.length&&d.current){t.stopPropagation(),_(t);const r=yo(n[0],n[1]),o=r-d.current;return void(Math.abs(o)>0&&(a(No(e,o,y),!0,...n.map(e=>N(e)).reduce((e,t)=>t.map((t,n)=>e[n]+t/2))),d.current=r))}e>1&&(t.stopPropagation(),r&&(1===n.length&&l((r.clientX-t.clientX)/e,(r.clientY-t.clientY)/e),_(t)))}),P=k.useCallback(e=>{const t=s.current;2===t.length&&t.find(t=>t.pointerId===e.pointerId)&&(d.current=void 0),I(e)},[I]),A=k.useCallback(()=>{const e=s.current;e.splice(0,e.length),u.current=0,d.current=void 0},[]);$n(p,S,L,P,r),k.useEffect(A,[h,A]),k.useEffect(()=>r?()=>{}:St(A,p(vt,M),p(gt,R)),[r,p,A,M,R])}(c,i,l,d,f,p,h,m,null==t?void 0:t.zoomWrapperRef);const v=k.useMemo(()=>({zoom:c,minZoom:i,maxZoom:l,offsetX:s,offsetY:u,disabled:d,zoomIn:f,zoomOut:p,changeZoom:h}),[c,i,l,s,u,d,f,p,h]);k.useImperativeHandle(o,()=>v,[v]);const g=k.useMemo(()=>({...v,setZoomWrapper:n}),[v,n]);return k.createElement(Mo.Provider,{value:g},e)}const ko=Cn("ZoomIn",k.createElement(k.Fragment,null,k.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),k.createElement("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"}))),_o=Cn("ZoomOut",k.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})),So=k.forwardRef(function({zoomIn:e,onLoseFocus:t},n){const r=k.useRef(!1),o=k.useRef(!1),{zoom:i,minZoom:a,maxZoom:l,zoomIn:c,zoomOut:s,disabled:u}=Ro(),{render:d}=sn(),h=u||(e?i>=l:i<=a);return k.useEffect(()=>{h&&r.current&&o.current&&t(),h||(r.current=!0)},[h,t]),k.createElement(En,{ref:n,disabled:h,label:e?"Zoom in":"Zoom out",icon:e?ko:_o,renderIcon:e?d.iconZoomIn:d.iconZoomOut,onClick:e?c:s,onFocus:()=>{o.current=!0},onBlur:()=>{o.current=!1}})});function Lo(){const e=k.useRef(null),t=k.useRef(null),{focus:n}=Jn(),r=k.useCallback(e=>{var t,r;(null===(t=e.current)||void 0===t?void 0:t.disabled)?n():null===(r=e.current)||void 0===r||r.focus()},[n]),o=k.useCallback(()=>r(e),[r]),i=k.useCallback(()=>r(t),[r]);return k.createElement(k.Fragment,null,k.createElement(So,{zoomIn:!0,ref:e,onLoseFocus:i}),k.createElement(So,{ref:t,onLoseFocus:o}))}function Po(){const{render:e}=sn(),t=Ro();return e.buttonZoom?k.createElement(k.Fragment,null,e.buttonZoom(t)):k.createElement(Lo,null)}function Ao({current:e,preload:t},{type:n,source:r}){switch(n){case"fetch":return e?{current:e,preload:r}:{current:r};case"done":return r===t?{current:r}:{current:e,preload:t};default:throw Error(wt)}}function To(e){var t,n;const[{current:r,preload:o},i]=k.useReducer(Ao,{}),{slide:a,rect:l,imageFit:c,render:s,interactive:u}=e,d=a.srcSet.sort((e,t)=>e.width-t.width),h=null!==(t=a.width)&&void 0!==t?t:d[d.length-1].width,m=null!==(n=a.height)&&void 0!==n?n:d[d.length-1].height,f=Ot(a,c),p=Math.max(...d.map(e=>e.width)),v=Math.min((f?Math.max:Math.min)(l.width,h*(l.height/m)),p),g=(Pt()?null===window||void 0===window?void 0:window.devicePixelRatio:void 0)||1,b=Tn(()=>{var e;const t=null!==(e=d.find(e=>e.width>=v*g))&&void 0!==e?e:d[d.length-1];(!r||d.findIndex(e=>e.src===r)<d.findIndex(e=>e===t))&&i({type:"fetch",source:t.src})});_n(b,[l.width,l.height,g,b]);const x=Tn(e=>i({type:"done",source:e})),E={WebkitTransform:u?"initial":"translateZ(0)"};return f||Object.assign(E,l.width/l.height<h/m?{width:"100%",height:"auto"}:{width:"auto",height:"100%"}),k.createElement(k.Fragment,null,o&&o!==r&&k.createElement(Yn,{key:"preload",...e,offset:void 0,slide:{...a,src:o,srcSet:void 0},style:{position:"absolute",visibility:"hidden",...E},onLoad:()=>x(o),render:{...s,iconLoading:()=>null,iconError:()=>null}}),r&&k.createElement(Yn,{key:"current",...e,slide:{...a,src:r,srcSet:void 0},style:E}))}function Oo({render:e,slide:t,offset:n,rect:r}){var o;const[i,a]=k.useState(),l=k.useRef(null),{zoom:c,maxZoom:s,offsetX:u,offsetY:d,setZoomWrapper:h}=Ro(),m=c>1,{carousel:f,on:p}=sn(),{currentIndex:v}=hn();_n(()=>0===n?(h({zoomWrapperRef:l,imageDimensions:i}),()=>h(void 0)):()=>{},[n,i,h]);let g=null===(o=e.slide)||void 0===o?void 0:o.call(e,{slide:t,offset:n,rect:r,zoom:c,maxZoom:s});if(!g&&Tt(t)){const o={slide:t,offset:n,rect:r,render:e,imageFit:f.imageFit,imageProps:f.imageProps,onClick:0===n?()=>{var e;return null===(e=p.click)||void 0===e?void 0:e.call(p,{index:v})}:void 0};g=function(e){var t;return((null===(t=e.srcSet)||void 0===t?void 0:t.length)||0)>0}(t)?k.createElement(To,{...o,slide:t,interactive:m,rect:0===n?{width:r.width*c,height:r.height*c}:r}):k.createElement(Yn,{onLoad:e=>a({width:e.naturalWidth,height:e.naturalHeight}),...o})}return g?k.createElement("div",{ref:l,className:yt(Nt("fullsize"),Nt(rt),Nt(at),m&&Nt("slide_wrapper_interactive")),style:0===n?{transform:`scale(${c}) translateX(${u}px) translateY(${d}px)`}:void 0},g):null}const Fo=({augment:e,addModule:t})=>{e(({zoom:e,toolbar:t,render:n,controller:r,...o})=>{const i=wo(e);return{zoom:i,toolbar:Gt(t,Qe,k.createElement(Po,null)),render:{...n,slide:e=>{var t;return Tt(e.slide)?k.createElement(Oo,{render:n,...e}):null===(t=n.slide)||void 0===t?void 0:t.call(n,e)}},controller:{...r,preventDefaultWheelY:i.scrollToZoom},...o}}),t(Vt(Qe,Io))},jo=({message:e,onClick:n})=>{const r=Cn("Eye",
|
|
4
|
+
return t.jsx("div",{className:"flex justify-center items-center mt-[2px]",children:/* @__PURE__ */t.jsx(D,{dir:"rtl",className:"mx-[4px] text-[12px] hover:text-accent rounded-full cursor-pointer text-text w-[36px] h-[36px] "+(n?"bg-[#bda587]":""),children:/* @__PURE__ */t.jsx("button",{type:"button",className:"flex justify-center items-center w-full h-full",onClick:()=>y(e),children:/* @__PURE__ */t.jsx("div",{className:"reaction-transition text-[20px]",children:H(ae(e).emoji,{className:"w-[20px]"})})})})},e)}),!f&&x.length>4&&/* @__PURE__ */t.jsx("div",{className:"flex justify-center items-center mt-[2px]",children:/* @__PURE__ */t.jsx("button",{type:"button",className:"mx-[4px] w-[30px] h-[30px] text-[#bda587] grid place-items-center rounded",onClick:w,"aria-label":"More reactions",title:"More",children:/* @__PURE__ */t.jsx(h,{})})})]})})})})}),ze=/* @__PURE__ */new Map;function We(e){const t=ze.get(e);return t&&(ze.delete(e),ze.set(e,t)),t}function He(e,t){if(ze.size>=1e3){const e=ze.keys().next().value;e&&ze.delete(e)}ze.set(e,t)}const Ue=_.memo(({size:e="LARGE",item:n,children:r})=>{const o=i(e=>e.appConfig.token,m),[a,l]=L(null),{id:c,fileLink:s}=P(()=>{let e;try{const t=JSON.parse(n.metadata);if(e=t?.file?.link,e?.includes("/nzh/drive/downloadImage")){const n=t?.fileHash;e="https://podspace.pod.ir/api/v2/images/"+n}}catch{}return{id:n.id,fileLink:e}},[n.id,n.metadata]),{search:u,cacheKey:d,requestUrl:h}=P(()=>{if(!s)return{search:"",cacheKey:"",requestUrl:""};const t=new URL(s),n=new URLSearchParams({size:e,quality:"1",crop:"false",forceConvert:"false"});t.search=n.toString();const r=t.search;return{search:r,cacheKey:`${c}::${r}`,requestUrl:t.toString()}},[s,c]),f=O(null);return T(()=>{if(!(c&&o&&s&&d&&h))return;const e=new AbortController;return(async()=>{try{const t=We(d);if(t){const e=URL.createObjectURL(t);return f.current=e,void l(e)}const n=await fetch(h,{headers:{Authorization:"Bearer "+o,Accept:"image/*"},signal:e.signal});if(!n.ok)return;const r=await n.blob();He(d,r);const i=URL.createObjectURL(r);f.current=i,l(i)}catch(t){}})(),()=>{e.abort(),f.current&&(URL.revokeObjectURL(f.current),f.current=null)}},[c,o,d,h,s]),r?/* @__PURE__ */t.jsx(t.Fragment,{children:r(a)}):""});function Ye(e,t=2){if(0===e)return"0 Bytes";const n=t<0?0:t,r=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,r)).toFixed(n))+" "+["Bytes","KB","MB","GB","TB"][r]}const Ge=e=>{const t=e.slice(-5).indexOf(".");if(-1===t)return{name:e,ext:""};const n=e.length-5+t;return{name:e.slice(0,n),ext:e.slice(n)}},Be=({file:e,widthFull:n=!0})=>{const r=O(null),[o,i]=L(!1);return T(()=>{const e=r.current;e&&i(e.scrollWidth>e.clientWidth)},[e.name]),/* @__PURE__ */t.jsx(U,{tooltipContent:Ge(e?.originalName||e?.name||"").name,children:/* @__PURE__ */t.jsxs("div",{className:`font-semibold ${n?"w-full":"w-[140px]"} ltr flex overflow-hidden mb-[5px] text-[13px] text-bold text-invertBlackWhite justify-end }`,children:[
|
|
5
|
+
/* @__PURE__ */t.jsxs("div",{dir:"ltr",className:"whitespace-nowrap",children:[Ge(e?.originalName||e?.name||"").ext,o?" ":""]}),
|
|
6
|
+
/* @__PURE__ */t.jsx("div",{className:"truncate",dir:"ltr",ref:r,children:Ge(e?.originalName||e?.name||"").name})]})})},Ze="carousel",Xe="controller",Ve="portal",$e="toolbar",Ke="captions",qe="fullscreen",Je="thumbnails",Qe="zoom",et="loading",tt="error",nt="complete",rt="flex_center",ot="no_scroll_padding",it="slide",at="slide_wrapper",lt="prev",ct="next",st="swipe",ut="close",dt="onPointerDown",ht="onPointerMove",mt="onPointerUp",ft="onPointerLeave",pt="onPointerCancel",vt="onKeyDown",gt="onWheel",bt="icon",xt="contain",Et="cover",wt="Unknown action type",Ct="yarl__";function yt(...e){return[...e].filter(Boolean).join(" ")}function Nt(e){return`${Ct}${e}`}function Mt(e){return`--${Ct}${e}`}function Rt(e,t){return`${e}${t?"_"+t:""}`}function It(e){return t=>Rt(e,t)}function kt(e,t){var n;return null!==(n=null==e?void 0:e[t])&&void 0!==n?n:t}function _t(e,t,n){return kt(e,"{index} of {total}").replace(/\{index}/g,""+(zt(n,t.length)+1)).replace(/\{total}/g,""+t.length)}function St(...e){return()=>{e.forEach(e=>{e()})}}function Lt(e,t,n){return()=>{const r=k.useContext(n);if(!r)throw Error(`${e} must be used within a ${t}.Provider`);return r}}function Pt(){return"undefined"!=typeof window}function At(e,t=0){const n=10**t;return Math.round((e+Number.EPSILON)*n)/n}function Tt(e){return void 0===e.type||"image"===e.type}function Ot(e,t){return e.imageFit===Et||e.imageFit!==xt&&t===Et}function Ft(e){return"string"==typeof e?Number.parseInt(e,10):e}function jt(e){if("number"==typeof e)return{pixel:e};if("string"==typeof e){const t=Ft(e);return e.endsWith("%")?{percent:t}:{pixel:t}}return{pixel:0}}function Dt(e,t){const n=jt(t),r=void 0!==n.percent?e.width/100*n.percent:n.pixel;return{width:Math.max(e.width-2*r,0),height:Math.max(e.height-2*r,0)}}function zt(e,t){return t>0?(e%t+t)%t:0}function Wt(e){return e.length>0}function Ht(e,t){return e[zt(t,e.length)]}function Ut(e,t){return Wt(e)?Ht(e,t):void 0}function Yt(e){return Tt(e)?e.src:void 0}function Gt(e,t,n){if(!n)return e;const{buttons:r,...o}=e,i=r.findIndex(e=>e===t),a=k.isValidElement(n)?k.cloneElement(n,{key:t},null):n;if(i>=0){const e=[...r];return e.splice(i,1,a),{buttons:e,...o}}return{buttons:[a,...r],...o}}function Bt(e,t,n=0){return Math.min(e.preload,Math.max(e.finite?t.length-1:Math.floor(t.length/2),n))}const Zt=Number(k.version.split(".")[0])>=19,Xt={open:!1,close:()=>{},index:0,slides:[],render:{},plugins:[],toolbar:{buttons:[ut]},labels:{},animation:{fade:250,swipe:500,easing:{fade:"ease",swipe:"ease-out",navigation:"ease-in-out"}},carousel:{finite:!1,preload:2,padding:"16px",spacing:"30%",imageFit:xt,imageProps:{}},controller:{ref:null,focus:!0,aria:!1,touchAction:"none",closeOnPullUp:!1,closeOnPullDown:!1,closeOnBackdropClick:!1,preventDefaultWheelX:!0,preventDefaultWheelY:!1,disableSwipeNavigation:!1},portal:{},noScroll:{disabled:!1},on:{},styles:{},className:""};function Vt(e,t){return{name:e,component:t}}function $t(e,t){return{module:e,children:t}}function Kt(e,t,n){return e.module.name===t?n(e):e.children?[$t(e.module,e.children.flatMap(e=>{var r;return null!==(r=Kt(e,t,n))&&void 0!==r?r:[]}))]:[e]}function qt(e,t,n){return e.flatMap(e=>{var r;return null!==(r=Kt(e,t,n))&&void 0!==r?r:[]})}const Jt=k.createContext(null),Qt=Lt("useA11yContext","A11yContext",Jt);function en({children:e}){const[t,n]=k.useState(!1),[r,o]=k.useState(!1),i=k.useMemo(()=>({focusWithin:t,trackFocusWithin:(e,t)=>{const r=r=>o=>{var i;o.currentTarget.contains(o.relatedTarget)||n(r),null===(i=r?e:t)||void 0===i||i(o)};return{onFocus:r(!0),onBlur:r(!1)}},autoPlaying:r,setAutoPlaying:o}),[t,r]);return k.createElement(Jt.Provider,{value:i},e)}const tn=k.createContext(null),nn=Lt("useDocument","DocumentContext",tn);function rn({nodeRef:e,children:t}){const n=k.useMemo(()=>{const t=t=>{var n;return(null===(n=t||e.current)||void 0===n?void 0:n.ownerDocument)||document};return{getOwnerDocument:t,getOwnerWindow:e=>{var n;return(null===(n=t(e))||void 0===n?void 0:n.defaultView)||window}}},[e]);return k.createElement(tn.Provider,{value:n},t)}const on=k.createContext(null),an=Lt("useEvents","EventsContext",on);function ln({children:e}){const[t]=k.useState({});k.useEffect(()=>()=>{Object.keys(t).forEach(e=>delete t[e])},[t]);const n=k.useMemo(()=>{const e=(e,n)=>{var r;null===(r=t[e])||void 0===r||r.splice(0,t[e].length,...t[e].filter(e=>e!==n))};return{publish:(...[e,n])=>{var r;null===(r=t[e])||void 0===r||r.forEach(e=>e(n))},subscribe:(n,r)=>(t[n]||(t[n]=[]),t[n].push(r),()=>e(n,r)),unsubscribe:e}},[t]);return k.createElement(on.Provider,{value:n},e)}const cn=k.createContext(null),sn=Lt("useLightboxProps","LightboxPropsContext",cn);function un({children:e,...t}){return k.createElement(cn.Provider,{value:t},e)}const dn=k.createContext(null),hn=Lt("useLightboxState","LightboxStateContext",dn),mn=k.createContext(null),fn=Lt("useLightboxDispatch","LightboxDispatchContext",mn);function pn(e,t){switch(t.type){case"swipe":{const{slides:n}=e,r=(null==t?void 0:t.increment)||0,o=e.globalIndex+r,i=zt(o,n.length);return{slides:n,currentIndex:i,globalIndex:o,currentSlide:Ut(n,i),animation:r||void 0!==t.duration?{increment:r,duration:t.duration,easing:t.easing}:void 0}}case"update":return t.slides!==e.slides||t.index!==e.currentIndex?{slides:t.slides,currentIndex:t.index,globalIndex:t.index,currentSlide:Ut(t.slides,t.index)}:e;default:throw Error(wt)}}function vn({slides:e,index:t,children:n}){const[r,o]=k.useReducer(pn,{slides:e,currentIndex:t,globalIndex:t,currentSlide:Ut(e,t)});k.useEffect(()=>{o({type:"update",slides:e,index:t})},[e,t]);const i=k.useMemo(()=>({...r,state:r,dispatch:o}),[r,o]);return k.createElement(mn.Provider,{value:o},k.createElement(dn.Provider,{value:i},n))}const gn=k.createContext(null),bn=Lt("useTimeouts","TimeoutsContext",gn);function xn({children:e}){const[t]=k.useState([]);k.useEffect(()=>()=>{t.forEach(e=>window.clearTimeout(e)),t.splice(0,t.length)},[t]);const n=k.useMemo(()=>{const e=e=>{t.splice(0,t.length,...t.filter(t=>t!==e))};return{setTimeout:(n,r)=>{const o=window.setTimeout(()=>{e(o),n()},r);return t.push(o),o},clearTimeout:t=>{void 0!==t&&(e(t),window.clearTimeout(t))}}},[t]);return k.createElement(gn.Provider,{value:n},e)}const En=k.forwardRef(function({label:e,className:t,icon:n,renderIcon:r,onClick:o,style:i,...a},l){const{styles:c,labels:s}=sn(),u=kt(s,e);return k.createElement("button",{ref:l,type:"button",title:u,"aria-label":u,className:yt(Nt("button"),t),onClick:o,style:{...i,...c.button},...a},r?r():k.createElement(n,{className:Nt(bt),style:c.icon}))});function wn(e,t){const n=e=>k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",...e},t);return n.displayName=e,n}function Cn(e,t){return wn(e,k.createElement("g",{fill:"currentColor"},k.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t))}function yn(e,t){return wn(e,k.createElement(k.Fragment,null,k.createElement("defs",null,k.createElement("mask",{id:"strike"},k.createElement("path",{d:"M0 0h24v24H0z",fill:"white"}),k.createElement("path",{d:"M0 0L24 24",stroke:"black",strokeWidth:4}))),k.createElement("path",{d:"M0.70707 2.121320L21.878680 23.292883",stroke:"currentColor",strokeWidth:2}),k.createElement("g",{fill:"currentColor",mask:"url(#strike)"},k.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t)))}const Nn=Cn("Close",k.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),Mn=Cn("Previous",k.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),Rn=Cn("Next",k.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),In=Cn("Loading",k.createElement(k.Fragment,null,Array.from({length:8}).map((e,t,n)=>k.createElement("line",{key:t,x1:"12",y1:"6.5",x2:"12",y2:"1.8",strokeLinecap:"round",strokeWidth:"2.6",stroke:"currentColor",strokeOpacity:1/n.length*(t+1),transform:`rotate(${360/n.length*t}, 12, 12)`})))),kn=Cn("Error",k.createElement("path",{d:"M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z"})),_n=Pt()?k.useLayoutEffect:k.useEffect;function Sn(){const[e,t]=k.useState(!1);return k.useEffect(()=>{var e,n;const r=null===(e=window.matchMedia)||void 0===e?void 0:e.call(window,"(prefers-reduced-motion: reduce)");t(null==r?void 0:r.matches);const o=e=>t(e.matches);return null===(n=null==r?void 0:r.addEventListener)||void 0===n||n.call(r,"change",o),()=>{var e;return null===(e=null==r?void 0:r.removeEventListener)||void 0===e?void 0:e.call(r,"change",o)}},[]),e}function Ln(e,t){const n=k.useRef(void 0),r=k.useRef(void 0),o=Sn();return _n(()=>{var i,a,l;if(e.current&&void 0!==n.current&&!o){const{keyframes:o,duration:s,easing:u,onfinish:d}=t(n.current,e.current.getBoundingClientRect(),function(e){let t=0,n=0,r=0;const o=window.getComputedStyle(e).transform.match(/matrix.*\((.+)\)/);if(o){const e=o[1].split(",").map(Ft);6===e.length?(t=e[4],n=e[5]):16===e.length&&(t=e[12],n=e[13],r=e[14])}return{x:t,y:n,z:r}}(e.current))||{};if(o&&s){null===(i=r.current)||void 0===i||i.cancel(),r.current=void 0;try{r.current=null===(l=(a=e.current).animate)||void 0===l?void 0:l.call(a,o,{duration:s,easing:u})}catch(c){}r.current&&(r.current.onfinish=()=>{r.current=void 0,null==d||d()})}}n.current=void 0}),{prepareAnimation:e=>{n.current=e},isAnimationPlaying:()=>{var e;return"running"===(null===(e=r.current)||void 0===e?void 0:e.playState)}}}function Pn(){const e=k.useRef(null),t=k.useRef(void 0),[n,r]=k.useState();return{setContainerRef:k.useCallback(n=>{e.current=n,t.current&&(t.current.disconnect(),t.current=void 0);const o=()=>{if(n){const e=window.getComputedStyle(n),t=e=>parseFloat(e)||0;r({width:Math.round(n.clientWidth-t(e.paddingLeft)-t(e.paddingRight)),height:Math.round(n.clientHeight-t(e.paddingTop)-t(e.paddingBottom))})}else r(void 0)};o(),n&&"undefined"!=typeof ResizeObserver&&(t.current=new ResizeObserver(o),t.current.observe(n))},[]),containerRef:e,containerRect:n}}function An(){const e=k.useRef(void 0),{setTimeout:t,clearTimeout:n}=bn();return k.useCallback((r,o)=>{n(e.current),e.current=t(r,o>0?o:0)},[t,n])}function Tn(e){const t=k.useRef(e);return _n(()=>{t.current=e}),k.useCallback((...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)},[])}function On(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function Fn(e,t){return k.useMemo(()=>null==e&&null==t?null:n=>{On(e,n),On(t,n)},[e,t])}function jn(e,t=!1){const n=k.useRef(!1);return _n(()=>{t&&n.current&&(n.current=!1,e())},[t,e]),{onFocus:k.useCallback(()=>{n.current=!0},[]),onBlur:k.useCallback(()=>{n.current=!1},[])}}function Dn(){const[e,t]=k.useState(!1);return _n(()=>{t("rtl"===window.getComputedStyle(window.document.documentElement).direction)},[]),e}function zn(){const[e]=k.useState({}),t=k.useCallback((t,n)=>{var r;null===(r=e[t])||void 0===r||r.forEach(e=>{n.isPropagationStopped()||e(n)})},[e]);return{registerSensors:k.useMemo(()=>({onPointerDown:e=>t(dt,e),onPointerMove:e=>t(ht,e),onPointerUp:e=>t(mt,e),onPointerLeave:e=>t(ft,e),onPointerCancel:e=>t(pt,e),onKeyDown:e=>t(vt,e),onKeyUp:e=>t("onKeyUp",e),onWheel:e=>t(gt,e)}),[t]),subscribeSensors:k.useCallback((t,n)=>(e[t]||(e[t]=[]),e[t].unshift(n),()=>{const r=e[t];r&&r.splice(0,r.length,...r.filter(e=>e!==n))}),[e])}}function Wn(e,t){const n=k.useRef(0),r=An(),o=Tn((...t)=>{n.current=Date.now(),e(t)});return k.useCallback((...e)=>{r(()=>{o(e)},t-(Date.now()-n.current))},[t,o,r])}const Hn=It("slide"),Un=It("slide_image");function Yn({slide:e,offset:t,render:n,rect:r,imageFit:o,imageProps:i,onClick:a,onLoad:l,onError:c,style:s}){var u,d,h,m,f,p,v,g;const[b,x]=k.useState(et),{publish:E}=an(),{setTimeout:w}=bn(),C=k.useRef(null);k.useEffect(()=>{0===t&&E((e=>"active-slide-"+e)(b))},[t,b,E]);const y=Tn(e=>{("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{e.parentNode&&(x(nt),w(()=>{null==l||l(e)},0))})}),N=k.useCallback(e=>{C.current=e,(null==e?void 0:e.complete)&&y(e)},[y]),M=k.useCallback(e=>{y(e.currentTarget)},[y]),R=Tn(()=>{x(tt),null==c||c()}),I=Ot(e,o),_=(e,t)=>Number.isFinite(e)?e:t,S=_(Math.max(...(null!==(d=null===(u=e.srcSet)||void 0===u?void 0:u.map(e=>e.width))&&void 0!==d?d:[]).concat(e.width?[e.width]:[]).filter(Boolean)),(null===(h=C.current)||void 0===h?void 0:h.naturalWidth)||0),L=_(Math.max(...(null!==(f=null===(m=e.srcSet)||void 0===m?void 0:m.map(e=>e.height))&&void 0!==f?f:[]).concat(e.height?[e.height]:[]).filter(Boolean)),(null===(p=C.current)||void 0===p?void 0:p.naturalHeight)||0),P=S&&L?{maxWidth:`min(${S}px, 100%)`,maxHeight:`min(${L}px, 100%)`}:{maxWidth:"100%",maxHeight:"100%"},A=null===(v=e.srcSet)||void 0===v?void 0:v.sort((e,t)=>e.width-t.width).map(e=>`${e.src} ${e.width}w`).join(", "),T=A&&r&&Pt()?Math.round(Math.min(r&&!I&&e.width&&e.height?r.height/e.height*e.width:Number.MAX_VALUE,r.width))+"px":void 0,{style:O,className:F,...j}=i||{};return k.createElement(k.Fragment,null,k.createElement("img",{ref:N,onLoad:M,onError:R,onClick:a,draggable:!1,className:yt(Nt(Un()),I&&Nt(Un("cover")),b!==nt&&Nt(Un("loading")),F),style:{...P,...s,...O},...j,alt:null!==(g=e.alt)&&void 0!==g?g:"",sizes:T,srcSet:A,src:e.src}),b!==nt&&k.createElement("div",{className:Nt(Hn("placeholder"))},b===et&&((null==n?void 0:n.iconLoading)?n.iconLoading():k.createElement(In,{className:yt(Nt(bt),Nt(Hn(et)))})),b===tt&&((null==n?void 0:n.iconError)?n.iconError():k.createElement(kn,{className:yt(Nt(bt),Nt(Hn(tt)))}))))}const Gn=k.forwardRef(function({className:e,children:t,onFocus:n,onBlur:r,...o},i){const a=k.useRef(null),{trackFocusWithin:l}=Qt();return k.createElement(rn,{nodeRef:a},k.createElement("div",{ref:Fn(i,a),className:yt(Nt("root"),e),...l(n,r),...o},t))});var Bn,Zn,Xn,Vn;function $n(e,t,n,r,o){k.useEffect(()=>o?()=>{}:St(e(dt,t),e(ht,n),e(mt,r),e(ft,r),e(pt,r)),[e,t,n,r,o])}(Zn=Bn||(Bn={}))[Zn.NONE=0]="NONE",Zn[Zn.SWIPE=1]="SWIPE",Zn[Zn.PULL=2]="PULL",Zn[Zn.ANIMATION=3]="ANIMATION",(Vn=Xn||(Xn={}))[Vn.NONE=0]="NONE",Vn[Vn.SWIPE=1]="SWIPE",Vn[Vn.PULL=2]="PULL";const Kn=It("container"),qn=k.createContext(null),Jn=Lt("useController","ControllerContext",qn),Qn=Vt(Xe,function({children:e,...t}){var n;const{carousel:r,animation:o,controller:i,on:a,styles:l,render:c}=t,{closeOnPullUp:s,closeOnPullDown:u,preventDefaultWheelX:d,preventDefaultWheelY:h}=i,[m,f]=k.useState(),p=hn(),v=fn(),[g,b]=k.useState(Bn.NONE),x=k.useRef(0),E=k.useRef(0),w=k.useRef(1),{registerSensors:C,subscribeSensors:y}=zn(),{subscribe:N,publish:M}=an(),R=An(),I=An(),_=An(),{containerRef:S,setContainerRef:L,containerRect:P}=Pn(),A=Fn(function({preventDefaultWheelX:e,preventDefaultWheelY:t}){const n=k.useRef(null),r=Tn(n=>{const r=Math.abs(n.deltaX)>Math.abs(n.deltaY);(r&&e||!r&&t||n.ctrlKey)&&n.preventDefault()});return k.useCallback(e=>{var t;e?e.addEventListener("wheel",r,{passive:!1}):null===(t=n.current)||void 0===t||t.removeEventListener("wheel",r),n.current=e},[r])}({preventDefaultWheelX:d,preventDefaultWheelY:h}),L),T=k.useRef(null),O=Fn(T,void 0),{getOwnerDocument:F}=nn(),j=Dn(),D=e=>(j?-1:1)*("number"==typeof e?e:1),z=Tn(()=>{var e;return null===(e=S.current)||void 0===e?void 0:e.focus()}),W=Tn(()=>t),H=Tn(()=>p),U=k.useCallback(e=>M(lt,e),[M]),Y=k.useCallback(e=>M(ct,e),[M]),G=k.useCallback(()=>M(ut),[M]),B=e=>!(r.finite&&(D(e)>0&&0===p.currentIndex||D(e)<0&&p.currentIndex===p.slides.length-1)),Z=e=>{var t;x.current=e,null===(t=S.current)||void 0===t||t.style.setProperty(Mt("swipe_offset"),Math.round(e)+"px")},X=e=>{var t,n;E.current=e,w.current=Math.min(Math.max(At(1-(u&&e>0?e:s&&e<0?-e:0)/60*.5,2),.5),1),null===(t=S.current)||void 0===t||t.style.setProperty(Mt("pull_offset"),Math.round(e)+"px"),null===(n=S.current)||void 0===n||n.style.setProperty(Mt("pull_opacity"),""+w.current)},{prepareAnimation:V}=Ln(T,(e,t,n)=>{if(T.current&&P)return{keyframes:[{transform:`translate(0, ${e.rect.y-t.y+n.y}px)`,opacity:e.opacity},{transform:"translate(0, 0)",opacity:1}],duration:e.duration,easing:o.easing.fade}}),$=(e,t)=>{if(s||u){X(e);let n=0;T.current&&(n=o.fade*(t?2:1),V({rect:T.current.getBoundingClientRect(),opacity:w.current,duration:n})),_(()=>{X(0),b(Bn.NONE)},n),b(Bn.ANIMATION),t||G()}},{prepareAnimation:K,isAnimationPlaying:q}=Ln(T,(e,t,n)=>{var o;if(T.current&&P&&(null===(o=p.animation)||void 0===o?void 0:o.duration)){const o=jt(r.spacing),i=(o.percent?o.percent*P.width/100:o.pixel)||0;return{keyframes:[{transform:`translate(${D(p.globalIndex-e.index)*(P.width+i)+e.rect.x-t.x+n.x}px, 0)`},{transform:"translate(0, 0)"}],duration:p.animation.duration,easing:p.animation.easing}}}),J=Tn(e=>{var t,n;const r=e.offset||0,i=r?o.swipe:null!==(t=o.navigation)&&void 0!==t?t:o.swipe,a=r||q()?o.easing.swipe:o.easing.navigation;let{direction:l}=e;const c=null!==(n=e.count)&&void 0!==n?n:1;let s=Bn.ANIMATION,u=i*c;if(!l){const t=null==P?void 0:P.width,n=e.duration||0,o=t?i/t*Math.abs(r):i;0!==c?(n<o?u=u/o*Math.max(n,o/5):t&&(u=i/t*(t-Math.abs(r))),l=D(r)>0?lt:ct):u=i/2}let d=0;l===lt?B(D(1))?d=-c:(s=Bn.NONE,u=i):l===ct&&(B(D(-1))?d=c:(s=Bn.NONE,u=i)),u=Math.round(u),I(()=>{Z(0),b(Bn.NONE)},u),T.current&&K({rect:T.current.getBoundingClientRect(),index:p.globalIndex}),b(s),M(st,{type:"swipe",increment:d,duration:u,easing:a})});k.useEffect(()=>{var e,t;(null===(e=p.animation)||void 0===e?void 0:e.increment)&&(null===(t=p.animation)||void 0===t?void 0:t.duration)&&R(()=>v({type:"swipe",increment:0}),p.animation.duration)},[p.animation,v,R]);const Q=[y,B,(null==P?void 0:P.width)||0,o.swipe,()=>b(Bn.SWIPE),e=>Z(e),(e,t)=>J({offset:e,duration:t,count:1}),e=>J({offset:e,count:0})],ee=[()=>{u&&b(Bn.PULL)},e=>X(e),e=>$(e),e=>$(e,!0)];!function({disableSwipeNavigation:e,closeOnBackdropClick:t},n,r,o,i,a,l,c,s,u,d,h,m,f,p,v){const g=k.useRef(0),b=k.useRef([]),x=k.useRef(void 0),E=k.useRef(0),w=k.useRef(Xn.NONE),C=k.useCallback(e=>{x.current===e.pointerId&&(x.current=void 0,w.current=Xn.NONE);const t=b.current;t.splice(0,t.length,...t.filter(t=>t.pointerId!==e.pointerId))},[]),y=k.useCallback(e=>{C(e),e.persist(),b.current.push(e)},[C]),N=k.useCallback(e=>b.current.find(({pointerId:t})=>e.pointerId===t),[]),M=Tn(e=>{y(e)}),R=(e,t)=>d&&e>t||u&&e<-t,I=Tn(e=>{const n=N(e);if(n)if(x.current===e.pointerId){const e=Date.now()-E.current,t=g.current;w.current===Xn.SWIPE?Math.abs(t)>.3*o||Math.abs(t)>5&&e<i?c(t,e):s(t):w.current===Xn.PULL&&(R(t,60)?f(t,e):p(t)),g.current=0,w.current=Xn.NONE}else{const{target:r}=e;t&&r instanceof HTMLElement&&r===n.target&&(r.classList.contains(Nt(it))||r.classList.contains(Nt(at)))&&v()}C(e)});$n(n,M,Tn(t=>{const n=N(t);if(n){const o=x.current===t.pointerId;if(0===t.buttons)return void(o&&0!==g.current?I(t):C(n));const i=t.clientX-n.clientX,c=t.clientY-n.clientY;if(void 0===x.current){const n=e=>{y(t),x.current=t.pointerId,E.current=Date.now(),w.current=e};Math.abs(i)>Math.abs(c)&&Math.abs(i)>30&&r(i)?e||(n(Xn.SWIPE),a()):Math.abs(c)>Math.abs(i)&&R(c,30)&&(n(Xn.PULL),h())}else o&&(w.current===Xn.SWIPE?(g.current=i,l(i)):w.current===Xn.PULL&&(g.current=c,m(c)))}}),I)}(i,...Q,s,u,...ee,G),function(e,t,n,r,o,i,a,l,c){const s=k.useRef(0),u=k.useRef(0),d=k.useRef(void 0),h=k.useRef(void 0),m=k.useRef(0),f=k.useRef(void 0),p=k.useRef(0),{setTimeout:v,clearTimeout:g}=bn(),b=k.useCallback(()=>{d.current&&(g(d.current),d.current=void 0)},[g]),x=k.useCallback(()=>{h.current&&(g(h.current),h.current=void 0)},[g]),E=Tn(()=>{e!==Bn.SWIPE&&(s.current=0,p.current=0,b(),x())});k.useEffect(E,[e,E]);const w=Tn(e=>{h.current=void 0,s.current===e&&c(s.current)}),C=Tn(t=>{if(t.ctrlKey)return;if(Math.abs(t.deltaY)>Math.abs(t.deltaX))return;const c=e=>{m.current=e,g(f.current),f.current=e>0?v(()=>{m.current=0,f.current=void 0},300):void 0};if(e===Bn.NONE){if(Math.abs(t.deltaX)<=1.2*Math.abs(m.current))return void c(t.deltaX);if(!n(-t.deltaX))return;if(u.current+=t.deltaX,b(),Math.abs(u.current)>30)u.current=0,c(0),p.current=Date.now(),i();else{const e=u.current;d.current=v(()=>{d.current=void 0,e===u.current&&(u.current=0)},o)}}else if(e===Bn.SWIPE){let e=s.current-t.deltaX;if(e=Math.min(Math.abs(e),r)*Math.sign(e),s.current=e,a(e),x(),Math.abs(e)>.2*r)return c(t.deltaX),void l(e,Date.now()-p.current);h.current=v(()=>w(e),2*o)}else c(t.deltaX)});k.useEffect(()=>t(gt,C),[t,C])}(g,...Q);const te=Tn(()=>{i.focus&&F().querySelector(`.${Nt(Ve)} .${Nt(Kn())}`)&&z()});k.useEffect(te,[te]);const ne=Tn(()=>{var e;null===(e=a.view)||void 0===e||e.call(a,{index:p.currentIndex})});k.useEffect(ne,[p.globalIndex,ne]),k.useEffect(()=>St(N(lt,e=>J({direction:lt,...e})),N(ct,e=>J({direction:ct,...e})),N(st,e=>v(e))),[N,J,v]);const re=k.useMemo(()=>({prev:U,next:Y,close:G,focus:z,slideRect:P?Dt(P,r.padding):{width:0,height:0},containerRect:P||{width:0,height:0},subscribeSensors:y,containerRef:S,setCarouselRef:O,toolbarWidth:m,setToolbarWidth:f}),[U,Y,G,z,y,P,S,O,m,f,r.padding]);return k.useImperativeHandle(i.ref,()=>({prev:U,next:Y,close:G,focus:z,getLightboxProps:W,getLightboxState:H}),[U,Y,G,z,W,H]),k.createElement("div",{ref:A,className:yt(Nt(Kn()),Nt(rt)),style:{...g===Bn.SWIPE?{[Mt("swipe_offset")]:Math.round(x.current)+"px"}:null,...g===Bn.PULL?{[Mt("pull_offset")]:Math.round(E.current)+"px",[Mt("pull_opacity")]:""+w.current}:null,..."none"!==i.touchAction?{[Mt("controller_touch_action")]:i.touchAction}:null,...l.container},tabIndex:-1,...C},P&&k.createElement(qn.Provider,{value:re},e,null===(n=c.controls)||void 0===n?void 0:n.call(c)))});function er(e){return Rt(Ze,e)}function tr(e){return Rt(it,e)}function nr({slide:e,offset:t}){const n=k.useRef(null),{currentIndex:r,slides:o}=hn(),{slideRect:i,focus:a}=Jn(),{render:l,carousel:{imageFit:c,imageProps:s},on:{click:u},styles:{slide:d},labels:h}=sn(),{getOwnerDocument:m}=nn(),f=0!==t;return k.useEffect(()=>{var e;f&&(null===(e=n.current)||void 0===e?void 0:e.contains(m().activeElement))&&a()},[f,a,m]),k.createElement("div",{ref:n,className:yt(Nt(tr()),!f&&Nt(tr("current")),Nt(rt)),...(p=f,{inert:Zt?p:p?"":void 0}),style:d,role:"group","aria-roledescription":kt(h,"Slide"),"aria-label":_t(h,o,r+t)},(()=>{var n,o,a,d;let h=null===(n=l.slide)||void 0===n?void 0:n.call(l,{slide:e,offset:t,rect:i});return!h&&Tt(e)&&(h=k.createElement(Yn,{slide:e,offset:t,render:l,rect:i,imageFit:c,imageProps:s,onClick:f?void 0:()=>null==u?void 0:u({index:r})})),h?k.createElement(k.Fragment,null,null===(o=l.slideHeader)||void 0===o?void 0:o.call(l,{slide:e}),(null!==(a=l.slideContainer)&&void 0!==a?a:({children:e})=>e)({slide:e,children:h}),null===(d=l.slideFooter)||void 0===d?void 0:d.call(l,{slide:e})):null})());var p}function rr(){const e=sn().styles.slide;return k.createElement("div",{className:Nt(it),style:e})}const or=Vt(Ze,function({carousel:e,labels:t}){const{slides:n,currentIndex:r,globalIndex:o}=hn(),{setCarouselRef:i}=Jn(),{autoPlaying:a,focusWithin:l}=Qt(),c=jt(e.spacing),s=jt(e.padding),u=Bt(e,n,1),d=[];if(Wt(n))for(let h=r-u;h<=r+u;h+=1){const t=Ht(n,h),i=o-r+h,a=e.finite&&(h<0||h>n.length-1);d.push(a?{key:i}:{key:[""+i,Yt(t)].filter(Boolean).join("|"),offset:h-r,slide:t})}return k.createElement("div",{ref:i,className:yt(Nt(er()),d.length>0&&Nt(er("with_slides"))),style:{[""+Mt(er("slides_count"))]:d.length,[""+Mt(er("spacing_px"))]:c.pixel||0,[""+Mt(er("spacing_percent"))]:c.percent||0,[""+Mt(er("padding_px"))]:s.pixel||0,[""+Mt(er("padding_percent"))]:s.percent||0},role:"region","aria-live":a&&!l?"off":"polite","aria-roledescription":kt(t,"Carousel"),"aria-label":kt(t,"Photo gallery")},d.map(({key:e,slide:t,offset:n})=>t?k.createElement(nr,{key:e,slide:t,offset:n}):k.createElement(rr,{key:e})))});function ir(){const{carousel:e}=sn(),{slides:t,currentIndex:n}=hn();return{prevDisabled:0===t.length||e.finite&&0===n,nextDisabled:0===t.length||e.finite&&n===t.length-1}}function ar(e){var t;const n=Dn(),{publish:r}=an(),{animation:o}=sn(),{prevDisabled:i,nextDisabled:a}=ir(),l=(null!==(t=o.navigation)&&void 0!==t?t:o.swipe)/2,c=Wn(()=>r(lt),l),s=Wn(()=>r(ct),l),u=Tn(e=>{switch(e.key){case"Escape":r(ut);break;case"ArrowLeft":(n?a:i)||(n?s:c)();break;case"ArrowRight":(n?i:a)||(n?c:s)()}});k.useEffect(()=>e(vt,u),[e,u])}function lr({label:e,icon:t,renderIcon:n,action:r,onClick:o,disabled:i,style:a}){return k.createElement(En,{label:e,icon:t,renderIcon:n,className:Nt("navigation_"+r),disabled:i,onClick:o,style:a,...jn(Jn().focus,i)})}const cr=Vt("navigation",function({render:{buttonPrev:e,buttonNext:t,iconPrev:n,iconNext:r},styles:o}){const{prev:i,next:a,subscribeSensors:l}=Jn(),{prevDisabled:c,nextDisabled:s}=ir();return ar(l),k.createElement(k.Fragment,null,e?e():k.createElement(lr,{label:"Previous",action:lt,icon:Mn,renderIcon:n,style:o.navigationPrev,disabled:c,onClick:i}),t?t():k.createElement(lr,{label:"Next",action:ct,icon:Rn,renderIcon:r,style:o.navigationNext,disabled:s,onClick:a}))}),sr=Nt("no_scroll"),ur=Nt(ot);function dr(e){return"style"in e}function hr(e,t,n){const r=window.getComputedStyle(e),o=n?"padding-left":"padding-right",i=n?r.paddingLeft:r.paddingRight,a=e.style.getPropertyValue(o);return e.style.setProperty(o,(Ft(i)||0)+t+"px"),()=>{a?e.style.setProperty(o,a):e.style.removeProperty(o)}}const mr=Vt("no-scroll",function({noScroll:{disabled:e},children:t}){const n=Dn(),{getOwnerDocument:r,getOwnerWindow:o}=nn();return k.useEffect(()=>{if(e)return()=>{};const t=[],i=o(),{body:a,documentElement:l}=r(),c=Math.round(i.innerWidth-l.clientWidth);if(c>0){t.push(hr(a,c,n));const e=a.getElementsByTagName("*");for(let r=0;r<e.length;r+=1){const o=e[r];dr(o)&&"fixed"===i.getComputedStyle(o).getPropertyValue("position")&&!o.classList.contains(ur)&&t.push(hr(o,c,n))}}return a.classList.add(sr),()=>{a.classList.remove(sr),t.forEach(e=>e())}},[n,e,r,o]),k.createElement(k.Fragment,null,t)});function fr(e){return Rt(Ve,e)}function pr(e,t,n){const r=e.getAttribute(t);return e.setAttribute(t,n),()=>{r?e.setAttribute(t,r):e.removeAttribute(t)}}const vr=Vt(Ve,function({children:e,animation:t,styles:n,className:r,on:o,portal:i,close:a,labels:l}){const[c,s]=k.useState(!1),[u,d]=k.useState(!1),h=k.useRef([]),m=k.useRef(null),{setTimeout:f}=bn(),{subscribe:p}=an(),v=Sn()?0:t.fade;k.useEffect(()=>(s(!0),()=>{s(!1),d(!1)}),[]);const g=Tn(()=>{h.current.forEach(e=>e()),h.current=[]}),b=Tn(()=>{var e;d(!1),g(),null===(e=o.exiting)||void 0===e||e.call(o),f(()=>{var e;null===(e=o.exited)||void 0===e||e.call(o),a()},v)});k.useEffect(()=>p(ut,b),[p,b]);const x=Tn(e=>{var t,n,r;!function(e){e.scrollTop}(e),d(!0),null===(t=o.entering)||void 0===t||t.call(o);const i=null!==(r=null===(n=e.parentNode)||void 0===n?void 0:n.children)&&void 0!==r?r:[];for(let o=0;o<i.length;o+=1){const t=i[o];-1===["TEMPLATE","SCRIPT","STYLE"].indexOf(t.tagName)&&t!==e&&(h.current.push(pr(t,"inert","")),h.current.push(pr(t,"aria-hidden","true")))}h.current.push(()=>{var e,t;null===(t=null===(e=m.current)||void 0===e?void 0:e.focus)||void 0===t||t.call(e)}),f(()=>{var e;null===(e=o.entered)||void 0===e||e.call(o)},v)}),E=k.useCallback(e=>{e?x(e):g()},[x,g]);return c?Z(k.createElement(Gn,{ref:E,className:yt(r,Nt(fr()),Nt(ot),u&&Nt(fr("open"))),"aria-modal":!0,role:"dialog","aria-label":kt(l,"Lightbox"),style:{...t.fade!==Xt.animation.fade?{[Mt("fade_animation_duration")]:v+"ms"}:null,...t.easing.fade!==Xt.animation.easing.fade?{[Mt("fade_animation_timing_function")]:t.easing.fade}:null,...n.root},onFocus:e=>{m.current||(m.current=e.relatedTarget)}},e),i.root||document.body):null}),gr=Vt("root",function({children:e}){return k.createElement(k.Fragment,null,e)}),br=Vt($e,function({toolbar:{buttons:e},render:{buttonClose:t,iconClose:n},styles:r}){const{close:o,setToolbarWidth:i}=Jn(),{setContainerRef:a,containerRect:l}=Pn();return _n(()=>{i(null==l?void 0:l.width)},[i,null==l?void 0:l.width]),k.createElement("div",{ref:a,style:r.toolbar,className:Nt(Rt($e,void 0))},null==e?void 0:e.map(e=>e===ut?t?t():k.createElement(En,{key:ut,label:"Close",icon:Nn,renderIcon:n,onClick:o}):e))});function xr(e,t){var n;return k.createElement(e.module.component,{key:e.module.name,...t},null===(n=e.children)||void 0===n?void 0:n.map(e=>xr(e,t)))}function Er(e,t={}){const{easing:n,...r}=e,{easing:o,...i}=t;return{easing:{...n,...o},...r,...i}}function wr({carousel:e,animation:t,render:n,toolbar:r,controller:o,noScroll:i,on:a,plugins:l,slides:c,index:s,...u}){const{animation:d,carousel:h,render:m,toolbar:f,controller:p,noScroll:v,on:g,slides:b,index:x,plugins:E,...w}=Xt,{config:C,augmentation:y}=function(e,t=[],n=[]){let r=e;const o=e=>{const t=[...r];for(;t.length>0;){const n=t.pop();if((null==n?void 0:n.module.name)===e)return!0;(null==n?void 0:n.children)&&t.push(...n.children)}return!1},i=(e,t)=>{r=""!==e?qt(r,e,e=>[$t(t,[e])]):[$t(t,r)]},a=(e,t)=>{r=qt(r,e,e=>[$t(e.module,[$t(t,e.children)])])},l=(e,t,n)=>{r=qt(r,e,e=>{var r;return[$t(e.module,[...n?[$t(t)]:[],...null!==(r=e.children)&&void 0!==r?r:[],...n?[]:[$t(t)]])]})},c=(e,t,n)=>{r=qt(r,e,e=>[...n?[$t(t)]:[],e,...n?[]:[$t(t)]])},s=e=>{a(Xe,e)},u=(e,t)=>{r=qt(r,e,e=>[$t(t,e.children)])},d=e=>{r=qt(r,e,e=>e.children)},h=e=>{n.push(e)};return t.forEach(e=>{e({contains:o,addParent:i,append:a,addChild:l,addSibling:c,addModule:s,replace:u,remove:d,augment:h})}),{config:r,augmentation:e=>n.reduce((e,t)=>t(e),e)}}([$t(vr,[$t(mr,[$t(Qn,[$t(or),$t(br),$t(cr)])])])],l||E),N=y({animation:Er(d,t),carousel:{...h,...e},render:{...m,...n},toolbar:{...f,...r},controller:{...p,...o},noScroll:{...v,...i},on:{...g,...a},...w,...u});return N.open?k.createElement(un,{...N},k.createElement(vn,{slides:c||b,index:Ft(s||x)},k.createElement(xn,null,k.createElement(ln,null,k.createElement(en,null,xr($t(gr,C),N)))))):null}const Cr={download:void 0},yr=e=>({...Cr,...e});function Nr(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(t){const n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(n)}}function Mr(e,t){const n=document.createElement("a");n.rel="noopener",n.download=t||"",n.download||(n.target="_blank"),"string"==typeof e?(n.href=e,n.origin!==window.location.origin?function(e){const t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(n){}return t.status>=200&&t.status<=299}(n.href)?function(e,t){const n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=()=>{Mr(n.response,t)},n.onerror=()=>{},n.send()}(e,t):(n.target="_blank",Nr(n)):Nr(n)):(n.href=URL.createObjectURL(e),setTimeout(()=>URL.revokeObjectURL(n.href),3e4),setTimeout(()=>Nr(n),0))}const Rr=Cn("DownloadIcon",k.createElement("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z"}));function Ir(){const{render:e,on:t,download:n}=sn(),{download:r}=yr(n),{currentSlide:o,currentIndex:i}=hn();if(e.buttonDownload)return k.createElement(k.Fragment,null,e.buttonDownload());const a=o&&(o.downloadUrl||"string"==typeof o.download&&o.download||"object"==typeof o.download&&o.download.url||Tt(o)&&o.src)||void 0,l=r?!1!==(null==o?void 0:o.download):!!a,c=()=>{if(o&&a){const e=o.downloadFilename||"object"==typeof o.download&&o.download.filename||void 0;Mr(a,e)}};return k.createElement(En,{label:"Download",icon:Rr,renderIcon:e.iconDownload,disabled:!l,onClick:()=>{var e;o&&((r||c)({slide:o,saveAs:Mr}),null===(e=t.download)||void 0===e||e.call(t,{index:i}))}})}function kr({augment:e}){e(({toolbar:e,download:t,...n})=>({toolbar:Gt(e,"download",k.createElement(Ir,null)),download:yr(t),...n}))}const _r=e=>Nt("slide_"+e),Sr={descriptionTextAlign:"start",descriptionMaxLines:3,showToggle:!1,hidden:!1},Lr=e=>({...Sr,...e}),Pr=k.createContext(null),Ar=Lt("useCaptions","CaptionsContext",Pr);function Tr({captions:e,children:t}){const{ref:n,hidden:r}=Lr(e),[o,i]=k.useState(!r),a=k.useMemo(()=>({visible:o,show:()=>i(!0),hide:()=>i(!1)}),[o]);return k.useImperativeHandle(n,()=>a,[a]),k.createElement(Pr.Provider,{value:a},t)}function Or({title:e}){const{toolbarWidth:t}=Jn(),{styles:n}=sn(),{visible:r}=Ar();return r?k.createElement("div",{role:"heading","aria-level":2,style:n.captionsTitleContainer,className:yt(_r("captions_container"),_r("title_container"))},k.createElement("div",{className:_r("title"),style:{...t?{[Mt("toolbar_width")]:t+"px"}:null,...n.captionsTitle}},e)):null}function Fr({description:e}){const{descriptionTextAlign:t,descriptionMaxLines:n}=function(){const{captions:e}=sn();return Lr(e)}(),{styles:r,labels:o}=sn(),{visible:i}=Ar();return i?k.createElement("div",{style:r.captionsDescriptionContainer,className:yt(_r("captions_container"),_r("description_container"))},k.createElement("div",{className:_r("description"),style:{..."start"!==t||3!==n?{[Mt("slide_description_text_align")]:t,[Mt("slide_description_max_lines")]:n}:null,...r.captionsDescription},role:"paragraph","aria-roledescription":kt(o,"Caption")},"string"==typeof e?e.split("\n").flatMap((e,t)=>[...t>0?[k.createElement("br",{key:t})]:[],e]):e)):null}const jr=()=>k.createElement(k.Fragment,null,k.createElement("path",{strokeWidth:2,stroke:"currentColor",strokeLinejoin:"round",fill:"none",d:"M3 5l18 0l0 14l-18 0l0-14z"}),k.createElement("path",{d:"M7 15h3c.55 0 1-.45 1-1v-1H9.5v.5h-2v-3h2v.5H11v-1c0-.55-.45-1-1-1H7c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1zm7 0h3c.55 0 1-.45 1-1v-1h-1.5v.5h-2v-3h2v.5H18v-1c0-.55-.45-1-1-1h-3c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1z"})),Dr=Cn("CaptionsVisible",jr()),zr=yn("CaptionsVisible",jr());function Wr(){const{visible:e,show:t,hide:n}=Ar(),{render:r}=sn();return r.buttonCaptions?k.createElement(k.Fragment,null,r.buttonCaptions({visible:e,show:t,hide:n})):k.createElement(En,{label:e?"Hide captions":"Show captions",icon:e?Dr:zr,renderIcon:e?r.iconCaptionsVisible:r.iconCaptionsHidden,onClick:e?n:t})}function Hr({augment:e,addModule:t}){e(({captions:e,render:{slideFooter:t,...n},toolbar:r,...o})=>{const i=Lr(e);return{render:{slideFooter:({slide:e})=>k.createElement(k.Fragment,null,null==t?void 0:t({slide:e}),e.title&&k.createElement(Or,{title:e.title}),e.description&&k.createElement(Fr,{description:e.description})),...n},toolbar:Gt(r,Ke,i.showToggle?k.createElement(Wr,null):null),captions:i,...o}}),t(Vt(Ke,Tr))}const Ur={separator:"/",container:{}},Yr=e=>({...Ur,...e});function Gr({counter:e}){const{slides:t,currentIndex:n}=hn(),{separator:r,container:{className:o,...i},className:a,...l}=Yr(e);return 0===t.length?null:k.createElement("div",{className:yt(Nt("counter"),o||a),...l,...i,"aria-hidden":!0},n+1," ",r," ",t.length)}function Br({augment:e,addChild:t}){e(({counter:e,...t})=>({counter:Yr(e),...t})),t(Xe,Vt("counter",Gr))}const Zr={ref:null,position:"bottom",width:120,height:80,border:1,borderRadius:4,padding:4,gap:16,imageFit:"contain",vignette:!0,hidden:!1,showToggle:!1},Xr=e=>({...Zr,...e});function Vr(){const{thumbnails:e}=sn();return Xr(e)}const $r=e=>Rt(Je,e),Kr=e=>$r(Rt("thumbnail",e)),qr=Cn("VideoThumbnail",k.createElement("path",{d:"M10 16.5l6-4.5-6-4.5v9zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"})),Jr=Cn("UnknownThumbnail",k.createElement("path",{d:"M23 18V6c0-1.1-.9-2-2-2H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zM8.5 12.5l2.5 3.01L14.5 11l4.5 6H5l3.5-4.5z"})),Qr=It("active"),eo=It("fadein"),to=It("fadeout"),no=It("placeholder"),ro="delay",oo="duration";function io({slide:e,index:t,onClick:n,fadeIn:r,fadeOut:o,placeholder:i,onLoseFocus:a}){const l=k.useRef(null),{render:c,styles:s,labels:u}=sn(),{slides:d,globalIndex:h}=hn(),{getOwnerDocument:m}=nn(),{width:f,height:p,imageFit:v}=Vr(),g={width:f,height:p},b=t===h,x=Tn(a);return k.useEffect(()=>{o&&m().activeElement===l.current&&x()},[o,x,m]),k.createElement("button",{ref:l,type:"button",className:yt(Nt(rt),Nt(Kr()),b&&Nt(Kr(Qr())),r&&Nt(Kr(eo())),o&&Nt(Kr(to())),i&&Nt(Kr(no()))),style:{...r?{[Mt(Kr(eo(oo)))]:r.duration+"ms",[Mt(Kr(eo(ro)))]:r.delay+"ms"}:null,...o?{[Mt(Kr(to(oo)))]:o.duration+"ms",[Mt(Kr(to(ro)))]:o.delay+"ms"}:null,...s.thumbnail},onClick:n,"aria-current":!!b||void 0,"aria-label":_t(u,d,t)},e&&function({slide:e,render:t,rect:n,imageFit:r}){var o;const i=null===(o=t.thumbnail)||void 0===o?void 0:o.call(t,{slide:e,render:t,rect:n,imageFit:r});if(i)return i;const a={render:t,rect:n,imageFit:r};if(e.thumbnail)return k.createElement(Yn,{slide:{src:e.thumbnail},...a});if(Tt(e))return k.createElement(Yn,{slide:e,...a});const l=Nt(Kr(bt));return"video"===e.type?k.createElement(k.Fragment,null,e.poster&&k.createElement(Yn,{slide:{src:e.poster},...a}),k.createElement(qr,{className:l})):k.createElement(Jr,{className:l})}({slide:e,render:c,rect:g,imageFit:v}))}function ao(e){return["top","bottom"].includes(e)}function lo(e,t){return t+2*(e.border+e.padding)+e.gap}function co(e){const{thumbnail:t,poster:n}=e||{thumbnail:"placeholder"};return"string"==typeof t&&t||"string"==typeof n&&n||e&&Yt(e)||void 0}function so({visible:e,containerRef:t}){const n=k.useRef(null),r=Dn(),{publish:o,subscribe:i}=an(),{carousel:a,styles:l,labels:c}=sn(),{slides:s,globalIndex:u,animation:d}=hn(),{registerSensors:h,subscribeSensors:m}=zn();ar(m);const f=Vr(),{position:p,width:v,height:g,border:b,borderStyle:x,borderColor:E,borderRadius:w,padding:C,gap:y,vignette:N}=f,M=void 0!==(null==d?void 0:d.duration)&&(null==d?void 0:d.increment)||0,R=(null==d?void 0:d.duration)||0,{prepareAnimation:I}=Ln(n,e=>({keyframes:ao(p)?[{transform:`translateX(${(r?-1:1)*lo(f,v)*M+e}px)`},{transform:"translateX(0)"}]:[{transform:`translateY(${lo(f,g)*M+e}px)`},{transform:"translateY(0)"}],duration:R,easing:null==d?void 0:d.easing})),_=Tn(()=>{let e=0;if(t.current&&n.current){const r=t.current.getBoundingClientRect(),o=n.current.getBoundingClientRect();e=ao(p)?o.left-r.left-(r.width-o.width)/2:o.top-r.top-(r.height-o.height)/2}I(e)});k.useEffect(()=>St(i(st,_)),[i,_]);const S=Bt(a,s),L=[];if(Wt(s))for(let k=u-S-Math.abs(M);k<=u+S+Math.abs(M);k+=1){const e=a.finite&&(k<0||k>s.length-1)||M<0&&k<u-S||M>0&&k>u+S?null:Ht(s,k),t=[""+k,co(e)].filter(Boolean).join("|");L.push({key:t,index:k,slide:e})}return k.createElement("div",{className:yt(Nt($r("container")),Nt(rt)),style:{...e?null:{display:"none"},...120!==v?{[Mt(Kr("width"))]:v+"px"}:null,...80!==g?{[Mt(Kr("height"))]:g+"px"}:null,...1!==b?{[Mt(Kr("border"))]:b+"px"}:null,...x?{[Mt(Kr("border_style"))]:x}:null,...E?{[Mt(Kr("border_color"))]:E}:null,...4!==w?{[Mt(Kr("border_radius"))]:w+"px"}:null,...4!==C?{[Mt(Kr("padding"))]:C+"px"}:null,...16!==y?{[Mt(Kr("gap"))]:y+"px"}:null,...l.thumbnailsContainer}},k.createElement("nav",{ref:n,style:l.thumbnailsTrack,className:yt(Nt($r("track")),Nt(rt)),"aria-label":kt(c,"Thumbnails"),tabIndex:-1,...h},L.map(({key:e,index:t,slide:r})=>{const i=R/Math.abs(M||1),a=M>0&&t>u+S-M&&t<=u+S||M<0&&t<u-S-M&&t>=u-S?{duration:i,delay:((M>0?t-(u+S-M):u-S-M-t)-1)*i}:void 0,l=M>0&&t<u-S||M<0&&t>u+S?{duration:i,delay:(M>0?M-(u-S-t):-M-(t-(u+S)))*i}:void 0;return k.createElement(io,{key:e,index:t,slide:r,fadeIn:a,fadeOut:l,placeholder:!r,onClick:(c=t,()=>{c>u?o(ct,{count:c-u}):c<u&&o(lt,{count:u-c})}),onLoseFocus:()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.focus()}});var c})),N&&k.createElement("div",{className:Nt($r("vignette"))}))}const uo=k.createContext(null),ho=Lt("useThumbnails","ThumbnailsContext",uo);function mo({children:e,...t}){const{ref:n,position:r,hidden:o}=Xr(t.thumbnails),[i,a]=k.useState(!o),l=k.useRef(null),c=k.useMemo(()=>({visible:i,show:()=>a(!0),hide:()=>a(!1)}),[i]);return k.useImperativeHandle(n,()=>c,[c]),k.createElement(un,{...t},k.createElement(uo.Provider,{value:c},k.createElement("div",{ref:l,className:yt(Nt($r()),Nt($r(""+r)))},["start","top"].includes(r)&&k.createElement(so,{containerRef:l,visible:i}),k.createElement("div",{className:Nt($r("wrapper"))},e),["end","bottom"].includes(r)&&k.createElement(so,{containerRef:l,visible:i}))))}const fo=()=>k.createElement(k.Fragment,null,k.createElement("path",{strokeWidth:2,stroke:"currentColor",strokeLinejoin:"round",fill:"none",d:"M3 5l18 0l0 14l-18 0l0-14z"}),k.createElement("path",{d:"M5 14h4v3h-4zM10 14h4v3h-4zM15 14h4v3h-4z"})),po=Cn("ThumbnailsVisible",fo()),vo=yn("ThumbnailsHidden",fo());function go(){const{visible:e,show:t,hide:n}=ho(),{render:r}=sn();return r.buttonThumbnails?k.createElement(k.Fragment,null,r.buttonThumbnails({visible:e,show:t,hide:n})):k.createElement(En,{label:e?"Hide thumbnails":"Show thumbnails",icon:e?po:vo,renderIcon:e?r.iconThumbnailsVisible:r.iconThumbnailsHidden,onClick:e?n:t})}function bo({augment:e,contains:t,append:n,addParent:r}){e(({thumbnails:e,toolbar:t,...n})=>{const r=Xr(e);return{toolbar:Gt(t,Je,r.showToggle?k.createElement(go,null):null),thumbnails:r,...n}});const o=Vt(Je,mo);t(qe)?n(qe,o):r(Xe,o)}const xo={minZoom:1,maxZoomPixelRatio:1,zoomInMultiplier:2,doubleTapDelay:300,doubleClickDelay:500,doubleClickMaxStops:2,keyboardMoveDistance:50,wheelZoomDistanceFactor:100,pinchZoomDistanceFactor:100,scrollToZoom:!1};function Eo(e){return Math.min(Math.max(e,Number.EPSILON),1)}function wo(e){const{minZoom:t,...n}={...xo,...e};return{minZoom:Eo(t),...n}}function Co(){const{zoom:e}=sn();return wo(e)}function yo(e,t){return((e.clientX-t.clientX)**2+(e.clientY-t.clientY)**2)**.5}function No(e,t,n=100,r=2){return e*Math.min(1+Math.abs(t/n),r)**Math.sign(t)}const Mo=k.createContext(null),Ro=Lt("useZoom","ZoomControllerContext",Mo);function Io({children:e}){const[t,n]=k.useState(),{slideRect:r}=Jn(),{ref:o,minZoom:i}=Co(),{imageRect:a,maxZoom:l}=function(e,t){var n,r;let o={width:0,height:0},i={width:0,height:0};const{currentSlide:a}=hn(),{imageFit:l}=sn().carousel,{maxZoomPixelRatio:c}=Co();if(e&&a){const s={...a,...t};if(Tt(s)){const t=Ot(s,l),a=Math.max(...((null===(n=s.srcSet)||void 0===n?void 0:n.map(e=>e.width))||[]).concat(s.width?[s.width]:[])),u=Math.max(...((null===(r=s.srcSet)||void 0===r?void 0:r.map(e=>e.height))||[]).concat(s.height?[s.height]:[]));a>0&&u>0&&e.width>0&&e.height>0&&(i=t?{width:Math.round(Math.min(a,e.width/e.height*u)),height:Math.round(Math.min(u,e.height/e.width*a))}:{width:a,height:u},i={width:i.width*c,height:i.height*c},o=t?{width:Math.min(e.width,i.width,a),height:Math.min(e.height,i.height,u)}:{width:Math.round(Math.min(e.width,e.height/u*a,a)),height:Math.round(Math.min(e.height,e.width/a*u,u))})}}return{imageRect:o,maxZoom:o.width?Math.max(At(i.width/o.width,5),1):1}}(r,null==t?void 0:t.imageDimensions),{zoom:c,offsetX:s,offsetY:u,disabled:d,changeZoom:h,changeOffsets:m,zoomIn:f,zoomOut:p}=function(e,t,n){const[r,o]=k.useState(1),[i,a]=k.useState(0),[l,c]=k.useState(0),s=function(e,t,n,r){const o=k.useRef(void 0),i=k.useRef(void 0),{zoom:a}=sn().animation,l=Sn(),c=Tn(()=>{var c,s,u;if(null===(c=o.current)||void 0===c||c.cancel(),o.current=void 0,i.current&&(null==r?void 0:r.current)){try{o.current=null===(u=(s=r.current).animate)||void 0===u?void 0:u.call(s,[{transform:i.current},{transform:`scale(${e}) translateX(${t}px) translateY(${n}px)`}],{duration:l?0:null!=a?a:500,easing:o.current?"ease-out":"ease-in-out"})}catch(d){}i.current=void 0,o.current&&(o.current.onfinish=()=>{o.current=void 0})}});return _n(c,[e,t,n,c]),k.useCallback(()=>{i.current=(null==r?void 0:r.current)?window.getComputedStyle(r.current).transform:void 0},[r])}(r,i,l,n),{currentSlide:u,globalIndex:d}=hn(),{containerRect:h,slideRect:m}=Jn(),{minZoom:f,zoomInMultiplier:p}=Co(),v=u&&Tt(u)?u.src:void 0,g=!v||!(null==n?void 0:n.current);_n(()=>{o(1),a(0),c(0)},[d,v]);const b=k.useCallback((t,n,o)=>{const s=o||r,u=i-(t||0),d=l-(n||0),h=(e.width*s-m.width)/2/s,f=(e.height*s-m.height)/2/s;a(Math.min(Math.abs(u),Math.max(h,0))*Math.sign(u)),c(Math.min(Math.abs(d),Math.max(f,0))*Math.sign(d))},[r,i,l,m,e.width,e.height]),x=k.useCallback((e,n,i,a)=>{const l=At(Math.min(Math.max(e+.001<t?e:t,f),t),5);l!==r&&(n||s(),b(i?i*(1/r-1/l):0,a?a*(1/r-1/l):0,l),o(l))},[r,f,t,b,s]),E=Tn(()=>{r>1&&(r>t&&x(t,!0),b())});_n(E,[h.width,h.height,E]);const w=k.useCallback(()=>{const e=r*p;x(r<1&&e>1?1:e)},[r,p,x]),C=k.useCallback(()=>{const e=r/p;x(r>1&&e<1?1:e)},[r,p,x]);return{zoom:r,offsetX:i,offsetY:l,disabled:g,changeOffsets:b,changeZoom:x,zoomIn:w,zoomOut:C}}(a,l,null==t?void 0:t.zoomWrapperRef);!function(e,t){const{on:n}=sn(),r=Tn(()=>{var r;t||null===(r=n.zoom)||void 0===r||r.call(n,{zoom:e})});k.useEffect(r,[e,r])}(c,d),function(e,t,n,r,o,i,a,l,c){const s=k.useRef([]),u=k.useRef(0),d=k.useRef(void 0),{globalIndex:h}=hn(),{getOwnerWindow:m}=nn(),{containerRef:f,subscribeSensors:p}=Jn(),{keyboardMoveDistance:v,zoomInMultiplier:g,wheelZoomDistanceFactor:b,scrollToZoom:x,doubleTapDelay:E,doubleClickDelay:w,doubleClickMaxStops:C,pinchZoomDistanceFactor:y}=Co(),N=k.useCallback(e=>{if(f.current){const{pageX:t,pageY:n}=e,{scrollX:r,scrollY:o}=m(),{left:i,top:a,width:l,height:c}=f.current.getBoundingClientRect();return[t-i-r-l/2,n-a-o-c/2]}return[]},[f,m]),M=Tn(t=>{const{key:n,metaKey:r,ctrlKey:c}=t,s=r||c,u=()=>{t.preventDefault(),t.stopPropagation()};if(e>1){const e=(e,t)=>{u(),l(e,t)};"ArrowDown"===n?e(0,v):"ArrowUp"===n?e(0,-v):"ArrowLeft"===n?e(-v,0):"ArrowRight"===n&&e(v,0)}"+"===n||s&&"="===n?(u(),o()):"-"===n||s&&"_"===n?(u(),i()):s&&"0"===n&&(u(),a(1))}),R=Tn(t=>{if((t.ctrlKey||x)&&Math.abs(t.deltaY)>Math.abs(t.deltaX))return t.stopPropagation(),void a(No(e,-t.deltaY,b),!0,...N(t));e>1&&(t.stopPropagation(),x||l(t.deltaX,t.deltaY))}),I=k.useCallback(e=>{const t=s.current;t.splice(0,t.length,...t.filter(t=>t.pointerId!==e.pointerId))},[]),_=k.useCallback(e=>{I(e),e.persist(),s.current.push(e)},[I]),S=Tn(r=>{var o;const i=s.current;if("mouse"===r.pointerType&&r.buttons>1||!(null===(o=null==c?void 0:c.current)||void 0===o?void 0:o.contains(r.target)))return;e>1&&r.stopPropagation();const{timeStamp:l}=r;0===i.length&&l-u.current<("touch"===r.pointerType?E:w)?(u.current=0,a(e>=1?e!==n?e*Math.max(n**(1/C),g):1:e!==t?e/Math.max(t**(-1/C),g):1,!1,...N(r))):u.current=l,_(r),2===i.length&&(d.current=yo(i[0],i[1]))}),L=Tn(t=>{const n=s.current,r=n.find(e=>e.pointerId===t.pointerId);if(2===n.length&&d.current){t.stopPropagation(),_(t);const r=yo(n[0],n[1]),o=r-d.current;return void(Math.abs(o)>0&&(a(No(e,o,y),!0,...n.map(e=>N(e)).reduce((e,t)=>t.map((t,n)=>e[n]+t/2))),d.current=r))}e>1&&(t.stopPropagation(),r&&(1===n.length&&l((r.clientX-t.clientX)/e,(r.clientY-t.clientY)/e),_(t)))}),P=k.useCallback(e=>{const t=s.current;2===t.length&&t.find(t=>t.pointerId===e.pointerId)&&(d.current=void 0),I(e)},[I]),A=k.useCallback(()=>{const e=s.current;e.splice(0,e.length),u.current=0,d.current=void 0},[]);$n(p,S,L,P,r),k.useEffect(A,[h,A]),k.useEffect(()=>r?()=>{}:St(A,p(vt,M),p(gt,R)),[r,p,A,M,R])}(c,i,l,d,f,p,h,m,null==t?void 0:t.zoomWrapperRef);const v=k.useMemo(()=>({zoom:c,minZoom:i,maxZoom:l,offsetX:s,offsetY:u,disabled:d,zoomIn:f,zoomOut:p,changeZoom:h}),[c,i,l,s,u,d,f,p,h]);k.useImperativeHandle(o,()=>v,[v]);const g=k.useMemo(()=>({...v,setZoomWrapper:n}),[v,n]);return k.createElement(Mo.Provider,{value:g},e)}const ko=Cn("ZoomIn",k.createElement(k.Fragment,null,k.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),k.createElement("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"}))),_o=Cn("ZoomOut",k.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})),So=k.forwardRef(function({zoomIn:e,onLoseFocus:t},n){const r=k.useRef(!1),o=k.useRef(!1),{zoom:i,minZoom:a,maxZoom:l,zoomIn:c,zoomOut:s,disabled:u}=Ro(),{render:d}=sn(),h=u||(e?i>=l:i<=a);return k.useEffect(()=>{h&&r.current&&o.current&&t(),h||(r.current=!0)},[h,t]),k.createElement(En,{ref:n,disabled:h,label:e?"Zoom in":"Zoom out",icon:e?ko:_o,renderIcon:e?d.iconZoomIn:d.iconZoomOut,onClick:e?c:s,onFocus:()=>{o.current=!0},onBlur:()=>{o.current=!1}})});function Lo(){const e=k.useRef(null),t=k.useRef(null),{focus:n}=Jn(),r=k.useCallback(e=>{var t,r;(null===(t=e.current)||void 0===t?void 0:t.disabled)?n():null===(r=e.current)||void 0===r||r.focus()},[n]),o=k.useCallback(()=>r(e),[r]),i=k.useCallback(()=>r(t),[r]);return k.createElement(k.Fragment,null,k.createElement(So,{zoomIn:!0,ref:e,onLoseFocus:i}),k.createElement(So,{ref:t,onLoseFocus:o}))}function Po(){const{render:e}=sn(),t=Ro();return e.buttonZoom?k.createElement(k.Fragment,null,e.buttonZoom(t)):k.createElement(Lo,null)}function Ao({current:e,preload:t},{type:n,source:r}){switch(n){case"fetch":return e?{current:e,preload:r}:{current:r};case"done":return r===t?{current:r}:{current:e,preload:t};default:throw Error(wt)}}function To(e){var t,n;const[{current:r,preload:o},i]=k.useReducer(Ao,{}),{slide:a,rect:l,imageFit:c,render:s,interactive:u}=e,d=a.srcSet.sort((e,t)=>e.width-t.width),h=null!==(t=a.width)&&void 0!==t?t:d[d.length-1].width,m=null!==(n=a.height)&&void 0!==n?n:d[d.length-1].height,f=Ot(a,c),p=Math.max(...d.map(e=>e.width)),v=Math.min((f?Math.max:Math.min)(l.width,h*(l.height/m)),p),g=(Pt()?null===window||void 0===window?void 0:window.devicePixelRatio:void 0)||1,b=Tn(()=>{var e;const t=null!==(e=d.find(e=>e.width>=v*g))&&void 0!==e?e:d[d.length-1];(!r||d.findIndex(e=>e.src===r)<d.findIndex(e=>e===t))&&i({type:"fetch",source:t.src})});_n(b,[l.width,l.height,g,b]);const x=Tn(e=>i({type:"done",source:e})),E={WebkitTransform:u?"initial":"translateZ(0)"};return f||Object.assign(E,l.width/l.height<h/m?{width:"100%",height:"auto"}:{width:"auto",height:"100%"}),k.createElement(k.Fragment,null,o&&o!==r&&k.createElement(Yn,{key:"preload",...e,offset:void 0,slide:{...a,src:o,srcSet:void 0},style:{position:"absolute",visibility:"hidden",...E},onLoad:()=>x(o),render:{...s,iconLoading:()=>null,iconError:()=>null}}),r&&k.createElement(Yn,{key:"current",...e,slide:{...a,src:r,srcSet:void 0},style:E}))}function Oo({render:e,slide:t,offset:n,rect:r}){var o;const[i,a]=k.useState(),l=k.useRef(null),{zoom:c,maxZoom:s,offsetX:u,offsetY:d,setZoomWrapper:h}=Ro(),m=c>1,{carousel:f,on:p}=sn(),{currentIndex:v}=hn();_n(()=>0===n?(h({zoomWrapperRef:l,imageDimensions:i}),()=>h(void 0)):()=>{},[n,i,h]);let g=null===(o=e.slide)||void 0===o?void 0:o.call(e,{slide:t,offset:n,rect:r,zoom:c,maxZoom:s});if(!g&&Tt(t)){const o={slide:t,offset:n,rect:r,render:e,imageFit:f.imageFit,imageProps:f.imageProps,onClick:0===n?()=>{var e;return null===(e=p.click)||void 0===e?void 0:e.call(p,{index:v})}:void 0};g=function(e){var t;return((null===(t=e.srcSet)||void 0===t?void 0:t.length)||0)>0}(t)?k.createElement(To,{...o,slide:t,interactive:m,rect:0===n?{width:r.width*c,height:r.height*c}:r}):k.createElement(Yn,{onLoad:e=>a({width:e.naturalWidth,height:e.naturalHeight}),...o})}return g?k.createElement("div",{ref:l,className:yt(Nt("fullsize"),Nt(rt),Nt(at),m&&Nt("slide_wrapper_interactive")),style:0===n?{transform:`scale(${c}) translateX(${u}px) translateY(${d}px)`}:void 0},g):null}const Fo=({augment:e,addModule:t})=>{e(({zoom:e,toolbar:t,render:n,controller:r,...o})=>{const i=wo(e);return{zoom:i,toolbar:Gt(t,Qe,k.createElement(Po,null)),render:{...n,slide:e=>{var t;return Tt(e.slide)?k.createElement(Oo,{render:n,...e}):null===(t=n.slide)||void 0===t?void 0:t.call(n,e)}},controller:{...r,preventDefaultWheelY:i.scrollToZoom},...o}}),t(Vt(Qe,Io))},jo=({message:e,onClick:n})=>{const r=Cn("Eye",
|
|
7
7
|
/* @__PURE__ */t.jsx("path",{fill:"#ffffff",d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"}));/* @__PURE__ */
|
|
8
8
|
return t.jsx("div",{className:"cursor-pointer text-white",children:/* @__PURE__ */t.jsx(r,{onClick:()=>{n(e.time)}})})},Do=({onGo:e,open:n,index:r,setCurrentIndex:o,onClose:i,slides:a,onEndReached:l,onStartReached:c,threshold:s=1})=>{const u=O(!0),d=O(!0);if(T(()=>{setTimeout(()=>{u.current=!0,d.current=!0},100)},[a]),!n)return null;const h=r,m=a.map(e=>{const n="string"==typeof e.metadata?JSON.parse(e.metadata):e.metadata;return{id:e.id,metadata:e.metadata,src:n.file.link,width:n?.file?.actualWidth??1e3,height:n?.file?.actualHeight??1e3,description:/* @__PURE__ */t.jsx("span",{children:H(e?.message?.trim()+"",{parentClassName:"overflow-hidden text-ellipsis "})})}});/* @__PURE__ */
|
|
9
9
|
return t.jsx(wr,{open:n,close:()=>{i(),o&&o(-1)},controller:{closeOnBackdropClick:!0},slides:m,plugins:[kr,Hr,Br,bo,Fo],captions:{showToggle:!0,descriptionTextAlign:"center",descriptionMaxLines:2},index:h,toolbar:{buttons:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as e,cT as t,j as n,aq as r,ar as o,at as a}from"./main-
|
|
1
|
+
import{c as e,cT as t,j as n,aq as r,ar as o,at as a}from"./main-BiSoVrq9.js";import*as s from"react";import i from"react";import{j as c,k as d,l as x,P as u,m as p,n as l,G as f,o as m,q as h,r as C,s as g,t as v,S as M,v as w,w as y,x as _}from"./LoadingDots-CSbpS1Hq.js";const j=e("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var R="ContextMenu",[N]=r(R,[c]),b=c(),[P,k]=N(R),I=e=>{const{__scopeContextMenu:r,children:o,onOpenChange:a,dir:i,modal:c=!0}=e,[x,u]=s.useState(!1),p=b(r),l=t(a),f=s.useCallback(e=>{u(e),l(e)},[l]);/* @__PURE__ */
|
|
2
2
|
return n.jsx(P,{scope:r,open:x,onOpenChange:f,modal:c,children:/* @__PURE__ */n.jsx(d,{...p,dir:i,open:x,onOpenChange:f,modal:c,children:o})})};I.displayName=R;var O="ContextMenuTrigger",T=s.forwardRef((e,t)=>{const{__scopeContextMenu:r,disabled:i=!1,...c}=e,d=k(O,r),u=b(r),p=s.useRef({x:0,y:0}),l=s.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),f=s.useRef(0),m=s.useCallback(()=>window.clearTimeout(f.current),[]),h=e=>{p.current={x:e.clientX,y:e.clientY},d.onOpenChange(!0)};return s.useEffect(()=>m,[m]),s.useEffect(()=>{i&&m()},[i,m]),/* @__PURE__ */n.jsxs(n.Fragment,{children:[
|
|
3
3
|
/* @__PURE__ */n.jsx(x,{...u,virtualRef:l}),
|
|
4
4
|
/* @__PURE__ */n.jsx(o.span,{"data-state":d.open?"open":"closed","data-disabled":i?"":void 0,...c,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:i?e.onContextMenu:a(e.onContextMenu,e=>{m(),h(e),e.preventDefault()}),onPointerDown:i?e.onPointerDown:a(e.onPointerDown,G(e=>{m(),f.current=window.setTimeout(()=>h(e),700)})),onPointerMove:i?e.onPointerMove:a(e.onPointerMove,G(m)),onPointerCancel:i?e.onPointerCancel:a(e.onPointerCancel,G(m)),onPointerUp:i?e.onPointerUp:a(e.onPointerUp,G(m))})]})});T.displayName=O;var D=e=>{const{__scopeContextMenu:t,...r}=e,o=b(t);/* @__PURE__ */
|