(()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t){var n=function(t){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(n)?n:n+""}function n(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,t(o.key),o)}}function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}function o(e,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},o(e,t)}const i=gutenverseCoreFrontend;function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(c=function(){return!!e})()}var u=function(t){function u(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),t=this,o=arguments,n=r(n=u),function(t,n){if(n&&("object"==e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t)}(t,c()?Reflect.construct(n,o||[],r(t).constructor):n.apply(t,o));var t,n,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&o(e,t)}(u,t),f=u,(l=[{key:"init",value:function(){var e=this;this.choiceInstance=null,this._elements.map(function(t){e._selectItems(t)}),this.placeholder=""}},{key:"_selectItems",value:function(e){var t=this;(0,i.u)(e).find(".gutenverse-input-multiselect").map(function(n){t.choiceInstance=new i.Choices(n,{removeItemButton:!0,shouldSort:!1,placeholder:!1}),n.addEventListener("change",function(t){if(t.target.length>0){var n=(0,i.u)(e).find(".choices__input.choices__input--cloned");this.placeholder=n.nodes[0].placeholder,n.nodes[0].placeholder=""}})})}},{key:"destroy",value:function(){this.choiceInstance.destroy()}}])&&n(f.prototype,l),Object.defineProperty(f,"prototype",{writable:!1}),f;var f,l}(i.Default);if(!window.GutenverseData.activePlugins.includes("gutenverse-form/gutenverse-form.php")){var f=(0,i.u)(".guten-form-input-multiselect");f&&new u(f)}})();