1(()=>{"use strict";const e=window.React,t=window.wp.element,c=window.wp.plugins,n=window.wc.blocksCheckout,l=window.wp.data,i=({cart:c,context:n})=>{if("woocommerce/checkout"!==n)return null;const[i,a]=(0,t.useState)(!1),[r,s]=(0,t.useState)(),{setValidationErrors:d,clearValidationError:p}=(0,l.useDispatch)("wc/store/validation"),{phone:u,country:m,address_1:f,postcode:_,city:h}=c.shippingAddress;window.lpcBlockChangeContent=e=>{s(e)};let g="";null!=c?.shippingRates[0]&&c?.shippingRates[0]?.shipping_rates.forEach((e=>{g=!0===e.selected?e.method_id:g})),(0,t.useEffect)((()=>{"undefined"==typeof lpcPickUpSelection||i||"lpc_relay"!==g||(a(!0),jQuery.ajax({url:lpcPickUpSelection.baseAjaxUrl,type:"POST",dataType:"json",data:{action:"lpc_pickup_ajax_content"},success:function(e){"success"===e.type&&e.data.content!==r&&s(e.data.content)},complete:function(e){a(!1)}}))}),[c?.shippingRates,r]),(0,t.useEffect)((()=>{if(g&&"lpc_relay"===g&&"undefined"!=typeof lpcPickUpSelection)return((e,t)=>{if(!e)return!1;if("BE"!==t)return!0;const c=e.replace(/\s/g,"");if(!c.match(/^\+324\d{8}$/))return!1;const n=c.split("").reverse().map((e=>parseInt(e,10)));let l=!0,i=!0,o=!0;for(let e=0;e<n.length&&7!==e;e++)n[e+1]!==n[e]-1&&(l=!1),n[e+1]!==n[e]+1&&(i=!1),n[e+1]!==n[e]&&(o=!1);return!l&&!i&&!o})(u,m)?void(r&&!r.includes('<div id="lpc_pick_up_info"></div>')?p("lpc_validation"):d({lpc_validation:{message:lpcPickUpSelection.messagePickupRequired,hidden:!1}})):(console.log("pas bien"),void d({lpc_validation:{message:lpcPickUpSelection.messagePhoneRequired,hidden:!1,type:"error"}}))}),[p,d,r,c.shippingAddress.phone,c.shippingAddress.country,c?.shippingRates]);const{validationError:y}=(0,l.useSelect)((e=>({validationError:e("wc/store/validation").getValidationError("lpc_validation")})));return"lpc_relay"!==g?(y&&p("lpc_validation"),null):(jQuery("[data-lpc-template]").off("click").on("click",(function(e){e.preventDefault(),o({template:jQuery(this).attr("data-lpc-template")}),jQuery(this).is("[data-lpc-callback]")&&window[jQuery(this).attr("data-lpc-callback")](jQuery(this))})),jQuery(".lpc_pick_up_widget_show_map").off("click").on("click",(function(e){e.preventDefault(),$affectMethodDiv=jQuery(this).closest(".lpc_order_affect_available_methods"),o({template:"lpc_pick_up_widget_container"});const t={callBackFrame:"lpc_callback"};jQuery.extend(t,window.lpc_widget_info),t.ceAddress=f,t.ceZipCode=_,t.ceTown=h,t.ceCountry=m,jQuery("#lpc_widget_container").frameColissimoOpen(t),jQuery(".lpc-modal .modal-close").on("click",(function(){let e=jQuery("#lpc_widget_container");if(e.length>0)try{e.frameColissimoClose()}catch(e){console.error(e)}}))})),(0,e.createElement)("div",{id:"lpc_gutenberg_block_container"},(0,e.createElement)("div",{dangerouslySetInnerHTML:{__html:r}}),!1===y?.hidden&&(0,e.createElement)("div",null,"â ï¸ ",y?.message)))};function o(e){e.template||console.error("Could not instantiate modal without template");const t=`lpc-modal${e.template}`;let c=document.getElementById(t);if(c)c.style.display="block";else{const n=document.getElementById(`tmpl-${e.template}`);n||console.error("Error while getting the template of the modal"),document.body.insertAdjacentHTML("beforeend",`<div id='${t}'>${n.innerHTML}</div>`),c=document.getElementById(t)}const n=c.querySelectorAll(".modal-close");for(const e of n)e.addEventListener("click",(function(e){e.preventDefault(),c.style.display="none"}))}(0,c.registerPlugin)("lpc-wc-block",{render:()=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(n.ExperimentalOrderShippingPackages,null,(0,e.createElement)(i,null))),scope:"woocommerce-checkout"})})();
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.