Liferay.Loader.define("@liferay/content-dashboard-web@2.0.85/js/components/SidebarPanelInfoView/Share",["module","exports","require","frontend-js-web","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react"],(function(e,r,t){window;{Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=t("frontend-js-web"),a=(function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(t("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 r=_getRequireWildcardCache();if(r&&r.has(e))return r.get(e);var t={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=n?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(t,a,o):t[a]=e[a]}t.default=e,r&&r.set(e,t);return t}(t("liferay!frontend-js-react-web$react")));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}var _default=({fetchSharingButtonURL:e,onError:r})=>{const t=(0,a.useRef)(null);return(0,a.useEffect)((()=>{t.current&&(0,n.fetch)(e).then((r=>{if(!r.ok)throw new Error("Failed to fetch ".concat(e));return r.text()})).then((e=>{t.current.innerHTML=e,(0,n.runScriptsInElement)(t.current)})).catch((e=>{r&&r()}))}),[e,r]),a.default.createElement("span",{ref:t})};r.default=_default}}));
//# sourceMappingURL=Share.js.map