1import{C as d}from"./index-CxHn0Gru.js";import{p as u}from"./parsePhoneNumber-ZxPOqrGk.js";/*! js-cookie v3.0.8 | MIT */function s(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)o!=="__proto__"&&(e[o]=r[o])}return e}var m={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function l(e,t){function r(n,a,i){if(!(typeof document>"u")){i=s({},t,i),typeof i.expires=="number"&&(i.expires=new Date(Date.now()+i.expires*864e5)),i.expires&&(i.expires=i.expires.toUTCString()),n=encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var p in i)i[p]&&(c+="; "+p,i[p]!==!0&&(c+="="+i[p].split(";")[0]));return document.cookie=n+"="+e.write(a,n)+c}}function o(n){if(!(typeof document>"u"||arguments.length&&!n)){for(var a=document.cookie?document.cookie.split("; "):[],i={},c=0;c<a.length;c++){var p=a[c].split("="),h=p.slice(1).join("=");try{var f=decodeURIComponent(p[0]);if(f in i||(i[f]=e.read(h,f)),n===f)break}catch{}}return n?i[n]:i}}return Object.create({set:r,get:o,remove:function(n,a){r(n,"",s({},a,{expires:-1}))},withAttributes:function(n){return l(this.converter,s({},this.attributes,n))},withConverter:function(n){return l(s({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var g=l(m,{path:"/"});const v=()=>new URLSearchParams(window.location.search).get("subOnly")==="true"||g.get("subOnly")==="true",P={isValidURL(e){return!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(e)},trimShopifyURL(e){if(e.includes(".myshopify.com"))return this.trimStoreURL(e);(e.indexOf("http://")===0||e.indexOf("https://")===0)&&(e=e.replace(/^https?\:\/\//i,"")),e=e.split(":")[0],e=e.split("?")[0];let t="/";return e.split(t).slice(0,3).join(t)},trimStoreURL(e){return(e.indexOf("http://")===0||e.indexOf("https://")===0)&&(e=e.replace(/^https?\:\/\//i,"")),e.indexOf("//")>-1?e=e.split("/")[2]:e=e.split("/")[0],e=e.split(":")[0],e=e.split("?")[0],e},addHttps(e){return/^(?:f|ht)tps?\:\/\//.test(e)||(e="https://"+e),e},isPaymentMethodNotFound(e){return e===901},isTransactionErrorFound(e){return e===902},collectNavIds(e){let t=[];const r=o=>{o.forEach(n=>{t.push(n.id),n.children&&n.children.length>0&&r(n.children)})};return r(e),t},getCookieDomain(){let e=window.location.hostname.split(".");return e.length>=2?`.${e[e.length-2]}.${e[e.length-1]}`:e[0]},setCookie(e,t,r,o=null){let n="";if(o!==null){const a=new Date;a.setTime(a.getTime()+o*24*60*60*1e3),n="expires="+a.toUTCString()+";"}document.cookie=e+"="+t+";"+n+"path=/;domain="+r},getAffiliateUrl(e){return{copyfy:"https://zendrop.com/copyfy","checkout-dropshipping-com":"https://zendrop.com/checkout-dropshipping-com","checkout-minea-special-en":"https://zendrop.com/checkout-minea-special-en","checkout-minea-special-fr":"https://zendrop.com/checkout-minea-special-fr"}[e]||""},formatUniversalPhone(e){const t=String(e??"").trim();if(!t)return"";const r=u(t);if(!r)return t;const o=r.countryCallingCode,n=r.nationalNumber,a=n.slice(0,3),i=n.slice(3,6),c=n.slice(6,10);return a&&i&&c?`+${o} (${a}) ${i}-${c}`:a&&i?`+${o} (${a}) ${i}`:a?`+${o} (${a})`:`+${o}`},formExternalAttrSetter(e,t=!1){const r=d.get("affiliate_connector_id")??null,o=d.get("affiliate_type")??null,a=new URLSearchParams(window.location.search).get("referral_name")??null;v()?e.ubb_prohibited=t?1:!0:e.ubb_prohibited=t?0:!1,a&&(e.referral_name=a),r&&o&&(e.affiliate_type=o,e.affiliate_connector_id=r)},getUrlParams(){const e=new URLSearchParams(window.location.search),t={};for(const[r,o]of e.entries())t[r]=o;return t},getCurrentPlan(e){return e?e!=null&&e.has_usage_based_billing?"UBB":e!=null&&e.is_pro_user?"pro":e!=null&&e.is_plus_user?"plus":e!=null&&e.is_free_user?"free":e!=null&&e.is_select_user?"private agent":null:null}};export{g as a,v as i,P as u}; 2//# sourceMappingURL=util-BKLjsQa7.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.