(()=>{"use strict";const e=window.qf.blocks,t=window.qf.adminComponents,a=window.React,n=window.wp.i18n,l={color:"#127fa9",icon:()=>React.createElement("svg",{height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},React.createElement("g",null,React.createElement("path",{d:"M16.75 3.75a.75.75 0 0 0-1.5 0v3.5h-6.5v-3.5a.75.75 0 0 0-1.5 0v3.5h-2.5a.75.75 0 0 0 0 1.5h2.5v6.5h-2.5a.75.75 0 0 0 0 1.5h2.5v3.5a.75.75 0 0 0 1.5 0v-3.5h6.5v3.5a.75.75 0 0 0 1.5 0v-3.5h2.5a.75.75 0 0 0 0-1.5h-2.5v-6.5h2.5a.75.75 0 0 0 0-1.5h-2.5v-3.5zm-8 11.5v-6.5h6.5v6.5h-6.5z"}))),controls:e=>{const{attributes:{setMin:l,min:o,setMax:r,max:c},setAttributes:m}=e,i=99999999999999,s=e=>{let t=e;t<1&&(t=1),l&&o&&t<o&&(t=o),m({max:t})};return React.createElement(a.Fragment,null,React.createElement(t.BaseControl,null,React.createElement(t.ControlWrapper,{orientation:"horizontal"},React.createElement(t.ControlLabel,{label:(0,n.__)("Set min number","quillforms")}),React.createElement(t.ToggleControl,{checked:l,onChange:()=>{m({setMin:!l}),s(1)}})),l&&React.createElement(t.TextControl,{type:"number",placeholder:"0-"+(r&&c?c:i),value:o,onChange:e=>m({min:e}),onBlur:()=>(e=>{let t=e;t<0&&(t=0),r&&c&&t>c&&(t=c),m({min:t})})(o)})),React.createElement(t.BaseControl,null,React.createElement(t.ControlWrapper,{orientation:"horizontal"},React.createElement(t.ControlLabel,{label:(0,n.__)("Set max number","quillforms")}),React.createElement("div",{role:"presentation",className:"switch-control-wrapper"},React.createElement(t.ToggleControl,{checked:r,onChange:()=>{m({setMax:!r}),s(1)}}))),r&&React.createElement(t.TextControl,{type:"number",placeholder:(l&&o?o:1)+"-"+i,value:c,onChange:e=>m({max:e}),onBlur:()=>s(c)})))},logicControl:({value:e,setValue:n})=>{const[l,o]=(0,a.useState)(e);return(0,a.useEffect)((()=>{n(parseInt(l,10))}),[l]),React.createElement(t.TextControl,{type:"number",value:e,onChange:e=>o(e)})},title:(0,n.__)("Number","quillforms"),order:4},{name:o}={name:"number",supports:{editable:!0,required:!0,attachment:!0,description:!0,logic:!0,placeholder:!0,defaultValue:!0,theme:!0,numeric:!0,payments:!0},attributes:{setMax:{type:"boolean",default:!1},max:{type:"number",default:0},setMin:{type:"boolean",default:!1},min:{type:"number",default:0}},logicalOperators:["is","is_not","greater_than","lower_than"]};(0,e.setBlockAdminSettings)(o,l),(window.qf=window.qf||{}).blocklibNumberBlockAdmin={}})();