"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/extends"),t=require("@babel/runtime/helpers/taggedTemplateLiteral"),r=require("@babel/runtime/helpers/defineProperty"),o=require("@babel/runtime/helpers/objectWithoutProperties"),i=require("react"),n=require("react-transition-group"),a=require("clsx"),l=require("@prom-ui/core/Backdrop"),c=require("@prom-ui/core/Button"),d=require("@prom-ui/core/Icon"),s=require("@prom-ui/core/KeyPress"),u=require("@prom-ui/core/Portal"),p=require("@prom-ui/core/BodyProvider"),m=require("@prom-ui/icons/Close2");function f(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function b(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var y,O=f(e),h=f(t),v=f(r),g=f(o),P=b(i),j=f(a),q={root:"LXzJW",closeButton:"IfZSD",rootContent:"p62nO",enter:"CYsVE",exit:"-sfQK",enterActive:"Q3lip",exitActive:"_2XLH4"},E=["isOpen","isRenderPortal","isBodyScrollLock","isShowCloseButton","zIndex","width","height","padding","onClose","className","style","children"];function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){v.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var B=function(e){var t=e.isOpen,r=void 0!==t&&t,o=e.isRenderPortal,i=void 0===o||o,a=e.isBodyScrollLock,f=void 0===a||a,b=e.isShowCloseButton,v=void 0===b||b,w=e.zIndex,B=void 0===w?5e3:w,C=e.width,S=void 0===C?"auto":C,k=e.height,_=void 0===k?"auto":k,D=e.padding,I=void 0===D?36:D,N=e.onClose,z=e.className,L=e.style,R=e.children,T=g.default(e,E),K=p.useBodyStoreTTag().t,A=P.useRef(null);return P.createElement(P.Fragment,null,P.createElement(l.Backdrop,{isOpen:r,zIndex:B,isRenderPortal:i,isBodyScrollLock:f}),P.createElement(n.CSSTransition,{nodeRef:A,in:r,timeout:240,classNames:q,unmountOnExit:!0},P.createElement(u.Portal,{isActive:i},P.createElement(s.KeyPress,{code:"Escape",onKeyDown:N}),P.createElement("div",{ref:A,className:q.root,role:"dialog","aria-modal":!0,"aria-labelledby":void 0,style:{zIndex:B},onClick:function(e){e.target===e.currentTarget&&N(e)},"data-qaid":T["data-qaid"]||"modal","data-testid":T["data-testid"]||"modal"},P.createElement("div",O.default({className:j.default(q.rootContent,z),style:x({width:S,height:_,padding:I},L)},T,{"data-qaid":"modal_content","data-testid":"modal_content"}),R,v&&P.createElement("div",{className:q.closeButton},P.createElement(c.Button,{"button-theme":"black-inherit","button-padding":"xxs",type:"button",onClick:N,"aria-label":K(y||(y=h.default(["Закрыть"]))),"data-qaid":"modal_close_button","data-testid":"modal_close_button"},P.createElement(d.Icon,{"icon-as":m.SvgClose2,style:{width:24,height:24}}))))))))};B.displayName="Modal",exports.Modal=B,require("./style.production.css");
