PageSourceSearch

https://raspberryshake.org/wp-content/plugins/wc-cart-pdf/assets/js/wc-cart-pdf.js?ver=955e5b967937

js raspberryshake.org collected 2026-10-02 03:03:14 UTC 4,263 bytes, 6 lines download raw bytes

1(()=>{function m(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var c in r)c!=="__proto__"&&(e[c]=r[c])}return e}var C={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 g(e,n){function r(o,i,t){if(typeof document!="undefined"){t=m({},n,t),typeof t.expires=="number"&&(t.expires=new Date(Date.now()+t.expires*864e5)),t.expires&&(t.expires=t.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var d in t)t[d]&&(a+="; "+d,t[d]!==!0&&(a+="="+t[d].split(";")[0]));return document.cookie=o+"="+e.write(i,o)+a}}function c(o){if(!(typeof document=="undefined"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],t={},a=0;a<i.length;a++){var d=i[a].split("="),f=d.slice(1).join("=");try{var u=decodeURIComponent(d[0]);if(u in t||(t[u]=e.read(f,u)),o===u)break}catch(l){}}return o?t[o]:t}}return Object.create({set:r,get:c,remove:function(o,i){r(o,"",m({},i,{expires:-1}))},withAttributes:function(o){return g(this.converter,m({},this.attributes,o))},withConverter:function(o){return g(m({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(e)}})}var v=g(C,{path:"/"});var _=(e,n)=>{let r;return(...c)=>{clearTimeout(r),r=setTimeout(()=>e(...c),n)}},h=e=>{let n=cartpdf.capture_fields||[];try{if(!e||typeof e!="object")throw new Error("Invalid object");for(let c in e)n.includes(c)||delete e[c];let r=JSON.stringify(e);v.set("wc-cart-pdf-customer",r)}catch(r){console.error(r)}},D=()=>{if(typeof wp!="undefined"&&wp&&wp.data){let r=_(()=>{let c=wp.data.select("wc/store/cart");if(typeof c!="object")return;let o=c.getCustomerData(),i={};for(let t in o.shippingAddress)i[`shipping_${t}`]=o.shippingAddress[t];for(let t in o.billingAddress)i[`billing_${t}`]=o.billingAddress[t];h(i)},250);wp.data.subscribe(r)}let e=document.querySelector('form[name="checkout"]'),n=e==null?void 0:e.querySelectorAll("input, textarea, select");n==null||n.forEach(r=>{r.addEventListener("change",function(c){c.preventDefault();let o=new FormData(e),i={};o.forEach(function(t,a){i[a]=t}),h(i)})})},w=D;var S=()=>{let e=document.getElementById("wc-cart-pdf-modal"),n=e==null?void 0:e.querySelector("form"),r=n==null?void 0:n.getAttribute("action"),c=e==null?void 0:e.querySelector("#wc-cart-pdf-capture-form-errors");if(!e||!n||!r||!c){console.error("Cart PDF for WooCommerce: Modal capture elements not found.");return}let o=document.querySelector(".cart-pdf-button"),i=!1;function t(f){(f.target===e||f.target===e.querySelector(".wc-cart-pdf-modal-close"))&&(e.close(),e.removeEventListener("click",t))}function a(f){f.preventDefault(),e.showModal(),n.querySelector("input").focus(),e.addEventListener("click",t)}function d(){let u=setInterval(()=>{document.querySelector(".cart-pdf-button")&&(clearInterval(u),document.querySelector(".cart-pdf-button").addEventListener("click",a))},250)}o!=null&&o.addEventListener("click",a)||d(),n.addEventListener("submit",function(f){if(f.preventDefault(),i)return;i=!0;let u=new FormData(n),l={};for(let[s,p]of u.entries())l[s]=p;v.set("wc-cart-pdf-customer",JSON.stringify(l)),l.nonce=cartpdf.nonce,fetch(`${cartpdf.ajax_url}?action=wc_cart_pdf_modal_form_save`,{method:"POST",body:new URLSearchParams(l).toString(),headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(s=>s.json()).then(s=>{if(!s.success)c.textContent=(s==null?void 0:s.data)||"An error occurred.";else{let p=new URL(r);l.email_copy&&l.email_copy==="1"&&p.searchParams.set("email_copy","1"),window.location.href=p.toString(),e.close()}}).catch(s=>{var p;c.textContent=((p=s==null?void 0:s.responseJSON)==null?void 0:p.data)||"An error occurred."}).finally(()=>{i=!1})})},y=S;(function(){document.addEventListener("DOMContentLoaded",function(){var e,n;(e=cartpdf==null?void 0:cartpdf.modules)!=null&&e.capture_customer&&w(),(n=cartpdf==null?void 0:cartpdf.modules)!=null&&n.modal_capture&&y()})})();})();
2/*! Bundled license information:
3
4js-cookie/dist/js.cookie.mjs:
5  (*! js-cookie v3.0.8 | MIT *)
6*/

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.