Liferay.Loader.define("account-admin-web@2.0.39/account_entries_admin/js/PersonAccountEntryEventHandler.es",["module","exports","require","frontend-js-web","frontend-js-metal-web$metal-state"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=n("frontend-js-web"),r=n("frontend-js-metal-web$metal-state");class e extends s.PortletBase{attached(){this.selectUserButton.addEventListener("click",this._handleSelectUserButtonClicked),this._removeUserButtonHandle=(0,s.delegate)(this.container,"click",this.removeUserLinkSelector,this._handleRemoveUserButtonClicked.bind(this))}created(){this._handleSelectUserButtonClicked=this._handleSelectUserButtonClicked.bind(this)}detached(){super.detached(),this.selectUserButton.removeEventListener("click",this._handleSelectUserButtonClicked),this._removeUserButtonHandle.dispose()}_handleOnSelect(e){this._setSearchContainerUser(e)}_handleRemoveUserButtonClicked(){this.searchContainer.deleteRow(1,this.searchContainer.getData()),this.userIdInput.value=null}_handleSelectUserButtonClicked(){this._selectAccountUser()}_selectAccountUser(){(0,s.openSelectionModal)({id:this.ns(this.selectUserEventName),onSelect:this._handleOnSelect.bind(this),selectEventName:this.ns(this.selectUserEventName),selectedData:[this.userIdInput.value],title:Liferay.Language.get("assign-user"),url:this.selectUserURL})}_setSearchContainerUser({emailaddress:e,entityid:t,entityname:n,jobtitle:s}){this.userIdInput.value=t,this.searchContainer.deleteRow(1,this.searchContainer.getData()),this.searchContainer.addRow([n,e,s,this.removeUserIconMarkup],t),this.searchContainer.updateDataStore([t])}_setSearchContainer(e){return Liferay.SearchContainer.get(this.ns(e))}_setElement(e){return this.one(e)}}e.STATE={container:r.Config.string().setter("_setElement"),removeUserIconMarkup:r.Config.string(),removeUserLinkSelector:r.Config.string(),searchContainer:r.Config.string().setter("_setSearchContainer"),selectUserButton:r.Config.string().setter("_setElement"),selectUserEventName:r.Config.string(),selectUserURL:r.Config.string(),userIdInput:r.Config.string().setter("_setElement")};var i=e;t.default=i}}));
//# sourceMappingURL=PersonAccountEntryEventHandler.es.js.map