(()=>{"use strict";const e=window.React,t=window.wp.blocks,i=window.wp.element,n=(0,i.forwardRef)((function({icon:e,size:t=24,...n},a){return(0,i.cloneElement)(e,{width:t,height:t,...n,ref:a})})),a=window.wp.primitives,o=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{fillRule:"evenodd",d:"M5 5.5h14a.5.5 0 01.5.5v1.5a.5.5 0 01-.5.5H5a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 9.232A2 2 0 013 7.5V6a2 2 0 012-2h14a2 2 0 012 2v1.5a2 2 0 01-1 1.732V18a2 2 0 01-2 2H6a2 2 0 01-2-2V9.232zm1.5.268V18a.5.5 0 00.5.5h12a.5.5 0 00.5-.5V9.5h-13z",clipRule:"evenodd"})),c=window.wp.i18n,r=window.wp.blockEditor,l=window.wp.components,d=({attributes:t,setAttributes:n,setPhoneNumber:a})=>{const{phoneVerification:o}=t;return(0,i.useEffect)((()=>{const e=(navigator.language||"en").split(",")[0].substr(0,2),t=rc_options.gdpr_implementation||!1,i=rc_options.js_implementation||!1,o=rc_options.app_key||"";rc_options.gdpr_consent_message,t?(document.getElementById("widget-point").innerHTML='<div id="xyz" data-widget data-locale="'+e+'" data-type="dual" data-mode="signup"></div>',document.getElementById("gdpr_consent").value="false",i&&(document.getElementById("ringcaptcha_verified").value="false"),new RingCaptcha.Widget("#xyz",{app:o,locale:e,events:{verified:function(){document.getElementById("ringcaptcha_verified").value="true",n("verified")}}}).setup()):i?(document.getElementById("widget-point").innerHTML='<div id="xyz" data-widget data-locale="'+e+'" data-type="dual" data-mode="signup"></div>',document.getElementById("ringcaptcha_verified").value="false",new RingCaptcha.Widget("#xyz",{app:o,locale:e,events:{verified:function(){document.getElementById("ringcaptcha_verified").value="true",n("verified")}}}).setup()):(document.getElementById("widget-point").innerHTML='<div data-widget data-app="'+o+'" data-locale="'+e+'" data-type="dual"></div>',new RingCaptcha.Widget("[data-widget]",{app:o,locale:e,events:{verified:function(){document.getElementById("ringcaptcha_verified").value="true";const e=document.getElementsByName("ringcaptcha_phone_number");n("verified"),a(e[0].value)}}}).setup()),document.querySelectorAll(".panel.woocommerce_options_panel").forEach((function(e){console.log("Panel ID:",e.id,"Display:",e.style.display)}))}),[]),(0,e.createElement)("div",null,(0,e.createElement)("div",{id:"widget-point"}),(0,e.createElement)("input",{id:"gdpr_consent",type:"hidden",name:"gdpr_consent",value:"false"}),(0,e.createElement)("input",{id:"ringcaptcha_verified",type:"hidden",name:"ringcaptcha_verified",value:"false"}))},s=JSON.parse('{"apiVersion":2,"name":"ringcaptcha/ringcaptcha-block","version":"1.0.0","title":"Phone Verification Block","category":"woocommerce","description":"A block for phone verification on the checkout page.","supports":{"html":false,"align":false,"multiple":false,"reusable":false},"parent":["woocommerce/checkout-shipping-address-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"textdomain":"ringcaptcha-phone-verification-on-checkout-sms-order-notifications","editorScript":"file:../../../build/ringcaptcha-block.js","editorStyle":"file:../../../build/style-ringcaptcha-block.css"}');(0,t.registerBlockType)(s,{icon:{src:(0,e.createElement)(n,{icon:o})},edit:({attributes:t,setAttributes:i})=>{const{phoneVerification:n}=t,a=(0,r.useBlockProps)();return(0,e.createElement)("div",{...a},(0,e.createElement)(r.InspectorControls,null,(0,e.createElement)(l.PanelBody,{title:(0,c.__)("Phone Verification Settings","ringcaptcha-phone-verification-on-checkout-sms-order-notifications")},(0,e.createElement)(l.TextControl,{label:(0,c.__)("Verification Code","ringcaptcha-phone-verification-on-checkout-sms-order-notifications"),value:n,onChange:e=>i({phoneVerification:e})}))),(0,e.createElement)(d,{attributes:t,setAttributes:i}))},save:({attributes:t})=>{const{phoneVerification:i}=t;return(0,e.createElement)("div",{...r.useBlockProps.save()},(0,e.createElement)("p",null,i))}})})();