var p=Object.create;var S=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var h=(o,r)=>{for(var l in r)S(o,l,{get:r[l],enumerable:!0})},m=(o,r,l,d)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of z(r))!C.call(o,a)&&a!==l&&S(o,a,{get:()=>r[a],enumerable:!(d=b(r,a))||d.enumerable});return o};var y=(o,r,l)=>(l=o!=null?p(T(o)):{},m(r||!o||!o.__esModule?S(l,"default",{value:o,enumerable:!0}):l,o)),F=o=>m(S({},"__esModule",{value:!0}),o);var v={};h(v,{default:()=>W});module.exports=F(v);var t=require("@chakra-ui/react"),u=require("@solana/web3.js");var e=require("@chakra-ui/react"),c=y(require("@emotion/styled"),1),x=require("@solana/web3.js"),P=require("react"),n=require("react/jsx-runtime"),M="https://docs.bonfida.org/collection/naming-service/how-to-create-a-solana-domain-name/purchasing-a-domain-name/direct-registration",w=(0,c.default)(e.Flex)`
  position: relative;
`,O=({size:o,setSize:r,loading:l,subTotalPrice:d})=>(0,n.jsxs)(w,{paddingY:4,flexDir:"column",alignItems:"center",children:[(0,n.jsxs)(e.Slider,{defaultValue:0,min:1,max:10,step:1,w:"94%",onChange:s=>{r(s)},value:o,children:[(0,n.jsxs)(e.SliderTrack,{bg:"muted",children:[(0,n.jsx)(e.Box,{position:"relative",right:10}),(0,n.jsx)(e.SliderFilledTrack,{bg:"mutedForeground"})]}),(0,n.jsx)(e.SliderThumb,{boxSize:4,borderColor:"mutedForeground",borderWidth:"1"})]}),(0,n.jsxs)(e.Flex,{justifyContent:"space-between",w:"full",mt:"1",children:[(0,n.jsx)(e.Text,{fontSize:"12",children:"1 Kb"}),(0,n.jsx)(e.Text,{fontSize:"12",children:"10 Kb"})]}),(0,n.jsxs)(e.Flex,{w:"full",justifyContent:"space-between",children:[(0,n.jsxs)(e.Text,{fontSize:14,mt:4,fontWeight:"semibold",children:["Selected Size: ",`${o} Kb`]}),(0,n.jsx)(e.Text,{fontSize:14,mt:4,textDecoration:"underline",cursor:"pointer",onClick:()=>window.open(M),textAlign:"right",children:"How much storage is right for you?"})]}),(0,n.jsxs)(e.Flex,{w:"full",justifyContent:"space-between",alignItems:"center",children:[(0,n.jsx)(e.Text,{fontSize:14,mt:4,fontWeight:"bold",children:"Storage cost"}),(0,n.jsxs)(e.Flex,{alignItems:"flex-end",justifyContent:"center",mt:4,children:[l?(0,n.jsx)(e.Spinner,{size:"xs",mb:"1"}):(0,n.jsxs)(e.Text,{fontSize:14,fontWeight:"bold",children:["+",`${(d/x.LAMPORTS_PER_SOL).toFixed(5)}`]}),(0,n.jsx)(e.Text,{ml:"1",fontSize:14,fontWeight:"bold",children:"SOL"})]})]})]}),g=O;var i=require("react/jsx-runtime"),R=({size:o,setSize:r,onOpen:l,onClose:d,isOpen:a,loading:s,subTotalPrice:f})=>(0,i.jsxs)(t.Flex,{mt:"2",justifyContent:"space-between",children:[(0,i.jsxs)(t.Flex,{alignItems:"center",children:[(0,i.jsx)(t.Text,{fontSize:"12",mr:"1",children:"Storage Cost:"}),(0,i.jsx)(t.Text,{textDecoration:"underline",fontSize:"12",cursor:"pointer",onClick:l,children:"Edit"})]}),(0,i.jsxs)(t.Flex,{alignItems:"center",justifyContent:"center",children:[s?(0,i.jsx)(t.Spinner,{size:"xs"}):(0,i.jsxs)(t.Text,{fontSize:"12",fontWeight:"bold",children:["+",`${(f/u.LAMPORTS_PER_SOL).toFixed(5)}`]}),(0,i.jsx)(t.Text,{ml:"1",fontSize:"12",fontWeight:"bold",children:"SOL"}),(0,i.jsx)(t.Text,{fontSize:"12",mx:"1",children:`(${o} KB)`})]}),(0,i.jsxs)(t.Modal,{blockScrollOnMount:!1,isOpen:a,onClose:d,isCentered:!0,children:[(0,i.jsx)(t.ModalOverlay,{}),(0,i.jsxs)(t.ModalContent,{children:[(0,i.jsx)(t.ModalHeader,{children:"Edit storage size"}),(0,i.jsx)(t.ModalCloseButton,{}),(0,i.jsxs)(t.ModalBody,{children:[(0,i.jsx)(t.Text,{fontSize:"12",py:"2",px:"4",borderColor:"mutedForeground",borderWidth:"1px",borderStyle:"solid",borderRadius:"8",children:"Storage size cannot be changed after initial registration."}),(0,i.jsx)(g,{size:o,setSize:r,loading:s,subTotalPrice:f})]})]})]})]}),W=R;
