var sdk=function(t){var n,e,r;!function(t){t.JSCondition="jsCondition",t.JSFunction="jsFunction",t.JSEvent="jsEvent",t.Selector="selector",t.ElementEvent="elementEvent",t.PageLoad="pageLoad",t.Timeout="timeout",t.Inactivity="inactivity",t.ExitIntent="exitIntent",t.Conjunction="conjunction"}(n||(n={})),function(t){t[t.PAUSED=4]="PAUSED"}(e||(e={})),function(t){t[t.LOCAL=0]="LOCAL",t[t.STAGE=1]="STAGE",t[t.PROD=2]="PROD",t[t.TEST=3]="TEST"}(r||(r={}));var i="lmi_preview";function o(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=Array(n);e=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(){return c=Object.assign?Object.assign.bind():function(t){for(var n=1;n=0&&!h(t)&&setTimeout(function(){h(t)||p(t,n-1)},e)}function y(){window.loomi_ctx=window.loomi_ctx||{}}function g(t){window.loomi_ctx.tagIds=window.loomi_ctx.tagIds||new Set;var n=h(function(){return window.loomi.conf&&window.loomi.conf.googleTags||[]},[]);v(n)?t.forEach(function(t){return window.loomi_ctx.tagIds.add(t)}):window.loomi_ctx.tagIds=new Set(n),window.loomi_ctx.gtags=window.loomi_ctx.gtags||[]}function _(t){return t.replace(/[^a-z_A-Z0-9]/gi,"_")}var S,E=function(){return h(function(){return window.Shopify.customerPrivacy.analyticsProcessingAllowed})||h(function(){return window.Shopify.customerPrivacy.userCanBeTracked})||h(function(){return window.visually.analyticsProcessingAllowed})},x={DEBUG:{name:"DEBUG",severity:10},INFO:{name:"INFO",severity:100},WARN:{name:"WARN",severity:1e3},ERROR:{name:"ERROR",severity:1e4},NONE:{name:"NONE",severity:1e4}};function k(){return S||(t=h(function(){return window.location.search.includes("lmi_debug")})?x.WARN:x.NONE,n={minLogLevel:t},Object.values(x).forEach(function(e){var r=e.name,i=e.severity;n[r.toLowerCase()]=function(){var n=[].slice.call(arguments);if(i>=t.severity&&n.length>0&&"NONE"!=t.name){var e,o=n[0],a=n.splice(1),c="[VSLY-"+r+"] "+o;if("DEBUG"===r||"INFO"===r)(e=console).log.apply(e,[c].concat(a));else if("WARN"===r){var u;(u=console).warn.apply(u,[c].concat(a))}else{var s;(s=console).error.apply(s,[c].concat(a))}}}}),S=n);var t,n}function I(){try{return!!h(function(){return h(function(){return new URL(window.location.href).searchParams.get(i)})||sessionStorage.getItem(i)})}catch(t){return k().error("failed getting lmi_preview for preview"),!1}}var A="lmi_type",N="lmi_from",T="lmi_class";function P(t,n){return t.includes(n,t.length-n.length)}function C(t,n,e,r){void 0===e&&(e=2e3),void 0===r&&(r=5);var i=0,o=0,a=!1;return function(){var c,u,s,l=Date.now();l-i=r&&!a&&(a=!0,void 0===c&&(c="counter"),void 0===u&&(u="sdk"),void 0===s&&(s="inc"),fetch("https://logs.loomi-prod.xyz/af3a0f80-908b-4602-9c31-535a453d2b3a/collect/"+c+"/"+u+"/"+n+"/"+s,{method:"POST",body:JSON.stringify({alias:window.loomi_ctx.storeAlias}),headers:{"Content-Type":"application/json; charset=UTF-8"}})):o=0,i=l,!a&&t().apply(void 0,[].slice.call(arguments))}}var b="lmi_utm_data",O={utm_source:"source",utm_medium:"medium",utm_campaign:"campaign",utm_term:"term",utm_content:"content"},j=function(t,n){void 0===n&&(n=3);for(var e=t,r=0;rt.ts?n:t},i[0]).campaign})||""}var R="vslyCT",V="vslySUBS",U="vslySID",M="vslyUID",J="loomi-cart-history",q="vsly_session";function B(t){return j((t||"").replace("+"," "))}function G(){var t=window.loomi_ctx.storeAlias,n=function(t,n){void 0===n&&(n=8397271938200529);for(var e,r=3735928559^n,i=1103547991^n,o=0;o>>16,2246822507)^Math.imul(i^i>>>13,3266489909),""+(4294967296*(2097151&(i=Math.imul(i^i>>>16,2246822507)^Math.imul(r^r>>>13,3266489909)))+(r>>>0))}(t+window.loomi_ctx.userId+d()+D()+X()),e=W();"VIVIWAND"!=t&&Y(e)&&(n=e.payload.sid||n);var r={id:n,utm_campaign:D(),last_interaction:new Date,landing_page:h(function(){return location.href},""),start_at:new Date};return F(r),r}function F(t){var n=JSON.stringify(t);localStorage.setItem(q,n),window.loomi_ctx.session=t}function H(){window.loomi_ctx=window.loomi_ctx||{};var t=window.loomi_ctx.session||h(function(){var t=JSON.parse(localStorage.getItem(q));return t.last_interaction=new Date(t.last_interaction),t.start_at=new Date(t.start_at),t})||G();return function(t){var n=new Date,e=t.last_interaction;return(n.valueOf()-e.valueOf())/6e4>30||B(D())!==B(t.utm_campaign)||t.last_interaction.getDate()!==n.getDate()}(t)&&(t=G()),window.loomi_ctx.session=t,t}function K(){var t=H();t.last_interaction=new Date,F(t)}var z,W=function(t){return h(function(){return JSON.parse(decodeURIComponent(escape(atob(h(function(){return new URLSearchParams(t||window.location.search)}).get("vsly-redirected-event")))))})},Y=function(t){if(!t)return!1;var n=h(function(){return t.ts});return!n||(new Date).valueOf()-n<36e5},X=function(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)};function $(t,n){if(!t&&!n)return!0;if(!t&&n)return!1;if(t&&!n)return!1;var e=Object.keys(t).sort(function(t,n){return t.localeCompare(n)}),r=Object.keys(n).sort(function(t,n){return t.localeCompare(n)});if(e.length!==r.length)return!1;for(var i,o=a(e);!(i=o()).done;){var c=i.value,u=t[c],s=n[c],l=Q(u)&&Q(s);if(l&&!$(u,s)||!l&&u!==s)return!1}return!0}function Q(t){return null!=t&&"object"==typeof t}function Z(t){return h(function(){return window.visually.flags[t]},!1)}!function(t){t.SIGNUP="SIGNUP",t.ADD_TO_CART="ADD_TO_CART",t.CHANGE_QTY="CHANGE_QTY",t.REMOVE_FROM_CART="REMOVE_FROM_CART",t.PAGE_LOAD="PAGE_LOAD",t.CLICK="CLICK",t.LOGIN="LOGIN",t.LOGOUT="LOGOUT",t.TIME_SPENT="TIME_SPENT",t.USE_CASE="USE_CASE"}(z||(z={}));var tt=new Map,nt=function(){return edgetag("getUserId")};function et(t){var n=t.trim();return/^[a-zA-Z0-9_\- .:|/]+$/.test(n)||(n=n.replace(/[^a-zA-Z0-9_\- .:|/]/g,"")),n.slice(0,250)}var rt,it,ot=[{name:"amplitude",track:function(t,n){m(function(){return!!h(function(){return window.amplitude.track})},100,100).then(function(){window.amplitude.track("Visually",{vslyExpId:t.use_case,vslyExpVarId:t.use_case_variant,vslyExpName:n.gaName,vslyExpVarName:n.gaVariant,vslyVersion:t.version})})}},{name:"clarity",track:function(t,n){m(function(){return!!window.clarity},100,100).then(function(){window.clarity("event","Visually_"+n.gaName+"_"+n.gaVariant+"_"+t.version)})}},{name:"contentsquare",track:function(t,n){window._uxa=window._uxa||[],window._uxa.push(["trackDynamicVariable",{key:"AB_VI_"+et(n.gaName),value:et(n.gaVariant)+"("+t.version+")"}])}},{name:"fullstory",track:function(t,n){m(function(){return!!window.FS},100,100).then(function(){window.FS("trackEvent",{name:"Visually",properties:{vslyExpId:t.use_case,vslyExpVarId:t.use_case_variant,vslyExpName:n.gaName,vslyExpVarName:n.gaVariant,vslyVersion:t.version}})})}},{name:"heatmap",track:function(t,n){h(function(){window.dataLayer=window.dataLayer||[],window.dataLayer.push({_heatmap_split_test:{platform:"visually",experimentId:t.use_case,experimentName:n.gaName,variantId:t.use_case_variant,variantName:n.gaVariant}})})}},{name:"hotjar",track:function(t,n){m(function(){return!!window.hj},100,100).then(function(){window.hj("event",et("vsly_"+n.gaName+"_"+n.gaVariant+"_"+t.version))})}},{name:"segment",track:function(t,n){m(function(){return!!h(function(){return window.analytics.track})},100,100).then(function(){window.analytics.track("Visually",{vslyExpId:t.use_case,vslyExpVarId:t.use_case_variant,vslyExpName:n.gaName,vslyExpVarName:n.gaVariant,vslyVersion:t.version})})}},{name:"shopify",track:function(t,n){m(function(){return!!h(function(){return window.Shopify.analytics.publish})},100,100).then(function(){window.Shopify.analytics.publish("Visually-Experience",{vslyExpId:t.use_case,vslyExpVarId:t.use_case_variant,vslyExpName:n.gaName,vslyExpVarName:n.gaVariant,vslyVersion:t.version})})}},{name:"triplewhale",track:function(t,n){m(function(){return!!h(function(){return window.TriplePixel})},100,100).then(function(){window.TriplePixel("custom","vslyExperience",{vslyExpId:t.use_case,vslyExpVarId:t.use_case_variant,vslyExpName:n.gaName,vslyExpVarName:n.gaVariant,vslyVersion:t.version})})}}],at=[],ct=function(t,n){if(void 0===n&&(n=0),0!==at.length){var e=at;at=[];var r=mt(e),i=dt(e);t({bulk:i,shared:r},!0).catch(function(){var r=e.concat(at);r.length<100&&(at=r,n<2&&setTimeout(function(){return ct(t,n+1)},500*Math.pow(2,n)))})}},ut=l(ct,100),st=!1;function lt(){st||(st=!0,function(t,n){void 0===t&&(t=function(){return window}),void 0===n&&(n=!1);try{var e=function(){return Promise.resolve()},r=n&&s()?Promise.resolve(m(function(){return u},1e3,10)).then(function(){}):Promise.resolve(m(function(){return void 0!==h(function(){return t().addEventListener})},10,1e3)).then(function(){});return Promise.resolve(r&&r.then?r.then(e):e())}catch(t){return Promise.reject(t)}}().then(function(){window.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState&&it&&at.length>0&&ct(it)})}))}var ft,dt=function(t){return t.map(function(t){var n=JSON.parse(JSON.stringify(t));return delete n.user,delete n.event_id,delete n.user_agent,delete n.utc_time,delete n.local_tz_offset,delete n.doc_host,delete n.ids_ga,delete n.alias,delete n.userCanBeTracked,delete n.userDataCanBeSold,delete n.edgetag,delete n.api_key,delete n.src,n})},mt=function(t){var n=h(function(){return String(t[0].user.anonymous_id)},""),e=h(function(){return String(t[0].user_agent)},""),r=h(function(){return String(t[0].event_id)},""),i=h(function(){return String(t[0].utc_time)},""),o=h(function(){return Number(t[0].local_tz_offset)||0}),a=h(function(){return String(t[0].doc_host)},""),c=h(function(){return String(t[0].ids_ga)},""),u=h(function(){return String(t[0].alias)},""),s=h(function(){return Boolean(t[0].userCanBeTracked)},!0),l=h(function(){return Boolean(t[0].userDataCanBeSold)},!0),f=h(function(){return String(t[0].edgetag)},""),d=h(function(){return String(t[0].api_key)},""),m=h(function(){return String(t[0].src)},"");return Object.entries({anonymous_id:n,event_id:r,user_agent:e,utc_time:i,local_tz_offset:o,doc_host:a,ids_ga:c,alias:u,userCanBeTracked:s,userDataCanBeSold:l,edgetag:f,api_key:d,src:m}).reduce(function(t,n){var e=n[1];if(e){if("undefined"===e)return t;t[n[0]]=e}return t},{})},vt=/*#__PURE__*/function(){function t(){this.trackingHost="",this.apiKey="",this.runningUseCases=new Set,this.getAnalyticsCtx=function(){return{}}}var n=t.prototype;return n.makeEvent=function(t,n,e){var r,i=this.getCtx(),o=(r="vsly_edgetag",p(function(){return nt()&&localStorage.setItem(r,nt()),!0}),h(nt)||localStorage.getItem(r));o&&(i.edgetag=o);var a=c({api_key:this.apiKey,src:n,event_type:t},e);return i=function(t,n){try{Object.keys(t).forEach(function(t){if(h(function(){return t.includes("_")})&&t.toUpperCase()===t){var e=h(function(){return t.split("_").map(function(t){return t.toLowerCase()})},[""]);switch(e.length){case 1:h(function(){return n[e[0]]})&&delete n[e[0]];break;case 2:h(function(){return n[e[0]][e[1]]})&&delete n[e[0]][e[1]];break;case 3:h(function(){return n[e[0]][e[1]][e[2]]})&&delete n[e[0]][e[1]][e[2]];break;case 4:h(function(){return n[e[0]][e[1]][e[2]][e[3]]})&&delete n[e[0]][e[1]][e[2]][e[3]]}}})}catch(e){k().error("vsly 666:"+w(n)+":"+w(t))}return n}(e,i),c({},i,a)},n.sendJson=function(t,n){void 0===n&&(n=!1);var e=this.trackingHost+"/api/s?token="+this.apiKey;n&&(e+="&bulk=1");try{var r=JSON.stringify(t),i=function(){return fetch(e,{method:"POST",body:r,headers:{"Content-Type":"text/plain"}})};if(r.length>65536)return i();if(!navigator.sendBeacon(e,new Blob([r],{type:"text/plain"})))return i()}catch(t){return Promise.reject(t)}return Promise.resolve()},n.getCtx=function(){var t,n,e=this,r=h(function(){return window.loomi_ctx.audiences}),i=new Date;return c({event_id:"",user:{anonymous_id:window.loomi_ctx.userId},user_agent:navigator.userAgent,utc_time:(t=i.toISOString(),n=t.split(".")[1],n?n.length>=7?t:t.slice(0,-1)+"0".repeat(7-n.length)+"Z":t),local_tz_offset:i.getTimezoneOffset(),url:window.location.href,doc_path:document.location.pathname,doc_host:document.location.hostname,doc_search:window.location.search,ids_ga:h(function(){return document.cookie.split(";").map(function(t){return t.split("=")}).find(function(t){return"_ga"==t[0].trim()})[1]},""),alias:window.loomi_ctx.storeAlias},r?{audiences:r.join("|")}:{},{sid:h(function(){return window.loomi_ctx.session.id}),sid_start:h(function(){return window.loomi_ctx.session.start_at.toISOString()})},h(function(){return e.getAnalyticsCtx()},{}),L())},n.track=function(t,n,e){try{var r=this;return Promise.resolve(m(function(){return!!h(function(){return!!window.loomi_ctx.storeAlias&&window.loomi_ctx.session.id})},200)).then(function(){return Promise.resolve(r.skipTracking()).then(function(i){if(i)return Promise.resolve();t===z.USE_CASE&&(function(t){Z("kill-ga")||t.isAudience||(Z("ga-use-store-data-layer")?function(t){try{var n=_(t.gaName),e=_(t.gaVariant),r="DL-"+n+"-"+e;return tt.has(r)||(tt.set(r,!0),m(function(){return!!window.dataLayer},100,10).then(function(){window.dataLayer.push({event:"VISUALLY",EXPERIENCE:n,VARIANT:e,non_interaction:!0})})),Promise.resolve()}catch(t){return Promise.reject(t)}}(t).catch():function(t){try{return y(),g(function(){for(var t=document.getElementsByTagName("script"),n=[],e=0;e0})}).flatMap(function(t){return t.elementTracking.map(function(n){return c({},n,{steps:n.steps||[],useCase:t.name,variant:t.variant,version:t.version,clientTargetingFormula:t.clientTargetingFormula})})})})||[]},St=function(t){return{event:t,selectors:t.steps.flatMap(function(t){return t.selectors})}},Et=function(t){return t.ordinal+"-"+t.version+"-"+t.useCase+"-"+t.variant},xt=function(){var t=gt();t&&h(function(){return localStorage.setItem("vsly-last-atc-sid",t)})};function kt(){return m(function(){return h(function(){return!!window.loomi.jitsu})},100,100)}function It(){if(h(function(){return void 0===window.loomi_ctx.cart})){var t=localStorage.getItem(Pt);if(t)try{window.loomi_ctx=c({},window.loomi_ctx||{},{cart:JSON.parse(t)})}catch(n){k().error("failed parsing cart",t)}}return h(function(){return window.loomi_ctx.cart})}var At=function(t,n,e,r,i,o){if(Dt(t)){var a=h(function(){return n.toUpperCase()});"POST"===a?Gt(e)?(kt().then(function(){return window.loomi.jitsu.track(z.ADD_TO_CART,Mt(r))}),jt(i,e,!e.includes("update")),xt()):function(t){return t.match(/^\/cart\/change.*/)||t.match(/^\/cart\/update.*/)&&!t.includes("vsly=t")||t.match(/cart\/(change|update)\.(js|json)$/)}(e)&&(function(t){var n=function(n){return kt().then(function(){return window.loomi.jitsu.track(n,t)})};if(!h(function(){return!t.qty})&&!h(function(){return!t.variantId})){var e=h(function(){return It().items.find(function(n){return n.id==t.variantId||n.variant_id==t.variantId}).quantity});if(e){var r=parseInt(t.qty);0!==r&&r!==e&&r>e&&(n(z.ADD_TO_CART),xt())}else n(z.CHANGE_QTY)}}(Mt(r)),jt(i,e)):"GET"!==a&&a||function(t){return t.match(/^\/cart\.json.*|^\/cart\.js.*|^\/cart.*/)||t.match(/cart\.(js|json)$/)}(e)&&i&&Rt(i)&&Ot(i)}},Nt=l(function(){return document.body.dispatchEvent(new CustomEvent("pdpresp"))},500),Tt=function(t,n,e){var r="/products/",i=["/collections/",r];Dt(t)&&(e||"").includes(r)&&h(function(){return!!i.find(function(t){return window.location.pathname.includes(t)})})&&!Z("kill-pdp-intercept")&&Nt()},Pt="loomi-cart",Ct=function(t){(function(t,n){var e=h(function(){var t=n.attributes,e=h(function(){return window.loomi_ctx.userId}),r=h(function(){return window.loomi_ctx.session.id},"");return!(!e||!r||t[R]&&t[M]===e&&t[U]===r)},!1);try{return void 0!==n&&(!$(t,n)||e)}catch(t){return!0}})(It(),t)&&(!0===h(function(){return window.visually.flags["sdk-enable-cart-enrichment"]},!1)?function(t){try{var n=function(){return Promise.resolve(t)};if(h(function(){return t.items.length<=0}))return Promise.resolve(t);var e=function(n,e){try{var r=(i=h(function(){return Array.from(t.items.map(function(t){return t.handle}))},[]).map(function(t){return{name:t,oneOf:{productInfo:{handle:t,includeCollections:!0,includeTags:!0}}}}),Promise.resolve(window.loomi_api.allocatorQuery({queries:i})).then(function(n){t.items=t.items.map(function(t){return t.tags=h(function(){return n.results[t.handle].tags},[]),t.collections=h(function(){return n.results[t.handle].collections},[]),t})}))}catch(t){return e(t)}var i;return r&&r.then?r.then(void 0,e):r}(0,function(n){yt("failed to enrich cart with error",n,t)});return Promise.resolve(e&&e.then?e.then(n):n())}catch(t){return Promise.reject(t)}}(t).then(function(t){Lt(t),pt(ft.CART_CHANGE,h(function(){return window.loomi_ctx.cart}))}):(Lt(t),pt(ft.CART_CHANGE,h(function(){return window.loomi_ctx.cart}))))},bt=l(Ct,400),Ot=function(t){!0===h(function(){return window.visually.flags["sdk-enable-cart-change-debounce"]},!1)?bt(t):Ct(t)};function jt(t,n,e){void 0===e&&(e=!0);var r=!Z("disable-update-cart-refresh")||e;Rt(t)&&r&&Ot(t),h(function(){return!n.includes("vsly=t")})&&Bt()}function Lt(t){(function(t){try{var n=function(t){return h(function(){return t.items.map(function(t){var n=t.quantity;return{price:t.price,variant_id:""+t.variant_id,product_id:""+t.product_id,sid:h(gt),quantity:n,timestamp:Ht()}})},[])}(t);e=function(t){var n=It(),e=JSON.parse(localStorage.getItem(J)||"[]"),r=h(function(){return e.map(function(t){return""+t.variant_id})});return h(function(){return t.forEach(function(t){var i=r.indexOf(""+t.variant_id);i<0?e=[t].concat(e):function(t,n){return h(function(){return t.items.find(function(t){return""+t.variant_id==""+n.variant_id}).quantity3)throw new Error("invalid event");window.loomi.jitsu.track("CUSTOM_EVENT",{clickid:"custom_"+t})},_n=function(t){return"string"==typeof t&&t.length<40},Sn="VSLY_STEPS_COMPLETED",En=function(){return vn||(vn=h(function(){return JSON.parse(sessionStorage.getItem(Sn))})||[]),vn=xn(vn)},xn=function(t){return t.filter(function(t){return new Date(t.ts)>new Date((new Date).getTime()-72e5)||t.sid===gt()}).slice(0,700)},kn=new Map,In=function(t){if(!An(t)&&!Z("kill-custom-events")){var n=Et(t),e=kn.get(n),r=(new Date).valueOf();if(!(e&&r-e<1e3)){kn.set(n,r),kn.forEach(function(t,n){r-t>1e3&&kn.delete(n)});var i=Cn();i[n]=t,bn(i),window.loomi.jitsu.track("CUSTOM_EXP_EVENT",{clickid:"event_"+t.ordinal,use_case:t.useCase,use_case_variant:t.variant,version:t.version}).then(function(){console.debug("vsly custom event: ",n),setTimeout(function(){var t=Cn();delete t[n],bn(t)},1e3)})}}},An=function(t){return!Number.isInteger(t.ordinal)||!Number.isInteger(t.version)||!t.useCase||!t.variant||t.ordinal>12||t.ordinal<0},Nn=function(){var t=Cn();Object.values(t).map(In),_t().filter(function(t){return t.code}).forEach(Tn)},Tn=function(t){var n,e;(n=window).loomi||(n.loomi={});var r=(e=window.loomi).exp_events||(e.exp_events=new Set),i=Et(t);r.has(i)||(h(function(){return new Function(t.code)()}),r.add(i))},Pn="VSLY_REPORT_EVENTS",Cn=function(){return JSON.parse(sessionStorage.getItem(Pn)||"{}")},bn=function(t){sessionStorage.setItem(Pn,JSON.stringify(t))},On=function(t,n){t.isTrusted&&jn(t).forEach(function(t){return _t().map(St).forEach(function(e){var r=e.event;e.selectors.filter(function(n){return t.matches(n)}).forEach(function(t){(function(t){try{return Promise.resolve(m(function(){return"function"==typeof window.loomi_ctx.shouldApply},100,100)).then(function(){return window.loomi_ctx.shouldApply(t)})}catch(t){return Promise.reject(t)}})(r.clientTargetingFormula).then(function(e){e&&(function(t,n){void 0===n&&(n="click");var e=gt(),r=En(),i=r.findIndex(function(e){return e.selector===t&&n===e.action});i>=0?(r[i].ts=new Date,r[i].sid=e):r.push({selector:t,action:n,sid:e,ts:new Date}),function(t){sessionStorage.setItem(Sn,JSON.stringify(t))}(r)}(t,n),function(t){var n=En(),e=t.steps.map(function(t){var e=h(function(){return n.find(function(n){return t.selectors.includes(n.selector)&&n.action===function(t){return"action"===t.action?"click":t.action}(t)}).ts});return e&&(e=new Date(e)),e}).filter(function(t){return t})||[];return e.length===t.steps.length&&e.every(function(t,n){return!n||t>e[n-1]})}(r)&&In(r))})})})})},jn=function(t,n){if(void 0===n&&(n=h(function(){return Array.from(new Set(_t().filter(function(t){return!!t.steps}).flatMap(function(t){return t.steps.flatMap(function(t){return t.selectors})})))})||[]),0===n.length)return[];for(var e,r=t.composedPath()||[],i=[],o=n.join(","),c=a(r);!(e=c()).done;){var u=e.value;u instanceof Element&&u.matches(o)&&i.push(u)}return i},Ln=Symbol("vslyClickAttached"),Dn=Symbol("vslyMouseOverAttached"),Rn=function(t){On(t,"click")},Vn=function(t){On(t,"hover")};function Un(){if("undefined"!=typeof window&&!window.vsly_analytics_init){var t=function(){var t={apiKey:"",storeAlias:"",env:0,shouldStart:!1};try{if(window.location.search.includes("lmi_no_init=1"))return t;if(h(function(){return window.loomi_ctx.jitsuKey})){var n=window.loomi_ctx,e=n.jitsuKey,r=n.storeAlias,i=n.env;return{apiKey:e,env:i,storeAlias:r,shouldStart:!!e&&!!i&&!!r}}var o=function(){for(var t,n=document.getElementsByTagName("script"),e=function(e){var r=h(function(){return n[e]});if(["sdk.loomi-prod.xyz/","live.visually-io.com/","sdk.loomi-stg.xyz/","assets.visually.io/"].some(function(t){return h(function(){return r.src.includes("https://"+t)})})&&r.src.includes("k="))return t=r,1},r=0;r20&&o.shift(),on(o)}else on([i])}}(n),location.pathname.includes("/account/")&&m(function(){return!!document.querySelector('form[action="proxy.php?url=/account"][method="post"]')},1e3,10).then(function(){var t=document.querySelector('form[action="proxy.php?url=/account"][method="post"]');console.debug("vsly-loyalty","Capturing account form submit",t),t&&t.addEventListener("submit",function(n){try{var e=function(){t.submit()},r=function(t,e){try{var r=(n.preventDefault(),Promise.resolve(sn()).then(function(){}))}catch(t){return e(t)}return r&&r.then?r.then(void 0,e):r}(0,function(t){console.error("vsly-loyalty","Error tracking signup",t)});return Promise.resolve(r&&r.then?r.then(e):e())}catch(t){return Promise.reject(t)}})}).catch(function(){}),Promise.resolve(i.track(z.PAGE_LOAD)).then(function(){var t,n;!function(t,n){try{var e=W(n);if(Y(e)){h(function(){return delete e.payload.now});var r=h(function(){return window.loomi_ctx.session.id});r&&(e.payload.sid=r),e.options.immediate=!0,t.track(e.type,e.payload,e.options)}}catch(t){console.error("vsly-sdk-redirection","Failed to track redirection event",t)}}(i,location.search),Bt(),window.loomi_ctx.maintainCartAttributes=mn,n=function(){return mn(It())},m(function(){return!!It()},500,10).then(n),(t=window).loomi_api||(t.loomi_api={}),window.loomi_api.trackClick=hn,window.loomi_api.trackCustomEvent=pn,function(t){try{return Promise.resolve(m(function(){return!!document.body})).then(function(){return Promise.resolve(m(function(){return!!h(function(){return window.loomi_ctx.session.id})})).then(function(){h(function(){t||(t=h(function(){return window.loomi.conf.custom_goals})||[]);var n=function(){return window.loomi.custom_goals};t.forEach(function(t){n()||(window.loomi.custom_goals=new Set),n().has(t.id)||(h(function(){return new Function(t.code)()}),n().add(t.id))})})})})}catch(t){return Promise.reject(t)}}(),function(){if(!Z("kill-custom-events")){h(Nn),function(){var t;(t=window).loomi_api||(t.loomi_api={}),window.loomi_api.trackExpEvent=In}();var t=window.document;t[Ln]||(t.addEventListener("click",Rn,!0),t[Ln]=1),t[Dn]||(t.addEventListener("mouseover",Vn,!0),t[Dn]=1)}}()})}if(!Z("kill-switch")&&!Z("kill-tracking")){var i=function(){if(!h(function(){return window.vslyNotShopify}))return Promise.resolve(function(t,n){void 0===t&&(t=100),void 0===n&&(n=100);try{return Promise.resolve(m(function(){return void 0!==window.ShopifyAnalytics},t,n)).then(function(){return"ok"})}catch(t){return Promise.reject(t)}}(100,100)).then(function(){})}();return i&&i.then?i.then(n):n()}}))}catch(t){return o(t)}return a&&a.then?a.then(void 0,o):a}(0,function(t){k().error("vsly","init failed",t)}))}catch(t){return Promise.reject(t)}}(n,i,e))}}return Un(),t.bootstrap=Un,t}({});