exports.id=72118,exports.ids=[72118],exports.modules={1623:(a,b,c)=>{"use strict";c.d(b,{fU:()=>e}),c(4434);let d=new Set(["localhost","ondigitalocean.app","vercel.app","netlify.app"]);function e(){let a="dplms.com".trim().toLowerCase(),b=Array.from(d).join("|");return`(function(){try{
var h=location.hostname.toLowerCase();
var env=${JSON.stringify(a)};
var blocked=/${b}|localhost/;
function apex(){if(env)return env;var p=h.split('.');if(p.length>=3){var a=p.slice(-2).join('.');if(!blocked.test(a))return a}if(p.length===2&&!blocked.test(h))return h;return null}
var a=apex();if(!a)return;
if(!(h===a||h==='www.'+a||h.endsWith('.'+a)))return;
var cd='.'+a;
function rc(n){var pre=n+'=';var parts=document.cookie.split(';');for(var i=0;i<parts.length;i++){var t=parts[i].trim();if(t.indexOf(pre)===0){try{return decodeURIComponent(t.slice(pre.length))}catch(e){return null}}}return null}
function rchunk(n){var d=rc(n);if(d)return d;var c=rc(n+'__chunks');if(!c)return null;var nC=parseInt(c,10);if(!nC)return null;var s='';for(var j=0;j<nC;j++){var p=rc(n+'__'+j);if(p==null)return null;s+=p}try{return decodeURIComponent(s)}catch(e){return null}}
var acc=rchunk('accessToken');
var ref=rchunk('refreshToken');
var slug=rc('tenantSlug');
if(acc)localStorage.setItem('accessToken',acc);
if(ref)localStorage.setItem('refreshToken',ref);
if(slug)localStorage.setItem('tenantSlug',slug);
}catch(e){}})();`}},4434:(a,b,c)=>{"use strict";c.d(b,{Bw:()=>k,Fp:()=>l,WU:()=>j,g2:()=>m,k0:()=>i,pF:()=>n});var d=c(15698);let e=new Set(["www","api"]),f=new Set(["localhost","ondigitalocean.app","vercel.app","netlify.app"]);function g(a){let b=a.split(":")[0].toLowerCase();return!!b&&[...f].some(a=>"localhost"!==a&&(b===a||b.endsWith(`.${a}`)))}function h(a){return a.trim().toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").slice(0,63)}function i(a){let b=a.split(":")[0].toLowerCase(),c=b.split(".");if(c.length>=3){let a=c.slice(-2).join(".");if(!f.has(a)&&!a.includes("localhost"))return a}return 2!==c.length||f.has(b)||b.includes("localhost")?null:b}function j(a){let b="dplms.com".trim().toLowerCase()||null;return b||(a?i(a):null)}function k(a){let b=a.split(":")[0].toLowerCase();if(g(b))return null;let c=j(b);if(c){if(b===c||b===`www.${c}`)return null;if(b.endsWith(`.${c}`)){let a=b.slice(0,-(c.length+1));if(a&&!e.has(a))return h(a)||null}return null}let f=b.split(".");if(!c&&(0,d.Sh)(b)&&f.length>=3){let a=f[0];if(!e.has(a))return h(a)||null}return null}function l(a){let b=a.split(":")[0].toLowerCase();if(!b||"localhost"===b||"127.0.0.1"===b||b.startsWith("192.168.")||g(b))return!0;let c=j(b);return!!c&&(b===c||b===`www.${c}`||b.endsWith(`.${c}`))}function m(a){let b=a.split(":")[0].toLowerCase();return!(!b||"localhost"===b||"127.0.0.1"===b||g(b)||l(b)||k(b))&&b.includes(".")}function n(a){if(a){let b=a.split(":")[0].toLowerCase();return k(b)||m(b)?"/":"/academy"}return"/academy"}},15698:(a,b,c)=>{"use strict";c.d(b,{K_:()=>k,Sh:()=>f,bD:()=>i,xQ:()=>j});var d=c(4434);let e=new Set(["8080","3000","3001","4000"]);function f(a){let b=a.split(":")[0].toLowerCase();return!!("localhost"===b||"127.0.0.1"===b||b.endsWith(".localhost")||b.startsWith("192.168.")||b.startsWith("10."))||/^172\.(1[6-9]|2\d|3[0-1])\./.test(b)}function g(a,b=(0,d.WU)(a)){if(!b)return!1;let c=a.split(":")[0].toLowerCase();return c===b||c===`www.${b}`||c.endsWith(`.${b}`)}function h(a,b){let c=new URL(a.toString()),h=b??(()=>{let a=(0,d.WU)(c.hostname);if(a&&g(c.hostname,a))return a;let b=(0,d.k0)(c.hostname);return b&&g(c.hostname,b)?b:null})();return h&&g(c.hostname,h)&&((!c.port||e.has(c.port))&&(c.port=""),f(c.hostname)||(c.protocol="https:")),c}function i(a){if(!a)return"";try{let b=new URL(a.includes("://")?a:`https://${a}`);return h(b).origin}catch{return a.replace(/\/$/,"")}}function j(a){return a&&f(a)?"http:":"https:"}function k(a,b,c="/",d){let e=c.startsWith("/")?c:`/${c}`,f=d??j(`${a}.${b}`),g=f.endsWith(":")?f:`${f}:`;return h(new URL(`${g}//${a}.${b}${e}`),b).href}},36418:(a,b,c)=>{"use strict";c.d(b,{uE:()=>h,hS:()=>k,yH:()=>j});var d=c(24751);c(84346),c(62172),c(4434),c(15698),c(87288);var e=c(82819);let f=!1,g=[],h=d.A.create({baseURL:"",headers:{"Content-Type":"application/json"},withCredentials:!0,timeout:9e4});h.interceptors.request.use(a=>(a.baseURL=(0,e.Qb)(),a.data instanceof FormData&&a.headers&&delete a.headers["Content-Type"],a),a=>Promise.reject(a)),h.interceptors.response.use(a=>a,async a=>{let b=a.config;if(a.response?.status===401&&b&&!b._retry)return b.url?.includes("/auth/refresh-token")?(console.warn("401 on auth page or refresh endpoint - logging out"),i(),Promise.reject(a)):f?(console.log("Refresh already in progress, queuing request"),new Promise(a=>{g.push(c=>{b.headers&&(b.headers.Authorization=`Bearer ${c}`),a(h(b))})})):(b._retry=!0,f=!0,console.warn("No refresh token found in storage"),i(),Promise.reject(a));return(a.response?.status===401&&i(),a.response?.status===429)?Promise.reject(Error(a.response?.data?.message||"Too many requests. Please try again later.")):a.response?.status===402?Promise.reject({success:!1,message:a.response?.data?.message||"Your free trial has ended. Upgrade to continue using your academy.",code:a.response?.data?.code||"SUBSCRIPTION_REQUIRED"}):Promise.reject({success:!1,message:a.response?.data?.message||Object(a).message||"An error occurred",errors:a.response?.data?.errors})});let i=()=>{},j=a=>{let b=a.data;if(!b||"object"!=typeof b||!("success"in b))throw Error("Invalid API response");if(!b.success)throw Error(b.message||"API request failed");if(void 0!==b.data)return b.data},k=a=>{if(d.A.isAxiosError(a)){if("ECONNABORTED"===a.code||a.message.includes("timeout"))return"The request took too long to complete. Please try again. If the issue persists, the operation may be processing in the background.";if("ERR_NETWORK"===a.code||"Network Error"===a.message||"Failed to fetch"===a.message)return"Unable to connect to the server. Please check if the backend is running and the API URL is correct.";if(!a.response)return"No response from server. Please check your connection and try again.";let b=a.response?.data;if(400===a.response.status){if(b?.errors&&Array.isArray(b.errors)&&b.errors.length>0){let a=b.errors.map(a=>{let b=a.param||a.field||"field",c=a.msg||a.message||"Invalid value";return`${b}: ${c}`}).join("\n");return`Validation failed:
${a}`}return b?.message?b.message:"Invalid request. Please check your input and try again."}if(503===a.response.status)return b?.message||"The server or database is temporarily unavailable. Try again shortly.";if(401===a.response.status){let a=b?.message||"";return a.toLowerCase().includes("invalid email or password")?"Invalid email or password. Please check your credentials and try again.":a.includes("Can't reach database server")||a.includes("Invalid `prisma.")||a.includes("PrismaClient")?"The server cannot reach the database right now. Restart the backend and try again.":a||"Your session expired or credentials are invalid. Please sign in again."}if(402===a.response.status)return b?.message||"Your free trial has ended. Upgrade to Starter or Premium to continue.";if(b?.message){let a=b.message;return a.includes("Can't reach database server")||a.includes("Invalid `prisma.")||a.includes("PrismaClient")?"The server cannot reach the database right now. Restart the backend and try again.":a}return 404===a.response.status?"The requested resource was not found.":500===a.response.status?"Server error. Please try again later.":a.message?a.message:`Request failed with status ${a.response?.status||"unknown"}`}return a instanceof Error?"Failed to fetch"===a.message||a.message.includes("fetch")?"Unable to connect to the server. Please check if the backend is running and the API URL is correct.":a.message:a&&"object"==typeof a&&"message"in a&&"string"==typeof a.message?a.message:"An unexpected error occurred"}},62172:(a,b,c)=>{"use strict";c.d(b,{fb:()=>g}),c(4434);let d={primary:"#15803d",secondary:"#047857"},e=/^#([0-9A-Fa-f]{6})$/;function f(a){return e.test(a.trim())}function g(a){return a?{primary:f(a.primary||"")?a.primary.trim().toLowerCase():d.primary,secondary:f(a.secondary||"")?a.secondary.trim().toLowerCase():d.secondary}:{...d}}},78335:()=>{},82819:(a,b,c)=>{"use strict";c.d(b,{HZ:()=>g,Qb:()=>f});let d="https://api.reemangroup.com/api";function e(a){return a.trim().replace(/\/$/,"")}function f(){let a="https://dplms-saas-backend-gwthj.ondigitalocean.app/api".trim();return a?e(a):d}function g(){let a="https://dplms-saas-backend-gwthj.ondigitalocean.app/api".trim();return a?e(a):d}},84346:(a,b,c)=>{"use strict";function d(a){return a.trim().toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").slice(0,63)}c.d(b,{R7:()=>d}),c(4434),c(1623)},87288:(a,b,c)=>{"use strict";c.d(b,{if:()=>d}),c(1623);let d=a=>null},96487:()=>{}};