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