"use strict";(()=>{var e={};e.id=8810,e.ids=[3220,8810],e.modules={30671:(e,t)=>{Object.defineProperty(t,"M",{enumerable:!0,get:function(){return function e(t,r){return r in t?t[r]:"then"in t&&"function"==typeof t.then?t.then(t=>e(t,r)):"function"==typeof t&&"default"===r?t:void 0}}})},94212:(e,t,r)=>{r.r(t),r.d(t,{config:()=>q,default:()=>w,getServerSideProps:()=>C,getStaticPaths:()=>O,getStaticProps:()=>N,reportWebVitals:()=>L,routeModule:()=>T,unstable_getServerProps:()=>R,unstable_getServerSideProps:()=>k,unstable_getStaticParams:()=>Q,unstable_getStaticPaths:()=>M,unstable_getStaticProps:()=>I});var s={};r.r(s),r.d(s,{CreateAccountContext:()=>b,default:()=>P,getServerSideProps:()=>D});var n=r(63865),a=r(9455),o=r(30671),i=r(5583),c=r(19796),l=r(8732),u=r(82015),p=r.n(u),d=r(1013),m=r(91258),g=r(57660);function f(){let{query:e,invitingUser:t}=p().useContext(b);return(0,l.jsxs)("section",{className:"flex-col items-center lg:items-center gap-20 p-0",children:[(0,l.jsx)("img",{src:"/images/grid.webp",alt:"Dotted image background",className:"absolute top-0 left-0 w-full h-full object-cover opacity-80 dark:opacity-10 z-0"}),(0,l.jsxs)("div",{className:"w-full lg:w-1/2 max-w-6xl gap-4 flex-col items-center px-4 py-10 bg-white dark:bg-slate-900 relative z-10",children:[t?.first_name&&(0,l.jsxs)("span",{className:"text-xs bg-emerald-100 rounded-full px-4 py-1 mb-4",children:["You have been invited by"," ",(0,l.jsxs)("b",{children:[t.first_name," ",t.last_name," (",t.email,")"]})," ","to manage an account. Please create an account to gain access."]}),(0,l.jsx)("h1",{className:"m-0 text-center text-2xl",children:"Create An Account"}),(0,l.jsx)(g.A,{query:e})]})]})}r(92702),r(77047);var h=r(71934);let x=require("sanitize-html");var _=r.n(x);let y={allowedTags:["b","i","em","strong","a","p","span","ul","ol","li","h1","h2","h3","h4","h5","h6","img","div","button","pre","code","br"],allowedAttributes:{a:["href"],img:["src","alt","width","height","class","style"],"*":["style","class"]}};var S=r(43651),j=r(55511),v=r(79428),E=r(16175);r(46169);var A=r(32572);r(41939);let b=p().createContext({});function P(e){let t="Create Account | Datasquirel",r="Create a FREE account and start storing data.",s=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("title",{children:t}),(0,l.jsx)("meta",{name:"description",content:r}),(0,l.jsx)(m.A,{pageTitle:t,pageDescription:r,pagePathname:"/"})]}),[n,a]=p().useState(null);return e.query?.invite?(0,l.jsx)(A.A,{}):(0,l.jsx)(d.A,{head:s,children:(0,l.jsx)(b.Provider,{value:{user:n,query:e.query,invitingUser:e.invitingUser},children:(0,l.jsx)("main",{children:(0,l.jsx)(f,{})})})})}async function D({req:e,res:t,query:r}){return{redirect:{destination:"/login",permanent:!1}}}let w=(0,o.M)(s,"default"),N=(0,o.M)(s,"getStaticProps"),O=(0,o.M)(s,"getStaticPaths"),C=(0,o.M)(s,"getServerSideProps"),q=(0,o.M)(s,"config"),L=(0,o.M)(s,"reportWebVitals"),I=(0,o.M)(s,"unstable_getStaticProps"),M=(0,o.M)(s,"unstable_getStaticPaths"),Q=(0,o.M)(s,"unstable_getStaticParams"),R=(0,o.M)(s,"unstable_getServerProps"),k=(0,o.M)(s,"unstable_getServerSideProps"),T=new n.PagesRouteModule({definition:{kind:a.A.PAGES,page:"/create-account",pathname:"/create-account",bundlePath:"",filename:""},components:{App:c.default,Document:i.default},userland:s})},10621:(e,t,r)=>{r.d(t,{A:()=>n});var s=r(8732);function n({message:e}){return(0,s.jsxs)("div",{className:"p-2 bg-orange-50 w-full justify-center rounded text-sm text-orange-700 border border-orange-400 border-solid",children:[(0,s.jsx)("img",{src:"/images/warning.png",alt:"Warning Image Icon",width:22,className:"-my-2"}),(0,s.jsx)("span",{children:e})]})}r(82015)},32572:(e,t,r)=>{r.d(t,{A:()=>a});var s=r(8732);r(82015);var n=r(16757);function a(){return(0,s.jsx)("div",{className:"flex flex-col gap-4 items-center justify-center w-full h-screen p-6 bg-slate-100",children:(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center gap-4 px-6 py-20 bg-white rounded shadow-sm max-w-2xl w-full",children:[(0,s.jsx)("img",{src:"/images/logo-icon-alt-2.webp",alt:"Datasquirel Logo",width:60}),(0,s.jsx)("div",{className:"w-10 h-10 flex flex-col items-center justify-center",children:(0,s.jsx)(n.A,{width:"25px",position:"relative"})})]})})}},91258:(e,t,r)=>{r.d(t,{A:()=>o});var s=r(8732),n=r(82015),a=r.n(n);function o({pageTitle:e,pageDescription:t,pagePathname:r,aceEditor:n}){return(0,s.jsxs)(a().Fragment,{children:[(0,s.jsx)("link",{rel:"canonical",href:"http://localhost:7070"+r}),(0,s.jsx)("meta",{property:"og:url",content:"http://localhost:7070"+r}),(0,s.jsx)("meta",{itemProp:"url",content:"http://localhost:7070"+r}),(0,s.jsx)("meta",{name:"twitter:url",content:"http://localhost:7070"+r}),(0,s.jsx)("meta",{property:"og:title",content:e}),(0,s.jsx)("meta",{property:"og:description",content:t}),(0,s.jsx)("meta",{itemProp:"name",content:e}),(0,s.jsx)("meta",{itemProp:"description",content:t}),(0,s.jsx)("meta",{name:"twitter:title",content:e}),(0,s.jsx)("meta",{name:"twitter:description",content:t}),n&&(0,s.jsxs)(a().Fragment,{children:[(0,s.jsx)("script",{src:"https://cdnjs.cloudflare.com/ajax/libs/ace/1.22.0/ace.min.js",integrity:"sha512-q6CTB0jS+VuJnSct82rVcWlI06LGzNjaG3CWenHWVUncRvc4UQMFkA3a5Ip880xr+lBx38FcHDclOxPdSg+sBw==",crossOrigin:"anonymous",referrerPolicy:"no-referrer"}),(0,s.jsx)("script",{src:"https://cdnjs.cloudflare.com/ajax/libs/ace/1.22.0/ext-language_tools.min.js",integrity:"sha512-6g6cvocV7eT/J8L44lL8gJKqq9onqQeYGgJO0DmrsYFcCfRl6wYkYA/KHS768r4QVTB4JxsCcMQ9gIezxpTCZw==",crossOrigin:"anonymous",referrerPolicy:"no-referrer"})]})]})}},92702:(e,t,r)=>{r.d(t,{A:()=>c});var s=r(71934),n=r(71205),a=r(29021),o=r.n(a),i=r(41939);async function c(e,t,r){try{let{keyCookieName:a,csrfCookieName:c}=(0,i.A)();if(!e.cookies?.[a]?.match(/./))throw Error("Request Cookies not Found!");let l=(0,n.A)({encryptedString:e.cookies[a]});if(!l)throw Error("Couldn't decrypt auth cookie!");let u=JSON.parse(l);if(!u.csrf_k)throw Error("No `csrf_k` present in user Object!");if(r&&!Object.keys(e.headers).find(e=>e.includes(u.csrf_k)))throw Error("Deep Auth Failed. `csrf` key not found in request headers!");let p=process.env.DSQL_USER_LOGIN_KEYS_PATH;if(!p)throw Error("DSQL_USER_LOGIN_KEYS_PATH env variable not found. Please set this variable.");if(r&&!o().existsSync(`${p}/${u.csrf_k}`))throw Error("Key not found in Auth Keys Folder!");if(0==u.verification_status&&!r){let e=await (0,s.A)(`SELECT verification_status FROM users WHERE id='${u.id}'`);e&&e[0]&&1==e[0].verification_status&&t.setHeader("Set-Cookie",["user_refresh=1"])}if(u?.date&&Date.now()-u.date>6048e5)throw Error("Key expired!");return u}catch(e){return console.log(`userAuth Error: ${e.message}`),null}}},41939:(e,t,r)=>{r.d(t,{A:()=>s});function s(e){let t=process.env.DSQL_COOKIES_PREFIX||"dsql_",r=process.env.DSQL_COOKIES_KEY_NAME||"key",s=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",n=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",a=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),o=t;e?.userId&&(o+=`user_${e.userId}_`),a&&(o+=`${a}_`),o+=r;let i=t;e?.userId&&(i+=`user_${e.userId}_`),a&&(i+=`${a}_`),i+=s;let c=t;return e?.userId&&(c+=`user_${e.userId}_`),a&&(c+=`${a}_`),{keyCookieName:o,csrfCookieName:i,oneTimeCodeName:c+=n}}},71205:(e,t,r)=>{r.d(t,{A:()=>a});var s=r(55511),n=r(79428);function a({encryptedString:e,encryptionKey:t,encryptionSalt:r}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let a=t||process.env.DSQL_ENCRYPTION_PASSWORD,o=r||process.env.DSQL_ENCRYPTION_SALT,i=process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24;if(!a?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!o?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let c=(0,s.scryptSync)(a,o,i),l=n.Buffer.alloc(16,0),u=(0,s.createDecipheriv)("aes-192-cbc",c,l);try{let t=u.update(e,"hex","utf8");return t+=u.final("utf8")}catch(t){return console.log("Error in decrypting =>",t.message),e}}},71934:(e,t,r)=>{r.d(t,{A:()=>s});async function s(...e){let t=global.DSQL_DB_CONN;try{if(!t)throw Error("No Connection provided to DB_HANDLER function!");let r=await t.query(...e);return JSON.parse(JSON.stringify(r))}catch(e){return console.log("DB Error =>",e),{success:!1,error:e.message}}finally{await t?.end()}}},43651:(e,t,r)=>{async function s(e,t,r){try{if("string"==typeof t){let s=await e.query(n(t),r);return JSON.parse(JSON.stringify(s))}if("object"!=typeof t)return null;{let r=[];for(let s=0;sa})},16175:(e,t,r)=>{r.d(t,{A:()=>i});var s=r(9973),n=r.n(s),a=r(29021),o=r.n(a);async function i(...e){let t=n()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4",ssl:function(){let e=process.env.DSQL_SSL_DIR;if(!e?.match(/./))return;let t=`${e}/ca-cert.pem`;if(!o().existsSync(t)){console.log(`${t} does not exist`);return}return{ca:o().readFileSync(`${e}/ca-cert.pem`),rejectUnauthorized:!1}}()},onConnect:()=>{console.log("Connection Successful!")},onConnectError:e=>{console.log("Connection Error",e.message)},onError:e=>{console.log("Client Error",e.message)}});console.log("Querying ...");try{let r=await t.query(...e);return await t.end(),JSON.parse(JSON.stringify(r))}catch(e){return console.log("DB Error =>",e.message),{success:!1,error:e.message}}}},5583:(e,t,r)=>{r.r(t),r.d(t,{default:()=>a});var s=r(8732);r(82015);var n=r(20883);function a(){return(0,s.jsxs)(n.Html,{lang:"en",children:[(0,s.jsxs)(n.Head,{children:[(0,s.jsx)("meta",{name:"author",content:"Datasquirel"}),(0,s.jsx)("meta",{name:"Copyright",content:`Copyright (c) ${new Date().getFullYear()} Datasquirel`}),"dev_dev".match(/dev/)&&(0,s.jsx)("meta",{name:"robots",content:"noindex,nofollow"}),(0,s.jsx)("link",{rel:"preconnect",href:"https://fonts.googleapis.com/",crossOrigin:"anonymous"}),(0,s.jsx)("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),(0,s.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Poppins"}),(0,s.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Inter"}),(0,s.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=IBM+Plex+Mono"}),(0,s.jsx)("script",{src:"/scripts/themeSelector.js"}),(0,s.jsx)("meta",{httpEquiv:"Content-Type",content:"text/html; charset=UTF-8"}),(0,s.jsx)("meta",{property:"og:site_name",content:"DATASQUIREL"}),(0,s.jsx)("meta",{property:"og:type",content:"website"}),(0,s.jsx)("meta",{name:"twitter:card",content:"summary"}),(0,s.jsx)("meta",{property:"og:image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,s.jsx)("meta",{itemProp:"image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,s.jsx)("meta",{name:"twitter:image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,s.jsx)("link",{rel:"stylesheet",href:"/styles/prism.css"}),(0,s.jsx)("script",{src:"/scripts/prism.js",async:!0}),(0,s.jsx)("script",{dangerouslySetInnerHTML:{__html:"var DSQL = {}"}})]}),(0,s.jsxs)("body",{children:[(0,s.jsx)(n.Main,{}),(0,s.jsx)(n.NextScript,{})]})]})}},9455:(e,t)=>{Object.defineProperty(t,"A",{enumerable:!0,get:function(){return r}});var r=function(e){return e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE",e}({})},13893:e=>{e.exports=require("@moduletrace/datasquirel/dist/client/fetch")},40361:e=>{e.exports=require("next/dist/compiled/next-server/pages.runtime.prod.js")},27912:e=>{e.exports=require("next/head")},82015:e=>{e.exports=require("react")},22326:e=>{e.exports=require("react-dom")},8732:e=>{e.exports=require("react/jsx-runtime")},9973:e=>{e.exports=require("serverless-mysql")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},33873:e=>{e.exports=require("path")}};var t=require("../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[883,9821,9796,8760],()=>r(94212));module.exports=s})();