/*! For license information please see spm.v1.min.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Sailthru",[],t):"object"==typeof exports?exports.Sailthru=t():e.Sailthru=t()}(self,()=>(()=>{"use strict";var e={169:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});class n extends Error{}class r extends n{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class i extends n{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class o extends n{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class s extends n{}class a extends n{constructor(e){super(`Invalid unit ${e}`)}}class u extends n{}class l extends n{constructor(){super("Zone is an abstract class")}}const c="numeric",d="short",h="long",f={year:c,month:c,day:c},m={year:c,month:d,day:c},p={year:c,month:d,day:c,weekday:d},y={year:c,month:h,day:c},g={year:c,month:h,day:c,weekday:h},v={hour:c,minute:c},w={hour:c,minute:c,second:c},b={hour:c,minute:c,second:c,timeZoneName:d},k={hour:c,minute:c,second:c,timeZoneName:h},S={hour:c,minute:c,hourCycle:"h23"},x={hour:c,minute:c,second:c,hourCycle:"h23"},T={hour:c,minute:c,second:c,hourCycle:"h23",timeZoneName:d},O={hour:c,minute:c,second:c,hourCycle:"h23",timeZoneName:h},I={year:c,month:c,day:c,hour:c,minute:c},N={year:c,month:c,day:c,hour:c,minute:c,second:c},E={year:c,month:d,day:c,hour:c,minute:c},C={year:c,month:d,day:c,hour:c,minute:c,second:c},D={year:c,month:d,day:c,weekday:d,hour:c,minute:c},$={year:c,month:h,day:c,hour:c,minute:c,timeZoneName:d},_={year:c,month:h,day:c,hour:c,minute:c,second:c,timeZoneName:d},V={year:c,month:h,day:c,weekday:h,hour:c,minute:c,timeZoneName:h},M={year:c,month:h,day:c,weekday:h,hour:c,minute:c,second:c,timeZoneName:h};class F{get type(){throw new l}get name(){throw new l}get ianaName(){return this.name}get isUniversal(){throw new l}offsetName(e,t){throw new l}formatOffset(e,t){throw new l}offset(e){throw new l}equals(e){throw new l}get isValid(){throw new l}}let P=null;class A extends F{static get instance(){return null===P&&(P=new A),P}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return rt(e,t,n)}formatOffset(e,t){return at(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"system"===e.type}get isValid(){return!0}}const L=new Map;const j={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};const U=new Map;class R extends F{static create(e){let t=U.get(e);return void 0===t&&U.set(e,t=new R(e)),t}static resetCache(){U.clear(),L.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}}constructor(e){super(),this.zoneName=e,this.valid=R.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return rt(e,t,n,this.name)}formatOffset(e,t){return at(this.offset(e),t)}offset(e){if(!this.valid)return NaN;const t=new Date(e);if(isNaN(t))return NaN;const n=function(e){let t=L.get(e);return void 0===t&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),L.set(e,t)),t}(this.name);let[r,i,o,s,a,u,l]=n.formatToParts?function(e,t){const n=e.formatToParts(t),r=[];for(let e=0;e=0?d:1e3+d,(Qe({year:r,month:i,day:o,hour:24===a?0:a,minute:u,second:l,millisecond:0})-c)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let q={};const z=new Map;function W(e,t={}){const n=JSON.stringify([e,t]);let r=z.get(n);return void 0===r&&(r=new Intl.DateTimeFormat(e,t),z.set(n,r)),r}const Z=new Map;const H=new Map;let G=null;const B=new Map;function Y(e){let t=B.get(e);return void 0===t&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),B.set(e,t)),t}const J=new Map;function K(e,t,n,r){const i=e.listingMode();return"error"===i?null:"en"===i?n(t):r(t)}class X{constructor(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;const{padTo:r,floor:i,...o}=n;if(!t||Object.keys(o).length>0){const t={useGrouping:!1,...n};n.padTo>0&&(t.minimumIntegerDigits=n.padTo),this.inf=function(e,t={}){const n=JSON.stringify([e,t]);let r=Z.get(n);return void 0===r&&(r=new Intl.NumberFormat(e,t),Z.set(n,r)),r}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return Ze(this.floor?Math.floor(e):Ye(e,3),this.padTo)}}class Q{constructor(e,t,n){let r;if(this.opts=n,this.originalZone=void 0,this.opts.timeZone)this.dt=e;else if("fixed"===e.zone.type){const t=e.offset/60*-1,n=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;0!==e.offset&&R.create(n).valid?(r=n,this.dt=e):(r="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?(this.dt=e,r=e.zone.name):(r="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const i={...this.opts};i.timeZone=i.timeZone||r,this.dtf=W(t,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(e=>{if("timeZoneName"===e.type){const t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}return e}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class ee{constructor(e,t,n){this.opts={style:"long",...n},!t&&je()&&(this.rtf=function(e,t={}){const{base:n,...r}=t,i=JSON.stringify([e,r]);let o=H.get(i);return void 0===o&&(o=new Intl.RelativeTimeFormat(e,t),H.set(i,o)),o}(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,n="always",r=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===n&&o){const n="days"===e;switch(t){case 1:return n?"tomorrow":`next ${i[e][0]}`;case-1:return n?"yesterday":`last ${i[e][0]}`;case 0:return n?"today":`this ${i[e][0]}`}}const s=Object.is(t,-0)||t<0,a=Math.abs(t),u=1===a,l=i[e],c=r?u?l[1]:l[2]||l[1]:u?i[e][0]:e;return s?`${a} ${c} ago`:`in ${a} ${c}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const te={firstDay:1,minimalDays:4,weekend:[6,7]};class ne{static fromOpts(e){return ne.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,n,r,i=!1){const o=e||be.defaultLocale,s=o||(i?"en-US":G||(G=(new Intl.DateTimeFormat).resolvedOptions().locale,G)),a=t||be.defaultNumberingSystem,u=n||be.defaultOutputCalendar,l=ze(r)||be.defaultWeekSettings;return new ne(s,a,u,l,o)}static resetCache(){G=null,z.clear(),Z.clear(),H.clear(),B.clear(),J.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:n,weekSettings:r}={}){return ne.create(e,t,n,r)}constructor(e,t,n,r,i){const[o,s,a]=function(e){const t=e.indexOf("-x-");-1!==t&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(-1===n)return[e];{let t,r;try{t=W(e).resolvedOptions(),r=e}catch(i){const o=e.substring(0,n);t=W(o).resolvedOptions(),r=o}const{numberingSystem:i,calendar:o}=t;return[r,i,o]}}(e);this.locale=o,this.numberingSystem=t||s||null,this.outputCalendar=n||a||null,this.weekSettings=r,this.intl=function(e,t,n){return n||t?(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===Y(e.locale).numberingSystem)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?ne.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,ze(e.weekSettings)||this.weekSettings,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return K(this,e,ht,()=>{const n="ja"===this.intl||this.intl.startsWith("ja-"),r=(t&=!n)?{month:e,day:"numeric"}:{month:e},i=t?"format":"standalone";if(!this.monthsCache[i][e]){const t=n?e=>this.dtFormatter(e,r).format():e=>this.extract(e,r,"month");this.monthsCache[i][e]=function(e){const t=[];for(let n=1;n<=12;n++){const r=vr.utc(2009,n,1);t.push(e(r))}return t}(t)}return this.monthsCache[i][e]})}weekdays(e,t=!1){return K(this,e,yt,()=>{const n=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},r=t?"format":"standalone";return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=function(e){const t=[];for(let n=1;n<=7;n++){const r=vr.utc(2016,11,13+n);t.push(e(r))}return t}(e=>this.extract(e,n,"weekday"))),this.weekdaysCache[r][e]})}meridiems(){return K(this,void 0,()=>gt,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[vr.utc(2016,11,13,9),vr.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return K(this,e,kt,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[vr.utc(-40,1,1),vr.utc(2017,1,1)].map(e=>this.extract(e,t,"era"))),this.eraCache[e]})}extract(e,t,n){const r=this.dtFormatter(e,t).formatToParts().find(e=>e.type.toLowerCase()===n);return r?r.value:null}numberFormatter(e={}){return new X(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Q(e,this.intl,t)}relFormatter(e={}){return new ee(this.intl,this.isEnglish(),e)}listFormatter(e={}){return function(e,t={}){const n=JSON.stringify([e,t]);let r=q[n];return r||(r=new Intl.ListFormat(e,t),q[n]=r),r}(this.intl,e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||Y(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Ue()?function(e){let t=J.get(e);if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in t||(t={...te,...t}),J.set(e,t)}return t}(this.locale):te}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let re=null;class ie extends F{static get utcInstance(){return null===re&&(re=new ie(0)),re}static instance(e){return 0===e?ie.utcInstance:new ie(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new ie(it(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${at(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${at(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return at(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class oe extends F{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function se(e,t){if(Pe(e)||null===e)return t;if(e instanceof F)return e;if("string"==typeof e){const n=e.toLowerCase();return"default"===n?t:"local"===n||"system"===n?A.instance:"utc"===n||"gmt"===n?ie.utcInstance:ie.parseSpecifier(n)||R.create(e)}return Ae(e)?ie.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new oe(e)}const ae={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},ue={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},le=ae.hanidec.replace(/[\[|\]]/g,"").split("");const ce=new Map;function de({numberingSystem:e},t=""){const n=e||"latn";let r=ce.get(n);void 0===r&&(r=new Map,ce.set(n,r));let i=r.get(t);return void 0===i&&(i=new RegExp(`${ae[n]}${t}`),r.set(t,i)),i}let he,fe=()=>Date.now(),me="system",pe=null,ye=null,ge=null,ve=60,we=null;class be{static get now(){return fe}static set now(e){fe=e}static set defaultZone(e){me=e}static get defaultZone(){return se(me,A.instance)}static get defaultLocale(){return pe}static set defaultLocale(e){pe=e}static get defaultNumberingSystem(){return ye}static set defaultNumberingSystem(e){ye=e}static get defaultOutputCalendar(){return ge}static set defaultOutputCalendar(e){ge=e}static get defaultWeekSettings(){return we}static set defaultWeekSettings(e){we=ze(e)}static get twoDigitCutoffYear(){return ve}static set twoDigitCutoffYear(e){ve=e%100}static get throwOnInvalid(){return he}static set throwOnInvalid(e){he=e}static resetCaches(){ne.resetCache(),R.resetCache(),vr.resetCache(),ce.clear()}}class ke{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Se=[0,31,59,90,120,151,181,212,243,273,304,334],xe=[0,31,60,91,121,152,182,213,244,274,305,335];function Te(e,t){return new ke("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function Oe(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const i=r.getUTCDay();return 0===i?7:i}function Ie(e,t,n){return n+(Je(e)?xe:Se)[t-1]}function Ne(e,t){const n=Je(e)?xe:Se,r=n.findIndex(e=>ett(r,t,n)?(u=r+1,l=1):u=r,{weekYear:u,weekNumber:l,weekday:a,...ut(e)}}function De(e,t=4,n=1){const{weekYear:r,weekNumber:i,weekday:o}=e,s=Ee(Oe(r,1,t),n),a=Ke(r);let u,l=7*i+o-s-7+t;l<1?(u=r-1,l+=Ke(u)):l>a?(u=r+1,l-=Ke(r)):u=r;const{month:c,day:d}=Ne(u,l);return{year:u,month:c,day:d,...ut(e)}}function $e(e){const{year:t,month:n,day:r}=e;return{year:t,ordinal:Ie(t,n,r),...ut(e)}}function _e(e){const{year:t,ordinal:n}=e,{month:r,day:i}=Ne(t,n);return{year:t,month:r,day:i,...ut(e)}}function Ve(e,t){if(!Pe(e.localWeekday)||!Pe(e.localWeekNumber)||!Pe(e.localWeekYear)){if(!Pe(e.weekday)||!Pe(e.weekNumber)||!Pe(e.weekYear))throw new s("Cannot mix locale-based week fields with ISO-based week fields");return Pe(e.localWeekday)||(e.weekday=e.localWeekday),Pe(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),Pe(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function Me(e){const t=Le(e.year),n=We(e.month,1,12),r=We(e.day,1,Xe(e.year,e.month));return t?n?!r&&Te("day",e.day):Te("month",e.month):Te("year",e.year)}function Fe(e){const{hour:t,minute:n,second:r,millisecond:i}=e,o=We(t,0,23)||24===t&&0===n&&0===r&&0===i,s=We(n,0,59),a=We(r,0,59),u=We(i,0,999);return o?s?a?!u&&Te("millisecond",i):Te("second",r):Te("minute",n):Te("hour",t)}function Pe(e){return void 0===e}function Ae(e){return"number"==typeof e}function Le(e){return"number"==typeof e&&e%1==0}function je(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function Ue(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function Re(e,t,n){if(0!==e.length)return e.reduce((e,r)=>{const i=[t(r),r];return e&&n(e[0],i[0])===e[0]?e:i},null)[1]}function qe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ze(e){if(null==e)return null;if("object"!=typeof e)throw new u("Week settings must be an object");if(!We(e.firstDay,1,7)||!We(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(e=>!We(e,1,7)))throw new u("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function We(e,t,n){return Le(e)&&e>=t&&e<=n}function Ze(e,t=2){let n;return n=e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0"),n}function He(e){return Pe(e)||null===e||""===e?void 0:parseInt(e,10)}function Ge(e){return Pe(e)||null===e||""===e?void 0:parseFloat(e)}function Be(e){if(!Pe(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function Ye(e,t,n="round"){const r=10**t;switch(n){case"expand":return e>0?Math.ceil(e*r)/r:Math.floor(e*r)/r;case"trunc":return Math.trunc(e*r)/r;case"round":return Math.round(e*r)/r;case"floor":return Math.floor(e*r)/r;case"ceil":return Math.ceil(e*r)/r;default:throw new RangeError(`Value rounding ${n} is out of range`)}}function Je(e){return e%4==0&&(e%100!=0||e%400==0)}function Ke(e){return Je(e)?366:365}function Xe(e,t){const n=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===n?Je(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Qe(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function et(e,t,n){return-Ee(Oe(e,1,t),n)+t-1}function tt(e,t=4,n=1){const r=et(e,t,n),i=et(e+1,t,n);return(Ke(e)-r+i)/7}function nt(e){return e>99?e:e>be.twoDigitCutoffYear?1900+e:2e3+e}function rt(e,t,n,r=null){const i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);const s={timeZoneName:t,...o},a=new Intl.DateTimeFormat(n,s).formatToParts(i).find(e=>"timezonename"===e.type.toLowerCase());return a?a.value:null}function it(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0;return 60*n+(n<0||Object.is(n,-0)?-r:r)}function ot(e){const t=Number(e);if("boolean"==typeof e||""===e||!Number.isFinite(t))throw new u(`Invalid unit value ${e}`);return t}function st(e,t){const n={};for(const r in e)if(qe(e,r)){const i=e[r];if(null==i)continue;n[t(r)]=ot(i)}return n}function at(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${Ze(n,2)}:${Ze(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${Ze(n,2)}${Ze(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function ut(e){return function(e,t){return t.reduce((t,n)=>(t[n]=e[n],t),{})}(e,["hour","minute","second","millisecond"])}const lt=["January","February","March","April","May","June","July","August","September","October","November","December"],ct=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dt=["J","F","M","A","M","J","J","A","S","O","N","D"];function ht(e){switch(e){case"narrow":return[...dt];case"short":return[...ct];case"long":return[...lt];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const ft=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],mt=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],pt=["M","T","W","T","F","S","S"];function yt(e){switch(e){case"narrow":return[...pt];case"short":return[...mt];case"long":return[...ft];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const gt=["AM","PM"],vt=["Before Christ","Anno Domini"],wt=["BC","AD"],bt=["B","A"];function kt(e){switch(e){case"narrow":return[...bt];case"short":return[...wt];case"long":return[...vt];default:return null}}function St(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const xt={D:f,DD:m,DDD:y,DDDD:g,t:v,tt:w,ttt:b,tttt:k,T:S,TT:x,TTT:T,TTTT:O,f:I,ff:E,fff:$,ffff:V,F:N,FF:C,FFF:_,FFFF:M};class Tt{static create(e,t={}){return new Tt(e,t)}static parseFormat(e){let t=null,n="",r=!1;const i=[];for(let o=0;o0||r)&&i.push({literal:r||/^\s+$/.test(n),val:""===n?"'":n}),t=null,n="",r=!r):r||s===t?n+=s:(n.length>0&&i.push({literal:/^\s+$/.test(n),val:n}),n=s,t=s)}return n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),i}static macroTokenToFormatOpts(e){return xt[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0,n=void 0){if(this.opts.forceSimple)return Ze(e,t);const r={...this.opts};return t>0&&(r.padTo=t),n&&(r.signDisplay=n),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,t){const n="en"===this.loc.listingMode(),r=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,i=(t,n)=>this.loc.extract(e,t,n),o=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",s=()=>n?function(e){return gt[e.hour<12?0:1]}(e):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(t,r)=>n?function(e,t){return ht(t)[e.month-1]}(e,t):i(r?{month:t}:{month:t,day:"numeric"},"month"),u=(t,r)=>n?function(e,t){return yt(t)[e.weekday-1]}(e,t):i(r?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),l=t=>{const n=Tt.macroTokenToFormatOpts(t);return n?this.formatWithSystemDefault(e,n):t},c=t=>n?function(e,t){return kt(t)[e.year<0?0:1]}(e,t):i({era:t},"era");return St(Tt.parseFormat(t),t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return s();case"d":return r?i({day:"numeric"},"day"):this.num(e.day);case"dd":return r?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return r?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return r?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return r?i({month:"numeric"},"month"):this.num(e.month);case"MM":return r?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return r?i({year:"numeric"},"year"):this.num(e.year);case"yy":return r?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return r?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return r?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return l(t)}})}formatDurationFromString(e,t){const n="negativeLargestOnly"===this.opts.signMode?-1:1,r=e=>{switch(e[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},i=Tt.parseFormat(t),o=i.reduce((e,{literal:t,val:n})=>t?e:e.concat(n),[]),s=e.shiftTo(...o.map(r).filter(e=>e));return St(i,((e,t)=>i=>{const o=r(i);if(o){const r=t.isNegativeDuration&&o!==t.largestUnit?n:1;let s;return s="negativeLargestOnly"===this.opts.signMode&&o!==t.largestUnit?"never":"all"===this.opts.signMode?"always":"auto",this.num(e.get(o)*r,i.length,s)}return i})(s,{isNegativeDuration:s<0,largestUnit:Object.keys(s.values)[0]}))}}const Ot=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function It(...e){const t=e.reduce((e,t)=>e+t.source,"");return RegExp(`^${t}$`)}function Nt(...e){return t=>e.reduce(([e,n,r],i)=>{const[o,s,a]=i(t,r);return[{...e,...o},s||n,a]},[{},null,1]).slice(0,2)}function Et(e,...t){if(null==e)return[null,null];for(const[n,r]of t){const t=n.exec(e);if(t)return r(t)}return[null,null]}function Ct(...e){return(t,n)=>{const r={};let i;for(i=0;ivoid 0!==e&&(t||e&&c)?-e:e;return[{years:h(Ge(n)),months:h(Ge(r)),weeks:h(Ge(i)),days:h(Ge(o)),hours:h(Ge(s)),minutes:h(Ge(a)),seconds:h(Ge(u),"-0"===u),milliseconds:h(Be(l),d)}]}const Zt={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ht(e,t,n,r,i,o,s){const a={year:2===t.length?nt(He(t)):He(t),month:ct.indexOf(n)+1,day:He(r),hour:He(i),minute:He(o)};return s&&(a.second=He(s)),e&&(a.weekday=e.length>3?ft.indexOf(e)+1:mt.indexOf(e)+1),a}const Gt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Bt(e){const[,t,n,r,i,o,s,a,u,l,c,d]=e,h=Ht(t,i,r,n,o,s,a);let f;return f=u?Zt[u]:l?0:it(c,d),[h,new ie(f)]}const Yt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Jt=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Kt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Xt(e){const[,t,n,r,i,o,s,a]=e;return[Ht(t,i,r,n,o,s,a),ie.utcInstance]}function Qt(e){const[,t,n,r,i,o,s,a]=e;return[Ht(t,a,n,r,i,o,s),ie.utcInstance]}const en=It(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Vt),tn=It(/(\d{4})-?W(\d\d)(?:-?(\d))?/,Vt),nn=It(/(\d{4})-?(\d{3})/,Vt),rn=It(_t),on=Nt(function(e,t){return[{year:Lt(e,t),month:Lt(e,t+1,1),day:Lt(e,t+2,1)},null,t+3]},jt,Ut,Rt),sn=Nt(Mt,jt,Ut,Rt),an=Nt(Ft,jt,Ut,Rt),un=Nt(jt,Ut,Rt);const ln=Nt(jt);const cn=It(/(\d{4})-(\d\d)-(\d\d)/,At),dn=It(Pt),hn=Nt(jt,Ut,Rt);const fn="Invalid Duration",mn={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},pn={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...mn},yn=365.2425,gn=30.436875,vn={years:{quarters:4,months:12,weeks:52.1775,days:yn,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:gn,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...mn},wn=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],bn=wn.slice(0).reverse();function kn(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new On(r)}function Sn(e,t){var n;let r=null!=(n=t.milliseconds)?n:0;for(const n of bn.slice(1))t[n]&&(r+=t[n]*e[n].milliseconds);return r}function xn(e,t){const n=Sn(e,t)<0?-1:1;wn.reduceRight((r,i)=>{if(Pe(t[i]))return r;if(r){const o=t[r]*n,s=e[i][r],a=Math.floor(o/s);t[i]+=a*n,t[r]-=a*s*n}return i},null),wn.reduce((n,r)=>{if(Pe(t[r]))return n;if(n){const i=t[n]%1;t[n]-=i,t[r]+=i*e[n][r]}return r},null)}function Tn(e){const t={};for(const[n,r]of Object.entries(e))0!==r&&(t[n]=r);return t}class On{constructor(e){const t="longterm"===e.conversionAccuracy||!1;let n=t?vn:pn;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||ne.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(e,t){return On.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new u("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new On({values:st(e,On.normalizeUnit),loc:ne.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Ae(e))return On.fromMillis(e);if(On.isDuration(e))return e;if("object"==typeof e)return On.fromObject(e);throw new u(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[n]=function(e){return Et(e,[zt,Wt])}(e);return n?On.fromObject(n,t):On.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[n]=function(e){return Et(e,[qt,ln])}(e);return n?On.fromObject(n,t):On.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new u("need to specify a reason the Duration is invalid");const n=e instanceof ke?e:new ke(e,t);if(be.throwOnInvalid)throw new o(n);return new On({invalid:n})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new a(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const n={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?Tt.create(this.loc,n).formatDurationFromString(this,e):fn}toHuman(e={}){if(!this.isValid)return fn;const t=!1!==e.showZeros,n=wn.map(n=>{const r=this.values[n];return Pe(r)||0===r&&!t?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:n.slice(0,-1)}).format(r)}).filter(e=>e);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=Ye(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1};return vr.fromMillis(t,{zone:"UTC"}).toISOTime(e)}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Sn(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=On.fromDurationLike(e),n={};for(const e of wn)(qe(t.values,e)||qe(this.values,e))&&(n[e]=t.get(e)+this.get(e));return kn(this,{values:n},!0)}minus(e){if(!this.isValid)return this;const t=On.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=ot(e(this.values[n],n));return kn(this,{values:t},!0)}get(e){return this[On.normalizeUnit(e)]}set(e){if(!this.isValid)return this;return kn(this,{values:{...this.values,...st(e,On.normalizeUnit)}})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n,matrix:r}={}){return kn(this,{loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:r,conversionAccuracy:n})}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return xn(this.matrix,e),kn(this,{values:e},!0)}rescale(){if(!this.isValid)return this;return kn(this,{values:Tn(this.normalize().shiftToAll().toObject())},!0)}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map(e=>On.normalizeUnit(e));const t={},n={},r=this.toObject();let i;for(const o of wn)if(e.indexOf(o)>=0){i=o;let e=0;for(const t in n)e+=this.matrix[t][o]*n[t],n[t]=0;Ae(r[o])&&(e+=r[o]);const s=Math.trunc(e);t[o]=s,n[o]=(1e3*e-1e3*s)/1e3}else Ae(r[o])&&(n[o]=r[o]);for(const e in n)0!==n[e]&&(t[i]+=e===i?n[e]:n[e]/this.matrix[i][e]);return xn(this.matrix,t),kn(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return kn(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;return kn(this,{values:Tn(this.values)},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;function t(e,t){return void 0===e||0===e?void 0===t||0===t:e===t}for(const n of wn)if(!t(this.values[n],e.values[n]))return!1;return!0}}const In="Invalid Interval";class Nn{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new u("need to specify a reason the Interval is invalid");const n=e instanceof ke?e:new ke(e,t);if(be.throwOnInvalid)throw new i(n);return new Nn({invalid:n})}static fromDateTimes(e,t){const n=wr(e),r=wr(t),i=function(e,t){return e&&e.isValid?t&&t.isValid?te}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&(this.s<=e&&this.e>e)}set({start:e,end:t}={}){return this.isValid?Nn.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(wr).filter(e=>this.contains(e)).sort((e,t)=>e.toMillis()-t.toMillis()),n=[];let{s:r}=this,i=0;for(;r+this.e?this.e:e;n.push(Nn.fromDateTimes(r,o)),r=o,i+=1}return n}splitBy(e){const t=On.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let n,{s:r}=this,i=1;const o=[];for(;re*i));n=+e>+this.e?this.e:e,o.push(Nn.fromDateTimes(r,n)),r=n,i+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e)}equals(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,n=this.e=n?null:Nn.fromDateTimes(t,n)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Nn.fromDateTimes(t,n)}static merge(e){const[t,n]=e.sort((e,t)=>e.s-t.s).reduce(([e,t],n)=>t?t.overlaps(n)||t.abutsStart(n)?[e,t.union(n)]:[e.concat([t]),n]:[e,n],[[],null]);return n&&t.push(n),t}static xor(e){let t=null,n=0;const r=[],i=e.map(e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}]),o=Array.prototype.concat(...i).sort((e,t)=>e.time-t.time);for(const e of o)n+="s"===e.type?1:-1,1===n?t=e.time:(t&&+t!==+e.time&&r.push(Nn.fromDateTimes(t,e.time)),t=null);return Nn.merge(r)}difference(...e){return Nn.xor([this].concat(e)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:In}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=f,t={}){return this.isValid?Tt.create(this.s.loc.clone(t),e).formatInterval(this):In}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:In}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:In}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:In}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:In}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):On.invalid(this.invalidReason)}mapEndpoints(e){return Nn.fromDateTimes(e(this.s),e(this.e))}}class En{static hasDST(e=be.defaultZone){const t=vr.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return R.isValidZone(e)}static normalizeZone(e){return se(e,be.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||ne.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||ne.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||ne.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||ne.create(t,n,i)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||ne.create(t,n,i)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||ne.create(t,n,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||ne.create(t,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return ne.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return ne.create(t,null,"gregory").eras(e)}static features(){return{relative:je(),localeWeek:Ue()}}}function Cn(e,t){const n=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(On.fromMillis(r).as("days"))}function Dn(e,t,n,r){let[i,o,s,a]=function(e,t,n){const r=[["years",(e,t)=>t.year-e.year],["quarters",(e,t)=>t.quarter-e.quarter+4*(t.year-e.year)],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const n=Cn(e,t);return(n-n%7)/7}],["days",Cn]],i={},o=e;let s,a;for(const[u,l]of r)n.indexOf(u)>=0&&(s=u,i[u]=l(e,t),a=o.plus(i),a>t?(i[u]--,(e=o.plus(i))>t&&(a=e,i[u]--,e=o.plus(i))):e=a);return[e,i,a,s]}(e,t,n);const u=t-i,l=n.filter(e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0);0===l.length&&(s0?On.fromMillis(u,r).shiftTo(...l).plus(c):c}function $n(e,t=e=>e){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n=n&&r<=i&&(t+=r-n)}}return parseInt(t,10)}return t}(e))}}const _n=`[ ${String.fromCharCode(160)}]`,Vn=new RegExp(_n,"g");function Mn(e){return e.replace(/\./g,"\\.?").replace(Vn,_n)}function Fn(e){return e.replace(/\./g,"").replace(Vn," ").toLowerCase()}function Pn(e,t){return null===e?null:{regex:RegExp(e.map(Mn).join("|")),deser:([n])=>e.findIndex(e=>Fn(n)===Fn(e))+t}}function An(e,t){return{regex:e,deser:([,e,t])=>it(e,t),groups:t}}function Ln(e){return{regex:e,deser:([e])=>e}}const jn={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};let Un=null;function Rn(e,t){return Array.prototype.concat(...e.map(e=>function(e,t){if(e.literal)return e;const n=Wn(Tt.macroTokenToFormatOpts(e.val),t);return null==n||n.includes(void 0)?e:n}(e,t)))}class qn{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=Rn(Tt.parseFormat(t),e),this.units=this.tokens.map(t=>function(e,t){const n=de(t),r=de(t,"{2}"),i=de(t,"{3}"),o=de(t,"{4}"),s=de(t,"{6}"),a=de(t,"{1,2}"),u=de(t,"{1,3}"),l=de(t,"{1,6}"),c=de(t,"{1,9}"),d=de(t,"{2,4}"),h=de(t,"{4,6}"),f=e=>{return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([e])=>e,literal:!0};var t},m=(m=>{if(e.literal)return f(m);switch(m.val){case"G":return Pn(t.eras("short"),0);case"GG":return Pn(t.eras("long"),0);case"y":return $n(l);case"yy":case"kk":return $n(d,nt);case"yyyy":case"kkkk":return $n(o);case"yyyyy":return $n(h);case"yyyyyy":return $n(s);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return $n(a);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return $n(r);case"MMM":return Pn(t.months("short",!0),1);case"MMMM":return Pn(t.months("long",!0),1);case"LLL":return Pn(t.months("short",!1),1);case"LLLL":return Pn(t.months("long",!1),1);case"o":case"S":return $n(u);case"ooo":case"SSS":return $n(i);case"u":return Ln(c);case"uu":return Ln(a);case"uuu":case"E":case"c":return $n(n);case"a":return Pn(t.meridiems(),0);case"EEE":return Pn(t.weekdays("short",!1),1);case"EEEE":return Pn(t.weekdays("long",!1),1);case"ccc":return Pn(t.weekdays("short",!0),1);case"cccc":return Pn(t.weekdays("long",!0),1);case"Z":case"ZZ":return An(new RegExp(`([+-]${a.source})(?::(${r.source}))?`),2);case"ZZZ":return An(new RegExp(`([+-]${a.source})(${r.source})?`),2);case"z":return Ln(/[a-z_+-/]{1,256}?/i);case" ":return Ln(/[^\S\n\r]/);default:return f(m)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return m.token=e,m}(t,e)),this.disqualifyingUnit=this.units.find(e=>e.invalidReason),!this.disqualifyingUnit){const[e,t]=[`^${(n=this.units).map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,"")}$`,n];this.regex=RegExp(e,"i"),this.handlers=t}var n}explainFromTokens(e){if(this.isValid){const[t,n]=function(e,t,n){const r=e.match(t);if(r){const e={};let t=1;for(const i in n)if(qe(n,i)){const o=n[i],s=o.groups?o.groups+1:1;!o.literal&&o.token&&(e[o.token.val[0]]=o.deser(r.slice(t,t+s))),t+=s}return[r,e]}return[r,{}]}(e,this.regex,this.handlers),[r,i,o]=n?function(e){let t,n=null;return Pe(e.z)||(n=R.create(e.z)),Pe(e.Z)||(n||(n=new ie(e.Z)),t=e.Z),Pe(e.q)||(e.M=3*(e.q-1)+1),Pe(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),Pe(e.u)||(e.S=Be(e.u)),[Object.keys(e).reduce((t,n)=>{const r=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(n);return r&&(t[r]=e[n]),t},{}),n,t]}(n):[null,null,void 0];if(qe(n,"a")&&qe(n,"H"))throw new s("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:n,result:r,zone:i,specificOffset:o}}return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function zn(e,t,n){return new qn(e,n).explainFromTokens(t)}function Wn(e,t){if(!e)return null;const n=Tt.create(t,e).dtFormatter((Un||(Un=vr.fromMillis(1555555555555)),Un)),r=n.formatToParts(),i=n.resolvedOptions();return r.map(t=>function(e,t,n){const{type:r,value:i}=e;if("literal"===r){const e=/^\s+$/.test(i);return{literal:!e,val:e?" ":i}}const o=t[r];let s=r;"hour"===r&&(s=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":n.hour12?"hour12":"hour24");let a=jn[s];if("object"==typeof a&&(a=a[o]),a)return{literal:!1,val:a}}(t,e,i))}const Zn="Invalid DateTime",Hn=864e13;function Gn(e){return new ke("unsupported zone",`the zone "${e.name}" is not supported`)}function Bn(e){return null===e.weekData&&(e.weekData=Ce(e.c)),e.weekData}function Yn(e){return null===e.localWeekData&&(e.localWeekData=Ce(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Jn(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new vr({...n,...t,old:n})}function Kn(e,t,n){let r=e-60*t*1e3;const i=n.offset(r);if(t===i)return[r,t];r-=60*(i-t)*1e3;const o=n.offset(r);return i===o?[r,i]:[e-60*Math.min(i,o)*1e3,Math.max(i,o)]}function Xn(e,t){const n=new Date(e+=60*t*1e3);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Qn(e,t,n){return Kn(Qe(e),t,n)}function er(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),o={...e.c,year:r,month:i,day:Math.min(e.c.day,Xe(r,i))+Math.trunc(t.days)+7*Math.trunc(t.weeks)},s=On.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=Qe(o);let[u,l]=Kn(a,n,e.zone);return 0!==s&&(u+=s,l=e.zone.offset(u)),{ts:u,o:l}}function tr(e,t,n,r,i,o){const{setZone:s,zone:a}=n;if(e&&0!==Object.keys(e).length||t){const r=t||a,i=vr.fromObject(e,{...n,zone:r,specificOffset:o});return s?i:i.setZone(a)}return vr.invalid(new ke("unparsable",`the input "${i}" can't be parsed as ${r}`))}function nr(e,t,n=!0){return e.isValid?Tt.create(ne.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function rr(e,t,n){const r=e.c.year>9999||e.c.year<0;let i="";if(r&&e.c.year>=0&&(i+="+"),i+=Ze(e.c.year,r?6:4),"year"===n)return i;if(t){if(i+="-",i+=Ze(e.c.month),"month"===n)return i;i+="-"}else if(i+=Ze(e.c.month),"month"===n)return i;return i+=Ze(e.c.day),i}function ir(e,t,n,r,i,o,s){let a=!n||0!==e.c.millisecond||0!==e.c.second,u="";switch(s){case"day":case"month":case"year":break;default:if(u+=Ze(e.c.hour),"hour"===s)break;if(t){if(u+=":",u+=Ze(e.c.minute),"minute"===s)break;a&&(u+=":",u+=Ze(e.c.second))}else{if(u+=Ze(e.c.minute),"minute"===s)break;a&&(u+=Ze(e.c.second))}if("second"===s)break;!a||r&&0===e.c.millisecond||(u+=".",u+=Ze(e.c.millisecond,3))}return i&&(e.isOffsetFixed&&0===e.offset&&!o?u+="Z":e.o<0?(u+="-",u+=Ze(Math.trunc(-e.o/60)),u+=":",u+=Ze(Math.trunc(-e.o%60))):(u+="+",u+=Ze(Math.trunc(e.o/60)),u+=":",u+=Ze(Math.trunc(e.o%60)))),o&&(u+="["+e.zone.ianaName+"]"),u}const or={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},sr={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},ar={ordinal:1,hour:0,minute:0,second:0,millisecond:0},ur=["year","month","day","hour","minute","second","millisecond"],lr=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],cr=["year","ordinal","hour","minute","second","millisecond"];function dr(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new a(e);return t}function hr(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return dr(e)}}function fr(e,t){const n=se(t.zone,be.defaultZone);if(!n.isValid)return vr.invalid(Gn(n));const r=ne.fromObject(t);let i,o;if(Pe(e.year))i=be.now();else{for(const t of ur)Pe(e[t])&&(e[t]=or[t]);const t=Me(e)||Fe(e);if(t)return vr.invalid(t);const r=function(e){if(void 0===yr&&(yr=be.now()),"iana"!==e.type)return e.offset(yr);const t=e.name;let n=gr.get(t);return void 0===n&&(n=e.offset(yr),gr.set(t,n)),n}(n);[i,o]=Qn(e,r,n)}return new vr({ts:i,zone:n,loc:r,o})}function mr(e,t,n){const r=!!Pe(n.round)||n.round,i=Pe(n.rounding)?"trunc":n.rounding,o=(e,o)=>{e=Ye(e,r||n.calendary?0:2,n.calendary?"round":i);return t.loc.clone(n).relFormatter(n).format(e,o)},s=r=>n.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r);if(n.unit)return o(s(n.unit),n.unit);for(const e of n.units){const t=s(e);if(Math.abs(t)>=1)return o(t,e)}return o(e>t?-0:0,n.units[n.units.length-1])}function pr(e){let t,n={};return e.length>0&&"object"==typeof e[e.length-1]?(n=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[n,t]}let yr;const gr=new Map;class vr{constructor(e){const t=e.zone||be.defaultZone;let n=e.invalid||(Number.isNaN(e.ts)?new ke("invalid input"):null)||(t.isValid?null:Gn(t));this.ts=Pe(e.ts)?be.now():e.ts;let r=null,i=null;if(!n){if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,i]=[e.old.c,e.old.o];else{const o=Ae(e.o)&&!e.old?e.o:t.offset(this.ts);r=Xn(this.ts,o),n=Number.isNaN(r.year)?new ke("invalid input"):null,r=n?null:r,i=n?null:o}}this._zone=t,this.loc=e.loc||ne.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}static now(){return new vr({})}static local(){const[e,t]=pr(arguments),[n,r,i,o,s,a,u]=t;return fr({year:n,month:r,day:i,hour:o,minute:s,second:a,millisecond:u},e)}static utc(){const[e,t]=pr(arguments),[n,r,i,o,s,a,u]=t;return e.zone=ie.utcInstance,fr({year:n,month:r,day:i,hour:o,minute:s,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const n=(r=e,"[object Date]"===Object.prototype.toString.call(r)?e.valueOf():NaN);var r;if(Number.isNaN(n))return vr.invalid("invalid input");const i=se(t.zone,be.defaultZone);return i.isValid?new vr({ts:n,zone:i,loc:ne.fromObject(t)}):vr.invalid(Gn(i))}static fromMillis(e,t={}){if(Ae(e))return e<-Hn||e>Hn?vr.invalid("Timestamp out of range"):new vr({ts:e,zone:se(t.zone,be.defaultZone),loc:ne.fromObject(t)});throw new u(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Ae(e))return new vr({ts:1e3*e,zone:se(t.zone,be.defaultZone),loc:ne.fromObject(t)});throw new u("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const n=se(t.zone,be.defaultZone);if(!n.isValid)return vr.invalid(Gn(n));const r=ne.fromObject(t),i=st(e,hr),{minDaysInFirstWeek:o,startOfWeek:a}=Ve(i,r),u=be.now(),l=Pe(t.specificOffset)?n.offset(u):t.specificOffset,c=!Pe(i.ordinal),d=!Pe(i.year),h=!Pe(i.month)||!Pe(i.day),f=d||h,m=i.weekYear||i.weekNumber;if((f||c)&&m)throw new s("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&c)throw new s("Can't mix ordinal dates with month/day");const p=m||i.weekday&&!f;let y,g,v=Xn(u,l);p?(y=lr,g=sr,v=Ce(v,o,a)):c?(y=cr,g=ar,v=$e(v)):(y=ur,g=or);let w=!1;for(const e of y){Pe(i[e])?i[e]=w?g[e]:v[e]:w=!0}const b=p?function(e,t=4,n=1){const r=Le(e.weekYear),i=We(e.weekNumber,1,tt(e.weekYear,t,n)),o=We(e.weekday,1,7);return r?i?!o&&Te("weekday",e.weekday):Te("week",e.weekNumber):Te("weekYear",e.weekYear)}(i,o,a):c?function(e){const t=Le(e.year),n=We(e.ordinal,1,Ke(e.year));return t?!n&&Te("ordinal",e.ordinal):Te("year",e.year)}(i):Me(i),k=b||Fe(i);if(k)return vr.invalid(k);const S=p?De(i,o,a):c?_e(i):i,[x,T]=Qn(S,l,n),O=new vr({ts:x,zone:n,o:T,loc:r});return i.weekday&&f&&e.weekday!==O.weekday?vr.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${O.toISO()}`):O.isValid?O:vr.invalid(O.invalid)}static fromISO(e,t={}){const[n,r]=function(e){return Et(e,[en,on],[tn,sn],[nn,an],[rn,un])}(e);return tr(n,r,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[n,r]=function(e){return Et(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[Gt,Bt])}(e);return tr(n,r,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[n,r]=function(e){return Et(e,[Yt,Xt],[Jt,Xt],[Kt,Qt])}(e);return tr(n,r,t,"HTTP",t)}static fromFormat(e,t,n={}){if(Pe(e)||Pe(t))throw new u("fromFormat requires an input string and a format");const{locale:r=null,numberingSystem:i=null}=n,o=ne.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),[s,a,l,c]=function(e,t,n){const{result:r,zone:i,specificOffset:o,invalidReason:s}=zn(e,t,n);return[r,i,o,s]}(o,e,t);return c?vr.invalid(c):tr(s,a,n,`format ${t}`,e,l)}static fromString(e,t,n={}){return vr.fromFormat(e,t,n)}static fromSQL(e,t={}){const[n,r]=function(e){return Et(e,[cn,on],[dn,hn])}(e);return tr(n,r,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new u("need to specify a reason the DateTime is invalid");const n=e instanceof ke?e:new ke(e,t);if(be.throwOnInvalid)throw new r(n);return new vr({invalid:n})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const n=Wn(e,ne.fromObject(t));return n?n.map(e=>e?e.val:null).join(""):null}static expandFormat(e,t={}){return Rn(Tt.parseFormat(e),ne.fromObject(t)).map(e=>e.val).join("")}static resetCache(){yr=void 0,gr.clear()}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Bn(this).weekYear:NaN}get weekNumber(){return this.isValid?Bn(this).weekNumber:NaN}get weekday(){return this.isValid?Bn(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Yn(this).weekday:NaN}get localWeekNumber(){return this.isValid?Yn(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Yn(this).weekYear:NaN}get ordinal(){return this.isValid?$e(this.c).ordinal:NaN}get monthShort(){return this.isValid?En.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?En.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?En.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?En.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,n=Qe(this.c),r=this.zone.offset(n-e),i=this.zone.offset(n+e),o=this.zone.offset(n-r*t),s=this.zone.offset(n-i*t);if(o===s)return[this];const a=n-o*t,u=n-s*t,l=Xn(a,o),c=Xn(u,s);return l.hour===c.hour&&l.minute===c.minute&&l.second===c.second&&l.millisecond===c.millisecond?[Jn(this,{ts:a}),Jn(this,{ts:u})]:[this]}get isInLeapYear(){return Je(this.year)}get daysInMonth(){return Xe(this.year,this.month)}get daysInYear(){return this.isValid?Ke(this.year):NaN}get weeksInWeekYear(){return this.isValid?tt(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?tt(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:n,calendar:r}=Tt.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(ie.instance(e),t)}toLocal(){return this.setZone(be.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:n=!1}={}){if((e=se(e,be.defaultZone)).equals(this.zone))return this;if(e.isValid){let r=this.ts;if(t||n){const t=e.offset(this.ts),n=this.toObject();[r]=Qn(n,t,e)}return Jn(this,{ts:r,zone:e})}return vr.invalid(Gn(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){return Jn(this,{loc:this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n})})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=st(e,hr),{minDaysInFirstWeek:n,startOfWeek:r}=Ve(t,this.loc),i=!Pe(t.weekYear)||!Pe(t.weekNumber)||!Pe(t.weekday),o=!Pe(t.ordinal),a=!Pe(t.year),u=!Pe(t.month)||!Pe(t.day),l=a||u,c=t.weekYear||t.weekNumber;if((l||o)&&c)throw new s("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&o)throw new s("Can't mix ordinal dates with month/day");let d;i?d=De({...Ce(this.c,n,r),...t},n,r):Pe(t.ordinal)?(d={...this.toObject(),...t},Pe(t.day)&&(d.day=Math.min(Xe(d.year,d.month),d.day))):d=_e({...$e(this.c),...t});const[h,f]=Qn(d,this.o,this.zone);return Jn(this,{ts:h,o:f})}plus(e){if(!this.isValid)return this;return Jn(this,er(this,On.fromDurationLike(e)))}minus(e){if(!this.isValid)return this;return Jn(this,er(this,On.fromDurationLike(e).negate()))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const n={},r=On.normalizeUnit(e);switch(r){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0}if("weeks"===r)if(t){const e=this.loc.getStartOfWeek(),{weekday:t}=this;t=3&&(a+="T"),a+=ir(this,s,t,n,r,i,o),a}toISODate({format:e="extended",precision:t="day"}={}){return this.isValid?rr(this,"extended"===e,dr(t)):null}toISOWeekDate(){return nr(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,includePrefix:r=!1,extendedZone:i=!1,format:o="extended",precision:s="milliseconds"}={}){if(!this.isValid)return null;return s=dr(s),(r&&ur.indexOf(s)>=3?"T":"")+ir(this,"extended"===o,t,e,n,i,s)}toRFC2822(){return nr(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return nr(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?rr(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:n=!0}={}){let r="HH:mm:ss.SSS";return(t||e)&&(n&&(r+=" "),t?r+="z":e&&(r+="ZZ")),nr(this,r,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Zn}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",n={}){if(!this.isValid||!e.isValid)return On.invalid("created by diffing an invalid DateTime");const r={locale:this.locale,numberingSystem:this.numberingSystem,...n},i=(a=t,Array.isArray(a)?a:[a]).map(On.normalizeUnit),o=e.valueOf()>this.valueOf(),s=Dn(o?this:e,o?e:this,i,r);var a;return o?s.negate():s}diffNow(e="milliseconds",t={}){return this.diff(vr.now(),e,t)}until(e){return this.isValid?Nn.fromDateTimes(this,e):this}hasSame(e,t,n){if(!this.isValid)return!1;const r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,n)<=r&&r<=i.endOf(t,n)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||vr.fromObject({},{zone:this.zone}),n=e.padding?thise.valueOf(),Math.min)}static max(...e){if(!e.every(vr.isDateTime))throw new u("max requires all arguments be DateTimes");return Re(e,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,n={}){const{locale:r=null,numberingSystem:i=null}=n;return zn(ne.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,n={}){return vr.fromFormatExplain(e,t,n)}static buildFormatParser(e,t={}){const{locale:n=null,numberingSystem:r=null}=t,i=ne.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0});return new qn(i,e)}static fromFormatParser(e,t,n={}){if(Pe(e)||Pe(t))throw new u("fromFormatParser requires an input string and a format parser");const{locale:r=null,numberingSystem:i=null}=n,o=ne.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});if(!o.equals(t.locale))throw new u(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${t.locale}`);const{result:s,zone:a,specificOffset:l,invalidReason:c}=t.explainFromTokens(e);return c?vr.invalid(c):tr(s,a,n,`format ${t.format}`,e,l)}static get DATE_SHORT(){return f}static get DATE_MED(){return m}static get DATE_MED_WITH_WEEKDAY(){return p}static get DATE_FULL(){return y}static get DATE_HUGE(){return g}static get TIME_SIMPLE(){return v}static get TIME_WITH_SECONDS(){return w}static get TIME_WITH_SHORT_OFFSET(){return b}static get TIME_WITH_LONG_OFFSET(){return k}static get TIME_24_SIMPLE(){return S}static get TIME_24_WITH_SECONDS(){return x}static get TIME_24_WITH_SHORT_OFFSET(){return T}static get TIME_24_WITH_LONG_OFFSET(){return O}static get DATETIME_SHORT(){return I}static get DATETIME_SHORT_WITH_SECONDS(){return N}static get DATETIME_MED(){return E}static get DATETIME_MED_WITH_SECONDS(){return C}static get DATETIME_MED_WITH_WEEKDAY(){return D}static get DATETIME_FULL(){return $}static get DATETIME_FULL_WITH_SECONDS(){return _}static get DATETIME_HUGE(){return V}static get DATETIME_HUGE_WITH_SECONDS(){return M}}function wr(e){if(vr.isDateTime(e))return e;if(e&&e.valueOf&&Ae(e.valueOf()))return vr.fromJSDate(e);if(e&&"object"==typeof e)return vr.fromObject(e);throw new u(`Unknown datetime argument: ${e}, of type ${typeof e}`)}t.DateTime=vr,t.Duration=On,t.FixedOffsetZone=ie,t.IANAZone=R,t.Info=En,t.Interval=Nn,t.InvalidZone=oe,t.Settings=be,t.SystemZone=A,t.VERSION="3.7.1",t.Zone=F}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.r(r),n.d(r,{debug:()=>Ii,getCookie:()=>_i,init:()=>Ni,integration:()=>Di,overlay:()=>$i,personalize:()=>Ei,track:()=>Ci});const i="do-not-track",o="data-var-name",s="sailthru_sess_overlay_params",a="sailthru_session_overlay",u="sailthru_dismiss_overlay",l="STdebug",c="STpreview",d="STpageviewsOverride";function h(e,t){const n=encodeURIComponent(t)+"=";for(const t of(document.cookie||"").split(/;\s*/))t.startsWith(n)&&e.push(decodeURIComponent(t.substring(n.length)))}const f={getCookie(e){const t=String(e),n=function(e){const t=[];return h(t,e),t}(t);if("sailthru_hid"===t)for(const e of n)if(e===i||"optout"===e)return e;const r=n.length&&n[0]||"";return"string"==typeof r?r.trim():""}};function m(e){return/^(?:\d{1,3}\.){3}\d{1,3}$/.test(e)}function p(e,t,{value:n="",minutes:r,domain:i,secureFlag:o,isDeletion:s=!1}={}){const a=[`${encodeURIComponent(e)}=${encodeURIComponent(n)}`,"Path=/",`SameSite=${t}`];if(s)a.push("Max-Age=0","Expires=Thu, 01 Jan 1970 00:00:00 GMT");else if("number"==typeof r){const e=Math.floor(60*r*1e3),t=new Date(Date.now()+Math.max(e,0)).toUTCString();a.push(`Expires=${t}`),a.push(`Max-Age=${Math.max(0,Math.floor(e/1e3))}`)}return i&&a.push(`Domain=${i}`),("none"===t.toLowerCase()||o)&&a.push("Secure"),a}function y(e,t,n,r){return p(e,n,{value:t,...r}).join("; ")}function g(e,t,n){return p(e,t,{...n,isDeletion:!0}).join("; ")}function v(e,t=null,r=null,{secure:i,sameSite:o="Lax",minutes:s}={}){if(!e)return{success:!0,cookieWasSet:!1,shouldCache:!0};if(!(null!=t&&`${t}`.length>0)||!(null!=r))return{success:!1,cookieWasSet:!1,shouldCache:!1};const a=i||"none"===o.toLowerCase(),u=`${r}__sentinel_${function(e=4){const t=void 0!==n.g&&n.g.crypto?n.g.crypto:void 0,r=globalThis.crypto||t;return r?.getRandomValues?[...r.getRandomValues(new Uint8Array(e))].map(e=>Number(e).toString(16).padStart(2,"0")).join(""):Array.from({length:e},()=>Math.floor(256*Math.random()).toString(16).padStart(2,"0")).join("")}(4)}`,l=y(t,u,o,{minutes:1/60,domain:e,secureFlag:a});document.cookie=l;const c=`${encodeURIComponent(t)}=${encodeURIComponent(u)}`;if(!document.cookie.split(/;\s*/).some(e=>e===c))return{success:!1,cookieWasSet:!1,shouldCache:!1};const d=y(t,r,o,{minutes:s,domain:e,secureFlag:a});return document.cookie=d,{success:!0,cookieWasSet:!0,shouldCache:!0}}function w(e){return null==e?e:`${e}`.replace(/^\.+/,"").toLowerCase()}function b(e){const t=`${e}=`,n=encodeURIComponent(`${e}`)+"=";return!(document.cookie||"").split(/;\s*/).some(e=>e.startsWith(t)||e.startsWith(n))}const k={create(e,t,r,i,o={}){const{sameSite:s="Lax",secure:a="https:"===location.protocol}=o;let u=null,l=!1;if(null!=i){const o=function({preferred:e,sameSite:t="Lax",secure:r,cookieName:i=null,cookieValue:o=null,minutes:s}={}){const a="undefined"!=typeof globalThis&&globalThis.location||"undefined"!=typeof window&&window.location||void 0!==n.g&&n.g.location||{hostname:"",protocol:""};let u=a.hostname||"";if("boolean"!=typeof r&&(r="https"===(a.protocol||"").replace(/:$/,"")),!u&&e&&(u=e),!u||"localhost"===u||m(u))return null;const l=e?w(e):null,c=`cookie-domain:${u}:${t}:${r?1:0}`,d={get(){try{const e=sessionStorage.getItem(c);return null===e?null:""===e?"":w(e)}catch{return null}},set(e){try{sessionStorage.setItem(c,e??"")}catch{}}},h=d.get();if(null!==h)return{domain:""===h?null:h,cookieWasSet:!1};if(l){const e=v(l,i,o,{sameSite:t,secure:r,minutes:s});if(e.success)return e.shouldCache&&d.set(l),{domain:l,cookieWasSet:e.cookieWasSet}}const f=w(u),p=v(f,i,o,{sameSite:t,secure:r,minutes:s});return p.success?(p.shouldCache&&d.set(f),{domain:f,cookieWasSet:p.cookieWasSet}):(d.set(""),{domain:null,cookieWasSet:!1})}({preferred:i,sameSite:s,secure:a,cookieName:e,cookieValue:t,minutes:r});u=o.domain,l=o.cookieWasSet}if(!l){const n=y(e,t,s,{minutes:r,domain:u,secureFlag:"none"===s.toLowerCase()||!0===o.secure||a});document.cookie=n}return document.cookie.includes(`${encodeURIComponent(e)}=`)},read:f.getCookie,delete(e,t=void 0,n={}){const{sameSite:r="Lax",secure:i="https:"===location.protocol}=n;for(const n of function(e){const t=w(location.hostname),n=new Set,r=[];if(e&&"localhost"!==e&&!m(e)){const t=w(e);t&&!n.has(t)&&(n.add(t),r.push(t))}const i=t.split(".");for(let e=1;e-1===e.indexOf(i)).join("")}n=`00${s}${n}`,n=n.slice(0,1682),this.create("sailthru_pc",n,525600)},updateSailthruContentCookie(e){if(this.handleGDPR())return;let t=this.read("sailthru_content");if(e){const n=e.length,r=16*n,i=t.indexOf(e);-1!==i&&(t=t.substring(0,i)+t.substring(i+n));let o=t+e;o=o.length>r?o.substring(n):o,this.delete("sailthru_content"),this.create("sailthru_content",o,525600)}},updatePageviewsCookie(){if(this.handleGDPR()){const e=this.getSessionCookieName("sailthru_pageviews");let t=this.readCookieValue("sailthru_pageviews");t=Number(t)+1,this.create(e,t)}else{const e=this.read("sailthru_overlays");let t=this.read("sailthru_pageviews");t=Number(t)+1,this.create("sailthru_pageviews",t,30),e.length>0&&this.create("sailthru_overlays",e,30)}},setSailthruHid(e){if(!e)return void this.delete("sailthru_hid");const t=this.getCookieDomain(window.location.hostname);this.create("sailthru_hid",e,525600,t)},setCookiesDoNotTrack(){return this.create("sailthru_no_cookies","1",525600)},unsetCookiesDoNotTrack(){this.delete("sailthru_no_cookies"),this.read("sailthru_hid")===i&&this.setSailthruHid(null),this.convertSessionCookiesToPersistent()},convertSessionCookiesToPersistent(){const e=this.getSessionCookieName("sailthru_pageviews"),t=this.read(e);t&&(this.delete(e),this.create("sailthru_pageviews",t,30));const n=this.getSessionCookieName("sailthru_overlays"),r=this.read(n);r&&(this.delete(n),this.create("sailthru_overlays",r,30))},isAnonymousUser(){return!this.read("sailthru_hid")},isDoNotTrackUser(){const e=this.read("sailthru_hid"),t=this.read("sailthru_no_cookies");return e===i||"optout"===e||!!t},refreshNoCookies(){this.read("sailthru_no_cookies")&&this.setCookiesDoNotTrack()},handleGDPR(){return!!this.isDoNotTrackUser()&&(this.delete("sailthru_content"),this.delete("sailthru_pc"),this.delete("sailthru_bid"),this.delete("sailthru_sid"),this.delete("sailthru_cid"),this.delete("sailthru_rid"),this.delete("sailthru_recommendation_hidden"),this.delete("sailthru_visitor"),this.delete("sailthru_overlays"),this.convertToSessionCookie("sailthru_pageviews",1),this.delete("sailthru_hid"),this.setSailthruHid(i),!0)},getCookieDomain(e){const t=/(?:[\w-]+\.(?:com|co|gov|edu|org|net)\.[\w-]{1,2}|[\w-]+\.[\w-]{2,})$/.exec(e);return t?t[0]:null},getPageViewsCount(){let e=this.readCookieValue("sailthru_pageviews")||0;return Number(e)},readCookieValue(e){const t=this.getSessionCookieName(e);return this.read(t)||this.read(e)},convertToSessionCookie(e,t=1){const n=this.getSessionCookieName(e);this.read(e)&&!this.read(n)&&this.create(n,t),this.delete(e)},getSessionCookieName:e=>`${e}_session`},S={defaultPageviewOnError:e=>`Pageview was not tracked: ${e.responseText&&JSON.parse(e.responseText).error||e.error||"Check url and configuration."}`,getData(e,t,n){const r={...t,url:e,pageview:!0,visitorId:k.read("sailthru_visitor"),apiUrl:`${n.trackDomain}/v1/track/event/pageview`},i=document.querySelectorAll&&document.querySelectorAll('meta[name="sailthru.tags"]').length>0&&document.querySelectorAll('meta[name="sailthru.tags"]')[0].getAttribute("content"),o=document.querySelectorAll&&document.querySelectorAll('meta[name="keywords"]').length>0&&document.querySelectorAll('meta[name="keywords"]')[0].getAttribute("content"),s=i||o||"";return r.visitorId=k.read("sailthru_visitor"),r.messageId=k.read("sailthru_bid"),r.excludeContent=n.excludeContent,"true"===r.excludeContent?r.excludeContent=!0:"boolean"!=typeof r.excludeContent&&(r.excludeContent=!1),void 0===r.useStoredTags&&(r.useStoredTags=n.useStoredTags),"false"===r.useStoredTags?r.useStoredTags=!1:"boolean"!=typeof r.useStoredTags&&(r.useStoredTags=!0),r.tags=void 0!==r.tags?r.tags.toString():s,r}},x=(e,t,n)=>{if("undefined"==typeof AbortController||!n)return fetch(e,t);const r=new AbortController,i={...t,signal:r.signal};return new Promise((t,o)=>{let s=setTimeout(()=>{r.abort(),o(new Error("Request timed out"))},n);fetch(e,i).then(e=>{clearTimeout(s),t(e)},e=>{clearTimeout(s),o(e)})})},T=e=>{function t(e){const t=window.document.createElement("div");return t.innerHTML=``,t.firstChild.href}function n(t){let n={...t};if(delete n.apiUrl,n.onSuccess&&delete n.onSuccess,n.onError&&delete n.onError,n.elementId&&delete n.elementId,n.pageview&&delete n.pageview,void 0===t.userIdKey||""===t.userIdKey||"HID"===t.userIdKey.toUpperCase()){const e=k.read("sailthru_hid");void 0!==e&&""!==e&&(n.userIdKey="hid",n.userIdValue=e)}return n=JSON.stringify(n),x(t.apiUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","X-Lib-Version":e.VERSION,Authorization:`Bearer ${e.customerId}`},body:n},2e3).then(e=>e.json()).then(e=>{if(e&&(e.error||e.message))throw e;t&&(t.elementId&&(e.elementId=t.elementId),e.doNotTrack&&(k.setSailthruHid(i),k.handleGDPR()),t.pageview&&k.updateSailthruContentCookie(e.contentHash),t.onSuccess&&t.onSuccess(e),t.visitorId||!e.visitorId||k.handleGDPR()||k.create("sailthru_visitor",e.visitorId,525600))}).catch(e=>{let n;e&&e.responseText&&(n=JSON.parse(e.responseText),console.log(`You have the following track error: ${n.message}`)),t&&(t.elementId&&(e.elementId=t.elementId),t.pageview&&console.error(S.defaultPageviewOnError(e)),t.onError&&t.onError(e))})}return{click(r,i,o){const s={...o,sectionId:r,url:t(i),apiUrl:`${e.trackDomain}/v1/track/event/click/`};return r&&i?n(s):(console.log("url, and sectionId are required for trackClick.",s),!1)},impression(r,i,o){Array.isArray(i)?i=i.map(t):"object"==typeof i&&Object.keys(i).length>0&&(o=i,i=void 0);const s={...o,sectionId:r,apiUrl:`${e.trackDomain}/v1/track/event/impression/`};return r?(i&&i.length>0&&(s.urls=i),n(s)):(console.log("sectionId are required for trackImpression.",s),!1)},pageview(r,i){if(r){const o=t(r);return n(S.getData(o,i,e))}return console.log("url is required for trackPageView.",r,i),!1},navigation(r,i){if(r){return n({...i,url:t(r),index:Date.now(),type:"navigation",visitorId:k.read("sailthru_visitor"),apiUrl:`${e.trackDomain}/v1/track/heartbeat`})}return console.log("url is required for heartbeat navigation",r,i),!1},heartbeat(r,i){if(r){return n({...i,url:t(r),index:Date.now(),type:"heartbeat",visitorId:k.read("sailthru_visitor"),apiUrl:`${e.trackDomain}/v1/track/heartbeat`})}return console.log("url is required for heartbeat",r,i),!1},gdprDoNotTrack(t){const n=k.read("sailthru_hid");if(!n)return k.setSailthruHid(i),void k.handleGDPR();k.setSailthruHid(i),k.handleGDPR(),fetch(`${e.trackDomain}/v1/profile/${n}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","X-Lib-Version":e.VERSION,Authorization:`Bearer ${e.customerId}`},body:JSON.stringify({doNotTrack:!0})}).then(e=>e.json()).then(e=>{if(e&&(e.error||e.message))throw e;t&&t.onSuccess&&t.onSuccess(e)}).catch(e=>{t&&t.onError&&t.onError(e)})},cookiesDoNotTrack(e){!e||!1!==e.set?(k.setCookiesDoNotTrack(),k.handleGDPR()):k.unsetCookiesDoNotTrack()}}};let O,I={},N=!0;function E(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function C(e,t){if(void 0===e.userIdKey||"hid"===e.userIdKey){const e=k.read("sailthru_hid");e&&(t.push("userIdKey=hid"),t.push(`userIdValue=${e}`))}else e.userIdValue&&(t.push(`userIdKey=${e.userIdKey}`),t.push(`userIdValue=${e.userIdValue}`));return t}function D(){const e=window.location.hash.substr(1);return O=e.split("&").map(e=>e.split("=")).reduce((e,t)=>(e[t[0]]=decodeURIComponent(t[1]),e),{}),O}function $(){return void 0!==O[c]}function _(){if($())return O[c]}function V(e,t){if(void 0!==e){const n=e?"1":"0";t.push(`isMobile=${n}`)}return t}function M(e){const t=function(){const e=k.read(s);return e?decodeURIComponent(e):window.location.search}();if(t&&t.length>1&&"?"===t[0])if("function"==typeof URL){const n=new URL(`http://domain.tld${t}`).searchParams;for(const t of n.keys())e.push(`page=${encodeURIComponent(`${t}=${n.get(t)}`)}`)}else{const n=function(e){const t=/([^=?&]+)=?([^&]*)/g,n={};let r,i,o;for(;r=t.exec(e);)i=E(r[1]),o=E(r[2]),null===i||null===o||i in n||(n[i]=o);return n}(t);for(const t of Object.keys(n))e.push(`page=${encodeURIComponent(`${t}=${n[t]}`)}`)}return e}function F(){let e;const t=window.location.search,n=/[?&]+([^=&]+)=([^&]*)[^&#]*/gi;for(;e=n.exec(t);)I[decodeURIComponent(e[1])]=decodeURIComponent(e[2]);return N=!1,I}function P(e){N&&F();return I[e]}function A(){N=!0,I={}}const L=()=>(D(),F(),{pushUserIdKeyAndUserIdValue:C,urlHashToMap:D,getPreviewIdFromAnchor:_,isPreview:$,urlFragmentParams:O,pushDeviceTypeInfo:V,getUrlParam:P,pushLandingPageParams:M,reset:A});let j,U,R,q,z,W,Z,H=!1;function G(){return H=!0,window.clearInterval(q),window.clearInterval(z),console.log("Heartbeat stopped"),{lostVisibility:H,firstHeartbeatInterval:q,secondHeartbeatInterval:z}}function B(e,t,n){const r=window.setInterval(()=>{(new Date).getTime()-e>n?window.clearInterval(r):U.heartbeat(window.location.href,{onError:G})},t);return r}function Y(){H&&(H=!1,U.navigation(window.location.href,{onError:G}));const e=(new Date).getTime();return q=B(e,1e4,3e4),z=B(e,6e4,174e4),{lostVisibility:H,firstHeartbeatInterval:q,secondHeartbeatInterval:z}}function J(){return document[W]?G():Y()}function K(){return void 0!==document.hidden?(W="hidden",Z="visibilitychange"):void 0!==document.msHidden?(W="msHidden",Z="msvisibilitychange"):void 0!==document.webkitHidden&&(W="webkitHidden",Z="webkitvisibilitychange"),void 0===document.addEventListener||void 0===document.hidden?(console.log("Heartbeat requires a browser that supports the Page Visibility API"),!1):k.isAnonymousUser()?(R.urlFragmentParams[l]&&console.log("Heartbeat only works for known users"),!1):j.enableHeartbeat?(document.addEventListener(Z,J,!1),Y()):(R.urlFragmentParams[l]&&console.log("Heartbeat disabled"),!1)}const X=e=>(j=e,U=T(e),H=!1,R=L(),{appendHearbeatListener:K}),Q=e=>{function t(e){const t={...e};return void 0!==t.source&&(t.vars=t.vars||{},t.vars.source=t.source,delete t.source),t}function n(t,n){const r={...t};delete r.apiUrl;const i={method:n||"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json","X-Lib-Version":e.VERSION,Authorization:`Bearer ${e.customerId}`}};return"POST"===i.method&&(i.body=JSON.stringify(r)),fetch(t.apiUrl,i).then(e=>e.json()).then(e=>{if(e&&(e.message||e.error||e.errors))throw e;"function"==typeof t.onSuccess&&t.onSuccess(e)}).catch(e=>{"function"==typeof t.onError?t.onError(e):e&&(e.error||e.message||e.errors)&&console.error(`You have the following error: ${e.error||e.message||e.errors}`)})}function r(e){return"object"==typeof e&&"string"==typeof e.key&&("string"==typeof e.id||"number"==typeof e.id)}function i(e){let t;return"string"==typeof e?{id:e,key:"email"}:"object"==typeof e&&r(e)?e:(t=k.read("sailthru_hid"))?{id:t,key:"cookie"}:{id:void 0,key:void 0}}return{getCurrentUser(r){const i=`${e.trackDomain}/v1/track/user?`,o=k.read("sailthru_hid");if(o){const e=[];e.push("user_id_key=hid"),r.hash&&e.push(`hash=${r.hash}`),e.push(`user_id_value=${o}`);const s=i+e.join("&");return n(t({...r,apiUrl:s}),"GET")}return console.error("Please make sure the sailthru_hid cookie is set."),!1},userSignUp(r,o){const s=`${e.trackDomain}/v1/track/user/signup`;r=i(r);const a=void 0!==o.lists&&o.lists||void 0!==o.vars&&o.vars||void 0!==o.source&&o.source;const u=t({...r,...o,apiUrl:s,onSuccess:function(e){if(e?.sailthruHid&&k.setSailthruHid(e.sailthruHid),"function"==typeof o.onSuccess)return o.onSuccess(this,e)}});return k.read("sailthru_hid")||(u.content=k.read("sailthru_content")),("sms"===u.key||"email"===u.key)&&u.id&&a?n(u):(console.error("Please make sure to include a valid id/key plus a lists or a vars option.",u),!1)},userSignUpConfirmedOptIn(i,o){const s=`${e.trackDomain}/v1/track/user/signup`;if(!(void 0!==o&&void 0!==o.template&&void 0!==o.template.name)||!r(i))return console.error("Please make sure that the integration options include a template and id/key pair: ",o),!1;const a=t({...o,id:i.id,key:i.key||"email",apiUrl:s});return k.read("sailthru_hid")||(a.content=k.read("sailthru_content")),n(a)},addToCart(t,r){const o=`${e.trackDomain}/v1/track/addToCart`,s=r&&r.items&&r.items.filter(e=>void 0!==e.sku||void 0!==e.url).length>0,a=r&&r.items&&0===r.items.length,u={...i(t),...r,apiUrl:o};return u.id&&(s||a)?n(u):(console.error("Please make sure to include an id and key plus an items sku or items url option.",u),!1)},purchase(t,r){const o=`${e.trackDomain}/v1/track/purchase`,s=r&&r.items&&r.items.filter(e=>void 0!==e.sku||void 0!==e.url).length>0,a=r&&r.incomplete&&r.items&&0===r.items.length,u=k.read("sailthru_bid"),l=k.read("sailthru_pc");t=i(t);const c={...t,...r,apiUrl:o};return u&&(c.message_id=u),l&&(c.cookies={sailthru_pc:l}),c.id&&(s||a)?n(c):(console.error("Please make sure to include an id and key plus an items sku or items url option.",c),!1)},watchContent(t,r={}){const o=`${e.trackDomain}/v1/track/content/watch`,{id:s,key:a}=i(t),u={apiUrl:o,profile_id:s,profile_id_type:a,watch:r},{query:l={}}=u.watch;return Object.keys(l).length&&u.watch.interest_type?n(u):(console.error("Please make sure to include a query and interest type.",u),!1)},customEvent(t,r,o){const s=`${e.trackDomain}/v1/track/event/custom`,a="string"==typeof t;r=i(r);const u={...r,...o,apiUrl:s,event:t||void 0,vars:o.vars||void 0};return u.id&&a?n(u):(console.error("Please make sure to include a custom event name and id.",u),!1)}}};function ee(e){return Array.from(document.getElementsByName(e)).find(e=>e.checked)?.value??null}function te(e){if("checkbox"===e.type&&e.name){const t=e.form||document,n=Array.from(t.querySelectorAll(`input[type="checkbox"][name="${CSS.escape(e.name)}"]`));if(n.length>1&&n.some(e=>e.required)){const e=n.some(e=>e.checked&&!e.disabled),t=n.find(e=>e.required)||n[0];return t.setCustomValidity(e?"":"Please select at least one option."),t.reportValidity?.(),e}}return!("function"==typeof e.checkValidity&&!e.checkValidity())||(e.reportValidity?.(),!1)}const ne=/^lists\[(.+?)\]/;function re(e){return e.getAttribute?.(o)??e.name??e.id??""}function ie(e,t,n,r){e.errors.push({code:t,name:n,message:r})}function oe(e,t,n){try{return!!te(e)||(ie(n,"required",t,"This field is required."),!1)}catch(e){return ie(n,"validation_exception",t,e?.message??"Validation threw an exception."),ie(n,"required",t,"This field is required."),!1}}function se(e){if("checkbox"!==e.type)return null;const t=e.name??e.getAttribute?.("name")??"",n=ne.exec(t);return n?n[1]:null}function ae(e,t,n){e.lists[t]=n.checked?1:0}function ue(e){return e.getAttribute?.(o)??""}function le(e,t){if(!t)return null;if("FORM"===e.nodeName)return ee(t);const n=e.getAttribute?.("data-var-attribute");return n?e[n]:null}function ce(e,t,n,r){const i=t.getAttribute?.("data-var-type");if("bee_radio_checkbox"===i)if(t.checked){const t=e.vars[n];e.vars[n]=t?`${t},${r}`:r}else e.vars[n]??="";else e.vars[n]=r}function de(e){console.log("getVars() non-blocking error:",e)}const he={getVars:function(){const e=document.querySelectorAll(".sailthru-var"),t={vars:Object.create(null),lists:Object.create(null),errors:[]};for(const n of e){if(!oe(n,re(n),t))continue;const e=se(n);if(e){ae(t,e,n);continue}const r=ue(n),i=le(n,r);if(r&&null!=i&&""!==String(i).trim())try{ce(t,n,r,i)}catch(e){de(e)}}return t},getCheckedValue:ee,validateRequiredElement:te},fe={parseUuidsList(e){if(null==e||""==e)return[];if(e.length>36&&","===e.charAt(36))return e.split(",");let t=[];for(let n=0;n<=e.length-36;n+=36)t.push(e.substring(n,n+36));return t},isUuid:e=>!!e.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i)};let me;function pe(e,t){const n={apiUrl:`${me.overlayTrackDomain}/v1/overlay/${e}`,overlay_id:t.overlay_id,target_audience:t.target_audience,visitor_id:k.read("sailthru_visitor"),sticky:!!fe.parseUuidsList(k.read(a))[0]};"lists"===t.target_audience&&(n.lists=t.lists),t.experiment_id&&(n.experiment_id=t.experiment_id,n.variant_id=t.variant_id);const r=k.read("sailthru_hid");return void 0!==r&&r.length>0&&(n.user_id_key="hid",n.user_id_value=r),n}function ye(e){let t={...e};return delete t.apiUrl,t.onSuccess&&delete t.onSuccess,t.onError&&delete t.onError,t=JSON.stringify(t),fetch(e.apiUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","X-Lib-Version":me.VERSION,Authorization:`Bearer ${me.customerId}`},body:t}).then(e=>e.json()).then(t=>{if(t&&(t.error||t.message))throw t;e.onSuccess&&e.onSuccess(t)}).catch(t=>{let n;t&&t.responseText&&(n=JSON.parse(t.responseText),console.error(`You have the following overlay track error: ${n.message}`)),e.onError&&e.onError(t)})}const ge=e=>(me=e,{view:e=>ye(pe("view",e)),conversion:(e,t)=>ye({...pe("conversion",e),...t}),click:e=>ye(pe("click",e))});let ve,we;function be(e){ve=e,k.create(a,e)}function ke(){const e=we.getUrlParam("SToverlay");if(""===e)return void console.error("Empty overlay id. Please specify a valid uuid.");const t=fe.parseUuidsList(k.read(a))[0];if(e&&!fe.isUuid(e)&&!t)return void console.error(`Invalid id: ${e}. Please specify a valid uuid.`);if(e)return function(e){const t=k.read(u),n=fe.parseUuidsList(t);t&&-1!==n.indexOf(e)&&(t===e?k.delete(u):k.create(u,t.replace(e,"")))}(e),k.create(s,window.location.search),be(e),e;const n=fe.parseUuidsList(k.read(u));return t&&-1===n.indexOf(t)?(be(t),t):void 0}function Se(){return ve}function xe(e){"string"==typeof e&&fe.isUuid(e)?(k.delete(s),k.delete(a),function(e){const t=k.read(u);-1===fe.parseUuidsList(t).indexOf(e)&&(t?k.create(u,`${e}${t}`):k.create(u,e))}(e)):console.error(`Invalid id: ${e}. Please specify a valid uuid.`)}const Te=()=>(we=L(),{triggerStickyOverlay:ke,getStickyOverlayId:Se,dismiss:xe});let Oe,Ie;const Ne=[];function Ee(){clearTimeout(Oe),Ne.forEach(function(e){document.removeEventListener(e.event,e.handler)})}function Ce(e,t){Oe=setTimeout(()=>{Ie(e),Ee()},t)}function De(e,t,n){const r=t.timer.event_handler[e];if("page_interaction"===e){let e;"reset"===r&&(e=function(){!function(e,t){clearTimeout(Oe),Ce(e,t)}(t,n)}),"cancel"===r&&(e=function(){Ee()}),e&&(["mousemove","mousedown","click","scroll","keydown"].forEach(function(t){Ne.push({event:t,handler:e}),document.addEventListener(t,e)}),Ce(t,n))}}function $e(e){if("page"===e.timer.scope){const t=e.timer.threshold_ms||0;if(e.timer.event_handler){const n=Object.keys(e.timer.event_handler);for(const r of n)De(r,e,t)}else setTimeout(()=>{Ie(e)},t)}else Ie(e)}const _e=e=>(Ie=e,{renderTimeDelayedOverlay:$e});var Ve,Me="user-agent",Fe="",Pe="function",Ae="undefined",Le="object",je="string",Ue="browser",Re="cpu",qe="device",ze="engine",We="os",Ze="result",He="name",Ge="type",Be="vendor",Ye="version",Je="architecture",Ke="major",Xe="model",Qe="console",et="mobile",tt="tablet",nt="smarttv",rt="wearable",it="xr",ot="embedded",st="inapp",at="brands",ut="formFactors",lt="fullVersionList",ct="platform",dt="platformVersion",ht="bitness",ft="sec-ch-ua",mt=ft+"-full-version-list",pt=ft+"-arch",yt=ft+"-"+ht,gt=ft+"-form-factors",vt=ft+"-"+et,wt=ft+"-"+Xe,bt=ft+"-"+ct,kt=bt+"-version",St=[at,lt,et,Xe,ct,dt,Je,ut,ht],xt="Amazon",Tt="Apple",Ot="ASUS",It="BlackBerry",Nt="Google",Et="Huawei",Ct="Lenovo",Dt="Honor",$t="LG",_t="Microsoft",Vt="Motorola",Mt="Nvidia",Ft="OnePlus",Pt="OPPO",At="Samsung",Lt="Sharp",jt="Sony",Ut="Xiaomi",Rt="Zebra",qt="Chrome",zt="Chromium",Wt="Chromecast",Zt="Edge",Ht="Firefox",Gt="Opera",Bt="Facebook",Yt="Sogou",Jt="Mobile ",Kt=" Browser",Xt="Windows",Qt=typeof window!==Ae&&window.navigator?window.navigator:void 0,en=Qt&&Qt.userAgentData?Qt.userAgentData:void 0,tn=function(e){for(var t={},n=0;n0){for(var n in e)if(an(t)==an(e[n]))return!0;return!1}return!!on(e)&&an(t)==an(e)},rn=function(e,t){for(var n in e)return/^(browser|cpu|device|engine|os)$/.test(n)||!!t&&rn(e[n])},on=function(e){return typeof e===je},sn=function(e){if(e){for(var t=[],n=cn(/\\?\"/g,e).split(","),r=0;r-1){var i=hn(n[r]).split(";v=");t[r]={brand:i[0],version:i[1]}}else t[r]=hn(n[r]);return t}},an=function(e){return on(e)?e.toLowerCase():e},un=function(e){return on(e)?cn(/[^\d\.]/g,e).split(".")[0]:void 0},ln=function(e){for(var t in e){var n=e[t];typeof n==Le&&2==n.length?this[n[0]]=n[1]:this[n]=void 0}return this},cn=function(e,t){return on(t)?t.replace(e,Fe):t},dn=function(e){return cn(/\\?\"/g,e)},hn=function(e,t){if(on(e))return e=cn(/^\s\s*/,e),typeof t===Ae?e:e.substring(0,500)},fn=function(e,t){if(e&&t)for(var n,r,i,o,s,a,u=0;u0?2===o.length?typeof o[1]==Pe?this[o[0]]=o[1].call(this,a):this[o[0]]=o[1]:o.length>=3&&(typeof o[1]!==Pe||o[1].exec&&o[1].test?3==o.length?this[o[0]]=a?a.replace(o[1],o[2]):void 0:4==o.length?this[o[0]]=a?o[3].call(this,a.replace(o[1],o[2])):void 0:o.length>4&&(this[o[0]]=a?o[3].apply(this,[a.replace(o[1],o[2])].concat(o.slice(4))):void 0):o.length>3?this[o[0]]=a?o[1].apply(this,o.slice(2)):void 0:this[o[0]]=a?o[1].call(this,a,o[2]):void 0):this[o]=a||void 0;u+=2}},mn=function(e,t){for(var n in t)if(typeof t[n]===Le&&t[n].length>0){for(var r=0;r2&&this.set(Xe,"iPad").set(Ge,tt);break;case We:!this.get(He)&&en&&en[ct]&&this.set(He,en[ct]);break;case Ze:var e=this.data,t=function(t){return e[t].getItem().detectFeature().get()};this.set(Ue,t(Ue)).set(Re,t(Re)).set(qe,t(qe)).set(ze,t(ze)).set(We,t(We))}return this},this.parseUA=function(){return this.itemType!=Ze&&fn.call(this.data,this.ua,this.rgxMap),this.itemType==Ue&&this.set(Ke,un(this.get(Ye))),this},this.parseCH=function(){var e=this.uaCH,t=this.rgxMap;switch(this.itemType){case Ue:case ze:var n,r=e[lt]||e[at];if(r)for(var i in r){var o=r[i].brand||r[i],s=r[i].version;this.itemType==Ue&&!/not.a.brand/i.test(o)&&(!n||/Chrom/.test(n)&&o!=zt||n==Zt&&/WebView2/.test(o))&&(o=mn(o,gn),(n=this.get(He))&&!/Chrom/.test(n)&&/Chrom/.test(o)||this.set(He,o).set(Ye,s).set(Ke,un(s)),n=o),this.itemType==ze&&o==zt&&this.set(Ye,s)}break;case Re:var a=e[Je];a&&(a&&"64"==e[ht]&&(a+="64"),fn.call(this.data,a+";",t));break;case qe:if(e[et]&&this.set(Ge,et),e[Xe]&&(this.set(Xe,e[Xe]),!this.get(Ge)||!this.get(Be))){var u={};fn.call(u,"droid 9; "+e[Xe]+")",t),!this.get(Ge)&&u.type&&this.set(Ge,u.type),!this.get(Be)&&u.vendor&&this.set(Be,u.vendor)}if(e[ut]){var l;if("string"!=typeof e[ut])for(var c=0;!l&&c=13?"11":"10"),this.set(He,d).set(Ye,h)}this.get(He)==Xt&&"Xbox"==e[Xe]&&this.set(He,"Xbox").set(Ye,void 0);break;case Ze:var f=this.data,m=function(t){return f[t].getItem().setCH(e).parseCH().get()};this.set(Ue,m(Ue)).set(Re,m(Re)).set(qe,m(qe)).set(ze,m(ze)).set(We,m(We))}return this},ln.call(this,[["itemType",e],["ua",t],["uaCH",r],["rgxMap",n],["data",bn(this,e)]]),this}function xn(e,t,n){if(typeof e===Le?(rn(e,!0)?(typeof t===Le&&(n=t),t=e):(n=e,t=void 0),e=void 0):typeof e!==je||rn(t,!0)||(n=t,t=void 0),n&&typeof n.append===Pe){var r={};n.forEach(function(e,t){r[t]=e}),n=r}if(!(this instanceof xn))return new xn(e,t,n).getResult();var i=typeof e===je?e:n&&n[Me]?n[Me]:Qt&&Qt.userAgent?Qt.userAgent:Fe,o=new kn(n,!0),s=t?function(e,t){var n={},r=t;if(!rn(t))for(var i in r={},t)for(var o in t[i])r[o]=t[i][o].concat(r[o]?r[o]:[]);for(var s in e)n[s]=r[s]&&r[s].length%2==0?r[s].concat(e[s]):e[s];return n}(vn,t):vn,a=function(e){return e==Ze?function(){return new Sn(e,i,s,o).set("ua",i).set(Ue,this.getBrowser()).set(Re,this.getCPU()).set(qe,this.getDevice()).set(ze,this.getEngine()).set(We,this.getOS()).get()}:function(){return new Sn(e,i,s[e],o).parseUA().get()}};return ln.call(this,[["getBrowser",a(Ue)],["getCPU",a(Re)],["getDevice",a(qe)],["getEngine",a(ze)],["getOS",a(We)],["getResult",a(Ze)],["getUA",function(){return i}],["setUA",function(e){return on(e)&&(i=e.length>500?hn(e,500):e),this}]]).setUA(i),this}xn.VERSION="2.0.4",xn.BROWSER=tn([He,Ye,Ke,Ge]),xn.CPU=tn([Je]),xn.DEVICE=tn([Xe,Be,Ge,Qe,et,nt,tt,rt,ot]),xn.ENGINE=xn.OS=tn([He,Ye]);var Tn=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],On=Tn.join(","),In="undefined"==typeof Element,Nn=In?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,En=!In&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},Cn=function(e,t){var n;void 0===t&&(t=!0);var r=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):Cn(e.parentNode))},Dn=function(e,t,n){if(Cn(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(On));return t&&Nn.call(e,On)&&r.unshift(e),r=r.filter(n)},$n=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var o=i.shift();if(!Cn(o,!1))if("SLOT"===o.tagName){var s=o.assignedElements(),a=s.length?s:o.children,u=$n(a,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:o,candidates:u})}else{Nn.call(o,On)&&n.filter(o)&&(t||!e.includes(o))&&r.push(o);var l=o.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(o),c=!Cn(l,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(o));if(l&&c){var d=$n(!0===l?o.children:l.children,!0,n);n.flatten?r.push.apply(r,d):r.push({scopeParent:o,candidates:d})}else i.unshift.apply(i,o.children)}}return r},_n=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Vn=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!_n(e)?0:e.tabIndex},Mn=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Fn=function(e){return"INPUT"===e.tagName},Pn=function(e){return function(e){return Fn(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||En(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var i=function(e,t){for(var n=0;nsummary:first-of-type")?e.parentElement:e;if(Nn.call(i,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return An(e)}else{if("function"==typeof r){for(var o=e;e;){var s=e.parentElement,a=En(e);if(s&&!s.shadowRoot&&!0===r(s))return An(e);e=e.assignedSlot?e.assignedSlot:s||a===e.ownerDocument?s:a.host}e=o}if(function(e){var t,n,r,i,o=e&&En(e),s=null===(t=o)||void 0===t?void 0:t.host,a=!1;if(o&&o!==e)for(a=!!(null!==(n=s)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(s)||null!=e&&null!==(i=e.ownerDocument)&&void 0!==i&&i.contains(e));!a&&s;){var u,l,c;a=!(null===(l=s=null===(u=o=En(s))||void 0===u?void 0:u.host)||void 0===l||null===(c=l.ownerDocument)||void 0===c||!c.contains(s))}return a}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},jn=function(e,t){return!(t.disabled||function(e){return Fn(e)&&"hidden"===e.type}(t)||Ln(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some(function(e){return"SUMMARY"===e.tagName})}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n=0)},qn=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,o=i?e.scopeParent:e,s=function(e,t){var n=Vn(e);return n<0&&t&&!_n(e)?0:n}(o,i),a=i?qn(e.candidates):o;0===s?i?t.push.apply(t,a):t.push(o):n.push({documentOrder:r,tabIndex:s,item:e,isScope:i,content:a})}),n.sort(Mn).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},zn=function(e,t){var n;return n=(t=t||{}).getShadowRoot?$n([e],t.includeContainer,{filter:Un.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Rn}):Dn(e,t.includeContainer,Un.bind(null,t)),qn(n)},Wn=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Nn.call(e,On)&&Un(t,e)},Zn=Tn.concat("iframe:not([inert]):not([inert] *)").join(","),Hn=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Nn.call(e,Zn)&&jn(t,e)};function Gn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function Kn(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Qn(e){for(var t=1;t3?(i=m===r)&&(u=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=f&&((i=n<2&&fr||r>m)&&(o[4]=n,o[5]=r,h.n=m,a=0))}if(i||n>1)return s;throw d=!0,r}return function(i,c,m){if(l>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,m),a=c,u=m;(t=a<2?e:u)||!d;){o||(a?a<3?(a>1&&(h.n=-1),f(a,u)):h.n=u:h.v=u);try{if(l=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(d=h.n<0)?u:n.call(r,h))!==s)break}catch(t){o=e,a=1,u=t}finally{l=1}}return{value:t,done:d}}}(n,i,o),!0),l}var s={};function a(){}function u(){}function l(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(tr(t={},r,function(){return this}),t),d=l.prototype=a.prototype=Object.create(c);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,tr(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e}return u.prototype=l,tr(d,"constructor",l),tr(l,"constructor",u),u.displayName="GeneratorFunction",tr(l,i,"GeneratorFunction"),tr(d),tr(d,i,"Generator"),tr(d,r,function(){return this}),tr(d,"toString",function(){return"[object Generator]"}),(er=function(){return{w:o,m:h}})()}function tr(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}tr=function(e,t,n,r){function o(t,n){tr(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},tr(e,t,n,r)}function nr(e){return function(e){if(Array.isArray(e))return Gn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||rr(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rr(e,t){if(e){if("string"==typeof e)return Gn(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gn(e,t):void 0}}var ir={getActiveTrap:function(e){return(null==e?void 0:e.length)>0?e[e.length-1]:null},activateTrap:function(e,t){t!==ir.getActiveTrap(e)&&ir.pauseTrap(e);var n=e.indexOf(t);-1===n||e.splice(n,1),e.push(t)},deactivateTrap:function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),ir.unpauseTrap(e)},pauseTrap:function(e){var t=ir.getActiveTrap(e);null==t||t._setPausedState(!0)},unpauseTrap:function(e){var t=ir.getActiveTrap(e);t&&!t._isManuallyPaused()&&t._setPausedState(!1)}},or=function(e){return"Tab"===(null==e?void 0:e.key)||9===(null==e?void 0:e.keyCode)},sr=function(e){return or(e)&&!e.shiftKey},ar=function(e){return or(e)&&e.shiftKey},ur=function(e){return setTimeout(e,0)},lr=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:{},n=t.hasFallback,i=void 0!==n&&n,s=t.params,a=void 0===s?[]:s,u=o[e];if("function"==typeof u&&(u=u.apply(void 0,nr(a))),!0===u&&(u=void 0),!u){if(void 0===u||!1===u)return u;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var l=u;if("string"==typeof u){try{l=r.querySelector(u)}catch(t){throw new Error("`".concat(e,'` appears to be an invalid selector; error="').concat(t.message,'"'))}if(!l&&!i)throw new Error("`".concat(e,"` as selector refers to no known node"))}return l},c=function(){var e=l("initialFocus",{hasFallback:!0});if(!1===e)return!1;if(void 0===e||e&&!Hn(e,o.tabbableOptions))if(u(r.activeElement)>=0)e=r.activeElement;else{var t=s.tabbableGroups[0];e=t&&t.firstTabbableNode||l("fallbackFocus")}else null===e&&(e=l("fallbackFocus"));if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},d=function(){if(s.containerGroups=s.containers.map(function(e){var t=zn(e,o.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?$n([e],t.includeContainer,{filter:jn.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Dn(e,t.includeContainer,jn.bind(null,t))}(e,o.tabbableOptions),r=t.length>0?t[0]:void 0,i=t.length>0?t[t.length-1]:void 0,s=n.find(function(e){return Wn(e)}),a=n.slice().reverse().find(function(e){return Wn(e)}),u=!!t.find(function(e){return Vn(e)>0});return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:u,firstTabbableNode:r,lastTabbableNode:i,firstDomTabbableNode:s,lastDomTabbableNode:a,nextTabbableNode:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=t.indexOf(e);return i<0?r?n.slice(n.indexOf(e)+1).find(function(e){return Wn(e)}):n.slice(0,n.indexOf(e)).reverse().find(function(e){return Wn(e)}):t[i+(r?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(e){return e.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!l("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function(e){return e.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function(e){var t=e.activeElement;if(t)return t.shadowRoot&&null!==t.shadowRoot.activeElement?h(t.shadowRoot):t},f=function(e){!1!==e&&e!==h(document)&&(e&&e.focus?(e.focus({preventScroll:!!o.preventScroll}),s.mostRecentlyFocusedNode=e,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(e)&&e.select()):f(c()))},m=function(e){var t=l("setReturnFocus",{params:[e]});return t||!1!==t&&e},p=function(e){var t=e.target,n=e.event,r=e.isBackward,i=void 0!==r&&r;t=t||cr(n),d();var a=null;if(s.tabbableGroups.length>0){var c=u(t,n),h=c>=0?s.containerGroups[c]:void 0;if(c<0)a=i?s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:s.tabbableGroups[0].firstTabbableNode;else if(i){var f=s.tabbableGroups.findIndex(function(e){var n=e.firstTabbableNode;return t===n});if(f<0&&(h.container===t||Hn(t,o.tabbableOptions)&&!Wn(t,o.tabbableOptions)&&!h.nextTabbableNode(t,!1))&&(f=c),f>=0){var m=0===f?s.tabbableGroups.length-1:f-1,p=s.tabbableGroups[m];a=Vn(t)>=0?p.lastTabbableNode:p.lastDomTabbableNode}else or(n)||(a=h.nextTabbableNode(t,!1))}else{var y=s.tabbableGroups.findIndex(function(e){var n=e.lastTabbableNode;return t===n});if(y<0&&(h.container===t||Hn(t,o.tabbableOptions)&&!Wn(t,o.tabbableOptions)&&!h.nextTabbableNode(t))&&(y=c),y>=0){var g=y===s.tabbableGroups.length-1?0:y+1,v=s.tabbableGroups[g];a=Vn(t)>=0?v.firstTabbableNode:v.firstDomTabbableNode}else or(n)||(a=h.nextTabbableNode(t))}}else a=l("fallbackFocus");return a},y=function(e){var t=cr(e);u(t,e)>=0||(lr(o.clickOutsideDeactivates,e)?n.deactivate({returnFocus:o.returnFocusOnDeactivate}):lr(o.allowOutsideClick,e)||e.preventDefault())},g=function(e){var t=cr(e),n=u(t,e)>=0;if(n||t instanceof Document)n&&(s.mostRecentlyFocusedNode=t);else{var r;e.stopImmediatePropagation();var i=!0;if(s.mostRecentlyFocusedNode)if(Vn(s.mostRecentlyFocusedNode)>0){var a=u(s.mostRecentlyFocusedNode),l=s.containerGroups[a].tabbableNodes;if(l.length>0){var d=l.findIndex(function(e){return e===s.mostRecentlyFocusedNode});d>=0&&(o.isKeyForward(s.recentNavEvent)?d+1=0&&(r=l[d-1],i=!1))}}else s.containerGroups.some(function(e){return e.tabbableNodes.some(function(e){return Vn(e)>0})})||(i=!1);else i=!1;i&&(r=p({target:s.mostRecentlyFocusedNode,isBackward:o.isKeyBackward(s.recentNavEvent)})),f(r||(s.mostRecentlyFocusedNode||c()))}s.recentNavEvent=void 0},v=function(e){(o.isKeyForward(e)||o.isKeyBackward(e))&&function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];s.recentNavEvent=e;var n=p({event:e,isBackward:t});n&&(or(e)&&e.preventDefault(),f(n))}(e,o.isKeyBackward(e))},w=function(e){var t;"Escape"!==(null==(t=e)?void 0:t.key)&&"Esc"!==(null==t?void 0:t.key)&&27!==(null==t?void 0:t.keyCode)||!1===lr(o.escapeDeactivates,e)||(e.preventDefault(),n.deactivate())},b=function(e){var t=cr(e);u(t,e)>=0||lr(o.clickOutsideDeactivates,e)||lr(o.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},k=function(){return s.active?(ir.activateTrap(i,n),o.delayInitialFocus?e=new Promise(function(e){s.delayInitialFocusTimer=ur(function(){f(c()),e()})}):(e=Promise.resolve(),f(c())),r.addEventListener("focusin",g,!0),r.addEventListener("mousedown",y,{capture:!0,passive:!1}),r.addEventListener("touchstart",y,{capture:!0,passive:!1}),r.addEventListener("click",b,{capture:!0,passive:!1}),r.addEventListener("keydown",v,{capture:!0,passive:!1}),r.addEventListener("keydown",w),e):Promise.resolve();var e},S=function(){if(s.active)return r.removeEventListener("focusin",g,!0),r.removeEventListener("mousedown",y,!0),r.removeEventListener("touchstart",y,!0),r.removeEventListener("click",b,!0),r.removeEventListener("keydown",v,!0),r.removeEventListener("keydown",w),n},x="undefined"!=typeof window&&"MutationObserver"in window?new MutationObserver(function(e){e.some(function(e){return Array.from(e.removedNodes).some(function(e){return e===s.mostRecentlyFocusedNode})})&&f(c())}):void 0,T=function(){x&&(x.disconnect(),s.active&&!s.paused&&s.containers.map(function(e){x.observe(e,{subtree:!0,childList:!0})}))};return n={get active(){return s.active},get paused(){return s.paused},activate:function(e){if(s.active)return this;var t,o=a(e,"onActivate"),u=a(e,"onPostActivate"),l=a(e,"checkCanFocusTrap"),c=ir.getActiveTrap(i),f=!1;c&&!c.paused&&(null===(t=c._setSubtreeIsolation)||void 0===t||t.call(c,!1),f=!0);try{l||d(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=h(r),null==o||o();var m=function(){var e=Yn(er().m(function e(){return er().w(function(e){for(;;)switch(e.n){case 0:return l&&d(),e.n=1,k();case 1:n._setSubtreeIsolation(!0),T(),null==u||u();case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();if(l)return l(s.containers.concat()).then(m,m),this;m()}catch(e){var p;if(c===ir.getActiveTrap(i)&&f)null===(p=c._setSubtreeIsolation)||void 0===p||p.call(c,!0);throw e}return this},deactivate:function(e){if(!s.active)return this;var t=Qn({onDeactivate:o.onDeactivate,onPostDeactivate:o.onPostDeactivate,checkCanReturnFocus:o.checkCanReturnFocus},e);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,s.paused||n._setSubtreeIsolation(!1),s.alreadySilent.clear(),S(),s.active=!1,s.paused=!1,T(),ir.deactivateTrap(i,n);var r=a(t,"onDeactivate"),u=a(t,"onPostDeactivate"),l=a(t,"checkCanReturnFocus"),c=a(t,"returnFocus","returnFocusOnDeactivate");null==r||r();var d=function(){ur(function(){c&&f(m(s.nodeFocusedBeforeActivation)),null==u||u()})};return c&&l?(l(m(s.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(e){return s.active?(s.manuallyPaused=!0,this._setPausedState(!0,e)):this},unpause:function(e){return s.active?(s.manuallyPaused=!1,i[i.length-1]!==this?this:this._setPausedState(!1,e)):this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return s.containers=t.map(function(e){return"string"==typeof e?r.querySelector(e):e}),o.isolateSubtrees&&function(e){s.active&&!s.paused&&n._setSubtreeIsolation(!1),s.adjacentElements.clear(),s.alreadySilent.clear();var t,r=new Set,i=new Set,o=Jn(e);try{for(o.s();!(t=o.n()).done;){var a=t.value;r.add(a);for(var u="undefined"!=typeof ShadowRoot&&a.getRootNode()instanceof ShadowRoot,l=a;l;){r.add(l);var c=l.parentElement,d=[];c?d=c.children:!c&&u&&(d=l.getRootNode().children,c=l.getRootNode().host,u="undefined"!=typeof ShadowRoot&&c.getRootNode()instanceof ShadowRoot);var h,f=Jn(d);try{for(f.s();!(h=f.n()).done;){var m=h.value;i.add(m)}}catch(e){f.e(e)}finally{f.f()}l=c}}}catch(e){o.e(e)}finally{o.f()}r.forEach(function(e){i.delete(e)}),s.adjacentElements=i}(s.containers),s.active&&(d(),s.paused||n._setSubtreeIsolation(!0)),T(),this}},Object.defineProperties(n,{_isManuallyPaused:{value:function(){return s.manuallyPaused}},_setPausedState:{value:function(e,t){if(s.paused===e)return this;if(s.paused=e,e){var r=a(t,"onPause"),i=a(t,"onPostPause");null==r||r(),S(),n._setSubtreeIsolation(!1),T(),null==i||i()}else{var o=a(t,"onUnpause"),u=a(t,"onPostUnpause");null==o||o();var l=function(){var e=Yn(er().m(function e(){return er().w(function(e){for(;;)switch(e.n){case 0:return d(),e.n=1,k();case 1:n._setSubtreeIsolation(!0),T(),null==u||u();case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();l()}return this}},_setSubtreeIsolation:{value:function(e){o.isolateSubtrees&&s.adjacentElements.forEach(function(t){var n;if(e)if("aria-hidden"===o.isolateSubtrees)"true"!==t.ariaHidden&&"true"!==(null===(n=t.getAttribute("aria-hidden"))||void 0===n?void 0:n.toLowerCase())||s.alreadySilent.add(t),t.setAttribute("aria-hidden","true");else(t.inert||t.hasAttribute("inert"))&&s.alreadySilent.add(t),t.setAttribute("inert",!0);else if(s.alreadySilent.has(t));else if("aria-hidden"===o.isolateSubtrees)t.removeAttribute("aria-hidden");else t.removeAttribute("inert")})}}}),n.updateContainerElements(e),n};let fr,mr,pr,yr,gr,vr,wr,br=!1,kr=null,Sr=null,xr=null,Tr={};const{DateTime:Or}=n(169),Ir="#sailthru-user-acquisition-email",Nr="#sailthru-user-acquisition-phone",Er="opt-in",Cr="opt-out";function Dr(){document.body?.classList?.remove("sailthru-overlay-no-scroll"),xr&&(xr.deactivate(),xr=null);const e=document.getElementsByClassName("sailthru-overlay-container");Array.from(e).forEach(e=>e.remove());const t=document.body;t?.classList?.remove("sailthru-pushdown","sailthru-pushdown-animation"),kr?.overlay_id&&vr.getStickyOverlayId()===kr.overlay_id&&vr.dismiss(kr.overlay_id),kr=null}function $r(e){return/^(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){255,})(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){65,}@)(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22))(?:\.(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-[a-z0-9]+)*)|(?:\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\]))$/i.test(e)}function _r(e){const t=e.match(/sailthru(?:_\d){3}/);if(!t)return{row:null,col:null,elem:null};const[n,r,i]=t[0].match(/\d/g);return{row:n,col:r,elem:i}}function Vr(e){if(!e)return console.warn("hideInputValidationError:: No selector was provided"),null;const t=document.querySelector(e);if(!t)return console.warn(`hideInputValidationError:: ${e} was not found`),null;let n=t.className;const{row:r,col:i,elem:o}=_r(n),s=document.querySelector(`div[id$='error-${r}-${i}-${o}'].sailthru-overlay-validation-error`);return s&&(s.style.display="none"),n=n.replace(/[^\s]has-error/g,""),t.className=n,null}function Mr(e){const t=document.querySelector(e).value;return t.replace(/<\/*\s*script.*?>/gi,"")}function Fr(e,t={},n={},r={}){let i=e,o="";const s=-1!==i.indexOf("?"),a=-1!==i.indexOf("#"),u=!!t.email&&encodeURIComponent(t.email);return u&&(o+=`em=${u}`),o=Object.entries(n).reduce((e,[t,n])=>{let r=e;return e&&(r+="&"),`${r}${t}=${encodeURIComponent(n)}`},o),s&&a?i=i.replace("#",`&${o}#`):s&&!a?i=`${i}&${o}`:!s&&a?i=i.replace("#",`?${o}#`):s||a||(i=`${i}?${o}`),i}function Pr(e,t,n){if(e?.redirect?.active&&e.redirect.url){const r=Fr(e.redirect.url,t,n);return e.redirect.new_tab||window.location.assign(r),Dr(),`Redirecting to ${r}`}return e?.message?.active&&e.message.text?(document.getElementsByClassName("sailthru-overlay")[0].style.display="none",document.getElementsByClassName("sailthru-overlay-post-click")[0].style.display="block",setTimeout(()=>{Dr()},5e3),`Display Message: ${e.message.text}`):(Dr(),"No Post-click Action")}function Ar(e){const t=he.getVars(),n=e.acquisition_source||"overlay";return t.errors.length?null:{vars:{...t.vars,source:n},lists:t.lists}}function Lr(e,t,n){const r=`Invalid ${n}`;!function(e){return"function"==typeof e.checkValidity&&"function"==typeof e.setCustomValidity&&"function"==typeof e.reportValidity}(e)?(!function(e){if(!e)return console.warn("showInputValidationError:: No selector was provided"),null;const t=document.querySelector(e);if(!t)return console.warn(`hideInputValidationError:: ${e} was not found`),null;let n=t.className;const{row:r,col:i,elem:o}=_r(n),s=document.querySelector(`div[id$='error-${r}-${i}-${o}'].sailthru-overlay-validation-error`);s&&(s.style.display="block"),n.indexOf("has-error")<0&&(n.endsWith(" ")||(n+=" "),n+="has-error"),t.className=n}(t),e.focus()):(e.setCustomValidity(r),e.reportValidity()),console.error(r)}function jr(e){const t=e.destination_lists,n={},r=document.querySelector(Ir),i=!!r;let o=null;const s=document.querySelector(Nr),a=!!s;let u=null,c=null,d=!1;if(i){if(o=Mr(Ir),!o||!$r(o))return Lr(r,Ir,"Email"),!1;"function"==typeof r.setCustomValidity&&r.setCustomValidity(""),n.email=o}if(a&&(u=Mr(Nr),d=""!==u,c=function(e){let t=e;"number"==typeof t&&(t=t.toString());let n=t.replace(/[^0-9]/g,"");return n.length<10?null:(10===n.length&&(n=`1${n}`),`+${n}`)}(u),d||!i)){if(!c)return Lr(s,Nr,"Phone"),!1;"function"==typeof s.setCustomValidity&&s.setCustomValidity(""),n.sms=c}Vr(Nr),Vr(Ir);const h=i?"email":"sms",f=i?n.email:n.sms,m=""!==e.template,p={id:f,key:h},y={},g=document.querySelector("#sailthru-user-acquisition-sms-marketing"),v=document.querySelector("#sailthru-user-acquisition-sms-transaction");d&&g&&(y.sms_marketing_status=g.checked?Er:Cr),d&&v&&(y.sms_transactional_status=v.checked?Er:Cr);const w=Ar(e);if(null===w)return console.error("Required custom var missing"),!1;const{vars:b={},lists:k={}}=w??{},S=function(e,t,n){return function(r){yr.urlFragmentParams[l]&&console.log("userSignUp SUCCESS",r),mr.conversion(e,t);let i=-1;if("function"==typeof fr.onSignupSuccess)try{if(i=fr.onSignupSuccess({...t,vars:{...n},response:r}),0===i)return Dr(),0}catch(e){console.log("onSignupSuccess encountered an error:",e),i=0}const o=Pr(e.post_click,t,n);return yr.urlFragmentParams[l]&&console.log(`onSignupSuccess returned ${i} with post-click: ${o}`),i}}(e,n,b),x=function(e){return function(t){console.log("userSignUp ERROR",t);let n=-1;if("function"==typeof fr.onSignupError)try{n=fr.onSignupError({...e,error:t.error||"There was an error with your request"})}catch(e){console.log("onSignupError encountered an error:",e),n=0}return Dr(),console.log(`onSignupError returned ${n}`),n}}(n);if(m&&n.email){const r={name:e.template,vars:{signup_lists:t}};return pr.userSignUpConfirmedOptIn(p,{keys:n,...y,vars:b,template:r,onSuccess:S,onError:x})}const T={...k};if(Array.isArray(t))for(const e of t)"string"==typeof e&&e&&(T[e]=1);return pr.userSignUp(p,{keys:n,...y,lists:T,vars:b,onSuccess:S,onError:x})}function Ur(){return"1"===yr.urlFragmentParams.STshowOverlay}function Rr(e,t,n){try{e.setItem(t,n)}catch(r){if("QuotaExceededError"===r.name){console.error("LocalStorage is full. Making space and retrying update"),n=n.substr(1+n.indexOf("|"));try{e.setItem(t,n)}catch(e){throw console.error("Failed updating local storage"),e}}}}function qr(e,t){const n=e.getItem("sailthru-overlay-info")||"",r=`${t}#${Or.utc().toISO()}|`;if(-1===n.indexOf(t))Rr(e,"sailthru-overlay-info",`${n}${r}`);else{const i=n.split("|").find(e=>e.startsWith(t));Rr(e,"sailthru-overlay-info",n.replace(`${t}#${i.split("#")[1]}|`,`${r}`))}}function zr(e,t,n,r){const i=r||window.localStorage,o=k.readCookieValue("sailthru_overlays")||"",s=function(e,t){const n=e.getItem("sailthru-overlay-info")||"";if(""===n||-1===n.indexOf(t))return null;const r=n.split("|").find(e=>e.startsWith(t));return Or.fromISO(r.split("#")[1])}(i,n),a=Or.utc(),u=()=>qr(i,n);if(Ur())return!0;const l=k.handleGDPR();if(l&&"every-pageview"!==e&&"once-visit"!==e)return!1;switch(e){case"every-pageview":return!0;case"once-visit":if(!o.includes(n)){if(l){const e=k.getSessionCookieName("sailthru_overlays");return()=>k.create(e,`${n}${o}`)}return()=>k.create("sailthru_overlays",`${n}${o}`,30)}return!1;case"once-ever":{const e=i.getItem("sailthruOverlay")||"";return!e.includes(n)&&(()=>{try{i.setItem("sailthruOverlay",`${n}${e}`)}catch{i.setItem("sailthruOverlay",`${n}${e.slice(0,-36)}`)}})}case"once-month":{if(!s)return u;const e=s.plus({days:31}).setZone("utc"),t=s.plus({months:1}).endOf("month");return a>=Or.min(t,e)&&u}case"once-week":if(!s)return u;return a.minus({days:a.weekday%7}).startOf("day")>s&&u;case"once-n-days":return(!s||a>=s.plus({days:t}))&&u;case"every-n-pageviews":{const e=function(e,t){let n=0;const r=e.getItem("sailthru-overlay-hit-count")||"";r.indexOf(t)>=0&&(n=r.split("|").find(e=>e.startsWith(t)).split("#")[1]);return Number(n)}(i,n);return k.getPageViewsCount()>=e+t&&(()=>{!function(e,t){const n=k.getPageViewsCount(),r=e.getItem("sailthru-overlay-hit-count")||"",i=`${t}#${n}|`;if(-1===r.indexOf(t))Rr(e,"sailthru-overlay-hit-count",`${r}${i}`);else{const n=r.split("|").find(e=>e.startsWith(t));Rr(e,"sailthru-overlay-hit-count",r.replace(`${t}#${n.split("#")[1]}|`,`${i}`))}}(i,n),qr(i,n)})}default:return!1}}function Wr(){const e=new xn(window.navigator.userAgent).getDevice().type;return"mobile"===e||"tablet"===e}function Zr(e){const t=document.querySelector("#sailthru-overlay-call-to-action"),n=document.querySelector(Ir),r=document.querySelector(Nr);t&&(t.addEventListener("click",()=>{jr(e)}),n&&n.addEventListener("input",function(){const n=e.post_click;if(n?.redirect?.active&&n.redirect.new_tab&&$r(this.value)){const r=Ar(e);if(null===r)return console.error("Required custom var missing"),!1;const{vars:i={},lists:o={}}=r??{},s={email:Mr(Ir)};gr=Fr(n.redirect.url,s,i),t.href=gr,t.target="_blank"}else t.removeAttribute("href"),t.removeAttribute("target")})),n&&n.addEventListener("keydown",e=>{Vr(Ir);13===(e.which||e.keyCode)&&document.querySelector("#sailthru-overlay-call-to-action").click()}),r&&r.addEventListener("keydown",e=>{Vr(Nr);13===(e.which||e.keyCode)&&document.querySelector("#sailthru-overlay-call-to-action").click()})}function Hr(){!function(e,t){const n=document.querySelector(`.${e}`);n&&t.addEventListener("mousedown",e=>{n.contains(e.target)||Dr()})}("sailthru-overlay",document.getElementById("sailthru-overlay-container"))}function Gr(e,t){if(kr)return;kr=e;const n=document.getElementsByClassName("sailthru-overlay");for(let e=n.length-1;e>=0;e-=1)try{document.body.removeChild(n[e])}catch{}!function(e){const t=new window.DOMParser;document.body.appendChild(t.parseFromString(e,"text/html").body.firstChild)}(e.html),document.body?.classList?.add("sailthru-overlay-no-scroll"),function(){const e=document.getElementById("sailthru-overlay-container");if(e){e.setAttribute("tabindex","-1");const t=zn(e,Tr),n=t.find(e=>!e.classList.contains("sailthru-overlay-close"))||t[0],r={returnFocusOnDeactivate:!0,fallbackFocus:e,...n&&{initialFocus:n}};Tr&&(r.tabbableOptions=Tr),xr=hr(e,r),xr.activate()}}(),!1===e.allow_close?function(){const e=document.querySelector(".sailthru-overlay-post-click");e&&(e.querySelectorAll(".sailthru-overlay-close").forEach(e=>e.addEventListener("click",Dr)),document.addEventListener("keydown",function(t){"Escape"!==t.key&&27!==t.keyCode||"none"===window.getComputedStyle(e).display||Dr()},{once:!0}))}():(document.querySelectorAll(".sailthru-overlay-close").forEach(e=>e.addEventListener("click",Dr)),document.addEventListener("keydown",e=>{"Escape"!==e.key&&27!==e.keyCode||Dr()})),e&&!0===e.click_to_dismiss&&Hr(),function(e){const t=document.getElementById("sailthru-overlay-container").getElementsByTagName("a"),n=()=>{mr.click(e),Dr()};for(let e=0,r=t.length;e{if(window.navigator.userAgent.indexOf("Trident")<0)return;const e=document.getElementsByClassName("sailthru-overlay")[0],t=window.getComputedStyle(e,null)["background-image"];t&&(e.style["background-image"]=t,u&&console.log(`Setting background-image to ${t}.`));const n=window.getComputedStyle(e,null).height;u&&console.log(`Setting height to ${n}.`),e.style.height=n};h(),u&&console.log(`Scheduling inline CSS resets after ${d} ms.`),setTimeout(h,d)}function Br(e){if(!function(e){const t=Wr();return"mobile-only"===e?t:"desktop-only"!==e||!t}(e.target_device))return!1;const t=Number(e.frequency_value),n=zr(e.frequency,isNaN(t)?0:t,e.overlay_id);if(!n)return!1;const{onBeforeOverlayRender:r}=fr;if("function"==typeof r)try{if(!1===r(e))return!1}catch(e){console.log("Unexpected error in onBeforeOverlayRender function.",e)}return"function"==typeof n&&n(),!e.renderhref||e.renderhref===document.location.href}function Yr(e,t){(br||Br(e))&&Gr(e,t)}function Jr(e){if(e.exit_intent){const t=(e=>{Sr=e;const t=n=>{n.clientY>20||Sr!==e||Yr(e,t)};return t})(e);document.documentElement.addEventListener("mouseleave",t)}else e.timer?wr.renderTimeDelayedOverlay(e):Yr(e);return e}function Kr(e){const t={};return Object.keys(e).forEach(n=>{if("renderhref"!==n){const r=e[n];e.renderhref&&r&&(r.renderhref=e.renderhref),Jr(r),t[n]=r}}),t}function Xr(){let e=[];const t=yr.getPreviewIdFromAnchor();t&&(console.log(`previewing overlay ${t}`),e.push(`preview=${t}`));const n=function(){const e=window.location.hash.startsWith("#")?window.location.hash.substring(1):window.location.hash,t="1"===new URLSearchParams(e).get(d);return t&&console.log(`Overriding pageviews count with anchor "${d}=1".`),t}()?"10000":k.readCookieValue("sailthru_pageviews");n&&e.push(`pageviews=${n}`);const r=Wr()?"1":"0";e.push(`isMobile=${r}`);const i=vr.triggerStickyOverlay();i&&e.push(`echo=${i}`),e=yr.pushLandingPageParams(e);for(const t of function(){const e=k.readCookieValue("sailthru_overlays");return fe.parseUuidsList(e)}())e.push(`so=${t}`);for(const t of function(e){const t=(e||window.localStorage).getItem("sailthruOverlay");return fe.parseUuidsList(t)}())e.push(`oo=${t}`);if(fr.overlayKeyValue&&"object"==typeof fr.overlayKeyValue){const t={};for(const e of Object.keys(fr.overlayKeyValue))"string"==typeof fr.overlayKeyValue[e]?t[e]=fr.overlayKeyValue[e]:console.warn(`Value provided for custom overlay targeting key ${e} is of type ${typeof fr.overlayKeyValue[e]} and will be ignored. Values used for custom overlay targeting must be of string type only.`);e.push(`okv=${encodeURIComponent(JSON.stringify(t))}`)}return e}function Qr(){const e=`${fr.personalizeDomain}/v1/personalize/initialize?`;let t=Xr();return t=yr.pushUserIdKeyAndUserIdValue(fr,t),Promise.resolve(e+t.join("&"))}function ei(){return yr.isPreview()&&(br=!0),br}const ti=e=>(fr=e,mr=ge(fr),pr=Q(fr),yr=L(),vr=Te(),wr=_e(Yr),{hideOverlay:Dr,buildOverlayUrl:Qr,renderOverlays:Kr,renderOverlay:Jr,isShowOverlaySet:Ur,setPreview:ei,getUrlParameters:Xr});let ni,ri,ii,oi,si;function ai(e){const{selector:t,sectionId:n}=e,r=document.querySelectorAll(`${t}`)[0];r&&r.addEventListener("click",t=>{t.preventDefault();const r=t.target,i=r.closest("a");if("A"===r.tagName||i){const t=r.getAttribute("href")||i.getAttribute("href");ri.click(n,t,{onSuccess:n=>{k.updatePCCookie(n,e),window.location.href=t},onError:e=>{console.error(`Click error: ${e.error}`),window.location.href=t}}).catch(e=>{console.error(`Error: ${e}`),window.location.href=t})}})}function ui(e){ni.impressions[e]&&delete ni.impressions[e]}function li(e){ui(e.elementId)}function ci(e){const{elementId:t}=e,n=ni.impressions[t];if(n){if(n.failures+=1,n.failures>=5)ui(t);else{const{section:{sectionId:e},urls:r}=n;ri.impression(e,r,{sectionId:e,elementId:t,userIdKey:ni.userIdKey,userIdValue:ni.userIdValue,onSuccess:li,onError:ci})}return n}}function di(){const{impressions:e}=ni;Object.keys(e).forEach(t=>{const n=e[t];if(function(e){const t=document.querySelector(e);if(!t)return!1;const n=t.getBoundingClientRect(),r=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight;return!(n.right<0||n.bottom<0||n.left>r||n.top>i)}(t)&&"unseen"===n.status){const{section:{sectionId:e},urls:r}=n;return n.status="seen",ri.impression(e,r,{elementId:t,userIdKey:ni.userIdKey,userIdValue:ni.userIdValue,onSuccess:li,onError:ci}),n}})}function hi(e){const{selector:t}=e,n=[],r=document.querySelectorAll(`${t} a[href]`);for(const e of r)n.push(e.href);return ni.impressions[t]={section:e,urls:n,failures:0,status:"unseen"},window.addEventListener("scroll",di),di()}function fi(e){const{sectionId:t,selector:n,list:r,json:i,html:o,error:s,errorMessage:a}=e;if(s)return{error:s};if(a)return{errorMessage:a};const u={sectionId:t,selector:n,list:r};return i?u.json=i:o&&(u.html=o),u}function mi(e){const{selector:t,html:n}=e,r=document.querySelectorAll(t);if(r.length>0)for(const e of r){const t=e.cloneNode(!1);t.innerHTML=n,e.parentNode.replaceChild(t,e)}else console.error(`Unknown selector '${t}' for section ${e.sectionId}`)}function pi(e,t){return"function"==typeof t?t(e):ni&&"function"==typeof ni.onError?ni.onError(e):console.error(`Personalize call failed. ${e}`)}function yi(e,t){const{testId:n,customerId:r,sections:o={},overlays:s={}}=e,a=e.doNotTrack;if(void 0!==n&&(k.delete("sailthru_test_id"),k.create("sailthru_test_id",n,525600)),void 0!==e.pageview){const t=e.pageview.error||e.pageview.message,n=e.pageview.contentHash,r=e.pageview.visitorId;void 0!==t?console.error(`Pageview error ${t}`):(k.updateSailthruContentCookie(n),r&&!k.handleGDPR()&&(k.delete("sailthru_visitor"),k.create("sailthru_visitor",r,525600)))}if(ni.customerId=r||ni.customerId,ni.sections=function(e){const{requestedSections:t}=ni;for(const n in e){const r=e[n],i=t[r.requestedSectionId],o=void 0!==i;r.sectionId=n,ni.isCustom&&(r.selector=i.selector||""),r.html&&!r.control&&mi(r),r.selector&&(hi(r),ai(r)),e[n]=fi(r),r.error||r.errorMessage?o&&"function"==typeof i.onError&&i.onError(e[n]):o&&"function"==typeof i.onSuccess&&i.onSuccess(e[n])}return e}(o),ii.setPreview()){const e=Object.keys(s)[0];void 0!==e?ni.overlay=ii.renderOverlay(s[e]):console.warn("No overlay to preview. put a valid overlay id!")}else e.renderhref&&(s.renderhref=e.renderhref),ni.overlay=ii.renderOverlays(s);a&&(k.setSailthruHid(i),k.handleGDPR()),"function"==typeof t&&t(ni.sections),"function"==typeof ni.onSuccess&&ni.onSuccess(ni.sections)}function gi(e=!1){let t=window.location.toString();if(t&&!e){const e=t.indexOf("#");e>=0&&(t=t.slice(0,e))}return t}window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){let t,n=(this.document||this.ownerDocument).querySelectorAll(e),r=this;do{for(t=n.length;--t>=0&&n.item(t)!==r;);}while(t<0&&(r=r.parentElement));return r});const vi=e=>(ni=e,ii=ti(ni),ri=T(ni),oi=L(),si=Te(),{fetchPersonalize(e,t,n={}){if(!t)throw Error("Missing referrerUrl from personalize call");const r=new Headers({Accept:"application/json","Content-Type":"application/json","X-Lib-Version":ni.VERSION,Authorization:`Bearer ${ni.customerId}`,"X-Referring-URL":gi(ni.fragmentEnabled)});return x(e,{credentials:"same-origin",headers:r},3e4).then(e=>function(e,t){if(window.location!=t)throw oi.urlFragmentParams[l]&&(console.log("window.location",window.location),console.log("referrerUrl",t)),Error("Response for different page.");if(!e)throw Error("No personalize response.");return e.json()}(e,t)).then(e=>e&&(e.error||e.message)?pi(e,n.onError):(e.customerId&&""!=e.customerId&&ni&&ni.currhref&&(e.renderhref=ni.currhref),yi(e,n.onSuccess))).catch(e=>pi(e,n.onError))},SPAHistoryHook(){!function(e){const t=e.pushState;e.pushState=function(n,r,i){const o=t.apply(e,arguments);return Sailthru.init(ni),o}}(window.history)}});let wi,bi,ki,Si;function xi(e){let t=`${wi.personalizeDomain}/v1/personalize`,n=[];if(e)t+="?",n.push(`sections=${Object.keys(wi.requestedSections).join()}`),wi.userVars&&n.push(`vars=${encodeURIComponent(JSON.stringify(wi.userVars))}`);else{t+="/simple?",n=bi.getUrlParameters();const e=k.read("sailthru_visitor");e&&n.push(`visitorId=${e}`);const r=k.read("sailthru_bid");r&&n.push(`messageId=${r}`)}n=Si.pushUserIdKeyAndUserIdValue(wi,n);const r=k.read("sailthru_content");r&&n.push(`content=${r}`);const i=k.read("sailthru_test_id");return i&&n.push(`testId=${i}`),wi.checkBlocked?(o=wi.assetsPath,fetch(`${o}awepop.js`,{mode:"no-cors"}).then(()=>!1).catch(e=>"Failed to fetch"===e.message)).then(e=>(e&&n.push("blocked=true"),t+n.join("&"))):Promise.resolve(t+n.join("&"));var o}function Ti(e){const{sections:t,onSuccess:n,onError:r}=e,i={onSuccess:n,onError:r,sections:t};if(!t||!t.length)throw Error("Please add sections before personalize");return e&&e.vars&&(wi.userVars={vars:e.vars}),t.forEach(e=>{wi.requestedSections[e.id]={...e}}),xi(!0).then(e=>ki.fetchPersonalize(e,window.location,i))}const Oi=e=>(wi=e,bi=ti(wi),ki=vi(wi),Si=L(),{personalize:Ti,buildPersonalizeUrl:xi,overlay:bi}),{debug:Ii,init:Ni,personalize:Ei,track:Ci,integration:Di,overlay:$i}=(e=>{let t,n,r,i,o,s,a,u,l,c,d,h,f,m,p,y,g,v={};return{debug:()=>({...v}),init({userIdKey:w="hid",checkBlocked:b=!1,isCustom:S=!1,autoTrackPageview:x=!0,excludeContent:O=!1,useStoredTags:I=!0,customerId:N,fragmentEnabled:E=!1,onSuccess:C,onError:D,onSignupSuccess:$,onSignupError:_,onBeforeOverlayRender:V,overlayKeyValue:M,hostWebsiteType:F}={}){if(v={VERSION:"v1.0.1",...e,isCustom:S,userIdKey:w,checkBlocked:b,customerId:N,fragmentEnabled:E,overlays:{},sections:{},requestedSections:{},impressions:{},cleanJSON:[],autoTrackPageview:x,excludeContent:O,useStoredTags:I,onSuccess:C,onError:D,onSignupSuccess:$,onSignupError:_,onBeforeOverlayRender:V,overlayKeyValue:M},v.currhref=document.location.href,void 0===v.customerId)throw Error("Customer ID is required.");k.refreshNoCookies(),k.handleGDPR();const P=vi(v);F&&"spa"===F.toLowerCase()&&P.SPAHistoryHook(),t=P.fetchPersonalize;const A=T(v);n=A.click,r=A.impression,i=A.pageview,m=A.gdprDoNotTrack,p=A.cookiesDoNotTrack;const L=X(v);o=L.appendHearbeatListener;const j=Q(v);s=j.getCurrentUser,a=j.userSignUp,u=j.userSignUpConfirmedOptIn,l=j.addToCart,c=j.purchase,d=j.customEvent,y=j.watchContent;const U=Te();g=U.dismiss,h=Oi(v),f=ti(v),k.updatePageviewsCookie();const R=window.localStorage;return 1===k.getPageViewsCount()&&R.removeItem("sailthru-overlay-hit-count"),f.hideOverlay(),S?(x&&i(window.location.href),f.buildOverlayUrl().then(e=>t(e,window.location))):h.buildPersonalizeUrl(!1).then(e=>t(e,window.location)).then(()=>{k.isDoNotTrackUser()||o()})},personalize:e=>(k.handleGDPR(),h.personalize(e)),track(e,t){const s={...t},{sectionId:a,url:u,urls:l}=s,c=`Invalid event: ${e}. Please specify a valid event.`;switch(delete s.sectionId,delete s.url,delete s.urls,delete s.email,delete s.name,delete s.id,delete s.key,k.handleGDPR(),e){case"click":return n(a,u,s);case"impression":return r(a,l,s);case"pageview":return i(u,s).then(()=>{k.isDoNotTrackUser()||o()});case"gdprDoNotTrack":return m(e);case"cookiesDoNotTrack":return p(t);default:return console.error(c),c}},integration(e,t){const n={...t},{email:r,name:i,id:o,key:h="email"}=n,f={id:o||r,key:h},m=`Invalid event: ${e}. Please specify a valid event.`;switch(delete n.sectionId,delete n.url,delete n.urls,delete n.email,delete n.name,delete n.id,delete n.key,k.handleGDPR(),e){case"getCurrentUser":return s(n);case"userSignUp":return a(f,n);case"userSignUpConfirmedOptIn":return u(f,n);case"addToCart":return l(f,n);case"purchase":return c(f,n);case"watchContent":return y(f,n);case"customEvent":return d(i,f,n);default:return console.error(m),m}},overlay(e,t={}){const n=`Invalid event: ${e}. Please specify a valid event.`,{overlayId:r}=t;switch(e){case"dismiss":return g(r);case"hide":return f.hideOverlay();default:return console.error(n),n}}}})({trackDomain:"https://api.sail-track.com",personalizeDomain:"https://api.sail-personalize.com",overlayTrackDomain:"https://overlay-track.sailthru.cloud",assetsPath:"https://ak.sail-horizon.com/spm/",enableHeartbeat:!0}),_i=f.getCookie;return r})()); //# sourceMappingURL=spm.v1.min.js.map