"use strict";var e=require("@babel/runtime/helpers/defineProperty"),r=require("prop-types"),n=require("react-image-lightbox"),t=require("@material-ui/icons/SaveAlt"),o=require("@material-ui/icons/ArrowBack");require("../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js");var i=require("react/jsx-runtime");require("../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js"),require("../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/RemoveAppButton.js"),require("../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js"),require("../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js"),require("../DevCenter/DevCenterAppContainer/components/NonPriorityMenus/NonPriorityMenus.js"),require("../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js"),require("../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js"),require("../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js"),require("../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js"),require("../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js");var s=require("../DevCenter/DevCenterAppContainer/components/IsInsideDcAppProvider/IsInsideDcAppProvider.js"),a=require("./styles.css.js");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=p(e),l=p(r),u=p(n),d=p(t),m=p(o);function C(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function v(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?C(Object(n),!0).forEach((function(r){c.default(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}var f=function(e){return i.jsx("div",{className:a.cImageViewerToolbar,children:i.jsx("button",{type:"button","aria-label":"Close",className:a.cImageViewerToolbarButton,onClick:e.onCloseRequest,children:i.jsx(m.default,{className:a.cImageViewerToolbarIcon,htmlColor:"#fff"})})})},D=function(e){var r=s.useIsInsideDcApp();return i.jsx("div",{className:a.cImageViewer,children:i.jsx(u.default,{mainSrc:e.mainSrc,imagePadding:e.imagePadding,toolbarButtons:[i.jsx("button",{"data-testid":"".concat("ImageViewer","_download"),type:"button","aria-label":"Download",className:a.cImageViewerToolbarButton,children:i.jsx("a",{href:e.mainSrc,download:"image",target:"_blank",rel:"noopener noreferrer",children:i.jsx(d.default,{className:a.cImageViewerToolbarIcon,htmlColor:"#fff"})})})],onAfterOpen:e.onAfterOpen,onCloseRequest:e.onCloseRequest,reactModalStyle:{overlay:{zIndex:1500}},reactModalProps:{parentSelector:function(){return r?parent.document.body:document.body},overlayElement:function(e,r){return i.jsxs("div",v(v({},e),{},{children:[i.jsx(f,{onCloseRequest:e.onCloseRequest}),r]}))}},wrapperClassName:a.cImageViewerWrapper})})};D.propTypes={mainSrc:l.default.string.isRequired,imagePadding:l.default.number,onAfterOpen:l.default.func,onCloseRequest:l.default.func},f.propTypes={onCloseRequest:l.default.func.isRequired},D.defaultProps={imagePadding:50,onAfterOpen:void 0,onCloseRequest:void 0},module.exports=D;
