https://team6th.org/wp-content/cache/min/1/insights/v1/paypal-insights.sandbox.min.js?ver=1788649522
1/*! 2 * PayPal Insights Web SDK v1.3.1 (2024-06-11T21:36:25.082Z) 3 * Copyright 2024-present, PayPal, Inc. All rights reserved. 4 */ 5var __paypalInsight__=function(e){"use strict";const t={CONFIG:"config",EVENT:"event",GET:"get",SET:"set"},r={JS_LOAD:"js_load",BEGIN_CHECKOUT:"begin_checkout",END_CHECKOUT:"end_checkout",SUBMIT_CHECKOUT_EMAIL:"submit_checkout_email",SELECT_PAYMENT_METHOD:"select_payment_method",PAGE_VIEW:"page_view",ORDER_CREATED:"order_created"},i={HOMEPAGE:"homepage",ABOUT:"about",CONTACT:"contact",PRODUCT_CATEGORY:"product_category",PRODUCT_DETAILS:"product_details",SEARCH:"search",CART:"cart",MINI_CART:"mini_cart",CHECKOUT:"checkout",ORDER_REVIEW:"order_review",ORDER_CONFIRMATION:"order_confirmation",OTHER:"other"},s={APPLE_PAY:"apple_pay",CARD:"card",GIFT_CERTIFICATE:"gift_certificate",GOOGLE_PAY:"google_pay",AFFIRM:"affirm",STORE_CREDIT:"store_credit",AMAZON_PAY:"amazon_pay",PAYPAL:"paypal",PAYPAL_CREDIT:"paypal_credit",VENMO:"venmo",OTHER:"other"},a={CLIENT_ID:"client_id",MERCHANT_ID:"merchant_id",COMPONENT:"component",USER_AGENT_STRING:"user_agent_string",REFERRER:"referrer",SCREEN_SIZE:"screen_size",CLIENT_SDK_SESSION_ID:"client_sdk_session_id",PAGE_URL:"page_url",PAGE_TITLE:"page_title"},n="insights_sdk_validation_error",o="insights_sdk_error",l="payment_method_selected",d="payment_methods_displayed",u={PAYMENT:"Payment"};function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},c.apply(this,arguments)}function g(e){const{session_id:t,merchant_id:r}=e,i=c({},function(e,t){if(null==e)return{};var r,i,s={},a=Object.keys(e);for(i=0;i<a.length;i++)r=a[i],t.indexOf(r)>=0||(s[r]=e[r]);return s}(e,["session_id","merchant_id"]));return r&&(i.seller_id=r),t&&(i.context_id=t),i}class m{debug(...e){this.isDebugModeEnabled&&console.debug(...e)}info(...e){this.isDebugModeEnabled&&console.info(...e)}warn(...e){this.isDebugModeEnabled&&console.warn(...e)}error(...e){this.isDebugModeEnabled&&console.error(...e)}group(...e){this.isDebugModeEnabled&&console.group(...e)}groupEnd(){this.isDebugModeEnabled&&console.groupEnd()}dir(...e){this.isDebugModeEnabled&&console.dir(...e)}setEventName(e){this.logQueueMetadata.eventName=e}addLogToBuffer(e,t){this.logQueueMetadata.isSuccess=!(null==t?void 0:t.isError),this.logQueue.push(e)}flush(){const{eventName:e,isSuccess:t}=this.logQueueMetadata;this.group(`[PayPal Insights] event "${e}" - ${t?"successfully registered":"failed to register"}`),this.logQueue.forEach((e=>{e()})),this.groupEnd(),this.logQueue=[],this.logQueueMetadata={eventName:null,isSuccess:!1}}constructor(){this.logQueue=[],this.logQueueMetadata={eventName:null,isSuccess:!1},this.isDebugModeEnabled=!1}}const{CLIENT_SDK_SESSION_ID:h}=a;function p(){const e=function(e){try{return window.sessionStorage.getItem(e)}catch(e){return null}}(h);if(e)return e;const t=function(){var e;if("function"==typeof(null==(e=window.crypto)?void 0:e.randomUUID))return window.crypto.randomUUID().replace(/-/g,"");const t="0123456789abcdefghijklmnopqrstuvwxyz";let r="";for(let e=0;e<32;e++){const e=Math.floor(36*Math.random());r+=t.charAt(e)}return r}();return function(e,t){try{window.sessionStorage.setItem(e,t)}catch(e){return}}(h,t),t}function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},v.apply(this,arguments)}const f="info",_="warn",E="debug",b="error";const y={send:function({endpoint:e,payload:t,debug:r}){if(r)return console.log("Debug Log:"),void console.dir(JSON.parse(t));let i=!1;if(window&&window.navigator&&window.navigator.sendBeacon&&window.Blob)try{const r=new Blob([t],{type:"application/json"});i=navigator.sendBeacon(e,r)}catch(e){i=!1}i||fetch(e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)})}};class N{log(e,t,r={}){const i=this.payloadBuilder(v({},r,{timestamp:(new Date).toISOString()}));return this.logBuffer.push({level:e,event:t,payload:i}),this}info(e,t={}){return this.log(f,e,t)}debug(e,t={}){return this.log(E,e,t)}
5error(e,t={}){return this.log(b,e,t),this.flush(),this}warn(e,t={}){return this.log(_,e,t)}track(e){const t=this.trackingBuilder(e);return this.trackingBuffer.push(t),this}metricCounter(e){var t;this.metricNamespacePrefix&&(e.metricNamespace=`${this.metricNamespacePrefix}.${e.metricNamespace}`);const r=this.metricBuilder(v({},e,{metricValue:null!=(t=e.metricValue)?t:1,metricType:"counter"}));return this.metricsBuffer.push(r),this}metricGauge(e){this.metricNamespacePrefix&&(e.metricNamespace=`${this.metricNamespacePrefix}.${e.metricNamespace}`);const t=this.metricBuilder(v({},e,{metricNamespace:this.metricNamespacePrefix||e.metricNamespace,metricType:"gauge"}));return this.metricsBuffer.push(t),this}getLogs(){return[...this.logBuffer]}getTracking(){return[...this.trackingBuffer]}getMetrics(){return[...this.metricsBuffer]}pause(){return this.isPaused=!0,this}resume(){return this.isPaused=!1,this.sendBuffer(),this}flush(){this.sendBuffer()}resetFlushInterval(e=this.flushInterval){return this.sendInterval&&clearInterval(this.sendInterval),this.sendInterval=setInterval(this.sendBuffer.bind(this),e),this}setPayloadBuilder(e){return this.payloadBuilder=e,this}setTrackingBuilder(e){return this.trackingBuilder=e,this}enableDebugMode(e=!0){return this.isDebug=e,this}formatDataForSend(){const e=this.logBuffer,t=this.trackingBuffer;return{events:e,metrics:this.metricsBuffer,tracking:t}}clearAllBuffers(){this.logBuffer=[],this.trackingBuffer=[],this.metricsBuffer=[]}shouldFlush(){return!1===this.isPaused&&Boolean(this.logBuffer.length||this.trackingBuffer.length||this.metricsBuffer.length)}sendBuffer(){if(!1===this.shouldFlush())return;const e=this.formatDataForSend();this.transport.send({endpoint:this.endpoint,debug:this.isDebug,payload:JSON.stringify(e)}),this.clearAllBuffers()}onVisibilityChange(){var e;"hidden"===(null==(e=document)?void 0:e.visibilityState)&&this.flush()}onPageExit(){this.flush()}constructor({endpoint:e,transport:t,flushInterval:r,metricNamespacePrefix:i}){var s,a;this.payloadBuilder=e=>e,this.trackingBuilder=e=>e,this.metricBuilder=e=>e,this.endpoint=e,this.flushInterval=null!=r?r:6e4,this.transport=null!=t?t:y,this.metricNamespacePrefix=null!=i?i:"",this.logBuffer=[],this.trackingBuffer=[],this.metricsBuffer=[],this.isPaused=!1,this.sendInterval=null,this.payloadBuilder=e=>e,this.trackingBuilder=e=>e,this.metricBuilder=e=>e,this.isDebug=!1,this.resetFlushInterval(),null==(s=document)||s.addEventListener("visibilitychange",this.onVisibilityChange.bind(this)),null==(a=document)||a.addEventListener("pagehide",this.onPageExit.bind(this))}}var V="1.3.1",C="sandbox";function P(){return P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},P.apply(this,arguments)}class T{get loggingServerUrl(){return"https://www.sandbox.paypal.com/xoplatform/logger/api/logger?disableSetCookie=true"}stringifyErrorForLogs(e){try{if(e instanceof Error){let t=null==e?void 0:e.stack;if(t&&t.lastIndexOf("\n")){const e=255;t=t.slice(0,e),t=t.slice(0,t.lastIndexOf("\n"))}const r=null==e?void 0:e.message;if(t&&r)return t.includes(r)?t:`${r}\n${t}`;if(t)return t;if(r)return r}if("string"==typeof e)return e;if("function"==typeof(null==e?void 0:e.toString))return e.toString()}catch(e){this.loggerClient.metricCounter({metricNamespace:"error.count",metricEventName:"error",dimensions:{type:"stringify_error"}}).error(o,{error:"Error attempting to stringify error for logs"})}}constructor(){this.loggerClient=new N({endpoint:this.loggingServerUrl,flushInterval:4e3,metricNamespacePrefix:"pp.sdks.insights"}),this.loggerClient.setPayloadBuilder((e=>P({},e,{version:V,env:C,url:window.location.href})))}}function I({type:e,attributeName:t,value:r}){return void 0===r?{isValid:!1,error:{attributeName:t,errorMessage:`'${t}' is required.`}}:typeof r!==e?{isValid:!1,error:{attributeName:t,errorMessage:`'${t}' is expected to be a ${e}.`}}:{isValid:!0}}function w({value:e,attributeName:t,expectedLength:r}){const i=I({type:"string",attributeName:t,value:e});return i.isValid?""===(null==e?void 0:e.trim())?{isValid:!1,error:{attributeName:t,errorMessage:`'${t}' cannot be an empty string.`}}:r&&e.length!==r?{isValid:!1,error:{attributeName:t,errorMessage:`'${t}' must be a ${r} character string.`}}:{isValid:!0}:i}function O({value:e,attributeName:t}){return I({type:"boolean",attributeName:t,value:e})}function M(e={}){const t=[];if(0===Object.keys(e).length)return{isValid:!1,errors:[{attributeName:"amount",errorMessage:"'amount' object is required."}]};const{currency_code:r,value:i}=e,s=w({attributeName:"amount.value",value:"number"==typeof i?String(i):i});
5s.isValid||t.push(s.error);const a=w({attributeName:"amount.currency_code",value:r,expectedLength:3});if(a.isValid||t.push(a.error),t.length)return{isValid:!1,errors:t};if("string"==typeof i){const e=parseFloat(i);if(isNaN(e))return{isValid:!1,errors:[{attributeName:"amount.value",errorMessage:"'amount.value' must be valid number."}]}}return{isValid:!0,validEventParameters:{currency_code:null==r?void 0:r.toUpperCase(),value:i}}}const A={CONTROL:"control",TEST:"test",INELIGIBLE:"ineligible"};function S(e){const t=[];return void 0===e&&t.push({attributeName:"experiment",errorMessage:"'experiment' is required."}),Array.isArray(e)||t.push({attributeName:"experiment",errorMessage:"'experiment' is expected to be an array."}),t.length?{isValid:!1,errors:t}:(e.forEach((({exp_name:e,treatment_name:r,ramp:i},s)=>{const a=w({attributeName:`experiment[${s}].exp_name`,value:e});a.isValid||t.push(a.error);const n=w({attributeName:`experiment[${s}].treatment_name`,value:r});n.isValid||t.push(n.error);const o=w({attributeName:`experiment[${s}].ramp`,value:i});if(o.isValid||t.push(o.error),t.length)return{isValid:!1,errors:t};if(!Object.values(A).includes(r)){const e=Object.values(A).join(", ");t.push({attributeName:`experiment[${s}].treatment_name`,errorMessage:`'experiment[${s}].treatment_name' is invalid. Expected one of the following values: ${e}.`})}"%"!==i.slice(-1)&&t.push({attributeName:`experiment[${s}].ramp`,errorMessage:"'experiment.ramp' must end with %"})})),t.length?{isValid:!1,errors:t}:{isValid:!0,validEventParameters:e})}function B(e){const t=w({attributeName:"page_type",value:e});if(!t.isValid)return{isValid:!1,errors:[t.error]};if(!Object.values(i).includes(e)){return{isValid:!1,errors:[{attributeName:"page_type",errorMessage:`'page_type' is invalid. Expected one of the following values: ${Object.values(i).join(", ")}`}]}}return{isValid:!0,validEventParameters:e}}function x(e){const{isValid:t,error:r}=w({attributeName:"session_id",value:e});return t?{isValid:t,validEventParameters:e}:{isValid:t,errors:[r]}}function D(e={}){const t=[];if(0===Object.keys(e).length)return{isValid:!1,errors:[{attributeName:"user_data",errorMessage:"'user_data' object is required."}]};const{country:r,is_store_member:i}=e,s=w({attributeName:"user_data.country",value:r,expectedLength:2});s.isValid||t.push(s.error);const a=O({attributeName:"user_data.is_store_member",value:i});return a.isValid||t.push(a.error),t.length?{isValid:!1,errors:t}:{isValid:!0,validEventParameters:{country:r,is_store_member:i}}}function k({amount:e,page_type:t,session_id:r,user_data:i,experiment:s}={}){let a=[];const n={};if(void 0!==t){const e=B(t);e.isValid?n.page_type=e.validEventParameters:a=[...a,...e.errors]}if(void 0!==s){const e=S(s);e.isValid?n.experiment=e.validEventParameters:a=[...a,...e.errors]}const o=M(e);o.isValid?n.amount=o.validEventParameters:a=[...a,...o.errors];const l=x(r);l.isValid?n.session_id=l.validEventParameters:a=[...a,...l.errors];const d=D(i);return d.isValid?n.user_data=d.validEventParameters:a=[...a,...d.errors],a.length?{isValid:!1,errors:a}:{isValid:!0,validEventParameters:n}}function L({page_type:e,experiment:t,session_id:r}={}){let i=[];const s={};if(void 0!==e){const t=B(e);t.isValid?s.page_type=t.validEventParameters:i=[...i,...t.errors]}if(void 0!==t){const e=S(t);e.isValid?s.experiment=e.validEventParameters:i=[...i,...e.errors]}const a=x(r);return a.isValid?s.session_id=a.validEventParameters:i=[...i,...a.errors],i.length?{isValid:!1,errors:i}:{isValid:!0,validEventParameters:s}}function R(e,t){const r=w({attributeName:t||"an attribute",value:e});if(!r.isValid)return{isValid:!1,errors:[r.error]};if(!Object.values(s).includes(e)){return{isValid:!1,errors:[{attributeName:t,errorMessage:`'${t}' is invalid. Expected one of the following values: ${Object.values(s).join(", ")}`}]}}return{isValid:!0,validEventParameters:e}}function $({payment_method_selected:e,page_type:t,session_id:r,experiment:i}={}){let s=[];const a={},n=R(e,l);n.isValid?a.payment_method_selected=n.validEventParameters:s=[...s,...n.errors];const o=B(t);o.isValid?a.page_type=o.validEventParameters:s=[...s,...o.errors];const d=x(r);if(d.isValid?a.session_id=d.validEventParameters:s=[...s,...d.errors],void 0!==i){const e=S(i);e.isValid?a.experiment=e.validEventParameters:s=[...s,...e.errors]}return s.length?{isValid:!1,errors:s}:{isValid:!0,validEventParameters:a}}function j({amount:e,payment_method_selected:t,page_type:r,session_id:i,user_data:s,experiment:a}={}){let n=[];const o={},d=M(e);d.isValid?o.amount=d.validEventParameters:n=[...n,...d.errors];const u=R(t,l);u.isValid?o.payment_method_selected=u.validEventParameters:n=[...n,...u.errors];const c=B(r);c.isValid?o.page_type=c.validEventParameters:n=[...n,...c.errors];const g=D(s);g.isValid?o.user_data=g.validEventParameters:n=[...n,...g.errors];const m=x(i);if(m.isValid?o.session_id=m.validEventParameters:n=[...n,...m.errors],void 0!==a){const e=S(a);e.isValid?o.experiment=e.validEventParameters:n=[...n,...e.errors]}return n.length?{isValid:!1,errors:n}:{isValid:!0,validEventParameters:o}}function G({timestamp:e}={}){const{isValid:t,error:r}=function({value:e,attributeName:t}){return I({type:"number",attributeName:t,value:e})}({attributeName:"timestamp",value:e});return t?{isValid:t,validEventParameters:{timestamp:e}}:{isValid:t,errors:[r]}}function U({page_type:e,session_id:t,payment_methods_displayed:r,insights_used:i,insights_reference:s,user_data:a,experiment:n}={}){let o=[];const l={},c=B(e);c.isValid?l.page_type=c.validEventParameters:o=[...o,...c.errors];const g=x(t);if(g.isValid?l.session_id=g.validEventParameters:o=[...o,...g.errors],void 0===r){const e={attributeName:d,errorMessage:`'${d}' is required.`};o.push(e)}else if(Array.isArray(r))if(0===r.length){const e={attributeName:d,errorMessage:`'${d}
5' is invalid. Must pass at least one payment method.`};o.push(e)}else for(const e of r){const t=R(e,d);var m;if(t.isValid)(m=l).payment_methods_displayed||(m.payment_methods_displayed=[]),l.payment_methods_displayed.push(t.validEventParameters);else o=[...o,...t.errors]}else{const e={attributeName:d,errorMessage:`'${d}' is invalid. Must pass an array of values.`};o.push(e)}if(void 0===i){const e={attributeName:"insights_used",errorMessage:"'insights_used' is required."};o.push(e)}else if(Array.isArray(i))if(0===i.length){const e={attributeName:"insights_used",errorMessage:"'insights_used' is invalid. Must pass at least one insight type."};o.push(e)}else for(const e of i){if(w({attributeName:"insights_used",value:e}).isValid&&Object.values(u).includes(e)){var h;(h=l).insights_used||(h.insights_used=[]),l.insights_used.push(e)}else{const e={attributeName:"insights_used",errorMessage:`'insights_used' is invalid. Expected one of the following values: ${Object.values(u).join(", ")}`};o.push(e)}}else{const e={attributeName:"insights_used",errorMessage:"'insights_used' is expected to be an array."};o.push(e)}if(void 0===s);else if(Array.isArray(s))if(0===s.length){const e={attributeName:"insights_reference",errorMessage:"'insights_reference' is invalid. Must pass at least one insight reference."};o.push(e)}else for(const e of s){const t=w({attributeName:"insights_reference",value:e});var p;if(t.isValid)(p=l).insights_reference||(p.insights_reference=[]),l.insights_reference.push(e);else o.push(t.error)}else{s=[];const e={attributeName:"insights_reference",errorMessage:"'insights_reference' is expected to be an array."};o.push(e)}if(void 0!==a){const e=D(a);e.isValid?l.user_data=e.validEventParameters:o=[...o,...e.errors]}if(void 0!==n){const e=S(n);e.isValid?l.experiment=e.validEventParameters:o=[...o,...e.errors]}return o.length?{isValid:!1,errors:o}:{isValid:!0,validEventParameters:l}}function F({order_id:e,session_id:t,user_data:r}={}){let i=[];const s={},a=function(e){const{isValid:t,error:r}=w({attributeName:"order_id",value:e});return t?{isValid:t,validEventParameters:e}:{isValid:t,errors:[r]}}(e);a.isValid?s.order_id=a.validEventParameters:i=[...i,...a.errors];const n=x(t);if(n.isValid?s.session_id=n.validEventParameters:i=[...i,...n.errors],void 0!==r){const e=D(r);e.isValid?s.user_data=e.validEventParameters:i=[...i,...e.errors]}return i.length?{isValid:!1,errors:i}:{isValid:!0,validEventParameters:s}}function H(){return H=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},H.apply(this,arguments)}const K=new class{getPageAttributes(){return{[a.COMPONENT]:"insights_sdk",[a.USER_AGENT_STRING]:window.navigator.userAgent,[a.REFERRER]:document.referrer,[a.SCREEN_SIZE]:`${window.innerWidth}x${window.innerHeight}`,[a.CLIENT_SDK_SESSION_ID]:p(),[a.PAGE_URL]:window.location.href,[a.PAGE_TITLE]:document.title}}processDataLayer(){try{if(!(window.paypalInsightDataLayer&&Array.isArray(window.paypalInsightDataLayer)&&window.paypalInsightDataLayer.length))return;window.paypalInsightDataLayer.forEach((e=>{const[t,r,i]=e;this.send(t,r,i)}))}catch(e){this.loggerClient.metricCounter({metricNamespace:"error.count",metricEventName:"error",dimensions:{type:"process_data_layer"}}).error(o,{description:"process data layer",error:this.stringifyErrorForLogs(e)})}}updateGlobalTrackingAttributes(e){this.globalTrackingAttributes=H({},this.globalTrackingAttributes,e)}configCommand(e,t={debug:!1}){const{isValid:r,validEventParameters:i,errors:s}=function({client_id:e,merchant_id:t,debug:r}={}){let i=[];const s={};if(void 0!==t){const e=w({attributeName:"merchant_id",value:t});e.isValid?s.merchant_id=t:i=[...i,e.error]}if(void 0!==r){const e=O({attributeName:"debug",value:r});e.isValid?s.debug=r:i=[...i,e.error]}const a=w({attributeName:"client_id",value:e});return a.isValid?s.client_id=e:i=[...i,a.error],i.length?{isValid:!1,errors:i}:{isValid:!0,validEventParameters:s}}(H({client_id:e},t));this.debuggingConsole.isDebugModeEnabled=Boolean(t.debug),r?(this.loggerClient.metricCounter({metricNamespace:"success.count",metricEventName:"success",dimensions:{command:"config"}}
5),this.updateGlobalTrackingAttributes(i)):(this.debuggingConsole.group('[PayPal Insights] invalid options passed to "config"'),s.forEach((t=>{this.debuggingConsole.warn(t.errorMessage),this.loggerClient.warn(n,{command:"config",error:t.errorMessage,clientId:e}).metricCounter({metricNamespace:"error.count",metricEventName:"error",dimensions:{type:"validation",command:"config"}})})),this.debuggingConsole.groupEnd())}getCommand(e){return this.globalTrackingAttributes[e]}setCommand(e){const{isValid:t,validEventParameters:r,errors:i}=function({session_id:e,experiment:t,page_type:r,user_data:i,payment_method_selected:s,amount:a}={}){let n=[];const o={};if(void 0!==r){const e=B(r);e.isValid?o.page_type=e.validEventParameters:n=[...n,...e.errors]}if(void 0!==t){const e=S(t);e.isValid?o.experiment=e.validEventParameters:n=[...n,...e.errors]}if(void 0!==e){const t=x(e);t.isValid?o.session_id=t.validEventParameters:n=[...n,...t.errors]}if(void 0!==i){const e=D(i);e.isValid?o.user_data=e.validEventParameters:n=[...n,...e.errors]}if(void 0!==s){const e=R(s,l);e.isValid?o.payment_method_selected=e.validEventParameters:n=[...n,...e.errors]}if(void 0!==a){const e=M(a);e.isValid?o.amount=e.validEventParameters:n=[...n,...e.errors]}return n.length?{isValid:!1,errors:n}:{isValid:!0,validEventParameters:o}}(e);t?this.updateGlobalTrackingAttributes(r):(this.debuggingConsole.group('[PayPal Insights] invalid options passed to "set"'),i.forEach((e=>{this.debuggingConsole.warn(e.errorMessage),this.loggerClient.warn(n,{command:"set",error:e.errorMessage}).metricCounter({metricNamespace:"error.count",metricEventName:"error",dimensions:{type:"validation",command:"set"}})})),this.debuggingConsole.groupEnd())}processValidationErrors(e,t){e.forEach((e=>{const r=`Error at: ${e.attributeName}. Message: ${e.errorMessage}`;this.debuggingConsole.addLogToBuffer((()=>{this.debuggingConsole.warn(r)}),{isError:!0}),this.loggerClient.warn(n,{event:t,error:r}).metricCounter({metricNamespace:"error.count",metricEventName:"error",dimensions:{type:"validation",command:t}})}))}eventCommand(e,t){const i=H({},this.globalTrackingAttributes,t);let s;switch(this.debuggingConsole.setEventName(e),e){case r.JS_LOAD:s=G;break;case r.BEGIN_CHECKOUT:s=k;break;case r.SUBMIT_CHECKOUT_EMAIL:s=L;break;case r.SELECT_PAYMENT_METHOD:s=$;break;case r.END_CHECKOUT:s=j;break;case r.PAGE_VIEW:s=U;break;case r.ORDER_CREATED:s=F;break;default:return this.debuggingConsole.addLogToBuffer((()=>{const t=Object.values(r).join(", "),i=`The event name "${e}" is invalid. Expected one of the following values: ${t}`;this.debuggingConsole.warn(i)}),{isError:!0}),this.loggerClient.warn(n,{command:"event",error:`Invalid event name: ${e}`}).metricCounter({metricNamespace:"error.count",metricEventName:"error",dimensions:{type:"validation",command:"invalid_event_name"}}),void this.debuggingConsole.flush()}this.debuggingConsole.addLogToBuffer((()=>{this.debuggingConsole.info(`The event name "${e}" is a valid name`)}));const a=s(i);let o;if(!a.isValid)return this.processValidationErrors(a.errors,e),void this.debuggingConsole.flush();o=a.validEventParameters,this.loggerClient.metricCounter({metricNamespace:"success.count",metricEventName:"success",dimensions:{command:e}}),this.debuggingConsole.addLogToBuffer((()=>{this.debuggingConsole.info("The following event parameters are valid and are sent:"),this.debuggingConsole.dir(o)}));const l=function(e){const t={},r={};return Object.keys(e).forEach((i=>{const s=e[i];if(null!=s&&"function"!=typeof s)if("string"==typeof s||"number"==typeof s||"boolean"==typeof s)t[i]=s;else try{t[i]=JSON.stringify(s)}catch(e){r[i]={invalidValue:s,errorDetail:e.message}}else r[i]={invalidValue:s,errorDetail:"Invalid value."}})),{validValues:t,invalidValues:r}}(H({},this.globalTrackingAttributes,o)).validValues;this.loggerClient.track(H({t:Date.now(),event_name:e,space_key:"SKS09G"},this.getPageAttributes(),g(l))),this.debuggingConsole.flush()}send(...e){try{const[r,i,s]=e;switch(r){case t.CONFIG:this.configCommand(i,s);break;case t.SET:this.setCommand(i);break;case t.GET:return this.getCommand(i);case t.EVENT:this.eventCommand(i,s);break;default:return this.debuggingConsole.addLogToBuffer((()=>{const e=Object.values(t).join(", ");this.debuggingConsole.warn(`The command "${String(r)}
5" is invalid. Expected one of the following values: ${e}`)}),{isError:!0}),this.loggerClient.warn(n,{error:`Invalid command name: ${String(r)}`}).metricCounter({metricNamespace:"error.count",metricEventName:"error",dimensions:{type:"validation",command:"invalid_command_name"}}),void this.debuggingConsole.flush()}}catch(e){this.loggerClient.metricCounter({metricNamespace:"error.count",metricEventName:"error",dimensions:{type:"send_event"}}).error(o,{error:this.stringifyErrorForLogs(e)})}}constructor(){this.debuggingConsole=new m;const e=new T;this.loggerClient=e.loggerClient,this.stringifyErrorForLogs=e.stringifyErrorForLogs,this.globalTrackingAttributes={},this.processDataLayer(),!function(){try{const e=window.sessionStorage;return e.setItem("test_key","test_value"),e.getItem("test_key"),e.removeItem("test_key"),!0}catch(e){return!1}}()?this.loggerClient.warn(o,{error:"window.sessionStorage is not supported"}).metricCounter({metricNamespace:"error.count",metricEventName:"error",dimensions:{type:"session_storage_not_supported"}}):this.updateGlobalTrackingAttributes({[a.CLIENT_SDK_SESSION_ID]:p()})}},Q=K.send.bind(K),Y=V;return e.paypalInsight=Q,e.version=Y,e}({});window.paypalInsight=__paypalInsight__.paypalInsight,window.paypalInsight.version=__paypalInsight__.version
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.