Liferay.Loader.define("@liferay/document-library-web@6.0.120/document_library/js/data-engine/panels/InfoPanel.es",["module","exports","require","@frontend-taglib-clay$clayui/loading-indicator","@liferay/frontend-js-react-web","frontend-js-web","liferay!frontend-js-react-web$react"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function InfoPanel({title:e,url:t}){const[r,d]=(0,i.useState)(!0),[o,c]=(0,i.useState)(""),u=(0,a.useIsMounted)();return(0,i.useEffect)((()=>{(0,l.fetch)(t).then((e=>e.text())).then((e=>{u()&&(c(e),d(!1))})).catch((e=>{}))}),[u,t]),i.default.createElement("div",{className:"sidebar-sm"},i.default.createElement("div",{className:"sidebar-header"},i.default.createElement("h2",{className:"component-title",tabIndex:"0"},e)),i.default.createElement("div",{className:"sidebar-body"},r?i.default.createElement(n.default,null):i.default.createElement(InfoPanelBody,{content:o})))};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r("@frontend-taglib-clay$clayui/loading-indicator")),a=r("@liferay/frontend-js-react-web"),l=r("frontend-js-web"),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 r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var l=n?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}r.default=e,t&&t.set(e,r);return r}(r("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}class InfoPanelBody extends i.default.Component{constructor(e){super(e),this._ref=i.default.createRef()}componentDidMount(){this._ref.current&&((0,l.runScriptsInElement)(this._ref.current),this._ref.current.addEventListener("change",this._handleOnChange))}shouldComponentUpdate(){return!1}render(){return i.default.createElement("div",{dangerouslySetInnerHTML:{__html:this.props.content},ref:this._ref})}}}}));
//# sourceMappingURL=InfoPanel.es.js.map