Liferay.Loader.define("commerce-product-content-web@4.0.80/js/TagSelector.es",["module","exports","require","frontend-js-metal-web$metal-component","frontend-js-metal-web$metal-soy","frontend-js-metal-web$metal-state","./TagSelector.soy"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.TagSelector=void 0;var r=_interopRequireDefault(n("frontend-js-metal-web$metal-component")),a=_interopRequireDefault(n("frontend-js-metal-web$metal-soy")),o=n("frontend-js-metal-web$metal-state"),s=_interopRequireDefault(n("./TagSelector.soy"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}class TagSelector extends r.default{focusTagInput_(){this.refs.tagInput.focus()}onEntriesChanged_(){this.rule.queryValues=this.tagsSelector_.entries.keys.join()}rendered(){this.element.addEventListener("click",this.focusTagInput_.bind(this)),AUI().use("liferay-commerce-frontend-asset-tag-selector",(()=>{const e={allowAddEntry:!0,contentBox:this.element,eventName:this.eventName,groupIds:this.groupIds,hiddenInput:"#".concat(this.refs.hiddenInput.getAttribute("id")),input:"#".concat(this.refs.tagInput.getAttribute("id")),portletURL:this.tagSelectorURL,tagNames:this.rule.queryValues||""};this.tagsSelector_=new Liferay.AssetTaglibTagsSelector(e);const t=this.tagsSelector_.entries;t.after("add",this.onEntriesChanged_,this),t.after("remove",this.onEntriesChanged_,this),this.tagsSelector_.render(),this.element.parentNode.removeAttribute("tabindex")}))}}t.TagSelector=TagSelector,TagSelector.STATE={eventName:o.Config.string().value(""),groupIds:o.Config.string().value(""),hiddenInput:o.Config.string().value(""),index:o.Config.number().value(0),namespace:o.Config.string().value(""),rule:o.Config.object().value({}),tagSelectorURL:o.Config.string().value("")},a.default.register(TagSelector,s.default);var i=TagSelector;t.default=i}}));
//# sourceMappingURL=TagSelector.es.js.map