var G=Object.create;var x=Object.defineProperty,H=Object.defineProperties,V=Object.getOwnPropertyDescriptor,q=Object.getOwnPropertyDescriptors,N=Object.getOwnPropertyNames,b=Object.getOwnPropertySymbols,Y=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var S=(e,o,n)=>o in e?x(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n,B=(e,o)=>{for(var n in o||(o={}))I.call(o,n)&&S(e,n,o[n]);if(b)for(var n of b(o))k.call(o,n)&&S(e,n,o[n]);return e},R=(e,o)=>H(e,q(o));var T=(e,o)=>{var n={};for(var t in e)I.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(e!=null&&b)for(var t of b(e))o.indexOf(t)<0&&k.call(e,t)&&(n[t]=e[t]);return n};var J=(e,o)=>{for(var n in o)x(e,n,{get:o[n],enumerable:!0})},_=(e,o,n,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of N(o))!I.call(e,r)&&r!==n&&x(e,r,{get:()=>o[r],enumerable:!(t=V(o,r))||t.enumerable});return e};var w=(e,o,n)=>(n=e!=null?G(Y(e)):{},_(o||!e||!e.__esModule?x(n,"default",{value:e,enumerable:!0}):n,e)),K=e=>_(x({},"__esModule",{value:!0}),e);var ne={};J(ne,{default:()=>te});module.exports=K(ne);var l=require("@chakra-ui/react"),j=w(require("@emotion/styled"),1);var m=require("react"),h=w(require("@emotion/styled"),1),C=require("@chakra-ui/icons"),u=require("@chakra-ui/react");var $=w(require("react"),1),i=require("@chakra-ui/react"),v=require("@chakra-ui/anatomy");var c=require("react/jsx-runtime"),D=$.default.forwardRef((a,z)=>{var g=a,{label:e,error:o,placeholder:n,helperText:t,isInvalid:r,as:f=i.Input,InputLeftAddon:p,InputRightAddon:F}=g,y=T(g,["label","error","placeholder","helperText","isInvalid","as","InputLeftAddon","InputRightAddon"]);let{disabled:A}=y;return(0,c.jsxs)(i.FormControl,{isInvalid:r,opacity:A?.4:1,children:[e&&(0,c.jsx)(i.Text,{color:r?"destructive":"foreground",fontWeight:"medium",fontSize:"sm",lineHeight:1,children:e}),(0,c.jsxs)(i.InputGroup,{mt:"2",children:[p,(0,c.jsx)(f,R(B({variant:"",placeholder:n},y),{ref:z})),F]}),t&&(0,c.jsx)(i.Text,{fontSize:"xs",mt:2,color:"mutedForeground",children:t}),r&&o&&(0,c.jsx)(i.Text,{fontSize:"xs",mt:2,color:"destructive",children:o})]})}),{definePartsStyle:W,defineMultiStyleConfig:L}=(0,i.createMultiStyleConfigHelpers)(v.inputAnatomy.keys),O=W({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"}}}),P=(0,i.defineStyle)({borderRadius:"md"}),Q={sm:W({field:P})},de=L({baseStyle:O,sizes:Q});var d=require("react/jsx-runtime"),X=(0,h.default)(u.Box)`
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px;
  height: 40px;
  border-radius: 12px;
`,E=(0,h.default)(u.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};
    }
  }
`,Z=(0,h.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;
`,U=({initialState:e=1,maxState:o,onChange:n,value:t,onError:r})=>{let[f,p]=(0,m.useState)(e);return(0,m.useEffect)(()=>{n(f)},[f]),(0,m.useEffect)(()=>{p(e)},[e]),(0,m.useEffect)(()=>{o>0&&t>o||f<1?r(!0):r(!1)},[o,t,f]),(0,d.jsxs)(u.Flex,{flexDirection:"column",alignItems:"flex-end",children:[(0,d.jsxs)(X,{children:[(0,d.jsx)(E,{variant:"outline",onClick:()=>{t>e&&p(a=>t-1)},disabled:t===1,children:(0,d.jsx)(C.MinusIcon,{})}),(0,d.jsx)(Z,{value:t,onChange:a=>{let g=Number(a.target.value);p(g)}}),(0,d.jsx)(E,{variant:"outline",onClick:()=>{o?t<o&&p(a=>t+1):p(a=>t+1)},disabled:o===t||!o,children:(0,d.jsx)(C.AddIcon,{})})]}),(o>0&&t>o||f<1)&&(0,d.jsxs)(u.Text,{fontSize:12,mt:10,color:"#E11900",children:["Enter quantity between 1 to ",o]})]})},M=U;var s=require("react/jsx-runtime"),ee=(0,j.default)(l.Flex)`
  position: relative;
`,oe=({duration:e,setDuration:o,loading:n,subTotalPrice:t,payUsing:r})=>(0,s.jsxs)(ee,{paddingY:4,flexDir:"column",alignItems:"center",children:[(0,s.jsx)(M,{initialState:1,maxState:1e4,onChange:o,onError:()=>{},value:e}),(0,s.jsxs)(l.Flex,{w:"full",justifyContent:"space-between",alignItems:"center",children:[(0,s.jsx)(l.Text,{fontSize:14,mt:4,fontWeight:"bold",children:`${e} year registration`}),(0,s.jsxs)(l.Flex,{alignItems:"flex-end",justifyContent:"center",mt:4,children:[n?(0,s.jsx)(l.Spinner,{size:"xs",mb:"1.5"}):(0,s.jsx)(l.Text,{fontSize:14,fontWeight:"bold",children:`${t==null?void 0:t.toFixed(5)}`}),(0,s.jsx)(l.Text,{ml:"1",fontSize:14,fontWeight:"bold",children:r==null?void 0:r.ticker})]})]})]}),te=oe;
