Liferay.Loader.define("commerce-frontend-taglib@19.1.14/user_roles_modal/RoleListItem.es",["module","exports","require","frontend-js-metal-web$metal-component","frontend-js-metal-web$metal-soy","./RoleListItem.soy","../autocomplete_item/AutocompleteItem.es"],(function(e,t,o){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.RoleListItem=void 0;var r=_interopRequireDefault(o("frontend-js-metal-web$metal-component")),i=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var n=r?Object.getOwnPropertyDescriptor(e,i):null;n&&(n.get||n.set)?Object.defineProperty(o,i,n):o[i]=e[i]}o.default=e,t&&t.set(e,o);return o}(o("frontend-js-metal-web$metal-soy")),n=_interopRequireDefault(o("./RoleListItem.soy"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}o("../autocomplete_item/AutocompleteItem.es");class RoleListItem extends r.default{syncSelectedRoles(){return this._selected=this.selectedRoles.reduce(((e,t)=>e||t.id===this.id),!1),this._selected}_handleToggleItem(e){return e.preventDefault(),this.emit("toggleItem",{id:this.id,name:this.name})}}t.RoleListItem=RoleListItem,i.default.register(RoleListItem,n.default),RoleListItem.STATE={_selected:i.Config.bool().value(!1),id:i.Config.oneOfType([i.Config.number(),i.Config.string()]),name:i.Config.string(),query:i.Config.string(),selectedRoles:i.Config.array(i.Config.shapeOf({id:i.Config.oneOfType([i.Config.number(),i.Config.string()]),name:i.Config.string()})).value([])};var l=RoleListItem;t.default=l}}));
//# sourceMappingURL=RoleListItem.es.js.map