"use strict";(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[1530],{1530(e,l,t){t.r(l),t.d(l,{default:()=>c});var a=t(1609),n=t(6087),r=t(7723),o=t(6723);const c=({field:e})=>{const l=(0,o.EP)(e.options||"");let t=(0,o.EP)(e.std||"").map(e=>e.value);t=e.multiple?t:t[0];const c=(0,n.useRef)();return(0,n.useEffect)(()=>{const l=jQuery(c.current);l.siblings(".select2-container").remove(),l.select2({allowClear:!0,dropdownAutoWidth:!0,placeholder:e.placeholder||(0,r.__)("Select an item","meta-box-builder"),width:"style"})},[e.multiple,e.std,e.placeholder]),(0,a.createElement)(a.Fragment,null,(0,a.createElement)("select",{multiple:e.multiple,ref:c,value:t,onChange:o.Zi},(0,a.createElement)("option",{value:""},e.placeholder||(0,r.__)("Select an item","meta-box-builder")),l.map(e=>(0,a.createElement)("option",{key:e.value,value:e.value},e.label))),e.multiple&&e.select_all_none&&(0,a.createElement)("div",{className:"rwmb-select-all-none"},(0,r.__)("Select:","meta-box-builder"),"  ",(0,a.createElement)("a",{href:"#"},(0,r.__)("All","meta-box-builder"))," | ",(0,a.createElement)("a",{href:"#"},(0,r.__)("None","meta-box-builder"))))}}}]);