Liferay.Loader.define("@liferay/search-experiences-web@3.0.7/sxp_blueprint_admin/js/shared/PreviewModal",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/icon","@frontend-taglib-clay$clayui/link","@frontend-taglib-clay$clayui/modal","liferay!frontend-js-react-web$react","../utils/constants","../utils/toasts","./CodeMirrorEditor"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.PreviewModalWithCopyDownload=function({children:t,fileName:a,folded:o=!1,lineWrapping:f,readOnly:s=!0,size:y,text:p,title:m,type:b="application/json"}){return i.default.createElement(e,{body:i.default.createElement(i.default.Fragment,null,i.default.createElement(l.default.Group,{spaced:!0},i.default.createElement(l.default,{className:d.COPY_BUTTON_CSS_CLASS,"data-clipboard-text":p,displayType:"secondary",small:!0},i.default.createElement("span",{className:"inline-item inline-item-before"},i.default.createElement(n.default,{symbol:"copy"})),Liferay.Language.get("copy-to-clipboard")),i.default.createElement(r.default,{displayType:"secondary",download:a,href:URL.createObjectURL(new Blob([p],{type:b})),onClick:()=>{(0,u.openSuccessToast)({message:Liferay.Language.get("downloaded")})},outline:!0},i.default.createElement("span",{className:"inline-item inline-item-before"},i.default.createElement(n.default,{symbol:"download"})),Liferay.Language.get("download"))),i.default.createElement(c.default,{folded:o,lineWrapping:f,readOnly:s,value:p})),size:y,title:m},t)},t.default=void 0;var l=y(a("@frontend-taglib-clay$clayui/button")),n=y(a("@frontend-taglib-clay$clayui/icon")),r=y(a("@frontend-taglib-clay$clayui/link")),o=s(a("@frontend-taglib-clay$clayui/modal")),i=s(a("liferay!frontend-js-react-web$react")),d=a("../utils/constants"),u=a("../utils/toasts"),c=y(a("./CodeMirrorEditor"));function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=f();if(t&&t.has(e))return t.get(e);var a={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=l?Object.getOwnPropertyDescriptor(e,n):null;r&&(r.get||r.set)?Object.defineProperty(a,n,r):a[n]=e[n]}return a.default=e,t&&t.set(e,a),a}function y(e){return e&&e.__esModule?e:{default:e}}const e=({body:e,children:t,size:a="md",title:l})=>{const[n,r]=(0,i.useState)(!1),{observer:d}=(0,o.useModal)({onClose:()=>r(!1)});return i.default.createElement(i.default.Fragment,null,n&&i.default.createElement(o.default,{className:"preview-modal",observer:d,size:a},i.default.createElement(o.default.Header,null,l),i.default.createElement(o.default.Body,null,e)),i.default.createElement("div",{onClick:()=>r(!n)},t))};var p=e;t.default=p}}));
//# sourceMappingURL=PreviewModal.js.map