Liferay.Loader.define("commerce-frontend-js@4.0.75/components/add_to_wish_list/AddToWishList",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/icon","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../utilities/notifications","./util/LegacyWishListResource"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=_interopRequireDefault(r("@frontend-taglib-clay$clayui/button")),n=_interopRequireDefault(r("@frontend-taglib-clay$clayui/icon")),a=(_interopRequireDefault(r("liferay!frontend-js-react-web$prop-types")),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 r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var a=i?Object.getOwnPropertyDescriptor(e,n):null;a&&(a.get||a.set)?Object.defineProperty(r,n,a):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react"))),o=r("../../utilities/notifications"),l=_interopRequireDefault(r("./util/LegacyWishListResource"));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}}function _objectWithoutProperties(e,t){if(null==e)return{};var r,i,n=function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,i,n={},a=Object.keys(e);for(i=0;i<a.length;i++)r=a[i],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function AddToWishList(e){let{iconOnly:t,isInWishList:r,large:c}=e,u=_objectWithoutProperties(e,["iconOnly","isInWishList","large"]);const[s,f]=(0,a.useState)(r);return a.default.createElement(i.default,{className:"btn-outline-borderless btn-".concat(c?"lg":"sm"),displayType:"secondary",onClick:()=>l.default.toggleInWishList(u).then((({success:e})=>f(e))).catch((e=>{(0,o.showErrorNotification)(e)}))},!t&&a.default.createElement("span",{className:"text-truncate-inline"},a.default.createElement("span",{className:"font-weight-normal text-truncate"},Liferay.Language.get("add-to-list"))),a.default.createElement("span",{className:"wish-list-icon"},a.default.createElement(n.default,{symbol:"heart".concat(s?"-full":"")})))}AddToWishList.defaultProps={isInWishList:!1,large:!1};var c=AddToWishList;t.default=c}}));
//# sourceMappingURL=AddToWishList.js.map