(function(shopify) { (()=>{var se="WebPixel::Render";var Y=e=>shopify.extend(se,e);var K={config:0,set:1,page_view:2,view_item:3,add_to_cart:4,purchase:5,begin_checkout:6,search:7,add_payment_info:8,update:9,default:10},ce={send_to:0,page_path:1,page_title:2,page_location:3,ignore_referrer:4,ecomm_prodid:5,ecomm_totalvalue:6,ecomm_pagetype:7,items:8,id:9,name:10,brand:11,category:12,coupon:13,price:14,quantity:15,variant:16,value:17,currency:18,tax:19,shipping:20,search_term:21,total:22,transaction_id:23,ad_storage:24,ad_user_data:25,ad_personalization:26,analytics_storage:27},le={config:[],set:[],page_view:["send_to"],view_item:["send_to","ecomm_prodid"],add_to_cart:["send_to","ecomm_prodid"],purchase:["send_to","transaction_id"],begin_checkout:["send_to"],search:["send_to"],add_payment_info:["send_to"]};var fe="",ge=function(e){fe=e},Pe=Math.floor(Math.random()*2147483648),pe=function(){if(arguments[0]==="js")return;let r=window.dataLayer.filter(o=>Object.prototype.toString.call(o)==="[object Arguments]").filter(o=>ue(o,arguments)),c=Ce(r,arguments);if(!c){let o=arguments,a=!1,v=window.gtag;window.gtag=function(){return!a&&ue(arguments,o)&&(de(arguments,o),a=!0),v==null?void 0:v(...arguments)};return}de(c,arguments)};function Ce(e,r){if(e.length===0)return;if(r[0]==="set"){let o=e.filter(a=>O(r[1],a[1],[]));return o.length>0?o[0]:e[0]}else e.sort((o,a)=>Ae(r[2],o[2],a[2]));return e[0]}function Ae(e,r,c){let o=[],a=[];return O(e,r,o),O(e,c,a),o.length-a.length}var de=function(e,r){let c=r[0],o=r[1],a=r[2],v=K[o];(c==="set"||c==="config")&&(v=K[c]);let u=[`id=${fe}`,`pid=${Pe}`];if(c==="set"){if(!O(r[1],e[1],[])){u.push(`cdm=${v}`),L(u);return}}else{let p=e[2],E=[];if(O(a,p,E),E.length){let h=E.map(P=>ce[P]).filter(P=>P!==void 0);u.push(`cdm=${v}.${h.join(".")}`),L(u);return}}u.push(`cm=${v}`),L(u)};function O(e,r,c){let o=[];if(e===r)return!0;if(!(e instanceof Object)||!(r instanceof Object))return!1;for(let a in e){if(!e.hasOwnProperty(a)||a==="user_data")continue;if(!r.hasOwnProperty(a)){o.push(a);continue}let v=e[a],u=r[a];if(v!=u){if(Array.isArray(v)&&Array.isArray(u)){if(Ee(v,u,o))continue}else if(v instanceof Object&&O(v,u,o))continue;o.push(a)}}for(let a in r)r.hasOwnProperty(a)&&!e.hasOwnProperty(a)&&o.push(a);return c.push(...o),o.length===0}function Ee(e,r,c){let o=[];if(e.length!==r.length)return!1;for(let a=0;a{let E=e[2][p],h=a[p];return p==="send_to"||p==="ecomm_prodid"?JSON.stringify(E)===JSON.stringify(h):p==="transaction_id"?E==h:E===h}).every(p=>p===!0):!1}return!1}function ve(e){let r=e.init.customerPrivacy;if(r===void 0||r.marketingAllowed||r.analyticsProcessingAllowed)me(e,r);else{let c=!1;e.customerPrivacy.subscribe("visitorConsentCollected",o=>{let a=o.customerPrivacy;!c&&(a.marketingAllowed||a.analyticsProcessingAllowed)&&(me(e,a),c=!0)})}}function me(e,r){var J,B,X,Z,H,Q,V,k,ee,te,ne,re,ie;let c=window.dataLayer=window.dataLayer||[],o=JSON.parse(e.settings.config),a=o.pixel_id;ge(a);let v=o.enable_monitoring_mode;if(v&&!((J=new URL(window.location.href))!=null&&J.searchParams.has("force_monitor"))&&Math.floor(Math.random()*1e3)>10)return;let u=window.gtag=window.gtag||function(){c.push(arguments)},p=v?pe:u;r&&(p("consent","default",ye(r)),p("set",_e(r))),I(e)&&p("set",{ignore_referrer:"true"}),u("policy","detect_click_events",()=>!1),u("policy","detect_element_visibility_events",()=>!1),u("policy","detect_history_change_events",()=>!1),u("policy","detect_link_click_events",()=>!1),u("policy","detect_timer_events",()=>!1),u("policy","detect_youtube_activity_events",()=>!1),u("policy","detect_scroll_events",()=>!1),u("policy","detect_form_submit_events",()=>!1),u("policy","detect_form_interaction_events",()=>!1),u("policy","internal_sw_allowed",()=>!1),u("set","developer_id.dNzYwYj",!0),u("js",new Date);let E=document.createElement("script");E.src=`https://www.googletagmanager.com/gtag/js?id=${a}`,document.body.appendChild(E);let h={send_page_view:!1};I(e)&&(h.ignore_referrer="true"),p("config",a,h);let P=o.gtag_events,N=t=>{var i;return"shopify_"+(o.target_country||"US")+"_"+String((i=t==null?void 0:t.product)==null?void 0:i.id)+"_"+String(t==null?void 0:t.id)},x=t=>{let i=t==null?void 0:t.title;return["default","title","default title",""].includes(String(i).toLowerCase())?null:i},D=(t,i)=>i?`${t} - ${i}`:t,be=(t,i)=>{var l;if(t==="/search"){let f=(l=document.querySelector("link[rel='canonical']"))==null?void 0:l.getAttribute("href");if(f)return f}return i},we=(t,i,l)=>t&&t.endsWith("thank_you")?D(i,l):i,F=t=>{var i,l,f,_,d,b,w;return{email:t==null?void 0:t.email,phone_number:t==null?void 0:t.phone,address:{first_name:(i=t==null?void 0:t.billingAddress)==null?void 0:i.firstName,last_name:(l=t==null?void 0:t.billingAddress)==null?void 0:l.lastName,street:(f=t==null?void 0:t.billingAddress)==null?void 0:f.address1,city:(_=t==null?void 0:t.billingAddress)==null?void 0:_.city,region:(d=t==null?void 0:t.billingAddress)==null?void 0:d.province,postal_code:(b=t==null?void 0:t.billingAddress)==null?void 0:b.zip,country:(w=t==null?void 0:t.billingAddress)==null?void 0:w.country}}},S={email:(Z=(X=(B=e.init)==null?void 0:B.data)==null?void 0:X.customer)==null?void 0:Z.email,phone_number:(V=(Q=(H=e.init)==null?void 0:H.data)==null?void 0:Q.customer)==null?void 0:V.phone,address:{first_name:(te=(ee=(k=e.init)==null?void 0:k.data)==null?void 0:ee.customer)==null?void 0:te.firstName,last_name:(ie=(re=(ne=e.init)==null?void 0:ne.data)==null?void 0:re.customer)==null?void 0:ie.lastName}};e.analytics.subscribe("page_viewed",t=>{var l,f,_,d,b,w,s,C;let i=P.find(n=>n.type==="page_view");if(i&&i.action_label){let n=(_=(f=(l=t.context)==null?void 0:l.window)==null?void 0:f.location)==null?void 0:_.pathname,A={send_to:i.action_label,page_path:n,page_title:he((b=(d=t.context)==null?void 0:d.document)==null?void 0:b.title,n),page_location:be(n,(C=(s=(w=t.context)==null?void 0:w.window)==null?void 0:s.location)==null?void 0:C.href),user_data:S};I(e)&&(A.ignore_referrer="true"),p("event","page_view",A)}}),e.analytics.subscribe("product_viewed",t=>{var l,f,_,d,b,w;let i=P.find(s=>s.type==="view_item");if(i&&i.action_label){let s=(l=t.data)==null?void 0:l.productVariant;p("event","view_item",{send_to:i.action_label,ecomm_prodid:[N(s)],ecomm_totalvalue:(f=s==null?void 0:s.price)==null?void 0:f.amount,ecomm_pagetype:"product",items:[{id:N(s),name:D((_=s==null?void 0:s.product)==null?void 0:_.title,x(s)),brand:(d=s==null?void 0:s.product)==null?void 0:d.vendor,category:(b=s==null?void 0:s.product)==null?void 0:b.type,price:(w=s==null?void 0:s.price)==null?void 0:w.amount,variant:x(s)}],user_data:S})}}),e.analytics.subscribe("product_added_to_cart",t=>{var l,f,_,d,b,w,s,C,n,A,m;let i=P.find(g=>g.type==="add_to_cart");if(i&&i.action_label){let g=(l=t.data)==null?void 0:l.cartLine,y=g==null?void 0:g.merchandise;p("event","add_to_cart",{send_to:i.action_label,ecomm_prodid:[N(g==null?void 0:g.merchandise)],ecomm_totalvalue:(_=(f=g==null?void 0:g.cost)==null?void 0:f.totalAmount)==null?void 0:_.amount,ecomm_pagetype:"cart",value:(b=(d=g==null?void 0:g.cost)==null?void 0:d.totalAmount)==null?void 0:b.amount,currency:((s=(w=g==null?void 0:g.cost)==null?void 0:w.totalAmount)==null?void 0:s.currencyCode)||"USD",items:[{id:N(y),name:D((C=y==null?void 0:y.product)==null?void 0:C.title,x(y)),brand:(n=y==null?void 0:y.product)==null?void 0:n.vendor,category:(A=y==null?void 0:y.product)==null?void 0:A.type,price:(m=y==null?void 0:y.price)==null?void 0:m.amount,quantity:g==null?void 0:g.quantity,variant:x(y)}],user_data:S})}}),e.analytics.subscribe("checkout_completed",t=>{var l,f,_,d,b,w,s,C;let i=P.find(n=>n.type==="purchase");if(i&&i.action_label){let n=(l=t.data)==null?void 0:l.checkout,A={send_to:i.action_label,transaction_id:(f=n==null?void 0:n.order)==null?void 0:f.id,value:(_=n==null?void 0:n.subtotalPrice)==null?void 0:_.amount,currency:((d=n==null?void 0:n.subtotalPrice)==null?void 0:d.currencyCode)||"USD",tax:(b=n==null?void 0:n.totalTax)==null?void 0:b.amount,shipping:(s=(w=n==null?void 0:n.shippingLine)==null?void 0:w.price)==null?void 0:s.amount,items:(C=n==null?void 0:n.lineItems)==null?void 0:C.map(m=>{var g,y,T,M,R,j,z,G,q,U,$,W,ae,oe;return{id:N(m.variant),name:we((T=(y=(g=t.context)==null?void 0:g.window)==null?void 0:y.location)==null?void 0:T.pathname,(R=(M=m.variant)==null?void 0:M.product)==null?void 0:R.title,x(m.variant)),brand:(z=(j=m.variant)==null?void 0:j.product)==null?void 0:z.vendor,category:(q=(G=m.variant)==null?void 0:G.product)==null?void 0:q.type,coupon:(W=($=(U=m.discountAllocations)==null?void 0:U[0])==null?void 0:$.discountApplication)==null?void 0:W.title,price:(oe=(ae=m.variant)==null?void 0:ae.price)==null?void 0:oe.amount,quantity:m.quantity,variant:x(m.variant)}}),user_data:F(n)};I(e)&&(A.ignore_referrer="true"),p("event","purchase",A)}}),e.analytics.subscribe("checkout_started",t=>{var l,f,_,d,b,w,s,C;let i=P.find(n=>n.type==="begin_checkout");if(i&&i.action_label){let n=(l=t.data)==null?void 0:l.checkout,A={send_to:i.action_label,ecomm_prodid:(f=n==null?void 0:n.lineItems)==null?void 0:f.map(m=>N(m.variant)),ecomm_totalvalue:(_=n==null?void 0:n.subtotalPrice)==null?void 0:_.amount,ecomm_pagetype:"cart",value:(d=n==null?void 0:n.subtotalPrice)==null?void 0:d.amount,currency:((b=n==null?void 0:n.subtotalPrice)==null?void 0:b.currencyCode)||"USD",coupon:(s=(w=n==null?void 0:n.discountApplications)==null?void 0:w[0])==null?void 0:s.title,items:(C=n==null?void 0:n.lineItems)==null?void 0:C.map(m=>{var g,y,T,M,R,j,z,G,q,U,$,W;return{id:N(m.variant),name:(y=(g=m.variant)==null?void 0:g.product)==null?void 0:y.title,brand:(M=(T=m.variant)==null?void 0:T.product)==null?void 0:M.vendor,category:(j=(R=m.variant)==null?void 0:R.product)==null?void 0:j.type,coupon:(q=(G=(z=m.discountAllocations)==null?void 0:z[0])==null?void 0:G.discountApplication)==null?void 0:q.title,price:($=(U=m.variant)==null?void 0:U.price)==null?void 0:$.amount,quantity:m.quantity,variant:(W=m.variant)==null?void 0:W.title}}),user_data:F(n)};I(e)&&(A.ignore_referrer="true"),p("event","begin_checkout",A)}}),e.analytics.subscribe("search_submitted",t=>{var l,f;let i=P.find(_=>_.type==="search");i&&i.action_label&&p("event","search",{send_to:i.action_label,search_term:(f=(l=t.data)==null?void 0:l.searchResult)==null?void 0:f.query,user_data:S})}),e.analytics.subscribe("payment_info_submitted",t=>{var l,f,_;let i=P.find(d=>d.type==="add_payment_info");if(i&&i.action_label){let d=(l=t.data)==null?void 0:l.checkout,b={send_to:i.action_label,currency:((f=d==null?void 0:d.totalPrice)==null?void 0:f.currencyCode)||"USD",total:(_=d==null?void 0:d.totalPrice)==null?void 0:_.amount,user_data:F(d)};I(e)&&(b.ignore_referrer="true"),p("event","add_payment_info",b)}}),e.customerPrivacy.subscribe("visitorConsentCollected",t=>{let i=t.customerPrivacy;p("consent","update",ye(i)),p("set",_e(i))})}function _e(e){return{restricted_data_processing:!e.saleOfDataAllowed}}function ye(e){return{ad_storage:e.marketingAllowed?"granted":"denied",ad_user_data:e.marketingAllowed?"granted":"denied",ad_personalization:e.marketingAllowed?"granted":"denied",analytics_storage:e.analyticsProcessingAllowed?"granted":"denied"}}function I(e){var r;return((r=e==null?void 0:e._pixelInfo)==null?void 0:r.surfaceNext)==="checkout"}function he(e,r){if(!r)return e;let c=[["/information","Checkout - Contact Information"],["/shipping","Checkout - Shipping"],["/payment","Checkout - Payment"],["/review","Checkout - Review"],["/processing","Checkout - Processing"],["/thank-you","Checkout - Receipt"],["/stock-problems","Checkout - Stock problems"],["/error","Checkout - Error"]];for(let[o,a]of c)if(r.endsWith(o))return a;return/^\/checkouts\/[A-Za-z0-9]+\/[A-Za-z0-9]+$/.test(r)?"Checkout - Contact Information":e}Y(ve);})(); })(self.webPixelsManager.createShopifyExtend('512393393', 'app'));