var _=Object.create;var h=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var H=(e,o)=>{for(var r in o)h(e,r,{get:o[r],enumerable:!0})},F=(e,o,r,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of E(o))!P.call(e,i)&&i!==r&&h(e,i,{get:()=>o[i],enumerable:!(n=W(o,i))||n.enumerable});return e};var T=(e,o,r)=>(r=e!=null?_(O(e)):{},F(o||!e||!e.__esModule?h(r,"default",{value:e,enumerable:!0}):r,e)),j=e=>F(h({},"__esModule",{value:!0}),e);var X={};H(X,{default:()=>Q});module.exports=j(X);var t=require("@chakra-ui/react");var c=require("@chakra-ui/react"),R=T(require("@emotion/styled"),1),ie=require("react");var b=require("react"),I=T(require("@emotion/styled"),1),S=require("@chakra-ui/icons"),m=require("@chakra-ui/react");var z=T(require("react"),1),d=require("@chakra-ui/react"),M=require("@chakra-ui/anatomy"),f=require("react/jsx-runtime"),D=z.default.forwardRef(({label:e,error:o,placeholder:r,helperText:n,isInvalid:i,as:u=d.Input,InputLeftAddon:p,InputRightAddon:y,...g},C)=>{let{disabled:x}=g;return(0,f.jsxs)(d.FormControl,{isInvalid:i,opacity:x?.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,{variant:"",placeholder:r,...g,ref:C}),y]}),n&&(0,f.jsx)(d.Text,{fontSize:"xs",mt:2,color:"mutedForeground",children:n}),i&&o&&(0,f.jsx)(d.Text,{fontSize:"xs",mt:2,color:"destructive",children:o})]})}),{definePartsStyle:v,defineMultiStyleConfig:A}=(0,d.createMultiStyleConfigHelpers)(M.inputAnatomy.keys),G=v({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"}}}),U=(0,d.defineStyle)({borderRadius:"md"}),V={sm:v({field:U})},ee=A({baseStyle:G,sizes:V});var s=require("react/jsx-runtime"),Y=(0,I.default)(m.Box)`
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px;
  height: 40px;
  border-radius: 12px;
`,k=(0,I.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};
    }
  }
`,q=(0,I.default)(D)`
  justify-content: center;
  font-size: 18px;
  min-width: 60px;
  user-select: none;
  border: none;
  box-shadow: none;
  max-width: 80px;
  text-align: center;
`,N=({initialState:e=1,maxState:o,onChange:r,value:n,onError:i})=>{let[u,p]=(0,b.useState)(e);return(0,b.useEffect)(()=>{r(u)},[u]),(0,b.useEffect)(()=>{p(e)},[e]),(0,b.useEffect)(()=>{o>0&&n>o||u<1?i(!0):i(!1)},[o,n,u]),(0,s.jsxs)(m.Flex,{flexDirection:"column",alignItems:"flex-end",children:[(0,s.jsxs)(Y,{children:[(0,s.jsx)(k,{variant:"outline",onClick:()=>{n>e&&p(x=>n-1)},disabled:n===1,children:(0,s.jsx)(S.MinusIcon,{})}),(0,s.jsx)(q,{value:n,onChange:x=>{let w=Number(x.target.value);p(w)}}),(0,s.jsx)(k,{variant:"outline",onClick:()=>{o?n<o&&p(x=>n+1):p(x=>n+1)},disabled:o===n||!o,children:(0,s.jsx)(S.AddIcon,{})})]}),(o>0&&n>o||u<1)&&(0,s.jsxs)(m.Text,{fontSize:12,mt:10,color:"#E11900",children:["Enter quantity between 1 to ",o]})]})},B=N;var a=require("react/jsx-runtime"),J=(0,R.default)(c.Flex)`
  position: relative;
`,K=({duration:e,setDuration:o,loading:r,subTotalPrice:n,payUsing:i})=>(0,a.jsxs)(J,{paddingY:4,flexDir:"column",alignItems:"center",children:[(0,a.jsx)(B,{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:[r?(0,a.jsx)(c.Spinner,{size:"xs",mb:"1.5"}):(0,a.jsx)(c.Text,{fontSize:14,fontWeight:"bold",children:`${n?.toFixed(5)}`}),(0,a.jsx)(c.Text,{ml:"1",fontSize:14,fontWeight:"bold",children:i?.ticker})]})]})]}),$=K;var l=require("react/jsx-runtime"),L=({selectedDomain:e,duration:o,selectDuration:r,onOpen:n,onClose:i,isOpen:u,loading:p,subTotalPrice:y,payUsing:g})=>{let C=(0,t.useToast)();return(0,l.jsxs)(t.Flex,{justifyContent:"space-between",children:[(0,l.jsxs)(t.Flex,{alignItems:"center",children:[(0,l.jsx)(t.Text,{fontSize:"12",mr:"1",children:"Duration:"}),(0,l.jsx)(t.Text,{textDecoration:"underline",fontSize:"12",cursor:"pointer",onClick:()=>{if(!e)return C({title:"Select Domain",status:"warning"});n()},children:"Edit"})]}),(0,l.jsx)(t.Text,{fontSize:"12",mr:"1",children:`${o} Year`}),(0,l.jsxs)(t.Modal,{blockScrollOnMount:!1,isOpen:u,onClose:i,isCentered:!0,children:[(0,l.jsx)(t.ModalOverlay,{}),(0,l.jsxs)(t.ModalContent,{children:[(0,l.jsx)(t.ModalHeader,{children:"Registration duration"}),(0,l.jsx)(t.ModalCloseButton,{}),(0,l.jsxs)(t.ModalBody,{children:[(0,l.jsx)(t.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)($,{duration:o,setDuration:r,loading:p,subTotalPrice:y,payUsing:g})]})]})]})]})},Q=L;
