(()=>{var x={};x.id=2824,x.ids=[2824],x.modules={3295:x=>{"use strict";x.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:x=>{"use strict";x.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},24989:(x,e,a)=>{"use strict";a.r(e),a.d(e,{patchFetch:()=>M,routeModule:()=>D,serverHooks:()=>F,workAsyncStorage:()=>T,workUnitAsyncStorage:()=>B});var f={};a.r(f),a.d(f,{GET:()=>N});var c=a(96559),d=a(48088),b=a(37719),r=a(32190),t=a(96330),n=a(55511),o=null;function i(x,e){if("number"!=typeof(x=x||I))throw Error("Illegal arguments: "+typeof x+", "+typeof e);x<4?x=4:x>31&&(x=31);var a=[];return a.push("$2b$"),x<10&&a.push("0"),a.push(x.toString()),a.push("$"),a.push(m(function(x){try{return crypto.getRandomValues(new Uint8Array(x))}catch{}try{return n.randomBytes(x)}catch{}if(!o)throw Error("Neither WebCryptoAPI nor a crypto module is available. Use bcrypt.setRandomFallback to set an alternative");return o(x)}(A),A)),a.join("")}function s(x,e,a){if("function"==typeof e&&(a=e,e=void 0),"function"==typeof x&&(a=x,x=void 0),void 0===x)x=I;else if("number"!=typeof x)throw Error("illegal arguments: "+typeof x);function f(e){h(function(){try{e(null,i(x))}catch(x){e(x)}})}if(!a)return new Promise(function(x,e){f(function(a,f){if(a)return void e(a);x(f)})});if("function"!=typeof a)throw Error("Illegal callback: "+typeof a);f(a)}function u(x,e){if(void 0===e&&(e=I),"number"==typeof e&&(e=i(e)),"string"!=typeof x||"string"!=typeof e)throw Error("Illegal arguments: "+typeof x+", "+typeof e);return R(x,e)}function l(x,e,a,f){function c(a){"string"==typeof x&&"number"==typeof e?s(e,function(e,c){R(x,c,a,f)}):"string"==typeof x&&"string"==typeof e?R(x,e,a,f):h(a.bind(this,Error("Illegal arguments: "+typeof x+", "+typeof e)))}if(!a)return new Promise(function(x,e){c(function(a,f){if(a)return void e(a);x(f)})});if("function"!=typeof a)throw Error("Illegal callback: "+typeof a);c(a)}function p(x,e){for(var a=x.length^e.length,f=0;fx.length)throw Error("Illegal len: "+e);for(;c>2&63]),a=(3&a)<<4,c>=e||(a|=(f=255&x[c++])>>4&15,d.push(y[63&a]),a=(15&f)<<2,c>=e)){d.push(y[63&a]);break}a|=(f=255&x[c++])>>6&3,d.push(y[63&a]),d.push(y[63&f])}return d.join("")}function w(x,e){var a,f,c,d,b,r=0,t=x.length,n=0,o=[];if(e<=0)throw Error("Illegal len: "+e);for(;r>>0|(48&f)>>4,o.push(String.fromCharCode(d)),!(++n>=e||r>=t||-1==(c=(b=x.charCodeAt(r++))>>0|(60&c)>>2,o.push(String.fromCharCode(d)),++n>=e||r>=t)));){;d=(3&c)<<6>>>0|((b=x.charCodeAt(r++))>>24]+f[256|d>>16&255]^f[512|d>>8&255])+f[768|255&d]^a[1],d^=(f[b>>>24]+f[256|b>>16&255]^f[512|b>>8&255])+f[768|255&b]^a[2],b^=(f[d>>>24]+f[256|d>>16&255]^f[512|d>>8&255])+f[768|255&d]^a[3],d^=(f[b>>>24]+f[256|b>>16&255]^f[512|b>>8&255])+f[768|255&b]^a[4],b^=(f[d>>>24]+f[256|d>>16&255]^f[512|d>>8&255])+f[768|255&d]^a[5],d^=(f[b>>>24]+f[256|b>>16&255]^f[512|b>>8&255])+f[768|255&b]^a[6],b^=(f[d>>>24]+f[256|d>>16&255]^f[512|d>>8&255])+f[768|255&d]^a[7],d^=(f[b>>>24]+f[256|b>>16&255]^f[512|b>>8&255])+f[768|255&b]^a[8],b^=(f[d>>>24]+f[256|d>>16&255]^f[512|d>>8&255])+f[768|255&d]^a[9],d^=(f[b>>>24]+f[256|b>>16&255]^f[512|b>>8&255])+f[768|255&b]^a[10],b^=(f[d>>>24]+f[256|d>>16&255]^f[512|d>>8&255])+f[768|255&d]^a[11],d^=(f[b>>>24]+f[256|b>>16&255]^f[512|b>>8&255])+f[768|255&b]^a[12],b^=(f[d>>>24]+f[256|d>>16&255]^f[512|d>>8&255])+f[768|255&d]^a[13],d^=(f[b>>>24]+f[256|b>>16&255]^f[512|b>>8&255])+f[768|255&b]^a[14],b^=(f[d>>>24]+f[256|d>>16&255]^f[512|d>>8&255])+f[768|255&d]^a[15],d^=(f[b>>>24]+f[256|b>>16&255]^f[512|b>>8&255])+f[768|255&b]^a[16],x[e]=b^a[17],x[e+1]=d,x}function $(x,e){for(var a=0,f=0;a<4;++a)f=f<<8|255&x[e],e=(e+1)%x.length;return{key:f,offp:e}}function j(x,e,a){for(var f,c=0,d=[0,0],b=e.length,r=a.length,t=0;t31){if(b=Error("Illegal number of rounds (4-31): "+a),f)return void h(f.bind(this,b));throw b}if(e.length!==A){if(b=Error("Illegal salt length: "+e.length+" != "+A),f)return void h(f.bind(this,b));throw b}a=1<>>0;var n,o,i,s=0;function u(){if(c&&c(s/a),s100)););else{for(s=0;s<64;s++)for(i=0;i>1;i++)P(r,i<<1,n,o);var b=[];for(s=0;s>24&255)>>>0),b.push((r[s]>>16&255)>>>0),b.push((r[s]>>8&255)>>>0),b.push((255&r[s])>>>0);return f?void f(null,b):b}f&&h(u)}if("function"==typeof Int32Array?(n=new Int32Array(E),o=new Int32Array(k)):(n=E.slice(),o=k.slice()),!function(x,e,a,f){for(var c,d=0,b=[0,0],r=a.length,t=f.length,n=0;n"$"){if(c=Error("Missing salt rounds"),a)return void h(a.bind(this,c));throw c}var c,d,b,r=10*parseInt(e.substring(b,b+1),10)+parseInt(e.substring(b+1,b+2),10),t=e.substring(b+3,b+25),n=function(x){for(var e,a,f=0,c=Array(g(x)),d=0,b=x.length;d>6|192:((64512&e)==55296&&(64512&(a=x.charCodeAt(d+1)))==56320?(e=65536+((1023&e)<<10)+(1023&a),++d,c[f++]=e>>18|240,c[f++]=e>>12&63|128):c[f++]=e>>12|224,c[f++]=e>>6&63|128),c[f++]=63&e|128);return c}(x+=d>="a"?"\0":""),o=w(t,A);function i(x){var e=[];return e.push("$2"),d>="a"&&e.push(d),e.push("$"),r<10&&e.push("0"),e.push(r.toString()),e.push("$"),e.push(m(o,o.length)),e.push(m(x,4*C.length-1)),e.join("")}if(void 0===a)return i(S(n,o,r));S(n,o,r,function(x,e){x?a(x,null):a(null,i(e))},f)}let q={setRandomFallback:function(x){o=x},genSaltSync:i,genSalt:s,hashSync:u,hash:l,compareSync:function(x,e){if("string"!=typeof x||"string"!=typeof e)throw Error("Illegal arguments: "+typeof x+", "+typeof e);return 60===e.length&&p(u(x,e.substring(0,e.length-31)),e)},compare:function(x,e,a,f){function c(a){return"string"!=typeof x||"string"!=typeof e?void h(a.bind(this,Error("Illegal arguments: "+typeof x+", "+typeof e))):60!==e.length?void h(a.bind(this,null,!1)):void l(x,e.substring(0,29),function(x,f){x?a(x):a(null,p(f,e))},f)}if(!a)return new Promise(function(x,e){c(function(a,f){if(a)return void e(a);x(f)})});if("function"!=typeof a)throw Error("Illegal callback: "+typeof a);c(a)},getRounds:function(x){if("string"!=typeof x)throw Error("Illegal arguments: "+typeof x);return parseInt(x.split("$")[2],10)},getSalt:function(x){if("string"!=typeof x)throw Error("Illegal arguments: "+typeof x);if(60!==x.length)throw Error("Illegal hash length: "+x.length+" != 60");return x.substring(0,29)},truncates:function(x){if("string"!=typeof x)throw Error("Illegal arguments: "+typeof x);return g(x)>72},encodeBase64:function(x,e){return m(x,e)},decodeBase64:function(x,e){return w(x,e)}},U=new t.PrismaClient;async function N(){try{let x=await fetch(process.env.EQUIPES_API_URL||"https://equipes-api-url/users",{headers:{Authorization:`Bearer ${process.env.EQUIPES_API_TOKEN}`}});if(!x.ok)throw Error(`API responded with status: ${x.status}`);let e=await x.json(),a={total:e.length,created:0,updated:0,failed:0};for(let x of e)try{if(await U.user.findUnique({where:{id:x.id}}))await U.user.update({where:{id:x.id},data:{email:x.email,updatedAt:new Date}}),a.updated++;else{let e=await q.hash(Math.random().toString(36).slice(-10),10);await U.user.create({data:{id:x.id,email:x.email,password:e,createdAt:new Date,updatedAt:new Date}}),a.created++}}catch(e){console.error(`Error processing user ${x.id}:`,e),a.failed++}return r.NextResponse.json({success:!0,results:a})}catch(x){return console.error("Error syncing users:",x),r.NextResponse.json({success:!1,error:x.message},{status:500})}}let D=new c.AppRouteRouteModule({definition:{kind:d.RouteKind.APP_ROUTE,page:"/api/sync-users/route",pathname:"/api/sync-users",filename:"route",bundlePath:"app/api/sync-users/route"},resolvedPagePath:"/Users/alma/Documents/NeahNew/app/api/sync-users/route.ts",nextConfigOutput:"",userland:f}),{workAsyncStorage:T,workUnitAsyncStorage:B,serverHooks:F}=D;function M(){return(0,b.patchFetch)({workAsyncStorage:T,workUnitAsyncStorage:B})}},29294:x=>{"use strict";x.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:x=>{"use strict";x.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:x=>{"use strict";x.exports=require("crypto")},63033:x=>{"use strict";x.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},96330:x=>{"use strict";x.exports=require("@prisma/client")},96487:()=>{}};var e=require("../../../webpack-runtime.js");e.C(x);var a=x=>e(e.s=x),f=e.X(0,[4243,580],()=>a(24989));module.exports=f})();