const n=function(n){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:scData?.currency;return["BIF","BYR","CLP","DJF","GNF","ISK","JPY","KMF","KRW","PYG","RWF","UGX","VND","VUV","XAF","XAG","XAU","XBA","XBB","XBC","XBD","XDR","XOF","XPD","XPF","XPT","XTS"].includes(t?.toUpperCase())?n:n/100};window.addEventListener("scSearched",(function(n){if(!window?.fbq)return;const{searchString:t,searchResultIds:e}=n.detail;window.fbq("track","Search",{search_string:t,content_ids:e})})),window.addEventListener("scAddedToCart",(function(n){if(!window?.fbq)return;const t=n.detail;if(!t?.price?.product)return;const e=t?.price?.product,c=e?.product_collections?.data?.map((n=>n.name))||[];window.fbq("track","AddToCart",{...c.length?{content_category:c.join(", ")}:{},content_ids:[e.id],content_name:e?.name+(t?.variant_options?.length?` - ${t?.variant_options.join(" / ")}`:""),content_type:"product",contents:[{id:e.id,quantity:t.quantity}],currency:t?.price?.currency,value:t?.price?.converted_amount||0})})),window.addEventListener("scProductViewed",(function(t){if(!window?.fbq)return;const e=t.detail;window.fbq("track","ViewContent",{content_ids:[e.id],content_category:e?.product_collections?.data?.map((n=>n.name)).join(", "),content_name:e?.name+(e?.variant_options?.length?` - ${e?.variant_options.join(" / ")}`:""),content_type:"product",contents:[{id:e.id,quantity:1}],currency:e?.price?.currency,value:n(e.price?.amount||0,e.price?.currency||"USD")})}));