PageSourceSearch

https://www.staysure.co.uk/_next/static/chunks/290-f8a50981119e4978.js

js staysure.co.uk collected 2026-09-24 20:33:04 UTC 12,793 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[290],{4290:function(t,e,n){n.r(e),n.d(e,{default:function(){return P}});var a=n(7573),r=n(9585),s=n(3074);function o(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var a=e[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function l(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function c(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&p(t,e)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}();return function(){var n,a=u(t);return n=e?Reflect.construct(a,arguments,u(this).constructor):a.apply(this,arguments),n&&("object"==typeof n||"function"==typeof n)?n:function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this)}}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=Array(e);n<e;n++)a[n]=t[n];return a}function f(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,a=String(t);if(0===n)return a;var r=a.match(/(.*?)([0-9]+)(.*)/),s=r?r[1]:"",o=r?r[3]:"",i=r?r[2]:a,l=i.length>=n?i:(((function(t){if(Array.isArray(t))return m(t)})(e=Array(n))||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(e)||function(t,e){if(t){if("string"==typeof t)return m(t,void 0);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(t,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map(function(){return"0"}).join("")+i).slice(-1*n);return"".concat(s).concat(l).concat(o)}var h={daysInHours:!1,zeroPadTime:2},v=function(t){c(n,t);var e=d(n);function n(){var t;return o(this,n),t=e.apply(this,arguments),t.state={count:t.props.count||3},t.startCountdown=function(){t.interval=window.setInterval(function(){0==t.state.count-1?(t.stopCountdown(),t.props.onComplete&&t.props.onComplete()):t.setState(function(t){return{count:t.count-1}})},1e3)},t.stopCountdown=function(){clearInterval(t.interval)},t.addTime=function(e){t.stopCountdown(),t.setState(function(t){return{count:t.count+e}},t.startCountdown)},t}return l(n,[{key:"componentDidMount",value:function(){this.startCountdown()}},{key:"componentWillUnmount",value:function(){clearInterval(this.interval)}},{key:"render",value:function(){return this.props.children?(0,r.cloneElement)(this.props.children,{count:this.state.count}):null}}]),n}(r.Component);v.propTypes={count:s.number,children:s.element,onComplete:s.func};var x=function(t){c(n,t);var e=d(n);function n(t){var a;if(o(this,n),(a=e.call(this,t)).mounted=!1,a.initialTimestamp=a.calcOffsetStartTimestamp(),a.offsetStartTimestamp=a.props.autoStart?0:a.initialTimestamp,a.offsetTime=0,a.legacyMode=!1,a.legacyCountdownRef=null,a.tick=function(){var t=a.calcTimeDelta(),e=t.completed&&!a.props.overtime?void 0:a.props.onTick;a.setTimeDeltaState(t,void 0,e)},a.setLegacyCountdownRef=function(t){a.legacyCountdownRef=t},a.start=function(){if(!a.isStarted()){var t=a.offsetStartTimestamp;a.offsetStartTimestamp=0,a.offsetTime+=t?a.calcOffsetStartTimestamp()-t:0;var e=a.calcTimeDelta();a.setTimeDeltaState(e,"STARTED",a.props.onStart),a.props.controlled||e.completed&&!a.props.overt
1ime||(a.clearTimer(),a.interval=window.setInterval(a.tick,a.props.intervalDelay))}},a.pause=function(){a.isPaused()||(a.clearTimer(),a.offsetStartTimestamp=a.calcOffsetStartTimestamp(),a.setTimeDeltaState(a.state.timeDelta,"PAUSED",a.props.onPause))},a.stop=function(){a.isStopped()||(a.clearTimer(),a.offsetStartTimestamp=a.calcOffsetStartTimestamp(),a.offsetTime=a.offsetStartTimestamp-a.initialTimestamp,a.setTimeDeltaState(a.calcTimeDelta(),"STOPPED",a.props.onStop))},a.isStarted=function(){return a.isStatus("STARTED")},a.isPaused=function(){return a.isStatus("PAUSED")},a.isStopped=function(){return a.isStatus("STOPPED")},a.isCompleted=function(){return a.isStatus("COMPLETED")},t.date){var r=a.calcTimeDelta();a.state={timeDelta:r,status:r.completed?"COMPLETED":"STOPPED"}}else a.legacyMode=!0;return a}return l(n,[{key:"componentDidMount",value:function(){!this.legacyMode&&(this.mounted=!0,this.props.onMount&&this.props.onMount(this.calcTimeDelta()),this.props.autoStart&&this.start())}},{key:"componentDidUpdate",value:function(t){this.legacyMode||this.props.date===t.date||(this.initialTimestamp=this.calcOffsetStartTimestamp(),this.offsetStartTimestamp=this.initialTimestamp,this.offsetTime=0,this.setTimeDeltaState(this.calcTimeDelta()))}},{key:"componentWillUnmount",value:function(){this.legacyMode||(this.mounted=!1,this.clearTimer())}},{key:"calcTimeDelta",value:function(){var t=this.props,e=t.date,n=t.now,a=t.precision,r=t.controlled,s=t.overtime;return function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=n.now,r=void 0===a?Date.now:a,s=n.precision,o=n.controlled,i=n.offsetTime,l=n.overt
1ime;e="string"==typeof t?new Date(t).getTime():t instanceof Date?t.getTime():t,o||(e+=void 0===i?0:i);var c=o?e:e-r(),u=Math.round(1e3*parseFloat(((l?c:Math.max(0,c))/1e3).toFixed(Math.min(20,Math.max(0,void 0===s?0:s))))),p=Math.abs(u)/1e3;return{total:u,days:Math.floor(p/86400),hours:Math.floor(p/3600%24),minutes:Math.floor(p/60%60),seconds:Math.floor(p%60),milliseconds:Number((p%1*1e3).toFixed()),completed:u<=0}}(e,{now:n,precision:a,controlled:r,offsetTime:this.offsetTime,overtime:s})}},{key:"calcOffsetStartTimestamp",value:function(){return Date.now()}},{key:"addTime",value:function(t){this.legacyCountdownRef.addTime(t)}},{key:"clearTimer",value:function(){window.clearInterval(this.interval)}},{key:"isStatus",value:function(t){return this.state.status===t}},{key:"setTimeDeltaState",value:function(t,e,n){var a=this;if(this.mounted){var r=t.completed&&!this.state.timeDelta.completed,s=t.completed&&"STARTED"===e;return r&&!this.props.overtime&&this.clearTimer(),this.setState(function(n){var r=e||n.status;return t.completed&&!a.props.overtime?r="COMPLETED":e||"COMPLETED"!==r||(r="STOPPED"),{timeDelta:t,status:r}},function(){n&&n(a.state.timeDelta),a.props.onComplete&&(r||s)&&a.props.onComplete(t,s)})}}},{key:"getApi",value:function(){return this.api=this.api||{start:this.start,pause:this.pause,stop:this.stop,isStarted:this.isStarted,isPaused:this.isPaused,isStopped:this.isStopped,isCompleted:this.isCompleted}}},{key:"getRenderProps",value:function(){var t,e,n,a,r,s,o,i,l,c,u,p,d=this.props,m=d.daysInHours,v=d.zeroPadTime,x=d.zeroPadDays,y=this.state.timeDelta;return Object.assign(Object.assign({},y),{api:this.getApi(),props:this.props,formatted:(t={daysInHours:m,zeroPadTime:v,zeroPadDays:x},e=y.days,n=y.hours,a=y.minutes,r=y.seconds,o=(s=Object.assign(Object.assign({},h),t)).daysInHours,i=s.zeroPadTime,c=void 0===(l=s.zeroPadDays)?i:l,u=Math.min(2,i),p=o?f(n+24*e,i):f(n,u),{days:o?"":f(e,c),hours:p,minutes:f(a,u),seconds:f(r,u)})})}},{key:"render",value:function(){if(this.legacyMode){var t=this.props,e=t.count,n=t.children,a=t.onComplete;return(0,r.createElement)(v,{ref:this.setLegacyCountdownRef,count:e,onComplete:a},n)}var s=this.props,o=s.className,i=s.overtime,l=s.children,c=s.renderer,u=this.getRenderProps();if(c)return c(u);if(l&&this.state.timeDelta.completed&&!i)return(0,r.cloneElement)(l,{countdown:u});var p=u.formatted,d=p.days,m=p.hours,f=p.minutes,h=p.seconds;return(0,r.createElement)("span",{className:o},u.total<0?"-":"",d,d?":":"",m,":",f,":",h)}}]),n}(r.Component);x.defaultProps=Object.assign(Object.assign({},h),{controlled:!1,intervalDelay:1e3,precision:0,autoStart:!0}),x.propTypes={date:(0,s.oneOfType)([(0,s.instanceOf)(Date),s.string,s.number]),daysInHours:s.bool,zeroPadTime:s.number,zeroPadDays:s.number,controlled:s.bool,intervalDelay:s.number,precision:s.number,autoStart:s.bool,overtime:s.bool,className:s.string,children:s.element,renderer:s.func,now:s.func,onMount:s.func,onStart:s.func,onPause:s.func,onStop:s.func,onTick:s.func,onComplete:s.func};var y=n(6849),b=n(4189),T=n(4255),S=n(9174),g=n(8053);let{completionlist:w}=(0,y.tv)({slots:{completionlist:"text-[31px] font-semibold text-black"},variants:{brand:{staysure:{},avanti:{},ptm:{},staysureIntl:{}}},defaultVariants:{brand:"staysure"}})({brand:b.UQ}),D=()=>(0,a.jsx)("span",{className:w(),children:"Expired"}),j=(t,e,n,r,s,o)=>i=>{let{days:l,hours:c,minutes:u,seconds:p,completed:d}=i;if(d)return(0,a.jsx)(D,{});let{base:m,container:f,value:h,wording:v}=(0,y.tv)({slots:{base:"flex gap-x-8",container:"relative grid h-[50px] w-[50px] content-center justify-center rounded-[4px] bg-white text-center font-semibold text-body",value:"text-3xl/26",wording:"text-[10px] font-bold leading-[9px]"},variants:{brand:{staysure:{},avanti:{},ptm:{},staysureIntl:{}},isHomeHero:{true:{base:"justify-center xs:gap-x-4 md:gap-x-8",container:"h-32 w-32 rounded-[2px] border-[0.5px] border-white bg-transparent text-white md:h-40 md:w-40",value:"text-s/20 md:text-[24px] md:leading-24",wording:"text-[6px] leading-[10px] md:text-[8px] md:leading-[8px]"}},isHomeHeroMobile:{true:{base:"[&>div:not(:last-child)>span]:after:absolute [&>div:not(:last-child)>span]:after:content-[':'] [&>div:not(:last-child)>span]:after:-right-[6px]",container:"h-auto w-auto bg-transparent",value:"text-xs/27 text-dark-accent-4-primary",wording:"hidden"}},isAvantiHero:{true:{}}},defaultVariants:{brand:"staysure"},compoundVariants:[{brand:T.QP.STAYSURE,class:{value:"font-acumin",wording:"font-acumin leading-16"}},{brand:T.QP.STAYSURE,isHomeHero:!0,class:{value:"font-acumin",wording:"md:leading-[12px] font-acumin"}},{brand:T.QP.STAYSURE,isHomeHeroMobile:!0,class:{value:"font-acumin"}},{brand:T.QP.AVANTI,isAvantiHero:!0,class:{container:"!bg-white !text-body !rounded-[4px] !h-[47px] !w-[47px]"}}]})({isHomeHero:t,brand:b.UQ,isHomeHeroMobile:e,isAvantiHero:o});if(n){let{wrapper:t,label:e,timeContainer:n,timeValue:o,separator:i}=(0,y.tv)({slots:{wrapper:"flex flex-nowrap items-center gap-x-8 font-medium",label:"text-white whitespace-nowrap",timeContainer:"flex flex-nowrap items-center gap-x-4",timeValue:"",separator:""},variants:{brand:{staysure:{},avanti:{},ptm:{},staysureIntl:{}},isSaleCountOnly:{true:{label:"text-xs/21",timeValue:"text-xs/21",separator:"text-xs/21"},false:{wrapper:"rounded-lg border h-[37px] xs:h-[39px] border-white px-16 py-8",label:"text-xs/21 xs:text-s/23",timeValue:"text-xs/21 xs:text-s/23",separator:"text-xs/21 xs:text-s/23"}}},defaultVariants:{brand:"staysure",isSaleCountOnly:!1}})({brand:b.UQ,isSaleCountOnly:r});return(0,a.jsxs)("div",{className:t(),children:[(0,a.jsxs)("span",{className:e(),children:[" ",(0,S.G1)("saleEndsIn",s)]}),(0,a.jsxs)("div",{className:n(),children:[(0,a.jsxs)("span",{className:o(),children:[String(l).padStart(2,"0"),"d"]}),(0,a.jsx)("span",{className:i(),children:":"}),(0,a.jsxs)("span",{className:o(),children:[String(c).padStart(2,"0"),"h"]}),(0,a.jsx)("span",{className:i(),children:":"}),(0,a.jsxs)("span",{className:o(),children:[String(u).padStart(2,"0"),"m"]}),(0,a.jsx)("span",{className:i(),children:":"}),(0,a.jsxs)("span",{className:o(),children:[String(p).padStart(2,"0"),"s"]})]})]})}return(0,a.jsxs)("div",{className:m(),children:[(0,a.jsxs)("div",{className:f(),children:[(0,a.jsx)("span",{className:h(),children:l}),(0,a.jsx)("span",{className:v(),children:(0,S.G1)("days",s)})]}),(0,a.jsxs)("div",{className:f(),children:[(0,a.jsx)("span",{className:h(),children:c}),(0,a.jsx)("span",{className:v(),children:(0,S.G1)("hours",s)})]}),(0,a.jsxs)("div",{className:f(),children:[(0,a.jsx)("span",{className:h(),children:u}),(0,a.jsx)("span",{className:v(),children:(0,S.G1)("minutes",s)})]}),(0,a.jsxs)("div",{className:f(),children:[(0,a.jsx)("span",{className:h(),children:p}),(0,a.jsx)("span",{className:v(),children:(0,S.G1)("seconds",s)})]})]})};function P(t){let{endDate:e=0,isHomeHero:n=!1,isHomeHeroMobile:r=!1,isSaleStrap:s=!1,isSaleCountOnly:o=!1,isAvantiHero:i=!1}=t,l=(0,g.y)();return(0,a.jsx)(x,{date:e,renderer:j(n,r,s,o,l,i)})}}}]);

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.