@qratilabs/qrati-connect 2.6.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/element/B8jogRzT.js +4 -0
  3. package/element/{wHbQZdly.js → BiQECCnr.js} +1 -1
  4. package/element/{B4-Qw59P.js → BjbDXTeP.js} +3 -3
  5. package/element/{DPOkh0eJ.js → COUnPxHl.js} +1 -1
  6. package/element/{DODG2TX4.js → CkfXzc1_.js} +1 -1
  7. package/element/{B28y50Bi.js → DGeYAYfl.js} +1 -1
  8. package/element/{CUOOhGTj.js → DXPR6JWg.js} +1 -1
  9. package/element/{D4xTzxjA.js → DqOnDVHH.js} +1 -1
  10. package/element/ThtSVXLE.js +32 -0
  11. package/element/{CH2f_afH.js → gajcOMzQ.js} +1 -1
  12. package/element/{Cf1QDu0i.js → ojjN3KY4.js} +1 -1
  13. package/element/web.es.js +192 -183
  14. package/element/xqhGemdL.js +16 -0
  15. package/package.json +1 -1
  16. package/react/{C4TTO8j2.js → B0pbGxj0.js} +1 -1
  17. package/react/B57jvRJw.js +1 -0
  18. package/react/{B8FlrdhF.js → B74JcfT2.js} +1 -1
  19. package/react/{Cs3wia2w.js → BBaYBpSS.js} +1 -1
  20. package/react/{pIx9IeV5.js → BUm8-ZtV.js} +1 -1
  21. package/react/Bran9aUe.js +32 -0
  22. package/react/{BaT1o9UO.js → CDAGXOJa.js} +1 -1
  23. package/react/{aragUG-J.js → CMUYyO6F.js} +1 -1
  24. package/react/CPs8NoX7.js +1 -0
  25. package/react/{DOw70z3P.js → CdZcv5CJ.js} +1 -1
  26. package/react/Ce4GGag_.js +1 -0
  27. package/react/CnRdB6_J.js +16 -0
  28. package/react/{e8YBtYhk.js → CzNVO0Zz.js} +1 -1
  29. package/react/{D7c4q3kj.js → D6h9tRAZ.js} +1 -1
  30. package/react/{DLf4fPpy.js → DCjmEjZr.js} +1 -1
  31. package/react/{BXiO9Rt2.js → DJ-3Sziz.js} +1 -1
  32. package/react/{DB3DJWUI.js → DKvJBrWM.js} +3 -3
  33. package/react/DSAOtDOg.js +4 -0
  34. package/react/{DEIcfk-y.js → DaQR1Bft.js} +1 -1
  35. package/react/{CT_Cvh8-.js → Dbq_PyC6.js} +1 -1
  36. package/react/{sxfIEK17.js → DdmNkEML.js} +1 -1
  37. package/react/{CNAEfadS.js → buiUjKpV.js} +1 -1
  38. package/react/{Czrz88CD.js → dLaHt9rf.js} +1 -1
  39. package/react/index.cjs +1 -1
  40. package/react/index.mjs +419 -410
  41. package/react/{Dljj3ToS.js → zrUJi_8F.js} +1 -1
  42. package/umd/web.umd.js +1 -1
  43. package/element/BKzoEuEi.js +0 -4
  44. package/element/B_TauT26.js +0 -1
  45. package/element/CudAoK3L.js +0 -32
  46. package/element/DHTkVJH6.js +0 -1
  47. package/element/Dc7DVn3n.js +0 -16
  48. package/react/BD2gDjZu.js +0 -1
  49. package/react/BUcttdEL.js +0 -1
  50. package/react/BXe4I1MJ.js +0 -32
  51. package/react/B_TauT26.js +0 -1
  52. package/react/BhU5cdLs.js +0 -1
  53. package/react/C1A9nC-v.js +0 -16
  54. package/react/DDbNaN3e.js +0 -4
  55. package/react/DHTkVJH6.js +0 -1
  56. package/react/DV6DJ1Br.js +0 -1
  57. package/react/QPXxc9eb.js +0 -1
  58. /package/element/{DMDEuqn7.js → BppxGns9.js} +0 -0
  59. /package/element/{Ccwm5LwS.js → C2ydm0ZD.js} +0 -0
  60. /package/element/{DSjmSa7l.js → CjmNvKgB.js} +0 -0
  61. /package/element/{ZShDCNL_.js → CziefUVo.js} +0 -0
  62. /package/element/{DD-DUfz5.js → DUlbZyIi.js} +0 -0
  63. /package/react/{CCCbXwws.js → BT55gXKs.js} +0 -0
  64. /package/react/{CEEUMvOM.js → Bxitmzur.js} +0 -0
  65. /package/react/{Bqe_56Ho.js → CO70kETi.js} +0 -0
  66. /package/react/{CssqM9iA.js → CR2MwRBM.js} +0 -0
  67. /package/react/{DV8H8PH6.js → CtCRzhKd.js} +0 -0
  68. /package/react/{BxS4S1Bm.js → CvLw8owR.js} +0 -0
  69. /package/react/{bYucjLbl.js → D5puLxf7.js} +0 -0
  70. /package/react/{BqRDSbh4.js → DtvJNH06.js} +0 -0
  71. /package/react/{DvZVbBR7.js → LDusNFdQ.js} +0 -0
  72. /package/react/{DYyT8DeU.js → zyOknCLQ.js} +0 -0
package/react/BXe4I1MJ.js DELETED
@@ -1,32 +0,0 @@
1
- import{B as e,C as t,Ct as r,F as o,N as n,Q as s,St as i,Tt as a,V as l,Y as c,_t as u,a as h,ct as d,dt as f,et as p,gt as m,i as y,it as g,lt as w,n as b,nt as _,ot as v,pt as R,rt as S,st as T,t as x,tt as E,u as A,vt as C,wt as I,xt as O,yt as P,z as q}from"./QPXxc9eb.js";import*as k from"react";import{jsx as N}from"react/jsx-runtime";var D=class extends w{constructor(t,r){super(),this.options=r,this.#e=t,this.#t=null,this.#r=e(),this.bindMethods(),this.setOptions(r)}#e;#o=void 0;#n=void 0;#s=void 0;#i;#a;#r;#t;#l;#c;#u;#h;#d;#f;#p=/* @__PURE__ */new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#o.addObserver(this),U(this.#o,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return L(this.#o,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return L(this.#o,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=/* @__PURE__ */new Set,this.#g(),this.#w(),this.#o.removeObserver(this)}setOptions(e){const t=this.options,r=this.#o;if(this.options=this.#e.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof E(this.options.enabled,this.#o))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#b(),this.#o.setOptions(this.options),t._defaulted&&!S(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#o,observer:this});const o=this.hasListeners();o&&M(this.#o,r,this.options,t)&&this.#m(),this.updateResult(),!o||this.#o===r&&E(this.options.enabled,this.#o)===E(t.enabled,this.#o)&&_(this.options.staleTime,this.#o)===_(t.staleTime,this.#o)||this.#_();const n=this.#v();!o||this.#o===r&&E(this.options.enabled,this.#o)===E(t.enabled,this.#o)&&n===this.#f||this.#R(n)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);var o;return o=r,S(this.getCurrentResult(),o)||(this.#s=r,this.#a=this.options,this.#i=this.#o.state),r}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#r.status||this.#r.reject(/* @__PURE__ */new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#o}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#m(e){this.#b();let t=this.#o.fetch(this.options,e);return e?.throwOnError||(t=t.catch(s)),t}#_(){this.#g();const e=_(this.options.staleTime,this.#o);if(l.isServer()||this.#s.isStale||!c(e))return;const t=v(this.#s.dataUpdatedAt,e)+1;this.#h=T.setTimeout(()=>{this.#s.isStale||this.updateResult()},t)}#v(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#o):this.options.refetchInterval)??!1}#R(e){this.#w(),this.#f=e,!l.isServer()&&!1!==E(this.options.enabled,this.#o)&&c(this.#f)&&0!==this.#f&&(this.#d=T.setInterval(()=>{(this.options.refetchIntervalInBackground||d.isFocused())&&this.#m()},this.#f))}#y(){this.#_(),this.#R(this.#v())}#g(){this.#h&&(T.clearTimeout(this.#h),this.#h=void 0)}#w(){this.#d&&(T.clearInterval(this.#d),this.#d=void 0)}createResult(t,r){const n=this.#o,s=this.options,i=this.#s,a=this.#i,l=this.#a,c=t!==n?t.state:this.#n,{state:u}=t;let h,d={...u},f=!1;if(r._optimisticResults){const e=this.hasListeners(),i=!e&&U(t,r),a=e&&M(t,n,r,s);(i||a)&&(d={...d,...o(u.data,t.options)}),"isRestoring"===r._optimisticResults&&(d.fetchStatus="idle")}let{error:m,errorUpdatedAt:y,status:g}=d;h=d.data;let w=!1;if(void 0!==r.placeholderData&&void 0===h&&"pending"===g){let e;i?.isPlaceholderData&&r.placeholderData===l?.placeholderData?(e=i.data,w=!0):e="function"==typeof r.placeholderData?r.placeholderData(this.#u?.state.data,this.#u):r.placeholderData,void 0!==e&&(g="success",h=p(i?.data,e,r),f=!0)}if(r.select&&void 0!==h&&!w)if(i&&h===a?.data&&r.select===this.#l)h=this.#c;else try{this.#l=r.select,h=r.select(h),h=p(i?.data,h,r),this.#c=h,this.#t=null}catch(x){this.#t=x}this.#t&&(m=this.#t,h=this.#c,y=Date.now(),g="error");const b="fetching"===d.fetchStatus,_="pending"===g,v="error"===g,R=_&&b,S=void 0!==h,T={status:g,fetchStatus:d.fetchStatus,isPending:_,isSuccess:"success"===g,isError:v,isInitialLoading:R,isLoading:R,data:h,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:y,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!_,isLoadingError:v&&!S,isPaused:"paused"===d.fetchStatus,isPlaceholderData:f,isRefetchError:v&&S,isStale:j(t,r),refetch:this.refetch,promise:this.#r,isEnabled:!1!==E(r.enabled,t)};if(this.options.experimental_prefetchInRender){const r=void 0!==T.data,o="error"===T.status&&!r,s=e=>{o?e.reject(T.error):r&&e.resolve(T.data)},i=()=>{s(this.#r=T.promise=e())},a=this.#r;switch(a.status){case"pending":t.queryHash===n.queryHash&&s(a);break;case"fulfilled":(o||T.data!==a.value)&&i();break;case"rejected":o&&T.error===a.reason||i()}}return T}updateResult(){const e=this.#s,t=this.createResult(this.#o,this.options);this.#i=this.#o.state,this.#a=this.options,void 0!==this.#i.data&&(this.#u=this.#o),S(t,e)||(this.#s=t,this.#S({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#p.size)return!0;const o=new Set(r??this.#p);return this.options.throwOnError&&o.add("error"),Object.keys(this.#s).some(t=>{const r=t;return this.#s[r]!==e[r]&&o.has(r)})})()}))}#b(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#o)return;const t=this.#o;this.#o=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#S(e){q.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#s)}),this.#e.getQueryCache().notify({query:this.#o,type:"observerResultsUpdated"})})}};function U(e,t){return function(e,t){return!1!==E(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&L(e,t,t.refetchOnMount)}function L(e,t,r){if(!1!==E(t.enabled,e)&&"static"!==_(t.staleTime,e)){const o="function"==typeof r?r(e):r;return"always"===o||!1!==o&&j(e,t)}return!1}function M(e,t,r,o){return(e!==t||!1===E(o.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&j(e,r)}function j(e,t){return!1!==E(t.enabled,e)&&e.isStaleByTime(_(t.staleTime,e))}var Q=k.createContext(!1);Q.Provider;var F=k.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),z=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function H(e,t,r){if("production"!==process.env.NODE_ENV&&("object"!=typeof e||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const o=k.useContext(Q),i=k.useContext(F),a=n(r),c=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(c);const u=a.getQueryCache().get(c.queryHash);"production"!==process.env.NODE_ENV&&(c.queryFn||console.error(`[${c.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),c._optimisticResults=o?"isRestoring":"optimistic",(e=>{if(e.suspense){const t=1e3,r=e=>"static"===e?e:Math.max(e??t,t),o=e.staleTime;e.staleTime="function"==typeof o?(...e)=>r(o(...e)):r(o),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(c),((e,t,r)=>{const o=r?.state.error&&"function"==typeof e.throwOnError?g(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||o)&&(t.isReset()||(e.retryOnMount=!1))})(c,i,u),(e=>{k.useEffect(()=>{e.clearReset()},[e])})(i);const h=!a.getQueryCache().get(c.queryHash),[d]=k.useState(()=>new t(a,c)),f=d.getOptimisticResult(c),p=!o&&!1!==e.subscribed;if(k.useSyncExternalStore(k.useCallback(e=>{const t=p?d.subscribe(q.batchCalls(e)):s;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),k.useEffect(()=>{d.setOptions(c)},[c,d]),((e,t)=>e?.suspense&&t.isPending)(c,f))throw z(c,d,i);if((({result:e,errorResetBoundary:t,throwOnError:r,query:o,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&o&&(n&&void 0===e.data||g(r,[e.error,o])))({result:f,errorResetBoundary:i,throwOnError:c.throwOnError,query:u,suspense:c.suspense}))throw f.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(c,f),c.experimental_prefetchInRender&&!l.isServer()&&((e,t)=>e.isLoading&&e.isFetching&&!t)(f,o)&&(h?z(c,d,i):u?.promise)?.catch(s).finally(()=>{d.updateResult()}),c.notifyOnChangeProps?f:d.trackResult(f)}function B(e,t){return H(e,D,t)}function W(e,t){for(var r in e)if("__source"!==r&&!(r in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function V(e,t){this.props=e,this.context=t}(V.prototype=new a).isPureReactComponent=!0,V.prototype.shouldComponentUpdate=function(e,t){return W(this.props,e)||W(this.state,t)};var Z=I.__b;I.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Z&&Z(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var $=I.__e;I.__e=function(e,t,r,o){if(e.then)for(var n,s=t;s=s.__;)if((n=s.__c)&&n.__c)return t.__e??(t.__e=r.__e,t.__k=r.__k),n.__c(e,t);$(e,t,r,o)};var G=I.unmount;function J(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=function(e,t){for(var r in t)e[r]=t[r];return e}({},e)).__c&&(e.__c.__P===r&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return J(e,t,r)})),e}function Y(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Y(e,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function K(){this.__u=0,this.o=null,this.__b=null}function X(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function ee(e){var t,r,o,n=null;function s(s){if(t||(t=e()).then(function(e){e&&(n=e.default||e),o=!0},function(e){r=e,o=!0}),r)throw r;if(!o)throw t;return n?i(n,s):null}return s.displayName="Lazy",s.__f=!0,s}function te(){this.i=null,this.l=null}I.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),G&&G(e)},(K.prototype=new a).__c=function(e,t){var r=t.__c,o=this;o.o??=[],o.o.push(r);var n=X(o.__v),s=!1,i=function(){s||o.__z||(s=!0,r.__R=null,n?n(l):l())};r.__R=i;var a=r.__P;r.__P=null;var l=function(){if(! --o.__u){if(o.state.__a){var e=o.state.__a;o.__v.__k[0]=Y(e,e.__c.__P,e.__c.__O)}var t;for(o.setState({__a:o.__b=null});t=o.o.pop();)t.__P=a,t.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(i,i)},K.prototype.componentWillUnmount=function(){this.o=[]},K.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var o=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=J(this.__b,o,n.__O=n.__P)}this.__b=null}var s=t.__a&&i(r,null,e.fallback);return s&&(s.__u&=-33),[i(r,null,t.__a?null:e.children),s]};var re=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};function oe(e){return this.getChildContext=function(){return e.context},e.children}function ne(e){var t=this,r=e.h;if(t.componentWillUnmount=function(){C(null,t.v),t.v=null,t.h=null},t.h&&t.h!==r&&t.componentWillUnmount(),!t.v){for(var o=t.__v;null!==o&&!o.__m&&null!==o.__;)o=o.__;t.h=r,t.v={nodeType:1,parentNode:r,childNodes:[],__k:{__m:o.__m},contains:function(){return!0},namespaceURI:r.namespaceURI,insertBefore:function(e,r){this.childNodes.push(e),t.h.insertBefore(e,r)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}C(i(oe,{context:t.context},e.__v),t.v)}function se(e,t){var r=i(ne,{__v:e,h:t});return r.containerInfo=t,r}(te.prototype=new a).__a=function(e){var t=this,r=X(t.__v),o=t.l.get(e);return o[0]++,function(n){var s=function(){t.props.revealOrder?(o.push(n),re(t,e,o)):n()};r?r(s):s()}},te.prototype.render=function(e){this.i=null,this.l=/* @__PURE__ */new Map;var t=P(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},te.prototype.componentDidUpdate=te.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){re(e,r,t)})};var ie="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,ae=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,le=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,ce=/[A-Z0-9]/g,ue="undefined"!=typeof document,he=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};a.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(a.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var de=I.event;I.event=function(e){return de&&(e=de(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var fe={configurable:!0,get:function(){return this.class}},pe=I.vnode;I.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,r=e.type,o={},n=-1==r.indexOf("-");for(var s in t){var i=t[s];if(!("value"===s&&"defaultValue"in t&&null==i||ue&&"children"===s&&"noscript"===r||"class"===s||"className"===s)){var a=s.toLowerCase();"defaultValue"===s&&"value"in t&&null==t.value?s="value":"download"===s&&!0===i?i="":"translate"===a&&"no"===i?i=!1:"o"===a[0]&&"n"===a[1]?"ondoubleclick"===a?s="ondblclick":"onchange"!==a||"input"!==r&&"textarea"!==r||he(t.type)?"onfocus"===a?s="onfocusin":"onblur"===a?s="onfocusout":le.test(s)&&(s=a):a=s="oninput":n&&ae.test(s)?s=s.replace(ce,"-$&").toLowerCase():null===i&&(i=void 0),"oninput"===a&&o[s=a]&&(s="oninputCapture"),o[s]=i}}"select"==r&&(o.multiple&&Array.isArray(o.value)&&(o.value=P(t.children).forEach(function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)})),null!=o.defaultValue&&(o.value=P(t.children).forEach(function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",fe)):t.className&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=ie,pe&&pe(e)};var me=I.__r;I.__r=function(e){me&&me(e),e.__c};var ye=I.diffed;I.diffed=function(e){ye&&ye(e);var t=e.props,r=e.__e;null!=r&&"textarea"===e.type&&"value"in t&&t.value!==r.value&&(r.value=null==t.value?"":t.value)};var ge=class extends Error{response;request;options;constructor(e,t,r){const o=`${e.status||0===e.status?e.status:""} ${e.statusText??""}`.trim();super(`Request failed with ${o?`status code ${o}`:"an unknown error"}: ${t.method} ${t.url}`),this.name="HTTPError",this.response=e,this.request=t,this.options=r}},we=class extends Error{name="NonError";value;constructor(e){let t="Non-error value was thrown";try{"string"==typeof e?t=e:e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message&&(t=e.message)}catch{}super(t),this.value=e}},be=class extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const t=e?.cause?e.cause instanceof Error?e.cause:new we(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",t?{cause:t}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}},_e=(()=>{let e=!1,t=!1;const r="function"==typeof globalThis.ReadableStream,o="function"==typeof globalThis.Request;if(r&&o)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(n){if(n instanceof Error&&"unsupported BodyInit type"===n.message)return!1;throw n}return e&&!t})(),ve="function"==typeof globalThis.AbortController,Re="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,Se="function"==typeof globalThis.ReadableStream,Te="function"==typeof globalThis.FormData,xe=["get","post","put","patch","head","delete"],Ee={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},Ae=(new TextEncoder).encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,Ce=Symbol("stop"),Ie=class{options;constructor(e){this.options=e}},Oe=e=>new Ie(e),Pe={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},qe={next:!0},ke={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},Ne=(e,t,r)=>{let o,n=0;return e.pipeThrough(new TransformStream({transform(e,s){if(s.enqueue(e),o){n+=o.byteLength;let e=0===t?0:n/t;e>=1&&(e=1-Number.EPSILON),r?.({percent:e,totalBytes:Math.max(t,n),transferredBytes:n},o)}o=e},flush(){o&&(n+=o.byteLength,r?.({percent:1,totalBytes:Math.max(t,n),transferredBytes:n},o))}}))},De=e=>null!==e&&"object"==typeof e,Ue=(...e)=>{for(const t of e)if((!De(t)||Array.isArray(t))&&void 0!==t)throw new TypeError("The `options` argument must be an object");return Fe({},...e)},Le=(e={},t={})=>{const r=new globalThis.Headers(e),o=t instanceof globalThis.Headers,n=new globalThis.Headers(t);for(const[s,i]of n.entries())o&&"undefined"===i||void 0===i?r.delete(s):r.set(s,i);return r};function Me(e,t,r){return Object.hasOwn(t,r)&&void 0===t[r]?[]:Fe(e[r]??[],t[r]??[])}var je=(e={},t={})=>({beforeRequest:Me(e,t,"beforeRequest"),beforeRetry:Me(e,t,"beforeRetry"),afterResponse:Me(e,t,"afterResponse"),beforeError:Me(e,t,"beforeError")}),Qe=(e,t)=>{const r=new URLSearchParams;for(const o of[e,t])if(void 0!==o)if(o instanceof URLSearchParams)for(const[e,t]of o.entries())r.append(e,t);else if(Array.isArray(o))for(const e of o){if(!Array.isArray(e)||2!==e.length)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(e[0]),String(e[1]))}else if(De(o))for(const[e,t]of Object.entries(o))void 0!==t&&r.append(e,String(t));else{const e=new URLSearchParams(o);for(const[t,o]of e.entries())r.append(t,o)}return r},Fe=(...e)=>{let t,r={},o={},n={};const s=[];for(const i of e)if(Array.isArray(i))Array.isArray(r)||(r=[]),r=[...r,...i];else if(De(i)){for(let[e,o]of Object.entries(i))if("signal"===e&&o instanceof globalThis.AbortSignal)s.push(o);else if("context"!==e)"searchParams"!==e?(De(o)&&e in r&&(o=Fe(r[e],o)),r={...r,[e]:o}):t=null==o?void 0:void 0===t?o:Qe(t,o);else{if(null!=o&&(!De(o)||Array.isArray(o)))throw new TypeError("The `context` option must be an object");r={...r,context:null==o?{}:{...r.context,...o}}}De(i.hooks)&&(n=je(n,i.hooks),r.hooks=n),De(i.headers)&&(o=Le(o,i.headers),r.headers=o)}return void 0!==t&&(r.searchParams=t),s.length>0&&(1===s.length?r.signal=s[0]:r.signal=Re?AbortSignal.any(s):s.at(-1)),r},ze=e=>xe.includes(e)?e.toUpperCase():e,He={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},Be=(e={})=>{if("number"==typeof e)return{...He,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.methods&&=e.methods.map(e=>e.toLowerCase()),e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");const t=Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e));return{...He,...t}},We=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}},Ve=class e{static create(t,r){const o=new e(t,r),n=o.#T(async()=>{if("number"==typeof o.#x.timeout&&o.#x.timeout>2147483647)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let e=await o.#E();for(const r of o.#x.hooks.afterResponse){const n=o.#A(e.clone());let s;try{s=await r(o.request,o.#C(),n,{retryCount:o.#I})}catch(t){throw o.#O(n),o.#O(e),t}if(s instanceof Ie)throw o.#O(n),o.#O(e),new be(s.options);const i=s instanceof globalThis.Response?s:e;n!==i&&o.#O(n),e!==i&&o.#O(e),e=i}if(o.#A(e),!e.ok&&("function"==typeof o.#x.throwHttpErrors?o.#x.throwHttpErrors(e.status):o.#x.throwHttpErrors)){let t=new ge(e,o.request,o.#C());for(const e of o.#x.hooks.beforeError)t=await e(t,{retryCount:o.#I});throw t}if(o.#x.onDownloadProgress){if("function"!=typeof o.#x.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!Se)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const t=e.clone();return o.#O(e),((e,t)=>{if(!e.body)return e;if(204===e.status)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});const r=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(Ne(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})})(t,o.#x.onDownloadProgress)}return e}).finally(()=>{const e=o.#P;o.#q(e?.body??void 0),o.#q(o.request.body??void 0)});for(const[e,s]of Object.entries(Ee))"bytes"===e&&"function"!=typeof globalThis.Response?.prototype?.bytes||(n[e]=async()=>{o.request.headers.set("accept",o.request.headers.get("accept")||s);const t=await n;if("json"===e){if(204===t.status)return"";const e=await t.text();return""===e?"":r.parseJson?r.parseJson(e):JSON.parse(e)}return t[e]()});return n}static#k(e){return!e||"object"!=typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}request;#N;#I=0;#D;#x;#P;#U;#L;constructor(t,r={}){if(this.#D=t,this.#x={...r,headers:Le(this.#D.headers,r.headers),hooks:je({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:ze(r.method??this.#D.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:Be(r.retry),throwHttpErrors:r.throwHttpErrors??!0,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis),context:r.context??{}},"string"!=typeof this.#D&&!(this.#D instanceof URL||this.#D instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#x.prefixUrl&&"string"==typeof this.#D){if(this.#D.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#x.prefixUrl.endsWith("/")||(this.#x.prefixUrl+="/"),this.#D=this.#x.prefixUrl+this.#D}ve&&Re&&(this.#U=this.#x.signal??this.#D.signal,this.#N=new globalThis.AbortController,this.#x.signal=this.#U?AbortSignal.any([this.#U,this.#N.signal]):this.#N.signal),_e&&(this.#x.duplex="half"),void 0!==this.#x.json&&(this.#x.body=this.#x.stringifyJson?.(this.#x.json)??JSON.stringify(this.#x.json),this.#x.headers.set("content-type",this.#x.headers.get("content-type")??"application/json"));const o=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(this.#D instanceof globalThis.Request&&(Te&&this.#x.body instanceof globalThis.FormData||this.#x.body instanceof URLSearchParams)&&!o&&this.#x.headers.delete("content-type"),this.request=new globalThis.Request(this.#D,this.#x),void 0!==(n=this.#x.searchParams)&&(Array.isArray(n)?n.length>0:n instanceof URLSearchParams?n.size>0:"object"==typeof n?Object.keys(n).length>0:"string"==typeof n?n.trim().length>0:Boolean(n))){const t="?"+("string"==typeof this.#x.searchParams?this.#x.searchParams.replace(/^\?/,""):new URLSearchParams(e.#k(this.#x.searchParams)).toString()),r=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,t);this.request=new globalThis.Request(r,this.#x)}var n;if(this.#x.onUploadProgress){if("function"!=typeof this.#x.onUploadProgress)throw new TypeError("The `onUploadProgress` option must be a function");if(!_e)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#M(this.request,this.#x.body??void 0)}}#j(){const e=this.#x.retry.delay(this.#I);let t=e;!0===this.#x.retry.jitter?t=Math.random()*e:"function"==typeof this.#x.retry.jitter&&(t=this.#x.retry.jitter(e),(!Number.isFinite(t)||t<0)&&(t=e));const r=this.#x.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(r,t)}async#Q(e){if(this.#I++,this.#I>this.#x.retry.limit)throw e;const t=e instanceof Error?e:new we(e);if(t instanceof be)return t.customDelay??this.#j();if(!this.#x.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(void 0!==this.#x.retry.shouldRetry){const r=await this.#x.retry.shouldRetry({error:t,retryCount:this.#I});if(!1===r)throw e;if(!0===r)return this.#j()}if(function(e){return e instanceof We||e?.name===We.name}(e)&&!this.#x.retry.retryOnTimeout)throw e;if(function(e){return e instanceof ge||e?.name===ge.name}(e)){if(!this.#x.retry.statusCodes.includes(e.response.status))throw e;const t=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(t&&this.#x.retry.afterStatusCodes.includes(e.response.status)){let e=1e3*Number(t);Number.isNaN(e)?e=Date.parse(t)-Date.now():e>=Date.parse("2024-01-01")&&(e-=Date.now());const r=this.#x.retry.maxRetryAfter??e;return e<r?e:r}if(413===e.response.status)throw e}return this.#j()}#A(e){return this.#x.parseJson&&(e.json=async()=>this.#x.parseJson(await e.text())),e}#q(e){e&&e.cancel().catch(()=>{})}#O(e){this.#q(e.body??void 0)}async#T(e){try{return await e()}catch(t){const r=Math.min(await this.#Q(t),2147483647);if(this.#I<1)throw t;if(await async function(e,{signal:t}){return new Promise((r,o)=>{function n(){clearTimeout(s),o(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",n,{once:!0}));const s=setTimeout(()=>{t?.removeEventListener("abort",n),r()},e)})}(r,this.#U?{signal:this.#U}:{}),t instanceof be&&t.customRequest){const e=this.#x.signal?new globalThis.Request(t.customRequest,{signal:this.#x.signal}):new globalThis.Request(t.customRequest);this.#F(e)}for(const e of this.#x.hooks.beforeRetry){const r=await e({request:this.request,options:this.#C(),error:t,retryCount:this.#I});if(r instanceof globalThis.Request){this.#F(r);break}if(r instanceof globalThis.Response)return r;if(r===Ce)return}return this.#T(e)}}async#E(){this.#N?.signal.aborted&&(this.#N=new globalThis.AbortController,this.#x.signal=this.#U?AbortSignal.any([this.#U,this.#N.signal]):this.#N.signal,this.request=new globalThis.Request(this.request,{signal:this.#x.signal}));for(const t of this.#x.hooks.beforeRequest){const e=await t(this.request,this.#C(),{retryCount:this.#I});if(e instanceof Response)return e;if(e instanceof globalThis.Request){this.#F(e);break}}const e=((e,t)=>{const r={};for(const o in t)Object.hasOwn(t,o)&&(o in ke||o in Pe||o in e&&!(o in qe)||(r[o]=t[o]));return r})(this.request,this.#x);return this.#P=this.request,this.request=this.#P.clone(),!1===this.#x.timeout?this.#x.fetch(this.#P,e):async function(e,t,r,o){return new Promise((n,s)=>{const i=setTimeout(()=>{r&&r.abort(),s(new We(e))},o.timeout);o.fetch(e,t).then(n).catch(s).then(()=>{clearTimeout(i)})})}(this.#P,e,this.#N,this.#x)}#C(){if(!this.#L){const{hooks:e,...t}=this.#x;this.#L=Object.freeze(t)}return this.#L}#F(e){this.#L=void 0,this.request=this.#M(e)}#M(e,t){return this.#x.onUploadProgress&&e.body?((e,t,r)=>{if(!e.body)return e;const o=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[r,o]of e)t+=Ae,t+=(new TextEncoder).encode(`Content-Disposition: form-data; name="${r}"`).length,t+="string"==typeof o?(new TextEncoder).encode(o).length:o.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if("string"==typeof e)return(new TextEncoder).encode(e).length;if(e instanceof URLSearchParams)return(new TextEncoder).encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if("object"==typeof e&&null!==e)try{const t=JSON.stringify(e);return(new TextEncoder).encode(t).length}catch{return 0}return 0})(r??e.body);return new Request(e,{duplex:"half",body:Ne(e.body,o,t)})})(e,this.#x.onUploadProgress,t??this.#x.body??void 0):e}},Ze=e=>{const t=(t,r)=>Ve.create(t,Ue(e,r));for(const r of xe)t[r]=(t,o)=>Ve.create(t,Ue(e,o,{method:r}));return t.create=e=>Ze(Ue(e)),t.extend=t=>("function"==typeof t&&(t=t(e??{})),Ze(Ue(e,t))),t.stop=Ce,t.retry=Oe,t},$e=Ze();function Ge({title:e,children:t}){/* @__PURE__ */
2
- return h("div",{className:"mx-auto mt-24 w-fit max-w-xl space-y-8",children:[/* @__PURE__ */h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"mx-auto h-64 w-fit",width:"800",height:"469.317",viewBox:"0 0 800 469.317",role:"img","aria-label":"Error illustration",children:/* @__PURE__ */h("g",{transform:"translate(-443.142 -257.876)",children:[
3
- /* @__PURE__ */h("path",{d:"M898.247,664.1H371.155a30.276,30.276,0,0,1-30.241-30.241V352.525a30.276,30.276,0,0,1,30.241-30.241H898.247a30.276,30.276,0,0,1,30.241,30.241V633.862A30.276,30.276,0,0,1,898.247,664.1Z",transform:"translate(308.867 25.517)",fill:"#fff"}),
4
- /* @__PURE__ */h("path",{d:"M557.334,341.82H30.241A30.276,30.276,0,0,1,0,311.578V30.241A30.276,30.276,0,0,1,30.241,0H557.334a30.276,30.276,0,0,1,30.241,30.241V311.578A30.276,30.276,0,0,1,557.334,341.82ZM30.241,1.833A28.441,28.441,0,0,0,1.833,30.241V311.578a28.441,28.441,0,0,0,28.409,28.409H557.334a28.441,28.441,0,0,0,28.409-28.409V30.241A28.441,28.441,0,0,0,557.334,1.833Z",transform:"matrix(0.999, -0.035, 0.035, 0.999, 643.995, 358.158)",fill:"#d6d6e3"}),
5
- /* @__PURE__ */h("path",{d:"M754.171,630.2l-509.5-135.058a30.276,30.276,0,0,1-21.483-36.981L295.28,186.212a30.276,30.276,0,0,1,36.981-21.483l509.5,135.058a30.276,30.276,0,0,1,21.483,36.981L791.152,608.712A30.276,30.276,0,0,1,754.171,630.2Z",transform:"translate(220.958 94.156)",fill:"#f2f2f2"}),
6
- /* @__PURE__ */h("path",{d:"M775.247,705.1H248.155a30.276,30.276,0,0,1-30.241-30.241V393.525a30.276,30.276,0,0,1,30.241-30.241H775.247a30.276,30.276,0,0,1,30.241,30.242V674.862A30.275,30.275,0,0,1,775.247,705.1Z",transform:"translate(319.149 22.09)",fill:"#fff"}),
7
- /* @__PURE__ */h("path",{d:"M638.653,701.841H298.272c-.426,0-.852-.009-1.272-.033l160.985-90.663c3.065-1.762,9.943-2.382,15.361-1.385a13.912,13.912,0,0,1,4.26,1.385l108.041,60.842,5.176,2.911Z",transform:"translate(312.538 1.526)",fill:"#e6e6e6"}),
8
- /* @__PURE__ */h("path",{d:"M760.145,704.279h-294.4l57.049-26.943L526.9,675.4l74.341-35.111c4.874-2.3,16.6-2.445,22.328-.434q.577.206,1.071.434Z",transform:"translate(298.432 -0.912)",fill:"#e6e6e6"}),
9
- /* @__PURE__ */h("path",{d:"M248.322,365.284a28.441,28.441,0,0,0-28.409,28.409V675.03a28.441,28.441,0,0,0,28.409,28.409H775.415a28.441,28.441,0,0,0,28.409-28.409V393.693a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(318.982 21.923)",fill:"#3f3d56"}),
10
- /* @__PURE__ */h("path",{d:"M777.254,685.116H250.161a8.257,8.257,0,0,1-8.248-8.248V395.532a8.257,8.257,0,0,1,8.248-8.248H777.254a8.257,8.257,0,0,1,8.248,8.248V676.869a8.257,8.257,0,0,1-8.248,8.248Zm-527.092-296a6.422,6.422,0,0,0-6.415,6.415V676.869a6.422,6.422,0,0,0,6.415,6.415H777.254a6.422,6.422,0,0,0,6.415-6.415V395.532a6.422,6.422,0,0,0-6.415-6.415Z",transform:"translate(317.143 20.083)",fill:"#ccc"}),
11
- /* @__PURE__ */h("ellipse",{cx:"71.849",cy:"89.934",rx:"71.849",ry:"89.934",transform:"translate(928.82 428.806)",fill:"#f2f2f2"}),
12
- /* @__PURE__ */h("path",{d:"M505.77,325.365h.2l3.553,203.7h-7.5Z",transform:"translate(495.097 175.29)",fill:"#ccc"}),
13
- /* @__PURE__ */h("path",{d:"M736.239,636.154h0a1.776,1.776,0,0,1-.744,2.4l-10.3,5.425-1.655-3.144,10.3-5.425A1.776,1.776,0,0,1,736.239,636.154Z",transform:"translate(276.882 -0.641)",fill:"#ccc"}),
14
- /* @__PURE__ */h("ellipse",{cx:"71.849",cy:"89.934",rx:"71.849",ry:"89.934",transform:"translate(722.256 428.806)",fill:"#f2f2f2"}),
15
- /* @__PURE__ */h("path",{d:"M510.532,627.307h0a1.777,1.777,0,0,0-2.4-.744l-7.194,3.788-2.464-141.27h-.2l-3.75,203.7h7.5l-1.02-58.456,8.78-4.622A1.777,1.777,0,0,0,510.532,627.307Z",transform:"translate(296.026 11.574)",fill:"#ccc"}),
16
- /* @__PURE__ */h("path",{d:"M626.318,603.854a2.25,2.25,0,0,0-3.04-.943l-9.116,4.8-3.122-179h-.25l-4.752,258.115h9.5l-1.292-74.07,11.125-5.857a2.251,2.251,0,0,0,.943-3.04Z",transform:"translate(286.704 16.621)",fill:"#3f3d56"}),
17
- /* @__PURE__ */h("path",{d:"M777.247,703.1H250.155a30.276,30.276,0,0,1-30.241-30.241V391.525a30.276,30.276,0,0,1,30.241-30.241H777.247a30.276,30.276,0,0,1,30.241,30.241V672.862A30.276,30.276,0,0,1,777.247,703.1Z",transform:"translate(318.982 22.257)",fill:"#fff"}),
18
- /* @__PURE__ */h("path",{d:"M671.188,708.113h-370.8c-.464,0-.928-.01-1.386-.036l175.372-98.766c3.339-1.919,10.831-2.595,16.734-1.509a15.16,15.16,0,0,1,4.641,1.509l117.7,66.28,5.639,3.172Z",transform:"translate(288.046 16.168)",fill:"#f2f2f2"}),
19
- /* @__PURE__ */h("path",{d:"M788.457,708.163H467.743l62.148-29.351,4.472-2.114,80.984-38.25c5.309-2.507,18.082-2.663,24.324-.473q.629.224,1.166.473Z",transform:"translate(287.761 16.118)",fill:"#f2f2f2"}),
20
- /* @__PURE__ */h("path",{d:"M777.247,703.1H250.155a30.276,30.276,0,0,1-30.241-30.241V391.525a30.276,30.276,0,0,1,30.241-30.241H777.247a30.276,30.276,0,0,1,30.241,30.241V672.862A30.276,30.276,0,0,1,777.247,703.1ZM250.155,363.117a28.441,28.441,0,0,0-28.409,28.409V672.862a28.441,28.441,0,0,0,28.409,28.409H777.247a28.441,28.441,0,0,0,28.409-28.409V391.525a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(318.982 22.257)",fill:"#3f3d56"}),
21
- /* @__PURE__ */h("g",{transform:"translate(696.754 297.373)",children:[
22
- /* @__PURE__ */h("ellipse",{cx:"61.798",cy:"61.798",rx:"61.798",ry:"61.798",transform:"translate(215.662 36.955)",fill:"#ff6584"}),
23
- /* @__PURE__ */h("ellipse",{cx:"78.271",cy:"97.971",rx:"78.271",ry:"97.971",transform:"translate(225.025 127.808)",fill:"#e6e6e6"}),
24
- /* @__PURE__ */h("path",{d:"M508.105,323.365h.215l3.87,221.909h-8.171Z",transform:"translate(-204.593 -117.286)",fill:"#ccc"}),
25
- /* @__PURE__ */h("path",{d:"M739.374,634.239h0a1.935,1.935,0,0,1-.811,2.614l-11.226,5.91-1.8-3.425,11.226-5.91A1.935,1.935,0,0,1,739.374,634.239Z",transform:"translate(-422.513 -281.249)",fill:"#ccc"}),
26
- /* @__PURE__ */h("ellipse",{cx:"78.271",cy:"97.971",rx:"78.271",ry:"97.971",transform:"translate(0 127.808)",fill:"#e6e6e6"}),
27
- /* @__PURE__ */h("path",{d:"M513.962,637.661h0a1.936,1.936,0,0,0-2.614-.811l-7.837,4.126-2.684-153.9h-.215l-4.085,221.91H504.7l-1.111-63.68,9.565-5.036A1.936,1.936,0,0,0,513.962,637.661Z",transform:"translate(-422.126 -281.002)",fill:"#ccc"}),
28
- /* @__PURE__ */h("path",{d:"M612.666,280.653c54.774,0,99.294,103.207,99.294,171.768s-44.4,124.14-99.177,124.14-99.177-55.579-99.177-124.14S557.892,280.653,612.666,280.653Z",transform:"translate(-422.155 -280.653)",fill:"currentColor"}),
29
- /* @__PURE__ */h("path",{d:"M630.131,617.508a2.452,2.452,0,0,0-3.312-1.027l-9.931,5.228-3.4-195h-.272L608.039,707.89h10.353l-1.408-80.69,12.119-6.38A2.452,2.452,0,0,0,630.131,617.508Z",transform:"translate(-422.315 -280.9)",fill:"#3f3d56"})]})]})}),/* @__PURE__ */h("div",{className:"space-y-4",children:[/* @__PURE__ */h("h4",{className:"text-foreground text-center text-lg font-semibold",children:e}),/* @__PURE__ */h("p",{className:"text-muted-foreground text-center",children:t})]})]})}function Je({organizationId:e,errorType:r}){/* @__PURE__ */
30
- return h(Ge,"custom-auth-invalid"===r?{title:"Invalid input",children:"Custom auth mode requires uid, fname, lname. For more details please contact Qrati support."}:{title:"page-not-registered"===r?"Page not registered":"Something went wrong",children:["If you are an admin of this organization, please add the current page URL in Allowed URLs under"," ",
31
- /* @__PURE__ */h("a",{className:"font-medium text-blue-500",href:t.ORGANIZATION_SETTINGS(e),target:"_blank",rel:"noreferrer",children:"Organization Settings"})," ","⇨"," ",
32
- /* @__PURE__ */h("a",{className:"font-medium text-blue-500",href:t.ORGANIZATION_SETTINGS_INTEGRATION(e),target:"_blank",rel:"noreferrer",children:"Integration Settings"}),". For more details please contact Qrati support."]})}var Ye=e=>({google:"Google",apple:"Apple"}[e]||e.charAt(0).toUpperCase()+e.slice(1)),Ke=(e,t=0)=>{let r=t^e.length,o=0;const n=e.length;for(;o+3<n;){let t=255&e.charCodeAt(o)|(255&e.charCodeAt(o+1))<<8|(255&e.charCodeAt(o+2))<<16|(255&e.charCodeAt(o+3))<<24;t=Math.imul(t,3432918353),t=t<<15|t>>>17,t=Math.imul(t,461845907),r^=t,r=r<<13|r>>>19,r=Math.imul(r,5)+3864292196,o+=4}let s=0;switch(n-o){case 3:s^=(255&e.charCodeAt(o+2))<<16;case 2:s^=(255&e.charCodeAt(o+1))<<8;case 1:s^=255&e.charCodeAt(o),s=Math.imul(s,3432918353),s=s<<15|s>>>17,s=Math.imul(s,461845907),r^=s}return r^=r>>>16,r=Math.imul(r,2246822507),r^=r>>>13,r=Math.imul(r,3266489909),r^=r>>>16,r>>>=0,r.toString(16).padStart(8,"0")},Xe=async e=>{try{return await e()}catch{return null}},et=e=>{if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(et).join(",")}]`;const t=Object.keys(e).sort(),r=[];for(const o of t){const t=e[o];void 0!==t&&r.push(`${et(o)}:${et(t)}`)}return`{${r.join(",")}}`},tt=async({debug:e=!1}={})=>{const t=await Xe(()=>it()),r=await Xe(()=>new Intl.NumberFormat(window.navigator.languages?.[0]||"en").resolvedOptions().numberingSystem),o=window.navigator.languages?Array.from(window.navigator.languages).join(","):window.navigator.language||null,n=Intl.DateTimeFormat().resolvedOptions().timeZone,s=/* @__PURE__ */(new Date).getTimezoneOffset(),i=window.matchMedia("(prefers-reduced-motion: reduce)").matches?"reduce":"no-preference",a=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",l=window.matchMedia("(forced-colors: active)").matches?"active":null,{pixelDepth:c,colorDepth:u}=window.screen,h="ontouchstart"in window||window.navigator.maxTouchPoints>0,d=await Xe(()=>rt(e)),f=await Xe(()=>ot()),p=await Xe(()=>nt(e)),m=await Xe(()=>st(e)),y=window.screen.width&&window.screen.height?(window.screen.width/window.screen.height).toFixed(4):null,g={vendor:window.navigator.vendor||null,platform:window.navigator.platform||null,fonts:t,numberingSystem:r,languages:o,timezone:n,timezoneOffset:s,reducedMotion:i,colorScheme:a,hardwareConcurrency:window.navigator.hardwareConcurrency||null,deviceMemory:window.navigator.deviceMemory||null,forcedColors:l,pixelDepth:c,colorDepth:u,touchSupport:h,canvasID:d,webglID:f,webgpuID:p,audioID:m},w={aspectRatio:y,width:window.screen.width,height:window.screen.height,maxTouchPoints:window.navigator.maxTouchPoints};return(!0===navigator.userAgentData?.mobile||/Mobi|Android|iPhone|iPad|iPod|webOS|BlackBerry|Windows Phone/i.test(navigator.userAgent)||navigator.maxTouchPoints>0&&matchMedia("(pointer:coarse)").matches&&innerWidth<=1024)&&Object.assign(g,w),{fingerprint:Ke(et(g)),...g}},rt=async e=>{const t=document.createElement("canvas");t.width=280,t.height=100;const r=t.getContext("2d"),o=r.createLinearGradient(0,0,280,100);return o.addColorStop(0,"#f60"),o.addColorStop(.4,"#09f"),o.addColorStop(.7,"#f09"),o.addColorStop(1,"#0f9"),r.fillStyle=o,r.fillRect(0,0,280,100),r.font='18px "Arial","Helvetica","DejaVu Sans",sans-serif',r.fillStyle="#000",r.textBaseline="alphabetic",r.fillText("Fingerprint ¼½¾™©®∆π∑€¶§",12,45),r.font='bold 22px "Georgia","Times New Roman",serif',r.fillStyle="#222",r.fillText("🦊🐱🚀 2026",12,78),r.globalAlpha=.7,r.fillStyle="rgba(255, 80, 0, 0.35)",r.fillRect(180,20,80,60),r.beginPath(),r.arc(220,50,32,0,2*Math.PI),r.strokeStyle="#fff",r.lineWidth=4,r.stroke(),r.beginPath(),r.moveTo(30,85),r.quadraticCurveTo(140,20,240,85),r.strokeStyle="#00f",r.lineWidth=3,r.stroke(),e&&(t.style.border="1px solid #444",document.body.appendChild(t)),Ke(t.toDataURL("image/png"))},ot=()=>{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl"),r=t.getExtension("WEBGL_debug_renderer_info");return Ke(et({vendor:r?t.getParameter(r.UNMASKED_VENDOR_WEBGL):t.getParameter(t.VENDOR),renderer:r?t.getParameter(r.UNMASKED_RENDERER_WEBGL):t.getParameter(t.RENDERER)}))},nt=async e=>{const t=await navigator.gpu.requestAdapter({powerPreference:"high-performance"}),r={vendor:t.info?.vendor??"",architecture:t.info?.architecture??"",description:t.info?.description??"",features:Array.from(t.features).sort(),limits:Array.from(t.limits).sort()};if(e){const e=document.createElement("pre");e.style.margin="10px 0",e.style.padding="10px",e.style.border="1px solid #444",e.style.background="#111",e.style.color="#0f8",e.style.fontFamily="monospace",e.textContent=`WebGPU:\n${JSON.stringify(r,null,2)}`,document.body.appendChild(e)}return Ke(et(r))},st=async e=>{const t=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,6e3,44100),r=t.createOscillator();r.type="sawtooth",r.frequency.value=8800;const o=t.createDynamicsCompressor();o.threshold.value=-48,o.knee.value=30,o.ratio.value=14,o.attack.value=0,o.release.value=.3;const n=t.createGain();n.gain.value=.4,r.connect(o),o.connect(n),n.connect(t.destination),r.start(0);const s=(await t.startRendering()).getChannelData(0);let i=0,a=0;for(let c=3e3;c<5800;c+=2){const e=s[c];i=31*i+Math.floor(1e5*(e+1))|0,a=Math.imul(a^Math.floor(98765*e),2246822519)}const l=i>>>0^a>>>0;if(e){const e=document.createElement("canvas");e.width=500,e.height=120,e.style.border="1px solid #444",e.style.margin="10px 0",e.title="Audio buffer snippet (4500–5000 samples)";const t=e.getContext("2d");t.fillStyle="#111",t.fillRect(0,0,e.width,e.height),t.font="14px monospace",t.fillStyle="#0f8",t.textAlign="left",t.fillText("AudioID",10,20),t.strokeStyle="#0f8",t.lineWidth=1.5,t.beginPath();const r=Array.from(s.slice(4500,5e3)),o=e.width/r.length;for(let n=0;n<r.length;n++){const s=n*o,i=(r[n]+1)/2*e.height;0===n?t.moveTo(s,i):t.lineTo(s,i)}t.stroke(),document.body.appendChild(e)}return Ke(l.toString(16))},it=()=>{const e=["monospace","serif","sans-serif"],t=["Arial","Helvetica","Verdana","Trebuchet MS","Comic Sans MS","Georgia","Times New Roman","Courier New","Segoe UI","Roboto","Open Sans","Noto Sans","system-ui","-apple-system","BlinkMacSystemFont"],r=document.createElement("span");r.style.fontSize="72px",r.style.position="absolute",r.style.visibility="hidden",r.style.whiteSpace="nowrap",r.textContent="mmmmmmmmmwwwwwww",document.body.appendChild(r);const o={};for(const s of e)r.style.fontFamily=s,o[s]=r.offsetWidth;const n=[];for(const s of t){let t=!1;for(const i of e)if(r.style.fontFamily=`"${s}", ${i}`,r.offsetWidth!==o[i]){n.push(s),t=!0;break}t||(r.style.fontFamily=`"${s}"`,r.offsetWidth!==o.monospace&&r.offsetWidth!==o.serif&&n.push(s))}return document.body.removeChild(r),n.length?n.sort().join(","):null};"undefined"!=typeof window&&(window.getBrowserFingerprint=tt);var at=async(e,t)=>{if(e instanceof ge){try{const t=await e.response.json();if(t?.error)return t.error;if(t?.message)return t.message;if("INVALID_EMAIL_OR_PASSWORD"===t?.code)return"Invalid email or password"}catch{return t||e.message}return t||e.message}return e instanceof Error?t||e.message:t||String(e)},lt=O(void 0),ct=({props:e={},children:t})=>{const{organizationId:r,uid:o,fname:n,lname:s,theme:i="light"}=e,[a,l]=R(()=>{if("undefined"==typeof window)return null;if(o||n||s)return null;const e=localStorage.getItem("qrati_token");return e?{token:e}:null}),{isLoading:c,data:d,error:p}=B({queryKey:["qrati-connect-session",r,o??null,n??null,s??null],queryFn:async()=>{const e=await(async()=>{const e=await tt();return"string"==typeof e?e:e?.fingerprint})();return(await $e.post(A.INITIALIZE_SESSION,{json:{uid:o,fname:n,lname:s,browserFingerprint:e},headers:{"x-org-id":r,Authorization:o||n||s||!localStorage.getItem("qrati_token")?void 0:`Bearer ${localStorage.getItem("qrati_token")}`}}).json()).data},enabled:!!r});u(()=>{const e=d?.authSession?.session?.token,t=d?.authSession?.user;t&&e?(l({...t,token:e}),d?.organization?.customAuth||localStorage.setItem("qrati_token",e)):d?.organization?.customAuth&&o&&n&&s&&l(e=>e??{uid:o,name:`${n} ${s}`,fname:n,lname:s})},[d]);const m=f(()=>y(d?.organization?.integrationSettings,d?.organization?.customFontUrl),[d?.organization?.integrationSettings,d?.organization?.customFontUrl]),g=async e=>{try{const t=await((e,t,r)=>new Promise((o,n)=>{if(!e)return void n(/* @__PURE__ */new Error("Provider is required"));if(!t)return void n(/* @__PURE__ */new Error("Organization ID is required"));const s=new URL(`${r}/qc-social-auth`);s.searchParams.set("provider",e),s.searchParams.set("organizationId",t),s.searchParams.set("origin",window.location.origin);const i=(window.screen.width-500)/2,a=(window.screen.height-600)/2,l=window.open(s.toString(),"qrati_social_auth",`width=500,height=600,left=${i},top=${a},scrollbars=yes,resizable=yes,status=yes`);if(!l)return void n(/* @__PURE__ */new Error("Failed to open popup window. Please allow popups and try again."));const c=()=>{clearInterval(h),clearTimeout(d),window.removeEventListener("message",u)},u=e=>{try{const t=new URL(r).origin;if(e.origin!==t)return void console.warn("Origin mismatch:",e.origin,"expected:",t)}catch(h){console.warn("Could not parse origin for verification")}const{type:s,data:i,error:a,organizationId:u}=e.data||{};if(u===t)switch(s){case"QRATI_SOCIAL_AUTH_SUCCESS":c(),l.close(),o({user:i.user,session:i.session,token:i.token});break;case"QRATI_SOCIAL_AUTH_ERROR":console.error("Authentication error:",a),c(),l.close(),n(new Error(a||"Social authentication failed"));break;case"QRATI_SOCIAL_AUTH_CANCELLED":c(),l.close(),n(/* @__PURE__ */new Error("Authentication was cancelled"))}else console.warn("Organization ID mismatch:",u,"expected:",t)},h=setInterval(()=>{try{l.closed&&(c(),n(/* @__PURE__ */new Error("Authentication was cancelled")))}catch(e){}},1e3);window.addEventListener("message",u);const d=setTimeout(()=>{c(),l.closed||l.close(),n(/* @__PURE__ */new Error("Authentication timeout. Please try again."))},3e5)}))(e,r??"","https://qrati.com");return t?.user&&t?.token&&(l({...t.user,token:t.token}),localStorage.setItem("qrati_token",t.token)),t}catch(p){throw console.error("Social login error:",p),p}};return p?/* @__PURE__ */h(K,{fallback:null,children:/* @__PURE__ */h(Je,{organizationId:r??"",errorType:401===p?.response?.status?"page-not-registered":"generic-error"})}):!d?.organization?.customAuth||o&&n&&s?/* @__PURE__ */h(lt.Provider,{value:{props:e,initializing:c,sessionId:d?.sessionId,organization:d?.organization,folders:d?.folders,loadingUser:c,user:a,registerUsingEmail:async(e,t,o,n)=>{try{const s=await $e.post(A.REGISTER,{json:{email:e,password:t,fname:o,lname:n},headers:{"x-org-id":r}}).json();return s.error?{error:s.error}:(l({...s.user,token:s.token}),localStorage.setItem("qrati_token",s.token),s)}catch(p){return{error:await at(p,"Registration failed")}}},loginWithGoogle:async()=>{try{return await g("google")}catch(p){throw console.error("Google login error:",p),p}},loginWithApple:async()=>{try{return await g("apple")}catch(p){throw console.error("Apple login error:",p),p}},loginUsingEmail:async(e,t)=>{try{const o=await $e.post(A.LOGIN,{json:{email:e,password:t},headers:{"x-org-id":r}}).json();return o.error?{error:o.error}:(l({...o.user,token:o.token}),localStorage.setItem("qrati_token",o.token),o)}catch(p){return{error:await at(p,"Invalid email or password")}}},sendPasswordResetCode:async e=>{try{const t=await $e.post(A.SEND_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase()},headers:{"x-org-id":r}}).json();return t.error?{error:t.error}:t}catch(p){return{error:await at(p,"Failed to send password reset code")}}},verifyPasswordResetCode:async(e,t)=>{try{const o=await $e.post(A.VERIFY_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase(),code:t},headers:{"x-org-id":r}}).json();return o.error?{error:o.error}:o}catch(p){return{error:await at(p,"Invalid code, please check your email")}}},resetPassword:async(e,t)=>{try{const o=await $e.post(A.RESET_PASSWORD,{json:{passwordResetCodeId:e,newPassword:t},headers:{"x-org-id":r}}).json();return o.error?{error:o.error}:o}catch(p){return{error:p?.message}}},signout:async()=>{try{const e=await $e.post(A.LOGOUT,{headers:{"x-org-id":r,Authorization:`Bearer ${a?.token}`}}).json();return e.error?{error:e.error}:(localStorage.removeItem("qrati_token"),l(null),e)}catch(p){return console.error(p),{error:p?.message}}},error:p},children:/* @__PURE__ */h("div",{id:"qrati-connect-container",style:{...b(d?.organization,i),fontFamily:"var(--font-family)"},className:x("bg-background text-foreground relative min-h-[80vh]"),children:[m?/* @__PURE__ */h("style",{children:m}):null,t]})}):/* @__PURE__ */h(K,{fallback:null,children:/* @__PURE__ */h(Je,{organizationId:r??"",errorType:"custom-auth-invalid"})})},ut=()=>{const e=m(lt);if(void 0===e)throw new Error("useSession must be used within SessionProvider");return e};export{$e as a,ee as c,D as d,Ye as i,B as l,ut as n,se as o,tt as r,K as s,ct as t,H as u};
package/react/B_TauT26.js DELETED
@@ -1 +0,0 @@
1
- import{_ as t,a as i,b as s,c as e,d as o,f as n,g as a,h as r,i as h,l as p,n as l,o as c,s as d,t as u,u as m,v as _,x as v,y as g}from"./DHTkVJH6.js";var y=class{constructor(t){this.gestures=t,this.pswp=t.pswp,this.startPan={x:0,y:0}}start(){this.pswp.currSlide&&o(this.startPan,this.pswp.currSlide.pan),this.pswp.animations.stopAll()}change(){const{p1:i,prevP1:s,dragAxis:e}=this.gestures,{currSlide:o}=this.pswp;if("y"===e&&this.pswp.options.closeOnVerticalDrag&&o&&o.currZoomLevel<=o.zoomLevels.fit&&!this.gestures.isMultitouch){const t=o.pan.y+(i.y-s.y);if(!this.pswp.dispatch("verticalDrag",{panY:t}).defaultPrevented){this._setPanWithFriction("y",t,.6);const i=1-Math.abs(this._getVerticalDragRatio(o.pan.y));this.pswp.applyBgOpacity(i),o.applyCurrentZoomPan()}}else this._panOrMoveMainScroll("x")||(this._panOrMoveMainScroll("y"),o&&(t(o.pan),o.applyCurrentZoomPan()))}end(){const{velocity:t}=this.gestures,{mainScroll:i,currSlide:s}=this.pswp;let e=0;if(this.pswp.animations.stopAll(),i.isShifted()){const s=(i.x-i.getCurrSlideX())/this.pswp.viewportSize.x;t.x<-.5&&s<0||t.x<.1&&s<-.5?(e=1,t.x=Math.min(t.x,0)):(t.x>.5&&s>0||t.x>-.1&&s>.5)&&(e=-1,t.x=Math.max(t.x,0)),i.moveIndexBy(e,!0,t.x,!0)}s&&s.currZoomLevel>s.zoomLevels.max||this.gestures.isMultitouch?this.gestures.zoomLevels.correctZoomPan(!0):(this._finishPanGestureForAxis("x"),this._finishPanGestureForAxis("y"))}_finishPanGestureForAxis(t){const{velocity:i}=this.gestures,{currSlide:s}=this.pswp;if(!s)return;const{pan:o,bounds:n}=s,a=o[t],r=this.pswp.bgOpacity<1&&"y"===t,h=a+i[t]*.995/(1-.995);if(r){const t=this._getVerticalDragRatio(a),i=this._getVerticalDragRatio(h);if(t<0&&i<-.4||t>0&&i>.4)return void this.pswp.close()}const p=n.correctPan(t,h);if(a===p)return;const l=p===h?1:.82,c=this.pswp.bgOpacity,d=p-a;this.pswp.animations.startSpring({name:`panGesture${t}`,isPan:!0,start:a,end:p,velocity:i[t],dampingRatio:l,onUpdate:i=>{if(r&&this.pswp.bgOpacity<1){const t=1-(p-i)/d;this.pswp.applyBgOpacity(e(c+(1-c)*t,0,1))}o[t]=Math.floor(i),s.applyCurrentZoomPan()}})}_panOrMoveMainScroll(t){const{p1:i,dragAxis:s,prevP1:e,isMultitouch:o}=this.gestures,{currSlide:n,mainScroll:a}=this.pswp,r=i[t]-e[t],h=a.x+r;if(!r||!n)return!1;if("x"===t&&!n.isPannable()&&!o)return a.moveTo(h,!0),!0;const{bounds:p}=n,l=n.pan[t]+r;if(this.pswp.options.allowPanToNext&&"x"===s&&"x"===t&&!o){const i=a.getCurrSlideX(),s=a.x-i,e=r>0,o=!e;if(l>p.min[t]&&e){if(p.min[t]<=this.startPan[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,l)}else if(l<p.max[t]&&o){if(this.startPan[t]<=p.max[t])return a.moveTo(h,!0),!0;this._setPanWithFriction(t,l)}else if(0!==s){if(s>0)return a.moveTo(Math.max(h,i),!0),!0;if(s<0)return a.moveTo(Math.min(h,i),!0),!0}else this._setPanWithFriction(t,l)}else"y"===t&&(a.isShifted()||p.min.y===p.max.y)||this._setPanWithFriction(t,l);return!1}_getVerticalDragRatio(t){return(t-(this.pswp.currSlide?.bounds.center.y??0))/(this.pswp.viewportSize.y/3)}_setPanWithFriction(t,i,s){const{currSlide:e}=this.pswp;if(!e)return;const{pan:o,bounds:n}=e;if(n.correctPan(t,i)!==i||s){const e=Math.round(i-o[t]);o[t]+=e*(s||.35)}else o[t]=i}};function w(t){return!!t.target.closest(".pswp__container")}var f=class{constructor(t){this.gestures=t}click(t,i){const s=i.target.classList,e=s.contains("pswp__img"),o=s.contains("pswp__item")||s.contains("pswp__zoom-wrap");e?this._doClickOrTapAction("imageClick",t,i):o&&this._doClickOrTapAction("bgClick",t,i)}tap(t,i){w(i)&&this._doClickOrTapAction("tap",t,i)}doubleTap(t,i){w(i)&&this._doClickOrTapAction("doubleTap",t,i)}_doClickOrTapAction(t,i,s){const{pswp:e}=this.gestures,{currSlide:o}=e,n=`${t}Action`,a=e.options[n];if(!e.dispatch(n,{point:i,originalEvent:s}).defaultPrevented)if("function"!=typeof a)switch(a){case"close":case"next":e[a]();break;case"zoom":o?.toggleZoom(i);break;case"zoom-or-close":o?.isZoomable()&&o.zoomLevels.secondary!==o.zoomLevels.initial?o.toggleZoom(i):e.options.clickToCloseNonZoomable&&e.close();break;case"toggle-controls":this.gestures.pswp.element?.classList.toggle("pswp--ui-visible")}else a.call(e,i,s)}};function P(t,i,s){return t.x=(i.x+s.x)/2,t.y=(i.y+s.y)/2,t}var x=class{constructor(t){this.gestures=t,this._startPan={x:0,y:0},this._startZoomPoint={x:0,y:0},this._zoomPoint={x:0,y:0},this._wasOverFitZoomLevel=!1,this._startZoomLevel=1}start(){const{currSlide:t}=this.gestures.pswp;t&&(this._startZoomLevel=t.currZoomLevel,o(this._startPan,t.pan)),this.gestures.pswp.animations.stopAllPan(),this._wasOverFitZoomLevel=!1}change(){const{p1:t,startP1:i,p2:s,startP2:e,pswp:o}=this.gestures,{currSlide:a}=o;if(!a)return;const r=a.zoomLevels.min,h=a.zoomLevels.max;if(!a.isZoomable()||o.mainScroll.isShifted())return;P(this._startZoomPoint,i,e),P(this._zoomPoint,t,s);let p=1/n(i,e)*n(t,s)*this._startZoomLevel;if(p>a.zoomLevels.initial+a.zoomLevels.initial/15&&(this._wasOverFitZoomLevel=!0),p<r)if(o.options.pinchToClose&&!this._wasOverFitZoomLevel&&this._startZoomLevel<=a.zoomLevels.initial){const t=1-(r-p)/(r/1.2);o.dispatch("pinchClose",{bgOpacity:t}).defaultPrevented||o.applyBgOpacity(t)}else p=r-.15*(r-p);else p>h&&(p=h+.05*(p-h));a.pan.x=this._calculatePanForZoomLevel("x",p),a.pan.y=this._calculatePanForZoomLevel("y",p),a.setZoomLevel(p),a.applyCurrentZoomPan()}end(){const{pswp:t}=this.gestures,{currSlide:i}=t;(!i||i.currZoomLevel<i.zoomLevels.initial)&&!this._wasOverFitZoomLevel&&t.options.pinchToClose?t.close():this.correctZoomPan()}_calculatePanForZoomLevel(t,i){const s=i/this._startZoomLevel;return this._zoomPoint[t]-(this._startZoomPoint[t]-this._startPan[t])*s}correctZoomPan(t){const{pswp:i}=this.gestures,{currSlide:s}=i;if(!s?.isZoomable())return;0===this._zoomPoint.x&&(t=!0);const n=s.currZoomLevel;let a,h=!0;n<s.zoomLevels.initial?a=s.zoomLevels.initial:n>s.zoomLevels.max?a=s.zoomLevels.max:(h=!1,a=n);const p=i.bgOpacity,l=i.bgOpacity<1,c=o({x:0,y:0},s.pan);let d=o({x:0,y:0},c);t&&(this._zoomPoint.x=0,this._zoomPoint.y=0,this._startZoomPoint.x=0,this._startZoomPoint.y=0,this._startZoomLevel=n,o(this._startPan,c)),h&&(d={x:this._calculatePanForZoomLevel("x",a),y:this._calculatePanForZoomLevel("y",a)}),s.setZoomLevel(a),d={x:s.bounds.correctPan("x",d.x),y:s.bounds.correctPan("y",d.y)},s.setZoomLevel(n);const u=!r(d,c);if(!u&&!h&&!l)return s._setResolution(a),void s.applyCurrentZoomPan();i.animations.stopAllPan(),i.animations.startSpring({isPan:!0,start:0,end:1e3,velocity:0,dampingRatio:1,naturalFrequency:40,onUpdate:t=>{if(t/=1e3,u||h){if(u&&(s.pan.x=c.x+(d.x-c.x)*t,s.pan.y=c.y+(d.y-c.y)*t),h){const i=n+(a-n)*t;s.setZoomLevel(i)}s.applyCurrentZoomPan()}l&&i.bgOpacity<1&&i.applyBgOpacity(e(p+(1-p)*t,0,1))},onComplete:()=>{s._setResolution(a),s.applyCurrentZoomPan()}})}},S=class{constructor(t){this.pswp=t,this.dragAxis=null,this.p1={x:0,y:0},this.p2={x:0,y:0},this.prevP1={x:0,y:0},this.prevP2={x:0,y:0},this.startP1={x:0,y:0},this.startP2={x:0,y:0},this.velocity={x:0,y:0},this._lastStartP1={x:0,y:0},this._intervalP1={x:0,y:0},this._numActivePoints=0,this._ongoingPointers=[],this._touchEventEnabled="ontouchstart"in window,this._pointerEventEnabled=!!window.PointerEvent,this.supportsTouch=this._touchEventEnabled||this._pointerEventEnabled&&navigator.maxTouchPoints>1,this._numActivePoints=0,this._intervalTime=0,this._velocityCalculated=!1,this.isMultitouch=!1,this.isDragging=!1,this.isZooming=!1,this.raf=null,this._tapTimer=null,this.supportsTouch||(t.options.allowPanToNext=!1),this.drag=new y(this),this.zoomLevels=new x(this),this.tapHandler=new f(this),t.on("bindEvents",()=>{t.events.add(t.scrollWrap,"click",this._onClick.bind(this)),this._pointerEventEnabled?this._bindEvents("pointer","down","up","cancel"):this._touchEventEnabled?(this._bindEvents("touch","start","end","cancel"),t.scrollWrap&&(t.scrollWrap.ontouchmove=()=>{},t.scrollWrap.ontouchend=()=>{})):this._bindEvents("mouse","down","up")})}_bindEvents(t,i,s,e){const{pswp:o}=this,{events:n}=o,a=e?t+e:"";n.add(o.scrollWrap,t+i,this.onPointerDown.bind(this)),n.add(window,`${t}move`,this.onPointerMove.bind(this)),n.add(window,t+s,this.onPointerUp.bind(this)),a&&n.add(o.scrollWrap,a,this.onPointerUp.bind(this))}onPointerDown(t){const i="mousedown"===t.type||"mouse"===t.pointerType;if(i&&t.button>0)return;const{pswp:s}=this;s.opener.isOpen?s.dispatch("pointerDown",{originalEvent:t}).defaultPrevented||(i&&(s.mouseDetected(),this._preventPointerEventBehaviour(t,"down")),s.animations.stopAll(),this._updatePoints(t,"down"),1===this._numActivePoints&&(this.dragAxis=null,o(this.startP1,this.p1)),this._numActivePoints>1?(this._clearTapTimer(),this.isMultitouch=!0):this.isMultitouch=!1):t.preventDefault()}onPointerMove(t){this._preventPointerEventBehaviour(t,"move"),this._numActivePoints&&(this._updatePoints(t,"move"),this.pswp.dispatch("pointerMove",{originalEvent:t}).defaultPrevented||(1!==this._numActivePoints||this.isDragging?this._numActivePoints>1&&!this.isZooming&&(this._finishDrag(),this.isZooming=!0,this._updateStartPoints(),this.zoomLevels.start(),this._rafStopLoop(),this._rafRenderLoop()):(this.dragAxis||this._calculateDragDirection(),this.dragAxis&&!this.isDragging&&(this.isZooming&&(this.isZooming=!1,this.zoomLevels.end()),this.isDragging=!0,this._clearTapTimer(),this._updateStartPoints(),this._intervalTime=Date.now(),this._velocityCalculated=!1,o(this._intervalP1,this.p1),this.velocity.x=0,this.velocity.y=0,this.drag.start(),this._rafStopLoop(),this._rafRenderLoop()))))}_finishDrag(){this.isDragging&&(this.isDragging=!1,this._velocityCalculated||this._updateVelocity(!0),this.drag.end(),this.dragAxis=null)}onPointerUp(t){this._numActivePoints&&(this._updatePoints(t,"up"),this.pswp.dispatch("pointerUp",{originalEvent:t}).defaultPrevented||(0===this._numActivePoints&&(this._rafStopLoop(),this.isDragging?this._finishDrag():this.isZooming||this.isMultitouch||this._finishTap(t)),this._numActivePoints<2&&this.isZooming&&(this.isZooming=!1,this.zoomLevels.end(),1===this._numActivePoints&&(this.dragAxis=null,this._updateStartPoints()))))}_rafRenderLoop(){(this.isDragging||this.isZooming)&&(this._updateVelocity(),this.isDragging?r(this.p1,this.prevP1)||this.drag.change():r(this.p1,this.prevP1)&&r(this.p2,this.prevP2)||this.zoomLevels.change(),this._updatePrevPoints(),this.raf=requestAnimationFrame(this._rafRenderLoop.bind(this)))}_updateVelocity(t){const i=Date.now(),s=i-this._intervalTime;s<50&&!t||(this.velocity.x=this._getVelocity("x",s),this.velocity.y=this._getVelocity("y",s),this._intervalTime=i,o(this._intervalP1,this.p1),this._velocityCalculated=!0)}_finishTap(t){const{mainScroll:i}=this.pswp;if(i.isShifted())return void i.moveIndexBy(0,!0);if(t.type.indexOf("cancel")>0)return;if("mouseup"===t.type||"mouse"===t.pointerType)return void this.tapHandler.click(this.startP1,t);const s=this.pswp.options.doubleTapAction?300:0;this._tapTimer?(this._clearTapTimer(),n(this._lastStartP1,this.startP1)<25&&this.tapHandler.doubleTap(this.startP1,t)):(o(this._lastStartP1,this.startP1),this._tapTimer=setTimeout(()=>{this.tapHandler.tap(this.startP1,t),this._clearTapTimer()},s))}_clearTapTimer(){this._tapTimer&&(clearTimeout(this._tapTimer),this._tapTimer=null)}_getVelocity(t,i){const s=this.p1[t]-this._intervalP1[t];return Math.abs(s)>1&&i>5?s/i:0}_rafStopLoop(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null)}_preventPointerEventBehaviour(t,i){this.pswp.applyFilters("preventPointerEvent",!0,t,i)&&t.preventDefault()}_updatePoints(t,i){if(this._pointerEventEnabled){const s=t,e=this._ongoingPointers.findIndex(t=>t.id===s.pointerId);"up"===i&&e>-1?this._ongoingPointers.splice(e,1):"down"===i&&-1===e?this._ongoingPointers.push(this._convertEventPosToPoint(s,{x:0,y:0})):e>-1&&this._convertEventPosToPoint(s,this._ongoingPointers[e]),this._numActivePoints=this._ongoingPointers.length,this._numActivePoints>0&&o(this.p1,this._ongoingPointers[0]),this._numActivePoints>1&&o(this.p2,this._ongoingPointers[1])}else{const s=t;this._numActivePoints=0,s.type.indexOf("touch")>-1?s.touches&&s.touches.length>0&&(this._convertEventPosToPoint(s.touches[0],this.p1),this._numActivePoints++,s.touches.length>1&&(this._convertEventPosToPoint(s.touches[1],this.p2),this._numActivePoints++)):(this._convertEventPosToPoint(t,this.p1),"up"===i?this._numActivePoints=0:this._numActivePoints++)}}_updatePrevPoints(){o(this.prevP1,this.p1),o(this.prevP2,this.p2)}_updateStartPoints(){o(this.startP1,this.p1),o(this.startP2,this.p2),this._updatePrevPoints()}_calculateDragDirection(){if(this.pswp.mainScroll.isShifted())this.dragAxis="x";else{const t=Math.abs(this.p1.x-this.startP1.x)-Math.abs(this.p1.y-this.startP1.y);if(0!==t){const i=t>0?"x":"y";Math.abs(this.p1[i]-this.startP1[i])>=10&&(this.dragAxis=i)}}}_convertEventPosToPoint(t,i){return i.x=t.pageX-this.pswp.offset.x,i.y=t.pageY-this.pswp.offset.y,"pointerId"in t?i.id=t.pointerId:void 0!==t.identifier&&(i.id=t.identifier),i}_onClick(t){this.pswp.mainScroll.isShifted()&&(t.preventDefault(),t.stopPropagation())}},b=class{constructor(t){this.slide=t,this.currZoomLevel=1,this.center={x:0,y:0},this.max={x:0,y:0},this.min={x:0,y:0}}update(t){this.currZoomLevel=t,this.slide.width?(this._updateAxis("x"),this._updateAxis("y"),this.slide.pswp.dispatch("calcBounds",{slide:this.slide})):this.reset()}_updateAxis(t){const{pswp:i}=this.slide,s=this.slide["x"===t?"width":"height"]*this.currZoomLevel,e=d("x"===t?"left":"top",i.options,i.viewportSize,this.slide.data,this.slide.index),o=this.slide.panAreaSize[t];this.center[t]=Math.round((o-s)/2)+e,this.max[t]=s>o?Math.round(o-s)+e:this.center[t],this.min[t]=s>o?e:this.center[t]}reset(){this.center.x=0,this.center.y=0,this.max.x=0,this.max.y=0,this.min.x=0,this.min.y=0}correctPan(t,i){return e(i,this.max[t],this.min[t])}},T=class{constructor(t,i,s){this.data=t,this.index=i,this.pswp=s,this.isActive=i===s.currIndex,this.currentResolution=0,this.panAreaSize={x:0,y:0},this.pan={x:0,y:0},this.isFirstSlide=this.isActive&&!s.opener.isOpen,this.zoomLevels=new h(s.options,t,i,s),this.pswp.dispatch("gettingData",{slide:this,data:this.data,index:i}),this.content=this.pswp.contentLoader.getContentBySlide(this),this.container=p("pswp__zoom-wrap","div"),this.holderElement=null,this.currZoomLevel=1,this.width=this.content.width,this.height=this.content.height,this.heavyAppended=!1,this.bounds=new b(this),this.prevDisplayedWidth=-1,this.prevDisplayedHeight=-1,this.pswp.dispatch("slideInit",{slide:this})}setIsActive(t){t&&!this.isActive?this.activate():!t&&this.isActive&&this.deactivate()}append(t){this.holderElement=t,this.container.style.transformOrigin="0 0",this.data&&(this.calculateSize(),this.load(),this.updateContentSize(),this.appendHeavy(),this.holderElement.appendChild(this.container),this.zoomAndPanToInitial(),this.pswp.dispatch("firstZoomPan",{slide:this}),this.applyCurrentZoomPan(),this.pswp.dispatch("afterSetContent",{slide:this}),this.isActive&&this.activate())}load(){this.content.load(!1),this.pswp.dispatch("slideLoad",{slide:this})}appendHeavy(){const{pswp:t}=this;!this.heavyAppended&&t.opener.isOpen&&!t.mainScroll.isShifted()&&(this.isActive,1)&&(this.pswp.dispatch("appendHeavy",{slide:this}).defaultPrevented||(this.heavyAppended=!0,this.content.append(),this.pswp.dispatch("appendHeavyContent",{slide:this})))}activate(){this.isActive=!0,this.appendHeavy(),this.content.activate(),this.pswp.dispatch("slideActivate",{slide:this})}deactivate(){this.isActive=!1,this.content.deactivate(),this.currZoomLevel!==this.zoomLevels.initial&&this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize(),this.pswp.dispatch("slideDeactivate",{slide:this})}destroy(){this.content.hasSlide=!1,this.content.remove(),this.container.remove(),this.pswp.dispatch("slideDestroy",{slide:this})}resize(){this.currZoomLevel!==this.zoomLevels.initial&&this.isActive?(this.calculateSize(),this.bounds.update(this.currZoomLevel),this.panTo(this.pan.x,this.pan.y)):(this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize())}updateContentSize(t){const i=this.currentResolution||this.zoomLevels.initial;if(!i)return;const s=Math.round(this.width*i)||this.pswp.viewportSize.x,e=Math.round(this.height*i)||this.pswp.viewportSize.y;(this.sizeChanged(s,e)||t)&&this.content.setDisplayedSize(s,e)}sizeChanged(t,i){return(t!==this.prevDisplayedWidth||i!==this.prevDisplayedHeight)&&(this.prevDisplayedWidth=t,this.prevDisplayedHeight=i,!0)}getPlaceholderElement(){return this.content.placeholder?.element}zoomTo(i,s,o,n){const{pswp:a}=this;if(!this.isZoomable()||a.mainScroll.isShifted())return;a.dispatch("beforeZoomTo",{destZoomLevel:i,centerPoint:s,transitionDuration:o}),a.animations.stopAllPan();const r=this.currZoomLevel;n||(i=e(i,this.zoomLevels.min,this.zoomLevels.max)),this.setZoomLevel(i),this.pan.x=this.calculateZoomToPanOffset("x",s,r),this.pan.y=this.calculateZoomToPanOffset("y",s,r),t(this.pan);const h=()=>{this._setResolution(i),this.applyCurrentZoomPan()};o?a.animations.startTransition({isPan:!0,name:"zoomTo",target:this.container,transform:this.getCurrentTransform(),onComplete:h,duration:o,easing:a.options.easing}):h()}toggleZoom(t){this.zoomTo(this.currZoomLevel===this.zoomLevels.initial?this.zoomLevels.secondary:this.zoomLevels.initial,t,this.pswp.options.zoomAnimationDuration)}setZoomLevel(t){this.currZoomLevel=t,this.bounds.update(this.currZoomLevel)}calculateZoomToPanOffset(t,i,s){if(this.bounds.max[t]-this.bounds.min[t]===0)return this.bounds.center[t];i||(i=this.pswp.getViewportCenterPoint()),s||(s=this.zoomLevels.initial);const e=this.currZoomLevel/s;return this.bounds.correctPan(t,(this.pan[t]-i[t])*e+i[t])}panTo(t,i){this.pan.x=this.bounds.correctPan("x",t),this.pan.y=this.bounds.correctPan("y",i),this.applyCurrentZoomPan()}isPannable(){return Boolean(this.width)&&this.currZoomLevel>this.zoomLevels.fit}isZoomable(){return Boolean(this.width)&&this.content.isZoomable()}applyCurrentZoomPan(){this._applyZoomTransform(this.pan.x,this.pan.y,this.currZoomLevel),this===this.pswp.currSlide&&this.pswp.dispatch("zoomPanUpdate",{slide:this})}zoomAndPanToInitial(){this.currZoomLevel=this.zoomLevels.initial,this.bounds.update(this.currZoomLevel),o(this.pan,this.bounds.center),this.pswp.dispatch("initialZoomPan",{slide:this})}_applyZoomTransform(t,i,s){s/=this.currentResolution||this.zoomLevels.initial,_(this.container,t,i,s)}calculateSize(){const{pswp:t}=this;o(this.panAreaSize,i(t.options,t.viewportSize,this.data,this.index)),this.zoomLevels.update(this.width,this.height,this.panAreaSize),t.dispatch("calcSlideSize",{slide:this})}getCurrentTransform(){const t=this.currZoomLevel/(this.currentResolution||this.zoomLevels.initial);return v(this.pan.x,this.pan.y,t)}_setResolution(t){t!==this.currentResolution&&(this.currentResolution=t,this.updateContentSize(),this.pswp.dispatch("resolutionChanged"))}};function L(t,i,s){t.classList.add("pswp__button--arrow"),t.setAttribute("aria-controls","pswp__items"),i.on("change",()=>{i.options.loop||(t.disabled=s?!(i.currIndex<i.getNumItems()-1):!(i.currIndex>0))})}var A={name:"arrowPrev",className:"pswp__button--arrow--prev",title:"Previous",order:10,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<path d="M29 43l-3 3-16-16 16-16 3 3-13 13 13 13z" id="pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"prev",onInit:L},z={name:"arrowNext",className:"pswp__button--arrow--next",title:"Next",order:11,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<use xlink:href="#pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"next",onInit:(t,i)=>{L(t,i,!0)}},C={name:"close",title:"Close",order:20,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M24 10l-2-2-6 6-6-6-2 2 6 6-6 6 2 2 6-6 6 6 2-2-6-6z" id="pswp__icn-close"/>',outlineID:"pswp__icn-close"},onClick:"close"},Z={name:"zoom",title:"Zoom",order:10,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M17.426 19.926a6 6 0 1 1 1.5-1.5L23 22.5 21.5 24l-4.074-4.074z" id="pswp__icn-zoom"/><path fill="currentColor" class="pswp__zoom-icn-bar-h" d="M11 16v-2h6v2z"/><path fill="currentColor" class="pswp__zoom-icn-bar-v" d="M13 12h2v6h-2z"/>',outlineID:"pswp__icn-zoom"},onClick:"toggleZoom"},I={name:"counter",order:5,onInit:(t,i)=>{i.on("change",()=>{t.innerText=i.currIndex+1+i.options.indexIndicatorSep+i.getNumItems()})}},O={name:"preloader",appendTo:"bar",order:7,html:{isCustomSVG:!0,inner:'<path fill-rule="evenodd" clip-rule="evenodd" d="M21.2 16a5.2 5.2 0 1 1-5.2-5.2V8a8 8 0 1 0 8 8h-2.8Z" id="pswp__icn-loading"/>',outlineID:"pswp__icn-loading"},onInit:(t,i)=>{let s,e=null;const o=i=>{var e;s!==i&&(s=i,e=i,t.classList.toggle("pswp__preloader--active",e))},n=()=>{if(!i.currSlide?.content.isLoading())return o(!1),void(e&&(clearTimeout(e),e=null));e||(e=setTimeout(()=>{o(Boolean(i.currSlide?.content.isLoading())),e=null},i.options.preloaderDelay))};i.on("change",n),i.on("loadComplete",t=>{i.currSlide===t.slide&&n()}),i.ui&&(i.ui.updatePreloaderVisibility=n)}},D=class{constructor(t,i){const s=i.name||i.className;let e=i.html;if(!1===t.options[s])return;"string"==typeof t.options[`${s}SVG`]&&(e=t.options[`${s}SVG`]),t.dispatch("uiElementCreate",{data:i});let o="";i.isButton?(o+="pswp__button ",o+=i.className||`pswp__button--${i.name}`):o+=i.className||`pswp__${i.name}`;let n=i.isButton?i.tagName||"button":i.tagName||"div";n=n.toLowerCase();const a=p(o,n);if(i.isButton){"button"===n&&(a.type="button");let{title:e}=i;const{ariaLabel:o}=i;"string"==typeof t.options[`${s}Title`]&&(e=t.options[`${s}Title`]),e&&(a.title=e);const r=o||e;r&&a.setAttribute("aria-label",r)}a.innerHTML=function(t){if("string"==typeof t)return t;if(!t||!t.isCustomSVG)return"";const i=t;let s='<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 %d %d" width="%d" height="%d">';return s=s.split("%d").join(i.size||32),i.outlineID&&(s+=`<use class="pswp__icn-shadow" xlink:href="#${i.outlineID}"/>`),s+=i.inner,s+="</svg>",s}(e),i.onInit&&i.onInit(a,t),i.onClick&&(a.onclick=s=>{"string"==typeof i.onClick?t[i.onClick]():"function"==typeof i.onClick&&i.onClick(s,a,t)});const r=i.appendTo||"bar";let h=t.element;"bar"===r?(t.topBar||(t.topBar=p("pswp__top-bar pswp__hide-on-close","div",t.scrollWrap)),h=t.topBar):(a.classList.add("pswp__hide-on-close"),"wrapper"===r&&(h=t.scrollWrap)),h?.appendChild(t.applyFilters("uiElement",a,i))}};function E(t,i){t.classList.toggle("pswp--zoomed-in",i)}var B=class{constructor(t){this.pswp=t,this.isRegistered=!1,this.uiElementsData=[],this.items=[],this.updatePreloaderVisibility=()=>{},this._lastUpdatedZoomLevel=void 0}init(){const{pswp:t}=this;this.isRegistered=!1,this.uiElementsData=[C,A,z,Z,O,I],t.dispatch("uiRegister"),this.uiElementsData.sort((t,i)=>(t.order||0)-(i.order||0)),this.items=[],this.isRegistered=!0,this.uiElementsData.forEach(t=>{this.registerElement(t)}),t.on("change",()=>{t.element?.classList.toggle("pswp--one-slide",1===t.getNumItems())}),t.on("zoomPanUpdate",()=>this._onZoomPanUpdate())}registerElement(t){this.isRegistered?this.items.push(new D(this.pswp,t)):this.uiElementsData.push(t)}_onZoomPanUpdate(){const{template:t,currSlide:i,options:s}=this.pswp;if(this.pswp.opener.isClosing||!t||!i)return;let{currZoomLevel:e}=i;if(this.pswp.opener.isOpen||(e=i.zoomLevels.initial),e===this._lastUpdatedZoomLevel)return;this._lastUpdatedZoomLevel=e;const o=i.zoomLevels.initial-i.zoomLevels.secondary;if(Math.abs(o)<.01||!i.isZoomable())return E(t,!1),void t.classList.remove("pswp--zoom-allowed");t.classList.add("pswp--zoom-allowed"),E(t,(e===i.zoomLevels.initial?i.zoomLevels.secondary:i.zoomLevels.initial)<=e),"zoom"!==s.imageClickAction&&"zoom-or-close"!==s.imageClickAction||t.classList.add("pswp--click-to-zoom")}},M="cubic-bezier(.4,0,.22,1)",F=class{constructor(t){this.props=t;const{target:i,onComplete:s,transform:e,onFinish:o=()=>{},duration:n=333,easing:a=M}=t;this.onFinish=o;const r=e?"transform":"opacity",h=t[r]??"";this._target=i,this._onComplete=s,this._finished=!1,this._onTransitionEnd=this._onTransitionEnd.bind(this),this._helperTimeout=setTimeout(()=>{g(i,r,n,a),this._helperTimeout=setTimeout(()=>{i.addEventListener("transitionend",this._onTransitionEnd,!1),i.addEventListener("transitioncancel",this._onTransitionEnd,!1),this._helperTimeout=setTimeout(()=>{this._finalizeAnimation()},n+500),i.style[r]=h},30)},0)}_onTransitionEnd(t){t.target===this._target&&this._finalizeAnimation()}_finalizeAnimation(){this._finished||(this._finished=!0,this.onFinish(),this._onComplete&&this._onComplete())}destroy(){this._helperTimeout&&(clearTimeout(this._helperTimeout),this._helperTimeout=null),a(this._target),this._target.removeEventListener("transitionend",this._onTransitionEnd,!1),this._target.removeEventListener("transitioncancel",this._onTransitionEnd,!1),this._finished||this._finalizeAnimation()}},R=class{constructor(t,i,s){this.velocity=1e3*t,this._dampingRatio=i||.75,this._naturalFrequency=s||12,this._dampedFrequency=this._naturalFrequency,this._dampingRatio<1&&(this._dampedFrequency*=Math.sqrt(1-this._dampingRatio*this._dampingRatio))}easeFrame(t,i){let s,e=0;i/=1e3;const o=Math.E**(-this._dampingRatio*this._naturalFrequency*i);if(1===this._dampingRatio)s=this.velocity+this._naturalFrequency*t,e=(t+s*i)*o,this.velocity=e*-this._naturalFrequency+s*o;else if(this._dampingRatio<1){s=1/this._dampedFrequency*(this._dampingRatio*this._naturalFrequency*t+this.velocity);const n=Math.cos(this._dampedFrequency*i),a=Math.sin(this._dampedFrequency*i);e=o*(t*n+s*a),this.velocity=e*-this._naturalFrequency*this._dampingRatio+o*(-this._dampedFrequency*t*a+this._dampedFrequency*s*n)}return e}},k=class{constructor(t){this.props=t,this._raf=0;const{start:i,end:s,velocity:e,onUpdate:o,onComplete:n,onFinish:a=()=>{},dampingRatio:r,naturalFrequency:h}=t;this.onFinish=a;const p=new R(e,r,h);let l=Date.now(),c=i-s;const d=()=>{this._raf&&(c=p.easeFrame(c,Date.now()-l),Math.abs(c)<1&&Math.abs(p.velocity)<50?(o(s),n&&n(),this.onFinish()):(l=Date.now(),o(c+s),this._raf=requestAnimationFrame(d)))};this._raf=requestAnimationFrame(d)}destroy(){this._raf>=0&&cancelAnimationFrame(this._raf),this._raf=0}},H=class{constructor(){this.activeAnimations=[]}startSpring(t){this._start(t,!0)}startTransition(t){this._start(t)}_start(t,i){const s=i?new k(t):new F(t);return this.activeAnimations.push(s),s.onFinish=()=>this.stop(s),s}stop(t){t.destroy();const i=this.activeAnimations.indexOf(t);i>-1&&this.activeAnimations.splice(i,1)}stopAll(){this.activeAnimations.forEach(t=>{t.destroy()}),this.activeAnimations=[]}stopAllPan(){this.activeAnimations=this.activeAnimations.filter(t=>!t.props.isPan||(t.destroy(),!1))}stopMainScroll(){this.activeAnimations=this.activeAnimations.filter(t=>!t.props.isMainScroll||(t.destroy(),!1))}isPanRunning(){return this.activeAnimations.some(t=>t.props.isPan)}},W=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{W=!0}}))}catch(J){}var N=class{constructor(){this._pool=[]}add(t,i,s,e){this._toggleListener(t,i,s,e)}remove(t,i,s,e){this._toggleListener(t,i,s,e,!0)}removeAll(){this._pool.forEach(t=>{this._toggleListener(t.target,t.type,t.listener,t.passive,!0,!0)}),this._pool=[]}_toggleListener(t,i,s,e,o,n){if(!t)return;const a=o?"removeEventListener":"addEventListener";i.split(" ").forEach(i=>{if(i){n||(o?this._pool=this._pool.filter(e=>e.type!==i||e.listener!==s||e.target!==t):this._pool.push({target:t,type:i,listener:s,passive:e}));const r=!!W&&{passive:e||!1};t[a](i,s,r)}})}},V={Escape:27,z:90,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Tab:9},q=(t,i)=>i?t:V[t],U=class{constructor(t){this.pswp=t,this._wasFocused=!1,t.on("bindEvents",()=>{t.options.trapFocus&&(t.options.initialPointerPos||this._focusRoot(),t.events.add(document,"focusin",this._onFocusIn.bind(this))),t.events.add(document,"keydown",this._onKeyDown.bind(this))});const i=document.activeElement;t.on("destroy",()=>{t.options.returnFocus&&i&&this._wasFocused&&i.focus()})}_focusRoot(){!this._wasFocused&&this.pswp.element&&(this.pswp.element.focus(),this._wasFocused=!0)}_onKeyDown(t){const{pswp:i}=this;if(i.dispatch("keydown",{originalEvent:t}).defaultPrevented)return;if(s(t))return;let e,o,n=!1;const a="key"in t;switch(a?t.key:t.keyCode){case q("Escape",a):i.options.escKey&&(e="close");break;case q("z",a):e="toggleZoom";break;case q("ArrowLeft",a):o="x";break;case q("ArrowUp",a):o="y";break;case q("ArrowRight",a):o="x",n=!0;break;case q("ArrowDown",a):n=!0,o="y";break;case q("Tab",a):this._focusRoot()}if(o){t.preventDefault();const{currSlide:s}=i;i.options.arrowKeys&&"x"===o&&i.getNumItems()>1?e=n?"next":"prev":s&&s.currZoomLevel>s.zoomLevels.fit&&(s.pan[o]+=n?-80:80,s.panTo(s.pan.x,s.pan.y))}e&&(t.preventDefault(),i[e]())}_onFocusIn(t){const{template:i}=this.pswp;i&&document!==t.target&&i!==t.target&&!i.contains(t.target)&&i.focus()}},$=class{constructor(t){this.pswp=t,this.x=0,this.slideWidth=0,this._currPositionIndex=0,this._prevPositionIndex=0,this._containerShiftIndex=-1,this.itemHolders=[]}resize(t){const{pswp:i}=this,s=Math.round(i.viewportSize.x+i.viewportSize.x*i.options.spacing),e=s!==this.slideWidth;e&&(this.slideWidth=s,this.moveTo(this.getCurrSlideX())),this.itemHolders.forEach((i,s)=>{e&&_(i.el,(s+this._containerShiftIndex)*this.slideWidth),t&&i.slide&&i.slide.resize()})}resetPosition(){this._currPositionIndex=0,this._prevPositionIndex=0,this.slideWidth=0,this._containerShiftIndex=-1}appendHolders(){this.itemHolders=[];for(let t=0;t<3;t++){const i=p("pswp__item","div",this.pswp.container);i.setAttribute("role","group"),i.setAttribute("aria-roledescription","slide"),i.setAttribute("aria-hidden","true"),i.style.display=1===t?"block":"none",this.itemHolders.push({el:i})}}canBeSwiped(){return this.pswp.getNumItems()>1}moveIndexBy(t,i,s){const{pswp:e}=this;let o=e.potentialIndex+t;const n=e.getNumItems();if(e.canLoop()){o=e.getLoopedIndex(o);const i=(t+n)%n;t=i<=n/2?i:i-n}else o<0?o=0:o>=n&&(o=n-1),t=o-e.potentialIndex;e.potentialIndex=o,this._currPositionIndex-=t,e.animations.stopMainScroll();const a=this.getCurrSlideX();if(i){e.animations.startSpring({isMainScroll:!0,start:this.x,end:a,velocity:s||0,naturalFrequency:30,dampingRatio:1,onUpdate:t=>{this.moveTo(t)},onComplete:()=>{this.updateCurrItem(),e.appendHeavy()}});let t=e.potentialIndex-e.currIndex;if(e.canLoop()){const i=(t+n)%n;t=i<=n/2?i:i-n}Math.abs(t)>1&&this.updateCurrItem()}else this.moveTo(a),this.updateCurrItem();return Boolean(t)}getCurrSlideX(){return this.slideWidth*this._currPositionIndex}isShifted(){return this.x!==this.getCurrSlideX()}updateCurrItem(){const{pswp:t}=this,i=this._prevPositionIndex-this._currPositionIndex;if(!i)return;this._prevPositionIndex=this._currPositionIndex,t.currIndex=t.potentialIndex;let s,e=Math.abs(i);e>=3&&(this._containerShiftIndex+=i+(i>0?-3:3),e=3,this.itemHolders.forEach(t=>{t.slide?.destroy(),t.slide=void 0}));for(let o=0;o<e;o++)i>0?(s=this.itemHolders.shift(),s&&(this.itemHolders[2]=s,this._containerShiftIndex++,_(s.el,(this._containerShiftIndex+2)*this.slideWidth),t.setContent(s,t.currIndex-e+o+2))):(s=this.itemHolders.pop(),s&&(this.itemHolders.unshift(s),this._containerShiftIndex--,_(s.el,this._containerShiftIndex*this.slideWidth),t.setContent(s,t.currIndex+e-o-2)));Math.abs(this._containerShiftIndex)>50&&!this.isShifted()&&(this.resetPosition(),this.resize()),t.animations.stopAllPan(),this.itemHolders.forEach((t,i)=>{t.slide&&t.slide.setIsActive(1===i)}),t.currSlide=this.itemHolders[1]?.slide,t.contentLoader.updateLazy(i),t.currSlide&&t.currSlide.applyCurrentZoomPan(),t.dispatch("change")}moveTo(t,i){if(!this.pswp.canLoop()&&i){let i=(this.slideWidth*this._currPositionIndex-t)/this.slideWidth;i+=this.pswp.currIndex;const s=Math.round(t-this.x);(i<0&&s>0||i>=this.pswp.getNumItems()-1&&s<0)&&(t=this.x+.35*s)}this.x=t,this.pswp.container&&_(this.pswp.container,t),this.pswp.dispatch("moveMainScroll",{x:t,dragging:i??!1})}},G=.003,X=class{constructor(t){this.pswp=t,this.isClosed=!0,this.isOpen=!1,this.isClosing=!1,this.isOpening=!1,this._duration=void 0,this._useAnimation=!1,this._croppedZoom=!1,this._animateRootOpacity=!1,this._animateBgOpacity=!1,this._placeholder=void 0,this._opacityElement=void 0,this._cropContainer1=void 0,this._cropContainer2=void 0,this._thumbBounds=void 0,this._prepareOpen=this._prepareOpen.bind(this),t.on("firstZoomPan",this._prepareOpen)}open(){this._prepareOpen(),this._start()}close(){if(this.isClosed||this.isClosing||this.isOpening)return;const t=this.pswp.currSlide;this.isOpen=!1,this.isOpening=!1,this.isClosing=!0,this._duration=this.pswp.options.hideAnimationDuration,t&&t.currZoomLevel*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps(),setTimeout(()=>{this._start()},this._croppedZoom?30:0)}_prepareOpen(){if(this.pswp.off("firstZoomPan",this._prepareOpen),!this.isOpening){const t=this.pswp.currSlide;this.isOpening=!0,this.isClosing=!1,this._duration=this.pswp.options.showAnimationDuration,t&&t.zoomLevels.initial*t.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps()}}_applyStartProps(){const{pswp:t}=this,i=this.pswp.currSlide,{options:s}=t;if("fade"===s.showHideAnimationType?(s.showHideOpacity=!0,this._thumbBounds=void 0):"none"===s.showHideAnimationType?(s.showHideOpacity=!1,this._duration=0,this._thumbBounds=void 0):this.isOpening&&t._initialThumbBounds?this._thumbBounds=t._initialThumbBounds:this._thumbBounds=this.pswp.getThumbBounds(),this._placeholder=i?.getPlaceholderElement(),t.animations.stopAll(),this._useAnimation=Boolean(this._duration&&this._duration>50),this._animateZoom=Boolean(this._thumbBounds)&&i?.content.usePlaceholder()&&(!this.isClosing||!t.mainScroll.isShifted()),this._animateZoom?this._animateRootOpacity=s.showHideOpacity??!1:(this._animateRootOpacity=!0,this.isOpening&&i&&(i.zoomAndPanToInitial(),i.applyCurrentZoomPan())),this._animateBgOpacity=!this._animateRootOpacity&&this.pswp.options.bgOpacity>G,this._opacityElement=this._animateRootOpacity?t.element:t.bg,!this._useAnimation)return this._duration=0,this._animateZoom=!1,this._animateBgOpacity=!1,this._animateRootOpacity=!0,void(this.isOpening&&(t.element&&(t.element.style.opacity=String(G)),t.applyBgOpacity(1)));this._animateZoom&&this._thumbBounds&&this._thumbBounds.innerRect?(this._croppedZoom=!0,this._cropContainer1=this.pswp.container,this._cropContainer2=this.pswp.currSlide?.holderElement,t.container&&(t.container.style.overflow="hidden",t.container.style.width=`${t.viewportSize.x}px`)):this._croppedZoom=!1,this.isOpening?(this._animateRootOpacity?(t.element&&(t.element.style.opacity=String(G)),t.applyBgOpacity(1)):(this._animateBgOpacity&&t.bg&&(t.bg.style.opacity=String(G)),t.element&&(t.element.style.opacity="1")),this._animateZoom&&(this._setClosedStateZoomPan(),this._placeholder&&(this._placeholder.style.willChange="transform",this._placeholder.style.opacity=String(G)))):this.isClosing&&(t.mainScroll.itemHolders[0]&&(t.mainScroll.itemHolders[0].el.style.display="none"),t.mainScroll.itemHolders[2]&&(t.mainScroll.itemHolders[2].el.style.display="none"),this._croppedZoom&&0!==t.mainScroll.x&&(t.mainScroll.resetPosition(),t.mainScroll.resize()))}_start(){this.isOpening&&this._useAnimation&&this._placeholder&&"IMG"===this._placeholder.tagName?new Promise(t=>{let i=!1,s=!0;m(this._placeholder).finally(()=>{i=!0,s||t(!0)}),setTimeout(()=>{s=!1,i&&t(!0)},50),setTimeout(t,250)}).finally(()=>this._initiate()):this._initiate()}_initiate(){this.pswp.element?.style.setProperty("--pswp-transition-duration",`${this._duration}ms`),this.pswp.dispatch(this.isOpening?"openingAnimationStart":"closingAnimationStart"),this.pswp.dispatch("initialZoom"+(this.isOpening?"In":"Out")),this.pswp.element?.classList.toggle("pswp--ui-visible",this.isOpening),this.isOpening?(this._placeholder&&(this._placeholder.style.opacity="1"),this._animateToOpenState()):this.isClosing&&this._animateToClosedState(),this._useAnimation||this._onAnimationComplete()}_onAnimationComplete(){const{pswp:t}=this;this.isOpen=this.isOpening,this.isClosed=this.isClosing,this.isOpening=!1,this.isClosing=!1,t.dispatch(this.isOpen?"openingAnimationEnd":"closingAnimationEnd"),t.dispatch("initialZoom"+(this.isOpen?"InEnd":"OutEnd")),this.isClosed?t.destroy():this.isOpen&&(this._animateZoom&&t.container&&(t.container.style.overflow="visible",t.container.style.width="100%"),t.currSlide?.applyCurrentZoomPan())}_animateToOpenState(){const{pswp:t}=this;this._animateZoom&&(this._croppedZoom&&this._cropContainer1&&this._cropContainer2&&(this._animateTo(this._cropContainer1,"transform","translate3d(0,0,0)"),this._animateTo(this._cropContainer2,"transform","none")),t.currSlide&&(t.currSlide.zoomAndPanToInitial(),this._animateTo(t.currSlide.container,"transform",t.currSlide.getCurrentTransform()))),this._animateBgOpacity&&t.bg&&this._animateTo(t.bg,"opacity",String(t.options.bgOpacity)),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","1")}_animateToClosedState(){const{pswp:t}=this;this._animateZoom&&this._setClosedStateZoomPan(!0),this._animateBgOpacity&&t.bgOpacity>.01&&t.bg&&this._animateTo(t.bg,"opacity","0"),this._animateRootOpacity&&t.element&&this._animateTo(t.element,"opacity","0")}_setClosedStateZoomPan(t){if(!this._thumbBounds)return;const{pswp:i}=this,{innerRect:s}=this._thumbBounds,{currSlide:e,viewportSize:n}=i;if(this._croppedZoom&&s&&this._cropContainer1&&this._cropContainer2){const i=-n.x+(this._thumbBounds.x-s.x)+s.w,e=-n.y+(this._thumbBounds.y-s.y)+s.h,o=n.x-s.w,a=n.y-s.h;t?(this._animateTo(this._cropContainer1,"transform",v(i,e)),this._animateTo(this._cropContainer2,"transform",v(o,a))):(_(this._cropContainer1,i,e),_(this._cropContainer2,o,a))}e&&(o(e.pan,s||this._thumbBounds),e.currZoomLevel=this._thumbBounds.w/e.width,t?this._animateTo(e.container,"transform",e.getCurrentTransform()):e.applyCurrentZoomPan())}_animateTo(t,i,s){if(!this._duration)return void(t.style[i]=s);const{animations:e}=this.pswp,o={duration:this._duration,easing:this.pswp.options.easing,onComplete:()=>{e.activeAnimations.length||this._onAnimationComplete()},target:t};o[i]=s,e.startTransition(o)}},K=class{constructor(t){this.pswp=t,t.events.add(t.element,"wheel",this._onWheel.bind(this))}_onWheel(t){t.preventDefault();const{currSlide:i}=this.pswp;let{deltaX:s,deltaY:e}=t;if(i&&!this.pswp.dispatch("wheel",{originalEvent:t}).defaultPrevented)if(t.ctrlKey||this.pswp.options.wheelToZoom){if(i.isZoomable()){let s=-e;1===t.deltaMode?s*=.05:s*=t.deltaMode?1:.002,s=2**s;const o=i.currZoomLevel*s;i.zoomTo(o,{x:t.clientX,y:t.clientY})}}else i.isPannable()&&(1===t.deltaMode&&(s*=18,e*=18),i.panTo(i.pan.x-s,i.pan.y-e))}},Y={allowPanToNext:!0,spacing:.1,loop:!0,pinchToClose:!0,closeOnVerticalDrag:!0,hideAnimationDuration:333,showAnimationDuration:333,zoomAnimationDuration:333,escKey:!0,arrowKeys:!0,trapFocus:!0,returnFocus:!0,maxWidthToAnimate:4e3,clickToCloseNonZoomable:!0,imageClickAction:"zoom-or-close",bgClickAction:"close",tapAction:"toggle-controls",doubleTapAction:"zoom",indexIndicatorSep:" / ",preloaderDelay:2e3,bgOpacity:.8,index:0,errorMsg:"The image cannot be loaded",preload:[1,2],easing:"cubic-bezier(.4,0,.22,1)"},j=class extends u{constructor(t){super(),this.options=this._prepareOptions(t||{}),this.offset={x:0,y:0},this._prevViewportSize={x:0,y:0},this.viewportSize={x:0,y:0},this.bgOpacity=1,this.currIndex=0,this.potentialIndex=0,this.isOpen=!1,this.isDestroying=!1,this.hasMouse=!1,this._initialItemData={},this._initialThumbBounds=void 0,this.topBar=void 0,this.element=void 0,this.template=void 0,this.container=void 0,this.scrollWrap=void 0,this.currSlide=void 0,this.events=new N,this.animations=new H,this.mainScroll=new $(this),this.gestures=new S(this),this.opener=new X(this),this.keyboard=new U(this),this.contentLoader=new l(this)}init(){if(this.isOpen||this.isDestroying)return!1;this.isOpen=!0,this.dispatch("init"),this.dispatch("beforeOpen"),this._createMainStructure();let t="pswp--open";return this.gestures.supportsTouch&&(t+=" pswp--touch"),this.options.mainClass&&(t+=` ${this.options.mainClass}`),this.element&&(this.element.className+=` ${t}`),this.currIndex=this.options.index||0,this.potentialIndex=this.currIndex,this.dispatch("firstUpdate"),this.scrollWheel=new K(this),(Number.isNaN(this.currIndex)||this.currIndex<0||this.currIndex>=this.getNumItems())&&(this.currIndex=0),this.gestures.supportsTouch||this.mouseDetected(),this.updateSize(),this.offset.y=window.pageYOffset,this._initialItemData=this.getItemData(this.currIndex),this.dispatch("gettingData",{index:this.currIndex,data:this._initialItemData,slide:void 0}),this._initialThumbBounds=this.getThumbBounds(),this.dispatch("initialLayout"),this.on("openingAnimationEnd",()=>{const{itemHolders:t}=this.mainScroll;t[0]&&(t[0].el.style.display="block",this.setContent(t[0],this.currIndex-1)),t[2]&&(t[2].el.style.display="block",this.setContent(t[2],this.currIndex+1)),this.appendHeavy(),this.contentLoader.updateLazy(),this.events.add(window,"resize",this._handlePageResize.bind(this)),this.events.add(window,"scroll",this._updatePageScrollOffset.bind(this)),this.dispatch("bindEvents")}),this.mainScroll.itemHolders[1]&&this.setContent(this.mainScroll.itemHolders[1],this.currIndex),this.dispatch("change"),this.opener.open(),this.dispatch("afterInit"),!0}getLoopedIndex(t){const i=this.getNumItems();return this.options.loop&&(t>i-1&&(t-=i),t<0&&(t+=i)),e(t,0,i-1)}appendHeavy(){this.mainScroll.itemHolders.forEach(t=>{t.slide?.appendHeavy()})}goTo(t){this.mainScroll.moveIndexBy(this.getLoopedIndex(t)-this.potentialIndex,!0)}next(){this.goTo(this.potentialIndex+1)}prev(){this.goTo(this.potentialIndex-1)}zoomTo(...t){this.currSlide?.zoomTo(...t)}toggleZoom(){this.currSlide?.toggleZoom()}close(){this.opener.isOpen&&!this.isDestroying&&(this.isDestroying=!0,this.dispatch("close"),this.events.removeAll(),this.opener.close())}destroy(){if(!this.isDestroying)return this.options.showHideAnimationType="none",void this.close();this.dispatch("destroy"),this._listeners={},this.scrollWrap&&(this.scrollWrap.ontouchmove=null,this.scrollWrap.ontouchend=null),this.element?.remove(),this.mainScroll.itemHolders.forEach(t=>{t.slide?.destroy()}),this.contentLoader.destroy(),this.events.removeAll()}refreshSlideContent(t){this.contentLoader.removeByIndex(t),this.mainScroll.itemHolders.forEach((i,s)=>{let e=(this.currSlide?.index??0)-1+s;this.canLoop()&&(e=this.getLoopedIndex(e)),e===t&&(this.setContent(i,t,!0),1===s&&(this.currSlide=i.slide,i.slide?.setIsActive(!0)))}),this.dispatch("change")}setContent(t,i,s){if(this.canLoop()&&(i=this.getLoopedIndex(i)),t.slide){if(t.slide.index===i&&!s)return;t.slide.destroy(),t.slide=void 0}!this.canLoop()&&(i<0||i>=this.getNumItems())||(t.slide=new T(this.getItemData(i),i,this),i===this.currIndex&&(this.currSlide=t.slide),t.slide.append(t.el))}getViewportCenterPoint(){return{x:this.viewportSize.x/2,y:this.viewportSize.y/2}}updateSize(t){if(this.isDestroying)return;const i=c(this.options,this);!t&&r(i,this._prevViewportSize)||(o(this._prevViewportSize,i),this.dispatch("beforeResize"),o(this.viewportSize,this._prevViewportSize),this._updatePageScrollOffset(),this.dispatch("viewportSize"),this.mainScroll.resize(this.opener.isOpen),!this.hasMouse&&window.matchMedia("(any-hover: hover)").matches&&this.mouseDetected(),this.dispatch("resize"))}applyBgOpacity(t){this.bgOpacity=Math.max(t,0),this.bg&&(this.bg.style.opacity=String(this.bgOpacity*this.options.bgOpacity))}mouseDetected(){this.hasMouse||(this.hasMouse=!0,this.element?.classList.add("pswp--has_mouse"))}_handlePageResize(){this.updateSize(),/iPhone|iPad|iPod/i.test(window.navigator.userAgent)&&setTimeout(()=>{this.updateSize()},500)}_updatePageScrollOffset(){this.setScrollOffset(0,window.pageYOffset)}setScrollOffset(t,i){this.offset.x=t,this.offset.y=i,this.dispatch("updateScrollOffset")}_createMainStructure(){this.element=p("pswp","div"),this.element.setAttribute("tabindex","-1"),this.element.setAttribute("role","dialog"),this.template=this.element,this.bg=p("pswp__bg","div",this.element),this.scrollWrap=p("pswp__scroll-wrap","section",this.element),this.container=p("pswp__container","div",this.scrollWrap),this.scrollWrap.setAttribute("aria-roledescription","carousel"),this.container.setAttribute("aria-live","off"),this.container.setAttribute("id","pswp__items"),this.mainScroll.appendHolders(),this.ui=new B(this),this.ui.init(),(this.options.appendToEl||document.body).appendChild(this.element)}getThumbBounds(){return function(t,i,s){const e=s.dispatch("thumbBounds",{index:t,itemData:i,instance:s});if(e.thumbBounds)return e.thumbBounds;const{element:o}=i;let n,a;if(o&&!1!==s.options.thumbSelector){const t=s.options.thumbSelector||"img";a=o.matches(t)?o:o.querySelector(t)}return a=s.applyFilters("thumbEl",a,i,t),a&&(n=i.thumbCropped?function(t,i,s){const e=t.getBoundingClientRect(),o=e.width/i,n=e.height/s,a=o>n?o:n,r=(e.width-i*a)/2,h=(e.height-s*a)/2,p={x:e.left+r,y:e.top+h,w:i*a};return p.innerRect={w:e.width,h:e.height,x:r,y:h},p}(a,i.width||i.w||0,i.height||i.h||0):function(t){const i=t.getBoundingClientRect();return{x:i.left,y:i.top,w:i.width}}(a)),s.applyFilters("thumbBounds",n,i,t)}(this.currIndex,this.currSlide?this.currSlide.data:this._initialItemData,this)}canLoop(){return this.options.loop&&this.getNumItems()>2}_prepareOptions(t){return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches&&(t.showHideAnimationType="none",t.zoomAnimationDuration=0),{...Y,...t}}};export{j as default};
package/react/BhU5cdLs.js DELETED
@@ -1 +0,0 @@
1
- function t(t,e,i){const s=document.createElement(e);return t&&(s.className=t),i&&i.appendChild(s),s}function e(t,e){return t.x=e.x,t.y=e.y,void 0!==e.id&&(t.id=e.id),t}function i(t){t.x=Math.round(t.x),t.y=Math.round(t.y)}function s(t,e){const i=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y);return Math.sqrt(i*i+s*s)}function n(t,e){return t.x===e.x&&t.y===e.y}function r(t,e,i){return Math.min(Math.max(t,e),i)}function a(t,e,i){let s=`translate3d(${t}px,${e||0}px,0)`;return void 0!==i&&(s+=` scale3d(${i},${i},1)`),s}function h(t,e,i,s){t.style.transform=a(e,i,s)}function o(t,e,i,s){t.style.transition=e?`${e} ${i}ms ${s||"cubic-bezier(.4,0,.22,1)"}`:"none"}function l(t,e,i){t.style.width="number"==typeof e?`${e}px`:e,t.style.height="number"==typeof i?`${i}px`:i}function d(t){o(t)}function c(t){return"decode"in t?t.decode().catch(()=>{}):t.complete?Promise.resolve(t):new Promise((e,i)=>{t.onload=()=>e(t),t.onerror=i})}var p="loading",m="loaded",u="error";function f(t){return"button"in t&&1===t.button||t.ctrlKey||t.metaKey||t.altKey||t.shiftKey}function y(t,e,i=document){let s=[];if(t instanceof Element)s=[t];else if(t instanceof NodeList||Array.isArray(t))s=Array.from(t);else{const n="string"==typeof t?t:e;n&&(s=Array.from(i.querySelectorAll(n)))}return s}function g(t){return"function"==typeof t&&t.prototype&&t.prototype.goTo}function x(){return!(!navigator.vendor||!navigator.vendor.match(/apple/i))}var v=class{constructor(e,i){if(this.element=t("pswp__img pswp__img--placeholder",e?"img":"div",i),e){const t=this.element;t.decoding="async",t.alt="",t.src=e,t.setAttribute("role","presentation")}this.element.setAttribute("aria-hidden","true")}setDisplayedSize(t,e){this.element&&("IMG"===this.element.tagName?(l(this.element,250,"auto"),this.element.style.transformOrigin="0 0",this.element.style.transform=a(0,0,t/250)):l(this.element,t,e))}destroy(){this.element?.parentNode&&this.element.remove(),this.element=null}},b=class{constructor(t,e,i){this.instance=e,this.data=t,this.index=i,this.element=void 0,this.placeholder=void 0,this.slide=void 0,this.displayedImageWidth=0,this.displayedImageHeight=0,this.width=Number(this.data.w)||Number(this.data.width)||0,this.height=Number(this.data.h)||Number(this.data.height)||0,this.isAttached=!1,this.hasSlide=!1,this.isDecoding=!1,this.state="idle",this.data.type?this.type=this.data.type:this.data.src?this.type="image":this.type="html",this.hash=this.data.hash,this.instance.dispatch("contentInit",{content:this})}removePlaceholder(){this.placeholder&&!this.keepPlaceholder()&&setTimeout(()=>{this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0)},1e3)}load(e,i){if(this.slide&&this.usePlaceholder())if(this.placeholder){const t=this.placeholder.element;t&&!t.parentElement&&this.slide.container.prepend(t)}else this.placeholder=new v(this.instance.applyFilters("placeholderSrc",!(!this.data.msrc||!this.slide.isFirstSlide)&&this.data.msrc,this),this.slide.container);this.element&&!i||this.instance.dispatch("contentLoad",{content:this,isLazy:e}).defaultPrevented||(this.isImageContent()?(this.element=t("pswp__img","img"),this.displayedImageWidth&&this.loadImage(e)):(this.element=t("pswp__content","div"),this.element.innerHTML=this.data.html||""),i&&this.slide&&this.slide.updateContentSize(!0))}loadImage(t){if(!this.isImageContent()||!this.element||this.instance.dispatch("contentLoadImage",{content:this,isLazy:t}).defaultPrevented)return;const e=this.element;this.updateSrcsetSizes(),this.data.srcset&&(e.srcset=this.data.srcset),e.src=this.data.src??"",e.alt=this.data.alt??"",this.state=p,e.complete?this.onLoaded():(e.onload=()=>{this.onLoaded()},e.onerror=()=>{this.onError()})}setSlide(t){this.slide=t,this.hasSlide=!0,this.instance=t.pswp}onLoaded(){this.state=m,this.slide&&this.element&&(this.instance.dispatch("loadComplete",{slide:this.slide,content:this}),this.slide.isActive&&this.slide.heavyAppended&&!this.element.parentNode&&(this.append(),this.slide.updateContentSize(!0)),this.state!==m&&this.state!==u||this.removePlaceholder())}onError(){this.state=u,this.slide&&(this.displayError(),this.instance.dispatch("loadComplete",{slide:this.slide,isError:!0,content:this}),this.instance.dispatch("loadError",{slide:this.slide,content:this}))}isLoading(){return this.instance.applyFilters("isContentLoading",this.state===p,this)}isError(){return this.state===u}isImageContent(){return"image"===this.type||"ad"===this.type}setDisplayedSize(t,e){if(this.element&&(this.placeholder&&this.placeholder.setDisplayedSize(t,e),!this.instance.dispatch("contentResize",{content:this,width:t,height:e}).defaultPrevented&&(l(this.element,t,e),this.isImageContent()&&!this.isError()))){const i=!this.displayedImageWidth&&t;this.displayedImageWidth=t,this.displayedImageHeight=e,i?this.loadImage(!1):this.updateSrcsetSizes(),this.slide&&this.instance.dispatch("imageSizeChange",{slide:this.slide,width:t,height:e,content:this})}}isZoomable(){return this.instance.applyFilters("isContentZoomable",this.isImageContent()&&this.state!==u,this)}updateSrcsetSizes(){if(!this.isImageContent()||!this.element||!this.data.srcset)return;const t=this.element,e=this.instance.applyFilters("srcsetSizesWidth",this.displayedImageWidth,this);(!t.dataset.largestUsedSize||e>parseInt(t.dataset.largestUsedSize,10))&&(t.sizes=`${e}px`,t.dataset.largestUsedSize=String(e))}usePlaceholder(){return this.instance.applyFilters("useContentPlaceholder",this.isImageContent(),this)}lazyLoad(){this.instance.dispatch("contentLazyLoad",{content:this}).defaultPrevented||this.load(!0)}keepPlaceholder(){return this.instance.applyFilters("isKeepingPlaceholder",this.isLoading(),this)}destroy(){this.hasSlide=!1,this.slide=void 0,this.instance.dispatch("contentDestroy",{content:this}).defaultPrevented||(this.remove(),this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0),this.isImageContent()&&this.element&&(this.element.onload=null,this.element.onerror=null,this.element=void 0))}displayError(){if(this.slide){let e=t("pswp__error-msg","div");e.innerText=this.instance.options?.errorMsg??"",e=this.instance.applyFilters("contentErrorElement",e,this),this.element=t("pswp__content pswp__error-msg-container","div"),this.element.appendChild(e),this.slide.container.innerText="",this.slide.container.appendChild(this.element),this.slide.updateContentSize(!0),this.removePlaceholder()}}append(){if(this.isAttached||!this.element)return;if(this.isAttached=!0,this.state===u)return void this.displayError();if(this.instance.dispatch("contentAppend",{content:this}).defaultPrevented)return;const t="decode"in this.element;this.isImageContent()?t&&this.slide&&(!this.slide.isActive||x())?(this.isDecoding=!0,this.element.decode().catch(()=>{}).finally(()=>{this.isDecoding=!1,this.appendImage()})):this.appendImage():this.slide&&!this.element.parentNode&&this.slide.container.appendChild(this.element)}activate(){!this.instance.dispatch("contentActivate",{content:this}).defaultPrevented&&this.slide&&(this.isImageContent()&&this.isDecoding&&!x()?this.appendImage():this.isError()&&this.load(!1,!0),this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","false"))}deactivate(){this.instance.dispatch("contentDeactivate",{content:this}),this.slide&&this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","true")}remove(){this.isAttached=!1,this.instance.dispatch("contentRemove",{content:this}).defaultPrevented||(this.element&&this.element.parentNode&&this.element.remove(),this.placeholder&&this.placeholder.element&&this.placeholder.element.remove())}appendImage(){this.isAttached&&(this.instance.dispatch("contentAppendImage",{content:this}).defaultPrevented||(this.slide&&this.element&&!this.element.parentNode&&this.slide.container.appendChild(this.element),this.state!==m&&this.state!==u||this.removePlaceholder()))}};function I(t,e){if(t.getViewportSizeFn){const i=t.getViewportSizeFn(t,e);if(i)return i}return{x:document.documentElement.clientWidth,y:window.innerHeight}}function w(t,e,i,s,n){let r=0;if(e.paddingFn)r=e.paddingFn(i,s,n)[t];else if(e.padding)r=e.padding[t];else{const i=`padding${t[0].toUpperCase()}${t.slice(1)}`;e[i]&&(r=e[i])}return Number(r)||0}function S(t,e,i,s){return{x:e.x-w("left",t,e,i,s)-w("right",t,e,i,s),y:e.y-w("top",t,e,i,s)-w("bottom",t,e,i,s)}}var _=class{constructor(t,e,i,s){this.pswp=s,this.options=t,this.itemData=e,this.index=i,this.panAreaSize=null,this.elementSize=null,this.fit=1,this.fill=1,this.vFill=1,this.initial=1,this.secondary=1,this.max=1,this.min=1}update(t,e,i){const s={x:t,y:e};this.elementSize=s,this.panAreaSize=i;const n=i.x/s.x,r=i.y/s.y;this.fit=Math.min(1,n<r?n:r),this.fill=Math.min(1,n>r?n:r),this.vFill=Math.min(1,r),this.initial=this._getInitial(),this.secondary=this._getSecondary(),this.max=Math.max(this.initial,this.secondary,this._getMax()),this.min=Math.min(this.fit,this.initial,this.secondary),this.pswp&&this.pswp.dispatch("zoomLevelsUpdate",{zoomLevels:this,slideData:this.itemData})}_parseZoomLevelOption(t){const e=`${t}ZoomLevel`,i=this.options[e];if(i)return"function"==typeof i?i(this):"fill"===i?this.fill:"fit"===i?this.fit:Number(i)}_getSecondary(){let t=this._parseZoomLevelOption("secondary");return t||(t=Math.min(1,3*this.fit),this.elementSize&&t*this.elementSize.x>4e3&&(t=4e3/this.elementSize.x),t)}_getInitial(){return this._parseZoomLevelOption("initial")||this.fit}_getMax(){return this._parseZoomLevelOption("max")||Math.max(1,4*this.fit)}};function P(t,e,i){const s=e.createContentFromData(t,i);let n;const{options:r}=e;if(r){let a;n=new _(r,t,-1),a=e.pswp?e.pswp.viewportSize:I(r,e);const h=S(r,a,t,i);n.update(s.width,s.height,h)}return s.lazyLoad(),n&&s.setDisplayedSize(Math.ceil(s.width*n.initial),Math.ceil(s.height*n.initial)),s}function C(t,e){const i=e.getItemData(t);if(!e.dispatch("lazyLoadSlide",{index:t,itemData:i}).defaultPrevented)return P(i,e,t)}var z=class{constructor(t){this.pswp=t,this.limit=Math.max(t.options.preload[0]+t.options.preload[1]+1,5),this._cachedItems=[]}updateLazy(t){const{pswp:e}=this;if(e.dispatch("lazyLoad").defaultPrevented)return;const{preload:i}=e.options,s=void 0===t||t>=0;let n;for(n=0;n<=i[1];n++)this.loadSlideByIndex(e.currIndex+(s?n:-n));for(n=1;n<=i[0];n++)this.loadSlideByIndex(e.currIndex+(s?-n:n))}loadSlideByIndex(t){const e=this.pswp.getLoopedIndex(t);let i=this.getContentByIndex(e);i||(i=C(e,this.pswp),i&&this.addToCache(i))}getContentBySlide(t){let e=this.getContentByIndex(t.index);return e||(e=this.pswp.createContentFromData(t.data,t.index),this.addToCache(e)),e.setSlide(t),e}addToCache(t){if(this.removeByIndex(t.index),this._cachedItems.push(t),this._cachedItems.length>this.limit){const t=this._cachedItems.findIndex(t=>!t.isAttached&&!t.hasSlide);-1!==t&&this._cachedItems.splice(t,1)[0].destroy()}}removeByIndex(t){const e=this._cachedItems.findIndex(e=>e.index===t);-1!==e&&this._cachedItems.splice(e,1)}getContentByIndex(t){return this._cachedItems.find(e=>e.index===t)}destroy(){this._cachedItems.forEach(t=>t.destroy()),this._cachedItems=[]}},L=class{constructor(t,e){this.type=t,this.defaultPrevented=!1,e&&Object.assign(this,e)}preventDefault(){this.defaultPrevented=!0}},E=class{constructor(){this._listeners={},this._filters={},this.pswp=void 0,this.options=void 0}addFilter(t,e,i=100){this._filters[t]||(this._filters[t]=[]),this._filters[t]?.push({fn:e,priority:i}),this._filters[t]?.sort((t,e)=>t.priority-e.priority),this.pswp?.addFilter(t,e,i)}removeFilter(t,e){this._filters[t]&&(this._filters[t]=this._filters[t].filter(t=>t.fn!==e)),this.pswp&&this.pswp.removeFilter(t,e)}applyFilters(t,...e){return this._filters[t]?.forEach(t=>{e[0]=t.fn.apply(this,e)}),e[0]}on(t,e){this._listeners[t]||(this._listeners[t]=[]),this._listeners[t]?.push(e),this.pswp?.on(t,e)}off(t,e){this._listeners[t]&&(this._listeners[t]=this._listeners[t].filter(t=>e!==t)),this.pswp?.off(t,e)}dispatch(t,e){if(this.pswp)return this.pswp.dispatch(t,e);const i=new L(t,e);return this._listeners[t]?.forEach(t=>{t.call(this,i)}),i}},O=class extends E{getNumItems(){let t=0;const e=this.options?.dataSource;e&&"length"in e?t=e.length:e&&"gallery"in e&&(e.items||(e.items=this._getGalleryDOMElements(e.gallery)),e.items&&(t=e.items.length));const i=this.dispatch("numItems",{dataSource:e,numItems:t});return this.applyFilters("numItems",i.numItems,e)}createContentFromData(t,e){return new b(t,this,e)}getItemData(t){const e=this.options?.dataSource;let i={};Array.isArray(e)?i=e[t]:e&&"gallery"in e&&(e.items||(e.items=this._getGalleryDOMElements(e.gallery)),i=e.items[t]);let s=i;s instanceof Element&&(s=this._domElementToItemData(s));const n=this.dispatch("itemData",{itemData:s||{},index:t});return this.applyFilters("itemData",n.itemData,t)}_getGalleryDOMElements(t){return this.options?.children||this.options?.childSelector?y(this.options.children,this.options.childSelector,t)||[]:[t]}_toLowerCaseFirstLetter(t){return t?t.charAt(0).toLowerCase()+t.slice(1):t}_domElementToItemData(t){const e={element:t},i="A"===t.tagName?t:t.querySelector("a");if(i){e.src=i.dataset.pswpSrc||i.href,i.dataset.pswpSrcset&&(e.srcset=i.dataset.pswpSrcset),e.width=i.dataset.pswpWidth?parseInt(i.dataset.pswpWidth,10):0,e.height=i.dataset.pswpHeight?parseInt(i.dataset.pswpHeight,10):0,i.dataset.pswpType&&(e.type=i.dataset.pswpType.toLowerCase());const s=t.querySelector("img");s&&(e.msrc=s.currentSrc||s.src,e.alt=s.getAttribute("alt")??""),(i.dataset.pswpCropped||i.dataset.cropped)&&(e.thumbCropped=!0);const n=["element","src","srcset","width","height","type","msrc","alt","thumbCropped"];Object.keys(i.dataset).filter(t=>t.startsWith("pswp")&&!n.includes(this._toLowerCaseFirstLetter(t.slice(4)))).forEach(t=>{e[this._toLowerCaseFirstLetter(t.slice(4))]=i.dataset[t]})}return this.applyFilters("domItemData",e,t,i)}lazyLoadData(t,e){return P(t,this,e)}};Object.defineProperty(exports,"ContentLoader",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"PhotoSwipeBase",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"ZoomLevel",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"clamp",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"createElement",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"decodeImage",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"equalizePoints",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"getDistanceBetween",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"getElementsFromOption",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"getPanAreaSize",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"getViewportSize",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"isPswpClass",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"lazyLoadSlide",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"parsePaddingOption",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"pointsEqual",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"removeTransitionStyle",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"roundPoint",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"setTransform",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"setTransitionStyle",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"specialKeyUsed",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"toTransformString",{enumerable:!0,get:function(){return a}});
package/react/C1A9nC-v.js DELETED
@@ -1,16 +0,0 @@
1
- import{Ct as t,D as e,E as n,N as i,T as s,_t as o,a as r,b as a,bt as l,c,dt as d,ft as h,gt as p,h as u,l as m,mt as g,n as f,pt as w,t as y,u as T,ut as v,xt as b}from"./QPXxc9eb.js";import{a as x,n as k,o as _}from"./BXe4I1MJ.js";import{a as q,n as S,r as E,t as C}from"./CNAEfadS.js";import{a as I,c as L,f as A,i as N,l as M,n as B,p as V,r as z,s as R,t as O,u as D}from"./DDbNaN3e.js";import{createElement as P,forwardRef as $,useCallback as H,useMemo as F,useReducer as U,useRef as j,useState as W}from"react";import{jsx as G,jsxs as K}from"react/jsx-runtime";function Y(t,e){const[n,i]=t;if(n===e)return t;if(void 0!==i&&void 0!==e&&void 0!==n&&e===i&&Math.abs(e-n)<=20){const s=Math.min(n,e),o=Math.max(n,e);return s===n&&o===i?t:[s,o]}return[e,n]}function Z(t,e,n){const[[i],s]=U(Y,[n]),o=function(t){const[e,n]=W(t);return t===e||t&&e&&t.length===e.length&&!t.some((t,n)=>t!==e[n])?e:(n(t),t)}(e),r=j(void 0);return{containerRef:H(e=>{r.current?.disconnect(),r.current=void 0;const n=()=>s(function(t,e){let n=t?.clientWidth;if(void 0!==n&&e&&e.length>0){const t=[...e.filter(t=>t>0)].sort((t,e)=>e-t);t.push(Math.floor(t[t.length-1]/2)),n=t.find((e,i)=>e<=n||i===t.length-1)}return n}(e,o));n(),e&&"undefined"!=typeof ResizeObserver&&(r.current=new ResizeObserver(n),r.current.observe(e)),"function"==typeof t?t(e):t&&(t.current=e)},[t,o]),containerWidth:i}}function Q(t){return["react-photo-album",t].filter(Boolean).join("--")}function J({width:t,height:e}){const n=t/e;return Number.isFinite(n)?n:1}var X=Object.freeze([1200,600,300,0]);function tt(t,e){return"function"==typeof t?t(e):t}function et(t,e){return void 0!==e?tt(t,e):void 0}function nt(t,e,n,i=0){if(void 0===e)return;const s=et(t,e);return Math.round(Math.max(void 0===s?function(t,e){const n=X.findIndex(t=>t<=e);return tt(t[Math.max(n,0)],e)}(n,e):s,i))}function it(t,{spacing:e,padding:n,componentsProps:i,render:s}){return{spacing:nt(e,t,[20,15,10,5]),padding:nt(n,t,[0,0,0,0]),componentsProps:tt(i,t)||{},render:tt(s,t)}}function st(t,e=0){const n=10**e;return Math.round((t+Number.EPSILON)*n)/n}function ot(t,e,n,i,s,o,r){let a,l;const c=t=>{const e=o*(s-1)+2*r*s;return`calc((${t.match(/^\s*calc\((.*)\)\s*$/)?.[1]??t} - ${e}px) / ${st((i-e)/n,5)})`},d=t.srcSet;return d&&d.length>0&&(a=d.concat(d.some(({width:e})=>e===t.width)?[]:[{src:t.src,width:t.width,height:t.height}]).sort((t,e)=>t.width-e.width).map(t=>`${t.src} ${t.width}w`).join(", ")),l=e?.size?(e.sizes||[]).map(({viewport:t,size:e})=>`${t} ${c(e)}`).concat(c(e.size)).join(", "):`${Math.ceil(n/i*100)}vw`,{srcSet:a,sizes:l}}var rt=$(function({as:t,render:e,context:n,classes:i=[],variables:s={},style:o,className:r,children:a,...l},c){const d=function(...t){return t.filter(Boolean).join(" ")}(...(Array.isArray(i)?i:[i]).filter(t=>"string"==typeof t).map(Q),r),h={style:{...Object.fromEntries(Object.entries(s).map(([t,e])=>{return[(n=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),`--${Q(n)}`),"number"==typeof e?st(e,5):e];var n})),...o},className:d,children:a,...l};if(e){const t=e({ref:c,...h},n);if(t)return t}return G(t||"div",{ref:c,...h})}),at=$(function({photo:t,index:e,width:n,height:i,onClick:s,render:{wrapper:o,link:r,button:a,image:l,extras:c}={},componentsProps:{link:d,button:h,wrapper:p,image:u}={}},m){const{href:g}=t,f={photo:t,index:e,width:st(n,3),height:st(i,3)};let w;return w=g?{...d,as:"a",render:r,classes:["photo","link"],href:g,onClick:s}:s?{...h,as:"button",type:"button",render:a,classes:["photo","button"],onClick:s}:{...p,render:o,classes:"photo"},K(rt,{ref:m,variables:{photoWidth:f.width,photoHeight:f.height},context:f,...w,children:[G(rt,{as:"img",classes:"image",render:l,context:f,...u}),c?.({},f)]})}),lt=$(function({layout:t,sizes:e,model:n,skeleton:i,onClick:s,render:{container:o,track:r,photo:a,...l}={},componentsProps:{container:c,track:d,link:h,button:p,wrapper:u,image:m}={}},g){const{spacing:f,padding:w,containerWidth:y,tracks:T,variables:v,horizontal:b}=n||{};return K(rt,{role:"group","aria-label":"Photo album",...c,variables:{spacing:f,padding:w,containerWidth:y,...v},classes:["",t],render:o,ref:g,children:[void 0!==f&&void 0!==w&&void 0!==y&&T?.map(({photos:t,variables:n},i)=>{const o=t.length,c=b?o:T.length;return P(rt,{...d,key:i,render:r,classes:"track",variables:{trackSize:o,...n}},t.map(t=>{const{photo:n,index:i,width:o}=t,{key:r,src:d,alt:g="",title:T,label:v}=n,b=s?t=>{s({event:t,photo:n,index:i})}:void 0;if(a){const e=a({onClick:b},t);if(e)return e}const x=t=>v?{"aria-label":v,...t}:t;return G(at,{onClick:b,render:l,componentsProps:{image:{loading:"lazy",decoding:"async",src:d,alt:g,title:T,...ot(n,e,o,y,c,f,w),...tt(m,t)},link:x(tt(h,t)),button:x(tt(p,t)),wrapper:tt(u,t)},...t},r??i)}))}),void 0===y&&i]})});function ct(t,e,n){return function(t,e){if(!t)return;const n=[];for(let i=e;void 0!==i;i=t.get(i))n.push(i);return n.reverse()}(function(t,e,n){const i=/* @__PURE__ */new Map,s=/* @__PURE__ */new Set,o=/* @__PURE__ */new Map;o.set(e,0);const r=function(t){let e=0;const n=[],i=(e,i)=>t(n[e],n[i])<0,s=(t,e)=>{const i=n[t];n[t]=n[e],n[e]=i};return{push:t=>{e+=1,n[e]=t,(t=>{let e=t,n=Math.floor(e/2);for(;e>1&&i(n,e);)s(n,e),e=n,n=Math.floor(e/2)})(e)},pop:()=>{if(0===e)return;s(1,e),e-=1;const t=n.pop();return(()=>{let t=1,n=2*t;for(;n<=e&&(n<e&&i(n,n+1)&&(n+=1),i(t,n));)s(t,n),t=n,n=2*t})(),t},size:()=>e}}((a=t=>t[1],(t,e)=>a(e)-a(t)));var a;for(r.push([e,0]);r.size()>0;){const[e,n]=r.pop();if(!s.has(e)){const a=t(e);s.add(e),a.forEach((t,s)=>{const a=n+t,l=i.get(s),c=o.get(s);(void 0===c||c>a&&(c/a>1.005||void 0!==l&&l<e))&&(o.set(s,a),r.push([s,a]),i.set(s,e))})}}return o.has(n)?i:void 0}(t,e,n),n)}function dt(t,e,n,i){return(e-(t.length-1)*n-2*i*t.length)/t.reduce((t,e)=>t+J(e),0)}function ht(t,e,n,i,s,o,r){const a=t.slice(e,n),l=dt(a,i,s,o);return l>0?(l-r)**2*a.length:void 0}var pt=$(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:o,containerWidth:r}=Z(s,e,n),{spacing:a,padding:l,targetRowHeight:c,minPhotos:d,maxPhotos:h,...p}=function(t,{photos:e,targetRowHeight:n,rowConstraints:i,...s}){const{spacing:o,padding:r,componentsProps:a,render:l}=it(t,s),{singleRowMaxHeight:c,minPhotos:d,maxPhotos:h}=et(i,t)||{};if(void 0!==c&&void 0!==o&&void 0!==r){const t=Math.floor(e.reduce((t,{width:e,height:n})=>t+e/n*c+2*r,o*(e.length-1)));t>0&&(a.container={...a.container},a.container.style={maxWidth:t,...a.container.style})}return{...s,targetRowHeight:nt(n,t,[t=>t/5,t=>t/4,t=>t/3,t=>t/2]),render:l,spacing:o,padding:r,minPhotos:d,maxPhotos:h,componentsProps:a}}(r,{photos:t,...i});return G(lt,{layout:"rows",ref:o,model:F(()=>void 0!==r&&void 0!==a&&void 0!==l&&void 0!==c?function(t,e,n,i,s,o,r){const a=ct(function(t,e,n,i,s,o,r,a){return l=>{const c=/* @__PURE__ */new Map;c.set(l,0);const d=r||1,h=Math.min(o,a||1/0);for(let o=l+d;o<t.length+1&&!(o-l>h);o+=1){const r=ht(t,l,o,i,e,n,s);if(void 0===r)break;c.set(o,r)}return c}}(t,e,n,i,s,function(t,e,n,i){return st(e/n/Math.min(...t.map(t=>J(t))))+(i||0)+2}(t,i,s,o),o,r),0,t.length);if(!a)return;const l=[];for(let c=1;c<a.length;c+=1){const s=t.slice(a[c-1],a[c]).map((t,e)=>({photo:t,index:a[c-1]+e})),o=dt(s.map(({photo:t})=>t),i,e,n);l.push({photos:s.map(({photo:t,index:e})=>({photo:t,index:e,width:o*J(t),height:o}))})}return{spacing:e,padding:n,containerWidth:i,tracks:l,horizontal:!0}}(t,a,l,r,c,d,h):void 0,[t,a,l,r,c,d,h]),...p})});function ut(t,e,n,i,s,o,r){const a=[],l=r.reduce((t,e)=>t+e,0);for(let c=0;c<t.length-1;c+=1){const d=e.slice(t[c],t[c+1]).map((e,n)=>({photo:e,index:t[c]+n})),h=r.reduce((t,e,n)=>t+(o[c]-o[n])*e,0),p=(s-(t.length-2)*n-2*(t.length-1)*i-h)*r[c]/l;a.push({photos:d.map(({photo:t,index:e})=>({photo:t,index:e,width:p,height:p/J(t)})),variables:{adjustedGaps:h,columnRatio:r[c]}})}return{tracks:a,variables:{totalRatio:l}}}function mt(t,e,n,i,s,o){const r=[],a=[];if(t.length<=o){const s=t.length>0?t.reduce((t,e)=>t+J(e),0)/t.length:1;for(let e=0;e<o;e+=1)r[e]=2*n,a[e]=e<t.length?J(t[e]):s;return ut(Array.from({length:o+1},(e,n)=>Math.min(n,t.length)),t,e,n,i,r,a)}const l=(c=function(t,e,n,i,s){return o=>{const r=[],a=1.5*s;let l=i/J(t[o])+2*n;for(let c=o+1;c<t.length+1&&(r.push([c,(s-l)**2]),!(l>a||c===t.length));c+=1)l+=i/J(t[c])+e+2*n;return r}}(t,e,n,s,(t.reduce((t,e)=>t+s/J(e),0)+e*(t.length-o)+2*n*t.length)/o),d=o,h=0,p=t.length,function(t,e,n){const i=[n];for(let s=n,o=e;o>0;o-=1)[s]=t.get(s)[o],i.push(s);return i.reverse()}(function(t,e,n,i){const s=/* @__PURE__ */new Map,o=/* @__PURE__ */new Set;o.add(n);for(let r=0;r<e;r+=1){const n=[...o.keys()];o.clear(),n.forEach(n=>{const a=r>0?s.get(n)[r][1]:0;t(n).forEach(([t,l])=>{let c=s.get(t);c||(c=[],s.set(t,c));const d=a+l,h=c[r+1];(!h||h[1]>d&&(h[1]/d>1.0001||n<h[0]))&&(c[r+1]=[n,d]),r<e-1&&t!==i&&o.add(t)})})}return s}(c,d,h,p),d,p));var c,d,h,p;for(let u=0;u<l.length-1;u+=1){const i=t.slice(l[u],l[u+1]);r[u]=e*(i.length-1)+2*n*i.length,a[u]=1/i.reduce((t,e)=>t+1/J(e),0)}return ut(l,t,e,n,i,r,a)}function gt(t,e,n,i,s){const{tracks:o,variables:r}=mt(t,e,n,i,(i-e*(s-1)-2*n*s)/s,s);return o.some(t=>t.photos.some(({width:t,height:e})=>t<=0||e<=0))?s>1?gt(t,e,n,i,s-1):void 0:{tracks:o,spacing:e,padding:n,containerWidth:i,variables:{columns:s,...r}}}var ft=$(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:o,containerWidth:r}=Z(s,e,n),{spacing:a,padding:l,columns:c,...d}=function(t,{columns:e,...n}){return{...n,...it(t,n),columns:nt(e,t,[5,4,3,2],1)}}(r,{photos:t,...i});return G(lt,{layout:"columns",ref:o,model:F(()=>void 0!==r&&void 0!==a&&void 0!==l&&void 0!==c?gt(t,a,l,r,c):void 0,[t,a,l,r,c]),...d})});function wt(t,e,n,i,s){const o=(i-e*(s-1)-2*n*s)/s;if(o<=0)return s>1?wt(t,e,n,i,s-1):void 0;const r=[];for(let l=0;l<s;l+=1)r[l]=0;const a=t.reduce((t,i,s)=>{const a=r.reduce((t,e,n)=>e<r[t]-1?n:t,0);return r[a]=r[a]+o/J(i)+e+2*n,t[a].push({photo:i,index:s}),t},Array.from({length:s},()=>[]));return{spacing:e,padding:n,containerWidth:i,variables:{columns:s},tracks:a.map(t=>({photos:t.map(({photo:t,index:e})=>({photo:t,index:e,width:o,height:o/J(t)}))}))}}var yt=$(function({photos:t,breakpoints:e,defaultContainerWidth:n,...i},s){const{containerRef:o,containerWidth:r}=Z(s,e,n),{spacing:a,padding:l,columns:c,...d}=function(t,{columns:e,...n}){return{...n,...it(t,n),columns:nt(e,t,[5,4,3,2],1)}}(r,{photos:t,...i});return G(lt,{layout:"masonry",ref:o,model:F(()=>void 0!==r&&void 0!==a&&void 0!==l&&void 0!==c?wt(t,a,l,r,c):void 0,[t,a,l,r,c]),...d})});function Tt(t){return t?String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"):""}var vt=class{constructor(t,e={}){this.lightbox=t,this.aiSummaryVisible=!1,this.currentSummary=null,this.options={aiSummaryButtonOrder:7,width:"400px",height:"300px",transition:"0.3s ease",...e},document.head.insertAdjacentHTML("beforeend",`<style>\n .pswp__ai-summary-panel {\n background: rgba(30, 30, 30, 0.9);\n color: white;\n position: absolute;\n overflow-y: auto;\n z-index: 1;\n transition: transform ${this.options.transition};\n box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);\n padding: 20px;\n }\n\n /* Desktop styles */\n @media (min-width: 768px) {\n .pswp__ai-summary-panel {\n top: 0;\n right: 0;\n height: 100%;\n width: ${this.options.width};\n transform: translateX(100%);\n }\n\n .pswp__ai-summary-panel.visible {\n transform: translateX(0);\n }\n\n .pswp__container.shifted-for-ai-summary {\n transform: translateX(-${this.options.width});\n transition: transform ${this.options.transition};\n }\n }\n\n /* Mobile styles */\n @media (max-width: 767px) {\n .pswp__ai-summary-panel {\n bottom: 0;\n left: 0;\n width: 100%;\n height: ${this.options.height};\n transform: translateY(100%);\n }\n\n .pswp__ai-summary-panel.visible {\n transform: translateY(0);\n }\n\n .pswp__container.shifted-for-ai-summary {\n transform: translateY(-${this.options.height});\n transition: transform ${this.options.transition};\n }\n }\n\n .pswp__ai-summary-close {\n position: absolute;\n top: 10px;\n right: 10px;\n width: 32px;\n height: 32px;\n opacity: 0.6;\n cursor: pointer;\n z-index: 2;\n background: rgba(0, 0, 0, 0.3);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: opacity 0.3s;\n }\n\n .pswp__ai-summary-close:hover {\n opacity: 1;\n }\n\n .pswp__ai-summary-close:before,\n .pswp__ai-summary-close:after {\n position: absolute;\n content: '';\n width: 16px;\n height: 2px;\n background-color: white;\n }\n\n .pswp__ai-summary-close:before {\n transform: rotate(45deg);\n }\n\n .pswp__ai-summary-close:after {\n transform: rotate(-45deg);\n }\n\n .pswp__ai-summary-content {\n margin-top: 20px;\n }\n\n .pswp__ai-summary-title {\n margin-bottom: 16px;\n font-size: 18px;\n font-weight: bold;\n padding-right: 30px; /* Add space for the close button */\n }\n\n .pswp__ai-summary-section {\n margin-bottom: 16px;\n }\n\n .pswp__ai-summary-section-title {\n font-weight: bold;\n margin-bottom: 8px;\n }\n\n .pswp__ai-summary-label {\n display: inline-flex;\n align-items: center;\n background: rgba(255, 255, 255, 0.1);\n border-radius: 12px;\n padding: 4px 12px;\n margin-right: 8px;\n margin-bottom: 8px;\n font-size: 14px;\n }\n\n .pswp__ai-summary-description {\n font-size: 14px;\n line-height: 1.5;\n }\n\n .pswp__ai-summary-empty {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n color: rgba(255, 255, 255, 0.6);\n font-style: italic;\n }\n\n .pswp__ai-summary-bing-search {\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 8px;\n z-index: 2;\n }\n\n .pswp__ai-summary-bing-button {\n height: 32px;\n background: rgba(255, 255, 255, 0.2);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: background-color 0.3s;\n }\n\n .pswp__ai-summary-bing-button:hover {\n background: rgba(255, 255, 255, 0.4);\n }\n\n .pswp__ai-summary-bing-icon {\n width: 20px;\n height: 20px;\n }\n\n .pswp__ai-summary-disclaimer {\n font-size: 12px;\n color: rgba(255, 255, 255, 0.7);\n text-align: center;\n margin-top: 32px;\n padding: 0 10px;\n line-height: 1.4;\n font-style: italic;\n }\n </style>`),t.on("init",()=>{this.initPswpEvents(t.pswp)})}initPswpEvents(t){t.on("uiRegister",()=>{t.ui.registerElement({name:"ai-summary-toggle-button",title:"Toggle AI summary view",order:this.options.aiSummaryButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24">\n <use class="pswp__icn-shadow" xlink:href="#pswp__icn-ai-summary"/>\n <path d="M12 17q.425 0 .713-.288T13 16v-4q0-.425-.288-.712T12 11t-.712.288T11 12v4q0 .425.288.713T12 17m0-8q.425 0 .713-.288T13 8t-.288-.712T12 7t-.712.288T11 8t.288.713T12 9m0 13q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m0-8"/>\n </svg>',onClick:()=>{this.toggleAISummary(t)}}),t.ui.registerElement({name:"ai-summary-panel",isButton:!1,appendTo:"root",html:'<div class="pswp__ai-summary-panel"><div class="pswp__ai-summary-close"></div></div>'})}),t.on("change",()=>{this.aiSummaryVisible&&this.updateAISummary(t)}),t.on("close",()=>{this.hideAISummary(t)}),t.on("firstUpdate",()=>{const e=t.element.querySelector(".pswp__ai-summary-close");e&&e.addEventListener("click",()=>{this.hideAISummary(t)})})}toggleAISummary(t){this.aiSummaryVisible?this.hideAISummary(t):this.showAISummary(t)}showAISummary(t){const e=t.container,n=t.element.querySelector(".pswp__ai-summary-panel");n&&(this.aiSummaryVisible=!0,n.classList.add("visible"),e.classList.add("shifted-for-ai-summary"),this.updateAISummary(t))}hideAISummary(t){const e=t.container,n=t.element.querySelector(".pswp__ai-summary-panel");n&&(this.aiSummaryVisible=!1,n.classList.remove("visible"),e.classList.remove("shifted-for-ai-summary"))}updateAISummary(t){if(!t.currSlide)return;const e=t.element.querySelector(".pswp__ai-summary-panel");if(!e)return;const n=t.currSlide.data,i=n.src||n.url||"";let s=null;try{n.contentSummary&&(s=JSON.parse(n.contentSummary),this.currentSummary=s)}catch(r){console.error("Error parsing AI summary data:",r)}const o=i?`<a class="pswp__ai-summary-bing-search" href="https://www.bing.com/images/search?view=detailv2&iss=SBI&form=SBIIRP&sbisrc=UrlPaste&q=imgurl:${encodeURIComponent(i)}&idpbck=1&selectedindex=0&id=${encodeURIComponent(i)}&mediaurl=${encodeURIComponent(i)}" target="_blank" rel="noopener noreferrer" class="pswp__ai-summary-bing-button">\n <svg xmlns="http://www.w3.org/2000/svg" style="height:24px;width:24px" width="256" height="388" viewBox="0 0 256 388"><defs><radialGradient id="logosBing0" cx="93.717%" cy="77.818%" r="143.121%" fx="93.717%" fy="77.818%" gradientTransform="scale(-1 -.71954)rotate(49.091 2.036 -2.204)"><stop offset="0%" stop-color="#00cacc"/><stop offset="100%" stop-color="#048fce"/></radialGradient><radialGradient id="logosBing1" cx="13.893%" cy="71.448%" r="150.086%" fx="13.893%" fy="71.448%" gradientTransform="matrix(.55155 -.39387 .23634 .91917 -.107 .112)"><stop offset="0%" stop-color="#00bbec"/><stop offset="100%" stop-color="#2756a9"/></radialGradient><linearGradient id="logosBing2" x1="50%" x2="50%" y1="0%" y2="100%"><stop offset="0%" stop-color="#00bbec"/><stop offset="100%" stop-color="#2756a9"/></linearGradient></defs><path fill="url(#logosBing0)" d="M129.424 122.047c-7.133.829-12.573 6.622-13.079 13.928c-.218 3.147-.15 3.36 6.986 21.722c16.233 41.774 20.166 51.828 20.827 53.243c1.603 3.427 3.856 6.65 6.672 9.544c2.16 2.22 3.585 3.414 5.994 5.024c4.236 2.829 6.337 3.61 22.818 8.49c16.053 4.754 24.824 7.913 32.381 11.664c9.791 4.86 16.623 10.387 20.944 16.946c3.1 4.706 5.846 13.145 7.04 21.64c.468 3.321.47 10.661.006 13.663c-1.008 6.516-3.021 11.976-6.101 16.545c-1.638 2.43-1.068 2.023 1.313-.939c6.74-8.379 13.605-22.7 17.108-35.687c4.24-15.718 4.817-32.596 1.66-48.57c-6.147-31.108-25.786-57.955-53.444-73.06c-1.738-.95-8.357-4.42-17.331-9.085a1633 1633 0 0 1-4.127-2.154c-.907-.477-2.764-1.447-4.126-2.154c-1.362-.708-5.282-2.75-8.711-4.539l-8.528-4.446a6021 6021 0 0 1-8.344-4.357c-8.893-4.655-12.657-6.537-13.73-6.863c-1.125-.343-3.984-.782-4.701-.723c-.152.012-.838.088-1.527.168"/><path fill="url(#logosBing1)" d="M148.81 277.994c-.493.292-1.184.714-1.537.938c-.354.225-1.137.712-1.743 1.083a8315 8315 0 0 0-13.204 8.137a2848 2848 0 0 0-8.07 4.997a388 388 0 0 1-3.576 2.198c-.454.271-2.393 1.465-4.31 2.654a2652 2652 0 0 1-7.427 4.586a3958 3958 0 0 0-8.62 5.316a3011 3011 0 0 1-7.518 4.637c-1.564.959-3.008 1.885-3.21 2.058c-.3.257-14.205 8.87-21.182 13.121c-5.3 3.228-11.43 5.387-17.705 6.235c-2.921.395-8.45.396-11.363.003c-7.9-1.067-15.176-4.013-21.409-8.666c-2.444-1.826-7.047-6.425-8.806-8.8c-4.147-5.598-6.829-11.602-8.218-18.396c-.32-1.564-.622-2.884-.672-2.935c-.13-.13.105 2.231.528 5.319c.44 3.211 1.377 7.856 2.387 11.829c7.814 30.743 30.05 55.749 60.15 67.646c8.668 3.424 17.415 5.582 26.932 6.64c3.576.4 13.699.56 17.43.276c17.117-1.296 32.02-6.334 47.308-15.996c1.362-.86 3.92-2.474 5.685-3.585a877 877 0 0 0 4.952-3.14c.958-.615 2.114-1.341 2.567-1.614a91 91 0 0 0 2.018-1.268c.656-.424 3.461-2.2 6.235-3.944l11.092-7.006l3.809-2.406l.137-.086l.42-.265l.199-.126l2.804-1.771l9.69-6.121c12.348-7.759 16.03-10.483 21.766-16.102c2.392-2.342 5.997-6.34 6.176-6.848c.037-.104.678-1.092 1.424-2.197c3.036-4.492 5.06-9.995 6.064-16.484c.465-3.002.462-10.342-.005-13.663c-.903-6.42-2.955-13.702-5.167-18.339c-3.627-7.603-11.353-14.512-22.453-20.076c-3.065-1.537-6.23-2.943-6.583-2.924c-.168.009-10.497 6.322-22.954 14.03c-12.457 7.71-23.268 14.4-24.025 14.87s-2.056 1.263-2.888 1.764z"/><path fill="url(#logosBing2)" d="m.053 241.013l.054 53.689l.695 3.118c2.172 9.747 5.937 16.775 12.482 23.302c3.078 3.07 5.432 4.922 8.768 6.896c7.06 4.177 14.657 6.238 22.978 6.235c8.716-.005 16.256-2.179 24.025-6.928c1.311-.801 6.449-3.964 11.416-7.029l9.032-5.572v-127.4l-.002-58.273c-.002-37.177-.07-59.256-.188-60.988c-.74-10.885-5.293-20.892-12.948-28.461c-2.349-2.323-4.356-3.875-10.336-7.99a25160 25160 0 0 1-12.104-8.336L28.617 5.835C22.838 1.85 22.386 1.574 20.639.949C18.367.136 15.959-.163 13.67.084C6.998.804 1.657 5.622.269 12.171C.053 13.191.013 26.751.01 100.35l-.003 86.975H0z"/></svg>\n <span>Search on Bing</span>\n </a>\n <div class="pswp__ai-summary-disclaimer">\n These are AI generated summaries based on the content. Please verify the information before using it.\n </div>`:"";if(s){e.innerHTML=`<div class="pswp__ai-summary-close"></div>${this.renderAISummary(s)}${o}`;const n=e.querySelector(".pswp__ai-summary-close");n&&n.addEventListener("click",()=>{this.hideAISummary(t)})}else{e.innerHTML=`<div class="pswp__ai-summary-close"></div><div class="pswp__ai-summary-empty">No AI summary available for this content</div>${o}`;const n=e.querySelector(".pswp__ai-summary-close");n&&n.addEventListener("click",()=>{this.hideAISummary(t)})}}renderAISummary(t){let e='<div class="pswp__ai-summary-content">';return t.subject&&(e+=`<div class="pswp__ai-summary-title">${Tt(t.subject)}</div>`),t.labels&&Object.entries(t.labels).filter(([t,e])=>Array.isArray(e)&&e.length>0).forEach(([t,n])=>{e+=`\n <div class="pswp__ai-summary-section">\n <div class="pswp__ai-summary-section-title">${Tt(t.replace("_"," ").replace(/\b\w/g,t=>t.toUpperCase()))}</div>\n <div class="pswp__ai-summary-labels space-y-2">\n ${n.map(t=>`<span class="pswp__ai-summary-label">${Tt(t)}</span>`).join("")}\n </div>\n </div>\n `}),t.description&&(e+=`\n <div class="pswp__ai-summary-section">\n <div class="pswp__ai-summary-description">${Tt(t.description)}</div>\n </div>\n `),e+="</div>",e}},bt='url("https://res.cloudinary.com/dectzk2b2/image/upload/v1736933014/black_rpie3v.png")',xt=class{constructor(t){this.backdropOn=!1,this.lightbox=t,this.backgroundElement=null,this.backgroundVideoElement=null,this.referenceVideoElement=null,this.options={toggleBackdropButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}initPswpEvents(t){t.on("afterInit",()=>{setTimeout(()=>{this.backgroundElement.style.display="block",this.backgroundVideoElement.style.display="block"},[500])}),t.on("uiRegister",()=>{t.ui.registerElement({name:"toggle-backdrop-button",title:"Toggle blur backdrop",order:this.options.toggleBackdropButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-backdrop"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-backdrop"/><path id="pswp__icn-show-backdrop" style="display:none" d="M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m0-4q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m0-4q-.425 0-.712-.288T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m0-4q-.425 0-.712-.288T5 6t.288-.712T6 5t.713.288T7 6t-.288.713T6 7m4 8.5q-.625 0-1.062-.437T8.5 14t.438-1.062T10 12.5t1.063.438T11.5 14t-.437 1.063T10 15.5m0-4q-.625 0-1.062-.437T8.5 10t.438-1.062T10 8.5t1.063.438T11.5 10t-.437 1.063T10 11.5m0 7.5q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m0-12q-.425 0-.712-.288T9 6t.288-.712T10 5t.713.288T11 6t-.288.713T10 7m0 14.5q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 12q-.625 0-1.062-.437T12.5 14t.438-1.062T14 12.5t1.063.438T15.5 14t-.437 1.063T14 15.5m0-4q-.625 0-1.062-.437T12.5 10t.438-1.062T14 8.5t1.063.438T15.5 10t-.437 1.063T14 11.5m0 7.5q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m0-12q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m0 14.5q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-18q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M18 19q-.425 0-.712-.288T17 18t.288-.712T18 17t.713.288T19 18t-.288.713T18 19m0-4q-.425 0-.712-.288T17 14t.288-.712T18 13t.713.288T19 14t-.288.713T18 15m0-4q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m0-4q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m3 7.5q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m0-4q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15"/><path id="pswp__icn-hide-backdrop" d="m19.1 21.9l-17-17q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l17 17q.275.275.275.7t-.275.7t-.7.275t-.7-.275m-9.1-.4q-.2 0-.35-.15T9.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 21t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M6 19q-.425 0-.712-.288T5 18t.288-.712T6 17t.713.288T7 18t-.288.713T6 19m4 0q-.425 0-.712-.288T9 18t.288-.712T10 17t.713.288T11 18t-.288.713T10 19m4 0q-.425 0-.712-.288T13 18t.288-.712T14 17t.713.288T15 18t-.288.713T14 19m-4-3.5q-.65 0-1.075-.425T8.5 14t.425-1.075T10 12.5t1.075.425T11.5 14t-.425 1.075T10 15.5M6 15q-.425 0-.712-.288T5 14t.288-.712T6 13t.713.288T7 14t-.288.713T6 15m11.8-.025l-.775-.775q-.1-.5.213-.85T18 13q.425 0 .713.288T19 14q0 .45-.35.763t-.85.212M3 14.5q-.2 0-.35-.15T2.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 14t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m-6.7-3.05L12.55 9.7q.125-.525.5-.862T14 8.5q.65 0 1.075.425T15.5 10q0 .575-.35.963t-.85.487M6 11q-.425 0-.712-.287T5 10t.288-.712T6 9t.713.288T7 10t-.288.713T6 11m12 0q-.425 0-.712-.288T17 10t.288-.712T18 9t.713.288T19 10t-.288.713T18 11m-15-.5q-.2 0-.35-.15T2.5 10t.15-.35T3 9.5t.35.15t.15.35t-.15.35t-.35.15m18 0q-.2 0-.35-.15T20.5 10t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15M14 7q-.425 0-.712-.288T13 6t.288-.712T14 5t.713.288T15 6t-.288.713T14 7m-4.175-.025l-.8-.8q-.075-.5.225-.837T10 5q.425 0 .712.287T11 6q0 .45-.337.75t-.838.225M18 7q-.425 0-.712-.288T17 6t.288-.712T18 5t.713.288T19 6t-.288.713T18 7m-8-3.5q-.2 0-.35-.15T9.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15m4 0q-.2 0-.35-.15T13.5 3t.15-.35t.35-.15t.35.15t.15.35t-.15.35t-.35.15" /></svg>',onClick:()=>{this.toggleBackdrop(t)}}),this.createBlurBackground(t)}),t.on("change",()=>{this.backdropOn&&this.updateBlurBackground(t)}),t.on("close",()=>{this.removeBlurBackground(),this.backdropOn=!1})}createBlurBackground(t){const e=t.element;if(!this.backgroundElement){const t=document.createElement("div");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.backgroundSize="cover",t.style.backgroundPosition="center",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.transition="background-image 0.5s ease, opacity 0.5s ease",t.style.display="none",t.style.backgroundImage=bt,e.append(t),this.backgroundElement=t}if(!this.backgroundVideoElement){const t=document.createElement("video");t.style.position="fixed",t.style.top=0,t.style.left=0,t.style.width="100vw",t.style.height="100vh",t.style.objectFit="cover",t.style.filter="blur(44px)",t.style.zIndex=-1,t.style.display="none",t.style.transition="opacity 0.5s ease",t.muted=!0,t.loop=!0,t.autoplay=!1,t.muted=!0,t.volume=0,e.append(t),this.backgroundVideoElement=t}}toggleBackdrop(t){this.backdropOn?(this.backgroundElement.style.backgroundImage=bt,this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.pause(),this.backdropOn=!1):(this.updateBlurBackground(t),this.backdropOn=!0),document.querySelector("#pswp__icn-hide-backdrop").style.display=this.backdropOn?"none":"inline",document.querySelector("#pswp__icn-show-backdrop").style.display=this.backdropOn?"inline":"none"}updateBlurBackground(t){const e=t.currSlide;if(e?.data)if("video"===e.data.type){const t=this.backgroundVideoElement,n=e.content.element;"video"===n?.tagName?.toLowerCase()&&(this.referenceVideoElement=n,this.registerVideoEvents(n,t)),t.style.opacity=0,setTimeout(()=>{t.src=e.data.src,t.load(),this.initBackgroundVideo(),t.style.opacity=1},500),this.backgroundElement&&(this.backgroundElement.style.opacity=0)}else{if(this.backgroundElement){const t=e.data.blurhash||"LEHV6nWB2yk8pyo0adR*.7kCMdnj";if(t){const e=this.createBlurhashCanvas(t,200,200);e.startsWith("data:")?this.backgroundElement.style.backgroundImage=`url('${e}')`:(this.backgroundElement.style.backgroundImage="none",this.backgroundElement.style.backgroundColor=e)}else this.backgroundElement.style.backgroundImage=`url('${e.data.thumbnailUrl}')`;this.backgroundElement.style.opacity=1}this.backgroundVideoElement&&(this.backgroundVideoElement.style.opacity=0,this.backgroundVideoElement.src="")}}initBackgroundVideo(){this.referenceVideoElement&&(this.backgroundVideoElement.currentTime=this.referenceVideoElement.currentTime,this.referenceVideoElement.currentTime>0&&!this.referenceVideoElement.paused&&!this.referenceVideoElement.ended&&this.referenceVideoElement.readyState>2&&this.backgroundVideoElement.play())}removeBlurBackground(){this.backgroundElement&&(this.backgroundElement.remove(),this.backgroundVideoElement.remove(),this.backgroundElement=null,this.backgroundVideoElement=null)}createBlurhashCanvas(t,e=100,n=100){const i=document.createElement("canvas");i.width=e,i.height=n;try{const s=i.getContext("2d"),o=S(t,e,n);if(o&&o.length>0){const t=s.createImageData(e,n);return t.data.set(o),s.putImageData(t,0,0),i.toDataURL()}throw new Error("Empty pixels array")}catch(s){return console.warn("Failed to decode blurhash for backdrop:",s),this.blurhashToColor(t)}}blurhashToColor(t){const e=["#8B9DC3","#DFB2A3","#C4B5A0","#A8B8C8","#B8A898"];return e[t.charCodeAt(0)%e.length]}registerVideoEvents(t,e){this.foregroundVideoElement=t,t.addEventListener("play",()=>{e.currentTime=t.currentTime,e.play()}),t.addEventListener("pause",()=>{e.pause()}),t.addEventListener("ended",()=>{e.pause(),e.currentTime=0})}};function kt(t){return t?String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"):""}var _t={[c.LINK]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h6q.425 0 .713.288T12 4t-.288.713T11 5H5v14h14v-6q0-.425.288-.712T20 12t.713.288T21 13v6q0 .825-.587 1.413T19 21zM19 6.4L10.4 15q-.275.275-.7.275T9 15t-.275-.7t.275-.7L17.6 5H15q-.425 0-.712-.288T14 4t.288-.712T15 3h5q.425 0 .713.288T21 4v5q0 .425-.288.713T20 10t-.712-.288T19 9z"/></svg>',[c.EMAIL]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12v1.45q0 1.475-1.012 2.513T18.5 17q-.875 0-1.65-.375t-1.3-1.075q-.725.725-1.638 1.088T12 17q-2.075 0-3.537-1.463T7 12t1.463-3.537T12 7t3.538 1.463T17 12v1.45q0 .65.425 1.1T18.5 15t1.075-.45t.425-1.1V12q0-3.35-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20h4q.425 0 .713.288T17 21t-.288.713T16 22zm0-7q1.25 0 2.125-.875T15 12t-.875-2.125T12 9t-2.125.875T9 12t.875 2.125T12 15"/></svg>',[c.PHONE]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M19.95 21q-3.125 0-6.175-1.362t-5.55-3.863t-3.862-5.55T3 4.05q0-.45.3-.75t.75-.3H8.1q.35 0 .625.238t.325.562l.65 3.5q.05.4-.025.675T9.4 8.45L6.975 10.9q.5.925 1.187 1.787t1.513 1.663q.775.775 1.625 1.438T13.1 17l2.35-2.35q.225-.225.588-.337t.712-.063l3.45.7q.35.1.575.363T21 15.9v4.05q0 .45-.3.75t-.75.3M6.025 9l1.65-1.65L7.25 5H5.025q.125 1.025.35 2.025T6.025 9m8.95 8.95q.975.425 1.988.675T19 18.95v-2.2l-2.35-.475zm0 0"/></svg>',[c.SMS]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="m6 18l-2.3 2.3q-.475.475-1.088.213T2 19.575V4q0-.825.588-1.412T4 2h16q.825 0 1.413.588T22 4v12q0 .825-.587 1.413T20 18zm-.85-2H20V4H4v13.125zM4 16V4zm4-5q.425 0 .713-.288T9 10t-.288-.712T8 9t-.712.288T7 10t.288.713T8 11m4 0q.425 0 .713-.288T13 10t-.288-.712T12 9t-.712.288T11 10t.288.713T12 11m4 0q.425 0 .713-.288T17 10t-.288-.712T16 9t-.712.288T15 10t.288.713T16 11"/></svg>',[c.WHATSAPP]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 258"><defs><linearGradient id="logosWhatsappIcon0" x1="50%" x2="50%" y1="100%" y2="0%"><stop offset="0%" stop-color="#1faf38"/><stop offset="100%" stop-color="#60d669"/></linearGradient><linearGradient id="logosWhatsappIcon1" x1="50%" x2="50%" y1="100%" y2="0%"><stop offset="0%" stop-color="#f9f9f9"/><stop offset="100%" stop-color="#fff"/></linearGradient></defs><path fill="url(#logosWhatsappIcon0)" d="M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"/><path fill="url(#logosWhatsappIcon1)" d="M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"/><path fill="#fff" d="M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"/></svg>',[c.MESSENGER]:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256"><defs><radialGradient id="logosMessenger0" cx="19.247%" cy="99.465%" r="108.96%" fx="19.247%" fy="99.465%"><stop offset="0%" stop-color="#09f"/><stop offset="60.975%" stop-color="#a033ff"/><stop offset="93.482%" stop-color="#ff5280"/><stop offset="100%" stop-color="#ff7061"/></radialGradient></defs><path fill="url(#logosMessenger0)" d="M128 0C55.894 0 0 52.818 0 124.16c0 37.317 15.293 69.562 40.2 91.835c2.09 1.871 3.352 4.493 3.438 7.298l.697 22.77c.223 7.262 7.724 11.988 14.37 9.054L84.111 243.9a10.22 10.22 0 0 1 6.837-.501c11.675 3.21 24.1 4.92 37.052 4.92c72.106 0 128-52.818 128-124.16S200.106 0 128 0"/><path fill="#fff" d="m51.137 160.47l37.6-59.653c5.98-9.49 18.788-11.853 27.762-5.123l29.905 22.43a7.68 7.68 0 0 0 9.252-.027l40.388-30.652c5.39-4.091 12.428 2.36 8.82 8.085l-37.6 59.654c-5.981 9.489-18.79 11.852-27.763 5.122l-29.906-22.43a7.68 7.68 0 0 0-9.25.027l-40.39 30.652c-5.39 4.09-12.427-2.36-8.818-8.085"/></svg>'},qt=class{constructor(t,e,n){this.lightbox=t,this.captureAdImpression=e,this.captureAdClick=n,this.captionOn=!0,this.options={captionButtonOrder:8},t.on("init",()=>{this.initPswpEvents(t.pswp)})}initPswpEvents(t){t.on("uiRegister",()=>{t.ui.registerElement({name:"caption-toggle-button",title:"Toggle caption view",order:this.options.captionButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-0.5" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-show-caption"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-hide-caption"/><path id="pswp__icn-show-caption" d="M5 20q-.825 0-1.412-.587T3 18V6q0-.825.588-1.412T5 4h14q.825 0 1.413.588T21 6v12q0 .825-.587 1.413T19 20zm0-2h14V6H5zm2-3h3q.425 0 .713-.288T11 14v-.5q0-.225-.15-.375t-.375-.15h-.45q-.225 0-.375.15t-.15.375h-2v-3h2q0 .225.15.375t.375.15h.45q.225 0 .375-.15T11 10.5V10q0-.425-.288-.712T10 9H7q-.425 0-.712.288T6 10v4q0 .425.288.713T7 15m10-6h-3q-.425 0-.712.288T13 10v4q0 .425.288.713T14 15h3q.425 0 .713-.288T18 14v-.5q0-.225-.15-.375t-.375-.15h-.45q-.225 0-.375.15t-.15.375h-2v-3h2q0 .225.15.375t.375.15h.45q.225 0 .375-.15T18 10.5V10q0-.425-.288-.712T17 9M5 18V6z"/><path id="pswp__icn-hide-caption" style="display:none" d="m9.025 9l1.5 1.5H7.5v3h2q0-.225.15-.375t.375-.15h.45q.225 0 .375.15t.15.375v.5q0 .425-.288.713T10 15H7q-.425 0-.712-.288T6 14v-4q0-.425.288-.712T7 9zM21 6v10q0 .5-.325.763t-.7.262t-.675-.262T19 16V6H8.975q-.5 0-.75-.312T7.975 5t.25-.687t.75-.313H19q.825 0 1.413.588T21 6m-3 8q0 .225-.088.438t-.262.337L16.375 13.5h.125q0-.225.15-.375t.375-.15h.45q.225 0 .375.15t.15.375zm-1-5q.425 0 .713.288T18 10v.5q0 .225-.15.375t-.375.15h-.45q-.225 0-.375-.15t-.15-.375h-2v1.125l-1.5-1.5V10q0-.425.288-.712T14 9zM5 20q-.825 0-1.412-.587T3 18V6q0-.625.338-1.112t.862-.713L6.025 6H5v12h10.175L1.375 4.225q-.3-.3-.3-.712t.3-.713t.713-.3t.712.3l18.375 18.375q.3.3.3.713t-.3.712t-.712.3t-.713-.3L17.175 20z"/></svg>',onClick:()=>{this.toggleCaption(t)}}),t.ui.registerElement({name:"custom-caption",isButton:!1,appendTo:"root",html:'<div id="pswp-caption-container" class=" absolute bottom-0 w-full"></div>'})}),t.on("change",()=>{this.captionOn&&this.updateCaption(t)}),t.on("close",()=>{this.clearCaption()})}toggleCaption(t){this.captionOn?this.clearCaption():this.updateCaption(t),this.captionOn=!this.captionOn,document.querySelector("#pswp__icn-show-caption").style.display=this.captionOn?"inline":"none",document.querySelector("#pswp__icn-hide-caption").style.display=this.captionOn?"none":"inline"}createCaptionHTML(t){const{id:e,type:n,caption:i,title:s,description:o,targetType:r,targetText:a,targetUrl:l}=t||{};switch("ad"===n&&this.captureAdImpression&&this.captureAdImpression(e),n){case"image":case"video":return i?.length>0?`\n <div class=" w-full bg-black bg-opacity-50 p-4 text-gray-300">\n <h3 class=" text-center sm:text-lg">${kt(i)}</h3>\n </div>\n `:"";case"ad":return`\n <div class=" w-full bg-black/85 p-4 text-white">\n <div class=" mx-auto w-full max-w-2xl space-y-2 text-center">\n <h3 class=" text-center sm:text-lg">${kt(s)}</h3>\n <h4 class=" pb-2 text-center text-sm sm:text-base">${kt(o)}</h4>\n <button\n class=" flex w-full items-center justify-center gap-3 rounded-md bg-white py-1 text-lg text-black caption-action-button"\n data-id="${kt(e)}"\n data-target-type="${kt(r||c.LINK)}"\n data-target-url="${kt(l)}">\n ${_t[r||c.LINK]}\n ${kt(a)}\n </button>\n </div>\n </div>\n `;default:return""}}updateCaption(t){try{const e=document.getElementById("pswp-caption-container");if(!e)return;const n=t.currSlide?.data;e.innerHTML=this.createCaptionHTML(n);const i=e.querySelector(". caption-action-button");i&&i.addEventListener("click",t=>{const e=t.currentTarget.dataset.id,n=t.currentTarget.dataset.targetType,i=t.currentTarget.dataset.targetUrl;this.captureAdClick&&e&&this.captureAdClick(e,n,i)})}catch(e){console.error("Error rendering caption:",e)}}clearCaption(){const t=document.getElementById("pswp-caption-container");t&&(t.innerHTML="")}},St=class{constructor(t){this.lightbox=t,this.fullscreen=!1,this.options={fullScreenButtonOrder:7},t.on("init",()=>{this.initPswpEvents(t.pswp)})}initPswpEvents(t){t.on("uiRegister",()=>{(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)&&t.ui.registerElement({name:"fullscreen-button",title:"Toggle fullscreen view",order:this.options.fullScreenButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn p-1" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-fullscreen"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-exit-fullscreen"/><path id="pswp__icn-fullscreen" d="M5 19h2q.425 0 .713.288T8 20t-.288.713T7 21H4q-.425 0-.712-.288T3 20v-3q0-.425.288-.712T4 16t.713.288T5 17zm14 0v-2q0-.425.288-.712T20 16t.713.288T21 17v3q0 .425-.288.713T20 21h-3q-.425 0-.712-.288T16 20t.288-.712T17 19zM5 5v2q0 .425-.288.713T4 8t-.712-.288T3 7V4q0-.425.288-.712T4 3h3q.425 0 .713.288T8 4t-.288.713T7 5zm14 0h-2q-.425 0-.712-.288T16 4t.288-.712T17 3h3q.425 0 .713.288T21 4v3q0 .425-.288.713T20 8t-.712-.288T19 7z"/><path id="pswp__icn-exit-fullscreen" style="display:none" d="M6 18H4q-.425 0-.712-.288T3 17t.288-.712T4 16h3q.425 0 .713.288T8 17v3q0 .425-.288.713T7 21t-.712-.288T6 20zm12 0v2q0 .425-.288.713T17 21t-.712-.288T16 20v-3q0-.425.288-.712T17 16h3q.425 0 .713.288T21 17t-.288.713T20 18zM6 6V4q0-.425.288-.712T7 3t.713.288T8 4v3q0 .425-.288.713T7 8H4q-.425 0-.712-.288T3 7t.288-.712T4 6zm12 0h2q.425 0 .713.288T21 7t-.288.713T20 8h-3q-.425 0-.712-.288T16 7V4q0-.425.288-.712T17 3t.713.288T18 4z"/></svg>',onClick:()=>{this.toggleFullscreen(t)}})})}toggleFullscreen(t){const e=t.element;this.fullscreen?(document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),t.options.showHideAnimationType="zoom",this.fullscreen=!1):(e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen(),t.options.showHideAnimationType="fade",this.fullscreen=!0),document.querySelector("#pswp__icn-exit-fullscreen").style.display=this.fullscreen?"inline":"none",document.querySelector("#pswp__icn-fullscreen").style.display=this.fullscreen?"none":"inline"}},Et=class{constructor(t,e={}){this.lightbox=t,this.autoHideTimer=null,this.uiVisible=!0,this.options=Object.assign({defaultDelayMs:4e3,playPauseButtonOrder:9,progressBarPosition:"top",progressBarTransition:"ease",restartOnSlideChange:!0,autoHideProgressBar:!0},e),this.setSlideshowLength(Number(localStorage.getItem("pswp_delay"))||this.options.defaultDelayMs),document.head.insertAdjacentHTML("beforeend",`<style>.pswp__progress-bar{position:fixed;${this.options.progressBarPosition}:0;width:0;height:0}.pswp__progress-bar.running{width:100%;height:2px;transition-property:width;background:#ff4800}</style>`),this.slideshowIsRunning=!1,this.slideshowTimerID=null,this.wakeLockIsRunning=!1,this.wakeLockSentinel=null,this.lightbox.on("init",()=>{this.init(this.lightbox.pswp)})}init(t){t.on("uiRegister",()=>{t.ui.registerElement({name:"playpause-button",title:"Toggle slideshow (Space)\nChange delay with +/- while running",order:this.options.playPauseButtonOrder,isButton:!0,html:'<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 24 24"><use class="pswp__icn-shadow" xlink:href="#pswp__icn-play"/><use class="pswp__icn-shadow" xlink:href="#pswp__icn-stop"/><path id="pswp__icn-play" d="M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"/><path id="pswp__icn-stop" style="display:none" d="M16 19q-.825 0-1.412-.587T14 17V7q0-.825.588-1.412T16 5t1.413.588T18 7v10q0 .825-.587 1.413T16 19m-8 0q-.825 0-1.412-.587T6 17V7q0-.825.588-1.412T8 5t1.413.588T10 7v10q0 .825-.587 1.413T8 19"/></svg>',onClick:()=>{this.setSlideshowState()}}),t.ui.registerElement({name:"playtime",appendTo:"wrapper",tagName:"div",className:"pswp__progress-bar"}),t.events.add(document,"keydown",t=>{switch(t.code){case"Space":this.setSlideshowState(),t.preventDefault();break;case"ArrowUp":case"NumpadAdd":case"Equal":this.changeSlideshowLength(1e3),t.preventDefault();break;case"ArrowDown":case"NumpadSubtract":case"Minus":this.changeSlideshowLength(-1e3),t.preventDefault()}})}),this.lightbox.on("change",()=>{this.slideshowIsRunning&&this.options.restartOnSlideChange&&this.goToNextSlideAfterTimeout()}),this.lightbox.on("close",()=>{this.slideshowIsRunning&&this.setSlideshowState()})}showUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.add("pswp--ui-visible"),this.uiVisible=!0}stopAutoHideTimer(){this.autoHideTimer&&(clearTimeout(this.autoHideTimer),this.autoHideTimer=null)}hideUI(){this.lightbox&&this.lightbox.pswp&&this.lightbox.pswp.element&&this.lightbox.pswp.element.classList.remove("pswp--ui-visible"),this.uiVisible=!1}resetAutoHideTimer(){this.autoHideTimer&&clearTimeout(this.autoHideTimer),this.autoHideTimer=setTimeout(()=>{this.slideshowIsRunning&&this.hideUI(),this.autoHideTimer=null},[3e3])}setSlideshowState(){this.slideshowIsRunning=!this.slideshowIsRunning,this.slideshowIsRunning?(this.goToNextSlideAfterTimeout(),this.showUI(),this.resetAutoHideTimer(),document.addEventListener("touchstart",()=>{this.stopAutoHideTimer(),this.showUI()}),document.addEventListener("touchend",()=>{this.resetAutoHideTimer()}),document.addEventListener("mousemove",()=>{this.uiVisible||this.showUI(),this.resetAutoHideTimer()})):(this.showUI(),this.resetSlideshow(),this.stopAutoHideTimer()),document.querySelector("#pswp__icn-stop").style.display=this.slideshowIsRunning?"inline":"none",document.querySelector("#pswp__icn-play").style.display=this.slideshowIsRunning?"none":"inline",document.querySelector(".pswp__progress-bar").style.opacity=this.options.autoHideProgressBar?null:1,this.toggleWakeLock()}setSlideshowLength(t){this.options.defaultDelayMs=Math.min(Math.max(t,1e3),2147483647),this.options.defaultDelayMs!=t&&localStorage.setItem("pswp_delay",this.options.defaultDelayMs)}changeSlideshowLength(t){if(!this.slideshowIsRunning)return;this.setSlideshowLength(this.options.defaultDelayMs+t),localStorage.setItem("pswp_delay",this.options.defaultDelayMs);const e=document.querySelector(".pswp__counter");e&&(e.innerHTML=this.options.defaultDelayMs/1e3+"s"),this.goToNextSlideAfterTimeout()}isVideoContent(t){return"video"===t?.data?.type}getSlideTimeout(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;if(e.paused)return this.options.defaultDelayMs;const n=e.duration,i=e.currentTime;return isNaN(n)||isNaN(i)?this.options.defaultDelayMs:1e3*(n-i)}return this.options.defaultDelayMs}slideContentHasLoaded(){const t=this.lightbox.pswp.currSlide.content;if(this.isVideoContent(t)){const e=t.element;return e.ended||e.readyState===HTMLMediaElement.HAVE_ENOUGH_DATA&&[HTMLMediaElement.NETWORK_IDLE,HTMLMediaElement.NETWORK_LOADING].includes(e.networkState)}return!t.isLoading()}goToNextSlideAfterTimeout(){if(this.resetSlideshow(),this.slideContentHasLoaded()){const t=this.getSlideTimeout();this.slideshowTimerID=setTimeout(()=>{this.lightbox.pswp.next(),this.options.restartOnSlideChange||this.goToNextSlideAfterTimeout()},t),setTimeout(()=>{this.slideshowIsRunning&&this.toggleProgressBar(t)},100)}else this.slideshowTimerID=setTimeout(()=>{this.goToNextSlideAfterTimeout()},200)}getSlideTransition(){return this.isVideoContent(this.lightbox.pswp.currSlide.content)?"linear":this.options.progressBarTransition}toggleProgressBar(t){const e=document.querySelector(".pswp__progress-bar");t?(e.style.transitionTimingFunction=this.getSlideTransition(),e.style.transitionDuration=`${t}ms`,e.classList.add("running")):e.classList.remove("running")}toggleWakeLock(){this.wakeLockIsRunning!=this.slideshowIsRunning&&("keepAwake"in screen?screen.keepAwake=this.slideshowIsRunning:"wakeLock"in navigator&&(this.wakeLockSentinel?this.wakeLockSentinel.release().then(()=>(this.wakeLockSentinel=null,!0)).catch(t=>console.error(t)):navigator.wakeLock.request("screen").then(t=>(this.wakeLockSentinel=t,this.wakeLockSentinel.addEventListener("release",()=>{this.wakeLockSentinel=null,this.wakeLockIsRunning=!1}),!0)).catch(t=>{})),this.wakeLockIsRunning=this.slideshowIsRunning)}resetSlideshow(){this.toggleProgressBar(),this.slideshowTimerID&&(clearTimeout(this.slideshowTimerID),this.slideshowTimerID=null)}},Ct={videoAttributes:{controls:"",playsinline:"",muted:"",preload:"auto"},autoplay:!0,preventDragOffset:40};function It(t){return t&&t.data&&"video"===t.data.type}var Lt=class{constructor(t,e){this.options=e,this.initLightboxEvents(t),t.on("init",()=>{this.initPswpEvents(t.pswp)})}initLightboxEvents(t){t.on("contentLoad",this.onContentLoad.bind(this)),t.on("contentDestroy",this.onContentDestroy.bind(this)),t.on("contentActivate",this.onContentActivate.bind(this)),t.on("contentDeactivate",this.onContentDeactivate.bind(this)),t.on("contentAppend",this.onContentAppend.bind(this)),t.on("contentResize",this.onContentResize.bind(this)),t.addFilter("isKeepingPlaceholder",this.isKeepingPlaceholder.bind(this)),t.addFilter("isContentZoomable",this.isContentZoomable.bind(this)),t.addFilter("useContentPlaceholder",this.useContentPlaceholder.bind(this)),t.addFilter("domItemData",(t,e,n)=>("video"===t.type&&n&&(n.dataset.pswpVideoSources?t.videoSources=JSON.parse(n.dataset.pswpVideoSources):n.dataset.pswpVideoSrc?t.videoSrc=n.dataset.pswpVideoSrc:t.videoSrc=n.href),t))}initPswpEvents(t){t.on("pointerDown",e=>{const n=t.currSlide;if(It(n)&&this.options.preventDragOffset){const i=e.originalEvent;if("pointerdown"===i.type){const s=Math.ceil(n.height*n.currZoomLevel)+n.bounds.center.y,o=i.pageY-t.offset.y;o>s-this.options.preventDragOffset&&o<s&&e.preventDefault()}}}),t.on("appendHeavy",t=>{It(t.slide)&&!t.slide.isActive&&t.preventDefault()}),t.on("close",()=>{It(t.currSlide.content)&&this.pauseVideo(t.currSlide.content)})}onContentDestroy({content:t}){It(t)&&t._videoPosterImg&&(t._videoPosterImg.onload=t._videoPosterImg.onerror=null,t._videoPosterImg=null)}onContentResize(t){if(It(t.content)){t.preventDefault();const e=t.width,n=t.height,i=t.content;if(i.element&&(i.element.style.width=`${e}px`,i.element.style.height=`${n}px`),i.slide&&i.slide.placeholder){const t=i.slide.placeholder.element.style;t.transform="none",t.width=`${e}px`,t.height=`${n}px`}}}isKeepingPlaceholder(t,e){return!It(e)&&t}isContentZoomable(t,e){return!It(e)&&t}onContentActivate({content:t}){It(t)&&this.options.autoplay&&this.playVideo(t)}onContentDeactivate({content:t}){It(t)&&this.pauseVideo(t)}onContentAppend(t){It(t.content)&&(t.preventDefault(),t.content.isAttached=!0,t.content.appendImage())}onContentLoad(t){const e=t.content;if(It(t.content)&&(t.preventDefault(),!e.element)){if(e.state="loading",e.type="video",e.element=document.createElement("video"),this.options.videoAttributes)for(let t in this.options.videoAttributes)e.element.setAttribute(t,this.options.videoAttributes[t]||"");e.element.setAttribute("poster",e.data.msrc),this.preloadVideoPoster(e,e.data.msrc),e.element.style.position="relative",e.element.style.left=0,e.element.style.top=0,e.data.videoSources?e.data.videoSources.forEach(t=>{let n=document.createElement("source");n.src=t.src,n.type=t.type,e.element.appendChild(n)}):e.data.videoSrc&&(e.element.src=e.data.videoSrc)}}preloadVideoPoster(t,e){!t._videoPosterImg&&e&&(t._videoPosterImg=new Image,t._videoPosterImg.src=e,t._videoPosterImg.complete?t.onLoaded():t._videoPosterImg.onload=t._videoPosterImg.onerror=()=>{t.onLoaded()})}playVideo(t){t.element&&t.element.play()}pauseVideo(t){t.element&&t.element.pause()}useContentPlaceholder(t,e){return!!It(e)||t}},At=class{constructor(t,e={}){new Lt(t,{...Ct,...e})}},Nt=({open:t,ad:e,onClose:n,captureAdClick:i})=>/* @__PURE__ */r(z,{open:Boolean(t&&e),onOpenChange:t=>!t&&n?.(),children:/* @__PURE__ */r(N,{children:[/* @__PURE__ */r(R,{className:"hidden",children:[/* @__PURE__ */r(L,{children:e?.title}),/* @__PURE__ */r(I,{children:e?.description})]}),/* @__PURE__ */r("div",{className:"flex max-w-lg flex-col overflow-hidden",children:[
2
- /* @__PURE__ */r("img",{className:"h-auto max-h-96 w-full object-contain",src:e?.imageUrl,alt:"Image not found"}),
3
- /* @__PURE__ */r("div",{className:"flex flex-col gap-2 p-3",children:[/* @__PURE__ */r(D,{variant:"h4",align:"center",lines:2,children:e?.title}),/* @__PURE__ */r(D,{variant:"body3",color:"secondary",align:"center",lines:6,children:e?.description})]}),
4
- /* @__PURE__ */r(A,{fullWidth:!0,className:"rounded-t-none",onClick:()=>i?.(e?._id,e?.targetType??c.LINK,e?.targetUrl),icon:m[e?.targetType]??m[c.LINK],children:e?.targetText})]})]})}),Mt=({url:e,alt:n="",thumbnailUrl:i,blurhash:s,pswpData:o={},curateLink:a,onClick:l})=>{const c=/* @__PURE__ */r(t,{children:[/* @__PURE__ */r(C,{threshold:.1,src:i||e,blurhash:s,alt:n}),o.type===u.VIDEO&&/* @__PURE__ */r("div",{className:"absolute inset-0 top-0 left-0 flex items-center justify-center opacity-75",children:/* @__PURE__ */r("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-16 text-white lg:w-24",viewBox:"0 0 24 24",children:/* @__PURE__ */r("path",{fill:"currentColor",d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})})})]});return l?/* @__PURE__ */r("button",{className:"h-full w-full",onClick:l,children:c}):a?/* @__PURE__ */r(q,{to:a,className:"h-full w-full",children:c}):/* @__PURE__ */r("a",{href:e,className:"pswp-item block h-full w-full",...Object.keys(o).reduce((t,e)=>{var n;return t[`data-pswp-${n=e,n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}`]=String(o[e]),t},{}),target:"_blank",rel:"noreferrer",children:c})},Bt=({style:t,content:e,curateLink:n,onAdClick:i})=>{const{captureAdImpression:s,captureAdEngagement:o,captureAdClick:a}=M();/* @__PURE__ */
5
- return r("div",{style:t,className:"group relative mb-1 overflow-hidden rounded",children:[/* @__PURE__ */r(E,{className:"size-full",threshold:.8,triggerOnce:!0,onChange:t=>{t&&s(e._id)},onClick:()=>o(e._id),children:/* @__PURE__ */r(Mt,{url:e.src,thumbnailUrl:e.src,blurhash:e.blurhash,alt:e.caption,onClick:n?i:void 0,pswpData:{id:e._id,type:u.AD,hash:e._id,width:e.width,height:e.height,title:e.title,description:e.description,targetType:e.targetType,targetText:e.targetText,targetUrl:e.targetUrl,thumbnailUrl:e.imageUrl,blurhash:e.blurhash}})}),/* @__PURE__ */r("div",{className:"transition-opacity duration-500 group-hover:opacity-100 sm:opacity-0",children:/* @__PURE__ */r("div",{className:"text-foreground bg-background bg-opacity-75 absolute bottom-0 w-full flex-col items-center justify-between sm:flex sm:flex-row",children:[/* @__PURE__ */r("h3",{className:"text-foreground line-clamp-2 p-2 text-sm font-medium sm:ml-3 sm:line-clamp-1 sm:p-0",children:e.title}),e?.targetType!==c.NONE&&/* @__PURE__ */r(A,{immutable:!0,className:"w-full rounded-t-none py-1 text-nowrap sm:w-auto sm:rounded-t-none sm:rounded-bl-none sm:py-2",onClick:()=>a(e._id,e.targetType,e.targetUrl),icon:m[e?.targetType??c.LINK],children:e?.targetText})]})})]})},Vt=b(null),zt=()=>{const t=p(Vt);if(!t)throw new Error("Popover components must be used within a Popover");return t},Rt=({children:t,className:e,open:n,onOpenChange:i})=>{const[s,o]=w(!1),a="boolean"==typeof n,l=a?n:s,c=g(),d=`popover-trigger-${c}`,h=`popover-content-${c}`,p=v(null);/* @__PURE__ */
6
- return r(Vt.Provider,{value:{isOpen:l,setIsOpen:t=>{a||o(t),i?.(t)},triggerId:d,contentId:h,triggerRef:p},children:/* @__PURE__ */r("div",{"data-slot":"popover",className:y("relative inline-block",e),children:t})})},Ot=({children:t,asChild:e,className:n,onClick:i,...s})=>{const{isOpen:a,setIsOpen:c,triggerId:d,contentId:h,triggerRef:p}=zt();if(o(()=>{if(!e)return;const t=document.getElementById(d);return p.current=t,()=>{p.current===t&&(p.current=null)}},[e,d,p]),e){const e=Array.isArray(t)?t[0]:t;if(e&&e.type){const t=e.props?.className;return l(e,{id:d,className:n?t?`${t} ${n}`:n:t,"aria-haspopup":"dialog","aria-expanded":a,"aria-controls":a?h:void 0,onClick:t=>{c(!a),e.props?.onClick?.(t)},"data-state":a?"open":"closed"})}}/* @__PURE__ */
7
- return r("button",{ref:p,id:d,type:"button","aria-haspopup":"dialog","aria-expanded":a,"aria-controls":a?h:void 0,"data-slot":"popover-trigger","data-state":a?"open":"closed",className:n,onClick:t=>{c(!a),i?.(t)},...s,children:t})},Dt=({children:t,className:e,align:n="center",side:i="top",sideOffset:s=4,...a})=>{const{isOpen:l,setIsOpen:c,contentId:d,triggerRef:p}=zt(),{organization:u}=k(),m=v(null),[g,T]=w(null);if(h(()=>{if(!l)return;const t=()=>{if(!p.current||!m.current)return;const t=p.current.getBoundingClientRect(),e=m.current.getBoundingClientRect();let o=t.left,r=t.bottom+s;"center"===n&&(o=t.left+t.width/2-e.width/2),"end"===n&&(o=t.right-e.width),"top"===i&&(r=t.top-e.height-s),"left"===i&&(o=t.left-e.width-s,r=t.top+t.height/2-e.height/2),"right"===i&&(o=t.right+s,r=t.top+t.height/2-e.height/2),"bottom"===i&&(r=t.bottom+s),T({top:r,left:o})},e=requestAnimationFrame(t);return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{cancelAnimationFrame(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[n,l,i,s,p]),o(()=>{if(!l)return;const t=t=>{const e=t.target;m.current&&!m.current.contains(e)&&p.current&&!p.current.contains(e)&&c(!1)},e=t=>{"Escape"===t.key&&(c(!1),p.current?.focus())},n=window.setTimeout(()=>{document.addEventListener("mousedown",t)},0);return document.addEventListener("keydown",e),()=>{window.clearTimeout(n),document.removeEventListener("mousedown",t),document.removeEventListener("keydown",e)}},[l,c,p]),!l)return null;const b=/* @__PURE__ */r("div",{ref:m,id:d,role:"dialog","aria-modal":"false","data-state":l?"open":"closed",className:y("bg-background text-foreground border-border shadow-outer rounded outline-none",e),style:{position:"fixed",top:g?.top??0,left:g?.left??0,zIndex:2010,...f(u)},...a,children:t});return"undefined"!=typeof document?_(b,document.body):b},Pt=({eventId:t,contentId:s,emojis:o=[],counts:a={},userReaction:l})=>{const{user:c,props:d,organization:h}=k(),p=d?.loginUrl,{handleReactionClick:u}=(()=>{const t=i(),{props:n,user:s}=k(),o=n?.organizationId;return{handleReactionClick:async(n,i,r)=>{if(!n||!i||!r)return!1;if(!s)return B.error("Please login to react"),!1;const a=[e.CONTENTS_BY_EVENT(n)],l=t.getQueriesData({queryKey:a});t.setQueriesData({queryKey:a},t=>t?.pages&&Array.isArray(t.pages)?{...t,pages:t.pages.map(t=>t.data?{...t,data:t.data.map(t=>{if(t._id===i){const e={...t.reactionCounts};return t.userReaction&&t.userReaction!==r&&(e[t.userReaction]=Math.max(0,(e[t.userReaction]??1)-1)),t.userReaction===r?(e[r]=Math.max(0,(e[r]??1)-1),{...t,reactionCounts:e,userReaction:void 0}):(e[r]=(e[r]??0)+1,{...t,reactionCounts:e,userReaction:r})}return t})}:t)}:t);try{return await x.post(T.UPDATE_REACTION,{json:{eventId:n,contentId:i,reaction:r},headers:{"x-org-id":o,Authorization:`Bearer ${s.token}`}}),!0}catch(c){return l.forEach(([e,n])=>{t.setQueryData(e,n)}),B.error("Failed to add reaction"),console.error("Error handling reaction click:",c),!1}}}})(),[m,g]=w(!1),[f,v]=w(!1),b=Object.values(a).reduce((t,e)=>t+e,0);/* @__PURE__ */
8
- return r(Rt,{open:m,onOpenChange:g,children:[/* @__PURE__ */r(Ot,{children:/* @__PURE__ */r("div",{className:y("bg-background/50 flex items-center gap-1 rounded px-2 py-1 backdrop-blur-sm transition-transform active:scale-90 sm:gap-2 sm:py-0",l&&"ring-primary ring-1"),children:[(o||[]).slice().sort((t,e)=>(a[e]||0)-(a[t]||0)).slice(0,1).map(t=>/* @__PURE__ */r("span",{className:"text-sm sm:text-lg",children:l||t},`${s}-${t}-1`)),b>0&&/* @__PURE__ */r("span",{className:"text-xs font-bold sm:text-sm",children:b||0})]})}),/* @__PURE__ */r(Dt,{side:"top",align:"end",children:[c?null:/* @__PURE__ */r("div",h?.customAuth?{className:"p-2 font-semibold",children:["Please"," ",
9
- /* @__PURE__ */r("a",{className:"text-info underline",href:p,children:"Login"})," ","to react"]}:{className:"p-2 font-semibold",children:["Please"," ",
10
- /* @__PURE__ */r(q,{className:"text-info underline",to:n.LOGIN,children:"Login"})," ","to react"]}),c&&/* @__PURE__ */r("div",{className:"flex gap-1 p-2",children:o.map(e=>{const n=l===e;/* @__PURE__ */
11
- return r("div",{className:"flex flex-col items-center",children:[/* @__PURE__ */r("span",{className:"text-xs font-medium",children:a[e]||0}),/* @__PURE__ */r("button",{type:"button",disabled:f,className:y("text-3xl transition-transform disabled:opacity-50",n?"scale-125":"hover:scale-110",f&&"cursor-not-allowed"),onClick:()=>(async e=>{!f&&u&&(v(!0),await u(t,s,e)&&g(!1),v(!1))})(e),children:e})]},`${s}-${e}-2`)})})]})]})},$t=({event:t={},content:e,curateLink:n})=>t.engagementStyle===a.CONTEST?/* @__PURE__ */r("button",{className:"bg-background/75 flex items-center gap-1 rounded px-2 py-1",children:[/* @__PURE__ */r(V,{name:"material-symbols:star-half-rounded",className:"size-4"}),/* @__PURE__ */r("span",{className:"text-xs font-semibold",children:parseFloat(String(e.score||0)).toFixed(1)})]}):t.engagementStyle===a.REACTION&&t.reactionEmojis?.length?/* @__PURE__ */r(Pt,{eventId:t?._id,contentId:e._id,emojis:t?.reactionEmojis,engagementStyle:t?.engagementStyle,counts:e.reactionCounts||{},userReaction:e.userReaction}):null,Ht=({content:t})=>/* @__PURE__ */r("div",{className:"w-full space-y-3 px-3 pb-3",children:[t?.caption&&/* @__PURE__ */r("span",{className:"hidden w-full py-1 text-xs drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)] sm:block","data-tooltip-target":"tooltip-default",children:/* @__PURE__ */r("div",{className:"hover:text-foreground lg:text-md line-clamp-2 text-xs text-white lg:font-medium",title:t?.caption,role:"note",children:t?.caption})}),/* @__PURE__ */r("div",{className:"flex items-center justify-between",children:/* @__PURE__ */r("span",{className:"lg:text-md line-clamp-1 text-sm font-medium text-white drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)]",children:t?.user?.name})})]}),Ft=({event:e,content:n,style:i,timestampField:s,curateLink:o,onChangeFaceUrl:a,hideControls:l})=>{const{organization:c}=k(),d=`content-${n._id}`,h=((t,e)=>{if(!t||!e)return null;const n=e?.[t];if(!n)return null;try{const t=new Date(String(n)),e=/* @__PURE__ */new Date,i=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return i||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}})(s,n);/* @__PURE__ */
12
- return r("div",{id:d,style:i,className:"group relative mb-1 overflow-hidden rounded",children:[/* @__PURE__ */r(Mt,{url:n.src,alt:n.caption,blurhash:n.blurhash,thumbnailUrl:n.thumbnailUrl,curateLink:o,pswpData:{id:n._id,type:u.IMAGE,hash:n._id,width:n.width,height:n.height,thumbnailUrl:n.thumbnailUrl,blurhash:n.blurhash,caption:n.caption,contentSummary:JSON.stringify(n.contentSummary)}}),!l&&/* @__PURE__ */r(t,{children:[h&&/* @__PURE__ */r("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:h}),c?.integrationSettings?.showQuickSearch&&(n.faces?.length??0)>0&&/* @__PURE__ */r("button",{className:"bg-primary absolute top-2 right-2 rounded-full p-1 text-gray-200 opacity-50 transition-all sm:p-1.5 sm:hover:scale-110 sm:hover:opacity-100",onClick:()=>{a?.(n?.url);const t=document.getElementById("media-gallery-container");t&&t.scrollIntoView({behavior:"smooth",block:"start"})},children:/* @__PURE__ */r(V,{color:"a11y",name:"material-symbols:familiar-face-and-zone-outline-rounded"})}),
13
- /* @__PURE__ */r("div",{className:"",children:[/* @__PURE__ */r("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */r(Ht,{content:n})}),/* @__PURE__ */r("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */r($t,{event:e,content:n,curateLink:o})})]})]})]})},Ut=({content:t,style:e,event:n,timestampField:i,curateLink:s,hideControls:o})=>{const a=((t,e)=>{if(!t||!e)return null;const n=e?.[t];if(!n)return null;try{const t=new Date(String(n)),e=/* @__PURE__ */new Date,i=t.getFullYear()===e.getFullYear(),s={weekday:"long",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};return i||(s.year="numeric"),t.toLocaleString("en-US",s).replace(","," •")}catch{return null}})(i,t);/* @__PURE__ */
14
- return r("div",{id:`content-${t._id}`,className:"group relative mb-1 overflow-hidden rounded",style:e,children:[/* @__PURE__ */r(Mt,{url:t.src??t.url,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,alt:t.caption,curateLink:s,pswpData:{id:t._id,type:u.VIDEO,hash:t._id,width:t.width,height:t.height,thumbnailUrl:t.thumbnailUrl,blurhash:t.blurhash,caption:t.caption}}),!o&&/* @__PURE__ */r("div",{className:"transition-opacity duration-500",children:[a&&/* @__PURE__ */r("div",{className:"absolute top-2 left-2 max-w-[calc(100%-80px)] truncate rounded bg-black/50 px-2 py-0.5 text-xs text-white backdrop-blur-sm",children:a}),
15
- /* @__PURE__ */r("div",{className:"absolute bottom-0 w-full rounded-b",children:/* @__PURE__ */r(Ht,{content:t})}),
16
- /* @__PURE__ */r("div",{className:"absolute right-2 bottom-2",children:/* @__PURE__ */r($t,{event:n,content:t,curateLink:s})})]})]})},jt=({event:e,contents:n=[],singleColumnMode:i,kioskMode:a,timestampField:l,curateLink:c,onChangeFaceUrl:h})=>{const p=v(null),m=d(()=>`gallery-${e?._id??""}`,[e]),{captureAdImpression:g,captureAdClick:f}=M(),{organization:T}=k(),[b,x]=w(null);return o(()=>{if(!c){const t=new O({gallery:`#${m}`,children:"a",counter:!1,bgOpacity:1,wheelToZoom:!0,pinchToClose:!0,zoom:!1,pswpModule:()=>import("./B_TauT26.js")});p.current=t,new At(t),new xt(t),new qt(t,g,f),new St(t),new Et(t),T?.navigationSettings?.showAIDescription&&new vt(t,{width:"400px",height:"40%"}),t.init()}return()=>{p.current?.destroy?.(),p.current=null}},[e?.galleryLayout,c,f,g,m,T]),/* @__PURE__ */r(t,{children:[/* @__PURE__ */r(d(()=>{switch(e?.galleryLayout){case s.ROW:return pt;case s.COLUMN:return ft;case s.MASONRY:return yt;default:return pt}},[i,e?.galleryLayout]),{spacing:4,targetRowHeight:i?500:360,columns:t=>i?1:t<400?2:t<800?3:4,photos:n.map(t=>({src:t.type===u.IMAGE||t.type===u.VIDEO?t.url:t.imageUrl,width:t.dimension?.width,height:t.dimension?.height,...t})),render:{container:({ref:t,className:e,children:n})=>/* @__PURE__ */r("div",{id:m,ref:t,className:y(e??"",i?"w-full lg:w-1/3":"w-full"),children:n}),photo:(t,{photo:n,width:i,height:s,index:o})=>{const d=n;let p=null;switch(d.type){case u.IMAGE:p=Ft;break;case u.VIDEO:p=Ut;break;case u.AD:p=Bt;break;default:p=null}return p&&/* @__PURE__ */r(p,{style:{width:i,height:s},event:e,content:d,timestampField:l,onAdClick:()=>{x(d)},hideControls:a,curateLink:c?`${c}/${d._id}`:null,onChangeFaceUrl:h},`${d._id??o}-${o}`)}}}),/* @__PURE__ */r(Nt,{ad:b,onClose:()=>x(null),captureAdClick:f})]})};export{jt as default};