PageSourceSearch

https://hqnfts.xyz/_next/static/chunks/954.85ec0686a9d7cc1d.js

js hqnfts.xyz collected 2026-10-09 22:56:57 UTC 4,109 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[954],{90954:function(e,t,n){n.r(t);var a=n(85893),s=n(82175),r=n(67294),l=n(3865),i=n(5152),o=n.n(i),d=n(74231),c=n(86501),u=n(88767),m=n(241),p=n(77294),h=n(76957),A=n(30080),g=n(11163),b=n(78945),f=n(15369);let v=o()(()=>n.e(9033).then(n.bind(n,49033)),{loadableGenerated:{webpack:()=>[49033]}}),N=e=>{let{modalShow:t,setModalShow:n,currentUser:i,refetch:o,rowData:N}=e,x=(0,g.useRouter)(),[y,M]=r.useState(!1),[j,w]=(0,r.useState)(null),[I,T]=(0,r.useState)(null),k=e=>{"fade modal show"===e.target.className&&e.preventDefault()},{data:F,refetch:S}=(0,u.useQuery)(["contract-data"],()=>h.Z.ArtEngine.loadContractByName({Name:x.pathname.includes("nft-collectable")?"Lazy Minting"===N.MintingType?"BulkMint":"TokenMint":!x.pathname.includes("nft-collectable")&&"Lazy Minting"!==N.MintingType&&"GasLessTokenMint"}),{refetchOnWindowFocus:!1,enabled:!1,onSuccess:e=>{w(e[0].ABI)}}),{isLoading:D,mutate:C}=(0,u.useMutation)(e=>h.Z.ArtEngine.addMintAmount(e),{retry:2}),z=(0,s.TA)({initialValues:{MintAmount:"",DeployAddress:""},validationSchema:d.Ry({MintAmount:d.nK().required(),DeployAddress:d.nK().required()}),validateOnChange:!0,validateOnBlur:!1,onSubmit:(e,t)=>{let{resetForm:n}=t;B(e.DeployAddress,j,parseInt(N.MintAmount)+parseInt(e.MintAmount),parseInt(e.MintAmount))}});async function B(e,a,s,r){try{let l=new m.Q(window.ethereum),i=await (await b.Z.post("".concat("https://hqnfts.xyz:5000/","loadChainIdByCollection"),{ArtId:null==N?void 0:N._id})).data[0],{chainId:d}=await l.getNetwork();if(d!==f.TW[null==i?void 0:i.Network.toString()])return M(!1),c.Am.error("Please switch to "+f.QO[f.xA[f.TW[null==i?void 0:i.Network.toString()]]]),!1;M(!0);let u=l.getSigner(),h=new p.CH(e,a,u);await h.mint(r);let A={MintAmount:s,ArtId:I&&I._id};C(A,{onSuccess:e=>{"success"===e?(M(!1),z.resetForm(),o(),x.reload("/nft-collectable?pageSize=10&pageNumber=1"),c.Am.success("Successfully Minted ".concat(r," NFTs")),n(!t)):c.Am.error("Failed to add")},onError:e=>{c.Am.error("An error has been occured")}})}catch(g){console.log(g),M(!1),c.Am.error("Metamask rejected mint process")}finally{M(!1)}}return(0,r.useEffect)(()=>{null!==N&&(S(),z.setFieldValue("DeployAddress",N&&N.DeployAddress),T(N&&N))},[t]),(0,a.jsx)(r.Fragment,{children:(0,a.jsx)("div",{onClick:e=>k(e),children:(0,a.jsxs)(l.Z,{show:t,size:"md",style:{background:" rgba(0, 0, 0, 0.7)"},centered:!0,children:[(0,a.jsxs)(l.Z.Header,{className:"p-0 border-0",children:[(0,a.jsx)("div",{className:"col-10 p-2 ps-3 text-start",children:(0,a.jsx)("h5",{children:"Mint NFT"})}),(0,a.jsx)("div",{className:"col-2 p-2 pe-3 text-end",children:(0,a.jsx)("span",{className:"cursor-pointer",onClick:e=>{n(!t),z.resetForm()},children:(0,a.jsx)(A.lTq,{size:20})})})]}),(0,a.jsx)(l.Z.Body,{className:"p-2",children:(0,a.jsx)(r.Fragment,{children:(0,a.jsx)("form",{onSubmit:z.handleSubmit,children:(0,a.jsxs)("div",{className:"row m-0",children:[(0,a.jsx)("div",{className:"col-12 mb-4",children:(0,a.jsx)(v,{label:"Mint Amount (".concat(I?parseInt(I.TotalGeneratedNFT)-parseInt(I.MintAmount):0," NFTs left)"),name:"MintAmount",placeholder:"Amount",onKeyPress:e=>{/[0-9]/.test(e.key)||e.preventDefault(),0>=parseInt(e.target.value)?e.preventDefault():parseInt(e.target.value)>parseInt(I.TotalGeneratedNFT)-parseInt(I.MintAmount)&&e.preventDefault()},value:z.getFieldProps("MintAmount").value,onChange:e=>{0>=parseInt(e.target.value)?e.preventDefault():parseInt(e.target.value)>parseInt(I.TotalGeneratedNFT)-parseInt(I.MintAmount)?e.preventDefault():z.setFieldValue("MintAmount",e.target.value)}})}),(0,a.jsx)("div",{className:"col-12 mb-2",children:!z.isValid&&(0,a.jsx)("span",{className:"text-warning mt-2",children:"Please fill all the required fields"})}),(0,a.jsx)("div",{className:"col-12 mb-4 text-center",children:y?(0,a.jsx)("span",{className:"spinner-border spinner-border-lg me-3",role:"status","aria-hidden":"true"}):(0,a.jsxs)("button",{className:"btn btns-primary w-100",type:"submit",disabled:z&&!(z.isValid&&z.dirty),children:[" ","Mint"]})})]})})})})]})})})};t.default=N}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.