var f=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var g=(e,t)=>{for(var r in t)f(e,r,{get:t[r],enumerable:!0})},d=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of y(t))!m.call(e,o)&&o!==r&&f(e,o,{get:()=>t[o],enumerable:!(i=u(t,o))||i.enumerable});return e};var w=e=>d(f({},"__esModule",{value:!0}),e);var h=(e,t,r)=>new Promise((i,o)=>{var s=n=>{try{a(r.next(n))}catch(l){o(l)}},c=n=>{try{a(r.throw(n))}catch(l){o(l)}},a=n=>n.done?i(n.value):Promise.resolve(n.value).then(s,c);a((r=r.apply(e,t)).next())});var U={};g(U,{capitalizeFirstLetter:()=>C,changeQueryParams:()=>B,copyText:()=>S,debounce:()=>I,eToNumber:()=>z,extractSrc:()=>$,folderValidation:()=>E,getImageUrl:()=>v,getJsonByteSize:()=>T,makeFriendlyNumber:()=>b,numberToWords:()=>p,readFile:()=>M,sleep:()=>P,toCamelize:()=>A,truncateAddress:()=>x});module.exports=w(U);var v=(e,{height:t,quality:r})=>{if(e)return e.includes("imagedelivery.net")?e.includes("quality")?`${e},height=${t}`:`${e}/height=${t},quality=${r}`:e},x=(e,t)=>e?e.length>t?e.substr(0,t-1)+"..."+e.substr(e.length-(t-1),e.length-1):e:"",b=e=>new Intl.NumberFormat("en-GB",{notation:"compact",compactDisplay:"short"}).format(e),S=(e,t)=>{if(navigator.clipboard&&navigator.permissions)navigator.clipboard.writeText(e).then(t);else if(document.queryCommandSupported("copy")){let r=document.createElement("textarea");r.value=e,document.body.appendChild(r),r.select(),document.execCommand("copy"),document.body.removeChild(r),t==null||t()}},$=e=>{let t=/<iframe.*src="([^"]+)".*>/,r=e.match(t);return r?r[1]:null};function A(e){return e.replace(/(?:^\w|[A-Z]|\b\w)/g,function(t,r){return r===0?t.toLowerCase():t.toUpperCase()}).replace(/\s+/g,"")}function p(e){let t=["","one","two","three","four","five","six","seven","eight","nine"],r=["","ten","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"],i=["ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"];if(e===0)return"zero";let o="";return e<0&&(o+="negative ",e=Math.abs(e)),e>=1e6&&(o+=p(Math.floor(e/1e6))+" million ",e%=1e6),e>=1e3&&(o+=p(Math.floor(e/1e3))+" thousand ",e%=1e3),e>=100&&(o+=t[Math.floor(e/100)]+" hundred ",e%=100),e>=20?(o+=r[Math.floor(e/10)]+" ",e%=10):e>=10&&(o+=i[e-10]+" ",e=0),e>0&&(o+=t[e]),o.trim()}function z(e){if(Math.abs(e)<1){var t=parseInt(e.toString().split("e-")[1]);t&&(e*=Math.pow(10,t-1),e="0."+new Array(t).join("0")+e.toString().substring(2))}else{var t=parseInt(e.toString().split("+")[1]);t>20&&(t-=20,e/=Math.pow(10,t),e+=new Array(t+1).join("0"))}return e}function C(e){return e.charAt(0).toUpperCase()+e.slice(1)}var I=(e,t)=>{let r;return function(...i){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,i)},t)}},M=e=>h(void 0,null,function*(){let t=new FileReader;return new Promise((r,i)=>{t.onload=()=>{let o=t.result,s=Buffer.from(o);r(s)},t.onerror=function(o){i(o)},t.readAsArrayBuffer(e)})}),T=e=>{let t=JSON.stringify(e);return new TextEncoder().encode(t).length},E=e=>{let t=0;if(e.length%2!==0)throw new Error("Invalid folder");let r=[];if(Array.from(e).forEach((o,s,c)=>{o.name==="collection.json"&&o.type==="application/json"&&(t+=o.size,r.push(o),c.find(a=>{a.name==="collection.png"&&a.type==="image/png"&&(t+=a.size,r.push(a))}))}),r.length!==2)throw new Error("Invalid collection files");let i=e.filter(o=>o.name!=="collection.json"&&o.name!=="collection.png");for(let o=0;o<i.length/2;o++){let s=`${o}.json`,c=`${o}.png`,a=[];if(Array.from(i).forEach((n,l)=>{n.name===s&&n.type==="application/json"&&(t+=n.size,a.push(n))}),Array.from(i).find(n=>{n.name===c&&n.type==="image/png"&&(t+=n.size,a.push(n))}),a.length!==2)throw new Error(`Invalid assets of file starting with ${o}`);return t}},B=(e,t,r,i,o,s,c)=>{if(c)i(t);else{let a=new URLSearchParams(e);a.set("collectionId",r);let n=`${t}?${a.toString()}${s?"#mint":""}`;i(n)}},P=e=>new Promise(t=>setTimeout(t,e*1e3));0&&(module.exports={capitalizeFirstLetter,changeQueryParams,copyText,debounce,eToNumber,extractSrc,folderValidation,getImageUrl,getJsonByteSize,makeFriendlyNumber,numberToWords,readFile,sleep,toCamelize,truncateAddress});
