1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5cc0360e-159f-44be-af41-3841a1bef310",e._sentryDebugIdIdentifier="sentry-dbid-5cc0360e-159f-44be-af41-3841a1bef310")}catch(e){}}();import"./_sentry-release-injection-file-BIxAPxRH.js";import{a as e}from"./rolldown-runtime-CynJssAt.js";import{t}from"./react-C9jbeexS.js";import{o as r}from"./isArrayLike-Ch5XQcjF.js";import{f as n,g as s}from"./_arrayPush-DSp2RZw1.js";import{g as o}from"./appRoutes-KNafzIMw.js";import{t as a}from"./noop-DXS_3UHp.js";import{t as i}from"./_copyArray-Bn7L1NMR.js";import{t as u}from"./_flatRest-B13sBdZ-.js";import{t as c}from"./useDateDisplay-Br5TAOSk.js";import{t as l}from"./Popover-BSNJHXs6.js";import{t as d}from"./formatClasses-DEp3Ml96.js";import{K as f,at as _}from"./index-eSpJ4TSf.js";var p=n&&new n;function m(){}var h=4294967295;function w(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}w.prototype=o(m.prototype),w.prototype.constructor=w;var v=p?function(e){return p.get(e)}:a,g={},y=Object.prototype.hasOwnProperty;function S(e){for(var t=e.name+"",r=g[t],n=y.call(g,t)?r.length:0;n--;){var s=r[n],o=s.func;if(null==o||o==e)return s.name}return t}function j(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}j.prototype=o(m.prototype),j.prototype.constructor=j;var x=Object.prototype.hasOwnProperty;function D(e){if(r(e)&&!s(e)&&!(e instanceof w)){if(e instanceof j)return e;if(x.call(e,"__wrapped__"))return function(e){if(e instanceof w)return e.clone();var t=new j(e.__wrapped__,e.__chain__);return t.__actions__=i(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}(e)}return new j(e)}function b(e){var t=S(e),r=D[t];if("function"!=typeof r||!(t in w.prototype))return!1;if(e===r)return!0;var n=v(r);return!!n&&e===n[0]}D.prototype=m.prototype,D.prototype.constructor=D;var P,O=(P=!0,u((function(e){var t=e.length,r=t,n=j.prototype.thru;for(P&&e.reverse();r--;){var o=e[r];if("function"!=typeof o)throw new TypeError("Expected a function");if(n&&!a&&"wrapper"==S(o))var a=new j([],!0)}for(r=a?r:t;++r<t;){var i=S(o=e[r]),u="wrapper"==i?v(o):void 0;a=u&&b(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?a[S(u[0])].apply(a,u[3]):1==o.length&&b(o)?a[i]():a.thru(o)}return function(){var r=arguments,n=r[0];if(a&&1==r.length&&s(n))return a.plant(n).value();for(var o=0,i=t?e[o].apply(this,r):n;++o<t;)i=e[o].call(this,i);return i}}))),I=e(t()),T=f(),C=I.createContext((new Date).getTime()),M=({now:e,children:t})=>{const r=(0,I.useMemo)((()=>new Date(e).getTime()-(new Date).getTime()),[e]),[n,s]=(0,I.useState)((new Date).getTime()+r);return(0,I.useEffect)((()=>{const e=setInterval((()=>{s((new Date).getTime()+r)}),1e3);return()=>clearInterval(e)}),[r]),(0,T.jsx)(C.Provider,{value:n,children:t})},E=()=>(0,I.useContext)(C),A=6e4,k=36e5,N=864e5;function R(e){const t=(0,I.useMemo)((()=>e&&new Date(e)),[e]),r=(t?t.getTime():0)-E();let n,s,o,a;return r<0?(n=0,s=0,o=0,a=0):(n=Math.floor(r/N),s=Math.floor(r%N/k),o=Math.floor(r%k/A),a=Math.floor(r%A/1e3)),{days:n,hours:s,minutes:o,seconds:a}}var L=_();function U(e,t){window.dispatchEvent(new StorageEvent("storage",{key:e,newValue:t}))}var F=(e,t)=>{const r=JSON.stringify(t);window.localStorage.setItem(e,r),U(e,r)},J=e=>window.localStorage.getItem(e),B=e=>(window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)),H=()=>{throw Error("useLocalStorage is a client-only hook")};function K(e,t){const r=I.useSyncExternalStore(B,(()=>J(e)),H),n=I.useCallback((t=>{try{const n="function"==typeof t?t(JSON.parse(r)):t;null==n?(e=>{window.localStorage.removeItem(e),U(e,null)})(e):F(e,n)}catch(n){console.warn(n)}}),[e,r]);return I.useEffect((()=>{null===J(e)&&void 0!==t&&F(e,t)}
1),[e,t]),[r?JSON.parse(r):t,n]}var Q=I.createContext({}),V=I.createContext(null),q=({id:e,name:t,slug:r,finalised_date:n,starts_at:s,ends_at:o,canUseAdminPreview:a,seller:i,reloadPageOnShowcaseStateChange:u=!0,heroImage:c,children:l})=>{const d=E(),f=(0,I.useMemo)((()=>new Date(n)),[n]),_=(0,I.useMemo)((()=>new Date(s)),[s]),p=(0,I.useMemo)((()=>new Date(o)),[o]);let m=(0,I.useMemo)((()=>d<_.getTime()?"future":d>p.getTime()?"past":"live"),[d,_,p]);const h=function(e){const[t,r]=I.useState(e),[n,s]=I.useState(null);return e!==t&&(s(t),r(e)),n}(m),w=u&&h&&m!==h;w&&(m=h),(0,I.useEffect)((()=>{w&&window.location.reload()}),[w]);const v=(0,I.useMemo)((()=>d>f.getTime()),[d,f]),{days:g,hours:y,minutes:S,seconds:j}=R("future"===m?_:p),x=a,D=!x&&i?.canUsePreview,b=x||D,P=i?.id,O=i?.isPartOfShowcase,C=(0,I.useMemo)((()=>({id:e,name:t,slug:r,startsAtDate:_,endsAtDate:p,state:m,hasBeenFinalised:v,isAdminPreview:x,sellerId:P,isSellerPreview:D,isPreview:b,isSellerPartOfShowcase:O,heroImage:c})),[e,t,r,_,p,m,v,x,P,D,b,O,c]),M=(0,I.useMemo)((()=>({days:g,hours:y,minutes:S,seconds:j})),[g,y,S,j]);return(0,T.jsx)(V.Provider,{value:C,children:(0,T.jsx)(Q.Provider,{value:M,children:l})})},z=({id:e,name:t,slug:r,finalised_date:n,starts_at:s,ends_at:o,now:a,canUseAdminPreview:i=!1,seller:u=null,reloadPageOnShowcaseStateChange:c=!0,heroImage:l,children:d})=>(0,T.jsx)(M,{now:a,children:(0,T.jsx)(q,{id:e,name:t,slug:r,finalised_date:n,starts_at:s,ends_at:o,canUseAdminPreview:i,seller:u,reloadPageOnShowcaseStateChange:c,heroImage:l,children:d})}),G=()=>(0,I.useContext)(V),W=O(I.memo,L.withTranslators)((function({t:e,tn:t,showPopover:r=!1,column:n=!1}={}){const{state:s,startsAtDate:o,endsAtDate:a}=G(),{days:i,hours:u,minutes:f,seconds:_}=(0,I.useContext)(Q),p=(0,I.useRef)(),{formatDateRange:m}=c(),h=(0,I.useMemo)((()=>m(o,a,"time")),[o,a,m]);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:d("showcase-countdown",{column:n}),ref:p,children:"past"===s?(0,T.jsx)("div",{children:e("This showcase has ended")}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{children:e("future"===s?i<=0?"Opens soon:":"Opens in:":"Closes in:")}),(0,T.jsx)("div",{children:i<=0?e("{{ hours }}:{{ minutes }}:{{ seconds }}",{numberOfDays:i,hours:u.toString().padStart(2,"0"),minutes:f.toString().padStart(2,"0"),seconds:_.toString().padStart(2,"0")}):t("{{ numberOfDays }} day, {{ hours }}:{{ minutes }}:{{ seconds }}","{{ numberOfDays }} days, {{ hours }}:{{ minutes }}:{{ seconds }}",i,{numberOfDays:i,hours:u.toString().padStart(2,"0"),minutes:f.toString().padStart(2,"0"),seconds:_.toString().padStart(2,"0")})})]})}),r&&(0,T.jsx)(l,{parentRef:p,isHover:!0,elevated:!0,placement:"bottom",children:(0,T.jsxs)("div",{className:"center",children:[e("The showcase is open:"),(0,T.jsx)("br",{}),h]})})]})}));W.displayName="ShowcaseCountdown";export{K as a,O as c,G as i,z as n,R as o,q as r,E as s,W as t}; 2//# sourceMappingURL=ShowcaseCountdown-Czxeg0HT.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.