1import{r as P,b as o,v as c,M as l,a as N,c as f,p as M,T as A,o as T}from"./web-CFqaUbgd.js";import"./bootstrap-BEcmssc5.js";const K=["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BRL","BSD","BTC","BTN","BWP","BYR","BZD","CAD","CDF","CHF","CLF","CLP","CNY","COP","CRC","CUC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EEK","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GGP","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HRK","HTG","HUF","IDR","ILS","IMP","INR","IQD","IRR","ISK","JEP","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LTL","LVL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRO","MTL","MUR","MVR","MWK","MXN","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLL","SOS","SRD","STD","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","UYU","UZS","VEF","VND","VUV","WST","XAF","XAG","XAU","XCD","XDR","XOF","XPD","XPF","XPT","YER","ZAR","ZMK","ZMW","ZWL"];function L(r){return K.indexOf(r)!==-1}function p(r,n,e,t,D){if(!P.rr())return!1;if(e==null&&(e="USD"),t==null&&(t=1),r==null||r.length<=0)return o.error('logPurchase requires a non-empty productId, got "'.concat(r,'", ignoring.')),!1;if(!c(r,"log purchase","the purchase name"))return!1;if(n==null||isNaN(parseFloat(n.toString())))return o.error("logPurchase requires a numeric price, got ".concat(n,", ignoring.")),!1;const i=parseFloat(n.toString()).toFixed(2);if(t==null||isNaN(parseInt(t.toString())))return o.error("logPurchase requires an integer quantity, got ".concat(t,", ignoring.")),!1;const s=parseInt(t.toString());if(s<1||s>l)return o.error("logPurchase requires a quantity >1 and <".concat(l,", got ").concat(s,", ignoring.")),!1;if(e=e!=null?e.toUpperCase():e,!L(e))return o.error("logPurchase requires a valid currencyCode, got ".concat(e,", ignoring.")),!1;const[g,S]=N(D,"logPurchase","purchaseProperties",'log purchase "'.concat(r,'"'),"purchase");if(!g)return!1;const u=P.l();if(u&&u.$r(r))return o.info('Purchase "'.concat(r,'" is blocklisted, ignoring.')),!1;const a=f.Dt(M.Pr,{pid:r,c:e,p:i,q:s,pr:S});if(a.lt){o.info("Logged ".concat(s," purchase").concat(s>1?"s":"",' of "').concat(r,'" for ').concat(e," ").concat(i,"."));for(const R of a.Ce)A.o().Ee(T.qr,[r,D],R)}return a.lt}export{p as logPurchase};
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.