module.exports=[731168,a=>{"use strict";var b=a.i(504601),c=a.i(591262),d=a.i(836340);let e=".clerk",f="clerk.lock",g=(...a)=>{let b=(0,c.nodePathOrThrow)(),d=(0,c.nodeCwdOrThrow)();return b.join(d(),e,...a)},h=".tmp",i=!1;function j(){let{readFileSync:a}=(0,c.nodeFsOrThrow)();try{let b,c=g(h,"keyless.json");try{b=a(c,{encoding:"utf-8"})||"{}"}catch{b="{}"}return JSON.parse(b)}catch{return}}let k=()=>{let{writeFileSync:a}=(0,c.nodeFsOrThrow)();i=!0,a(f,"This file can be deleted. Please delete this file and refresh your application",{encoding:"utf8",mode:"0777",flag:"w"})},l=()=>{let{rmSync:a}=(0,c.nodeFsOrThrow)();try{a(f,{force:!0,recursive:!0})}catch{}i=!1},m=()=>{let{existsSync:a}=(0,c.nodeFsOrThrow)();return i||a(f)};async function n(){let{writeFileSync:a,mkdirSync:f}=(0,c.nodeFsOrThrow)();if(m())return null;k();let i=g(h,"keyless.json"),n=g(h,"README.md");f(g(h),{recursive:!0}),function(){let{existsSync:a,writeFileSync:b,readFileSync:d,appendFileSync:f}=(0,c.nodeFsOrThrow)(),g=(0,c.nodePathOrThrow)(),h=(0,c.nodeCwdOrThrow)(),i=g.join(h(),".gitignore");a(i)||b(i,""),d(i,"utf-8").includes(e+"/")||f(i,`
# clerk configuration (can include secrets)
/${e}/
`)}();let o=j();if((null==o?void 0:o.publishableKey)&&(null==o?void 0:o.secretKey))return l(),o;let p=(0,b.createClerkClientWithOptions)({}),q=await (0,d.collectKeylessMetadata)().then(d.formatMetadataHeaders).catch(()=>new Headers),r=await p.__experimental_accountlessApplications.createAccountlessApplication({requestHeaders:q}).catch(()=>null);return r&&(a(i,JSON.stringify(r),{encoding:"utf8",mode:"0777",flag:"w"}),a(n,`
## DO NOT COMMIT
This directory is auto-generated from \`@clerk/nextjs\` because you are running in Keyless mode. Avoid committing the \`.clerk/\` directory as it includes the secret key of the unclaimed instance.
  `,{encoding:"utf8",mode:"0777",flag:"w"})),l(),r}function o(){let{rmSync:a}=(0,c.nodeFsOrThrow)();if(!m()){k();try{a(g(),{force:!0,recursive:!0})}catch{}l()}}a.s(["createOrReadKeyless",()=>n,"removeKeyless",()=>o,"safeParseClerkFile",()=>j])}];

//# sourceMappingURL=e99c8_%40clerk_nextjs_dist_esm_server_keyless-node_487811d0.js.map