(()=>{"use strict";const e=window.qf.blocks,t=window.qf.adminComponents,o=window.React,a=window.emotion,n=window.wp.i18n,c={color:"#2eaf8b",title:"Dropdown",icon:({color:e="currentColor",size:t=24})=>React.createElement("svg",{viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg"},React.createElement("g",{id:"Layer_11","data-name":"Layer 11"},React.createElement("path",{d:"m201.28 400a77.4 77.4 0 0 0 109.44 0l178.61-178.59a77.39 77.39 0 1 0 -109.44-109.41l-123.89 123.87-123.89-123.87a77.39 77.39 0 1 0 -109.44 109.41zm-151.74-261.16a39.4 39.4 0 0 1 55.7 0l137.32 137.33a19 19 0 0 0 26.88 0l137.32-137.33a39.39 39.39 0 1 1 55.7 55.7l-178.61 178.62a39.4 39.4 0 0 1 -55.7 0l-178.61-178.62a39.38 39.38 0 0 1 0-55.7z"}))),controls:e=>{const{attributes:{choices:a},setAttributes:c}=e;return React.createElement(o.Fragment,null,React.createElement(t.BaseControl,null,React.createElement(t.ControlWrapper,{orientation:"horizontal"},React.createElement(t.ControlLabel,{label:(0,n.__)("Choices","quillforms")}),React.createElement(t.ChoicesBulkBtn,{choices:a,setChoices:e=>{c({choices:e})}})),React.createElement(t.ControlWrapper,{orientation:"vertical"},React.createElement(t.ChoicesInserter,{choices:a,setChoices:e=>{c({choices:e})}}))))},logicControl:({attributes:e,value:n,setValue:c,removeCondition:l})=>{const{choices:r}=e;(0,o.useEffect)((()=>{n?r.some((e=>e.value===n))||l():c(r[0].value)}),[]);const i=r.map(((e,t)=>({key:e.value,name:e.label?e.label:`Choice ${t+1}`})));return React.createElement(t.SelectControl,{className:a.css`
				margin-top: 10px;
				margin-bottom: 10px;
			`,value:i.find((e=>e.key===n)),onChange:e=>{c(e.selectedItem.key)},options:i})},order:6,getChoices:({attributes:e})=>{var t;return null!==(t=e?.choices)&&void 0!==t?t:[]}},{name:l}={name:"dropdown",attributes:{choices:{type:"array",items:{type:"object",properties:{value:{type:"string"},label:{type:"string"}}},default:[{value:"123e45z7o89b",label:"Choice 1"}]}},supports:{editable:!0,required:!0,attachment:!0,description:!0,logic:!0,theme:!0,points:!0,payments:!0,choices:!0},logicalOperators:["is","is_not"]};(0,e.setBlockAdminSettings)(l,c),(window.qf=window.qf||{}).blocklibDropdownBlockAdmin={}})();