PageSourceSearch

https://stauff.com/assets/85393ace388eb89d64cbb1b9dc84c00e9c67e657…/stauff_platform.tracking-begin-checkout.js

js stauff.com collected 2026-09-28 07:55:01 UTC 12,453 bytes, 1 lines download raw bytes

1"use strict";(self.webpackJsonp_stauff_platform=self.webpackJsonp_stauff_platform||[]).push([[5745],{65494:(t,n,e)=>{e.r(n),e.d(n,{default:()=>i});var r=e(42744);class i extends r.Z{constructor(){super(...arguments),this.checkoutButtonElement=void 0}init(){this.checkoutButtonElement=this.getElementsByClassName("js-tracking-checkout-button")[0],this.mapEvents()}mapEvents(){this.checkoutButtonElement&&this.checkoutButtonElement.addEventListener("click",(()=>this.trackBeginCheckout()))}trackBeginCheckout(){var t=this.getAttribute("currency"),n={event:"begin_checkout",ecommerce:{value:this.buildPrice(this.getAttribute("total"),t),currency:t,coupon:this.buildSafeCoupon(this.getAttribute("coupon")),complete_delivery:this.hasAttribute("complete-delivery"),items:this.mapCartItems(t)}};this.trackEcommerceEvent(n)}}},42744:(t,n,e)=>{e.d(n,{Z:()=>i});var r=e(98736);class i extends r.Z{mapCartItems(t){return Array.from(document.getElementsByClassName("js-tracking-cart-item")).map(((n,e)=>({item_id:n.dataset.id,item_name:n.dataset.name,affiliation:this.getAffiliation(),index:e,item_brand:this.getBrand(),item_category:this.buildSafeCategory(n.dataset.category),price:this.buildPrice(n.dataset.price,t),quantity:parseFloat(n.dataset.quantity)})))}}},98736:(t,n,e)=>{e.d(n,{Z:()=>o});var r=e(97337),i=e(41139);class o extends r.Z{constructor(){super(...arguments),this.ecommerceTrackingUtil=new i.Z}readyCallback(){}getAffiliation(){return this.ecommerceTrackingUtil.getAffiliation()}getBrand(){return this.ecommerceTrackingUtil.getBrand()}trackEcommerceEvent(t){this.ecommerceTrackingUtil.trackEcommerceEvent(t)}buildPrice(t,n){return this.ecommerceTrackingUtil.buildPriceForTracking(t,n)}buildSafeCategory(t){return this.ecommerceTrackingUtil.buildSafeValue(t)}buildSafeCoupon(t){return this.ecommerceTrackingUtil.buildSafeValue(t)}}},41139:(t,n,e)=>{e.d(n,{Z:()=>i});var r=e(90711);class i{trackEcommerceEvent(t){window.dataLayer.push({ecommerce:null}),window.dataLayer.push(t)}getAffiliation(){return i.AFFILIATION}getBrand(){return i.BRAND}buildPriceForTracking(t,n){var e=parseInt(t);if(!isNaN(e))return this.buildPriceForTrackingFromNumber(e,n)}buildPriceForTrackingFromNumber(t,n){return(0,r.Z)({amount:t,currency:n}).toUnit()}buildSafeValue(t){if(null!==t&&""!==t)return t}}i.AFFILIATION="STAUFF E-Commerce Platform",i.BRAND="STAUFF"},90711:(t,n,e)=>{e.d(n,{Z:()=>S});var r={globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}};function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function o(t){return function(t){if(Array.isArray(t))return t}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(!t)return;if("string"==typeof t)return u(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return u(t,n)}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}var a={normalizePrecision:function(t){var n=t.reduce((function(t,n){return Math.max(t.getPrecision(),n.getPrecision())}));return t.map((function(t){return t.getPrecision()!==n?t.convertPrecision(n):t}))},minimum:function(t){var n=o(t),e=n[0],r=n.slice(1),i=e;return r.forEach((function(t){i=i.lessThan(t)?i:t})),i},maximum:function(t){var n=o(t),e=n[0],r=n.slice(1),i=e;return r.forEach((function(t){i=i.greaterThan(t)?i:t})),i}};function c(t){return!isNaN(parseInt(t))&&isFinite(t)}function s(t){return t%2==0}function l(t){return c(t)&&!Number.isInteger(t)}function m(t){return Math.abs(t)%1==.5}function h(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(e,r){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){4===i.readyState&&(i.status>=200&&i.status<400?e(JSON.parse(i.responseText)):r(new Error(i.statusText)))},onerror:function(){r(new Error("Network error"))}});i.open("GET",t,!0),function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var e in n)t.setRequestHeader(e,n[e])}(i,n.headers),i.send()}))}function f(t){return void 0===t}function d(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",e={};return Object.entries(t).forEach((function(t){if("object"===i(t[1])){var r=d(t[1]);Object.entries(r).forEach((function(r){e[t[0]+n+r[0]]=r[1]}))}else e[t[0]]=t[1]})),e}function g(){var t=function(t,n){var e=function(t){return Math.pow(10,function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0).toString();if(t.indexOf("e-")>0)return parseInt(t.split("e-")[1]);var n=t.split(".")[1];return n?n.length:0}(t))}
1,r=Math.max(e(t),e(n));return Math.round(t*r)*Math.round(n*r)/(r*r)},n={HALF_ODD:function(t){var n=Math.round(t);return m(t)&&s(n)?n-1:n},HALF_EVEN:function(t){var n=Math.round(t);return m(t)?s(n)?n:n-1:n},HALF_UP:function(t){return Math.round(t)},HALF_DOWN:function(t){return m(t)?Math.floor(t):Math.round(t)},HALF_TOWARDS_ZERO:function(t){return m(t)?Math.sign(t)*Math.floor(Math.abs(t)):Math.round(t)},HALF_AWAY_FROM_ZERO:function(t){return m(t)?Math.sign(t)*Math.ceil(Math.abs(t)):Math.round(t)},DOWN:function(t){return Math.floor(t)}};return{add:function(t,n){return t+n},subtract:function(t,n){return t-n},multiply:function(n,e){return l(n)||l(e)?t(n,e):n*e},divide:function(t,n){return t/n},modulo:function(t,n){return t%n},round:function(t){return n[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"HALF_EVEN"](t)}}}var p=g();function v(t){var n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;for(var e in n)t=t.replace("{{".concat(e,"}}"),n[e]);return t};return{getExchangeRate:function(e,r){return(o=t.endpoint,!Boolean(o)||"object"!==i(o)&&"function"!=typeof o||"function"!=typeof o.then?function(e,r){return h(n(t.endpoint,{from:e,to:r}),{headers:t.headers})}(e,r):t.endpoint).then((function(i){return d(i)[n(t.propertyPath,{from:e,to:r})]}));var o}}}function y(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Error;if(!t)throw new e(n)}function b(t){y(function(t){return c(t)&&t<=100&&t>=0}(t),"You must provide a numeric value between 0 and 100.",RangeError)}function A(t){y(Number.isInteger(t),"You must provide an integer.",TypeError)}var E=g(),M=Object.assign((function t(n){var e=Object.assign({},{amount:t.defaultAmount,currency:t.defaultCurrency,precision:t.defaultPrecision},n),r=e.amount,i=e.currency,o=e.precision;A(r),A(o);var u=t.globalLocale,a=t.globalFormat,c=t.globalRoundingMode,s=t.globalFormatRoundingMode,l=Object.assign({},t.globalExchangeRatesApi),m=function(n){var e=Object.assign({},Object.assign({},{amount:r,currency:i,precision:o},n),Object.assign({},{locale:this.locale},n));return Object.assign(t({amount:e.amount,currency:e.currency,precision:e.precision}),{locale:e.locale})},h=function(t){y(this.hasSameCurrency(t),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return r},getCurrency:function(){return i},getLocale:function(){return this.locale||u},setLocale:function(t){return m.call(this,{locale:t})},getPrecision:function(){return o},convertPrecision:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;return A(t),m.call(this,{amount:E.round(E.multiply(this.getAmount(),Math.pow(10,E.subtract(t,this.getPre
vendor: 4,521 bytes, line 1
1cision()))),n),precision:t})},add:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return m.call(this,{amount:E.add(e[0].getAmount(),e[1].getAmount()),precision:e[0].getPrecision()})},subtract:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return m.call(this,{amount:E.subtract(e[0].getAmount(),e[1].getAmount()),precision:e[0].getPrecision()})},multiply:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return m.call(this,{amount:E.round(E.multiply(this.getAmount(),t),n)})},divide:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return m.call(this,{amount:E.round(E.divide(this.getAmount(),t),n)})},percentage:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;return b(t),this.multiply(E.divide(t,100),n)},allocate:function(t){var n=this;!function(t){y(function(t){return t.length>0&&t.every((function(t){return t>=0}))&&t.some((function(t){return t>0}))}(t),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}(t);for(var e=t.reduce((function(t,n){return E.add(t,n)})),r=this.getAmount(),i=t.map((function(t){var i=Math.floor(E.divide(E.multiply(n.getAmount(),t),e));return r=E.subtract(r,i),m.call(n,{amount:i})})),o=0;r>0;)t[o]>0&&(i[o]=i[o].add(m.call(this,{amount:1})),r=E.subtract(r,1)),o+=1;return i},convert:function(t){var n=this,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.endpoint,i=void 0===r?l.endpoint:r,o=e.propertyPath,u=void 0===o?l.propertyPath||"rates.{{to}}":o,a=e.headers,s=void 0===a?l.headers:a,h=e.roundingMode,d=void 0===h?c:h,g=Object.assign({},{endpoint:i,propertyPath:u,headers:s,roundingMode:d});return v(g).getExchangeRate(this.getCurrency(),t).then((function(e){return y(!f(e),'No rate was found for the destination currency "'.concat(t,'".'),TypeError),m.call(n,{amount:E.round(E.multiply(n.getAmount(),parseFloat(e)),g.roundingMode),currency:t})}))},equalsTo:function(t){return this.hasSameAmount(t)&&this.hasSameCurrency(t)},lessThan:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()<e[1].getAmount()},lessThanOrEqual:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()<=e[1].getAmount()},greaterThan:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()>e[1].getAmount()},greaterThanOrEqual:function(n){h.call(this,n);var e=t.normalizePrecision([this,n]);return e[0].getAmount()>=e[1].getAmount()},isZero:function(){return 0===this.getAmount()},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return 0!==E.modulo(this.getAmount(),Math.pow(10,o))},hasCents:function(){return 0!==E.modulo(this.getAmount(),Math.pow(10,o))},hasSameCurrency:function(t){return this.getCurrency()===t.getCurrency()},hasSameAmount:function(n){var e=t.normalizePrecision([this,n]);return e[0].getAmount()===e[1].getAmount()},toFormat:function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,n=function(t){var n=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(t);return{getMatches:function(){return null!==n?n.slice(1).filter((function(t){return!f(t)})):[]},getMinimumFractionDigits:function(){var t=function(t){return"."===t};return f(this.getMatches().find(t))?0:this.getMatches()[p.add(this.getMatches().findIndex(t),1)].split("").length},getCurrencyDisplay:function(){return{USD:"code",dollar:"name",$:"symbol"}[this.getMatches().find((function(t){return"USD"===t||"dollar"===t||"$"===t}))]},getStyle:function(){return f(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!f(this.getMatches().find((function(t){return","===t})))}}}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:a);return this.toRoundedUnit(n.getMinimumFractionDigits(),t).toLocaleString(this.getLocale(),{currencyDisplay:n.getCurrencyDisplay(),useGrouping:n.getUseGrouping(),minimumFractionDigits:n.getMinimumFractionDigits(),style:n.getStyle(),currency:this.getCurrency()})},toUnit:function(){return E.divide(this.getAmount(),Math.pow(10,o))},toRoundedUnit:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,e=Math.pow(10,t);return E.divide(E.round(E.multiply(this.toUnit(),e),n),e)},toObject:function(){return{amount:r,currency:i,precision:o}},toJSON:function(){return this.toObject()}}}),{defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},r,a);const S=M}}]);

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.