1/*! Copyright 2025 SweetCode. All rights reserved. */ 2(self.webpackChunkPixel_Manager_for_WooCommerce=self.webpackChunkPixel_Manager_for_WooCommerce||[]).push([[672],{4359(){!function(e){const t=new class{adapt(e,t,r){const a=`adapt${this.toPascalCase(t)}`;return"function"==typeof this[a]?this[a](e,r):null}toPascalCase(e){return"string"!=typeof e?"":e.replace(/(^|_)(\w)/g,(e,t,r)=>r.toUpperCase())}getProductId(e){if(!e)return null;const t=pmwDataLayer?.pixels?.spotify?.dynamic_remarketing?.id_type;return t&&e.dyn_r_ids&&e.dyn_r_ids[t]?String(e.dyn_r_ids[t]):e.id?String(e.id):null}toPrice(e){const t=Math.round(100*Number(e))/100;return Number.isFinite(t)?t:0}toCategory(e){return Array.isArray(e)?e.join(", "):e||""}getBaseData(){return{event_id:e.getRandomEventId()}}getLineItem(e,t,r){const a=this.getProductId(e);if(!a)return null;const i=Number(t)||1,n={value:this.toPrice(Number(r)*i),quantity:i,product_id:a,product_name:e.name||""},o=this.toCategory(e.category);return o&&(n.product_type=o),e.brand&&(n.product_vendor=e.brand),e.is_variation&&e.id&&(n.variant_id=String(e.id),e.variant_description&&(n.variant_name=e.variant_description)),n}getEventDetails(e,t,r){const a={};return pmwDataLayer?.shop?.currency&&(a.currency=pmwDataLayer.shop.currency),Number.isFinite(Number(e))&&(a.amount=this.toPrice(e)),t&&(a.content_name=t),r&&(a.content_category=r),a}adaptPageView(e,t){const r=this.getBaseData();return r.event_name="view",r.event_data={},r.event_details={},r}adaptViewItem(e,t){const r=e.product,a=this.getProductId(r);if(!a)return null;const i={value:this.toPrice(r?.price),product_id:a,product_name:r?.name||""},n=this.toCategory(r?.category);pmwDataLayer?.shop?.currency&&(i.currency=pmwDataLayer.shop.currency),n&&(i.product_type=n),r?.brand&&(i.product_vendor=r.brand);const o=this.getBaseData();return o.event_name="product",o.event_data=i,o.event_details=this.getEventDetails(r?.price,r?.name,n),o}adaptAddToCart(e,t){const r=e.product,a=Number(r?.quantity)||1,i=this.getProductId(r);if(!i)return null;const n=this.toPrice(Number(r?.price)*a),o={value:n,quantity:a,product_id:i,product_name:r?.name||""},s=this.toCategory(r?.category);pmwDataLayer?.shop?.currency&&(o.currency=pmwDataLayer.shop.currency),s&&(o.product_type=s),r?.brand&&(o.product_vendor=r.brand),r?.is_variation&&r?.id&&(o.variant_id=String(r.id),r.variant_description&&(o.variant_name=r.variant_description));const p=this.getBaseData();return p.event_name="addtocart",p.event_data=o,p.event_details=this.getEventDetails(n,r?.name,s),p}adaptBeginCheckout(t,r){const a={};let i=null;if(pmwDataLayer?.cart&&!e.isEmptyObject(pmwDataLayer.cart)){i=e.getCartValue(),a.value=this.toPrice(i),pmwDataLayer?.shop?.currency&&(a.currency=pmwDataLayer.shop.currency);const t=[];let r=0;Object.values(pmwDataLayer.cart).forEach(e=>{const a=this.getLineItem(e,e.quantity,e.price);a&&(t.push(a),r+=a.quantity)}),t.length&&(a.line_items=t,a.quantity=r)}const n=this.getBaseData();return n.event_name="checkout",n.event_data=a,n.event_details=this.getEventDetails(i),n}adaptPurchase(e,t){if(!pmwDataLayer?.order)return null;const r=[];let a=0;Object.values(pmwDataLayer.order.items||{}).forEach(e=>{let t=pmwDataLayer.products?.[e.id];pmwDataLayer?.shop?.variations_output&&e.variation_id&&0!==e.variation_id&&(t=pmwDataLayer.products?.[e.variation_id]||t);const i=this.getProductId(t)||(e.id?String(e.id):null);if(!i)return;const n=Number(e.quantity)||1,o={value:this.toPrice(Number(e.price)*n),quantity:n,product_id:i,product_name:e.name||t?.name||""},s=this.toCategory(t?.category);s&&(o.product_type=s),t?.brand&&(o.product_vendor=t.brand),e.variation_id&&0!==e.variation_id&&(o.variant_id=String(e.variation_id),e.variant_description&&(o.variant_name=e.variant_description)),r.push(o),a+=n});const i=pmwDataLayer.order.value?.marketing,n={order_id:String(pmwDataLayer.order.number||pmwDataLayer.order.id),value:this.toPrice(i)};pmwDataLayer.order.currency&&(n.currency=pmwDataLayer.order.currency),pmwDataLayer.order.coupon&&(n.discount_code=pmwDataLayer.order.coupon),void 0!==pmwDataLayer.order.new_customer&&null!==pmwDataLayer.order.new_customer&&(n.is_new_customer=!!pmwD
2ataLayer.order.new_customer),r.length&&(n.line_items=r,n.quantity=a);const o=this.getBaseData();return o.event_id=pmwDataLayer.order.id?"pmw_"+String(pmwDataLayer.order.id):o.event_id,o.event_name="purchase",o.event_data=n,o.event_details={currency:pmwDataLayer.order.currency,amount:this.toPrice(i)},o}};e.registerAdapter("spotify",t,{supportsS2S:!0,supportsEventDeduplication:!0,supportsPageViewS2S:!0,isActive:()=>!0===pmwDataLayer?.pixels?.spotify?.loaded&&!0===e.consent.categories.get().marketing,isConfigured:()=>!!pmwDataLayer?.pixels?.spotify?.pixel_id})}(window.pmw=window.pmw||{})},1910(){var e;(e=window.pmw=window.pmw||{}).bus.on("pmw:load-pixels",function(){pmwDataLayer?.pixels?.spotify?.pixel_id&&!pmwDataLayer?.pixels?.spotify?.loaded&&e.consent.canPixelBeFired("marketing","Spotify Ads")&&e.loadSpotifyPixel()}),e.bus.on("pmw:pixel:page-view",t=>{if(pmwDataLayer?.pixels?.spotify?.loaded&&e.shouldFireBrowserPixel(t,"spotify"))try{const r=t.pixels?.spotify;if(!r)return;e.spotifyTrackEvent(r)}catch(e){console.error(e)}}),e.bus.on("pmw:pixel:view-item",t=>{if(pmwDataLayer?.pixels?.spotify?.loaded&&e.shouldFireBrowserPixel(t,"spotify"))try{const r=t.pixels?.spotify;if(!r)return;e.spotifyTrackEvent(r)}catch(e){console.error(e)}}),e.bus.on("pmw:pixel:add-to-cart",t=>{if(pmwDataLayer?.pixels?.spotify?.loaded&&e.shouldFireBrowserPixel(t,"spotify"))try{const r=t.pixels?.spotify;if(!r)return;e.spotifyTrackEvent(r)}catch(e){console.error(e)}}),e.bus.on("pmw:pixel:begin-checkout",t=>{if(pmwDataLayer?.pixels?.spotify?.loaded&&e.shouldFireBrowserPixel(t,"spotify"))try{const r=t.pixels?.spotify;if(!r)return;e.spotifyTrackEvent(r)}catch(e){console.error(e)}}),e.bus.on("pmw:pixel:purchase",t=>{if(pmwDataLayer?.pixels?.spotify?.loaded&&e.shouldFireBrowserPixel(t,"spotify"))try{const r=t.pixels?.spotify;if(!r)return;e.spotifySendAlias(),e.spotifyTrackEvent(r)}catch(e){console.error(e)}})},2802(){var e;(e=window.pmw=window.pmw||{}).loadSpotifyPixel=()=>{try{!function(e,t){var r="spdt-capture",a="script";if(!t.getElementById(r)){e.spdt=e.spdt||function(){(e.spdt.q=e.spdt.q||[]).push(arguments)};var i=t.createElement(a);i.id=r,i.async=1,i.src="https://pixel.byspotify.com/ping.min.js";var n=t.getElementsByTagName(a)[0];n.parentNode.insertBefore(i,n)}}(window,document),window.spdt("conf",{key:pmwDataLayer.pixels.spotify.pixel_id}),pmwDataLayer.pixels.spotify.loaded=!0,e.console.log("Spotify Ads: pixel loaded"),e.spotifySendAlias()}catch(e){console.error(e)}},e.spotifySendAlias=()=>{try{if("function"!=typeof window.spdt)return;if(!pmwDataLayer?.pixels?.spotify?.advanced_matching)return;const t=pmwDataLayer?.user?.email?.sha256;if(!t)return;if(pmwDataLayer.pixels.spotify.alias_sent===t)return;window.spdt("alias",{id:t}),pmwDataLayer.pixels.spotify.alias_sent=t,e.console.log("Spotify Ads: alias event sent")}catch(e){console.error(e)}},e.spotifyTrackEvent=t=>{try{if("function"!=typeof window.spdt)return;if(!t?.event_name)return;const r={...t.event_data||{}};t.event_id&&(r.event_id=t.event_id),"view"===t.event_name?window.spdt("view"):window.spdt(t.event_name,r),e.console.log("Spotify Ads: "+t.event_name+" event sent",r)}catch(e){console.error(e)}}},9182(e,t,r){r(4359),r(2802),r(1910)}}]); 3//# sourceMappingURL=pixel-spotify.b1d11b8d.chunk.min.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.