var bundle=(function(M){"use strict";function se(l,t){var o={};for(var e in l)Object.prototype.hasOwnProperty.call(l,e)&&t.indexOf(e)<0&&(o[e]=l[e]);if(l!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(l);n{var r,a,m;if(!c||typeof c!="object"||c.item_id==null)return c;const u=String(c.item_id);if(!u.trim())return c;const v=/^\d+$/.test(u),_=(m=(a=(r=c.p_id)!==null&&r!==void 0?r:c.parent_sku)!==null&&a!==void 0?a:c.item_group_id)!==null&&m!==void 0?m:c.product_id;if(v&&_!=null&&String(_).trim())return c;const f=i.filter(y=>(y==null?void 0:y.refId)!=null&&String(y.refId)===u||v&&(y==null?void 0:y.id)!=null&&String(y.id)===u),g=f[0];return!g||!/^\d+$/.test(String(g.id))||!/^\d+$/.test(String(g.productId))||f.some(y=>String(y.id)!==String(g.id)||String(y.productId)!==String(g.productId))?(s=!1,c):Object.assign(Object.assign({},c),{item_id:String(g.id),p_id:String(g.productId)})});return{data:e?Object.assign(Object.assign({},l),{ecommerce:Object.assign(Object.assign({},e),{items:d})}):Object.assign(Object.assign({},l),{items:d}),ready:s}}function Ce(l){let t=[],o;const e=(n=!0)=>{const i=t;t=[];const s=i.length?l():void 0;i.forEach(d=>{d(s,n)||t.push(d)}),!t.length&&o!==void 0&&(clearInterval(o),o=void 0)};return{flush:e,normalize(n,i,s){const d=(r,a)=>{const m=$e(n,r,i);return!a&&!m.ready?!1:(s(m.data),!0)};if(d(l(),!1)||(t.push(d),o!==void 0))return;const c=Date.now();o=setInterval(()=>e(Date.now()-c>=2e3),100)}}}const xe=["p-UFOIne7n"];function Le(l){return h(this,void 0,void 0,function*(){const t=import("https://openfpcdn.io/fingerprintjs/v4").then(a=>({agent:a.load(),hashComponents:a.hashComponents})),{agent:o,hashComponents:e}=yield t,i=yield(yield o).get();if(!xe.includes(l))return i.visitorId;const s=i.components,{applePay:d}=s,c=se(s,["applePay"]);return e(c)})}const Ue=["sV72lS4f5F"];function q(l){return Ue.includes(l)}const G=/[|\\]/,De=["source","campaign","adset","content","term"],Oe=new RegExp(`~~(?=(?:${De.join("|")})~)`);function de(l){var t,o;if(!l)return null;const e=l.split(Oe),n={};for(const s of e){const d=s.indexOf("~");if(d===-1)continue;const c=s.slice(0,d),r=s.slice(d+1);n[c]=r}const i={};if(n.source&&(i.utm_source=n.source),n.campaign){let s="",d="";if(n.source==="google"){const c=n.campaign.lastIndexOf("-");[s,d]=c!==-1?[n.campaign.slice(0,c),n.campaign.slice(c+1)]:[n.campaign,""]}else[s,d]=n.campaign.split(G)||[];i.utm_campaignName=s,i.utm_campaignId=d,i.utm_campaign=n.campaign}if(n.adset){const[s,d]=n.adset.split(G)||[];i.utm_adsetName=s,i.utm_adsetId=d,i.utm_medium=n.adset}if(n.content){const s=n.content.split(G)||[];for(;!((t=s[s.length-1])===null||t===void 0)&&t.startsWith("nemu_");)s.pop();let d=(o=s[s.length-1])!==null&&o!==void 0?o:null,c=s.slice(0,s.length-1).join("|");s.length===1&&(c=s[0],d=null),i.utm_adName=c,i.utm_adId=d,i.utm_content=c||d?`${c||""}\\${d||""}`:null}return n.term&&(i.googleKeyword=n.term),Object.keys(i).length?i:null}function Re(l){if(!l)return null;const t=l.match(/\/checkout\/confirmation\/(\d+)/);return t?t[1]:null}const Ae=["gruposbf","onelink"],Me=["p-UFOIne7n"],Pe=["purchase_ga4","purchase"],Fe=/^[A-Za-z0-9._-]{4,64}$/,X="__nmuEnterprisePurchaseClaims",Ke=()=>{const l=window;return l[X]=l[X]||{},l[X]};function je(l){if(typeof l!="string"&&typeof l!="number")return null;const t=String(l).trim();return Fe.test(t)?t:null}function He(l){var t,o,e,n;if(!l||typeof l!="object")return null;const i=l;if(typeof i.event!="string"||!Pe.includes(i.event))return null;const s=[(t=i.ecommerce)===null||t===void 0?void 0:t.transaction_id,(n=(e=(o=i.ecommerce)===null||o===void 0?void 0:o.purchase)===null||e===void 0?void 0:e.actionField)===null||n===void 0?void 0:n.id,i.transaction_id];for(const d of s){const c=je(d);if(c)return c}return null}function Ve(l,t,o){const e=()=>{};if(!l||!Array.isArray(t))return e;const n=Ke(),i=n[l];if((i==null?void 0:i.dataLayer)===t)return i.onTransactionId=o,e;const s={dataLayer:t,onTransactionId:o};n[l]=s;const d={},c=m=>{try{const u=He(m);if(!u||d[u])return;d[u]=!0,s.onTransactionId(u)}catch(u){}};t.slice().forEach(c);const r=t.push;if(typeof r!="function")return e;const a=function(...m){const u=r.apply(t,m);return m.forEach(c),u};return t.push=a,()=>{t.push===a&&(t.push=r),n[l]===s&&delete n[l]}}const We="dataLayer",ze=/^[A-Za-z_$][A-Za-z0-9_$]{0,63}$/,Be=["__proto__","prototype","constructor"];function le(l){if(typeof l!="string")return null;const t=l.trim();return!ze.test(t)||t===We||Be.includes(t)?null:t}function ce(l){const t=window;return t[l]===void 0&&(t[l]=[]),Array.isArray(t[l])?t[l]:null}const Z="__nmuCustomDataLayerClaims",ee=()=>{const l=window;return l[Z]=l[Z]||{},l[Z]},te=(l,t)=>`${l}:${t}`;function Qe(l,t,o,e){var n;const i=ee(),s=te(l,t);return((n=i[s])===null||n===void 0?void 0:n.dataLayer)===o?!1:(i[s]=Object.assign(Object.assign({},i[s]),{dataLayer:o,owner:e}),!0)}function oe(l,t){var o,e;return(e=(o=ee()[te(l,t)])===null||o===void 0?void 0:o.owner)!==null&&e!==void 0?e:null}function Ye(l,t,o,e){try{const n=oe(l,t);n&&typeof n.onScriptReinjected=="function"&&n.onScriptReinjected(o,e)}catch(n){}}function Je(l,t){const o=ee()[te(l,t)];return!o||o.hasRouteListener?!1:(o.hasRouteListener=!0,!0)}function qe(l,t){try{const o=oe(l,t);o&&typeof o.onRouteChange=="function"&&o.onRouteChange()}catch(o){}}const Ge={"p-UFOIne7n":["addToCart","pageView"]};function Xe(l,t){var o,e;return(e=(o=Ge[l])===null||o===void 0?void 0:o.includes(t))!==null&&e!==void 0?e:!1}const Ze="|",et=["_","-",".","~",":",";",","],tt=5,ot=/^\d+$/,ie=["|","\\"],it="-",nt=/(?:^|[|\\])nemu_[^|\\]*$/,rt=l=>l.replace(/[.*+?^${}()|[\]\\-]/g,"\\$&"),at={campaign:{key:"utm_campaign",nameKey:"utm_campaignName",idKey:"utm_campaignId"},adset:{key:"utm_medium",nameKey:"utm_adsetName",idKey:"utm_adsetId"},ad:{key:"utm_content",nameKey:"utm_adName",idKey:"utm_adId"}};function st(l,t){return!l||ie.includes(l)||!(l.length<=tt&&[...l].every(e=>et.includes(e)))?null:l}function dt(l,t){if(!l)return{name:null,id:null};const o=l.replace(nt,""),e=[...t,...ie].sort((a,m)=>m.length-a.length),n=new RegExp(e.map(rt).join("|"),"g");let i=null,s;for(;(s=n.exec(o))!==null;)i=s;if(!i)return{name:o||null,id:null};const d=o.slice(0,i.index)||null,c=o.slice(i.index+i[0].length)||null,r=ie.includes(i[0]);return c&&!r&&!ot.test(c)?{name:o,id:null}:{name:d,id:c}}function lt({name:l,id:t},o=Ze){return!l&&!t?null:t?`${l||""}${o}${t}`:l}function ct(l,t,o,{delimiter:e,isGoogle:n=!1}){const s=dt(t,l==="campaign"&&n?[e,it]:[e]),{key:d,nameKey:c,idKey:r}=at[l];o[c]=s.name,o[r]=s.id,o[d]=l==="ad"?s.name||s.id?`${s.name||""}\\${s.id||""}`:null:lt(s)}function ut(){var l,t;const o=["utm_source","utm_content","utm_medium","utm_campaign","uniqueId","solomon_email","solomon_phone","solomon_firstName","solomon_lastName","solomon_city","solomon_state","solomon_zip","solomon_country"],e=new Date(0).toUTCString(),n=(l=document.cookie.split("; ").find(r=>r.startsWith("utmsTrack=")))===null||l===void 0?void 0:l.split("=")[1],i=(t=document.cookie.split("; ").find(r=>r.startsWith("uniqueId=")))===null||t===void 0?void 0:t.split("=")[1];let s=null;try{s=localStorage.getItem("uniqueId")}catch(r){}const d=i||s;n&&d&&(document.cookie=`utmsTrack=${n.replace(d,"_")}; path=/;`),o.forEach(r=>{document.cookie=`${r}=; expires=${e}; path=/;`}),["utm_source","utm_medium","utm_campaign","utm_content","SolomonUserInternal","sol_email_sent","uniqueId"].forEach(r=>{try{localStorage.removeItem(r)}catch(a){}});try{window.SolomonUser=null,window.solomonCustomer=null}catch(r){}}function mt(l=5e3){return new Promise(t=>{var o;if(!((o=window.vtexjs)===null||o===void 0)&&o.checkout)return t(!0);const e=Date.now(),n=setInterval(()=>{var i;if(!((i=window.vtexjs)===null||i===void 0)&&i.checkout)return clearInterval(n),t(!0);if(Date.now()-e>=l)return clearInterval(n),t(!1)},100)})}function vt(l){return h(this,void 0,void 0,function*(){var t,o,e,n,i;try{if(!(yield mt(5e3))){C.error("[NEMU] window.vtexjs.checkout n\xE3o est\xE1 dispon\xEDvel ap\xF3s 5 segundos. A atualiza\xE7\xE3o foi cancelada.");return}const d=(e=(o=(t=window.vtexjs)===null||t===void 0?void 0:t.checkout)===null||o===void 0?void 0:o.orderForm)===null||e===void 0?void 0:e.orderFormId,r=(yield window.vtexjs.checkout.getOrderForm()).marketingData||{};if(!d){C.error("[NEMU] N\xE3o foi poss\xEDvel encontrar o orderFormId. A atualiza\xE7\xE3o foi cancelada.");return}const a=Object.assign(Object.assign({},r),{marketingTags:[...r.marketingTags,l.utm_term]});C.info("[NEMU] Atualizando o marketingData:",JSON.stringify(a,null,2)),(yield(i=(n=window.vtexjs)===null||n===void 0?void 0:n.checkout)===null||i===void 0?void 0:i.sendAttachment("marketingData",a))?C.info("[NEMU] marketingData da VTEX atualizado com sucesso!"):C.error("[NEMU] Falha ao atualizar o marketingData da VTEX")}catch(s){C.error("[NEMU] Ocorreu um erro inesperado ao tentar atualizar o marketingData da VTEX:",s)}})}function ue(l){const t=document.cookie.split(";");for(let o of t){const e=o.trim(),n=e.indexOf("=");if(n===-1)continue;const i=e.substring(0,n),s=e.substring(n+1);if(i===l&&s)return decodeURIComponent(s)}return null}function me(){const l=ue("checkout.vtex.com");return l?l.startsWith("__ofid=")?l.substring(7):l:ue("checkout.vtex.com__orderFormId")}function ve(l){try{const t=localStorage.getItem(l);if(!t)return null;const o=JSON.parse(t);if(o!=null&&o.id&&o.id!=="default-order-form")return o.id}catch(t){}return null}const _e=["WM_upfT9xx"],_t=1e3;let ne=!1;function z(l){var t;const o=((t=window.location)===null||t===void 0?void 0:t.pathname)||"";return!!l&&_e.includes(l)&&o.startsWith("/checkout")&&!o.includes("/orderPlaced")}function ft(l,t){var o;return!!l&&_e.includes(l)&&(((o=window.location)===null||o===void 0?void 0:o.pathname)||"").includes("/orderPlaced")&&!!t}function re(){var l,t,o;const e=(o=(t=(l=window.vtexjs)===null||l===void 0?void 0:l.checkout)===null||t===void 0?void 0:t.orderForm)===null||o===void 0?void 0:o.orderFormId;return!e||String(e).includes("order-form")?null:String(e)}function B(l,t){return z(t)?re()||ve(l)||me():ve(l)||me()}function ht(l,t,o){if(ne)return;ne=!0;let e=t,n=!1;const i=d=>h(this,void 0,void 0,function*(){if(!(!d||d.includes("order-form"))&&!(d===e||n)){n=!0,e=d;try{yield o(d)}catch(c){C.error("[NEMU] Falha ao atualizar o orderFormId observado no checkout:",c)}finally{n=!1}}}),s=setInterval(()=>{var d;if((((d=window.location)===null||d===void 0?void 0:d.pathname)||"").includes("/orderPlaced")){clearInterval(s),ne=!1;return}z(l)&&i(re())},_t)}const pt=1e3,gt=180*1e3;function yt(){var l,t,o;const e=((l=window.Yampi)===null||l===void 0?void 0:l.cart_token)||((o=(t=window.checkout)===null||t===void 0?void 0:t.orderPlaced)===null||o===void 0?void 0:o.token);return e?String(e):null}function St(){var l;return!!window.checkout||(((l=window.location)===null||l===void 0?void 0:l.pathname)||"").startsWith("/checkout")}function wt(l){let t=!1;const o=()=>{t=!0,clearInterval(e),clearTimeout(n)},e=setInterval(()=>{var i,s;const d=(s=(i=window.checkout)===null||i===void 0?void 0:i.orderPlaced)===null||s===void 0?void 0:s.token;d&&!t&&(o(),l(String(d)))},pt),n=setTimeout(o,gt)}function It(l){return h(this,void 0,void 0,function*(){const t=yt();if(t){yield l(t);return}St()&&wt(l)})}const Nt=1500;function fe(l,t,o){return new Promise(e=>{if(t!=="vtex")return e(null);const n=z(o),i=Date.now(),s=setInterval(()=>{const r=n&&Date.now()-i{clearInterval(s),e(B(l,o))},1e4)})}function j(l){return Array.isArray(l)?l.filter(t=>typeof t=="boolean"||!!t).map(j):l&&typeof l=="object"?Object.entries(l).reduce((t,[o,e])=>{const n=j(e);return n!=null&&n!==""&&(typeof n!="number"||!0)&&(typeof n!="boolean"||!0)&&(!Array.isArray(n)||n.length!==0)&&(typeof n!="object"||Object.keys(n).length!==0)?t[o]=n:delete t[o],t},Array.isArray(l)?[]:{}):l}function P(){const t=window.location.hostname.split(".");let o="",e="";return t.length>=3?(e=t.pop(),o=t.pop(),e==="br"&&(o=t.pop()+"."+o),o=o+"."+e):(e=t.pop(),o=t.pop()||"",o=o?o+"."+e:e),o="."+o,o}class C{static error(...t){}static warn(...t){}static info(...t){}}function he(l){var t,o;return l?typeof l=="string"?l:(l==null?void 0:l.message)||(l==null?void 0:l.name)||((o=(t=l==null?void 0:l.response)===null||t===void 0?void 0:t.data)===null||o===void 0?void 0:o.message)||(typeof(l==null?void 0:l.toString)=="function"?l.toString():"")||"":""}function pe(l){return((l==null?void 0:l.name)||"")==="AbortError"||/abort/i.test(he(l))}function kt(l){return/failed to fetch|load failed|networkerror|network request failed/i.test(he(l))}class V{static isJsonString(t){try{return JSON.parse(t),!0}catch(o){return!1}}setCookie(t,o,e,n){const i=typeof o=="object"?JSON.stringify(o):o,s=n?`; domain=${n}`:"";e?document.cookie=`${t}=${i}; expires=${e.toUTCString()}; path=/${s}`:document.cookie=`${t}=${i}; path=/${s}`}setEncodedCookie(t,o,e,n){const i=typeof o=="object"?JSON.stringify(o):o,s=encodeURIComponent(i),d=n?`; domain=${n}`:"";e?document.cookie=`${t}=${s}; expires=${e.toUTCString()}; path=/${d}`:document.cookie=`${t}=${s}; path=/${d}`}removeCookie(t,o){const e=new Date(0),n=o?`; domain=${o}`:"";document.cookie=`${t}=; expires=${e.toUTCString()}; path=/${n}`}hasCookiesEnabled(){let t=navigator.cookieEnabled;return(typeof navigator.cookieEnabled=="undefined"||!t)&&(document.cookie="check",t=document.cookie.indexOf("check")!==-1),t}getCookieByName(t){try{const e=`; ${document.cookie}`.split("; ").filter(n=>n);for(let n of e){const[i,s]=n.split("=");if(i===t){const d=s&&decodeURIComponent(s);return d?V.isJsonString(d)?JSON.parse(d):d:null}}}catch(o){return C.error("Error parsing cookie value:",o),null}}setLocalStorageItem(t,o){try{const e=typeof o=="object"?JSON.stringify(o):o;localStorage.setItem(t,e)}catch(e){C.error("Error setting localStorage item:",e)}}getLocalStorageItem(t){try{const o=localStorage.getItem(t);return o?V.isJsonString(o)?JSON.parse(o):o:null}catch(o){return C.error("Error getting localStorage item:",o),null}}removeLocalStorageItem(t){try{localStorage.removeItem(t)}catch(o){C.error("Error removing localStorage item:",o)}}}class Q{constructor(){this.MAX_PAYLOAD_SIZE_FOR_BEACON=65536}fetchWithRetry(t,o){return h(this,arguments,void 0,function*(e,n,i=1){try{return yield fetch(e,n)}catch(s){if(pe(s))throw s;if(kt(s)&&i>0)return this.fetchWithRetry(e,n,i-1);throw s}})}api(t){return h(this,arguments,void 0,function*(o,e="GET",n){const i=yield this.fetchWithRetry(o,Object.assign({method:e,headers:{"Content-Type":"application/json"}},n));let s;if(i.status!==204&&(s=yield i.json()),!i.ok)throw s;return s})}sendBeaconOrFetch(t,o){return h(this,void 0,void 0,function*(){const e=new Blob([o]).size;if(e{this.api(t,"GET").then(i=>{e(o?i[o]:i)}).catch(()=>n(void 0))})}createPromiseNoContentType(t,o){return new Promise((e,n)=>{this.apiNoContentType(t,"GET").then(i=>{e(o?i[o]:i)}).catch(()=>n(void 0))})}}class ge extends Q{constructor({baseURL:t}){super(),Object.assign(this,{baseURL:t})}sendInitateCheckoutEvent(t){return h(this,arguments,void 0,function*({trackingId:o,trackingSessionId:e,trackingSessionHistoryId:n}){return yield this.api(`${this.baseURL}/trackings/${o}/sessions/${e}/histories/${n}/initiate_checkout`,"POST",{})})}getLastBySessionId(t,o,e){return h(this,void 0,void 0,function*(){const n=e?`?${new URLSearchParams({nmubp:e}).toString()}`:"";return yield this.api(`${this.baseURL}/trackings/${t}/sessions/${o}/histories/last${n}`)})}updateNuvemshopId(t){return h(this,arguments,void 0,function*({trackingId:o,trackingSessionId:e,nuvemShopId:n}){try{return n?(yield this.api(`${this.baseURL}/trackings/${o}/sessions/${e}/histories/last`,"PUT",{body:JSON.stringify({nuvemShopId:n,vtexSessionId:n})}),!0):!1}catch(i){return C.error(JSON.stringify(i)),!1}})}updateVtexSessionId(t){return h(this,arguments,void 0,function*({trackingId:o,trackingSessionId:e,trackingSessionHistoryId:n,vtexSessionId:i}){for(let c=1;c<=3;c++)try{if(!i)return;const r={vtexSessionId:i};return n!=null&&(r.trackingSessionHistoryId=n),yield this.api(`${this.baseURL}/trackings/${o}/sessions/${e}/histories/last`,"PUT",{body:JSON.stringify(r)})}catch(r){if(C.error(`Attempt ${c} failed with 500 error. Retrying in 500ms...`),c<3)yield new Promise(a=>setTimeout(a,500));else{C.error("All 3 retry attempts failed.");return}}})}updateTraySessionId(t){return h(this,arguments,void 0,function*({trackingId:o,trackingSessionId:e,traySessionId:n}){try{return n?yield this.api(`${this.baseURL}/trackings/${o}/sessions/${e}/histories/last`,"PUT",{body:JSON.stringify({traySessionId:n})}):void 0}catch(i){C.error(JSON.stringify(i));return}})}add(t){return h(this,arguments,void 0,function*({sessionId:o,productData:e,trackingId:n,referrer:i,clientHash:s,clientId:d,facebookParams:c,platform:r,nmuBp:a,webPixelSessionId:m,href:u}){var v,_,f,g,y,I,S,N;const L=yield fe("orderform",r,n),x=!((_=(v=window==null?void 0:window.LS)===null||v===void 0?void 0:v.cart)===null||_===void 0)&&_.id?String((g=(f=window==null?void 0:window.LS)===null||f===void 0?void 0:f.cart)===null||g===void 0?void 0:g.id):null;let T=null;return!((I=(y=window==null?void 0:window.location)===null||y===void 0?void 0:y.pathname)===null||I===void 0)&&I.includes("efetuar-pagamento")&&(T=new URLSearchParams(window.location.search).get("key")||null),yield this.api(`${this.baseURL}/trackings/${n}/sessions/${o}/histories`,"POST",{body:JSON.stringify(Object.assign({referrer:i,origin:window.location.origin,href:u!=null?u:window.location.href,userAgent:navigator.userAgent,traySessionId:((S=document==null?void 0:document.documentElement)===null||S===void 0?void 0:S.getAttribute("data-session"))||((N=document==null?void 0:document.documentElement)===null||N===void 0?void 0:N.getAttribute("data-checkout-session_id")),vtexSessionId:L||x||T,nuvemShopId:x||T,clientId:d,clientHash:s,productData:e,nmuBp:a!=null?a:null,webPixelSessionId:m!=null?m:null},c))})})}}class bt extends Q{constructor({baseURL:t}){super(),Object.assign(this,{baseURL:t})}add(t){return h(this,arguments,void 0,function*({trackingId:o,productData:e,clientHash:n,referrer:i,clientId:s,nmuBp:d,webPixelSessionId:c}){var r,a,m,u,v,_,f,g;const y=B("orderform",o),I=!((a=(r=window==null?void 0:window.LS)===null||r===void 0?void 0:r.cart)===null||a===void 0)&&a.id?String((u=(m=window==null?void 0:window.LS)===null||m===void 0?void 0:m.cart)===null||u===void 0?void 0:u.id):null;let S=null;return!((_=(v=window==null?void 0:window.location)===null||v===void 0?void 0:v.pathname)===null||_===void 0)&&_.includes("efetuar-pagamento")&&(S=new URLSearchParams(window.location.search).get("key")||null),yield this.api(`${this.baseURL}/trackings/${o}/sessions`,"POST",{body:JSON.stringify({referrer:i,origin:window.location.origin,userAgent:navigator.userAgent,traySessionId:((f=document==null?void 0:document.documentElement)===null||f===void 0?void 0:f.getAttribute("data-session"))||((g=document==null?void 0:document.documentElement)===null||g===void 0?void 0:g.getAttribute("data-checkout-session_id")),vtexSessionId:y||I||S,nuvemShopId:I||S,clientId:s,clientHash:n,productData:e,nmuBp:d!=null?d:null,webPixelSessionId:c!=null?c:null})})})}getBy(t){return h(this,arguments,void 0,function*({trackingId:o,clientSessionId:e,clientHash:n}){try{const i=yield this.api(`${this.baseURL}/v2/trackings/${o}/sessions?clientHash=${n}&clientSessionId=${e}`);return!i||i.found===!1||!i.id?void 0:i}catch(i){return}})}}class K{static sanitizeQueryString(t){return t.replace(/\[[^\]]*\]/g,o=>o.replace(/&/g,"%26"))}constructor({full_url:t,delimiter:o}){this.utmNames=["utm_source","utm_campaign","utm_medium","utm_content"],this.utmNamesGa4=[...this.utmNames,"utm_term"],this.utmNamesNemu=["nemu_source","nemu_campaign","nemu_medium","nemu_content","nemu_adset"],this.hotmartUtmNames=["src","sck"],this.ga4Platforms=["shopify_ga4","nuvemshop_ga4","bagy_ga4","tray_ga4","magazord_ga4","shopify_plus_others_ga4","jetecommerce","wake_ga4","woocommerce_ga4","uappi_ga4"],this.delimiters=/[|\\]/,this.customDelimiter=null,this.full_url=window.location.search,this.paidPlatforms=["facebook","google","pinterest","tiktok"],this.utmsDefaultMappings={utm_campaign:(e,n,i)=>{const s=i==null?void 0:i.get(e);if(this.customDelimiter)return this.applyCustomDelimiter("campaign",s,n,i);let d="",c="";(i==null?void 0:i.get("utm_source"))==="google"?[d,c]=(s==null?void 0:s.split(/[|\\-]/))||[]:[d,c]=(s==null?void 0:s.split(/[|\\]/))||[],n.utm_campaignName=d,n.utm_campaignId=c,n[e]=s},utm_medium:(e,n,i)=>{const s=i==null?void 0:i.get(e);if(this.customDelimiter)return this.applyCustomDelimiter("adset",s,n,i);const[d,c]=(s==null?void 0:s.split(this.delimiters))||[];n.utm_adsetName=d,n.utm_adsetId=c,n[e]=s},utm_content:(e,n,i)=>{var s;const d=i==null?void 0:i.get(e);if(this.customDelimiter)return this.applyCustomDelimiter("ad",d,n,i);const c=(d==null?void 0:d.split(this.delimiters))||[];!((s=c[c.length-1])===null||s===void 0)&&s.startsWith("nemu_")&&c.pop();let r=c[c.length-1],a=c.slice(0,c.length-1).join("|");c.length===1&&(a=c[0],r=null),n.utm_adName=a,n.utm_adId=r,n[e]=a||r?`${a||""}\\${r||""}`:null}},this.utmsGa4Mappings={utm_campaign:(e,n,i)=>{const s=i==null?void 0:i.get(e);if(this.customDelimiter)return this.applyCustomDelimiter("campaign",s,n,i);let d="",c="";(i==null?void 0:i.get("utm_source"))==="google"?[d,c]=(s==null?void 0:s.split(/[|\\-]/))||[]:[d,c]=(s==null?void 0:s.split(/[|\\]/))||[],n.utm_campaignName=d,n.utm_campaignId=c,n[e]=s},utm_content:(e,n,i)=>{var s;const d=i==null?void 0:i.get(e);if(this.customDelimiter)return this.applyCustomDelimiter("ad",d,n,i);const c=(d==null?void 0:d.split(this.delimiters))||[];!((s=c[c.length-1])===null||s===void 0)&&s.startsWith("nemu_")&&c.pop();let r=c[c.length-1],a=c.slice(0,c.length-1).join("|");c.length===1&&(a=c[0],r=null),n.utm_adName=a,n.utm_adId=r,n[e]=a||r?`${a||""}\\${r||""}`:null},utm_medium:(e,n,i)=>{const s=i==null?void 0:i.get(e);if(!this.paidPlatforms.includes(i==null?void 0:i.get("utm_source"))&&s!=="cpc"||this.paidPlatforms.includes(i==null?void 0:i.get("utm_source"))&&!(i!=null&&i.get("utm_term"))&&s!=="cpc"){if(this.customDelimiter)return this.applyCustomDelimiter("adset",s,n,i);const d=(s==null?void 0:s.split(this.delimiters))||[];let c=d[d.length-1]||"",r=d.slice(0,d.length-1).join("|")||"";n.utm_adsetName=r,n.utm_adsetId=c,n[e]=s}},utm_term:(e,n,i)=>{const s=i==null?void 0:i.get(e);if(n.utm_source==="google"){const d=(s==null?void 0:s.split("_"))||[];let c=d[d.length-1],r=d.slice(0,d.length-1).join("_");d.length===1&&(r=d[0],c=null),n.googleKeyword=r,n.utm_medium=c||null,n.utm_adsetName=c}else{if(this.customDelimiter)return this.applyCustomDelimiter("adset",s,n,i);const d=(s==null?void 0:s.split(this.delimiters))||[];let c=d[d.length-1],r=d.slice(0,d.length-1).join("|");d.length===1&&(r=d[0],c=null),n.utm_adsetName=r,n.utm_adsetId=c,n.utm_medium=r||c?`${r||""}|${c||""}`:null}}},this.utmsNemuMappings={nemu_campaign:(e,n,i)=>{const s=i==null?void 0:i.get(e);if(this.customDelimiter)return this.applyCustomDelimiter("campaign",s,n,i);let d="",c="";(i==null?void 0:i.get("utm_source"))==="google"?[d,c]=(s==null?void 0:s.split(/[|\\-]/))||[]:[d,c]=(s==null?void 0:s.split(/[|\\]/))||[],n.utm_campaignName=d,n.utm_campaignId=c,n.utm_campaign=s},nemu_medium:(e,n,i)=>{const s=i==null?void 0:i.get(e);if(this.customDelimiter)return this.applyCustomDelimiter("adset",s,n,i);const[d,c]=(s==null?void 0:s.split(this.delimiters))||[];n.utm_adsetName=d,n.utm_adsetId=c,n.utm_medium=s},nemu_adset:(e,n,i)=>{const s=i==null?void 0:i.get(e);if(this.customDelimiter)return this.applyCustomDelimiter("adset",s,n,i);const[d,c]=(s==null?void 0:s.split(this.delimiters))||[];n.utm_adsetName=d,n.utm_adsetId=c,n.utm_medium=s},nemu_content:(e,n,i)=>{var s;const d=i==null?void 0:i.get(e);if(this.customDelimiter)return this.applyCustomDelimiter("ad",d,n,i);const c=(d==null?void 0:d.split(this.delimiters))||[];!((s=c[c.length-1])===null||s===void 0)&&s.startsWith("nemu_")&&c.pop();let r=c[c.length-1],a=c.slice(0,c.length-1).join("|");c.length===1&&(a=c[0],r=null),n.utm_adName=a,n.utm_adId=r,n.utm_content=a||r?`${a||""}\\${r||""}`:null},nemu_source:(e,n,i)=>{n.utm_source=i.get(e)}},Object.assign(this,{full_url:t,customDelimiter:st(o)})}applyCustomDelimiter(t,o,e,n){ct(t,o,e,{delimiter:this.customDelimiter,isGoogle:(n==null?void 0:n.get("utm_source"))==="google"})}getUtmFormats(){return this.utmNames.concat(this.hotmartUtmNames)}static extractHostname(t){try{return new URL(t).hostname}catch(o){return null}}static extractOrigin(t){var o;try{return(o=new URL(t))===null||o===void 0?void 0:o.origin}catch(e){return null}}isReferrerFromInternalSource(){const t=K.extractHostname(document.referrer);if(!t)return!1;const o=this.getMainDomainHostname(t),e=this.getMainDomainHostname(window.location.hostname);return o===e}isReferrerBlacklisted(t){if(!t)return!1;const o=this.getMainDomainHostname(t);return o?Ae.includes(o):!1}getMainDomainHostname(t){if(!t)return null;t=t.toLowerCase().trim(),t.startsWith("www.")&&(t=t.slice(4));const o=t.split("."),e=["com.br","net.br","org.br","gov.br","co.uk","org.uk","com.au","co.jp","com.cn","com.br/","net.br/","org.br/","gov.br/","co.uk/","org.uk/","com.au/","co.jp/","com.cn/"],n=o.slice(-2).join(".");return o.slice(-3).join("."),e.includes(n)&&o.length>=3?o[o.length-3]:o[o.length-2]}isPageReloaded(){if(typeof performance=="undefined"||typeof performance.getEntriesByType!="function")return this.checkLegacyNavigationType();const t=performance.getEntriesByType("navigation");return t.length===0?this.checkLegacyNavigationType():t[0].type==="reload"}checkLegacyNavigationType(){const t=performance.navigation;return(t==null?void 0:t.type)===1}getHotmartSourceName(){const t=new URLSearchParams(this.full_url),o=["src","sck"];let e;return o.find(n=>{t.has(n)&&(e=n)}),e}isHotmartUtmsValid(t,o=window.location.search){var e,n;const i=new URLSearchParams(K.sanitizeQueryString(o));let[s,d,c,r]=(n=(e=i.get(t))===null||e===void 0?void 0:e.split("|"))!==null&&n!==void 0?n:[];const a=j({utm_source:s,utm_medium:d,utm_campaign:c,utm_content:r});return!(!(a!=null&&a.utm_source)&&!(a!=null&&a.utm_medium)&&!(a!=null&&a.utm_campaign)&&!(a!=null&&a.utm_content))}containsHotmartSourceInUrl(){const t=this.getHotmartSourceName();return!!(t&&this.isHotmartUtmsValid(t,this.full_url))}containsUTMsInQueryParams(t){const o=new URLSearchParams(this.full_url);if(C.info(o,"url",this.full_url),q(t)){const n=o.get("utm_term");if(n&&de(n))return!0}if(this.containsHotmartSourceInUrl())return!0;const e=this.utmNames.concat(this.utmNamesNemu);if(Array.from(o.keys()).some(n=>e.includes(n)))return!0;if(t==="Ss-hu8loFI"){let n=this.getUtmsFromCookie("nemu:utmsTrackHistory");if(n){try{n=JSON.parse(n)}catch(i){return!1}for(const i of this.utmNames)if(n[i])return!0}}return!1}extractUTMsFromQueryParams(t,o){var e,n,i,s;let d={};const c=new URLSearchParams(this.full_url);if(q(o)){const r=c.get("utm_term"),a=r?de(r):null;if(a)return Object.assign(Object.assign({},d),a)}if(this.containsHotmartSourceInUrl()&&t==="hotmart"&&(d=ae.parseHotmartUTMs(this.getHotmartSourceName(),this.full_url)),this.ga4Platforms.includes(t)){for(let r of this.utmNamesGa4)if(c.has(r)){const a=(e=this.utmsGa4Mappings)===null||e===void 0?void 0:e[r];if(a){a(r,d,c);continue}d[r]=c.get(r)}}else{for(let r of this.utmNames)if(c.has(r)){const a=(n=this.utmsDefaultMappings)===null||n===void 0?void 0:n[r];if(a){a(r,d,c);continue}d[r]=c.get(r)}for(let r of this.utmNamesNemu)if(c.has(r)&&(!((i=c.get(r))===null||i===void 0)&&i.trim())){const a=(s=this.utmsNemuMappings)===null||s===void 0?void 0:s[r];if(a){a(r,d,c);continue}d[r]=c.get(r)}}if(!this.ga4Platforms.includes(t)&&d.utm_source==="google"){const r=c.get("utm_term");d.googleKeyword=r}if(o==="Ss-hu8loFI"&&Object.keys(d).length===0){let r=this.getUtmsFromCookie("nemu:utmsTrackHistory");if(r){try{r=JSON.parse(r)}catch(a){return d}for(let a of this.utmNames)if(r[a]){const m={utm_campaign:()=>{const v=r[a];let _="",f="";(c==null?void 0:c.get("utm_source"))==="google"?[_,f]=(v==null?void 0:v.split(/[|\\-]/))||[]:[_,f]=(v==null?void 0:v.split(/[|\\]/))||[],d.utm_campaignName=_,d.utm_campaignId=f,d[a]=v},utm_medium:()=>{const v=r[a],[_,f]=(v==null?void 0:v.split(this.delimiters))||[];d.utm_adsetName=_,d.utm_adsetId=f,d[a]=v},utm_content:()=>{var v;const _=r[a],f=(_==null?void 0:_.split(this.delimiters))||[];!((v=f[f.length-1])===null||v===void 0)&&v.startsWith("nemu_")&&f.pop();let g=f[f.length-1],y=f.slice(0,f.length-1).join("|");f.length===1&&(y=f[0],g=null),d.utm_adName=y,d.utm_adId=g,d[a]=y||g?`${y||""}\\${g||""}`:null}},u=m==null?void 0:m[a];if(u){u();continue}d[a]=r[a]}r.alreadySent=!0,this.setUtmsFromCookie(r)}}return d}getFacebookParams(t){const o=new URLSearchParams(window.location.search),e=t.getCookieByName("_fbc"),n=t.getCookieByName("_fbp");return{fbclid:o==null?void 0:o.get("fbclid"),fbc:e,fbp:n,fbpUnix:this.generateUnix(),fbcUnix:this.generateUnix()}}generateUnix(){const t=new Date().toLocaleString("en-US",{timeZone:"America/Sao_Paulo"}),o=Math.floor(new Date(t).getTime()/1e3);return String(o)}getUtmsFromCookie(t){for(var o=t+"=",e=document.cookie.split(";"),n=0;n=3){var d=s.pop(),c=s.pop();d==="br"&&(c=s.pop()+"."+c),c=c+"."+d}else d=s.pop(),c=s.pop(),c=c+"."+d;document.cookie="nemu:utmsTrackHistory="+o+"; domain="+c+"; path=/; "+n}}class ye{constructor({platforms:t}){Object.assign(this,{platforms:t})}referrerContainsPlatform(t){var o;const e=(o=this.platforms)===null||o===void 0?void 0:o.find(n=>t==null?void 0:t.includes(n.name));return e?e.name:null}}class ae{constructor({scanner:t,platformsFilter:o,sessionHistoryService:e,storage:n}){Object.assign(this,{scanner:t,platformsFilter:o,sessionHistoryService:e,storage:n})}waitForMagazordOrderId(t,o){const e="#checkout-main-area > div.container > div > div.ctn-info.flex > div.box-info.flex.column > div.detalhes.pedido.flex.column > div > div > div:nth-child(1) > span.value";let n=!1;const i=setInterval(()=>h(this,void 0,void 0,function*(){var s,d;try{const c=(d=(s=document.querySelector(e))===null||s===void 0?void 0:s.textContent)===null||d===void 0?void 0:d.trim();c&&!n&&(n=!0,yield this.sessionHistoryService.updateNuvemshopId({trackingId:t,trackingSessionId:o,nuvemShopId:c}),clearInterval(i))}catch(c){n=!1,C.error(c)}}),500);setTimeout(()=>clearInterval(i),3e4)}parseUTMSrc({utm_source:t}){const o=t==null?void 0:t.endsWith("_organic"),e=K.extractHostname(document.referrer),n=this.scanner.getMainDomainHostname(e),s=!this.scanner.isReferrerBlacklisted(e)&&n&&n!==this.scanner.getMainDomainHostname(window.location.hostname),d=()=>{if(!s||o)return!1;const c=new URLSearchParams(document.referrer),r=this.scanner.getUtmFormats();for(let a of r)if(c.has(a))return!1;return!0};return t||(s?`${n}${d()?"_organic":""}`:"direct")}static parseHotmartUTMs(t,o=window.location.search){var e,n;const i=new URLSearchParams(o);let[s,d,c,r,a,m,u,v]=(n=(e=i==null?void 0:i.get(t))===null||e===void 0?void 0:e.split("|"))!==null&&n!==void 0?n:[];return{utm_source:s,utm_medium:`${d||""}|${m||""}`,utm_campaign:`${c||""}|${a||""}`,utm_content:`${r||""}|${u||""}`,utm_campaignId:a,utm_campaignName:c,utm_adsetId:m,utm_adsetName:d,utm_adId:u,utm_adName:r,utm_term:v}}applyDefaultUtmsToQueryParams(t,o){for(const e of this.scanner.utmNames)if(e==="utm_content"){const n=`${(o==null?void 0:o.utm_adName)||""}|${(o==null?void 0:o.utm_adId)||""}|${(o==null?void 0:o.utm_term)||""}`;t.set(e,n||"")}else o[e]&&t.set(e,o[e]||"");o.googleKeyword&&t.set("utm_term",o.googleKeyword||"")}parseUTMsToQueryParams(t){return h(this,arguments,void 0,function*({tracking:o,utms:e,webPixelData:n}){const i=new URLSearchParams(window.location.search),s=["src","sck"];i.get("utm_source")!=="google"&&i.delete("utm_term");for(const r of s)i!=null&&i.has(r)&&i.delete(r);for(const r of this.scanner.utmNames)i!=null&&i.has(r)&&i.delete(r);const d={hotmart:()=>{const r=`${(e==null?void 0:e.utm_source)||""}|${(e==null?void 0:e.utm_adsetName)||""}|${(e==null?void 0:e.utm_campaignName)||""}|${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_campaignId)||""}|${(e==null?void 0:e.utm_adsetId)||""}|${(e==null?void 0:e.utm_adId)||""}|${(e==null?void 0:e.utm_term)||""}`;document.cookie=`utmsTrack=${o==null?void 0:o.sourceType}=${r}; path=/`,i.set(o==null?void 0:o.sourceType,r)},vega:()=>{const r={utm_campaign:()=>`${(e==null?void 0:e.utm_campaignName)||""}\\${(e==null?void 0:e.utm_campaignId)||""}`,utm_medium:()=>`${(e==null?void 0:e.utm_adsetName)||""}\\${(e==null?void 0:e.utm_adsetId)||""}`,utm_content:()=>`${(e==null?void 0:e.utm_adName)||""}\\${(e==null?void 0:e.utm_adId)||""}\\${e==null?void 0:e.utm_term}`};for(const a of this.scanner.utmNames)if(a==="utm_content"){const m=r[a]();i.set(a,m)}else if(e[a]){const m=r[a],u=m?m():e[a];i.set(a,u||"")}e.googleKeyword&&i.set("utm_term",e.googleKeyword||"")},others:()=>{for(const r of this.scanner.utmNames)if(r==="utm_content"){const a=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${e==null?void 0:e.utm_term}`;i.set(r,a||"")}else e[r]&&i.set(r,e[r]||"");if(e.googleKeyword&&i.set("utm_term",e.googleKeyword||""),q(o.id)){const{sessionHistoryService:r}=this;let a=!1;const m=setInterval(()=>h(this,void 0,void 0,function*(){try{const u=Re(window.location.pathname);u&&!a&&(a=!0,(yield r.updateNuvemshopId({trackingId:o.id,trackingSessionId:e.trackingSessionId,nuvemShopId:u}))?clearInterval(m):a=!1)}catch(u){a=!1,C.error(u)}}),500);setTimeout(()=>clearInterval(m),3e5)}},enterprise:()=>{for(const u of this.scanner.utmNames)if(u==="utm_content"){const v=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${e==null?void 0:e.utm_term}`;i.set(u,v||"")}else e[u]&&i.set(u,e[u]||"");e.googleKeyword&&i.set("utm_term",e.googleKeyword||"");const{sessionHistoryService:r}=this,a=le(o.dataLayerName);a||(window.dataLayer=window.dataLayer||[]);const m=a?ce(a):window.dataLayer;Ve(o.id,m,u=>{u!==(e==null?void 0:e.vtexSessionId)&&h(this,void 0,void 0,function*(){try{yield r.updateVtexSessionId({trackingId:o.id,trackingSessionId:e.trackingSessionId,trackingSessionHistoryId:e.id,vtexSessionId:u})}catch(v){C.error(JSON.stringify(v))}})})},shopify_plus_others:()=>{const{getCookieByName:r}=this.storage,{sessionHistoryService:a}=this;function m(){return new Promise(u=>h(this,void 0,void 0,function*(){const v=setInterval(()=>h(this,void 0,void 0,function*(){let _=r("cart")?r("cart").split("?")[0]:"",f=localStorage.getItem("trackedSourceId")||localStorage.getItem("cartToken");const g=_||f||null;if(g!==null)return clearInterval(v),yield a.updateNuvemshopId({trackingId:o.id,trackingSessionId:e.trackingSessionId,nuvemShopId:g}),u(!0)}),500)}))}m();for(const u of this.scanner.utmNames)if(u==="utm_content"){const v=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${e==null?void 0:e.utm_term}`;i.set(u,v||"")}else e[u]&&i.set(u,e[u]||"");e.googleKeyword&&i.set("utm_term",e.googleKeyword||"")},shopify_plus_others_ga4:()=>{const{getCookieByName:r}=this.storage,{sessionHistoryService:a}=this;function m(){return new Promise(u=>h(this,void 0,void 0,function*(){const v=setInterval(()=>h(this,void 0,void 0,function*(){let _=r("cart")?r("cart").split("?")[0]:"",f=localStorage.getItem("trackedSourceId")||localStorage.getItem("cartToken");const g=_||f||null;if(g!==null)return clearInterval(v),yield a.updateNuvemshopId({trackingId:o.id,trackingSessionId:e.trackingSessionId,nuvemShopId:g}),u(!0)}),500)}))}m();for(const u of this.scanner.utmNames){if(u==="utm_content"){const v=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}`;i.set(u,v||"")}else e[u]&&i.set(u,e[u]||"");if(i.set("utm_medium","cpc"),e.utm_medium)if(e.utm_source==="google"){const v=e.googleKeyword||"";i.set("utm_term",`${v}_${e.utm_medium}`)}else i.set("utm_term",e.utm_medium)}},nuvemshop:()=>h(this,void 0,void 0,function*(){var r,a,m,u;const v="12106";yield this.sessionHistoryService.updateNuvemshopId({trackingId:o.id,trackingSessionId:e.trackingSessionId,nuvemShopId:!((a=(r=window==null?void 0:window.LS)===null||r===void 0?void 0:r.cart)===null||a===void 0)&&a.id?String((u=(m=window==null?void 0:window.LS)===null||m===void 0?void 0:m.cart)===null||u===void 0?void 0:u.id):null});for(const f of this.scanner.utmNames)if(f==="utm_content"){const g=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${e==null?void 0:e.utm_term}`;i.set(f,g||"")}else e[f]&&i.set(f,e[f]||"");e.googleKeyword&&i.set("utm_term",e.googleKeyword||"");const _=U.extractUtmsFromQueryParams(i.toString());localStorage.setItem(`app-${v}-nemu:utmsTrack`,`${JSON.stringify({value:_})}`)}),tray:()=>h(this,void 0,void 0,function*(){var r,a;yield this.sessionHistoryService.updateTraySessionId({trackingId:o.id,trackingSessionId:e.trackingSessionId,traySessionId:((r=document==null?void 0:document.documentElement)===null||r===void 0?void 0:r.getAttribute("data-session"))||((a=document==null?void 0:document.documentElement)===null||a===void 0?void 0:a.getAttribute("data-checkout-session_id"))});for(const m of this.scanner.utmNames)if(m==="utm_content"){const u=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${e==null?void 0:e.utm_term}`;i.set(m,u||"")}else e[m]&&i.set(m,e[m]||"");e.googleKeyword&&i.set("utm_term",e.googleKeyword||"")}),tray_ga4:()=>h(this,void 0,void 0,function*(){var r,a;yield this.sessionHistoryService.updateTraySessionId({trackingId:o.id,trackingSessionId:e.trackingSessionId,traySessionId:((r=document==null?void 0:document.documentElement)===null||r===void 0?void 0:r.getAttribute("data-session"))||((a=document==null?void 0:document.documentElement)===null||a===void 0?void 0:a.getAttribute("data-checkout-session_id"))});for(const m of this.scanner.utmNames){if(m==="utm_content"){const u=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}`;i.set(m,u||"")}else e[m]&&i.set(m,e[m]||"");if(i.set("utm_medium","cpc"),e.utm_medium)if(e.utm_source==="google"){const u=e.googleKeyword||"";i.set("utm_term",`${u}_${e.utm_medium}`)}else i.set("utm_term",e.utm_medium)}}),shopify_ga4:()=>h(this,void 0,void 0,function*(){var r;const{getCookieByName:a}=this.storage,{sessionHistoryService:m}=this;function u(){return new Promise(_=>h(this,void 0,void 0,function*(){const f=setInterval(()=>h(this,void 0,void 0,function*(){let g=a("cart")?a("cart").split("?")[0]:"",y=localStorage.getItem("trackedSourceId")||localStorage.getItem("cartToken");const I=g||y||null;if(I!==null)return clearInterval(f),yield m.updateNuvemshopId({trackingId:o.id,trackingSessionId:e.trackingSessionId,nuvemShopId:I}),_(!0)}),500)}))}u();const v=new URLSearchParams;for(const _ of this.scanner.utmNames){if(_==="utm_content"){const N=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}`;i.set(_,N||""),v.set(_,`${N}|${(e==null?void 0:e.utm_term)||""}`||"")}else e[_]&&(i.set(_,e[_]||""),v.set(_,e[_]||""));if(e.utm_medium)if(e.utm_source==="google"){const N=e.utm_campaign||"";i.set("utm_campaign",`${N}_${e.utm_medium}`),i.set("utm_medium","cpc")}else["facebook","google","tiktok","pinterest"].includes(e.utm_source)?(i.set("utm_medium","cpc"),i.set("utm_term",e.utm_medium)):i.set("utm_medium",e.utm_medium);e.googleKeyword&&(i.set("utm_term",e.googleKeyword||""),v.set("utm_term",e.googleKeyword||""));const f=new Date;f.setDate(f.getDate()+30);const g=(r=document.cookie.split("; ").find(N=>N.startsWith("utmsTrack=")))===null||r===void 0?void 0:r.split("=")[1],y=v.toString(),I=g==null?void 0:g.includes("nemu_"),S=y.includes("nemu_");(!I||S)&&(document.cookie=`utmsTrack=${y}; expires=${f.toUTCString()}; path=/; SameSite=Lax; Secure`,localStorage.setItem("nemu:utmsTrack",y))}}),nuvemshop_ga4:()=>h(this,void 0,void 0,function*(){var r,a,m,u;yield this.sessionHistoryService.updateNuvemshopId({trackingId:o.id,trackingSessionId:e.trackingSessionId,nuvemShopId:!((a=(r=window==null?void 0:window.LS)===null||r===void 0?void 0:r.cart)===null||a===void 0)&&a.id?String((u=(m=window==null?void 0:window.LS)===null||m===void 0?void 0:m.cart)===null||u===void 0?void 0:u.id):null});for(const v of this.scanner.utmNames){if(v==="utm_content"){const _=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}`;i.set(v,_||"")}else e[v]&&i.set(v,e[v]||"");if(["facebook","google","tiktok","pinterest"].includes(e.utm_source)&&i.set("utm_medium","cpc"),e.utm_medium)if(e.utm_source==="google"){const _=e.utm_campaign||"";i.set("utm_campaign",`${_}_${e.utm_medium}`)}else i.set("utm_term",e.utm_medium);e.googleKeyword&&i.set("utm_term",e.googleKeyword||"")}}),bagy:()=>{const r=new Date,a={utm_source:e==null?void 0:e.utm_source,utm_campaign:e==null?void 0:e.utm_campaign,utm_medium:e==null?void 0:e.utm_medium,utm_content:e==null?void 0:e.utm_content,utm_term:e==null?void 0:e.utm_term};for(const m of this.scanner.utmNames)if(m==="utm_content"){const u=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${e==null?void 0:e.utm_term}`;i.set(m,u||"")}else e[m]&&i.set(m,e[m]||"");e.googleKeyword&&i.set("utm_term",e.googleKeyword||""),r.setDate(r.getDate()+30),document.cookie=`_dc_utm_campaign=${JSON.stringify(a)}; expires=${r.toUTCString()}; path=/; domain=${P()}`,document.cookie=`_dc_utm_campaign=${JSON.stringify(a)}; path=/`},bagy_ga4:()=>h(this,void 0,void 0,function*(){const r=new Date,a={utm_source:e==null?void 0:e.utm_source,utm_campaign:e==null?void 0:e.utm_campaign,utm_medium:e==null?void 0:e.utm_medium,utm_content:e==null?void 0:e.utm_content,utm_term:e==null?void 0:e.utm_term};for(const m of this.scanner.utmNames){if(m==="utm_content"){const u=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}`;i.set(m,u||"")}else e[m]&&i.set(m,e[m]||"");if(["facebook","google","tiktok","pinterest"].includes(e.utm_source)&&i.set("utm_medium","cpc"),e.utm_medium)if(e.utm_source==="google"){const u=e.utm_campaign||"";i.set("utm_campaign",`${u}_${e.utm_medium}`)}else i.set("utm_term",e.utm_medium);e.googleKeyword&&i.set("utm_term",e.googleKeyword||"")}r.setDate(r.getDate()+30),document.cookie=`_dc_utm_campaign=${JSON.stringify(a)}; expires=${r.toUTCString()}; path=/; domain=${P()}`,document.cookie=`_dc_utm_campaign=${JSON.stringify(a)}; path=/`}),magazord:()=>h(this,void 0,void 0,function*(){try{const r=new Date;let a=`lc=utm&utm_source=${(e==null?void 0:e.utm_source)||""}&utm_campaign=${(e==null?void 0:e.utm_campaign)||""}&utm_medium=${(e==null?void 0:e.utm_medium)||""}&utm_content=${(e==null?void 0:e.utm_content)||""}&utm_term=${(e==null?void 0:e.utm_term)||""}`,m=btoa(this.removeAccents(a.split("").reverse().join("")));r.setDate(r.getDate()+30),document.cookie=`trk=${encodeURIComponent(m)}; expires=${r.toUTCString()}; path=/`}catch(r){C.error(r)}this.waitForMagazordOrderId(o.id,e.trackingSessionId);for(const r of this.scanner.utmNames)if(r==="utm_content"){const a=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${e==null?void 0:e.utm_term}`;i.set(r,a||"")}else e[r]&&i.set(r,e[r]||"");if(["facebook","google","tiktok","pinterest"].includes(e.utm_source)&&i.set("utm_medium","cpc"),e.utm_medium)if(e.utm_source==="google"){const r=e.utm_campaign||"";i.set("utm_campaign",`${r}_${e.utm_medium}`)}else i.set("utm_term",e.utm_medium);e.googleKeyword&&i.set("utm_term",e.googleKeyword||"")}),magazord_ga4:()=>h(this,void 0,void 0,function*(){try{const r=new Date;let a=`lc=utm&utm_source=${(e==null?void 0:e.utm_source)||""}&utm_campaign=${(e==null?void 0:e.utm_campaign)||""}&utm_medium=${(e==null?void 0:e.utm_medium)||""}&utm_content=${(e==null?void 0:e.utm_content)||""}&utm_term=${(e==null?void 0:e.utm_term)||""}`,m=btoa(this.removeAccents(a.split("").reverse().join("")));r.setDate(r.getDate()+30),document.cookie=`trk=${encodeURIComponent(m)}; expires=${r.toUTCString()}; path=/`}catch(r){C.error(r)}for(const r of this.scanner.utmNames)if(r==="utm_content"){const a=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}`;i.set(r,a||"")}else e[r]&&i.set(r,e[r]||"");e.googleKeyword&&i.set("utm_term",e.googleKeyword||"")}),loja_integrada:()=>{const r=new Date;for(const a of this.scanner.utmNames)if(a==="utm_content"){const m=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${e==null?void 0:e.utm_term}`;i.set(a,m||"")}else e[a]&&i.set(a,e[a]||"");e.googleKeyword&&i.set("utm_term",e.googleKeyword||""),r.setDate(r.getDate()+30),document.cookie=`utm_campaign=${e.trackingSessionId}; expires=${r.toUTCString()}; path=/`},vtex:()=>h(this,void 0,void 0,function*(){var r,a,m;for(const _ of this.scanner.utmNames)if(_==="utm_content"){const f=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${e==null?void 0:e.utm_term}`;i.set(_,f||"")}else e[_]&&i.set(_,e[_]||"");o.vtex_marketing_data_update_enabled&&(yield vt(e));const u=yield fe("orderform","vtex",o.id),v=(u!=null&&u.includes("order-form")?null:u)||((m=(a=(r=window.vtexjs)===null||r===void 0?void 0:r.checkout)===null||a===void 0?void 0:a.orderForm)===null||m===void 0?void 0:m.orderFormId)||B("orderform",o.id);v&&v!==(e==null?void 0:e.vtexSessionId)&&!ft(o.id,e==null?void 0:e.vtexSessionId)&&(yield this.sessionHistoryService.updateVtexSessionId({trackingId:o.id,trackingSessionId:e.trackingSessionId,vtexSessionId:v})),z(o.id)&&ht(o.id,v||(e==null?void 0:e.vtexSessionId)||null,_=>this.sessionHistoryService.updateVtexSessionId({trackingId:o.id,trackingSessionId:e.trackingSessionId,vtexSessionId:_}))}),woocommerce:()=>h(this,void 0,void 0,function*(){var r;if(!((r=window==null?void 0:window.location)===null||r===void 0)&&r.pathname.includes("efetuar-pagamento")){const _=new URLSearchParams(window.location.search).get("key");_&&(yield this.sessionHistoryService.updateNuvemshopId({trackingId:o.id,trackingSessionId:e.trackingSessionId,nuvemShopId:_}))}for(const v of this.scanner.utmNames)if(v==="utm_content"){const _=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${e==null?void 0:e.utm_term}`;i.set(v,_||"")}else e[v]&&i.set(v,e[v]||"");const a=`typ=utm|||src=${(e==null?void 0:e.utm_source)||"(none)"}|||mdm=${(e==null?void 0:e.utm_medium)||"(none)"}|||cmp=${(e==null?void 0:e.utm_campaign)||"(none)"}|||cnt=${(e==null?void 0:e.utm_content)||"(none)"}|||trm=${(e==null?void 0:e.utm_term)||"(none)"}|||id=(none)|||plt=(none)|||fmt=(none)|||tct=(none)`;document.cookie=`sbjs_current=${encodeURIComponent(a)}; path=/; domain=${P()}`;const m="; path=/",u={nemu_source:(e==null?void 0:e.utm_source)||"",nemu_medium:(e==null?void 0:e.utm_medium)||"",nemu_campaign:(e==null?void 0:e.utm_campaign)||"",nemu_content:(e==null?void 0:e.utm_content)||"",nemu_term:(e==null?void 0:e.utm_term)||""};for(const[v,_]of Object.entries(u))_&&(document.cookie=`${v}=${encodeURIComponent(_)}${m}`)}),woocommerce_ga4:()=>h(this,void 0,void 0,function*(){var r;if(!((r=window==null?void 0:window.location)===null||r===void 0)&&r.pathname.includes("efetuar-pagamento")){const _=new URLSearchParams(window.location.search).get("key");_&&(yield this.sessionHistoryService.updateNuvemshopId({trackingId:o.id,trackingSessionId:e.trackingSessionId,nuvemShopId:_}))}for(const v of this.scanner.utmNames)if(v==="utm_content"){const _=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}`;i.set(v,_||"")}else e[v]&&i.set(v,e[v]||"");if(["facebook","google","tiktok","pinterest"].includes(e.utm_source)&&i.set("utm_medium","cpc"),e.utm_medium)if(e.utm_source==="google"){const v=e.utm_campaign||"";i.set("utm_campaign",`${v}_${e.utm_medium}`)}else i.set("utm_term",e.utm_medium);e.googleKeyword&&i.set("utm_term",e.googleKeyword||"");const a=new Date;a.setDate(a.getDate()+30);const m={nemu_source:(e==null?void 0:e.utm_source)||"",nemu_medium:(e==null?void 0:e.utm_medium)||"",nemu_campaign:(e==null?void 0:e.utm_campaign)||"",nemu_content:(e==null?void 0:e.utm_content)||"",nemu_term:(e==null?void 0:e.utm_term)||""};for(const[v,_]of Object.entries(m))_&&(document.cookie=`${v}=${encodeURIComponent(_)}; path=/; expires=${a.toUTCString()}`);const u=`typ=utm|||src=${(e==null?void 0:e.utm_source)||"(none)"}|||mdm=${(e==null?void 0:e.utm_medium)||"(none)"}|||cmp=${(e==null?void 0:e.utm_campaign)||"(none)"}|||cnt=${(e==null?void 0:e.utm_content)||"(none)"}|||trm=${(e==null?void 0:e.utm_term)||"(none)"}|||id=(none)|||plt=(none)|||fmt=(none)|||tct=(none)`;document.cookie=`sbjs_current=${encodeURIComponent(u)}; path=/; domain=${P()}; expires=${a.toUTCString()}`}),vnda:()=>h(this,void 0,void 0,function*(){const{getCookieByName:r}=this.storage,{sessionHistoryService:a}=this;function m(){return new Promise(_=>h(this,void 0,void 0,function*(){const f=setInterval(()=>h(this,void 0,void 0,function*(){const y=(r("ahoy_visit")?r("ahoy_visit").split("?")[0]:"")||null;if(y!==null)return clearInterval(f),yield a.updateTraySessionId({trackingId:o.id,trackingSessionId:e.trackingSessionId,traySessionId:y}),_(!0)}),500);setTimeout(()=>{clearInterval(f),_(null)},1e4)}))}yield m();for(const _ of this.scanner.utmNames)if(_==="utm_content"){const f=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${e==null?void 0:e.utm_term}`;i.set(_,f||"")}else e[_]&&i.set(_,e[_]||"");const u=`${e==null?void 0:e.utm_term}`,v=new Date;v.setDate(v.getDate()+30),document.cookie=`campaign=${u}; expires=${v.toUTCString()}; domain=${P()}; path=/`}),wake:()=>h(this,void 0,void 0,function*(){for(const u of this.scanner.utmNames)if(u==="utm_content"){const v=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${e==null?void 0:e.utm_term}`;i.set(u,v||"")}else e[u]&&i.set(u,e[u]||"");e.googleKeyword&&i.set("utm_term",e.googleKeyword||"");const r=100;let a=0,m=!1;new Promise((u,v)=>{const _=setInterval(()=>h(this,void 0,void 0,function*(){var f,g,y,I,S,N,L,x;if(typeof client!="undefined"){const T=client;clearInterval(_);try{const $=[e==null?void 0:e.utm_term,n==null?void 0:n.id].filter(Boolean).join("|"),O=yield(f=T==null?void 0:T.checkout)===null||f===void 0?void 0:f.getCheckoutId();if(["2qzQ7WcY1t","kNqC8lJ21m"].includes(o.id)){$&&(yield(g=T==null?void 0:T.checkout)===null||g===void 0?void 0:g.addCheckoutMetadata([{key:"nmu",value:$}],O)),u(null);return}const w=[{key:"utmSource",value:e==null?void 0:e.utm_source},{key:"utmCampaign",value:e==null?void 0:e.utm_campaign},{key:"utmMedium",value:e==null?void 0:e.utm_medium},{key:"utmContent",value:`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${(e==null?void 0:e.utm_term)||""}`}].filter(b=>b.value);$&&(yield(y=T==null?void 0:T.checkout)===null||y===void 0?void 0:y.addCheckoutMetadata([{key:"utmTerm",value:$}],O)),yield(I=T==null?void 0:T.checkout)===null||I===void 0?void 0:I.addCheckoutMetadata(w,O),u(null)}catch($){u(null)}}else if(++a>=r)clearInterval(_),u(null);else if(!m){const T=document.location.href.includes("/checkout")?(N=(S=document.getElementsByClassName("order-number"))===null||S===void 0?void 0:S[1])===null||N===void 0?void 0:N.textContent:void 0,$=(x=(L=this.storage.getCookieByName("t_us_id"))===null||L===void 0?void 0:L[0])===null||x===void 0?void 0:x.id,O=T!=null?T:$;O&&(m=!0,yield this.sessionHistoryService.updateVtexSessionId({trackingId:o.id,trackingSessionId:e.trackingSessionId,vtexSessionId:O.toString()})),clearInterval(_),u(null)}}),100)})}),wake_ga4:()=>h(this,void 0,void 0,function*(){for(const r of this.scanner.utmNames){if(r==="utm_content"){const u=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${e==null?void 0:e.utm_term}`;i.set(r,u||"")}else e[r]&&i.set(r,e[r]||"");if(["facebook","google","tiktok","pinterest"].includes(e.utm_source)&&i.set("utm_medium","cpc"),e.utm_medium)if(e.utm_source==="google"){const u=e.utm_campaign||"";i.set("utm_campaign",`${u}-${e.utm_medium}`)}else i.set("utm_term",e.utm_medium);e.googleKeyword&&i.set("utm_term",e.googleKeyword||"");const a=100;let m=0;new Promise((u,v)=>{const _=setInterval(()=>h(this,void 0,void 0,function*(){var f,g,y,I;if(typeof client!="undefined"){const S=client;clearInterval(_);try{const N=[e==null?void 0:e.utm_term,n==null?void 0:n.id].filter(Boolean).join("|"),L=yield(f=S==null?void 0:S.checkout)===null||f===void 0?void 0:f.getCheckoutId();if(["2qzQ7WcY1t","kNqC8lJ21m"].includes(o.id)){N&&(yield(g=S==null?void 0:S.checkout)===null||g===void 0?void 0:g.addCheckoutMetadata([{key:"nmu",value:N}],L)),u(null);return}const T=[{key:"utmSource",value:e==null?void 0:e.utm_source},{key:"utmCampaign",value:e==null?void 0:e.utm_campaign},{key:"utmMedium",value:e==null?void 0:e.utm_medium},{key:"utmContent",value:`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${(e==null?void 0:e.utm_term)||""}`}].filter($=>$.value);N&&(yield(y=S==null?void 0:S.checkout)===null||y===void 0?void 0:y.addCheckoutMetadata([{key:"utmTerm",value:N}],L)),yield(I=S==null?void 0:S.checkout)===null||I===void 0?void 0:I.addCheckoutMetadata(T,L),u(null)}catch(N){u(null)}}else++m>=a&&(clearInterval(_),u(null))}),100)})}}),tutoryhub:()=>h(this,void 0,void 0,function*(){const r=window.location.href;function a(u){const v=u.match(/\/obrigado\/(or_[a-zA-Z0-9]+)/);return v?v[1]:null}const m=a(r);m&&(yield this.sessionHistoryService.updateNuvemshopId({trackingId:o.id,trackingSessionId:e.trackingSessionId,nuvemShopId:m}));for(const u of this.scanner.utmNames)if(u==="utm_content"){const v=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${e==null?void 0:e.utm_term}`;i.set(u,v||"")}else e[u]&&i.set(u,e[u]||"");e.googleKeyword&&i.set("utm_term",e.googleKeyword||"")}),uappi:()=>h(this,void 0,void 0,function*(){var r;if(typeof WapStore!="undefined"){const a=WapStore,m=(r=a==null?void 0:a.pedido)===null||r===void 0?void 0:r.id;m&&(yield this.sessionHistoryService.updateNuvemshopId({trackingId:o.id,trackingSessionId:e.trackingSessionId,nuvemShopId:String(m)}))}for(const a of this.scanner.utmNames)if(a==="utm_content"){const m=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${e==null?void 0:e.utm_term}`;i.set(a,m||"")}else e[a]&&i.set(a,e[a]||"");e.googleKeyword&&i.set("utm_term",e.googleKeyword||"")}),uappi_ga4:()=>h(this,void 0,void 0,function*(){var r;if(typeof WapStore!="undefined"){const a=WapStore,m=(r=a==null?void 0:a.pedido)===null||r===void 0?void 0:r.id;m&&(yield this.sessionHistoryService.updateNuvemshopId({trackingId:o.id,trackingSessionId:e.trackingSessionId,nuvemShopId:String(m)}))}for(const a of this.scanner.utmNames)if(a==="utm_content"){const m=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${e==null?void 0:e.utm_term}`;i.set(a,m||"")}else e[a]&&i.set(a,e[a]||"");if(e.utm_medium)if(e.utm_source==="google"){const a=e.utm_campaign||"";i.set("utm_campaign",`${a}_${e.utm_medium}`)}else i.set("utm_term",e.utm_medium);e.googleKeyword&&i.set("utm_term",e.googleKeyword||"")}),yampi:()=>h(this,void 0,void 0,function*(){yield It(a=>this.sessionHistoryService.updateVtexSessionId({trackingId:o.id,trackingSessionId:e.trackingSessionId,vtexSessionId:a}))}),irroba:()=>h(this,void 0,void 0,function*(){const a=document.getElementsByClassName("number-order");a.length>0&&(yield this.sessionHistoryService.updateNuvemshopId({trackingId:o.id,trackingSessionId:e.trackingSessionId,nuvemShopId:String(a[0].textContent)}));for(const m of this.scanner.utmNames)if(m==="utm_content"){const u=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${e==null?void 0:e.utm_term}`;i.set(m,u||"")}else e[m]&&i.set(m,e[m]||"");e.googleKeyword&&i.set("utm_term",e.googleKeyword||"")}),shoppub:()=>h(this,void 0,void 0,function*(){const r=setInterval(()=>h(this,void 0,void 0,function*(){var a,m,u,v;!((m=(a=window==null?void 0:window.Shoppub)===null||a===void 0?void 0:a.customer)===null||m===void 0)&&m.id_on_store&&(clearInterval(r),yield this.sessionHistoryService.updateNuvemshopId({trackingId:o.id,trackingSessionId:e.trackingSessionId,nuvemShopId:String((v=(u=window==null?void 0:window.Shoppub)===null||u===void 0?void 0:u.customer)===null||v===void 0?void 0:v.id_on_store)}))}),500);for(const a of this.scanner.utmNames)if(a==="utm_content"){const m=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${e==null?void 0:e.utm_term}`;i.set(a,m||"")}else e[a]&&i.set(a,e[a]||"");e.googleKeyword&&i.set("utm_term",e.googleKeyword||"")}),zedy:()=>h(this,void 0,void 0,function*(){for(const r of this.scanner.utmNames)if(r==="utm_content"){const a=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${e==null?void 0:e.utm_term}`;i.set(r,a||"")}else e[r]&&i.set(r,e[r]||"");if(e.googleKeyword&&i.set("utm_term",e.googleKeyword||""),window.location.href.includes("/cart")){let r=0;const a=60,m=setInterval(()=>h(this,void 0,void 0,function*(){const u=window==null?void 0:window.chtCheckoutUrl,v=u==null?void 0:u.split("/").filter(Boolean).pop();if(v)try{yield this.sessionHistoryService.updateNuvemshopId({trackingId:o.id,trackingSessionId:e.trackingSessionId,nuvemShopId:v}),clearInterval(m)}catch(_){clearInterval(m)}r++,r>=a&&clearInterval(m)}),1e3)}}),cartpanda:()=>h(this,void 0,void 0,function*(){for(const u of this.scanner.utmNames)if(u==="utm_content"){const v=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${e==null?void 0:e.utm_term}`;i.set(u,v||"")}else e[u]&&i.set(u,e[u]||"");e.googleKeyword&&i.set("utm_term",e.googleKeyword||"");const{getCookieByName:r}=this.storage,{sessionHistoryService:a}=this;function m(){return new Promise(u=>h(this,void 0,void 0,function*(){const v=setInterval(()=>h(this,void 0,void 0,function*(){const f=(r("cart_token")?r("cart_token").split("?")[0]:"")||null;if(f!==null)return clearInterval(v),yield a.updateNuvemshopId({trackingId:o.id,trackingSessionId:e.trackingSessionId,nuvemShopId:f}),u(!0)}),500)}))}window.location.href.includes("/checkout")&&m()}),jetecommerce:()=>h(this,void 0,void 0,function*(){for(const a of this.scanner.utmNames)if(a==="utm_content"){const m=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}`;i.set(a,m||"")}else e[a]&&i.set(a,e[a]||"");if(e.utm_medium)if(e.utm_source==="google"){const a=e.utm_campaign||"";i.set("utm_campaign",`${a}_${e.utm_medium}`),i.set("utm_medium","cpc")}else["facebook","google","tiktok","pinterest"].includes(e.utm_source)?(i.set("utm_medium","cpc"),i.set("utm_term",e.utm_medium)):i.set("utm_medium",e.utm_medium);e.googleKeyword&&i.set("utm_term",e.googleKeyword||"");const r=setInterval(()=>h(this,void 0,void 0,function*(){const a=document.querySelector(".mail");if(a){clearInterval(r);const m=a==null?void 0:a.textContent;yield this.sessionHistoryService.updateNuvemshopId({trackingId:o.id,trackingSessionId:e.trackingSessionId,nuvemShopId:m})}}),500);setTimeout(()=>{clearInterval(r)},6e4*5)}),magento:()=>h(this,void 0,void 0,function*(){this.applyDefaultUtmsToQueryParams(i,e);const r=setInterval(()=>h(this,void 0,void 0,function*(){var a,m,u,v,_,f,g,y,I,S,N,L;const x=JSON.parse(localStorage.getItem("ds-cart-order")),T=(m=(a=window==null?void 0:window.dataLayer)===null||a===void 0?void 0:a.find(E=>!!E.customerEmail))===null||m===void 0?void 0:m.customerEmail,$=(_=(v=(u=window==null?void 0:window.dataLayer)===null||u===void 0?void 0:u.find(E=>{var F;return!!(!((F=E.customer)===null||F===void 0)&&F.email)}))===null||v===void 0?void 0:v.customer)===null||_===void 0?void 0:_.email,O=(f=document.querySelectorAll(".order-information .order-item span")[1])===null||f===void 0?void 0:f.textContent,p=(y=(g=document.querySelector("h2.order-id-label"))===null||g===void 0?void 0:g.textContent)===null||y===void 0?void 0:y.split("N\xBA do pedido ")[1],w=(S=(I=document.querySelector(".value"))===null||I===void 0?void 0:I.textContent)===null||S===void 0?void 0:S.split("#")[1],b=(N=document.querySelector(".numero-pedido .content"))===null||N===void 0?void 0:N.textContent,k=(L=document.querySelector(".checkout-success p span"))===null||L===void 0?void 0:L.textContent;if(x||T||O||p||w||b||$||k){clearInterval(r);const E=(x==null?void 0:x.id)||T||O||p||w||b||$||k;yield this.sessionHistoryService.updateNuvemshopId({trackingId:o.id,trackingSessionId:e.trackingSessionId,nuvemShopId:E})}}),500);setTimeout(()=>{clearInterval(r)},3e4)}),yever:()=>{for(const S of this.scanner.utmNames)if(S==="utm_content"){const N=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${(e==null?void 0:e.utm_term)||""}`;i.set(S,N||"")}else e[S]&&i.set(S,e[S]||"");e.googleKeyword&&i.set("utm_term",e.googleKeyword||"");const r=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${(e==null?void 0:e.utm_term)||""}`,a=new URLSearchParams;e.utm_source&&a.set("utm_source",e.utm_source),e.utm_campaign&&a.set("utm_campaign",e.utm_campaign),e.utm_medium&&a.set("utm_medium",e.utm_medium),r.replace(/\|/g,"")&&a.set("utm_content",r),e.googleKeyword?a.set("utm_term",e.googleKeyword):e.utm_term&&a.set("utm_term",e.utm_term);const m=a.toString(),u=new Date;u.setDate(u.getDate()+30);const v=P(),_=()=>document.cookie.split("; ").filter(S=>S.startsWith("yeverUtmsTrack=")).map(S=>S.slice(15)),f=()=>{const S=new Date(0).toUTCString();[`yeverUtmsTrack=; expires=${S}; path=/; SameSite=Lax`,`yeverUtmsTrack=; expires=${S}; path=/; SameSite=Lax; Secure`,`yeverUtmsTrack=; expires=${S}; path=/; domain=${v}; SameSite=Lax`,`yeverUtmsTrack=; expires=${S}; path=/; domain=${v}; SameSite=Lax; Secure`].forEach(N=>document.cookie=N),document.cookie=`yeverUtmsTrack=${m}; expires=${u.toUTCString()}; path=/; domain=${v}; SameSite=Lax`,document.cookie=`yeverUtmsTrack=${m}; expires=${u.toUTCString()}; path=/; domain=${v}; SameSite=Lax; Secure`};f();let g=0,y=0;const I=setInterval(()=>{g++,_().some(N=>N!==m)?(f(),y=0):y++,(y>=3||g>=30)&&clearInterval(I)},100)},wbuy:()=>h(this,void 0,void 0,function*(){for(const m of this.scanner.utmNames)if(m==="utm_content"){const u=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${(e==null?void 0:e.utm_term)||""}`;i.set(m,u||"")}else e[m]&&i.set(m,e[m]||"");e.googleKeyword&&i.set("utm_term",e.googleKeyword||"");const r="p.thanks-msg strong",a=setInterval(()=>h(this,void 0,void 0,function*(){var m,u,v;const _=(v=(u=(m=document.querySelector(r))===null||m===void 0?void 0:m.textContent)===null||u===void 0?void 0:u.trim())===null||v===void 0?void 0:v.split("#")[1];_&&(clearInterval(a),yield this.sessionHistoryService.updateNuvemshopId({trackingId:o.id,trackingSessionId:e.trackingSessionId,nuvemShopId:_}))}),500);setTimeout(()=>{clearInterval(a)},3e4)}),oraclecx:()=>h(this,void 0,void 0,function*(){for(const p of this.scanner.utmNames)if(p==="utm_content"){const w=`${(e==null?void 0:e.utm_adName)||""}|${(e==null?void 0:e.utm_adId)||""}|${(e==null?void 0:e.utm_term)||""}`;i.set(p,w||"")}else e[p]&&i.set(p,e[p]||"");e.googleKeyword&&i.set("utm_term",e.googleKeyword||"");const r=p=>{var w,b;if(p==null)return null;if(typeof p=="string")return p||null;if(typeof p=="number"||typeof p=="bigint")return String(p);if(typeof p=="object"){const k=(b=(w=p.id)!==null&&w!==void 0?w:p.orderId)!==null&&b!==void 0?b:p.orderNumber;return k==null?null:typeof k=="string"?k||null:String(k)}return null},a=p=>{var w,b,k;if(!p||p.indexOf("clientRepository")===-1)return null;try{const E=JSON.parse(p);return r((k=(b=(w=E==null?void 0:E.clientRepository)===null||w===void 0?void 0:w.context)===null||b===void 0?void 0:b.session)===null||k===void 0?void 0:k.order)}catch(E){return null}},m=()=>{try{for(let p=0;p{var p,w;try{const b=document.querySelector(".order-all-details-confirmation-orderId"),k=(p=b==null?void 0:b.textContent)===null||p===void 0?void 0:p.trim();if(!k)return null;const E=(w=k.split(" ")[2])===null||w===void 0?void 0:w.trim();return!E||!/\d/.test(E)?null:E}catch(b){return null}};let v=null,_=!1,f=null,g=null,y=null;const I={},S={},N=5,L=()=>{g&&(clearInterval(g),g=null),y&&(clearTimeout(y),y=null)},x=(p,w)=>{S[p]&&clearTimeout(S[p]),S[p]=setTimeout(()=>{if(delete S[p],p===v)return;const b=m();b&&b===p&&T(p)},w)},T=p=>h(this,void 0,void 0,function*(){if(!p||p===v)return;const w=I[p]||(I[p]={n:0,next:0});if(w.n>=N||Date.now(){const p=m()||u();p&&T(p)},O=()=>{g||(g=setInterval($,500)),y&&clearTimeout(y),y=setTimeout(L,3e4)};try{const p=typeof window!="undefined"?window.Storage:void 0,w=p==null?void 0:p.prototype;if(w&&!w.__nmuOraclecxPatched){const b=w.setItem;w.setItem=function(k,E){const F=b.apply(this,arguments);try{if(this===window.localStorage&&typeof E=="string"){const W=a(E);W&&T(W)}}catch(W){}return F},w.__nmuOraclecxPatched=!0}}catch(p){}$(),O();try{const p=history;if(!p.__nmuOraclecxNavPatched){p.__nmuOraclecxNavPatched=!0;const w=history.pushState;history.pushState=function(...k){const E=w.apply(this,k);try{window.dispatchEvent(new Event("nmu:oraclecx:nav"))}catch(F){}return E};const b=history.replaceState;history.replaceState=function(...k){const E=b.apply(this,k);try{window.dispatchEvent(new Event("nmu:oraclecx:nav"))}catch(F){}return E},window.addEventListener("popstate",()=>{try{window.dispatchEvent(new Event("nmu:oraclecx:nav"))}catch(k){}})}window.addEventListener("nmu:oraclecx:nav",()=>{try{$(),O()}catch(w){}})}catch(p){}})};return yield(d[o==null?void 0:o.platform]||d.others)(),i})}removeAccents(t){return t.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[`^~¨´]/g,"")}}class U{constructor({sessionHistoryService:t,redirect_url:o}){Object.assign(this,{redirect_url:o,sessionHistoryService:t})}redirectWithUTMs(t){const o=this.redirect_url.includes("?")?"&":"?";window.location.href=`${this.redirect_url}${o}${t}`}loadUTMsInQueryParams(t,o,e,n,i){const s=`${window.location.origin}${window.location.pathname}?${o}`;(t==null?void 0:t.accountId)!==4417&&(t==null?void 0:t.platform)!=="shopify_ga4"&&(t==null?void 0:t.platform)!=="shoppub"&&(t==null?void 0:t.platform)!=="nuvemshop_ga4"&&(t==null?void 0:t.platform)!=="bagy_ga4"&&(t==null?void 0:t.platform)!=="tray_ga4"&&(t==null?void 0:t.platform)!=="magazord_ga4"&&(t==null?void 0:t.platform)!=="uappi_ga4"&&(t==null?void 0:t.platform)!=="woocommerce_ga4"&&(t==null?void 0:t.platform)!=="jetecommerce"&&e&&window.history.replaceState({path:s},"",s);const d=U.appendIntegrationFieldsToUtms(U.extractUtmsFromQueryParams(o.toString()),n,i,t==null?void 0:t.id),c=new Date;if(c.setDate(c.getDate()+30),document.cookie=`nemuUtmsTrack=${d}; expires=${c.toUTCString()}; path=/; SameSite=Lax; Secure`,localStorage.setItem("nemu:utmsTrack",`${d}`),(t==null?void 0:t.platform)==="shopify_plus_others"){const r=new Date;r.setDate(r.getDate()+30),document.cookie=`utmsTrack=${d}; expires=${r.toUTCString()}; path=/; SameSite=Lax; Secure`,localStorage.setItem("nemu:utmsTrack",`${d}`)}}static extractUtmsFromQueryParams(t){const o=["utm_source","utm_content","utm_medium","utm_campaign","utm_term"];return t.split("&").filter(n=>o.includes(n.split("=")[0])).join("&")}static applyNmubpToQueryParams(t,o,e){var n;if(!o||!e||!U.NMUBP_IN_UTM_CONTENT_TRACKING_IDS.includes(e))return t;const i=new URLSearchParams(t),s=(n=i.get("utm_content"))!==null&&n!==void 0?n:"",d=s?`${s}|nemu_bp_${o}`:`nemu_bp_${o}`;return i.set("utm_content",d),i}static appendNmubpToUtms(t,o,e){return U.applyNmubpToQueryParams(new URLSearchParams(t),o,e).toString()}static applyWebPixelSessionIdToQueryParams(t,o,e){var n;if(!o||!e||!U.NMUBP_IN_UTM_CONTENT_TRACKING_IDS.includes(e))return t;const i=new URLSearchParams(t),s=(n=i.get("utm_term"))!==null&&n!==void 0?n:"",d=s?`${s}||${o}`:`||${o}`;return i.set("utm_term",d),i}static appendWebPixelSessionIdToUtms(t,o,e){return U.applyWebPixelSessionIdToQueryParams(new URLSearchParams(t),o,e).toString()}static applyIntegrationFieldsToQueryParams(t,o,e,n){const i=U.applyNmubpToQueryParams(t,o,n);return U.applyWebPixelSessionIdToQueryParams(i,e,n)}static appendIntegrationFieldsToUtms(t,o,e,n){return U.applyIntegrationFieldsToQueryParams(new URLSearchParams(t),o,e,n).toString()}addInitiateCheckoutListener(t,o,e){if((t==null?void 0:t.initiate_checkout_detection_type)==="selector"){const i=document.querySelectorAll(t==null?void 0:t.initiate_checkout_detection_value);for(let s of i)s.addEventListener("click",()=>h(this,void 0,void 0,function*(){yield this.sessionHistoryService.sendInitateCheckoutEvent({trackingId:t==null?void 0:t.id,trackingSessionId:o,trackingSessionHistoryId:e})}));return}const n=["button","a",'input[type=""]','input[type="button"]','input[type="submit"]','input[type="reset"]'];for(let i of n){const s=document.querySelectorAll(i);for(let d of s){let c=!1;d.tagName.toLowerCase()==="button"||d.tagName.toLowerCase()==="a"?c=d.textContent.includes(t==null?void 0:t.initiate_checkout_detection_value):d.tagName.toLowerCase()==="input"&&(c=d.value.includes(t==null?void 0:t.initiate_checkout_detection_value)),c&&d.addEventListener("click",function(){return h(this,void 0,void 0,function*(){yield this.sessionHistoryService.sendInitateCheckoutEvent({trackingId:t==null?void 0:t.id,trackingSessionId:o,trackingSessionHistoryId:e})})})}}}execute({trackingType:t,queryParams:o,trackingSessionHistoryId:e,tracking:n,trackingSessionId:i,url_update_enabled:s,nmuBp:d,webPixelSessionId:c}){if(t&&t==="redirect"){this.redirectWithUTMs(o.toString());return}this.loadUTMsInQueryParams(n,o.toString(),s,d,c),n!=null&&n.initiate_checkout_enabled&&(n!=null&&n.initiate_checkout_detection_value)&&this.addInitiateCheckoutListener(n,i,e)}}U.NMUBP_IN_UTM_CONTENT_TRACKING_IDS=Me;class Tt{constructor(t){this.storage=t,this.fbcKey="_fbc",this.fbpKey="_fbp"}getUnixTimestamp(){return Math.floor(Date.now()/1e3)}generateRandomNumber(){return Math.floor(Math.random()*9e9)+1e9}getExpirationDate(){return new Date(Date.now()+7776e6)}isValidFbc(t){const o=this.storage.getCookieByName(this.fbcKey);return!!o&&!!t&&o.includes(t)}isValidFbp(){return!!this.storage.getCookieByName(this.fbpKey)}validateAndUpdateFbc(){const t=new URLSearchParams(window.location.search).get("fbclid");if(!t||this.isValidFbc(t))return;const o=`fb.1.${this.getUnixTimestamp()}.${t}`;this.storage.setCookie(this.fbcKey,o,this.getExpirationDate())}ensureFbpExists(){if(this.isValidFbp())return;const t=this.generateRandomNumber(),o=`fb.1.${this.getUnixTimestamp()}.${t}`;this.storage.setCookie(this.fbpKey,o,this.getExpirationDate())}initialize(){this.validateAndUpdateFbc(),this.ensureFbpExists()}}class Se{constructor(){this.DEFAULT_BLOCKED_UA_STRS=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"]}isBlockedUA(t,o=[]){if(!t)return!1;const e=t.toLowerCase();return this.DEFAULT_BLOCKED_UA_STRS.concat(o).some(n=>{const i=n.toLowerCase();return e.indexOf(i)!==-1})}}class we{constructor(t){this.lastPath=window.location.pathname,this.onRouteChange=t}handleRouteChange(){const t=window.location.pathname;t!==this.lastPath&&(this.lastPath=t,this.onRouteChange())}setupListeners(){const t=history.pushState;history.pushState=(...e)=>{const n=t.apply(history,e);return this.handleRouteChange(),n};const o=history.replaceState;history.replaceState=(...e)=>{const n=o.apply(history,e);return this.handleRouteChange(),n},window.addEventListener("popstate",()=>{this.handleRouteChange()})}}class Ie{constructor(t){this.storage=t,this.STORAGE_KEY="nmu_wa",this.SESSION_TIMEOUT_SEC=1800,this.webPixel=null,this.isNewSessionFlag=!1,this.initialized=!1}getUnixTimestamp(){return Math.floor(Date.now()/1e3)}generateRandomNumber(){return Math.floor(Math.random()*9e9)+1e9}generateId(){return this.getUnixTimestamp()?`nmu.${this.getUnixTimestamp()}.${this.generateRandomNumber()}`:null}getStoredData(){return this.storage.getLocalStorageItem(this.STORAGE_KEY)}setStoredData(t){this.storage.setLocalStorageItem(this.STORAGE_KEY,t)}newSession(){return{sessionId:this.generateId(),startedAt:this.getUnixTimestamp(),lastSentAt:null}}initializeNewData(){const t={id:this.generateId(),session:this.newSession()};return this.setStoredData(t),t}isSessionExpired(t){return t===null?!0:this.getUnixTimestamp()-t>this.SESSION_TIMEOUT_SEC}resolveOrCreate(){const t=this.getStoredData();return t?this.isSessionExpired(t.session.lastSentAt)?(t.session=this.newSession(),this.setStoredData(t),{webPixel:t,isNewSession:!0}):{webPixel:t,isNewSession:!1}:{webPixel:this.initializeNewData(),isNewSession:!0}}getOrCreate(){if(this.initialized)return{webPixel:this.webPixel,isNewSession:this.isNewSessionFlag};const{webPixel:t,isNewSession:o}=this.resolveOrCreate();return this.webPixel=t,this.isNewSessionFlag=o,this.initialized=!0,{webPixel:t,isNewSession:o}}touchLastSent(){const t=this.getStoredData();if(!t)return;const o=this.getUnixTimestamp();t.session.lastSentAt=o,this.setStoredData(t),this.webPixel&&(this.webPixel.session.lastSentAt=o)}}class Ne extends Q{constructor(t,o,e,n,i,s,d){super(),this.identity=t,this.botValidator=o,this.trackingId=e,this.baseURL=n,this.nemuUtms=i,this.platform=s,this.QUEUE_DEBOUNCE_TIME_MS=150,this.QUEUE_MAX_WAIT_TIME_MS=450,this.SUPPORTED_EVENTS=["page_view","view_item","view_item_list","select_item","view_promotion","select_promotion","add_to_cart","view_cart","begin_checkout","add_shipping_info","add_payment_info","form_start","form_submit","session_start"],this.FUNNEL_ITEM_EVENTS=["view_item","view_item_list","select_item","view_promotion","select_promotion","add_to_cart","view_cart","begin_checkout","add_shipping_info","add_payment_info"],this.PREFIXABLE_EVENTS=["view_item","view_item_list","select_item","view_promotion","select_promotion","add_to_cart","view_cart","begin_checkout","add_shipping_info","add_payment_info"],this.checkoutNormalizer=Ce(()=>{var c,r,a;return(a=(r=(c=window.vtexjs)===null||c===void 0?void 0:c.checkout)===null||r===void 0?void 0:r.orderForm)===null||a===void 0?void 0:a.items}),this.eventQueue=[],this.debounceTimer=null,this.maxWaitTimer=null,this.isUsingCustomDataLayer=!1,this.customWebPixel=null,this.EVENT_ALIASES={product_detail:"view_item","gtm.form_interact":"form_start","gtm.form_submit":"form_submit"},this.customDataLayerName=le(d)}getUnixTimestamp(){return Math.floor(Date.now()/1e3)}getDeviceType(){const t=navigator.userAgent||navigator.vendor||window.opera,o=navigator.maxTouchPoints||0,e=/Android.*Mobile|iPhone|iPod|BlackBerry|IEMobile|Opera Mini|Mobile.*Firefox/i,n=/iPad|Android(?!.*Mobile)|Tablet|PlayBook|Silk/i;return/Macintosh/i.test(t)&&o>1||n.test(t)?"tablet":e.test(t)?"mobile":"desktop"}sendEvent(t){this.eventQueue.push(t),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.flushQueue()},this.QUEUE_DEBOUNCE_TIME_MS),this.maxWaitTimer||(this.maxWaitTimer=setTimeout(()=>{this.flushQueue()},this.QUEUE_MAX_WAIT_TIME_MS))}flushQueue(){return h(this,void 0,void 0,function*(){if(this.eventQueue.length===0)return;const t=[...this.eventQueue];this.eventQueue=[],this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.maxWaitTimer&&(clearTimeout(this.maxWaitTimer),this.maxWaitTimer=null),this.identity.touchLastSent();try{const o=`${this.baseURL}/events/${this.trackingId}`,e=JSON.stringify({trackingId:this.trackingId,events:t});yield this.sendBeaconOrFetch(o,e)}catch(o){}})}sendSessionStartEvent(t){const o="session_start",e=this.getUnixTimestamp(),n=this.enrichEvent(t,o,e,null);this.sendEvent(n)}sendPageViewEvent(t){const o="page_view",e=this.getUnixTimestamp(),n=this.enrichEvent(t,o,e,null);this.sendEvent(n)}normalizeEventName(t){return this.convertToSnakeCase(t)}getCanonicalEventName(t){var o;if(this.SUPPORTED_EVENTS.includes(t))return t;for(const e of this.PREFIXABLE_EVENTS)if(t.endsWith(`_${e}`))return e;return(o=this.EVENT_ALIASES[t])!==null&&o!==void 0?o:null}filterSupportedEvent(t){var o;if(t.endsWith("_ga4")){const e=t.slice(0,-4);if(this.PREFIXABLE_EVENTS.includes(e))return e}return this.getCanonicalEventName(t)?(o=this.EVENT_ALIASES[t])!==null&&o!==void 0?o:t:null}isFunnelItemEvent(t){const o=this.getCanonicalEventName(t);return o!==null&&this.FUNNEL_ITEM_EVENTS.includes(o)}isFirstFormInteraction(t){const o=t["gtm.interactSequenceNumber"];return o===void 0||o===0||o==="0"}convertToSnakeCase(t){return t.replace(/-/g,"_").replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase()}normalizeDataLayerEventName(t){"0"in t&&t[0]==="event"&&"1"in t&&typeof t[1]=="string"&&(t.event=t[1]);const o=t;if(!o.event||typeof o.event!="string"||this.isUsingCustomDataLayer&&Xe(this.trackingId,o.event))return null;const e=this.normalizeEventName(o.event);return o.event=e,o}isNemuEvent(t){return t.startsWith("nmu_")}extractEventData(t){if(!(this.isNemuEvent(t.event)||this.isFunnelItemEvent(t.event)))return null;const{event:e}=t,n=se(t,["event"]);return Object.keys(n).length===0?null:n}filterDataLayerEvent(t){if(this.isNemuEvent(t.event))return t;const o=this.filterSupportedEvent(t.event);if(!o||o==="form_start"&&!this.isFirstFormInteraction(t))return null;if(this.isFunnelItemEvent(o)){const e=this.unwrapEventPayload(t);return Object.assign(Object.assign({},e),{event:o})}return{event:o}}unwrapEventPayload(t){if(Array.isArray(t)){const e=t[2];return e&&typeof e=="object"?e:{}}const o=t;return o[0]==="event"&&typeof o[2]=="object"&&o[2]!==null?o[2]:o}enrichEvent(t,o,e,n){const i={};this.nemuUtms.forEach((u,v)=>{["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_adsetName","utm_campaignName","utm_adName","utm_campaignId","utm_adsetId","utm_adId"].includes(v)&&(i[v]=u)});const s=t.session.sessionId,d=document.referrer,c=window.location.hostname,r=window.location.pathname,a=navigator.userAgent,m={nmubp:t.id,eventId:this.identity.generateId(),trackingId:this.trackingId,event:o,eventTimestamp:e,sessionId:s,payload:{utms:i,referrer:d,hostname:c,path:r,userAgent:a,deviceType:this.getDeviceType()}};return n&&(m.eventData=n),m}handleDataLayerEvent(t,o){const e=this.getUnixTimestamp(),n=this.normalizeDataLayerEventName(o.detail);if(!n)return;const i=this.filterDataLayerEvent(n);if(!i)return;const s=this.extractEventData(i),d=this.enrichEvent(t,i.event,e,s);this.platform==="vtex"&&s?(this.checkoutNormalizer.normalize(s,this.getCanonicalEventName(i.event),c=>{d.eventData=c,this.sendEvent(d)}),document.visibilityState==="hidden"&&(this.checkoutNormalizer.flush(),this.flushQueue())):this.sendEvent(d)}setupDataLayerEventListener(t){window.addEventListener("nemuDataLayerPush",o=>{this.handleDataLayerEvent(t,o)})}processExistingDataLayerEvents(){!window.dataLayer||!Array.isArray(window.dataLayer)||window.dataLayer.forEach(t=>{if(t&&typeof t=="object"){const o=new CustomEvent("nemuDataLayerPush",{detail:Object.assign({},t)});window.dispatchEvent(o)}})}handleCustomDataLayerEntry(t,o){try{if(this.hasLostCustomDataLayer())return;if(o&&typeof o=="object"){const e=new CustomEvent("nemuDataLayerPush",{detail:Object.assign({},o)});this.handleDataLayerEvent(t,e)}}catch(e){}}hasLostCustomDataLayer(){return oe(this.trackingId,this.customDataLayerName)!==this}onScriptReinjected(t,o){try{const e=this.customWebPixel;if(!e||!(t!=null&&t.session)||t.session.sessionId===e.session.sessionId)return;e.id=t.id,e.session=Object.assign({},t.session),o&&this.sendSessionStartEvent(e)}catch(e){}}onRouteChange(){try{this.customWebPixel&&this.sendPageViewEvent(this.customWebPixel)}catch(t){}}setupCustomHistoryChangeListener(){const{trackingId:t,customDataLayerName:o}=this;if(!Je(t,o))return;new we(()=>{qe(t,o)}).setupListeners()}setupCustomDataLayerInterceptor(t,o){this.isUsingCustomDataLayer=!0,this.customWebPixel=t;const e=i=>this.handleCustomDataLayerEntry(t,i);o.forEach(e);const n=o.push;o.push=function(...i){return i.forEach(e),n.apply(o,i)},window.dataLayer=window.dataLayer||[]}setupDataLayerInterceptor(){window.dataLayer=window.dataLayer||[],this.processExistingDataLayerEvents();const t=window.dataLayer.push;window.dataLayer.push=function(...o){return o.forEach(e=>{if(e&&typeof e=="object"){const n=new CustomEvent("nemuDataLayerPush",{detail:Object.assign({},e)});window.dispatchEvent(n)}}),t.apply(window.dataLayer,o)}}setupPageLeaveListener(){const t=()=>{this.checkoutNormalizer.flush(),this.flushQueue()};window.addEventListener("pagehide",t),window.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&t()})}setupHistoryChangeListener(t){new we(()=>{this.sendPageViewEvent(t)}).setupListeners()}initialize(){if(this.botValidator.isBlockedUA(navigator.userAgent))return null;const t=this.customDataLayerName?ce(this.customDataLayerName):null;if(t&&!Qe(this.trackingId,this.customDataLayerName,t,this)){const{webPixel:n,isNewSession:i}=this.identity.getOrCreate();return Ye(this.trackingId,this.customDataLayerName,n,i),null}const{webPixel:o,isNewSession:e}=this.identity.getOrCreate();return e&&this.sendSessionStartEvent(o),this.sendPageViewEvent(o),t?this.setupCustomDataLayerInterceptor(o,t):(this.setupDataLayerEventListener(o),this.setupDataLayerInterceptor()),this.setupPageLeaveListener(),t?this.setupCustomHistoryChangeListener():this.setupHistoryChangeListener(o),window.dataLayer.push({event:"nmu.wp","nmu.start":new Date().getTime()}),o}}class ke{constructor(){this.id="_ItfebzCd3",this.src="https://wepink.trackings.nemu.com.br",this.type="tracking",this.redirect_url="",this.full_url="",this.platform="vtex",this.platforms="[{\"id\":1,\"name\":\"facebook\",\"createdAt\":\"2024-08-13T14:28:00.000Z\",\"updatedAt\":\"2024-08-13T14:28:00.000Z\"},{\"id\":2,\"name\":\"google\",\"createdAt\":\"2024-08-13T14:28:00.000Z\",\"updatedAt\":\"2024-08-13T14:28:00.000Z\"},{\"id\":3,\"name\":\"instagram\",\"createdAt\":\"2024-08-13T14:28:00.000Z\",\"updatedAt\":\"2024-08-13T14:28:00.000Z\"}]",this.url_update_enabled="false",this.blockExternalScripts="true",this.persist_session_cookie="false",this.data_layer_name=null,this.utm_delimiter=null}onLoad(){return h(this,void 0,void 0,function*(){var t,o,e,n,i,s,d,c;const r=window.location.href;this.blockExternalScripts==="true"&&ut();const a=new V,m=new Ie(a),{webPixel:u}=m.getOrCreate();new Tt(a).initialize(),C.info(this.full_url!==""?this.full_url:window.location.search,"search",window.location.search);const _=this.full_url!==""?this.full_url:window.location.search,f=new K({full_url:this.id==="CuaPMID9L2"?K.sanitizeQueryString(_):_,delimiter:this.utm_delimiter}),g=new ye({platforms:JSON.parse(this.platforms)}),y=new Y;try{C.info(JSON.stringify({referrer:K.extractOrigin(document==null?void 0:document.referrer),search:JSON.stringify(window.location.search,null,2),url:JSON.stringify(window.location,null,2)}));const I=(t=new URL(this.src))===null||t===void 0?void 0:t.origin;if(!I){C.error("script element with src attribute not found.");return}const S=new bt({baseURL:I}),N=new ge({baseURL:I}),L=new ae({scanner:f,platformsFilter:g,sessionHistoryService:N,storage:a});let x={},T=a.getCookieByName(`_nmu.${this.id}`);const $=a.getCookieByName(`_nmu_lh.${this.id}`);a.setEncodedCookie(`_nmu_lh.${this.id}`,{host:window.location.hostname,t:Math.floor(Date.now()/1e3)},void 0,P());const O=yield y.getClientHash(this.id),p=yield y.getClientId();let w;(O||T)&&(w=yield S.getBy({trackingId:this.id,clientHash:O,clientSessionId:T}));const b=new U({sessionHistoryService:N,redirect_url:this.redirect_url!==""?this.redirect_url:null}),k=(o=u==null?void 0:u.id)!==null&&o!==void 0?o:null,E=(n=(e=u==null?void 0:u.session)===null||e===void 0?void 0:e.sessionId)!==null&&n!==void 0?n:null,F=R=>{const D=new Se;new Ne(m,D,this.id,I,R,this.platform,this.data_layer_name).initialize()},W=()=>h(this,void 0,void 0,function*(){const R=yield N.getLastBySessionId(this.id,w.id,k);if(!R)return a.removeCookie(`_nmu.${this.id}`,P()),!1;const D=yield L.parseUTMsToQueryParams({tracking:R==null?void 0:R.tracking,utms:j(R),webPixelData:u});return this.nemuUtms=U.applyIntegrationFieldsToQueryParams(D,k,E,this.id),b.execute({tracking:R==null?void 0:R.tracking,queryParams:D,baseURL:I,trackingSessionId:w.id,trackingType:this.type,trackingSessionHistoryId:R.id,url_update_enabled:this.url_update_enabled==="true",nmuBp:k,webPixelSessionId:E}),F(U.applyNmubpToQueryParams(D,k,this.id)),!0}),Et=()=>h(this,void 0,void 0,function*(){var R;Object.assign(x,Object.assign({utm_term:`nemu_${w.id}`},j(f.extractUTMsFromQueryParams(this.platform,this.id))));const D=yield N.add({trackingId:this.id,sessionId:w.id,clientId:p,clientHash:O,productData:j(Object.assign(Object.assign({},x),{utm_source:L.parseUTMSrc({utm_source:x==null?void 0:x.utm_source})})),referrer:K.extractOrigin(document.referrer),facebookParams:f.getFacebookParams(a),platform:this.platform,nmuBp:k,webPixelSessionId:E,href:r});if(!D)return!1;const H=yield L.parseUTMsToQueryParams({tracking:D==null?void 0:D.tracking,utms:j(D),webPixelData:u});return this.nemuUtms=U.applyIntegrationFieldsToQueryParams(H,k,E,this.id),b.execute({tracking:D==null?void 0:D.tracking,queryParams:H,trackingType:this.type,baseURL:I,trackingSessionId:w.id,trackingSessionHistoryId:(R=D==null?void 0:D.lastHistory)===null||R===void 0?void 0:R.id,url_update_enabled:this.url_update_enabled==="true",nmuBp:k,webPixelSessionId:E}),F(U.applyNmubpToQueryParams(H,k,this.id)),!0});if(w){this.persist_session_cookie==="true"&&a.setCookie(`_nmu.${this.id}`,w.id,void 0,P()),C.info("scanner",String(!f.containsUTMsInQueryParams(this.id)));const R=f.containsUTMsInQueryParams(this.id),D=f.isReferrerFromInternalSource(),H=f.isPageReloaded(),Te=window.location.hostname,$t=!!document.referrer,Ee=(s=f.getMainDomainHostname((i=$==null?void 0:$.host)!==null&&i!==void 0?i:""))!==null&&s!==void 0?s:$==null?void 0:$.host,Ct=(d=f.getMainDomainHostname(Te))!==null&&d!==void 0?d:Te,xt=!!($!=null&&$.host)&&!!Ee&&Ee===Ct&&typeof $.t=="number"&&Math.floor(Date.now()/1e3)-$.t<=1800;if(!R&&(D||H||!$t&&xt)&&(yield W())||(yield Et()))return}f.containsUTMsInQueryParams(this.id)&&Object.assign(x,Object.assign({},j(f.extractUTMsFromQueryParams(this.platform,this.id))));const A=yield S.add({trackingId:this.id,clientHash:O,productData:Object.assign(Object.assign({},x),{utm_source:L.parseUTMSrc({utm_source:x==null?void 0:x.utm_source})}),facebookParams:f.getFacebookParams(a),referrer:K.extractOrigin(document.referrer),clientId:p,nmuBp:k,webPixelSessionId:E});A&&a.setCookie(`_nmu.${this.id}`,A.id,void 0,P());const J=yield L.parseUTMsToQueryParams({tracking:A==null?void 0:A.tracking,utms:j(A==null?void 0:A.lastHistory),webPixelData:u});this.nemuUtms=U.applyIntegrationFieldsToQueryParams(J,k,E,this.id),C.info(J.toString()),b.execute({tracking:A==null?void 0:A.tracking,queryParams:J,trackingType:this.type,baseURL:I,trackingSessionId:A.id,trackingSessionHistoryId:(c=A==null?void 0:A.lastHistory)===null||c===void 0?void 0:c.id,url_update_enabled:this.url_update_enabled==="true",nmuBp:k,webPixelSessionId:E}),F(U.applyNmubpToQueryParams(J,k,this.id))}catch(I){if(pe(I)||this.persist_session_cookie==="true")return;this.id&&a.removeCookie(`_nmu.${this.id}`,P())}})}}const be=new ke;return window.trackingNemu=be,be.onLoad(),M.BotValidator=Se,M.ClientService=Y,M.PlatformFilter=ye,M.SessionHistoryService=ge,M.Storage=V,M.Tracking=ke,M.UtmParser=ae,M.UtmProducer=U,M.UtmScanner=K,M.WebPixelIdentity=Ie,M.WebPixelManager=Ne,M})({}); ;(function(){try{var d=document;if(d.querySelector('script[data-nemu-bifrost-loader]'))return;var s=d.createElement('script');s.async=true;s.src="https://bifrost.api.nemu.com.br/v1/api/pixel/wepink/3729/script.js";s.setAttribute('data-nemu-bifrost-loader','');s.onerror=function(){};(d.head||d.documentElement).appendChild(s);}catch(e){}})();