(()=>{"use strict";window.React;const e=window.ReactJSXRuntime,{createElement:r}=wp.element,{registerBlockType:o}=wp.blocks,{InspectorControls:t}=wp.blockEditor?wp.blockEditor:wp.editor,l=wp.serverSideRender?wp.serverSideRender:wp.components.ServerSideRender,{TextControl:n,SelectControl:s,PanelBody:i,Placeholder:a,RadioControl:c,Notice:u}=wp.components,g=r("svg",{width:24,height:24,viewBox:"0 0 32 32"},r("path",{fill:"currentColor",d:"M27.58 4a27.9 27.9 0 0 0-5.17 4 27 27 0 0 0-4.09 5.08 33.06 33.06 0 0 1 2 4.65A23.78 23.78 0 0 1 24 12.15V18a8 8 0 0 1-5.89 7.72l-.21.05a27 27 0 0 0-1.9-8.16A27.9 27.9 0 0 0 9.59 8a27.9 27.9 0 0 0-5.17-4L4 3.77V18a12 12 0 0 0 9.93 11.82h.14a11.72 11.72 0 0 0 3.86 0h.14A12 12 0 0 0 28 18V3.77zM8 18v-5.85a23.86 23.86 0 0 1 5.89 13.57A8 8 0 0 1 8 18zm8-16a3 3 0 1 0 3 3 3 3 0 0 0-3-3z"})),{i18n:d,forms:m,logo_url:f}="undefined"!=typeof ur_form_block_data&&ur_form_block_data,{title:p,form_select:b,form_settings:h,deprecated_notice:_}=void 0!==d&&d;o("user-registration/form-selector",{title:p,icon:g,category:"widgets",attributes:{formId:{type:"string"},formType:{type:"string"},shortcode:{type:"string"},redirectUrl:{type:"string"},logoutUrl:{type:"string"}},supports:{inserter:!1},edit(r){const{attributes:{formId:o="",formType:g="registration_form",shortcode:_="",redirectUrl:v="",logoutUrl:w=""},setAttributes:x}=r,j=Object.keys(m).map(e=>({value:Number(e),label:m[e]}));let y;function S(e){x({formType:e})}function C(e){x({formId:e})}function R(e){x({shortcode:e})}return j.unshift({value:"",label:b}),y=[(0,e.jsx)(t,{children:(0,e.jsxs)(i,{title:h,children:[(0,e.jsx)(c,{selected:g,options:[{label:"Registration Form",value:"registration_form"},{label:"Login Form",value:"login_form"}],onChange:S},"ur-gutenberg-form-selector-radio-control"),"registration_form"===g?(0,e.jsx)(s,{value:o,options:j,onChange:C},"ur-gutenberg-form-selector-registration-form"):[(0,e.jsx)(s,{value:_,options:[{label:"Select Shortcode",value:""},{label:"Login Shortcode",value:"user_registration_login"},{label:"My Account Shortcode",value:"user_registration_my_account"}],onChange:R},"ur-gutenberg-form-selector-login-form"),(0,e.jsx)(n,{label:"Redirect URL",value:v,onChange:function(e){x({redirectUrl:e})}},"ur-gutenberg-form-selector-redirect-url"),(0,e.jsx)(n,{label:"Logout URL",value:w,onChange:function(e){x({logoutUrl:e})}},"ur-gutenberg-form-selector-logout-url")]]})},"ur-gutenberg-form-selector-inspector-controls")],y.push((0,e.jsx)(u,{status:"warning",isDismissible:!1,children:(0,e.jsx)("p",{children:d.deprecated_notice})})),o||""!==_?y.push((0,e.jsx)(l,{block:"user-registration/form-selector",attributes:r.attributes},"ur-gutenberg-form-selector-server-side-renderer")):y.push((0,e.jsxs)(a,{className:"ur-gutenberg-form-selector-wrap",children:[(0,e.jsx)("img",{src:f}),(0,e.jsx)("h2",{children:p}),(0,e.jsx)(c,{selected:g,options:[{label:"Registration Form",value:"registration_form"},{label:"Login Form",value:"login_form"}],onChange:S},"ur-gutenberg-form-selector-radio-control"),"registration_form"===g?(0,e.jsx)(s,{value:o,options:j,onChange:C},"ur-gutenberg-form-selector-select-control"):(0,e.jsx)(s,{selected:_,options:[{label:"Select Shortcode",value:""},{label:"Login Shortcode",value:"user_registration_login"},{label:"My Account Shortcode",value:"user_registration_my_account"}],onChange:R},"ur-gutenberg-form-selector-select-control")]},"ur-gutenberg-form-selector-wrap")),y},save:()=>null})})();