var G=Object.create;var y=Object.defineProperty,V=Object.defineProperties,Y=Object.getOwnPropertyDescriptor,q=Object.getOwnPropertyDescriptors,N=Object.getOwnPropertyNames,S=Object.getOwnPropertySymbols,J=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var D=(e,o,n)=>o in e?y(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,v=(e,o)=>{for(var n in o||(o={}))T.call(o,n)&&D(e,n,o[n]);if(S)for(var n of S(o))M.call(o,n)&&D(e,n,o[n]);return e},R=(e,o)=>V(e,q(o));var k=(e,o)=>{var n={};for(var t in e)T.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(e!=null&&S)for(var t of S(e))o.indexOf(t)<0&&M.call(e,t)&&(n[t]=e[t]);return n};var K=(e,o)=>{for(var n in o)y(e,n,{get:o[n],enumerable:!0})},B=(e,o,n,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of N(o))!T.call(e,i)&&i!==n&&y(e,i,{get:()=>o[i],enumerable:!(t=Y(o,i))||t.enumerable});return e};var z=(e,o,n)=>(n=e!=null?G(J(e)):{},B(o||!e||!e.__esModule?y(n,"default",{value:e,enumerable:!0}):n,e)),L=e=>B(y({},"__esModule",{value:!0}),e);var de={};K(de,{default:()=>le});module.exports=L(de);var r=require("@chakra-ui/react");var c=require("@chakra-ui/react"),P=z(require("@emotion/styled"),1);var x=require("react"),F=z(require("@emotion/styled"),1),w=require("@chakra-ui/icons"),m=require("@chakra-ui/react");var $=z(require("react"),1),d=require("@chakra-ui/react"),_=require("@chakra-ui/anatomy");var f=require("react/jsx-runtime"),W=$.default.forwardRef((g,h)=>{var I=g,{label:e,error:o,placeholder:n,helperText:t,isInvalid:i,as:u=d.Input,InputLeftAddon:p,InputRightAddon:C}=I,b=k(I,["label","error","placeholder","helperText","isInvalid","as","InputLeftAddon","InputRightAddon"]);let{disabled:A}=b;return(0,f.jsxs)(d.FormControl,{isInvalid:i,opacity:A?.4:1,children:[e&&(0,f.jsx)(d.Text,{color:i?"destructive":"foreground",fontWeight:"medium",fontSize:"sm",lineHeight:1,children:e}),(0,f.jsxs)(d.InputGroup,{mt:"2",children:[p,(0,f.jsx)(u,R(v({variant:"",placeholder:n},b),{ref:h})),C]}),t&&(0,f.jsx)(d.Text,{fontSize:"xs",mt:2,color:"mutedForeground",children:t}),i&&o&&(0,f.jsx)(d.Text,{fontSize:"xs",mt:2,color:"destructive",children:o})]})}),{definePartsStyle:E,defineMultiStyleConfig:Q}=(0,d.createMultiStyleConfigHelpers)(_.inputAnatomy.keys),X=E({field:{color:"foreground",background:"background",boxShadow:"base",borderWidth:"1px",borderStyle:"solid",borderColor:"input",borderRadius:"lg",_focusVisible:{borderColor:"ring"},_hover:{},_disabled:{opacity:1},_placeholder:{color:"mutedForeground"}}}),Z=(0,d.defineStyle)({borderRadius:"md"}),U={sm:E({field:Z})},ce=Q({baseStyle:X,sizes:U});var s=require("react/jsx-runtime"),ee=(0,F.default)(m.Box)`
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px;
  height: 40px;
  border-radius: 12px;
`,O=(0,F.default)(m.Button)`
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  height: 32px;
  width: 32px;
  //border-radius: 12px;
  //border: none;
  //border: 1px solid ${e=>e.theme.colors.border};
  pointer-events: ${e=>e.disabled?"none":"unset"};
  opacity: ${e=>e.disabled?"0.5":"1"};

  &:active {
    border: 1px solid ${e=>e.theme.colors.foreground};
  }

  svg {
    path {
      fill: ${e=>e.theme.colors.foreground};
    }
  }
`,oe=(0,F.default)(W)`
  justify-content: center;
  font-size: 18px;
  min-width: 60px;
  user-select: none;
  border: none;
  box-shadow: none;
  max-width: 80px;
  text-align: center;
`,te=({initialState:e=1,maxState:o,onChange:n,value:t,onError:i})=>{let[u,p]=(0,x.useState)(e);return(0,x.useEffect)(()=>{n(u)},[u]),(0,x.useEffect)(()=>{p(e)},[e]),(0,x.useEffect)(()=>{o>0&&t>o||u<1?i(!0):i(!1)},[o,t,u]),(0,s.jsxs)(m.Flex,{flexDirection:"column",alignItems:"flex-end",children:[(0,s.jsxs)(ee,{children:[(0,s.jsx)(O,{variant:"outline",onClick:()=>{t>e&&p(g=>t-1)},disabled:t===1,children:(0,s.jsx)(w.MinusIcon,{})}),(0,s.jsx)(oe,{value:t,onChange:g=>{let I=Number(g.target.value);p(I)}}),(0,s.jsx)(O,{variant:"outline",onClick:()=>{o?t<o&&p(g=>t+1):p(g=>t+1)},disabled:o===t||!o,children:(0,s.jsx)(w.AddIcon,{})})]}),(o>0&&t>o||u<1)&&(0,s.jsxs)(m.Text,{fontSize:12,mt:10,color:"#E11900",children:["Enter quantity between 1 to ",o]})]})},H=te;var a=require("react/jsx-runtime"),ne=(0,P.default)(c.Flex)`
  position: relative;
`,re=({duration:e,setDuration:o,loading:n,subTotalPrice:t,payUsing:i})=>(0,a.jsxs)(ne,{paddingY:4,flexDir:"column",alignItems:"center",children:[(0,a.jsx)(H,{initialState:1,maxState:1e4,onChange:o,onError:()=>{},value:e}),(0,a.jsxs)(c.Flex,{w:"full",justifyContent:"space-between",alignItems:"center",children:[(0,a.jsx)(c.Text,{fontSize:14,mt:4,fontWeight:"bold",children:`${e} year registration`}),(0,a.jsxs)(c.Flex,{alignItems:"flex-end",justifyContent:"center",mt:4,children:[n?(0,a.jsx)(c.Spinner,{size:"xs",mb:"1.5"}):(0,a.jsx)(c.Text,{fontSize:14,fontWeight:"bold",children:`${t==null?void 0:t.toFixed(5)}`}),(0,a.jsx)(c.Text,{ml:"1",fontSize:14,fontWeight:"bold",children:i==null?void 0:i.ticker})]})]})]}),j=re;var l=require("react/jsx-runtime"),ie=({selectedDomain:e,duration:o,selectDuration:n,onOpen:t,onClose:i,isOpen:u,loading:p,subTotalPrice:C,payUsing:b})=>{let h=(0,r.useToast)();return(0,l.jsxs)(r.Flex,{justifyContent:"space-between",children:[(0,l.jsxs)(r.Flex,{alignItems:"center",children:[(0,l.jsx)(r.Text,{fontSize:"12",mr:"1",children:"Duration:"}),(0,l.jsx)(r.Text,{textDecoration:"underline",fontSize:"12",cursor:"pointer",onClick:()=>{if(!e)return h({title:"Select Domain",status:"warning"});t()},children:"Edit"})]}),(0,l.jsx)(r.Text,{fontSize:"12",mr:"1",children:`${o} Year`}),(0,l.jsxs)(r.Modal,{blockScrollOnMount:!1,isOpen:u,onClose:i,isCentered:!0,children:[(0,l.jsx)(r.ModalOverlay,{}),(0,l.jsxs)(r.ModalContent,{children:[(0,l.jsx)(r.ModalHeader,{children:"Registration duration"}),(0,l.jsx)(r.ModalCloseButton,{}),(0,l.jsxs)(r.ModalBody,{children:[(0,l.jsx)(r.Text,{fontSize:"12",py:"2",px:"4",borderColor:"mutedForeground",borderWidth:"1px",borderStyle:"solid",borderRadius:"8",children:"Extending for multiple years will save money on network costs by avoiding yearly transactions."}),(0,l.jsx)(j,{duration:o,setDuration:n,loading:p,subTotalPrice:C,payUsing:b})]})]})]})]})},le=ie;
