"use strict";(self.webpackChunkneurosift_jp=self.webpackChunkneurosift_jp||[]).push([[206],{2206:(e,t,i)=>{i.r(t),i.d(t,{default:()=>r,useModalWindow:()=>h});var n=i(74848),o=i(90481),s=i(1191),l=i(93345);function d(){const{innerWidth:e,innerHeight:t}=window;return{width:e,height:t}}const r=({onClose:e,visible:t,children:i,padding:r,overflow:h})=>{const{width:u,height:a}=(()=>{const[e,t]=(0,l.useState)(d());return(0,l.useEffect)((()=>{function e(){t(d())}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),e})(),c=Math.min(u,a),p=c<400?0:c<500?10:c<600?20:c<800?30:c<1e3?40:50,w=void 0!==r?r:20,f=i,b=e?50:0,v=u-2*p-10,g=a-2*p-10,x=g-b;return(0,n.jsx)(s.Dialog,{fullScreen:!0,open:t,onClose:e,style:{zIndex:9999,left:p,top:p,right:p,bottom:p,background:"white",position:"absolute",border:"2px solid #000"},children:(0,n.jsxs)("div",{style:{zIndex:9999,position:"absolute",width:v,height:g,overflow:"hidden"},children:[(0,n.jsx)("div",{style:{position:"absolute",padding:20},children:e&&(0,n.jsx)(s.IconButton,{onClick:e,children:(0,n.jsx)(o.Close,{})})}),(0,n.jsx)("div",{style:{position:"absolute",left:w,width:v-2*w,top:b+w,height:x-2*w,overflow:h||"auto"},children:f&&(0,n.jsx)(f.type,{...f.props,width:v-2*w,height:x-2*w})})]})})},h=()=>{const[e,t]=(0,l.useState)(!1),i=(0,l.useCallback)((()=>{t(!0)}),[]),n=(0,l.useCallback)((()=>{t(!1)}),[]);return(0,l.useMemo)((()=>({visible:e,handleOpen:i,handleClose:n})),[e,i,n])}}}]);