@cyberskill/shared 1.94.0 → 1.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_tsup-dts-rollup.d.cts +18 -1
- package/dist/_tsup-dts-rollup.d.ts +18 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -1
- package/dist/nodejs/apollo-server/apollo-server.util.cjs +1 -1
- package/dist/nodejs/apollo-server/apollo-server.util.d.cts +1 -0
- package/dist/nodejs/apollo-server/apollo-server.util.d.ts +1 -0
- package/dist/nodejs/apollo-server/apollo-server.util.js +1 -1
- package/dist/nodejs/apollo-server/index.cjs +1 -1
- package/dist/nodejs/apollo-server/index.d.cts +1 -0
- package/dist/nodejs/apollo-server/index.d.ts +1 -0
- package/dist/nodejs/apollo-server/index.js +1 -1
- package/dist/nodejs/cli/cli.util.cjs +1 -1
- package/dist/nodejs/cli/cli.util.js +1 -1
- package/dist/nodejs/cli/index.cjs +1 -1
- package/dist/nodejs/cli/index.js +1 -1
- package/dist/nodejs/express/express.util.cjs +1 -1
- package/dist/nodejs/express/express.util.d.cts +2 -0
- package/dist/nodejs/express/express.util.d.ts +2 -0
- package/dist/nodejs/express/express.util.js +1 -1
- package/dist/nodejs/express/index.cjs +1 -1
- package/dist/nodejs/express/index.d.cts +2 -0
- package/dist/nodejs/express/index.d.ts +2 -0
- package/dist/nodejs/express/index.js +1 -1
- package/dist/nodejs/index.cjs +1 -1
- package/dist/nodejs/index.d.cts +3 -0
- package/dist/nodejs/index.d.ts +3 -0
- package/dist/nodejs/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export { DEBUG } from './_tsup-dts-rollup.js';
|
|
|
12
12
|
export { RESPONSE_STATUS } from './_tsup-dts-rollup.js';
|
|
13
13
|
export { I_ApolloServerOptions } from './_tsup-dts-rollup.js';
|
|
14
14
|
export { createApolloServer } from './_tsup-dts-rollup.js';
|
|
15
|
+
export { expressMiddleware } from './_tsup-dts-rollup.js';
|
|
15
16
|
export { I_EslintError } from './_tsup-dts-rollup.js';
|
|
16
17
|
export { I_CommandContext } from './_tsup-dts-rollup.js';
|
|
17
18
|
export { I_Command } from './_tsup-dts-rollup.js';
|
|
@@ -30,6 +31,8 @@ export { I_ExpressOptions } from './_tsup-dts-rollup.js';
|
|
|
30
31
|
export { I_CorsOptions } from './_tsup-dts-rollup.js';
|
|
31
32
|
export { createCors } from './_tsup-dts-rollup.js';
|
|
32
33
|
export { createExpress } from './_tsup-dts-rollup.js';
|
|
34
|
+
export { SessionOptions } from './_tsup-dts-rollup.js';
|
|
35
|
+
export { express } from './_tsup-dts-rollup.js';
|
|
33
36
|
export { existsSync } from './_tsup-dts-rollup.js';
|
|
34
37
|
export { readFileSync } from './_tsup-dts-rollup.js';
|
|
35
38
|
export { writeFileSync } from './_tsup-dts-rollup.js';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function s(e,t,r,n,s,o,i){try{var a=e[o](i);var c=a.value}catch(e){r(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(n,s)}}function o(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){s(i,n,o,a,c,"next",e)}function c(e){s(i,n,o,a,c,"throw",e)}a(undefined)})}}function i(e,t,r){t=d(t);return A(e,N()?Reflect.construct(t,r||[],d(e).constructor):t.apply(e,r))}function a(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}function u(e,t,r){if(t)c(e.prototype,t);if(r)c(e,r);return e}function l(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function d(e){d=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return d(e)}function f(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)C(e,t)}function p(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function m(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function v(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var s=true;var o=false;var i,a;try{for(r=r.call(e);!(s=(i=r.next()).done);s=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;a=e}finally{try{if(!s&&r["return"]!=null)r["return"]()}finally{if(o)throw a}}return n}function g(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function E(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){l(e,t,r[t])})}return e}function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,n)}return r}function S(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{y(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function O(e,t){if(e==null)return{};var r=_(e,t);var n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++){n=o[s];if(t.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;r[n]=e[n]}}return r}function _(e,t){if(e==null)return{};var r={};var n=Object.keys(e);var s,o;for(o=0;o<n.length;o++){s=n[o];if(t.indexOf(s)>=0)continue;r[s]=e[s]}return r}function A(e,t){if(t&&(T(t)==="object"||typeof t==="function")){return t}return n(e)}function C(e,t){C=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return C(e,t)}function I(e,r){return t(e)||v(e,r)||R(e,r)||g()}function b(e){return r(e)||m(e)||R(e)||E()}function T(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function R(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}function N(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(N=function(){return!!e})()}function w(e,t){var r,n,s,o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=a(0),i["throw"]=a(1),i["return"]=a(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(t){return c([e,t])}}function c(a){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,a[0]&&(o=0)),o)try{if(r=1,n&&(s=a[0]&2?n["return"]:a[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;if(n=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;n=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(a[0]===6&&o.label<s[1]){o.label=s[1];s=a;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(a);break}if(s[2])o.ops.pop();o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e];n=0}finally{r=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var x=Object.defineProperty;var D=function(e,t,r){return t in e?x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r};var L=function(e,t){return x(e,"name",{value:t,configurable:!0})};var j=function(e,t,r){return D(e,(typeof t==="undefined"?"undefined":T(t))!="symbol"?t+"":t,r)};var P={extends:["@commitlint/config-conventional"]};var M=function(e){return e.ESLINT="eslint",e.COMMITLINT="commitlint",e.LINT_STAGED="lint-staged",e.VITEST_REACT_E2E="vitest-react-e2e",e.VITEST_REACT_UNIT="vitest-react-unit",e}({});import G from"@antfu/eslint-config";import k from"@vitejs/plugin-react-swc";import{defineConfig as U}from"vitest/config";function F(e){return U(h({plugins:[k()],test:{include:["**/*.test.e2e.?(c|m)[jt]s?(x)"],browser:{enabled:!0,provider:"playwright",instances:[{browser:"chromium"},{browser:"firefox"},{browser:"webkit"}]}}},e))}L(F,"vitestE2E");import q from"@vitejs/plugin-react-swc";import{defineConfig as K}from"vitest/config";import H from"node:process";var V=function(e){return e.CLI="CLI",e.RAW="RAW",e}({});import{exec as W}from"node:child_process";import Q from"node:process";import*as Y from"node:util";import B from"node:process";var J=B.env.DEBUG==="true";var z=function(e){return e.Error="error",e.Warning="warning",e}({});import $ from"chalk";import X from"consola";import{GraphQLError as Z}from"graphql";var ee={GRAPHQL_PARSE_FAILED:{CODE:"GRAPHQL_PARSE_FAILED",MESSAGE:"The GraphQL operation string contains a syntax error."},GRAPHQL_VALIDATION_FAILED:{CODE:"GRAPHQL_VALIDATION_FAILED",MESSAGE:"The GraphQL operation is not valid against the server's schema."},BAD_USER_INPUT:{CODE:"BAD_USER_INPUT",MESSAGE:"The GraphQL operation includes an invalid value for a field argument."},PERSISTED_QUERY_NOT_FOUND:{CODE:"PERSISTED_QUERY_NOT_FOUND",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the query was not in the APQ cache."},PERSISTED_QUERY_NOT_SUPPORTED:{CODE:"PERSISTED_QUERY_NOT_SUPPORTED",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the server has disabled APQ."},OPERATION_RESOLUTION_FAILURE:{CODE:"OPERATION_RESOLUTION_FAILURE",MESSAGE:"The request was parsed successfully and is valid against the server's schema, but the server couldn't resolve which operation to run. This occurs when a request containing multiple named operations doesn't specify which operation to run (i.e.,operationName), or if the named operation isn't included in the request."},CONTINUE:{CODE:100,MESSAGE:"Continue"},SWITCHING_PROTOCOLS:{CODE:101,MESSAGE:"Switching Protocols"},PROCESSING:{CODE:102,MESSAGE:"Processing"},OK:{CODE:200,MESSAGE:"OK"},CREATED:{CODE:201,MESSAGE:"Created"},ACCEPTED:{CODE:202,MESSAGE:"Accepted"},NON_AUTHORITATIVE_INFORMATION:{CODE:203,MESSAGE:"Non Authoritative Information"},NO_CONTENT:{CODE:204,MESSAGE:"No Content"},RESET_CONTENT:{CODE:205,MESSAGE:"Reset Content"},PARTIAL_CONTENT:{CODE:206,MESSAGE:"Partial Content"},MULTI_STATUS:{CODE:207,MESSAGE:"Multi-Status"},MULTIPLE_CHOICES:{CODE:300,MESSAGE:"Multiple Choices"},MOVED_PERMANENTLY:{CODE:301,MESSAGE:"Moved Permanently"},MOVED_TEMPORARILY:{CODE:302,MESSAGE:"Moved Temporarily"},SEE_OTHER:{CODE:303,MESSAGE:"See Other"},NOT_MODIFIED:{CODE:304,MESSAGE:"Not Modified"},USE_PROXY:{CODE:305,MESSAGE:"Use Proxy"},TEMPORARY_REDIRECT:{CODE:307,MESSAGE:"Temporary Redirect"},PERMANENT_REDIRECT:{CODE:308,MESSAGE:"Permanent Redirect"},BAD_REQUEST:{CODE:400,MESSAGE:"Bad Request"},UNAUTHORIZED:{CODE:401,MESSAGE:"Unauthorized"},PAYMENT_REQUIRED:{CODE:402,MESSAGE:"Payment Required"},FORBIDDEN:{CODE:403,MESSAGE:"Forbidden"},NOT_FOUND:{CODE:404,MESSAGE:"Not Found"},METHOD_NOT_ALLOWED:{CODE:405,MESSAGE:"Method Not Allowed"},NOT_ACCEPTABLE:{CODE:406,MESSAGE:"Not Acceptable"},PROXY_AUTHENTICATION_REQUIRED:{CODE:407,MESSAGE:"Proxy Authentication Required"},REQUEST_TIMEOUT:{CODE:408,MESSAGE:"Request Timeout"},CONFLICT:{CODE:409,MESSAGE:"Conflict"},GONE:{CODE:410,MESSAGE:"Gone"},LENGTH_REQUIRED:{CODE:411,MESSAGE:"Length Required"},PRECONDITION_FAILED:{CODE:412,MESSAGE:"Precondition Failed"},REQUEST_TOO_LONG:{CODE:413,MESSAGE:"Request Entity Too Large"},REQUEST_URI_TOO_LONG:{CODE:414,MESSAGE:"Request-URI Too Long"},UNSUPPORTED_MEDIA_TYPE:{CODE:415,MESSAGE:"Unsupported Media Type"},REQUESTED_RANGE_NOT_SATISFIABLE:{CODE:416,MESSAGE:"Requested Range Not Satisfiable"},EXPECTATION_FAILED:{CODE:417,MESSAGE:"Expectation Failed"},IM_A_TEAPOT:{CODE:418,MESSAGE:"I'm a teapot"},INSUFFICIENT_SPACE_ON_RESOURCE:{CODE:419,MESSAGE:"Insufficient Space on Resource"},METHOD_FAILURE:{CODE:420,MESSAGE:"Method Failure"},MISDIRECTED_REQUEST:{CODE:421,MESSAGE:"Misdirected Request"},UNPROCESSABLE_ENTITY:{CODE:422,MESSAGE:"Unprocessable Entity"},LOCKED:{CODE:423,MESSAGE:"Locked"},FAILED_DEPENDENCY:{CODE:424,MESSAGE:"Failed Dependency"},PRECONDITION_REQUIRED:{CODE:428,MESSAGE:"Precondition Required"},TOO_MANY_REQUESTS:{CODE:429,MESSAGE:"Too Many Requests"},REQUEST_HEADER_FIELDS_TOO_LARGE:{CODE:431,MESSAGE:"Request Header Fields Too Large"},UNAVAILABLE_FOR_LEGAL_REASONS:{CODE:451,MESSAGE:"Unavailable For Legal Reasons"},INTERNAL_SERVER_ERROR:{CODE:500,MESSAGE:"Internal Server Error"},NOT_IMPLEMENTED:{CODE:501,MESSAGE:"Not Implemented"},BAD_GATEWAY:{CODE:502,MESSAGE:"Bad Gateway"},SERVICE_UNAVAILABLE:{CODE:503,MESSAGE:"Service Unavailable"},GATEWAY_TIMEOUT:{CODE:504,MESSAGE:"Gateway Timeout"},HTTP_VERSION_NOT_SUPPORTED:{CODE:505,MESSAGE:"HTTP Version Not Supported"},INSUFFICIENT_STORAGE:{CODE:507,MESSAGE:"Insufficient Storage"},NETWORK_AUTHENTICATION_REQUIRED:{CODE:511,MESSAGE:"Network Authentication Required"}};function et(e){var t=e.message,r=e.status,n=r===void 0?ee.INTERNAL_SERVER_ERROR:r,s=e.type,o=s===void 0?"graphql":s;var i;var a=(i=t!==null&&t!==void 0?t:n.MESSAGE)!==null&&i!==void 0?i:"Internal server error";throw o==="graphql"?new Z(a,{extensions:{code:n.CODE}}):new Error(a)}L(et,"throwError");J||(X.level=4);function er(e){var t=$[e];return typeof t=="function"?t:$.green}L(er,"chalkKeyword");var en={silent:X.silent,level:X.level,fatal:X.fatal,error:X.error,warn:X.warn,log:X.log,info:X.info,success:X.success,ready:X.ready,start:X.start,box:X.box,debug:X.debug,trace:X.trace,verbose:X.verbose,printBoxedLog:function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){X.box($.green(e));return}t.forEach(function(e){var t=e.file,n=e.position,s=e.rule,o=e.message;X.log("".concat($.gray("File:")," ").concat($.blue("".concat(t).concat(n?":".concat(n):"")))),s&&X.log(" ".concat(er(r)("Rule:")," ").concat(s)),X.log(" ".concat(er(r)("Message:")," ").concat(o))}),X.box(er(r)("".concat(e," : ").concat(t.length))),X.log($.gray("─".repeat(40)))}};var es={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import eo from"node-fetch";import*as ei from"node:fs";function ea(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.every(function(e){return ei.existsSync(e)})}L(ea,"existsSync");function ec(e,t){var r=ei.readFileSync(e,"utf-8");if(t===null||t===void 0?void 0:t.asJson)try{var n=JSON.parse(r);if((typeof n==="undefined"?"undefined":T(n))=="object"&&n!==null)return n;throw new Error("Parsed JSON is not an object or array")}catch(t){throw new Error("Failed to parse JSON from file: ".concat(e))}return r}L(ec,"readFileSync");function eu(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=r.isJson,s=n===void 0?!1:n,o=s&&(typeof t==="undefined"?"undefined":T(t))=="object"?JSON.stringify(t,null,4):String(t);ei.writeFileSync(e,o,"utf-8")}L(eu,"writeFileSync");function el(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=r.isJson,s=n===void 0?!1:n,o=s&&(typeof t==="undefined"?"undefined":T(t))=="object"?JSON.stringify(t,null,4):String(t);ei.appendFileSync(e,o,"utf-8")}L(el,"appendFileSync");function ed(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}t.forEach(function(e){ea(e)&&ei.rmSync(e,{recursive:!0,force:!0})})}L(ed,"rmSync");function ef(e){var t=ez(e$,e2);if(!ea(t))return!1;try{var r=ec(t,{asJson:!0}),n=r.name,s=r.dependencies,o=s===void 0?{}:s,i=r.devDependencies,a=i===void 0?{}:i,c=n===e,u=e in o,l=e in a;return c||u||l?{path:t,file:r,isCurrentProject:c,isDepend:u,isDevDepend:l}:!1}catch(e){return en.warn("Failed to read package.json: ".concat(e.message)),!1}}L(ef,"getPackage");function ep(e){return em.apply(this,arguments)}function em(){em=o(function(e){var t,r,n,s;return w(this,function(o){switch(o.label){case 0:o.trys.push([0,3,,4]);return[4,eo("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=o.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:r=o.sent(),n=r.version;return[2,n];case 3:s=o.sent();throw en.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})});return em.apply(this,arguments)}L(ep,"getLatestPackageVersion");function ev(e,t){return eg.apply(this,arguments)}function eg(){eg=o(function(e,t){var r,n,s,o,i,a,c,u,l,d,f,p,m,v,g,E,y,S,O,_,A;return w(this,function(C){switch(C.label){case 0:C.trys.push([0,4,,5]);r=ef(e);if(!r)return[2,h({},es)];c=r.path,u=r.file,l=r.isCurrentProject,d=r.isDepend,f=r.isDevDepend,p=(n=u.dependencies)!==null&&n!==void 0?n:{},m=(s=u.devDependencies)!==null&&s!==void 0?s:{},v=l?(o=u.version)!==null&&o!==void 0?o:"0.0.0":d?(i=p[e])!==null&&i!==void 0?i:"0.0.0":f?(a=m[e])!==null&&a!==void 0?a:"0.0.0":"0.0.0";if(!l)return[3,1];y=v;return[3,3];case 1:return[4,ep(e)];case 2:y=C.sent();C.label=3;case 3:g=y,E=l||v===g;if(!E&&(t===null||t===void 0?void 0:t.update)){;O=d?"dependencies":f?"devDependencies":null;O&&((S=u[O])===null||S===void 0?void 0:S[e])!==g&&(u[O]=(_=u[O])!==null&&_!==void 0?_:{},u[O][e]=g,eu(c,u,{isJson:!0}),en.info('Updated "'.concat(e,'" to version ').concat(g)))}return[2,{isCurrentProject:l,installedPath:c,file:u,isUpToDate:E}];case 4:A=C.sent();return[2,(en.error('Error checking package "'.concat(e,'": ').concat(A.message)),h({},es))];case 5:return[2]}})});return eg.apply(this,arguments)}L(ev,"checkPackage");function eE(){return eh.apply(this,arguments)}function eh(){eh=o(function(){var e,t,r,n,s,o,i,a,c,u,l,d;return w(this,function(f){switch(f.label){case 0:e=[{command:L(function(){return tN.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:L(function(){return tN.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:L(function(){return tN.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,r=false,n=undefined;f.label=1;case 1:f.trys.push([1,9,10,11]);s=e[Symbol.iterator]();f.label=2;case 2:if(!!(t=(o=s.next()).done))return[3,8];i=o.value,a=i.command,c=i.message;f.label=3;case 3:f.trys.push([3,6,,7]);return[4,a()];case 4:u=f.sent();return[4,eW("".concat(c," using: ").concat(u),u)];case 5:f.sent();return[2];case 6:l=f.sent();en.warn("Installation attempt failed: ".concat(c)),en.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=f.sent();r=true;n=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(r){throw n}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return eh.apply(this,arguments)}L(eE,"installDependencies");function ey(e,t){return eS.apply(this,arguments)}function eS(){eS=o(function(e,t){var r,n,s,o,i,a,c,u,l,d,f;return w(this,function(p){switch(p.label){case 0:if(!ea(tC.PACKAGE_JSON)){en.error("package.json not found. Aborting setup.");return[2]}p.label=1;case 1:p.trys.push([1,13,,14]);r=b(new Set(e)).sort();return[4,Promise.all(r.map(function(e){return ev(e,h({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:n=p.sent().every(function(e){return e.isUpToDate});if(n)return[3,4];return[4,eE()];case 3:n=p.sent();p.label=4;case 4:n;o=true,i=false,a=undefined;p.label=5;case 5:p.trys.push([5,10,11,12]);c=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();p.label=6;case 6:if(!!(o=(u=c.next()).done))return[3,9];l=u.value;return[4,l()];case 7:p.sent();p.label=8;case 8:o=true;return[3,6];case 9:return[3,12];case 10:d=p.sent();i=true;a=d;return[3,12];case 11:try{if(!o&&c.return!=null){c.return()}}finally{if(i){throw a}}return[7];case 12:return[3,14];case 13:f=p.sent();throw en.error('Failed to setup "'.concat(e.join(", "),'": ').concat(f.message)),f;case 14:return[2]}})});return eS.apply(this,arguments)}L(ey,"setupPackages");import eO from"node-persist";import e_ from"node:os";import eA from"node:process";function eC(){return eA.env.CYBERSKILL_STORAGE_DIR||ez(e_.homedir(),eZ)}L(eC,"getStorageDir");function eI(){return eb.apply(this,arguments)}function eb(){eb=o(function(){var e;return w(this,function(t){switch(t.label){case 0:e=eO.defaultInstance;if(e)return[3,2];return[4,eO.init({dir:eC(),stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})});return eb.apply(this,arguments)}L(eI,"initNodePersist");var eT={get:function e(e){return o(function(){var t,r;return w(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eI()];case 1:n.sent();return[4,eO.getItem(e)];case 2:return[2,(t=n.sent())!==null&&t!==void 0?t:null];case 3:r=n.sent();return[2,(en.error('[Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 4:return[2]}})})()},set:function e(e,t){return o(function(){var r;return w(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eI()];case 1:n.sent();return[4,eO.setItem(e,t)];case 2:n.sent();return[3,4];case 3:r=n.sent();en.error('[Storage:set] Error setting key "'.concat(e,'":'),r);return[3,4];case 4:return[2]}})})()},remove:function e(e){return o(function(){var t;return w(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eI()];case 1:r.sent();return[4,eO.removeItem(e)];case 2:r.sent();return[3,4];case 3:t=r.sent();en.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return o(function(){var e,t;return w(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eI()];case 1:r.sent();return[4,eO.keys()];case 2:e=r.sent();return[2,Array.isArray(e)?e:(en.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=r.sent();return[2,(en.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return o(function(){return w(this,function(t){try{return[2,"".concat(eC()," (key: ").concat(e,")")]}catch(e){return[2,(en.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var eR=Y.promisify(W);function eN(e){return"error_list:".concat(e)}L(eN,"getErrorListKey");function ew(e){return ex.apply(this,arguments)}function ex(){ex=o(function(e){var t,r,n;return w(this,function(s){switch(s.label){case 0:if(e.length===0)return[2];t=Date.now(),r=eN(t);s.label=1;case 1:s.trys.push([1,3,,4]);return[4,eT.set(r,{errors:e,timestamp:t})];case 2:s.sent(),setTimeout(/*#__PURE__*/o(function(){var e;return w(this,function(t){switch(t.label){case 0:return[4,eT.getLogLink(r)];case 1:e=t.sent();e&&en.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:n=s.sent();en.error("Failed to save errors: ".concat(n.message));return[3,4];case 4:return[2]}})});return ex.apply(this,arguments)}L(ew,"saveErrorListToStorage");function eD(){return eL.apply(this,arguments)}function eL(){eL=o(function(){var e,t,r;return w(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eT.keys()];case 1:e=n.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(/*#__PURE__*/function(){var e=o(function(e){var t;return w(this,function(r){switch(r.label){case 0:return[4,eT.get(e)];case 1:return[2,((t=r.sent())===null||t===void 0?void 0:t.errors)||[]]}})});return function(t){return e.apply(this,arguments)}}()))];case 2:return[2,n.sent().flat()];case 3:r=n.sent();return[2,(en.error("Failed to retrieve stored errors: ".concat(r.message)),[])];case 4:return[2]}})});return eL.apply(this,arguments)}L(eD,"getStoredErrorLists");function ej(){return eP.apply(this,arguments)}function eP(){eP=o(function(){var e,t,r;return w(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eT.keys()];case 1:e=n.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return eT.remove(e)}))];case 2:n.sent();return[3,4];case 3:r=n.sent();en.error("Failed to clear error lists: ".concat(r.message));return[3,4];case 4:return[2]}})});return eP.apply(this,arguments)}L(ej,"clearAllErrorLists");function eM(e){var t=[],r=[],n="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,o=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,i=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))n=e.trim();else{var a,c,u,l,d;var f=s.exec(e)||[],p=o.exec(e)||[],m=i.exec(e)||[];var v,g,E,h,y,S;f.length&&n?t.push({file:n,position:"".concat(f[1],":").concat(f[2]),type:f[3]===z.Error?z.Error:z.Warning,message:(v=f===null||f===void 0?void 0:(a=f[4])===null||a===void 0?void 0:a.trim())!==null&&v!==void 0?v:"",rule:(g=f===null||f===void 0?void 0:(c=f[5])===null||c===void 0?void 0:c.trim())!==null&&g!==void 0?g:""}):p.length?t.push({file:(E=p===null||p===void 0?void 0:p[1])!==null&&E!==void 0?E:"",position:"".concat(p[2],":").concat(p[3]),type:p[4]===z.Error?z.Error:z.Warning,message:(h=p===null||p===void 0?void 0:(u=p[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):m.length?t.push({file:"commitlint",type:z.Error,message:(y=m===null||m===void 0?void 0:(l=m[1])===null||l===void 0?void 0:l.trim())!==null&&y!==void 0?y:"",rule:(S=m===null||m===void 0?void 0:(d=m[2])===null||d===void 0?void 0:d.trim())!==null&&S!==void 0?S:""}):r.push(e.trim())}}),t.length&&ew(t),J&&r.length&&(en.warn("Unmatched lines:"),r.forEach(function(e){return en.info(" ".concat(e))}))}L(eM,"parseTextErrors");function eG(e){try{var t=JSON.parse(e),r=[];t.forEach(function(e){var t=e.filePath,n=e.messages;n.forEach(function(e){var n=e.severity,s=e.line,o=e.column,i=e.ruleId,a=e.message;r.push({type:n===2?z.Error:z.Warning,file:t,position:"".concat(s,":").concat(o),rule:i,message:a})})}),r.length&&ew(r)}catch(t){eM(e)}}L(eG,"parseCommandOutput");function ek(e){return eU.apply(this,arguments)}function eU(){eU=o(function(e){var t,r,n,s,o,i,a,c,u;var l=arguments;return w(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:eG;r=new AbortController;Q.on("SIGINT",function(){en.warn("Process interrupted. Terminating..."),r.abort(),Q.exit()});d.label=1;case 1:d.trys.push([1,3,,4]);return[4,eR(e,{maxBuffer:0x6400000,signal:r.signal})];case 2:n=d.sent(),s=n.stdout,o=n.stderr;[s,o].forEach(function(e){return e&&t(e)});return[3,4];case 3:i=d.sent();a=i.stdout,c=i.stderr,u=i.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&en.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return eU.apply(this,arguments)}L(ek,"executeCommand");function eF(e){return{raw:!0,cmd:e}}L(eF,"rawCommand");function eq(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(tE," ").concat(eX," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(tE," ").concat(tm," ").concat(tr," ").concat(e):"".concat(tE," ").concat(tt," ").concat(e)}L(eq,"formatCLI");function eK(e,t){return typeof e=="function"?eq(e(t),t):(typeof e==="undefined"?"undefined":T(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?eq(e,t):e}L(eK,"formatCommand");function eH(e){return eV.apply(this,arguments)}function eV(){eV=o(function(e){var t,r,n,s,o,i,a;var c=arguments;return w(this,function(u){switch(u.label){case 0:t=c.length>1&&c[1]!==void 0?c[1]:{};n=(r=t===null||t===void 0?void 0:t.isRemote)!==null&&r!==void 0?r:!1;if(!n)return[3,1];a=!1;return[3,3];case 1:return[4,ev(eX)];case 2:a=u.sent().isCurrentProject;u.label=3;case 3:s=a,o={isRemote:n,isCurrentProject:s},i=typeof e=="function"?e(o):e;return[2,Object.fromEntries(Object.entries(i).map(function(e){var t=I(e,2),r=t[0],n=t[1];return[r,eK(n,o)]}))]}})});return eV.apply(this,arguments)}L(eH,"resolveCommands");function eW(e,t){return eQ.apply(this,arguments)}function eQ(){eQ=o(function(e,t){var r;return w(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);en.start("".concat(e)),J&&en.info("→ ".concat(t));return[4,ek(t)];case 1:n.sent(),en.success("".concat(e," done."));return[3,3];case 2:r=n.sent();throw en.error("".concat(e," failed: ").concat(r.message)),r;case 3:return[2]}})});return eQ.apply(this,arguments)}L(eW,"runCommand");import*as eY from"node:path";function eB(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;return(n=eY).resolve.apply(n,[e$].concat(b(t)))}L(eB,"resolveWorkingPath");function eJ(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;return(n=eY).resolve.apply(n,b(t))}L(eJ,"resolve");function ez(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;return(n=eY).join.apply(n,b(t))}L(ez,"join");var e$=H.env.INIT_CWD||H.cwd(),eX="@cyberskill/shared",eZ=".cyberskill-storage",e0="node_modules",e1="dist",e2="package.json",e4="package-lock.json",e3="tsconfig.json",e8=".gitignore",e5=".simple-git-hooks.json",e6="pnpm-lock.yaml",e9=".git/hooks/",e7=".git/COMMIT_EDITMSG",te=ez(e$,e0,eX,e1),tt="cyberskill",tr="src/nodejs/cli/index.ts",tn="eslint",ts="eslint",to="vitest",ti="playwright",ta="vitest",tc="@commitlint/cli",tu="commitlint",tl="lint-staged",td="lint-staged",tf="typescript",tp="tsc",tm="tsx",tv="git",tg="pnpm",tE="pnpm exec",th="simple-git-hooks",ty="simple-git-hooks",tS="@eslint/config-inspector",tO="eslint-config-inspector",t_="node-modules-inspector",tA="node-modules-inspector",tC={CYBERSKILL_DIRECTORY:te,WORKING_DIRECTORY:e$,TS_CONFIG:eB(e3),GIT_IGNORE:eB(e8),GIT_HOOK:eB(e9),GIT_COMMIT_MSG:eB(e7),SIMPLE_GIT_HOOKS_JSON:eB(e5),PACKAGE_JSON:eB(e2),PACKAGE_LOCK_JSON:eB(e4),PNPM_LOCK_YAML:eB(e6),NODE_MODULES:eB(e0),LINT_STAGED_CONFIG:eB("".concat(te,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:eB("".concat(te,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:eB("".concat(te,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:eB("".concat(te,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:eB("".concat(te,"/react/vitest/vitest.e2e.js"))};function tI(e){var t=e.isCurrentProject;return h({"pre-commit":td,"commit-msg":tu},t&&{"pre-push":eF("".concat(tv," pull"))})}L(tI,"HOOK");function tb(e){return tT.apply(this,arguments)}function tT(){tT=o(function(e){var t,r,n,s,o,i;var a=arguments;return w(this,function(c){switch(c.label){case 0:for(t=a.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=a[n]}s=I(r,2),o=s[0],i=s[1];if(!o)throw new Error("'first' argument is undefined");switch(e){case V.CLI:return[3,1];case V.RAW:return[3,3]}return[3,4];case 1:return[4,ey(o.split(" "),{update:!0})];case 2:return[2,(c.sent(),eK(eF("".concat(tE," ").concat(i))))];case 3:return[2,eK(eF(o))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return tT.apply(this,arguments)}L(tb,"buildCommand");function tR(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}return /*#__PURE__*/o(function(){return w(this,function(t){return[2,tb.apply(void 0,[e].concat(b(r)))]})})}L(tR,"commandFactory");var tN={simpleGitHooks:tR(V.CLI,th,ty),eslintInspect:tR(V.CLI,tS,tO),nodeModulesInspect:tR(V.CLI,t_,tA),eslintCheck:tR(V.CLI,tn,"".concat(ts," ").concat(tC.WORKING_DIRECTORY)),eslintFix:tR(V.CLI,tn,"".concat(ts," ").concat(tC.WORKING_DIRECTORY," --fix")),typescriptCheck:tR(V.CLI,tf,"".concat(tp," -p ").concat(tC.TS_CONFIG," --noEmit")),configureGitHook:tR(V.RAW,"".concat(tv," config core.hooksPath ").concat(tC.GIT_HOOK)),testUnit:tR(V.CLI,to,"".concat(ta," --config ").concat(tC.UNIT_TEST_CONFIG)),testE2e:tR(V.CLI,"".concat(to," ").concat(ti),"".concat(ta," --config ").concat(tC.E2E_TEST_CONFIG)),commitLint:tR(V.CLI,tc,"".concat(tu," --edit ").concat(tC.GIT_COMMIT_MSG," --config ").concat(tC.COMMITLINT_CONFIG)),lintStaged:tR(V.CLI,tl,"".concat(td," --config ").concat(tC.LINT_STAGED_CONFIG)),stageBuildDirectory:tR(V.RAW,"".concat(tv," add ").concat(e1)),build:tR(V.RAW,"".concat(tg," run build")),pnpmInstallStandard:tR(V.RAW,"".concat(tg," install")),pnpmInstallLegacy:tR(V.RAW,"".concat(tg," install --legacy-peer-deps")),pnpmInstallForce:tR(V.RAW,"".concat(tg," install --force"))};function tw(e){return K(h({plugins:[q()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:[tC.UNIT_TEST_SETUP_CONFIG]}},e))}L(tw,"vitestUnit");function tx(e){try{return JSON.parse(e),!0}catch(e){return!1}}L(tx,"isJson");function tD(e){return!!e&&(typeof e==="undefined"?"undefined":T(e))=="object"&&!Array.isArray(e)}L(tD,"isPlainObject");function tL(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.flat().reduce(function(e,t){var r=true,n=false,s=undefined;try{for(var o=Object.entries(t)[Symbol.iterator](),i;!(r=(i=o.next()).done);r=true){var a=I(i.value,2),c=a[0],u=a[1];var l=e[c];Array.isArray(u)?e[c]=Array.from(new Set(b(Array.isArray(l)?l:[]).concat(b(u)))):tD(u)?e[c]=tL(tD(l)?l:{},u):e[c]=u}}catch(e){n=true;s=e}finally{try{if(!r&&o.return!=null){o.return()}}finally{if(n){throw s}}}return e},{})}L(tL,"deepMerge");import*as tj from"globals";var tP=[{languageOptions:{globals:h({},tj.node,tj.browser)},rules:{"perfectionist/sort-imports":["error",{internalPattern:["^#.*","^@/.*"]}]},ignores:["build","dist"]}];var tM;var tG=L(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return tL.apply(void 0,b(t))},"passThroughHandler"),tk=L(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n=tL.apply(void 0,[tP].concat(b(t))),s=n.ignores,o=O(n,["ignores"]),i=Array.isArray(s)&&s.every(function(e){return typeof e=="string"})?{ignores:s}:void 0,a=[o].concat(b(i?[i]:[]));return G.apply(void 0,[{stylistic:{semi:!0,indent:4,quotes:"single"},formatters:{css:!0,html:!0,markdown:"prettier"},yaml:!1,react:!0}].concat(b(a)))},"handleESLint"),tU=L(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return F.apply(void 0,b(t))},"handleVitestReactE2E"),tF=L(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return tw.apply(void 0,b(t))},"handleVitestReactUnit"),tq=(tM={},l(tM,M.ESLINT,tk),l(tM,M.COMMITLINT,tG),l(tM,M.LINT_STAGED,tG),l(tM,M.VITEST_REACT_E2E,tU),l(tM,M.VITEST_REACT_UNIT,tF),tM);function tK(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}var s=tq[e];if(!s)throw new Error("Unknown config type: ".concat(e));return s.apply(void 0,b(r))}L(tK,"mergeConfigs");import{defineConfig as tH}from"@eddeee888/gcg-typescript-resolver-files";function tV(e){var t=e.uri,r=e.from,n=e.to,s=e.target,o=s===void 0?"client":s;var i=o==="client",a=o==="server";return S(h({schema:t,ignoreNoDocuments:!0,overwrite:!0},i&&{documents:[r]}),{generates:h({},i&&l({},n,{preset:"client",presetConfig:{fragmentMasking:!1,persistedDocuments:!0},config:{useTypeImports:!0}}),a&&l({},n,tH()))})}L(tV,"createGraphqlCodegenConfig");var tW={"*":["eslint --fix"]};var tQ=(typeof window==="undefined"?"undefined":T(window))<"u";import{ApolloServer as tY}from"@apollo/server";import{ApolloServerPluginDrainHttpServer as tB}from"@apollo/server/plugin/drainHttpServer";import{ApolloServerPluginLandingPageLocalDefault as tJ,ApolloServerPluginLandingPageProductionDefault as tz}from"@apollo/server/plugin/landingPage/default";function t$(e){return new tY(h({schema:e.schema,plugins:[e.isDev?tJ():tz(),tB({httpServer:e.server})].concat(b(e.drainServer?[{serverWillStart:function t(){return o(function(){return w(this,function(t){return[2,{drainServer:function t(){return o(function(){var t;return w(this,function(r){(t=e.drainServer)===null||t===void 0?void 0:t.call(e),en.info("Apollo Server drainServer hook called");return[2]})})()}}]})})()}}]:[]))},e.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}))}L(t$,"createApolloServer");import tX from"node:process";import{hideBin as tZ}from"yargs/helpers";import t0 from"yargs/yargs";var t1={name:"@cyberskill/shared",type:"module",version:"1.93.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/apollo-server":{types:"./dist/nodejs/apollo-server/index.d.ts",import:"./dist/nodejs/apollo-server/index.js",require:"./dist/nodejs/apollo-server/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/express":{types:"./dist/nodejs/express/index.d.ts",import:"./dist/nodejs/express/index.js",require:"./dist/nodejs/express/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./nodejs/ws":{types:"./dist/nodejs/ws/index.d.ts",import:"./dist/nodejs/ws/index.js",require:"./dist/nodejs/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"dotenv -e .env -- tsup --watch",lint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint","lint:fix":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:inspect",reset:"dotenv -e .env -- tsx src/nodejs/cli/index.ts reset",setup:"dotenv -e .env -- tsx src/nodejs/cli/index.ts setup",inspect:"dotenv -e .env -- tsx src/nodejs/cli/index.ts inspect","test:unit":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:unit","test:e2e":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:e2e",commitlint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts commitlint","lint-staged":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.3","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.4","@next/eslint-plugin-next":"15.3.1","@swc/core":"1.11.21","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.1",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.19",express:"4.21.2","express-device":"0.4.2","express-session":"1.18.1",globals:"16.0.0",graphql:"16.10.0","graphql-ws":"6.0.4",i18next:"25.0.0",jsdom:"26.1.0",localforage:"1.10.0","modern-normalize":"3.0.1",mongodb:"6.15.0",mongoose:"8.13.2","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.0.2","node-fetch":"3.3.2","node-persist":"4.0.4",ora:"8.2.0",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.4.1","react-icons":"5.5.0",sass:"1.86.3",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.3",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.2",vitest:"3.1.1","vitest-browser-react":"0.1.1",ws:"8.18.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/compression":"1.7.5","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.2","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.24.0","lint-staged":"15.5.1","node-modules-inspector":"0.6.6","simple-git-hooks":"2.12.1"}};function t2(){return t4.apply(this,arguments)}function t4(){t4=o(function(){var e,t;return w(this,function(r){switch(r.label){case 0:if(!ea(tC.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,tN.typescriptCheck()];case 1:return[4,eW.apply(void 0,t.concat([r.sent()]))];case 2:e=r.sent();return[3,4];case 3:e=en.warn("No TypeScript configuration found. Skipping type check.");r.label=4;case 4:e;return[2]}})});return t4.apply(this,arguments)}L(t2,"checkTypescript");function t3(){return t8.apply(this,arguments)}function t8(){t8=o(function(){var e,t,r,n;var s=arguments;return w(this,function(o){switch(o.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];r=["Running ESLint with auto-fix"];return[4,tN.eslintFix()];case 1:return[4,eW.apply(void 0,r.concat([o.sent()]))];case 2:t=o.sent();return[3,6];case 3:n=["Running ESLint check"];return[4,tN.eslintCheck()];case 4:return[4,eW.apply(void 0,n.concat([o.sent()]))];case 5:t=o.sent();o.label=6;case 6:t;return[2]}})});return t8.apply(this,arguments)}L(t3,"checkEslint");function t5(e,t){if(!t.length)return;var r=e==="Errors"?"red":"yellow";en.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,r)}L(t5,"printIssues");function t6(){return t9.apply(this,arguments)}function t9(){t9=o(function(){var e,t,r;return w(this,function(n){switch(n.label){case 0:return[4,eD()];case 1:e=n.sent(),t=e.filter(function(e){return e.type===z.Error}),r=e.filter(function(e){return e.type===z.Warning});!t.length&&!r.length?en.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(t5("Warnings",r),t5("Errors",t),(t.length>0||r.length>0)&&tX.exit(1));return[2]}})});return t9.apply(this,arguments)}L(t6,"showCheckResult");function t7(){return re.apply(this,arguments)}function re(){re=o(function(){var e,t,r,n,s,o;return w(this,function(i){switch(i.label){case 0:return[4,ej()];case 1:i.sent();return[4,ev(eX)];case 2:e=i.sent(),t=e.isCurrentProject;if(!t)return[3,9];i.label=3;case 3:i.trys.push([3,8,,9]);r=["Building package: ".concat(eX)];return[4,tN.build()];case 4:return[4,eW.apply(void 0,r.concat([i.sent()]))];case 5:i.sent();n=["Staging build artifacts"];return[4,tN.stageBuildDirectory()];case 6:return[4,eW.apply(void 0,n.concat([i.sent()]))];case 7:i.sent();return[3,9];case 8:s=i.sent();throw en.error("Error building and staging ".concat(eX,": ").concat(s.message)),s;case 9:o=["Executing lint-staged"];return[4,tN.lintStaged()];case 10:return[4,eW.apply(void 0,o.concat([i.sent()]))];case 11:i.sent(),t6();return[2]}})});return re.apply(this,arguments)}L(t7,"lintStaged");function rt(){return rr.apply(this,arguments)}function rr(){rr=o(function(){var e;return w(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,tN.eslintInspect()];case 1:return[4,eW.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return rr.apply(this,arguments)}L(rt,"inspectLint");function rn(){return rs.apply(this,arguments)}function rs(){rs=o(function(){return w(this,function(e){switch(e.label){case 0:return[4,ej()];case 1:e.sent();return[4,Promise.all([t2(),t3()])];case 2:e.sent(),t6();return[2]}})});return rs.apply(this,arguments)}L(rn,"lintCheck");function ro(){return ri.apply(this,arguments)}function ri(){ri=o(function(){return w(this,function(e){switch(e.label){case 0:return[4,ej()];case 1:e.sent();return[4,Promise.all([t2(),t3(!0)])];case 2:e.sent(),t6();return[2]}})});return ri.apply(this,arguments)}L(ro,"lintFix");function ra(){return rc.apply(this,arguments)}function rc(){rc=o(function(){var e;return w(this,function(t){switch(t.label){case 0:return[4,ej()];case 1:t.sent();e=["Validating commit message"];return[4,tN.commitLint()];case 2:return[4,eW.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),t6();return[2]}})});return rc.apply(this,arguments)}L(ra,"commitLint");function ru(){return rl.apply(this,arguments)}function rl(){rl=o(function(){var e,t,r,n;return w(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,tN.configureGitHook()];case 1:return[4,eW.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),ed(tC.GIT_HOOK);return[4,eH(tI)];case 3:t=s.sent();eu(tC.SIMPLE_GIT_HOOKS_JSON,t,{isJson:!0});r="\n".concat(e5,"\n");ea(tC.GIT_IGNORE)?ec(tC.GIT_IGNORE).split("\n").includes(e5)||el(tC.GIT_IGNORE,r):eu(tC.GIT_IGNORE,r);n=["Setting up simple-git-hooks"];return[4,tN.simpleGitHooks()];case 4:return[4,eW.apply(void 0,n.concat([s.sent()]))];case 5:s.sent();return[2]}})});return rl.apply(this,arguments)}L(ru,"setupGitHook");function rd(){return rf.apply(this,arguments)}function rf(){rf=o(function(){return w(this,function(e){switch(e.label){case 0:return[4,ey([eX],{update:!0,postInstallActions:[ru]})];case 1:e.sent();return[2]}})});return rf.apply(this,arguments)}L(rd,"setup");function rp(){return rm.apply(this,arguments)}function rm(){rm=o(function(){return w(this,function(e){switch(e.label){case 0:ed(tC.NODE_MODULES,tC.PNPM_LOCK_YAML);return[4,eE()];case 1:e.sent();return[4,ru()];case 2:e.sent();return[2]}})});return rm.apply(this,arguments)}L(rp,"reset");function rv(){return rg.apply(this,arguments)}function rg(){rg=o(function(){var e;return w(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,tN.nodeModulesInspect()];case 1:return[4,eW.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return rg.apply(this,arguments)}L(rv,"inspect");function rE(){return rh.apply(this,arguments)}function rh(){rh=o(function(){var e;return w(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,tN.testUnit()];case 1:return[4,eW.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return rh.apply(this,arguments)}L(rE,"testUnit");function ry(){return rS.apply(this,arguments)}function rS(){rS=o(function(){var e;return w(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,tN.testE2e()];case 1:return[4,eW.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return rS.apply(this,arguments)}L(ry,"testE2E");o(function(){var e;return w(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,t0(tZ(tX.argv)).scriptName(tt).usage("$0 <command> [options]").command("lint","Check code for linting issues",rn).command("lint:fix","Fix linting issues automatically",ro).command("lint:inspect","View active ESLint configuration",rt).command("lint-staged","Run lint checks on staged files",t7).command("commitlint","Validate commit message format",ra).command("setup","Initialize project setup and dependencies",rd).command("reset","Reset the project and reinstall dependencies",rp).command("inspect","Analyze installed project dependencies",rv).command("test:unit","Run unit test suite",rE).command("test:e2e","Run end-to-end test suite",ry).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(t1.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();en.error("Fatal: ".concat(e.message)),tX.exit(1);return[3,3];case 3:return[2]}})})();import rO from"compression";import r_ from"cors";import rA from"express";import rC from"express-device";import rI from"express-session";function rb(e){return r_({origin:L(function(t,r){var n;e.isDev||((n=e.corsWhitelist)===null||n===void 0?void 0:n.includes(t!==null&&t!==void 0?t:""))?r(null,!0):r(null,!1)},"origin"),credentials:!0})}L(rb,"createCors");function rT(e){var t=rA();return t.set("trust proxy",1),t.use(rA.urlencoded({extended:!0})),t.use(rO()),t.use(rC.capture()),e.staticFolder&&t.use(rA.static(e.staticFolder)),e.sessionOptions&&t.use(rI(e.sessionOptions)),t}L(rT,"createExpress");import{format as rR}from"date-fns";import{Document as rN}from"mongoose";import rw from"mongoose-aggregate-paginate-v2";import rx from"mongoose-paginate-v2";import{v4 as rD}from"uuid";import rL from"crypto-js";import rj from"slugify";var rP=rj.default||rj;function rM(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;var r=t||{},n=r.lower,s=n===void 0?!0:n,o=r.locale,i=o===void 0?"vi":o,a=O(r,["lower","locale"]);return rP(e,h({lower:s,locale:i},a))}L(rM,"generateSlug");function rG(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return rL.SHA256(e).toString(rL.enc.Hex).slice(0,t)}L(rG,"generateShortId");var rk={isEmpty:function e(e){return e==null?!0:Array.isArray(e)?e.length===0:(typeof e==="undefined"?"undefined":T(e))=="object"?p(e,Date)?!1:Object.keys(e).length===0:typeof e=="string"?e.trim().length===0:!1}};var rU={getDateTime:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return rR(e,"yyyy-MM-dd HH:mm:ss.SSS")},createGenericFields:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.returnDateAs,r=t===void 0?"string":t;var n=r==="string"?rU.getDateTime():new Date;return{id:rD(),isDel:!1,createdAt:n,updatedAt:n}},applyPlugins:function e(e,t){t.filter(function(e){return typeof e=="function"}).forEach(function(t){return e.plugin(t)})},applyMiddlewares:function e(e,t){t.forEach(function(t){var r=t.method,n=t.pre,s=t.post;r&&n&&e.pre(r,n),r&&s&&e.post(r,s)})},createGenericSchema:function e(e){return new e.Schema({id:{type:String,default:rD,required:!0,unique:!0},isDel:{type:Boolean,default:!1,required:!0}},{timestamps:!0})},createSchema:function e(e){var t=e.mongoose,r=e.schema,n=e.virtuals,s=n===void 0?[]:n,o=e.standalone,i=o===void 0?!1:o;var a=new t.Schema(r,{strict:!0});return s.forEach(function(e){var t=e.name,r=e.options,n=e.get;var s=a.virtual(t,r);n&&s.get(n)}),i||a.add(rU.createGenericSchema(t)),a},createModel:function e(e){var t=e.mongoose,r=e.name,n=e.schema,s=e.pagination,o=s===void 0?!1:s,i=e.aggregate,a=i===void 0?!1:i,c=e.virtuals,u=c===void 0?[]:c,l=e.middlewares,d=l===void 0?[]:l;if(!r)throw new Error("Model name is required.");if(t.models[r])return t.models[r];var f=rU.createSchema({mongoose:t,schema:n,virtuals:u});return rU.applyPlugins(f,[o&&rx,a&&rw]),rU.applyMiddlewares(f,d),t.model(r,f)},createSlugQuery:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;return S(h({},t,r&&{id:{$ne:r}}),{$or:[{slug:e},{slugHistory:e}]})},validator:{isEmpty:function e(){return /*#__PURE__*/function(){var e=o(function(e){return w(this,function(t){return[2,!rk.isEmpty(e)]})});return function(t){return e.apply(this,arguments)}}()},isUnique:function e(e){return /*#__PURE__*/function(){var t=o(function(t){var r;return w(this,function(n){switch(n.label){case 0:if(!Array.isArray(e)||e.length===0)throw new Error("Fields must be a non-empty array of strings.");r={$or:e.map(function(e){return l({},e,t)})};return[4,this.constructor.findOne(r)];case 1:return[2,!n.sent()]}})});return function(e){return t.apply(this,arguments)}}()},matchesRegex:function e(e){return /*#__PURE__*/function(){var t=o(function(t){return w(this,function(r){if(!Array.isArray(e)||e.some(function(e){return!p(e,RegExp)}))throw new Error("regexArray must be an array of valid RegExp objects.");return[2,e.every(function(e){return e.test(t)})]})});return function(e){return t.apply(this,arguments)}}()}}},rF=/*#__PURE__*/function(){"use strict";function e(t,r){a(this,e);j(this,"collection");this.collection=t.collection(r)}u(e,[{key:"createOne",value:function e(e){var t=this;return o(function(){var r,n,s;return w(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);r=h({},rU.createGenericFields(),e);n={success:!0,message:"Document created successfully"};return[4,t.collection.insertOne(r)];case 1:return[2,(n.result=o.sent(),n)];case 2:s=o.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"createMany",value:function e(e){var t=this;return o(function(){var r,n,s;return w(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);r=e.map(function(e){return h({},rU.createGenericFields(),e)});return[4,t.collection.insertMany(r)];case 1:n=o.sent();return[2,n.insertedCount===0?{success:!1,message:"No documents were inserted"}:{success:!0,message:"".concat(n.insertedCount," documents created successfully"),result:n}];case 2:s=o.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"findOne",value:function e(e){var t=this;return o(function(){var r,n;return w(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,t.collection.findOne(e)];case 1:r=s.sent();return[2,r?{success:!0,message:"Document found",result:r}:{success:!1,message:"Document not found"}];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"findAll",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=this;return o(function(){var r,n;return w(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0,message:"Documents retrieved successfully"};return[4,t.collection.find(e).toArray()];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"count",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=this;return o(function(){var r,n;return w(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0,message:"Count retrieved successfully"};return[4,t.collection.countDocuments(e)];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"updateOne",value:function e(e,t){var r=this;return o(function(){var n,s;return w(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,r.collection.updateOne(e,{$set:t})];case 1:n=o.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Document updated successfully",result:n}];case 2:s=o.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"updateMany",value:function e(e,t){var r=this;return o(function(){var n,s;return w(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,r.collection.updateMany(e,{$set:t})];case 1:n=o.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Documents updated successfully",result:n}];case 2:s=o.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"deleteOne",value:function e(e){var t=this;return o(function(){var r,n;return w(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,t.collection.deleteOne(e)];case 1:r=s.sent();return[2,r.deletedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Document deleted successfully",result:r}];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"deleteMany",value:function e(e){var t=this;return o(function(){var r,n;return w(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,t.collection.deleteMany(e)];case 1:r=s.sent();return[2,r.deletedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Documents deleted successfully",result:r}];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}}]);return e}();L(rF,"MongoController");var rq=rF,rK=/*#__PURE__*/function(){"use strict";function e(t){a(this,e);j(this,"model");this.model=t}u(e,[{key:"getModelName",value:function e(){return this.model.modelName}},{key:"findOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;var s=this;return o(function(){var o,i,a;return w(this,function(c){switch(c.label){case 0:c.trys.push([0,2,,3]);o=s.model.findOne(e,t,r);n&&o.populate(n);return[4,o.exec()];case 1:i=c.sent();return[2,i?{success:!0,result:i}:{success:!1,message:"No ".concat(s.getModelName()," found."),code:ee.NOT_FOUND.CODE}];case 2:a=c.sent();return[2,{success:!1,message:a.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findAll",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;var s=this;return o(function(){var o,i,a;return w(this,function(c){switch(c.label){case 0:c.trys.push([0,2,,3]);o=s.model.find(e,t,r);n&&o.populate(n);i={success:!0};return[4,o.exec()];case 1:return[2,(i.result=c.sent(),i)];case 2:a=c.sent();return[2,{success:!1,message:a.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findPaging",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return o(function(){var n,s;return w(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);n={success:!0};return[4,r.model.paginate(e,t)];case 1:return[2,(n.result=o.sent(),n)];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findPagingAggregate",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return o(function(){var n,s;return w(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);n={success:!0};return[4,r.model.aggregatePaginate(r.model.aggregate(e),t)];case 1:return[2,(n.result=o.sent(),n)];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"count",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=this;return o(function(){var r,n;return w(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0};return[4,t.model.countDocuments(e)];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createOne",value:function e(e){var t=this;return o(function(){var r,n;return w(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0};return[4,t.model.create(e)];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createMany",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return o(function(){var n,s;return w(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);n={success:!0};return[4,r.model.insertMany(e,t)];case 1:return[2,(n.result=o.sent().map(function(e){return p(e,rN)?e.toObject():null}).filter(function(e){return e!==null}),n)];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"updateOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=this;return o(function(){var s,o;return w(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);return[4,n.model.findOneAndUpdate(e,t,h({new:!0},r)).exec()];case 1:s=i.sent();return[2,s?{success:!0,result:s}:{success:!1,message:"Failed to update ".concat(n.getModelName(),"."),code:ee.NOT_FOUND.CODE}];case 2:o=i.sent();return[2,{success:!1,message:o.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"updateMany",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=this;return o(function(){var s,o;return w(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);s={success:!0};return[4,n.model.updateMany(e,t,r).exec()];case 1:return[2,(s.result=i.sent(),s)];case 2:o=i.sent();return[2,{success:!1,message:o.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"deleteOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return o(function(){var n,s;return w(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,r.model.findOneAndDelete(e,t).exec()];case 1:n=o.sent();return[2,n?{success:!0,result:n}:{success:!1,message:"No ".concat(r.getModelName()," found to delete."),code:ee.NOT_FOUND.CODE}];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"deleteMany",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return o(function(){var n,s;return w(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,r.model.deleteMany(e,t).exec()];case 1:n=o.sent();return[2,n.deletedCount===0?{success:!1,message:"No documents found to delete.",code:ee.NOT_FOUND.CODE}:{success:!0,result:n}];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createShortId",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;var r=this;return o(function(){var n,s,o,i;return w(this,function(a){switch(a.label){case 0:n=new Set;s=0;a.label=1;case 1:if(!(s<10))return[3,5];o=rG(e,s+t);i=!n.has(o);if(!i)return[3,3];n.add(o);return[4,r.model.exists({shortId:o})];case 2:i=!a.sent();a.label=3;case 3:if(i)return[2,{success:!0,result:o}];a.label=4;case 4:s++;return[3,1];case 5:return[2,{success:!1,message:"Failed to create a unique shortId",code:ee.INTERNAL_SERVER_ERROR.CODE}]}})})()}},{key:"createSlug",value:function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=this;return o(function(){var s,i,a,c,u,l,d,f,p,m,v;return w(this,function(g){switch(g.label){case 0:g.trys.push([0,8,,9]);s=t[e],i=L(/*#__PURE__*/function(){var e=o(function(e){var s,o,i;return w(this,function(a){switch(a.label){case 0:return[4,n.model.findOne(rU.createSlugQuery(e,r,t.id))];case 1:s=a.sent();if(!s)return[2,e];o=1;a.label=2;case 2:i="".concat(e,"-").concat(o);return[4,n.model.findOne(rU.createSlugQuery(i,r,t.id))];case 3:s=a.sent(),o++;a.label=4;case 4:if(s)return[3,2];a.label=5;case 5:return[2,i]}})});return function(t){return e.apply(this,arguments)}}(),"createUniqueSlug");if(!((typeof s==="undefined"?"undefined":T(s))=="object"))return[3,5];a={};c=[];for(u in s)c.push(u);l=0;g.label=1;case 1:if(!(l<c.length))return[3,4];d=c[l];f=rM(s[d]);return[4,i(f)];case 2:a[d]=g.sent();g.label=3;case 3:l++;return[3,1];case 4:return[2,{success:!0,result:a}];case 5:p=rM(s);m={success:!0};return[4,i(p)];case 6:return[2,(m.result=g.sent(),m)];case 7:return[3,9];case 8:v=g.sent();return[2,{success:!1,message:"Failed to create a unique slug: ".concat(v.message),code:ee.INTERNAL_SERVER_ERROR.CODE}];case 9:return[2]}})})()}},{key:"aggregate",value:function e(e){var t=this;return o(function(){var r,n;return w(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0};return[4,t.model.aggregate(e)];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}}]);return e}();L(rK,"MongooseController");var rH=rK;import{Collection as rV,Db as rW}from"mongodb";import{Document as rQ,Model as rY}from"mongoose";var rB=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return i(this,t,arguments)}return t}(rW);L(rB,"C_Db");var rJ=rB,rz=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return i(this,t,arguments)}return t}(rQ);L(rz,"C_Document");var r$=rz,rX=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return i(this,t,arguments)}return t}(rY);L(rX,"C_Model");var rZ=rX,r0=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return i(this,t,arguments)}return t}(rV);L(r0,"C_Collection");var r1=r0;import{useServer as r2}from"graphql-ws/use/ws";import{WebSocketServer as r4}from"ws";function r3(e){return new r4({server:e.server,path:e.path})}L(r3,"createWSServer");function r8(e){return r2({schema:e.schema},e.server)}L(r8,"initGraphQLWS");import{ApolloClient as r5,ApolloError as r6,ApolloLink as r9,ApolloProvider as r7,from as ne,HttpLink as nt,InMemoryCache as nr,split as nn}from"@apollo/client";import{onError as ns}from"@apollo/client/link/error";import{removeTypenameFromVariables as no}from"@apollo/client/link/remove-typename";import{GraphQLWsLink as ni}from"@apollo/client/link/subscriptions";import{getMainDefinition as na}from"@apollo/client/utilities";import{createClient as nc}from"graphql-ws";import nu,{useMemo as nl}from"react";import{FaInfo as nd}from"react-icons/fa6";import nf,{use as np}from"react";import{FaRepeat as nm}from"react-icons/fa6";import{createContext as nv}from"react";var ng=nv(void 0);import nE from"./react/apollo-error/apollo-error.module.scss";function nh(){var e=np(ng),t=e===null||e===void 0?void 0:e.error;if(!t)return null;var r=L(function(e,t){return(t===null||t===void 0?void 0:t.length)?nf.createElement("div",null,nf.createElement("strong",null,e,":"),nf.createElement("ul",null,t.map(function(e){return nf.createElement("li",{key:e.message},e.message)}))):null},"renderErrorList");return nf.createElement("div",{className:nE["modal-backdrop"]},nf.createElement("div",{className:nE["modal-content"]},nf.createElement("button",{type:"button",className:nE["btn-close"],onClick:e.hideError},"✕"),nf.createElement("div",{className:nE["error-title"]},nf.createElement("button",{type:"button",className:nE["btn-retry"],onClick:L(function(){return window.location.reload()},"onClick")},nf.createElement(nm,null))," ",t.message),nf.createElement("div",{className:nE["error-details"]},t.networkError&&nf.createElement("pre",{className:"network"},nf.createElement("strong",null,"Network Error:")," ",t.networkError.message),r("GraphQL Errors",b(t.graphQLErrors)),r("Protocol Errors",b(t.protocolErrors)),r("Client Errors",b(t.clientErrors)),t.extraInfo&&nf.createElement("pre",{className:"extra"},nf.createElement("strong",null,"Extra Info:")," ",JSON.stringify(t.extraInfo,null,4)))))}L(nh,"ApolloError");import{use as ny}from"react";function nS(){var e=ny(ng);if(!e)throw new Error("useApolloError must be used within ApolloErrorProvider");return e}L(nS,"useApolloError");import nO,{useEffect as n_,useMemo as nA,useState as nC}from"react";var nI=null;function nb(e){nI=e}L(nb,"setGlobalApolloErrorCallback");function nT(e){nI===null||nI===void 0?void 0:nI(e)}L(nT,"showGlobalApolloError");function nR(e){var t=e.children;var r=I(nC(null),2),n=r[0],s=r[1];n_(function(){nb(s)},[]);var o=nA(function(){return{error:n,showError:s,hideError:L(function(){return s(null)},"hideError")}},[n]);return nO.createElement(ng,{value:o},t)}L(nR,"ApolloErrorProvider");import{consola as nN}from"consola/browser";var nw={silent:nN.silent,level:nN.level,fatal:nN.fatal,error:nN.error,warn:nN.warn,log:nN.log,info:nN.info,success:nN.success,ready:nN.ready,start:nN.start,box:nN.box,debug:nN.debug,trace:nN.trace,verbose:nN.verbose};import{toast as nx,Toaster as nD}from"react-hot-toast";var nL="/graphql";var nj,nP=(nj=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);var e;e=i(this,t,arguments);j(e,"count",0);return e}u(t,[{key:"request",value:function e(e,t){var r=this;var n=Date.now();return this.count+=1,t(e).map(function(t){var s=Date.now()-n,o=e.operationName||"Unnamed";return nw.info("[Apollo] #".concat(r.count,": ").concat(o," (").concat(s,"ms)")),t})}}]);return t}(r9),L(nj,"DevLoggerLink"),nj);function nM(e){var t=e.uri,r=e.wsUrl,n=e.customLinks,s=new nP,o=ns(function(e){var t=e.graphQLErrors,r=e.networkError,n=e.protocolErrors,s=e.operation;var o=(s===null||s===void 0?void 0:s.operationName)||"Unknown";if(t&&t.forEach(function(e){var t=e.message,r=e.locations,n=e.path;nw.error("[GraphQL error] ".concat(o,": ").concat(t,", Location: ").concat(JSON.stringify(r),", Path: ").concat(n))}),n&&n.forEach(function(e){var t=e.message,r=e.extensions;nw.error("[Protocol error]: ".concat(t,", Extensions: ").concat(JSON.stringify(r)))}),r&&nw.error("[Network error]: ".concat(r)),t||n||r){var i,a;var c=(t===null||t===void 0?void 0:(i=t[0])===null||i===void 0?void 0:i.message)||(n===null||n===void 0?void 0:(a=n[0])===null||a===void 0?void 0:a.message)||(r===null||r===void 0?void 0:r.message)||"Unexpected error",u=new r6({graphQLErrors:t||[],protocolErrors:n||[],clientErrors:[],networkError:r||null,errorMessage:c,extraInfo:{operation:s}});nx.error(function(e){return nu.createElement(nu.Fragment,null,c,"\xa0",nu.createElement(nd,{cursor:"pointer",onClick:L(function(){setTimeout(function(){nT(u)},0),nx.dismiss(e.id)},"onClick")}))})}}),i=no();t||nw.warn('[Apollo] No GraphQL URI provided — using "'.concat(nL,'" as default'));var a=new nt({uri:t!==null&&t!==void 0?t:nL,credentials:"include"}),c=r?new ni(nc({url:r})):r9.empty(),u=p(c,r9)?nn(function(e){var t=e.query;var r=na(t);return r.kind==="OperationDefinition"&&r.operation==="subscription"},c,a):a;return u===a&&r&&nw.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[s,o,i].concat(b(n!==null&&n!==void 0?n:[]),[u])}L(nM,"createApolloLinks");function nG(e){var t=e.isNextJS,r=e.options,n=e.children,s=e.client,o=e.provider,i=e.cache;var a=r||{},c=a.uri,u=a.wsUrl,l=a.customLinks,d=O(a,["uri","wsUrl","customLinks"]),f=s!==null&&s!==void 0?s:r5;if(typeof f!="function")throw new TypeError("Invalid ApolloClient provided. Ensure CustomClient is a class.");var m=o||r7,v=nl(function(){return ne(nM({uri:c!==null&&c!==void 0?c:nL,wsUrl:u!==null&&u!==void 0?u:"",customLinks:l!==null&&l!==void 0?l:[]}))},[c,u,l]),g=nl(function(){return p(i,nr)?i:new nr},[i]),E=nl(function(){return new f(h({link:v,cache:g},d))},[f,v,g,d]),y=t?nu.createElement(m,{makeClient:L(function(){return E},"makeClient")},n):nu.createElement(m,{client:E},n);return nu.createElement(nu.Fragment,null,nu.createElement(nR,null,y,nu.createElement(nh,null)),nu.createElement(nD,{position:"top-right"}))}L(nG,"ApolloProvider");import{useTranslation as nk}from"react-i18next";var nU=nk;import nF from"i18next";import{initReactI18next as nq}from"react-i18next";function nK(e){return nF.use(nq).init(e)}L(nK,"initI18next");import nH from"classnames";import nV from"react";import nW from"./react/loading/loading.module.scss";function nQ(e){var t=e.full,r=t===void 0?!1:t,n=e.block,s=n===void 0?!1:n,o=e.className,i=o===void 0?"":o,a=e.message,c=a===void 0?"Loading":a,u=O(e,["full","block","className","message"]);function l(){return nV.createElement("div",h({className:nW.container},u),nV.createElement("div",{className:nW.ring}),nV.createElement("div",{className:nW.ring}),nV.createElement("div",{className:nW.ring}),nV.createElement("div",{className:nW.ring}),c&&nV.createElement("div",{className:nW.message},c))}return L(l,"_renderLoading"),r?nV.createElement("div",{className:nH(nW.fullscreen,i)},l()):s?nV.createElement("div",{className:nH(nW.block,i)},l()):l()}L(nQ,"Loading");import{createContext as nY}from"react";var nB=nY(void 0);import{use as nJ}from"react";function nz(){var e=nJ(nB);if(!e)throw new Error("useLoading must be used within a LoadingProvider");return e}L(nz,"useLoading");import n$,{useCallback as nX,useMemo as nZ,useState as n0}from"react";function n1(e){var t=e.children;var r=I(n0(!1),2),n=r[0],s=r[1],o=I(n0(!1),2),i=o[0],a=o[1],c=nX(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;s(!0),a(e)},[]),u=nX(function(){s(!1),a(!1)},[]),l=nZ(function(){return{isLoading:n,isGlobalLoading:i,showLoading:c,hideLoading:u}},[n,i,c,u]);return n$.createElement(nB,{value:l},n?n$.createElement(nQ,{full:i}):t)}L(n1,"LoadingProvider");import{enUS as n2}from"date-fns/locale";var n4={label:"English",value:"en",flag:"\uD83C\uDDFA\uD83C\uDDF8",adapterLocale:n2,icon:"flagpack:gb-nir",numberFormat:{code:"en-US",currency:"USD"},timezone:"America/New_York"};import{createContext as n3}from"react";var n8=n3(void 0);import{NextIntlClientProvider as n5}from"next-intl";import n6 from"react";import{useTranslations as n9}from"next-intl";import{use as n7}from"react";function se(){var e=n7(n8);if(!e)throw new Error("useNextIntl must be used within a NextIntlProvider");return e}L(se,"useNextIntl");var st=n9;function sr(e){var t=L(function(t){var r;var n;var s=se(),o=s.currentLanguage,i=t.messages,a=t.languages,c="en",u=i[(o===null||o===void 0?void 0:o.value)||c],l=(n=(r=a.find(function(e){return e.value===(o===null||o===void 0?void 0:o.value)}))===null||r===void 0?void 0:r.timezone)!==null&&n!==void 0?n:n4.timezone;return i?n6.createElement(n5,{locale:(o===null||o===void 0?void 0:o.value)||c,messages:u||null,timeZone:l},n6.createElement(e,t)):(nw.warn("Missing messages for language: ".concat((o===null||o===void 0?void 0:o.value)||c)),null)},"PageWithI18n");return t.displayName="withNextIntl(".concat(e.displayName||e.name||"Component",")"),t}L(sr,"withNextIntl");import sn,{useMemo as ss}from"react";import{useCallback as so,useEffect as si,useState as sa}from"react";var sc={serialize:L(function(e){return JSON.stringify(e,function(e,t){return p(t,Date)?{__type:"Date",value:t.toISOString()}:t})},"serialize"),deserialize:L(function(e){return JSON.parse(e,function(e,t){return(t===null||t===void 0?void 0:t.__type)==="Date"?new Date(t.value):t})},"deserialize")};import su from"localforage";var sl={get:function e(e){return o(function(){var t;return w(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,su.getItem(e)];case 1:return[2,r.sent()];case 2:t=r.sent();return[2,(nw.error('[Storage:get] Error getting key "'.concat(e,'":'),t),null)];case 3:return[2]}})})()},set:function e(e,t){return o(function(){var r;return w(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,su.setItem(e,t)];case 1:n.sent();return[3,3];case 2:r=n.sent();nw.error('[Storage:set] Error setting key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})})()},remove:function e(e){return o(function(){var t;return w(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,su.removeItem(e)];case 1:r.sent();return[3,3];case 2:t=r.sent();nw.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,3];case 3:return[2]}})})()},keys:function e(){return o(function(){var e,t;return w(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,su.keys()];case 1:return[2,(e=r.sent())!==null&&e!==void 0?e:[]];case 2:t=r.sent();return[2,(nw.error("[Storage:keys] Error getting keys:",t),[])];case 3:return[2]}})})()}};function sd(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:sc;var n=I(sa(t),2),s=n[0],i=n[1],a=I(sa(!1),2),c=a[0],u=a[1];si(function(){var n=!0;return L(/*#__PURE__*/o(function(){var s,o,a,c;return w(this,function(l){switch(l.label){case 0:l.trys.push([0,6,7,8]);return[4,sl.get(e)];case 1:s=l.sent();if(!n)return[3,5];if(!(s!==null))return[3,2];o=r.deserialize(s);i(o);return[3,5];case 2:if(!(t!==void 0))return[3,4];a=r.serialize(t);return[4,sl.set(e,a)];case 3:l.sent(),i(t);return[3,5];case 4:i(void 0);l.label=5;case 5:return[3,8];case 6:c=l.sent();nw.error('Error loading value for key "'.concat(e,'":'),c),n&&i(t);return[3,8];case 7:n&&u(!0);return[7];case 8:return[2]}})}),"loadValue")(),function(){n=!1,u(!1)}},[e,t,r]),si(function(){if(!c)return;L(/*#__PURE__*/o(function(){var t,n;return w(this,function(o){switch(o.label){case 0:o.trys.push([0,3,,4]);if(!(s!==void 0))return[3,2];t=r.serialize(s);return[4,sl.set(e,t)];case 1:o.sent();o.label=2;case 2:return[3,4];case 3:n=o.sent();nw.error('Error saving value for key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})}),"saveValue")()},[s,e,r,c]);var l=so(function(e){i(function(t){return typeof e=="function"?e(t):e})},[]),d=so(/*#__PURE__*/o(function(){var t;return w(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,sl.remove(e)];case 1:r.sent(),i(void 0);return[3,3];case 2:t=r.sent();nw.error('Error removing key "'.concat(e,'":'),t);return[3,3];case 3:return[2]}})}),[e]);return{value:s,set:l,remove:d}}L(sd,"useStorage");function sf(e){var t=e.children;return sn.createElement(sn.Fragment,null,t)}L(sf,"LanguageWrapperBase");var sp=sr(sf);function sm(e){var t=e.children,r=e.languages,n=e.messages;var s=sd("lang",r[0]),o=s.value,i=s.set,a=ss(function(){return{languages:r,currentLanguage:o!==null&&o!==void 0?o:n4,setCurrentLanguage:i}},[r,i,o]);return sn.createElement(n8,{value:a},sn.createElement(sp,{languages:r,messages:n},t))}L(sm,"NextIntlProvider");import sv from"unorm";var sg={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},sE=Object.entries(sg).reduce(function(e,t){var r=I(t,2),n=r[0],s=r[1];return e[n.toUpperCase()]=s.map(function(e){return e.toUpperCase()}),e},{});function sh(e){e=sv.nfkc(e);var t=h({},sg,sE);var r=true,n=false,s=undefined;try{for(var o=Object.entries(t)[Symbol.iterator](),i;!(r=(i=o.next()).done);r=true){var a=I(i.value,2),c=a[0],u=a[1];var l="[".concat(c).concat(u.join(""),"]"),d="(".concat([c].concat(b(u)).join("|"),")");e=e.replace(new RegExp(l,"g"),d)}}catch(e){n=true;s=e}finally{try{if(!r&&o.return!=null){o.return()}}finally{if(n){throw s}}}return e}L(sh,"regexSearchMapper");function sy(e){return e.normalize("NFD").replace(RegExp("\\p{Diacritic}","gu"),"")}L(sy,"removeAccent");export{nh as ApolloError,ng as ApolloErrorContext,nR as ApolloErrorProvider,nG as ApolloProvider,e1 as BUILD_DIRECTORY,es as CHECK_PACKAGE_EMPTY_RESULT,tu as COMMIT_LINT_CLI,tc as COMMIT_LINT_PACKAGE_NAME,tt as CYBERSKILL_CLI,tr as CYBERSKILL_CLI_PATH,te as CYBERSKILL_DIRECTORY,eX as CYBERSKILL_PACKAGE_NAME,eZ as CYBERSKILL_STORAGE,r1 as C_Collection,rJ as C_Db,r$ as C_Document,rZ as C_Model,J as DEBUG,ts as ESLINT_CLI,tO as ESLINT_INSPECT_CLI,tS as ESLINT_INSPECT_PACKAGE_NAME,tn as ESLINT_PACKAGE_NAME,V as E_CommandType,M as E_ConfigType,z as E_IssueType,tv as GIT_CLI,e7 as GIT_COMMIT_EDITMSG,e9 as GIT_HOOK,e8 as GIT_IGNORE,nL as GRAPHQL_URI_DEFAULT,tI as HOOK,tQ as IS_BROWSER,td as LINT_STAGED_CLI,tl as LINT_STAGED_PACKAGE_NAME,nQ as Loading,nB as LoadingContext,n1 as LoadingProvider,rq as MongoController,rH as MongooseController,n4 as NEXT_INTL_DEFAULT_LANGUAGE,e0 as NODE_MODULES,tA as NODE_MODULES_INSPECT_CLI,t_ as NODE_MODULES_INSPECT_PACKAGE_NAME,n8 as NextIntlContext,sm as NextIntlProvider,e2 as PACKAGE_JSON,e4 as PACKAGE_LOCK_JSON,tC as PATH,ti as PLAYWRIGHT_PACKAGE_NAME,tg as PNPM_CLI,tE as PNPM_EXEC_CLI,e6 as PNPM_LOCK_YAML,ee as RESPONSE_STATUS,th as SIMPLE_GIT_HOOKS_PACKAGE_NAME,ty as SIMPLE_GIT_HOOK_CLI,e5 as SIMPLE_GIT_HOOK_JSON,e3 as TSCONFIG_JSON,tp as TSC_CLI,tf as TSC_PACKAGE_NAME,tm as TSX_CLI,nD as Toaster,ta as VITEST_CLI,to as VITEST_PACKAGE_NAME,e$ as WORKING_DIRECTORY,rw as aggregatePaginate,el as appendFileSync,ev as checkPackage,ej as clearAllErrorLists,tN as command,P as commitlintConfig,t$ as createApolloServer,rb as createCors,rT as createExpress,tV as createGraphqlCodegenConfig,r3 as createWSServer,tL as deepMerge,tP as eslintConfig,ea as existsSync,eK as formatCommand,rG as generateShortId,rM as generateSlug,ep as getLatestPackageVersion,ef as getPackage,eD as getStoredErrorLists,r8 as initGraphQLWS,nK as initI18next,eE as installDependencies,tx as isJson,tD as isPlainObject,ez as join,tW as lintStagedConfig,nw as log,en as logNodeJS,tK as mergeConfigs,rU as mongo,rx as mongoosePaginate,eF as rawCommand,ec as readFileSync,sh as regexSearchMapper,sy as removeAccent,eJ as resolve,eH as resolveCommands,eB as resolveWorkingPath,ed as rmSync,eW as runCommand,sc as serializer,nb as setGlobalApolloErrorCallback,ey as setupPackages,nT as showGlobalApolloError,sl as storage,eT as storageNodeJS,et as throwError,nx as toast,nS as useApolloError,nz as useLoading,se as useNextIntl,sd as useStorage,nU as useTranslateI18next,st as useTranslateNextIntl,rk as validate,F as vitestE2E,tw as vitestUnit,sr as withNextIntl,eu as writeFileSync};
|
|
1
|
+
function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function s(e,t,r,n,s,o,i){try{var a=e[o](i);var c=a.value}catch(e){r(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(n,s)}}function o(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){s(i,n,o,a,c,"next",e)}function c(e){s(i,n,o,a,c,"throw",e)}a(undefined)})}}function i(e,t,r){t=d(t);return A(e,w()?Reflect.construct(t,r||[],d(e).constructor):t.apply(e,r))}function a(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}function u(e,t,r){if(t)c(e.prototype,t);if(r)c(e,r);return e}function l(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function d(e){d=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return d(e)}function f(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)C(e,t)}function p(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function m(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function v(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var s=true;var o=false;var i,a;try{for(r=r.call(e);!(s=(i=r.next()).done);s=true){n.push(i.value);if(t&&n.length===t)break}}catch(e){o=true;a=e}finally{try{if(!s&&r["return"]!=null)r["return"]()}finally{if(o)throw a}}return n}function g(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function E(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){l(e,t,r[t])})}return e}function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,n)}return r}function S(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{y(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function O(e,t){if(e==null)return{};var r=_(e,t);var n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++){n=o[s];if(t.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;r[n]=e[n]}}return r}function _(e,t){if(e==null)return{};var r={};var n=Object.keys(e);var s,o;for(o=0;o<n.length;o++){s=n[o];if(t.indexOf(s)>=0)continue;r[s]=e[s]}return r}function A(e,t){if(t&&(T(t)==="object"||typeof t==="function")){return t}return n(e)}function C(e,t){C=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return C(e,t)}function I(e,r){return t(e)||v(e,r)||R(e,r)||g()}function b(e){return r(e)||m(e)||R(e)||E()}function T(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function R(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,r)}function w(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(w=function(){return!!e})()}function N(e,t){var r,n,s,o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=a(0),i["throw"]=a(1),i["return"]=a(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(t){return c([e,t])}}function c(a){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,a[0]&&(o=0)),o)try{if(r=1,n&&(s=a[0]&2?n["return"]:a[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;if(n=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;n=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(a[0]===6&&o.label<s[1]){o.label=s[1];s=a;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(a);break}if(s[2])o.ops.pop();o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e];n=0}finally{r=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var x=Object.defineProperty;var D=function(e,t,r){return t in e?x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r};var L=function(e,t){return x(e,"name",{value:t,configurable:!0})};var j=function(e,t,r){return D(e,(typeof t==="undefined"?"undefined":T(t))!="symbol"?t+"":t,r)};var P={extends:["@commitlint/config-conventional"]};var M=function(e){return e.ESLINT="eslint",e.COMMITLINT="commitlint",e.LINT_STAGED="lint-staged",e.VITEST_REACT_E2E="vitest-react-e2e",e.VITEST_REACT_UNIT="vitest-react-unit",e}({});import G from"@antfu/eslint-config";import k from"@vitejs/plugin-react-swc";import{defineConfig as U}from"vitest/config";function F(e){return U(h({plugins:[k()],test:{include:["**/*.test.e2e.?(c|m)[jt]s?(x)"],browser:{enabled:!0,provider:"playwright",instances:[{browser:"chromium"},{browser:"firefox"},{browser:"webkit"}]}}},e))}L(F,"vitestE2E");import q from"@vitejs/plugin-react-swc";import{defineConfig as H}from"vitest/config";import K from"node:process";var V=function(e){return e.CLI="CLI",e.RAW="RAW",e}({});import{exec as W}from"node:child_process";import Q from"node:process";import*as B from"node:util";import Y from"node:process";var J=Y.env.DEBUG==="true";var z=function(e){return e.Error="error",e.Warning="warning",e}({});import $ from"chalk";import X from"consola";import{GraphQLError as Z}from"graphql";var ee={GRAPHQL_PARSE_FAILED:{CODE:"GRAPHQL_PARSE_FAILED",MESSAGE:"The GraphQL operation string contains a syntax error."},GRAPHQL_VALIDATION_FAILED:{CODE:"GRAPHQL_VALIDATION_FAILED",MESSAGE:"The GraphQL operation is not valid against the server's schema."},BAD_USER_INPUT:{CODE:"BAD_USER_INPUT",MESSAGE:"The GraphQL operation includes an invalid value for a field argument."},PERSISTED_QUERY_NOT_FOUND:{CODE:"PERSISTED_QUERY_NOT_FOUND",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the query was not in the APQ cache."},PERSISTED_QUERY_NOT_SUPPORTED:{CODE:"PERSISTED_QUERY_NOT_SUPPORTED",MESSAGE:"A client sent the hash of a query string to execute via automatic persisted queries, but the server has disabled APQ."},OPERATION_RESOLUTION_FAILURE:{CODE:"OPERATION_RESOLUTION_FAILURE",MESSAGE:"The request was parsed successfully and is valid against the server's schema, but the server couldn't resolve which operation to run. This occurs when a request containing multiple named operations doesn't specify which operation to run (i.e.,operationName), or if the named operation isn't included in the request."},CONTINUE:{CODE:100,MESSAGE:"Continue"},SWITCHING_PROTOCOLS:{CODE:101,MESSAGE:"Switching Protocols"},PROCESSING:{CODE:102,MESSAGE:"Processing"},OK:{CODE:200,MESSAGE:"OK"},CREATED:{CODE:201,MESSAGE:"Created"},ACCEPTED:{CODE:202,MESSAGE:"Accepted"},NON_AUTHORITATIVE_INFORMATION:{CODE:203,MESSAGE:"Non Authoritative Information"},NO_CONTENT:{CODE:204,MESSAGE:"No Content"},RESET_CONTENT:{CODE:205,MESSAGE:"Reset Content"},PARTIAL_CONTENT:{CODE:206,MESSAGE:"Partial Content"},MULTI_STATUS:{CODE:207,MESSAGE:"Multi-Status"},MULTIPLE_CHOICES:{CODE:300,MESSAGE:"Multiple Choices"},MOVED_PERMANENTLY:{CODE:301,MESSAGE:"Moved Permanently"},MOVED_TEMPORARILY:{CODE:302,MESSAGE:"Moved Temporarily"},SEE_OTHER:{CODE:303,MESSAGE:"See Other"},NOT_MODIFIED:{CODE:304,MESSAGE:"Not Modified"},USE_PROXY:{CODE:305,MESSAGE:"Use Proxy"},TEMPORARY_REDIRECT:{CODE:307,MESSAGE:"Temporary Redirect"},PERMANENT_REDIRECT:{CODE:308,MESSAGE:"Permanent Redirect"},BAD_REQUEST:{CODE:400,MESSAGE:"Bad Request"},UNAUTHORIZED:{CODE:401,MESSAGE:"Unauthorized"},PAYMENT_REQUIRED:{CODE:402,MESSAGE:"Payment Required"},FORBIDDEN:{CODE:403,MESSAGE:"Forbidden"},NOT_FOUND:{CODE:404,MESSAGE:"Not Found"},METHOD_NOT_ALLOWED:{CODE:405,MESSAGE:"Method Not Allowed"},NOT_ACCEPTABLE:{CODE:406,MESSAGE:"Not Acceptable"},PROXY_AUTHENTICATION_REQUIRED:{CODE:407,MESSAGE:"Proxy Authentication Required"},REQUEST_TIMEOUT:{CODE:408,MESSAGE:"Request Timeout"},CONFLICT:{CODE:409,MESSAGE:"Conflict"},GONE:{CODE:410,MESSAGE:"Gone"},LENGTH_REQUIRED:{CODE:411,MESSAGE:"Length Required"},PRECONDITION_FAILED:{CODE:412,MESSAGE:"Precondition Failed"},REQUEST_TOO_LONG:{CODE:413,MESSAGE:"Request Entity Too Large"},REQUEST_URI_TOO_LONG:{CODE:414,MESSAGE:"Request-URI Too Long"},UNSUPPORTED_MEDIA_TYPE:{CODE:415,MESSAGE:"Unsupported Media Type"},REQUESTED_RANGE_NOT_SATISFIABLE:{CODE:416,MESSAGE:"Requested Range Not Satisfiable"},EXPECTATION_FAILED:{CODE:417,MESSAGE:"Expectation Failed"},IM_A_TEAPOT:{CODE:418,MESSAGE:"I'm a teapot"},INSUFFICIENT_SPACE_ON_RESOURCE:{CODE:419,MESSAGE:"Insufficient Space on Resource"},METHOD_FAILURE:{CODE:420,MESSAGE:"Method Failure"},MISDIRECTED_REQUEST:{CODE:421,MESSAGE:"Misdirected Request"},UNPROCESSABLE_ENTITY:{CODE:422,MESSAGE:"Unprocessable Entity"},LOCKED:{CODE:423,MESSAGE:"Locked"},FAILED_DEPENDENCY:{CODE:424,MESSAGE:"Failed Dependency"},PRECONDITION_REQUIRED:{CODE:428,MESSAGE:"Precondition Required"},TOO_MANY_REQUESTS:{CODE:429,MESSAGE:"Too Many Requests"},REQUEST_HEADER_FIELDS_TOO_LARGE:{CODE:431,MESSAGE:"Request Header Fields Too Large"},UNAVAILABLE_FOR_LEGAL_REASONS:{CODE:451,MESSAGE:"Unavailable For Legal Reasons"},INTERNAL_SERVER_ERROR:{CODE:500,MESSAGE:"Internal Server Error"},NOT_IMPLEMENTED:{CODE:501,MESSAGE:"Not Implemented"},BAD_GATEWAY:{CODE:502,MESSAGE:"Bad Gateway"},SERVICE_UNAVAILABLE:{CODE:503,MESSAGE:"Service Unavailable"},GATEWAY_TIMEOUT:{CODE:504,MESSAGE:"Gateway Timeout"},HTTP_VERSION_NOT_SUPPORTED:{CODE:505,MESSAGE:"HTTP Version Not Supported"},INSUFFICIENT_STORAGE:{CODE:507,MESSAGE:"Insufficient Storage"},NETWORK_AUTHENTICATION_REQUIRED:{CODE:511,MESSAGE:"Network Authentication Required"}};function et(e){var t=e.message,r=e.status,n=r===void 0?ee.INTERNAL_SERVER_ERROR:r,s=e.type,o=s===void 0?"graphql":s;var i;var a=(i=t!==null&&t!==void 0?t:n.MESSAGE)!==null&&i!==void 0?i:"Internal server error";throw o==="graphql"?new Z(a,{extensions:{code:n.CODE}}):new Error(a)}L(et,"throwError");J||(X.level=4);function er(e){var t=$[e];return typeof t=="function"?t:$.green}L(er,"chalkKeyword");var en={silent:X.silent,level:X.level,fatal:X.fatal,error:X.error,warn:X.warn,log:X.log,info:X.info,success:X.success,ready:X.ready,start:X.start,box:X.box,debug:X.debug,trace:X.trace,verbose:X.verbose,printBoxedLog:function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){X.box($.green(e));return}t.forEach(function(e){var t=e.file,n=e.position,s=e.rule,o=e.message;X.log("".concat($.gray("File:")," ").concat($.blue("".concat(t).concat(n?":".concat(n):"")))),s&&X.log(" ".concat(er(r)("Rule:")," ").concat(s)),X.log(" ".concat(er(r)("Message:")," ").concat(o))}),X.box(er(r)("".concat(e," : ").concat(t.length))),X.log($.gray("─".repeat(40)))}};var es={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import eo from"node-fetch";import*as ei from"node:fs";function ea(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.every(function(e){return ei.existsSync(e)})}L(ea,"existsSync");function ec(e,t){var r=ei.readFileSync(e,"utf-8");if(t===null||t===void 0?void 0:t.asJson)try{var n=JSON.parse(r);if((typeof n==="undefined"?"undefined":T(n))=="object"&&n!==null)return n;throw new Error("Parsed JSON is not an object or array")}catch(t){throw new Error("Failed to parse JSON from file: ".concat(e))}return r}L(ec,"readFileSync");function eu(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=r.isJson,s=n===void 0?!1:n,o=s&&(typeof t==="undefined"?"undefined":T(t))=="object"?JSON.stringify(t,null,4):String(t);ei.writeFileSync(e,o,"utf-8")}L(eu,"writeFileSync");function el(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=r.isJson,s=n===void 0?!1:n,o=s&&(typeof t==="undefined"?"undefined":T(t))=="object"?JSON.stringify(t,null,4):String(t);ei.appendFileSync(e,o,"utf-8")}L(el,"appendFileSync");function ed(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}t.forEach(function(e){ea(e)&&ei.rmSync(e,{recursive:!0,force:!0})})}L(ed,"rmSync");function ef(e){var t=ez(e$,e2);if(!ea(t))return!1;try{var r=ec(t,{asJson:!0}),n=r.name,s=r.dependencies,o=s===void 0?{}:s,i=r.devDependencies,a=i===void 0?{}:i,c=n===e,u=e in o,l=e in a;return c||u||l?{path:t,file:r,isCurrentProject:c,isDepend:u,isDevDepend:l}:!1}catch(e){return en.warn("Failed to read package.json: ".concat(e.message)),!1}}L(ef,"getPackage");function ep(e){return em.apply(this,arguments)}function em(){em=o(function(e){var t,r,n,s;return N(this,function(o){switch(o.label){case 0:o.trys.push([0,3,,4]);return[4,eo("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=o.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:r=o.sent(),n=r.version;return[2,n];case 3:s=o.sent();throw en.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})});return em.apply(this,arguments)}L(ep,"getLatestPackageVersion");function ev(e,t){return eg.apply(this,arguments)}function eg(){eg=o(function(e,t){var r,n,s,o,i,a,c,u,l,d,f,p,m,v,g,E,y,S,O,_,A;return N(this,function(C){switch(C.label){case 0:C.trys.push([0,4,,5]);r=ef(e);if(!r)return[2,h({},es)];c=r.path,u=r.file,l=r.isCurrentProject,d=r.isDepend,f=r.isDevDepend,p=(n=u.dependencies)!==null&&n!==void 0?n:{},m=(s=u.devDependencies)!==null&&s!==void 0?s:{},v=l?(o=u.version)!==null&&o!==void 0?o:"0.0.0":d?(i=p[e])!==null&&i!==void 0?i:"0.0.0":f?(a=m[e])!==null&&a!==void 0?a:"0.0.0":"0.0.0";if(!l)return[3,1];y=v;return[3,3];case 1:return[4,ep(e)];case 2:y=C.sent();C.label=3;case 3:g=y,E=l||v===g;if(!E&&(t===null||t===void 0?void 0:t.update)){;O=d?"dependencies":f?"devDependencies":null;O&&((S=u[O])===null||S===void 0?void 0:S[e])!==g&&(u[O]=(_=u[O])!==null&&_!==void 0?_:{},u[O][e]=g,eu(c,u,{isJson:!0}),en.info('Updated "'.concat(e,'" to version ').concat(g)))}return[2,{isCurrentProject:l,installedPath:c,file:u,isUpToDate:E}];case 4:A=C.sent();return[2,(en.error('Error checking package "'.concat(e,'": ').concat(A.message)),h({},es))];case 5:return[2]}})});return eg.apply(this,arguments)}L(ev,"checkPackage");function eE(){return eh.apply(this,arguments)}function eh(){eh=o(function(){var e,t,r,n,s,o,i,a,c,u,l,d;return N(this,function(f){switch(f.label){case 0:e=[{command:L(function(){return tw.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:L(function(){return tw.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:L(function(){return tw.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,r=false,n=undefined;f.label=1;case 1:f.trys.push([1,9,10,11]);s=e[Symbol.iterator]();f.label=2;case 2:if(!!(t=(o=s.next()).done))return[3,8];i=o.value,a=i.command,c=i.message;f.label=3;case 3:f.trys.push([3,6,,7]);return[4,a()];case 4:u=f.sent();return[4,eW("".concat(c," using: ").concat(u),u)];case 5:f.sent();return[2];case 6:l=f.sent();en.warn("Installation attempt failed: ".concat(c)),en.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=f.sent();r=true;n=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(r){throw n}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return eh.apply(this,arguments)}L(eE,"installDependencies");function ey(e,t){return eS.apply(this,arguments)}function eS(){eS=o(function(e,t){var r,n,s,o,i,a,c,u,l,d,f;return N(this,function(p){switch(p.label){case 0:if(!ea(tC.PACKAGE_JSON)){en.error("package.json not found. Aborting setup.");return[2]}p.label=1;case 1:p.trys.push([1,13,,14]);r=b(new Set(e)).sort();return[4,Promise.all(r.map(function(e){return ev(e,h({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:n=p.sent().every(function(e){return e.isUpToDate});if(n)return[3,4];return[4,eE()];case 3:n=p.sent();p.label=4;case 4:n;o=true,i=false,a=undefined;p.label=5;case 5:p.trys.push([5,10,11,12]);c=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();p.label=6;case 6:if(!!(o=(u=c.next()).done))return[3,9];l=u.value;return[4,l()];case 7:p.sent();p.label=8;case 8:o=true;return[3,6];case 9:return[3,12];case 10:d=p.sent();i=true;a=d;return[3,12];case 11:try{if(!o&&c.return!=null){c.return()}}finally{if(i){throw a}}return[7];case 12:return[3,14];case 13:f=p.sent();throw en.error('Failed to setup "'.concat(e.join(", "),'": ').concat(f.message)),f;case 14:return[2]}})});return eS.apply(this,arguments)}L(ey,"setupPackages");import eO from"node-persist";import e_ from"node:os";import eA from"node:process";function eC(){return eA.env.CYBERSKILL_STORAGE_DIR||ez(e_.homedir(),eZ)}L(eC,"getStorageDir");function eI(){return eb.apply(this,arguments)}function eb(){eb=o(function(){var e;return N(this,function(t){switch(t.label){case 0:e=eO.defaultInstance;if(e)return[3,2];return[4,eO.init({dir:eC(),stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})});return eb.apply(this,arguments)}L(eI,"initNodePersist");var eT={get:function e(e){return o(function(){var t,r;return N(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eI()];case 1:n.sent();return[4,eO.getItem(e)];case 2:return[2,(t=n.sent())!==null&&t!==void 0?t:null];case 3:r=n.sent();return[2,(en.error('[Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 4:return[2]}})})()},set:function e(e,t){return o(function(){var r;return N(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eI()];case 1:n.sent();return[4,eO.setItem(e,t)];case 2:n.sent();return[3,4];case 3:r=n.sent();en.error('[Storage:set] Error setting key "'.concat(e,'":'),r);return[3,4];case 4:return[2]}})})()},remove:function e(e){return o(function(){var t;return N(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eI()];case 1:r.sent();return[4,eO.removeItem(e)];case 2:r.sent();return[3,4];case 3:t=r.sent();en.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return o(function(){var e,t;return N(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eI()];case 1:r.sent();return[4,eO.keys()];case 2:e=r.sent();return[2,Array.isArray(e)?e:(en.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=r.sent();return[2,(en.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return o(function(){return N(this,function(t){try{return[2,"".concat(eC()," (key: ").concat(e,")")]}catch(e){return[2,(en.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var eR=B.promisify(W);function ew(e){return"error_list:".concat(e)}L(ew,"getErrorListKey");function eN(e){return ex.apply(this,arguments)}function ex(){ex=o(function(e){var t,r,n;return N(this,function(s){switch(s.label){case 0:if(e.length===0)return[2];t=Date.now(),r=ew(t);s.label=1;case 1:s.trys.push([1,3,,4]);return[4,eT.set(r,{errors:e,timestamp:t})];case 2:s.sent(),setTimeout(/*#__PURE__*/o(function(){var e;return N(this,function(t){switch(t.label){case 0:return[4,eT.getLogLink(r)];case 1:e=t.sent();e&&en.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:n=s.sent();en.error("Failed to save errors: ".concat(n.message));return[3,4];case 4:return[2]}})});return ex.apply(this,arguments)}L(eN,"saveErrorListToStorage");function eD(){return eL.apply(this,arguments)}function eL(){eL=o(function(){var e,t,r;return N(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eT.keys()];case 1:e=n.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(/*#__PURE__*/function(){var e=o(function(e){var t;return N(this,function(r){switch(r.label){case 0:return[4,eT.get(e)];case 1:return[2,((t=r.sent())===null||t===void 0?void 0:t.errors)||[]]}})});return function(t){return e.apply(this,arguments)}}()))];case 2:return[2,n.sent().flat()];case 3:r=n.sent();return[2,(en.error("Failed to retrieve stored errors: ".concat(r.message)),[])];case 4:return[2]}})});return eL.apply(this,arguments)}L(eD,"getStoredErrorLists");function ej(){return eP.apply(this,arguments)}function eP(){eP=o(function(){var e,t,r;return N(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eT.keys()];case 1:e=n.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return eT.remove(e)}))];case 2:n.sent();return[3,4];case 3:r=n.sent();en.error("Failed to clear error lists: ".concat(r.message));return[3,4];case 4:return[2]}})});return eP.apply(this,arguments)}L(ej,"clearAllErrorLists");function eM(e){var t=[],r=[],n="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,o=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,i=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))n=e.trim();else{var a,c,u,l,d;var f=s.exec(e)||[],p=o.exec(e)||[],m=i.exec(e)||[];var v,g,E,h,y,S;f.length&&n?t.push({file:n,position:"".concat(f[1],":").concat(f[2]),type:f[3]===z.Error?z.Error:z.Warning,message:(v=f===null||f===void 0?void 0:(a=f[4])===null||a===void 0?void 0:a.trim())!==null&&v!==void 0?v:"",rule:(g=f===null||f===void 0?void 0:(c=f[5])===null||c===void 0?void 0:c.trim())!==null&&g!==void 0?g:""}):p.length?t.push({file:(E=p===null||p===void 0?void 0:p[1])!==null&&E!==void 0?E:"",position:"".concat(p[2],":").concat(p[3]),type:p[4]===z.Error?z.Error:z.Warning,message:(h=p===null||p===void 0?void 0:(u=p[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):m.length?t.push({file:"commitlint",type:z.Error,message:(y=m===null||m===void 0?void 0:(l=m[1])===null||l===void 0?void 0:l.trim())!==null&&y!==void 0?y:"",rule:(S=m===null||m===void 0?void 0:(d=m[2])===null||d===void 0?void 0:d.trim())!==null&&S!==void 0?S:""}):r.push(e.trim())}}),t.length&&eN(t),J&&r.length&&(en.warn("Unmatched lines:"),r.forEach(function(e){return en.info(" ".concat(e))}))}L(eM,"parseTextErrors");function eG(e){try{var t=JSON.parse(e),r=[];t.forEach(function(e){var t=e.filePath,n=e.messages;n.forEach(function(e){var n=e.severity,s=e.line,o=e.column,i=e.ruleId,a=e.message;r.push({type:n===2?z.Error:z.Warning,file:t,position:"".concat(s,":").concat(o),rule:i,message:a})})}),r.length&&eN(r)}catch(t){eM(e)}}L(eG,"parseCommandOutput");function ek(e){return eU.apply(this,arguments)}function eU(){eU=o(function(e){var t,r,n,s,o,i,a,c,u;var l=arguments;return N(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:eG;r=new AbortController;Q.on("SIGINT",function(){en.warn("Process interrupted. Terminating..."),r.abort(),Q.exit()});d.label=1;case 1:d.trys.push([1,3,,4]);return[4,eR(e,{maxBuffer:0x6400000,signal:r.signal})];case 2:n=d.sent(),s=n.stdout,o=n.stderr;[s,o].forEach(function(e){return e&&t(e)});return[3,4];case 3:i=d.sent();a=i.stdout,c=i.stderr,u=i.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&en.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return eU.apply(this,arguments)}L(ek,"executeCommand");function eF(e){return{raw:!0,cmd:e}}L(eF,"rawCommand");function eq(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(tE," ").concat(eX," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(tE," ").concat(tm," ").concat(tr," ").concat(e):"".concat(tE," ").concat(tt," ").concat(e)}L(eq,"formatCLI");function eH(e,t){return typeof e=="function"?eq(e(t),t):(typeof e==="undefined"?"undefined":T(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?eq(e,t):e}L(eH,"formatCommand");function eK(e){return eV.apply(this,arguments)}function eV(){eV=o(function(e){var t,r,n,s,o,i,a;var c=arguments;return N(this,function(u){switch(u.label){case 0:t=c.length>1&&c[1]!==void 0?c[1]:{};n=(r=t===null||t===void 0?void 0:t.isRemote)!==null&&r!==void 0?r:!1;if(!n)return[3,1];a=!1;return[3,3];case 1:return[4,ev(eX)];case 2:a=u.sent().isCurrentProject;u.label=3;case 3:s=a,o={isRemote:n,isCurrentProject:s},i=typeof e=="function"?e(o):e;return[2,Object.fromEntries(Object.entries(i).map(function(e){var t=I(e,2),r=t[0],n=t[1];return[r,eH(n,o)]}))]}})});return eV.apply(this,arguments)}L(eK,"resolveCommands");function eW(e,t){return eQ.apply(this,arguments)}function eQ(){eQ=o(function(e,t){var r;return N(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);en.start("".concat(e)),J&&en.info("→ ".concat(t));return[4,ek(t)];case 1:n.sent(),en.success("".concat(e," done."));return[3,3];case 2:r=n.sent();throw en.error("".concat(e," failed: ").concat(r.message)),r;case 3:return[2]}})});return eQ.apply(this,arguments)}L(eW,"runCommand");import*as eB from"node:path";function eY(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;return(n=eB).resolve.apply(n,[e$].concat(b(t)))}L(eY,"resolveWorkingPath");function eJ(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;return(n=eB).resolve.apply(n,b(t))}L(eJ,"resolve");function ez(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;return(n=eB).join.apply(n,b(t))}L(ez,"join");var e$=K.env.INIT_CWD||K.cwd(),eX="@cyberskill/shared",eZ=".cyberskill-storage",e0="node_modules",e1="dist",e2="package.json",e4="package-lock.json",e3="tsconfig.json",e8=".gitignore",e5=".simple-git-hooks.json",e6="pnpm-lock.yaml",e9=".git/hooks/",e7=".git/COMMIT_EDITMSG",te=ez(e$,e0,eX,e1),tt="cyberskill",tr="src/nodejs/cli/index.ts",tn="eslint",ts="eslint",to="vitest",ti="playwright",ta="vitest",tc="@commitlint/cli",tu="commitlint",tl="lint-staged",td="lint-staged",tf="typescript",tp="tsc",tm="tsx",tv="git",tg="pnpm",tE="pnpm exec",th="simple-git-hooks",ty="simple-git-hooks",tS="@eslint/config-inspector",tO="eslint-config-inspector",t_="node-modules-inspector",tA="node-modules-inspector",tC={CYBERSKILL_DIRECTORY:te,WORKING_DIRECTORY:e$,TS_CONFIG:eY(e3),GIT_IGNORE:eY(e8),GIT_HOOK:eY(e9),GIT_COMMIT_MSG:eY(e7),SIMPLE_GIT_HOOKS_JSON:eY(e5),PACKAGE_JSON:eY(e2),PACKAGE_LOCK_JSON:eY(e4),PNPM_LOCK_YAML:eY(e6),NODE_MODULES:eY(e0),LINT_STAGED_CONFIG:eY("".concat(te,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:eY("".concat(te,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:eY("".concat(te,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:eY("".concat(te,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:eY("".concat(te,"/react/vitest/vitest.e2e.js"))};function tI(e){var t=e.isCurrentProject;return h({"pre-commit":td,"commit-msg":tu},t&&{"pre-push":eF("".concat(tv," pull"))})}L(tI,"HOOK");function tb(e){return tT.apply(this,arguments)}function tT(){tT=o(function(e){var t,r,n,s,o,i;var a=arguments;return N(this,function(c){switch(c.label){case 0:for(t=a.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=a[n]}s=I(r,2),o=s[0],i=s[1];if(!o)throw new Error("'first' argument is undefined");switch(e){case V.CLI:return[3,1];case V.RAW:return[3,3]}return[3,4];case 1:return[4,ey(o.split(" "),{update:!0})];case 2:return[2,(c.sent(),eH(eF("".concat(tE," ").concat(i))))];case 3:return[2,eH(eF(o))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return tT.apply(this,arguments)}L(tb,"buildCommand");function tR(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}return /*#__PURE__*/o(function(){return N(this,function(t){return[2,tb.apply(void 0,[e].concat(b(r)))]})})}L(tR,"commandFactory");var tw={simpleGitHooks:tR(V.CLI,th,ty),eslintInspect:tR(V.CLI,tS,tO),nodeModulesInspect:tR(V.CLI,t_,tA),eslintCheck:tR(V.CLI,tn,"".concat(ts," ").concat(tC.WORKING_DIRECTORY)),eslintFix:tR(V.CLI,tn,"".concat(ts," ").concat(tC.WORKING_DIRECTORY," --fix")),typescriptCheck:tR(V.CLI,tf,"".concat(tp," -p ").concat(tC.TS_CONFIG," --noEmit")),configureGitHook:tR(V.RAW,"".concat(tv," config core.hooksPath ").concat(tC.GIT_HOOK)),testUnit:tR(V.CLI,to,"".concat(ta," --config ").concat(tC.UNIT_TEST_CONFIG)),testE2e:tR(V.CLI,"".concat(to," ").concat(ti),"".concat(ta," --config ").concat(tC.E2E_TEST_CONFIG)),commitLint:tR(V.CLI,tc,"".concat(tu," --edit ").concat(tC.GIT_COMMIT_MSG," --config ").concat(tC.COMMITLINT_CONFIG)),lintStaged:tR(V.CLI,tl,"".concat(td," --config ").concat(tC.LINT_STAGED_CONFIG)),stageBuildDirectory:tR(V.RAW,"".concat(tv," add ").concat(e1)),build:tR(V.RAW,"".concat(tg," run build")),pnpmInstallStandard:tR(V.RAW,"".concat(tg," install")),pnpmInstallLegacy:tR(V.RAW,"".concat(tg," install --legacy-peer-deps")),pnpmInstallForce:tR(V.RAW,"".concat(tg," install --force"))};function tN(e){return H(h({plugins:[q()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:[tC.UNIT_TEST_SETUP_CONFIG]}},e))}L(tN,"vitestUnit");function tx(e){try{return JSON.parse(e),!0}catch(e){return!1}}L(tx,"isJson");function tD(e){return!!e&&(typeof e==="undefined"?"undefined":T(e))=="object"&&!Array.isArray(e)}L(tD,"isPlainObject");function tL(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.flat().reduce(function(e,t){var r=true,n=false,s=undefined;try{for(var o=Object.entries(t)[Symbol.iterator](),i;!(r=(i=o.next()).done);r=true){var a=I(i.value,2),c=a[0],u=a[1];var l=e[c];Array.isArray(u)?e[c]=Array.from(new Set(b(Array.isArray(l)?l:[]).concat(b(u)))):tD(u)?e[c]=tL(tD(l)?l:{},u):e[c]=u}}catch(e){n=true;s=e}finally{try{if(!r&&o.return!=null){o.return()}}finally{if(n){throw s}}}return e},{})}L(tL,"deepMerge");import*as tj from"globals";var tP=[{languageOptions:{globals:h({},tj.node,tj.browser)},rules:{"perfectionist/sort-imports":["error",{internalPattern:["^#.*","^@/.*"]}]},ignores:["build","dist"]}];var tM;var tG=L(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return tL.apply(void 0,b(t))},"passThroughHandler"),tk=L(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n=tL.apply(void 0,[tP].concat(b(t))),s=n.ignores,o=O(n,["ignores"]),i=Array.isArray(s)&&s.every(function(e){return typeof e=="string"})?{ignores:s}:void 0,a=[o].concat(b(i?[i]:[]));return G.apply(void 0,[{stylistic:{semi:!0,indent:4,quotes:"single"},formatters:{css:!0,html:!0,markdown:"prettier"},yaml:!1,react:!0}].concat(b(a)))},"handleESLint"),tU=L(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return F.apply(void 0,b(t))},"handleVitestReactE2E"),tF=L(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return tN.apply(void 0,b(t))},"handleVitestReactUnit"),tq=(tM={},l(tM,M.ESLINT,tk),l(tM,M.COMMITLINT,tG),l(tM,M.LINT_STAGED,tG),l(tM,M.VITEST_REACT_E2E,tU),l(tM,M.VITEST_REACT_UNIT,tF),tM);function tH(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}var s=tq[e];if(!s)throw new Error("Unknown config type: ".concat(e));return s.apply(void 0,b(r))}L(tH,"mergeConfigs");import{defineConfig as tK}from"@eddeee888/gcg-typescript-resolver-files";function tV(e){var t=e.uri,r=e.from,n=e.to,s=e.target,o=s===void 0?"client":s;var i=o==="client",a=o==="server";return S(h({schema:t,ignoreNoDocuments:!0,overwrite:!0},i&&{documents:[r]}),{generates:h({},i&&l({},n,{preset:"client",presetConfig:{fragmentMasking:!1,persistedDocuments:!0},config:{useTypeImports:!0}}),a&&l({},n,tK()))})}L(tV,"createGraphqlCodegenConfig");var tW={"*":["eslint --fix"]};var tQ=(typeof window==="undefined"?"undefined":T(window))<"u";import{ApolloServer as tB}from"@apollo/server";import{expressMiddleware as tY}from"@apollo/server/express4";import{ApolloServerPluginDrainHttpServer as tJ}from"@apollo/server/plugin/drainHttpServer";import{ApolloServerPluginLandingPageLocalDefault as tz,ApolloServerPluginLandingPageProductionDefault as t$}from"@apollo/server/plugin/landingPage/default";function tX(e){return new tB(h({schema:e.schema,plugins:[e.isDev?tz():t$(),tJ({httpServer:e.server})].concat(b(e.drainServer?[{serverWillStart:function t(){return o(function(){return N(this,function(t){return[2,{drainServer:function t(){return o(function(){var t;return N(this,function(r){(t=e.drainServer)===null||t===void 0?void 0:t.call(e),en.info("Apollo Server drainServer hook called");return[2]})})()}}]})})()}}]:[]))},e.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}))}L(tX,"createApolloServer");import tZ from"node:process";import{hideBin as t0}from"yargs/helpers";import t1 from"yargs/yargs";var t2={name:"@cyberskill/shared",type:"module",version:"1.94.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/apollo-server":{types:"./dist/nodejs/apollo-server/index.d.ts",import:"./dist/nodejs/apollo-server/index.js",require:"./dist/nodejs/apollo-server/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/express":{types:"./dist/nodejs/express/index.d.ts",import:"./dist/nodejs/express/index.js",require:"./dist/nodejs/express/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./nodejs/ws":{types:"./dist/nodejs/ws/index.d.ts",import:"./dist/nodejs/ws/index.js",require:"./dist/nodejs/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"dotenv -e .env -- tsup --watch",lint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint","lint:fix":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:inspect",reset:"dotenv -e .env -- tsx src/nodejs/cli/index.ts reset",setup:"dotenv -e .env -- tsx src/nodejs/cli/index.ts setup",inspect:"dotenv -e .env -- tsx src/nodejs/cli/index.ts inspect","test:unit":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:unit","test:e2e":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:e2e",commitlint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts commitlint","lint-staged":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.3","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.4","@next/eslint-plugin-next":"15.3.1","@swc/core":"1.11.21","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.1",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.19",express:"4.21.2","express-device":"0.4.2","express-session":"1.18.1",globals:"16.0.0",graphql:"16.10.0","graphql-ws":"6.0.4",i18next:"25.0.0",jsdom:"26.1.0",localforage:"1.10.0","modern-normalize":"3.0.1",mongodb:"6.15.0",mongoose:"8.13.2","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.0.2","node-fetch":"3.3.2","node-persist":"4.0.4",ora:"8.2.0",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.4.1","react-icons":"5.5.0",sass:"1.86.3",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.3",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.2",vitest:"3.1.1","vitest-browser-react":"0.1.1",ws:"8.18.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/compression":"1.7.5","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.2","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.24.0","lint-staged":"15.5.1","node-modules-inspector":"0.6.6","simple-git-hooks":"2.12.1"}};function t4(){return t3.apply(this,arguments)}function t3(){t3=o(function(){var e,t;return N(this,function(r){switch(r.label){case 0:if(!ea(tC.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,tw.typescriptCheck()];case 1:return[4,eW.apply(void 0,t.concat([r.sent()]))];case 2:e=r.sent();return[3,4];case 3:e=en.warn("No TypeScript configuration found. Skipping type check.");r.label=4;case 4:e;return[2]}})});return t3.apply(this,arguments)}L(t4,"checkTypescript");function t8(){return t5.apply(this,arguments)}function t5(){t5=o(function(){var e,t,r,n;var s=arguments;return N(this,function(o){switch(o.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];r=["Running ESLint with auto-fix"];return[4,tw.eslintFix()];case 1:return[4,eW.apply(void 0,r.concat([o.sent()]))];case 2:t=o.sent();return[3,6];case 3:n=["Running ESLint check"];return[4,tw.eslintCheck()];case 4:return[4,eW.apply(void 0,n.concat([o.sent()]))];case 5:t=o.sent();o.label=6;case 6:t;return[2]}})});return t5.apply(this,arguments)}L(t8,"checkEslint");function t6(e,t){if(!t.length)return;var r=e==="Errors"?"red":"yellow";en.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,r)}L(t6,"printIssues");function t9(){return t7.apply(this,arguments)}function t7(){t7=o(function(){var e,t,r;return N(this,function(n){switch(n.label){case 0:return[4,eD()];case 1:e=n.sent(),t=e.filter(function(e){return e.type===z.Error}),r=e.filter(function(e){return e.type===z.Warning});!t.length&&!r.length?en.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(t6("Warnings",r),t6("Errors",t),(t.length>0||r.length>0)&&tZ.exit(1));return[2]}})});return t7.apply(this,arguments)}L(t9,"showCheckResult");function re(){return rt.apply(this,arguments)}function rt(){rt=o(function(){var e,t,r,n,s,o;return N(this,function(i){switch(i.label){case 0:return[4,ej()];case 1:i.sent();return[4,ev(eX)];case 2:e=i.sent(),t=e.isCurrentProject;if(!t)return[3,9];i.label=3;case 3:i.trys.push([3,8,,9]);r=["Building package: ".concat(eX)];return[4,tw.build()];case 4:return[4,eW.apply(void 0,r.concat([i.sent()]))];case 5:i.sent();n=["Staging build artifacts"];return[4,tw.stageBuildDirectory()];case 6:return[4,eW.apply(void 0,n.concat([i.sent()]))];case 7:i.sent();return[3,9];case 8:s=i.sent();throw en.error("Error building and staging ".concat(eX,": ").concat(s.message)),s;case 9:o=["Executing lint-staged"];return[4,tw.lintStaged()];case 10:return[4,eW.apply(void 0,o.concat([i.sent()]))];case 11:i.sent(),t9();return[2]}})});return rt.apply(this,arguments)}L(re,"lintStaged");function rr(){return rn.apply(this,arguments)}function rn(){rn=o(function(){var e;return N(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,tw.eslintInspect()];case 1:return[4,eW.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return rn.apply(this,arguments)}L(rr,"inspectLint");function rs(){return ro.apply(this,arguments)}function ro(){ro=o(function(){return N(this,function(e){switch(e.label){case 0:return[4,ej()];case 1:e.sent();return[4,Promise.all([t4(),t8()])];case 2:e.sent(),t9();return[2]}})});return ro.apply(this,arguments)}L(rs,"lintCheck");function ri(){return ra.apply(this,arguments)}function ra(){ra=o(function(){return N(this,function(e){switch(e.label){case 0:return[4,ej()];case 1:e.sent();return[4,Promise.all([t4(),t8(!0)])];case 2:e.sent(),t9();return[2]}})});return ra.apply(this,arguments)}L(ri,"lintFix");function rc(){return ru.apply(this,arguments)}function ru(){ru=o(function(){var e;return N(this,function(t){switch(t.label){case 0:return[4,ej()];case 1:t.sent();e=["Validating commit message"];return[4,tw.commitLint()];case 2:return[4,eW.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),t9();return[2]}})});return ru.apply(this,arguments)}L(rc,"commitLint");function rl(){return rd.apply(this,arguments)}function rd(){rd=o(function(){var e,t,r,n;return N(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,tw.configureGitHook()];case 1:return[4,eW.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),ed(tC.GIT_HOOK);return[4,eK(tI)];case 3:t=s.sent();eu(tC.SIMPLE_GIT_HOOKS_JSON,t,{isJson:!0});r="\n".concat(e5,"\n");ea(tC.GIT_IGNORE)?ec(tC.GIT_IGNORE).split("\n").includes(e5)||el(tC.GIT_IGNORE,r):eu(tC.GIT_IGNORE,r);n=["Setting up simple-git-hooks"];return[4,tw.simpleGitHooks()];case 4:return[4,eW.apply(void 0,n.concat([s.sent()]))];case 5:s.sent();return[2]}})});return rd.apply(this,arguments)}L(rl,"setupGitHook");function rf(){return rp.apply(this,arguments)}function rp(){rp=o(function(){return N(this,function(e){switch(e.label){case 0:return[4,ey([eX],{update:!0,postInstallActions:[rl]})];case 1:e.sent();return[2]}})});return rp.apply(this,arguments)}L(rf,"setup");function rm(){return rv.apply(this,arguments)}function rv(){rv=o(function(){return N(this,function(e){switch(e.label){case 0:ed(tC.NODE_MODULES,tC.PNPM_LOCK_YAML);return[4,eE()];case 1:e.sent();return[4,rl()];case 2:e.sent();return[2]}})});return rv.apply(this,arguments)}L(rm,"reset");function rg(){return rE.apply(this,arguments)}function rE(){rE=o(function(){var e;return N(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,tw.nodeModulesInspect()];case 1:return[4,eW.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return rE.apply(this,arguments)}L(rg,"inspect");function rh(){return ry.apply(this,arguments)}function ry(){ry=o(function(){var e;return N(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,tw.testUnit()];case 1:return[4,eW.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return ry.apply(this,arguments)}L(rh,"testUnit");function rS(){return rO.apply(this,arguments)}function rO(){rO=o(function(){var e;return N(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,tw.testE2e()];case 1:return[4,eW.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return rO.apply(this,arguments)}L(rS,"testE2E");o(function(){var e;return N(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,t1(t0(tZ.argv)).scriptName(tt).usage("$0 <command> [options]").command("lint","Check code for linting issues",rs).command("lint:fix","Fix linting issues automatically",ri).command("lint:inspect","View active ESLint configuration",rr).command("lint-staged","Run lint checks on staged files",re).command("commitlint","Validate commit message format",rc).command("setup","Initialize project setup and dependencies",rf).command("reset","Reset the project and reinstall dependencies",rm).command("inspect","Analyze installed project dependencies",rg).command("test:unit","Run unit test suite",rh).command("test:e2e","Run end-to-end test suite",rS).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(t2.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();en.error("Fatal: ".concat(e.message)),tZ.exit(1);return[3,3];case 3:return[2]}})})();import r_ from"compression";import rA from"cors";import rC from"express";import rI from"express-device";import rb from"express-session";function rT(e){return rA({origin:L(function(t,r){var n;e.isDev||((n=e.corsWhitelist)===null||n===void 0?void 0:n.includes(t!==null&&t!==void 0?t:""))?r(null,!0):r(null,!1)},"origin"),credentials:!0})}L(rT,"createCors");function rR(e){var t=rC();return t.set("trust proxy",1),t.use(rC.urlencoded({extended:!0})),t.use(r_()),t.use(rI.capture()),e.staticFolder&&t.use(rC.static(e.staticFolder)),e.sessionOptions&&t.use(rb(e.sessionOptions)),t}L(rR,"createExpress");import{format as rw}from"date-fns";import{Document as rN}from"mongoose";import rx from"mongoose-aggregate-paginate-v2";import rD from"mongoose-paginate-v2";import{v4 as rL}from"uuid";import rj from"crypto-js";import rP from"slugify";var rM=rP.default||rP;function rG(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;var r=t||{},n=r.lower,s=n===void 0?!0:n,o=r.locale,i=o===void 0?"vi":o,a=O(r,["lower","locale"]);return rM(e,h({lower:s,locale:i},a))}L(rG,"generateSlug");function rk(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;return rj.SHA256(e).toString(rj.enc.Hex).slice(0,t)}L(rk,"generateShortId");var rU={isEmpty:function e(e){return e==null?!0:Array.isArray(e)?e.length===0:(typeof e==="undefined"?"undefined":T(e))=="object"?p(e,Date)?!1:Object.keys(e).length===0:typeof e=="string"?e.trim().length===0:!1}};var rF={getDateTime:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Date;return rw(e,"yyyy-MM-dd HH:mm:ss.SSS")},createGenericFields:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.returnDateAs,r=t===void 0?"string":t;var n=r==="string"?rF.getDateTime():new Date;return{id:rL(),isDel:!1,createdAt:n,updatedAt:n}},applyPlugins:function e(e,t){t.filter(function(e){return typeof e=="function"}).forEach(function(t){return e.plugin(t)})},applyMiddlewares:function e(e,t){t.forEach(function(t){var r=t.method,n=t.pre,s=t.post;r&&n&&e.pre(r,n),r&&s&&e.post(r,s)})},createGenericSchema:function e(e){return new e.Schema({id:{type:String,default:rL,required:!0,unique:!0},isDel:{type:Boolean,default:!1,required:!0}},{timestamps:!0})},createSchema:function e(e){var t=e.mongoose,r=e.schema,n=e.virtuals,s=n===void 0?[]:n,o=e.standalone,i=o===void 0?!1:o;var a=new t.Schema(r,{strict:!0});return s.forEach(function(e){var t=e.name,r=e.options,n=e.get;var s=a.virtual(t,r);n&&s.get(n)}),i||a.add(rF.createGenericSchema(t)),a},createModel:function e(e){var t=e.mongoose,r=e.name,n=e.schema,s=e.pagination,o=s===void 0?!1:s,i=e.aggregate,a=i===void 0?!1:i,c=e.virtuals,u=c===void 0?[]:c,l=e.middlewares,d=l===void 0?[]:l;if(!r)throw new Error("Model name is required.");if(t.models[r])return t.models[r];var f=rF.createSchema({mongoose:t,schema:n,virtuals:u});return rF.applyPlugins(f,[o&&rD,a&&rx]),rF.applyMiddlewares(f,d),t.model(r,f)},createSlugQuery:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;return S(h({},t,r&&{id:{$ne:r}}),{$or:[{slug:e},{slugHistory:e}]})},validator:{isEmpty:function e(){return /*#__PURE__*/function(){var e=o(function(e){return N(this,function(t){return[2,!rU.isEmpty(e)]})});return function(t){return e.apply(this,arguments)}}()},isUnique:function e(e){return /*#__PURE__*/function(){var t=o(function(t){var r;return N(this,function(n){switch(n.label){case 0:if(!Array.isArray(e)||e.length===0)throw new Error("Fields must be a non-empty array of strings.");r={$or:e.map(function(e){return l({},e,t)})};return[4,this.constructor.findOne(r)];case 1:return[2,!n.sent()]}})});return function(e){return t.apply(this,arguments)}}()},matchesRegex:function e(e){return /*#__PURE__*/function(){var t=o(function(t){return N(this,function(r){if(!Array.isArray(e)||e.some(function(e){return!p(e,RegExp)}))throw new Error("regexArray must be an array of valid RegExp objects.");return[2,e.every(function(e){return e.test(t)})]})});return function(e){return t.apply(this,arguments)}}()}}},rq=/*#__PURE__*/function(){"use strict";function e(t,r){a(this,e);j(this,"collection");this.collection=t.collection(r)}u(e,[{key:"createOne",value:function e(e){var t=this;return o(function(){var r,n,s;return N(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);r=h({},rF.createGenericFields(),e);n={success:!0,message:"Document created successfully"};return[4,t.collection.insertOne(r)];case 1:return[2,(n.result=o.sent(),n)];case 2:s=o.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"createMany",value:function e(e){var t=this;return o(function(){var r,n,s;return N(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);r=e.map(function(e){return h({},rF.createGenericFields(),e)});return[4,t.collection.insertMany(r)];case 1:n=o.sent();return[2,n.insertedCount===0?{success:!1,message:"No documents were inserted"}:{success:!0,message:"".concat(n.insertedCount," documents created successfully"),result:n}];case 2:s=o.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"findOne",value:function e(e){var t=this;return o(function(){var r,n;return N(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,t.collection.findOne(e)];case 1:r=s.sent();return[2,r?{success:!0,message:"Document found",result:r}:{success:!1,message:"Document not found"}];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"findAll",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=this;return o(function(){var r,n;return N(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0,message:"Documents retrieved successfully"};return[4,t.collection.find(e).toArray()];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"count",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=this;return o(function(){var r,n;return N(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0,message:"Count retrieved successfully"};return[4,t.collection.countDocuments(e)];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"updateOne",value:function e(e,t){var r=this;return o(function(){var n,s;return N(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,r.collection.updateOne(e,{$set:t})];case 1:n=o.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Document updated successfully",result:n}];case 2:s=o.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"updateMany",value:function e(e,t){var r=this;return o(function(){var n,s;return N(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,r.collection.updateMany(e,{$set:t})];case 1:n=o.sent();return[2,n.matchedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Documents updated successfully",result:n}];case 2:s=o.sent();return[2,{success:!1,message:s.message}];case 3:return[2]}})})()}},{key:"deleteOne",value:function e(e){var t=this;return o(function(){var r,n;return N(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,t.collection.deleteOne(e)];case 1:r=s.sent();return[2,r.deletedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Document deleted successfully",result:r}];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}},{key:"deleteMany",value:function e(e){var t=this;return o(function(){var r,n;return N(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,t.collection.deleteMany(e)];case 1:r=s.sent();return[2,r.deletedCount===0?{success:!1,message:"No documents matched the filter"}:{success:!0,message:"Documents deleted successfully",result:r}];case 2:n=s.sent();return[2,{success:!1,message:n.message}];case 3:return[2]}})})()}}]);return e}();L(rq,"MongoController");var rH=rq,rK=/*#__PURE__*/function(){"use strict";function e(t){a(this,e);j(this,"model");this.model=t}u(e,[{key:"getModelName",value:function e(){return this.model.modelName}},{key:"findOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;var s=this;return o(function(){var o,i,a;return N(this,function(c){switch(c.label){case 0:c.trys.push([0,2,,3]);o=s.model.findOne(e,t,r);n&&o.populate(n);return[4,o.exec()];case 1:i=c.sent();return[2,i?{success:!0,result:i}:{success:!1,message:"No ".concat(s.getModelName()," found."),code:ee.NOT_FOUND.CODE}];case 2:a=c.sent();return[2,{success:!1,message:a.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findAll",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;var s=this;return o(function(){var o,i,a;return N(this,function(c){switch(c.label){case 0:c.trys.push([0,2,,3]);o=s.model.find(e,t,r);n&&o.populate(n);i={success:!0};return[4,o.exec()];case 1:return[2,(i.result=c.sent(),i)];case 2:a=c.sent();return[2,{success:!1,message:a.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findPaging",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return o(function(){var n,s;return N(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);n={success:!0};return[4,r.model.paginate(e,t)];case 1:return[2,(n.result=o.sent(),n)];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"findPagingAggregate",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return o(function(){var n,s;return N(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);n={success:!0};return[4,r.model.aggregatePaginate(r.model.aggregate(e),t)];case 1:return[2,(n.result=o.sent(),n)];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"count",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=this;return o(function(){var r,n;return N(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0};return[4,t.model.countDocuments(e)];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createOne",value:function e(e){var t=this;return o(function(){var r,n;return N(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0};return[4,t.model.create(e)];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createMany",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return o(function(){var n,s;return N(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);n={success:!0};return[4,r.model.insertMany(e,t)];case 1:return[2,(n.result=o.sent().map(function(e){return p(e,rN)?e.toObject():null}).filter(function(e){return e!==null}),n)];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"updateOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=this;return o(function(){var s,o;return N(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);return[4,n.model.findOneAndUpdate(e,t,h({new:!0},r)).exec()];case 1:s=i.sent();return[2,s?{success:!0,result:s}:{success:!1,message:"Failed to update ".concat(n.getModelName(),"."),code:ee.NOT_FOUND.CODE}];case 2:o=i.sent();return[2,{success:!1,message:o.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"updateMany",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=this;return o(function(){var s,o;return N(this,function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);s={success:!0};return[4,n.model.updateMany(e,t,r).exec()];case 1:return[2,(s.result=i.sent(),s)];case 2:o=i.sent();return[2,{success:!1,message:o.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"deleteOne",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return o(function(){var n,s;return N(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,r.model.findOneAndDelete(e,t).exec()];case 1:n=o.sent();return[2,n?{success:!0,result:n}:{success:!1,message:"No ".concat(r.getModelName()," found to delete."),code:ee.NOT_FOUND.CODE}];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"deleteMany",value:function e(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r=this;return o(function(){var n,s;return N(this,function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,r.model.deleteMany(e,t).exec()];case 1:n=o.sent();return[2,n.deletedCount===0?{success:!1,message:"No documents found to delete.",code:ee.NOT_FOUND.CODE}:{success:!0,result:n}];case 2:s=o.sent();return[2,{success:!1,message:s.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}},{key:"createShortId",value:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4;var r=this;return o(function(){var n,s,o,i;return N(this,function(a){switch(a.label){case 0:n=new Set;s=0;a.label=1;case 1:if(!(s<10))return[3,5];o=rk(e,s+t);i=!n.has(o);if(!i)return[3,3];n.add(o);return[4,r.model.exists({shortId:o})];case 2:i=!a.sent();a.label=3;case 3:if(i)return[2,{success:!0,result:o}];a.label=4;case 4:s++;return[3,1];case 5:return[2,{success:!1,message:"Failed to create a unique shortId",code:ee.INTERNAL_SERVER_ERROR.CODE}]}})})()}},{key:"createSlug",value:function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=this;return o(function(){var s,i,a,c,u,l,d,f,p,m,v;return N(this,function(g){switch(g.label){case 0:g.trys.push([0,8,,9]);s=t[e],i=L(/*#__PURE__*/function(){var e=o(function(e){var s,o,i;return N(this,function(a){switch(a.label){case 0:return[4,n.model.findOne(rF.createSlugQuery(e,r,t.id))];case 1:s=a.sent();if(!s)return[2,e];o=1;a.label=2;case 2:i="".concat(e,"-").concat(o);return[4,n.model.findOne(rF.createSlugQuery(i,r,t.id))];case 3:s=a.sent(),o++;a.label=4;case 4:if(s)return[3,2];a.label=5;case 5:return[2,i]}})});return function(t){return e.apply(this,arguments)}}(),"createUniqueSlug");if(!((typeof s==="undefined"?"undefined":T(s))=="object"))return[3,5];a={};c=[];for(u in s)c.push(u);l=0;g.label=1;case 1:if(!(l<c.length))return[3,4];d=c[l];f=rG(s[d]);return[4,i(f)];case 2:a[d]=g.sent();g.label=3;case 3:l++;return[3,1];case 4:return[2,{success:!0,result:a}];case 5:p=rG(s);m={success:!0};return[4,i(p)];case 6:return[2,(m.result=g.sent(),m)];case 7:return[3,9];case 8:v=g.sent();return[2,{success:!1,message:"Failed to create a unique slug: ".concat(v.message),code:ee.INTERNAL_SERVER_ERROR.CODE}];case 9:return[2]}})})()}},{key:"aggregate",value:function e(e){var t=this;return o(function(){var r,n;return N(this,function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);r={success:!0};return[4,t.model.aggregate(e)];case 1:return[2,(r.result=s.sent(),r)];case 2:n=s.sent();return[2,{success:!1,message:n.message,code:ee.INTERNAL_SERVER_ERROR.CODE}];case 3:return[2]}})})()}}]);return e}();L(rK,"MongooseController");var rV=rK;import{Collection as rW,Db as rQ}from"mongodb";import{Document as rB,Model as rY}from"mongoose";var rJ=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return i(this,t,arguments)}return t}(rQ);L(rJ,"C_Db");var rz=rJ,r$=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return i(this,t,arguments)}return t}(rB);L(r$,"C_Document");var rX=r$,rZ=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return i(this,t,arguments)}return t}(rY);L(rZ,"C_Model");var r0=rZ,r1=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);return i(this,t,arguments)}return t}(rW);L(r1,"C_Collection");var r2=r1;import{useServer as r4}from"graphql-ws/use/ws";import{WebSocketServer as r3}from"ws";function r8(e){return new r3({server:e.server,path:e.path})}L(r8,"createWSServer");function r5(e){return r4({schema:e.schema},e.server)}L(r5,"initGraphQLWS");import{ApolloClient as r6,ApolloError as r9,ApolloLink as r7,ApolloProvider as ne,from as nt,HttpLink as nr,InMemoryCache as nn,split as ns}from"@apollo/client";import{onError as no}from"@apollo/client/link/error";import{removeTypenameFromVariables as ni}from"@apollo/client/link/remove-typename";import{GraphQLWsLink as na}from"@apollo/client/link/subscriptions";import{getMainDefinition as nc}from"@apollo/client/utilities";import{createClient as nu}from"graphql-ws";import nl,{useMemo as nd}from"react";import{FaInfo as nf}from"react-icons/fa6";import np,{use as nm}from"react";import{FaRepeat as nv}from"react-icons/fa6";import{createContext as ng}from"react";var nE=ng(void 0);import nh from"./react/apollo-error/apollo-error.module.scss";function ny(){var e=nm(nE),t=e===null||e===void 0?void 0:e.error;if(!t)return null;var r=L(function(e,t){return(t===null||t===void 0?void 0:t.length)?np.createElement("div",null,np.createElement("strong",null,e,":"),np.createElement("ul",null,t.map(function(e){return np.createElement("li",{key:e.message},e.message)}))):null},"renderErrorList");return np.createElement("div",{className:nh["modal-backdrop"]},np.createElement("div",{className:nh["modal-content"]},np.createElement("button",{type:"button",className:nh["btn-close"],onClick:e.hideError},"✕"),np.createElement("div",{className:nh["error-title"]},np.createElement("button",{type:"button",className:nh["btn-retry"],onClick:L(function(){return window.location.reload()},"onClick")},np.createElement(nv,null))," ",t.message),np.createElement("div",{className:nh["error-details"]},t.networkError&&np.createElement("pre",{className:"network"},np.createElement("strong",null,"Network Error:")," ",t.networkError.message),r("GraphQL Errors",b(t.graphQLErrors)),r("Protocol Errors",b(t.protocolErrors)),r("Client Errors",b(t.clientErrors)),t.extraInfo&&np.createElement("pre",{className:"extra"},np.createElement("strong",null,"Extra Info:")," ",JSON.stringify(t.extraInfo,null,4)))))}L(ny,"ApolloError");import{use as nS}from"react";function nO(){var e=nS(nE);if(!e)throw new Error("useApolloError must be used within ApolloErrorProvider");return e}L(nO,"useApolloError");import n_,{useEffect as nA,useMemo as nC,useState as nI}from"react";var nb=null;function nT(e){nb=e}L(nT,"setGlobalApolloErrorCallback");function nR(e){nb===null||nb===void 0?void 0:nb(e)}L(nR,"showGlobalApolloError");function nw(e){var t=e.children;var r=I(nI(null),2),n=r[0],s=r[1];nA(function(){nT(s)},[]);var o=nC(function(){return{error:n,showError:s,hideError:L(function(){return s(null)},"hideError")}},[n]);return n_.createElement(nE,{value:o},t)}L(nw,"ApolloErrorProvider");import{consola as nN}from"consola/browser";var nx={silent:nN.silent,level:nN.level,fatal:nN.fatal,error:nN.error,warn:nN.warn,log:nN.log,info:nN.info,success:nN.success,ready:nN.ready,start:nN.start,box:nN.box,debug:nN.debug,trace:nN.trace,verbose:nN.verbose};import{toast as nD,Toaster as nL}from"react-hot-toast";var nj="/graphql";var nP,nM=(nP=/*#__PURE__*/function(e){"use strict";f(t,e);function t(){a(this,t);var e;e=i(this,t,arguments);j(e,"count",0);return e}u(t,[{key:"request",value:function e(e,t){var r=this;var n=Date.now();return this.count+=1,t(e).map(function(t){var s=Date.now()-n,o=e.operationName||"Unnamed";return nx.info("[Apollo] #".concat(r.count,": ").concat(o," (").concat(s,"ms)")),t})}}]);return t}(r7),L(nP,"DevLoggerLink"),nP);function nG(e){var t=e.uri,r=e.wsUrl,n=e.customLinks,s=new nM,o=no(function(e){var t=e.graphQLErrors,r=e.networkError,n=e.protocolErrors,s=e.operation;var o=(s===null||s===void 0?void 0:s.operationName)||"Unknown";if(t&&t.forEach(function(e){var t=e.message,r=e.locations,n=e.path;nx.error("[GraphQL error] ".concat(o,": ").concat(t,", Location: ").concat(JSON.stringify(r),", Path: ").concat(n))}),n&&n.forEach(function(e){var t=e.message,r=e.extensions;nx.error("[Protocol error]: ".concat(t,", Extensions: ").concat(JSON.stringify(r)))}),r&&nx.error("[Network error]: ".concat(r)),t||n||r){var i,a;var c=(t===null||t===void 0?void 0:(i=t[0])===null||i===void 0?void 0:i.message)||(n===null||n===void 0?void 0:(a=n[0])===null||a===void 0?void 0:a.message)||(r===null||r===void 0?void 0:r.message)||"Unexpected error",u=new r9({graphQLErrors:t||[],protocolErrors:n||[],clientErrors:[],networkError:r||null,errorMessage:c,extraInfo:{operation:s}});nD.error(function(e){return nl.createElement(nl.Fragment,null,c,"\xa0",nl.createElement(nf,{cursor:"pointer",onClick:L(function(){setTimeout(function(){nR(u)},0),nD.dismiss(e.id)},"onClick")}))})}}),i=ni();t||nx.warn('[Apollo] No GraphQL URI provided — using "'.concat(nj,'" as default'));var a=new nr({uri:t!==null&&t!==void 0?t:nj,credentials:"include"}),c=r?new na(nu({url:r})):r7.empty(),u=p(c,r7)?ns(function(e){var t=e.query;var r=nc(t);return r.kind==="OperationDefinition"&&r.operation==="subscription"},c,a):a;return u===a&&r&&nx.warn("[Apollo] WS URL is set, but subscriptions fallback to HTTP. Check your wsLink config."),[s,o,i].concat(b(n!==null&&n!==void 0?n:[]),[u])}L(nG,"createApolloLinks");function nk(e){var t=e.isNextJS,r=e.options,n=e.children,s=e.client,o=e.provider,i=e.cache;var a=r||{},c=a.uri,u=a.wsUrl,l=a.customLinks,d=O(a,["uri","wsUrl","customLinks"]),f=s!==null&&s!==void 0?s:r6;if(typeof f!="function")throw new TypeError("Invalid ApolloClient provided. Ensure CustomClient is a class.");var m=o||ne,v=nd(function(){return nt(nG({uri:c!==null&&c!==void 0?c:nj,wsUrl:u!==null&&u!==void 0?u:"",customLinks:l!==null&&l!==void 0?l:[]}))},[c,u,l]),g=nd(function(){return p(i,nn)?i:new nn},[i]),E=nd(function(){return new f(h({link:v,cache:g},d))},[f,v,g,d]),y=t?nl.createElement(m,{makeClient:L(function(){return E},"makeClient")},n):nl.createElement(m,{client:E},n);return nl.createElement(nl.Fragment,null,nl.createElement(nw,null,y,nl.createElement(ny,null)),nl.createElement(nL,{position:"top-right"}))}L(nk,"ApolloProvider");import{useTranslation as nU}from"react-i18next";var nF=nU;import nq from"i18next";import{initReactI18next as nH}from"react-i18next";function nK(e){return nq.use(nH).init(e)}L(nK,"initI18next");import nV from"classnames";import nW from"react";import nQ from"./react/loading/loading.module.scss";function nB(e){var t=e.full,r=t===void 0?!1:t,n=e.block,s=n===void 0?!1:n,o=e.className,i=o===void 0?"":o,a=e.message,c=a===void 0?"Loading":a,u=O(e,["full","block","className","message"]);function l(){return nW.createElement("div",h({className:nQ.container},u),nW.createElement("div",{className:nQ.ring}),nW.createElement("div",{className:nQ.ring}),nW.createElement("div",{className:nQ.ring}),nW.createElement("div",{className:nQ.ring}),c&&nW.createElement("div",{className:nQ.message},c))}return L(l,"_renderLoading"),r?nW.createElement("div",{className:nV(nQ.fullscreen,i)},l()):s?nW.createElement("div",{className:nV(nQ.block,i)},l()):l()}L(nB,"Loading");import{createContext as nY}from"react";var nJ=nY(void 0);import{use as nz}from"react";function n$(){var e=nz(nJ);if(!e)throw new Error("useLoading must be used within a LoadingProvider");return e}L(n$,"useLoading");import nX,{useCallback as nZ,useMemo as n0,useState as n1}from"react";function n2(e){var t=e.children;var r=I(n1(!1),2),n=r[0],s=r[1],o=I(n1(!1),2),i=o[0],a=o[1],c=nZ(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;s(!0),a(e)},[]),u=nZ(function(){s(!1),a(!1)},[]),l=n0(function(){return{isLoading:n,isGlobalLoading:i,showLoading:c,hideLoading:u}},[n,i,c,u]);return nX.createElement(nJ,{value:l},n?nX.createElement(nB,{full:i}):t)}L(n2,"LoadingProvider");import{enUS as n4}from"date-fns/locale";var n3={label:"English",value:"en",flag:"\uD83C\uDDFA\uD83C\uDDF8",adapterLocale:n4,icon:"flagpack:gb-nir",numberFormat:{code:"en-US",currency:"USD"},timezone:"America/New_York"};import{createContext as n8}from"react";var n5=n8(void 0);import{NextIntlClientProvider as n6}from"next-intl";import n9 from"react";import{useTranslations as n7}from"next-intl";import{use as se}from"react";function st(){var e=se(n5);if(!e)throw new Error("useNextIntl must be used within a NextIntlProvider");return e}L(st,"useNextIntl");var sr=n7;function sn(e){var t=L(function(t){var r;var n;var s=st(),o=s.currentLanguage,i=t.messages,a=t.languages,c="en",u=i[(o===null||o===void 0?void 0:o.value)||c],l=(n=(r=a.find(function(e){return e.value===(o===null||o===void 0?void 0:o.value)}))===null||r===void 0?void 0:r.timezone)!==null&&n!==void 0?n:n3.timezone;return i?n9.createElement(n6,{locale:(o===null||o===void 0?void 0:o.value)||c,messages:u||null,timeZone:l},n9.createElement(e,t)):(nx.warn("Missing messages for language: ".concat((o===null||o===void 0?void 0:o.value)||c)),null)},"PageWithI18n");return t.displayName="withNextIntl(".concat(e.displayName||e.name||"Component",")"),t}L(sn,"withNextIntl");import ss,{useMemo as so}from"react";import{useCallback as si,useEffect as sa,useState as sc}from"react";var su={serialize:L(function(e){return JSON.stringify(e,function(e,t){return p(t,Date)?{__type:"Date",value:t.toISOString()}:t})},"serialize"),deserialize:L(function(e){return JSON.parse(e,function(e,t){return(t===null||t===void 0?void 0:t.__type)==="Date"?new Date(t.value):t})},"deserialize")};import sl from"localforage";var sd={get:function e(e){return o(function(){var t;return N(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,sl.getItem(e)];case 1:return[2,r.sent()];case 2:t=r.sent();return[2,(nx.error('[Storage:get] Error getting key "'.concat(e,'":'),t),null)];case 3:return[2]}})})()},set:function e(e,t){return o(function(){var r;return N(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,sl.setItem(e,t)];case 1:n.sent();return[3,3];case 2:r=n.sent();nx.error('[Storage:set] Error setting key "'.concat(e,'":'),r);return[3,3];case 3:return[2]}})})()},remove:function e(e){return o(function(){var t;return N(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,sl.removeItem(e)];case 1:r.sent();return[3,3];case 2:t=r.sent();nx.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,3];case 3:return[2]}})})()},keys:function e(){return o(function(){var e,t;return N(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,sl.keys()];case 1:return[2,(e=r.sent())!==null&&e!==void 0?e:[]];case 2:t=r.sent();return[2,(nx.error("[Storage:keys] Error getting keys:",t),[])];case 3:return[2]}})})()}};function sf(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:su;var n=I(sc(t),2),s=n[0],i=n[1],a=I(sc(!1),2),c=a[0],u=a[1];sa(function(){var n=!0;return L(/*#__PURE__*/o(function(){var s,o,a,c;return N(this,function(l){switch(l.label){case 0:l.trys.push([0,6,7,8]);return[4,sd.get(e)];case 1:s=l.sent();if(!n)return[3,5];if(!(s!==null))return[3,2];o=r.deserialize(s);i(o);return[3,5];case 2:if(!(t!==void 0))return[3,4];a=r.serialize(t);return[4,sd.set(e,a)];case 3:l.sent(),i(t);return[3,5];case 4:i(void 0);l.label=5;case 5:return[3,8];case 6:c=l.sent();nx.error('Error loading value for key "'.concat(e,'":'),c),n&&i(t);return[3,8];case 7:n&&u(!0);return[7];case 8:return[2]}})}),"loadValue")(),function(){n=!1,u(!1)}},[e,t,r]),sa(function(){if(!c)return;L(/*#__PURE__*/o(function(){var t,n;return N(this,function(o){switch(o.label){case 0:o.trys.push([0,3,,4]);if(!(s!==void 0))return[3,2];t=r.serialize(s);return[4,sd.set(e,t)];case 1:o.sent();o.label=2;case 2:return[3,4];case 3:n=o.sent();nx.error('Error saving value for key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})}),"saveValue")()},[s,e,r,c]);var l=si(function(e){i(function(t){return typeof e=="function"?e(t):e})},[]),d=si(/*#__PURE__*/o(function(){var t;return N(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,sd.remove(e)];case 1:r.sent(),i(void 0);return[3,3];case 2:t=r.sent();nx.error('Error removing key "'.concat(e,'":'),t);return[3,3];case 3:return[2]}})}),[e]);return{value:s,set:l,remove:d}}L(sf,"useStorage");function sp(e){var t=e.children;return ss.createElement(ss.Fragment,null,t)}L(sp,"LanguageWrapperBase");var sm=sn(sp);function sv(e){var t=e.children,r=e.languages,n=e.messages;var s=sf("lang",r[0]),o=s.value,i=s.set,a=so(function(){return{languages:r,currentLanguage:o!==null&&o!==void 0?o:n3,setCurrentLanguage:i}},[r,i,o]);return ss.createElement(n5,{value:a},ss.createElement(sm,{languages:r,messages:n},t))}L(sv,"NextIntlProvider");import sg from"unorm";var sE={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},sh=Object.entries(sE).reduce(function(e,t){var r=I(t,2),n=r[0],s=r[1];return e[n.toUpperCase()]=s.map(function(e){return e.toUpperCase()}),e},{});function sy(e){e=sg.nfkc(e);var t=h({},sE,sh);var r=true,n=false,s=undefined;try{for(var o=Object.entries(t)[Symbol.iterator](),i;!(r=(i=o.next()).done);r=true){var a=I(i.value,2),c=a[0],u=a[1];var l="[".concat(c).concat(u.join(""),"]"),d="(".concat([c].concat(b(u)).join("|"),")");e=e.replace(new RegExp(l,"g"),d)}}catch(e){n=true;s=e}finally{try{if(!r&&o.return!=null){o.return()}}finally{if(n){throw s}}}return e}L(sy,"regexSearchMapper");function sS(e){return e.normalize("NFD").replace(RegExp("\\p{Diacritic}","gu"),"")}L(sS,"removeAccent");export{ny as ApolloError,nE as ApolloErrorContext,nw as ApolloErrorProvider,nk as ApolloProvider,e1 as BUILD_DIRECTORY,es as CHECK_PACKAGE_EMPTY_RESULT,tu as COMMIT_LINT_CLI,tc as COMMIT_LINT_PACKAGE_NAME,tt as CYBERSKILL_CLI,tr as CYBERSKILL_CLI_PATH,te as CYBERSKILL_DIRECTORY,eX as CYBERSKILL_PACKAGE_NAME,eZ as CYBERSKILL_STORAGE,r2 as C_Collection,rz as C_Db,rX as C_Document,r0 as C_Model,J as DEBUG,ts as ESLINT_CLI,tO as ESLINT_INSPECT_CLI,tS as ESLINT_INSPECT_PACKAGE_NAME,tn as ESLINT_PACKAGE_NAME,V as E_CommandType,M as E_ConfigType,z as E_IssueType,tv as GIT_CLI,e7 as GIT_COMMIT_EDITMSG,e9 as GIT_HOOK,e8 as GIT_IGNORE,nj as GRAPHQL_URI_DEFAULT,tI as HOOK,tQ as IS_BROWSER,td as LINT_STAGED_CLI,tl as LINT_STAGED_PACKAGE_NAME,nB as Loading,nJ as LoadingContext,n2 as LoadingProvider,rH as MongoController,rV as MongooseController,n3 as NEXT_INTL_DEFAULT_LANGUAGE,e0 as NODE_MODULES,tA as NODE_MODULES_INSPECT_CLI,t_ as NODE_MODULES_INSPECT_PACKAGE_NAME,n5 as NextIntlContext,sv as NextIntlProvider,e2 as PACKAGE_JSON,e4 as PACKAGE_LOCK_JSON,tC as PATH,ti as PLAYWRIGHT_PACKAGE_NAME,tg as PNPM_CLI,tE as PNPM_EXEC_CLI,e6 as PNPM_LOCK_YAML,ee as RESPONSE_STATUS,th as SIMPLE_GIT_HOOKS_PACKAGE_NAME,ty as SIMPLE_GIT_HOOK_CLI,e5 as SIMPLE_GIT_HOOK_JSON,e3 as TSCONFIG_JSON,tp as TSC_CLI,tf as TSC_PACKAGE_NAME,tm as TSX_CLI,nL as Toaster,ta as VITEST_CLI,to as VITEST_PACKAGE_NAME,e$ as WORKING_DIRECTORY,rx as aggregatePaginate,el as appendFileSync,ev as checkPackage,ej as clearAllErrorLists,tw as command,P as commitlintConfig,tX as createApolloServer,rT as createCors,rR as createExpress,tV as createGraphqlCodegenConfig,r8 as createWSServer,tL as deepMerge,tP as eslintConfig,ea as existsSync,rC as express,tY as expressMiddleware,eH as formatCommand,rk as generateShortId,rG as generateSlug,ep as getLatestPackageVersion,ef as getPackage,eD as getStoredErrorLists,r5 as initGraphQLWS,nK as initI18next,eE as installDependencies,tx as isJson,tD as isPlainObject,ez as join,tW as lintStagedConfig,nx as log,en as logNodeJS,tH as mergeConfigs,rF as mongo,rD as mongoosePaginate,eF as rawCommand,ec as readFileSync,sy as regexSearchMapper,sS as removeAccent,eJ as resolve,eK as resolveCommands,eY as resolveWorkingPath,ed as rmSync,eW as runCommand,su as serializer,nT as setGlobalApolloErrorCallback,ey as setupPackages,nR as showGlobalApolloError,sd as storage,eT as storageNodeJS,et as throwError,nD as toast,nO as useApolloError,n$ as useLoading,st as useNextIntl,sf as useStorage,nF as useTranslateI18next,sr as useTranslateNextIntl,rU as validate,F as vitestE2E,tN as vitestUnit,sn as withNextIntl,eu as writeFileSync};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(r){if(Array.isArray(r))return e(r)}function t(e,r,t,n,o,a,l){try{var u=e[a](l);var i=u.value}catch(e){t(e);return}if(u.done){r(i)}else{Promise.resolve(i).then(n,o)}}function n(e){return function(){var r=this,n=arguments;return new Promise(function(o,a){var l=e.apply(r,n);function u(e){t(l,o,a,u,i,"next",e)}function i(e){t(l,o,a,u,i,"throw",e)}u(undefined)})}}function o(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}n.forEach(function(r){o(e,r,t[r])})}return e}function i(e){return r(e)||a(e)||f(e)||l()}function c(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function f(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}function s(e,r){var t,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},l=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return l.next=u(0),l["throw"]=u(1),l["return"]=u(2),typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function u(e){return function(r){return i([e,r])}}function i(u){if(t)throw new TypeError("Generator is already executing.");while(l&&(l=0,u[0]&&(a=0)),a)try{if(t=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=r.call(e,a)}catch(e){u=[6,e];n=0}finally{t=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var d=Object.create;var
|
|
1
|
+
"use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(r){if(Array.isArray(r))return e(r)}function t(e,r,t,n,o,a,l){try{var u=e[a](l);var i=u.value}catch(e){t(e);return}if(u.done){r(i)}else{Promise.resolve(i).then(n,o)}}function n(e){return function(){var r=this,n=arguments;return new Promise(function(o,a){var l=e.apply(r,n);function u(e){t(l,o,a,u,i,"next",e)}function i(e){t(l,o,a,u,i,"throw",e)}u(undefined)})}}function o(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}n.forEach(function(r){o(e,r,t[r])})}return e}function i(e){return r(e)||a(e)||f(e)||l()}function c(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function f(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}function s(e,r){var t,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},l=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return l.next=u(0),l["throw"]=u(1),l["return"]=u(2),typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function u(e){return function(r){return i([e,r])}}function i(u){if(t)throw new TypeError("Generator is already executing.");while(l&&(l=0,u[0]&&(a=0)),a)try{if(t=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=r.call(e,a)}catch(e){u=[6,e];n=0}finally{t=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var d=Object.create;var p=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var h=function(e,r){return p(e,"name",{value:r,configurable:!0})};var m=function(e,r){for(var t in r)p(e,t,{get:r[t],enumerable:!0})},w=function(e,r,t,n){var o=true,a=false,l=undefined;if(r&&(typeof r==="undefined"?"undefined":c(r))=="object"||typeof r=="function")try{var u=function(){var o=f.value;!g.call(e,o)&&o!==t&&p(e,o,{get:function(){return r[o]},enumerable:!(n=v(r,o))||n.enumerable})};for(var i=y(r)[Symbol.iterator](),f;!(o=(f=i.next()).done);o=true)u()}catch(e){a=true;l=e}finally{try{if(!o&&i.return!=null){i.return()}}finally{if(a){throw l}}}return e};var S=function(e,r,t){return t=e!=null?d(b(e)):{},w(r||!e||!e.__esModule?p(t,"default",{value:e,enumerable:!0}):t,e)},O=function(e){return w(p({},"__esModule",{value:!0}),e)};var P={};m(P,{createApolloServer:function(){return B},expressMiddleware:function(){return x.expressMiddleware}});module.exports=O(P);var j=require("@apollo/server"),x=require("@apollo/server/express4"),A=require("@apollo/server/plugin/drainHttpServer"),k=require("@apollo/server/plugin/landingPage/default");var q=S(require("chalk"),1),D=S(require("consola"),1),M=require("graphql");var E=S(require("process"),1),I=E.default.env.DEBUG==="true";I||(D.default.level=4);function L(e){var r=q.default[e];return typeof r=="function"?r:q.default.green}h(L,"chalkKeyword");var _={silent:D.default.silent,level:D.default.level,fatal:D.default.fatal,error:D.default.error,warn:D.default.warn,log:D.default.log,info:D.default.info,success:D.default.success,ready:D.default.ready,start:D.default.start,box:D.default.box,debug:D.default.debug,trace:D.default.trace,verbose:D.default.verbose,printBoxedLog:function e(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(r===null||r===void 0?void 0:r.length)){D.default.box(q.default.green(e));return}r.forEach(function(e){var r=e.file,n=e.position,o=e.rule,a=e.message;D.default.log("".concat(q.default.gray("File:")," ").concat(q.default.blue("".concat(r).concat(n?":".concat(n):"")))),o&&D.default.log(" ".concat(L(t)("Rule:")," ").concat(o)),D.default.log(" ".concat(L(t)("Message:")," ").concat(a))}),D.default.box(L(t)("".concat(e," : ").concat(r.length))),D.default.log(q.default.gray("─".repeat(40)))}};function B(e){return new j.ApolloServer(u({schema:e.schema,plugins:[e.isDev?(0,k.ApolloServerPluginLandingPageLocalDefault)():(0,k.ApolloServerPluginLandingPageProductionDefault)(),(0,A.ApolloServerPluginDrainHttpServer)({httpServer:e.server})].concat(i(e.drainServer?[{serverWillStart:function r(){return n(function(){return s(this,function(r){return[2,{drainServer:function r(){return n(function(){var r;return s(this,function(t){(r=e.drainServer)===null||r===void 0?void 0:r.call(e),_.info("Apollo Server drainServer hook called");return[2]})})()}}]})})()}}]:[]))},e.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}))}h(B,"createApolloServer");0&&(module.exports={createApolloServer:createApolloServer,expressMiddleware:expressMiddleware});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function r(r,e){if(e==null||e>r.length)e=r.length;for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function e(e){if(Array.isArray(e))return r(e)}function t(r,e,t,n,o,a,i){try{var l=r[a](i);var c=l.value}catch(r){t(r);return}if(l.done){e(c)}else{Promise.resolve(c).then(n,o)}}function n(r){return function(){var e=this,n=arguments;return new Promise(function(o,a){var i=r.apply(e,n);function l(r){t(i,o,a,l,c,"next",r)}function c(r){t(i,o,a,l,c,"throw",r)}l(undefined)})}}function o(r,e,t){if(e in r){Object.defineProperty(r,e,{value:t,enumerable:true,configurable:true,writable:true})}else{r[e]=t}return r}function a(r){if(typeof Symbol!=="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function i(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))}n.forEach(function(e){o(r,e,t[e])})}return r}function c(r){return e(r)||a(r)||u(r)||i()}function u(e,t){if(!e)return;if(typeof e==="string")return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}function f(r,e){var t,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=l(0),i["throw"]=l(1),i["return"]=l(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function l(r){return function(e){return c([r,e])}}function c(l){if(t)throw new TypeError("Generator is already executing.");while(i&&(i=0,l[0]&&(a=0)),a)try{if(t=1,n&&(o=l[0]&2?n["return"]:l[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;if(n=0,o)l=[l[0]&2,o.value];switch(l[0]){case 0:case 1:o=l;break;case 4:a.label++;return{value:l[1],done:false};case 5:a.label++;n=l[1];l=[0];continue;case 7:l=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){a=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(l[0]===6&&a.label<o[1]){a.label=o[1];o=l;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(l);break}if(o[2])a.ops.pop();a.trys.pop();continue}l=e.call(r,a)}catch(r){l=[6,r];n=0}finally{t=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}}var s=Object.defineProperty;var p=function(r,e){return s(r,"name",{value:e,configurable:!0})};import{ApolloServer as v}from"@apollo/server";import{
|
|
1
|
+
function r(r,e){if(e==null||e>r.length)e=r.length;for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function e(e){if(Array.isArray(e))return r(e)}function t(r,e,t,n,o,a,i){try{var l=r[a](i);var c=l.value}catch(r){t(r);return}if(l.done){e(c)}else{Promise.resolve(c).then(n,o)}}function n(r){return function(){var e=this,n=arguments;return new Promise(function(o,a){var i=r.apply(e,n);function l(r){t(i,o,a,l,c,"next",r)}function c(r){t(i,o,a,l,c,"throw",r)}l(undefined)})}}function o(r,e,t){if(e in r){Object.defineProperty(r,e,{value:t,enumerable:true,configurable:true,writable:true})}else{r[e]=t}return r}function a(r){if(typeof Symbol!=="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function i(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))}n.forEach(function(e){o(r,e,t[e])})}return r}function c(r){return e(r)||a(r)||u(r)||i()}function u(e,t){if(!e)return;if(typeof e==="string")return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}function f(r,e){var t,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=l(0),i["throw"]=l(1),i["return"]=l(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function l(r){return function(e){return c([r,e])}}function c(l){if(t)throw new TypeError("Generator is already executing.");while(i&&(i=0,l[0]&&(a=0)),a)try{if(t=1,n&&(o=l[0]&2?n["return"]:l[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;if(n=0,o)l=[l[0]&2,o.value];switch(l[0]){case 0:case 1:o=l;break;case 4:a.label++;return{value:l[1],done:false};case 5:a.label++;n=l[1];l=[0];continue;case 7:l=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){a=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(l[0]===6&&a.label<o[1]){a.label=o[1];o=l;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(l);break}if(o[2])a.ops.pop();a.trys.pop();continue}l=e.call(r,a)}catch(r){l=[6,r];n=0}finally{t=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}}var s=Object.defineProperty;var p=function(r,e){return s(r,"name",{value:e,configurable:!0})};import{ApolloServer as v}from"@apollo/server";import{expressMiddleware as b}from"@apollo/server/express4";import{ApolloServerPluginDrainHttpServer as d}from"@apollo/server/plugin/drainHttpServer";import{ApolloServerPluginLandingPageLocalDefault as g,ApolloServerPluginLandingPageProductionDefault as y}from"@apollo/server/plugin/landingPage/default";import m from"chalk";import h from"consola";import{GraphQLError as S}from"graphql";import w from"node:process";var A=w.env.DEBUG==="true";A||(h.level=4);function P(r){var e=m[r];return typeof e=="function"?e:m.green}p(P,"chalkKeyword");var x={silent:h.silent,level:h.level,fatal:h.fatal,error:h.error,warn:h.warn,log:h.log,info:h.info,success:h.success,ready:h.ready,start:h.start,box:h.box,debug:h.debug,trace:h.trace,verbose:h.verbose,printBoxedLog:function r(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(e===null||e===void 0?void 0:e.length)){h.box(m.green(r));return}e.forEach(function(r){var e=r.file,n=r.position,o=r.rule,a=r.message;h.log("".concat(m.gray("File:")," ").concat(m.blue("".concat(e).concat(n?":".concat(n):"")))),o&&h.log(" ".concat(P(t)("Rule:")," ").concat(o)),h.log(" ".concat(P(t)("Message:")," ").concat(a))}),h.box(P(t)("".concat(r," : ").concat(e.length))),h.log(m.gray("─".repeat(40)))}};function O(r){return new v(l({schema:r.schema,plugins:[r.isDev?g():y(),d({httpServer:r.server})].concat(c(r.drainServer?[{serverWillStart:function e(){return n(function(){return f(this,function(e){return[2,{drainServer:function e(){return n(function(){var e;return f(this,function(t){(e=r.drainServer)===null||e===void 0?void 0:e.call(r),x.info("Apollo Server drainServer hook called");return[2]})})()}}]})})()}}]:[]))},r.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}))}p(O,"createApolloServer");export{O as createApolloServer,b as expressMiddleware};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(r){if(Array.isArray(r))return e(r)}function t(e,r,t,n,o,a,l){try{var u=e[a](l);var i=u.value}catch(e){t(e);return}if(u.done){r(i)}else{Promise.resolve(i).then(n,o)}}function n(e){return function(){var r=this,n=arguments;return new Promise(function(o,a){var l=e.apply(r,n);function u(e){t(l,o,a,u,i,"next",e)}function i(e){t(l,o,a,u,i,"throw",e)}u(undefined)})}}function o(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}n.forEach(function(r){o(e,r,t[r])})}return e}function i(e){return r(e)||a(e)||f(e)||l()}function c(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function f(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}function s(e,r){var t,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},l=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return l.next=u(0),l["throw"]=u(1),l["return"]=u(2),typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function u(e){return function(r){return i([e,r])}}function i(u){if(t)throw new TypeError("Generator is already executing.");while(l&&(l=0,u[0]&&(a=0)),a)try{if(t=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=r.call(e,a)}catch(e){u=[6,e];n=0}finally{t=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var d=Object.create;var
|
|
1
|
+
"use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(r){if(Array.isArray(r))return e(r)}function t(e,r,t,n,o,a,l){try{var u=e[a](l);var i=u.value}catch(e){t(e);return}if(u.done){r(i)}else{Promise.resolve(i).then(n,o)}}function n(e){return function(){var r=this,n=arguments;return new Promise(function(o,a){var l=e.apply(r,n);function u(e){t(l,o,a,u,i,"next",e)}function i(e){t(l,o,a,u,i,"throw",e)}u(undefined)})}}function o(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}n.forEach(function(r){o(e,r,t[r])})}return e}function i(e){return r(e)||a(e)||f(e)||l()}function c(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function f(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}function s(e,r){var t,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},l=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return l.next=u(0),l["throw"]=u(1),l["return"]=u(2),typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function u(e){return function(r){return i([e,r])}}function i(u){if(t)throw new TypeError("Generator is already executing.");while(l&&(l=0,u[0]&&(a=0)),a)try{if(t=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=r.call(e,a)}catch(e){u=[6,e];n=0}finally{t=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var d=Object.create;var p=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var h=function(e,r){return p(e,"name",{value:r,configurable:!0})};var m=function(e,r){for(var t in r)p(e,t,{get:r[t],enumerable:!0})},w=function(e,r,t,n){var o=true,a=false,l=undefined;if(r&&(typeof r==="undefined"?"undefined":c(r))=="object"||typeof r=="function")try{var u=function(){var o=f.value;!g.call(e,o)&&o!==t&&p(e,o,{get:function(){return r[o]},enumerable:!(n=v(r,o))||n.enumerable})};for(var i=y(r)[Symbol.iterator](),f;!(o=(f=i.next()).done);o=true)u()}catch(e){a=true;l=e}finally{try{if(!o&&i.return!=null){i.return()}}finally{if(a){throw l}}}return e};var S=function(e,r,t){return t=e!=null?d(b(e)):{},w(r||!e||!e.__esModule?p(t,"default",{value:e,enumerable:!0}):t,e)},O=function(e){return w(p({},"__esModule",{value:!0}),e)};var P={};m(P,{createApolloServer:function(){return B},expressMiddleware:function(){return x.expressMiddleware}});module.exports=O(P);var j=require("@apollo/server"),x=require("@apollo/server/express4"),A=require("@apollo/server/plugin/drainHttpServer"),k=require("@apollo/server/plugin/landingPage/default");var q=S(require("chalk"),1),D=S(require("consola"),1),M=require("graphql");var E=S(require("process"),1),I=E.default.env.DEBUG==="true";I||(D.default.level=4);function L(e){var r=q.default[e];return typeof r=="function"?r:q.default.green}h(L,"chalkKeyword");var _={silent:D.default.silent,level:D.default.level,fatal:D.default.fatal,error:D.default.error,warn:D.default.warn,log:D.default.log,info:D.default.info,success:D.default.success,ready:D.default.ready,start:D.default.start,box:D.default.box,debug:D.default.debug,trace:D.default.trace,verbose:D.default.verbose,printBoxedLog:function e(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(r===null||r===void 0?void 0:r.length)){D.default.box(q.default.green(e));return}r.forEach(function(e){var r=e.file,n=e.position,o=e.rule,a=e.message;D.default.log("".concat(q.default.gray("File:")," ").concat(q.default.blue("".concat(r).concat(n?":".concat(n):"")))),o&&D.default.log(" ".concat(L(t)("Rule:")," ").concat(o)),D.default.log(" ".concat(L(t)("Message:")," ").concat(a))}),D.default.box(L(t)("".concat(e," : ").concat(r.length))),D.default.log(q.default.gray("─".repeat(40)))}};function B(e){return new j.ApolloServer(u({schema:e.schema,plugins:[e.isDev?(0,k.ApolloServerPluginLandingPageLocalDefault)():(0,k.ApolloServerPluginLandingPageProductionDefault)(),(0,A.ApolloServerPluginDrainHttpServer)({httpServer:e.server})].concat(i(e.drainServer?[{serverWillStart:function r(){return n(function(){return s(this,function(r){return[2,{drainServer:function r(){return n(function(){var r;return s(this,function(t){(r=e.drainServer)===null||r===void 0?void 0:r.call(e),_.info("Apollo Server drainServer hook called");return[2]})})()}}]})})()}}]:[]))},e.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}))}h(B,"createApolloServer");0&&(module.exports={createApolloServer:createApolloServer,expressMiddleware:expressMiddleware});
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { I_ApolloServerOptions_alias_3 as I_ApolloServerOptions } from '../../_tsup-dts-rollup.cjs';
|
|
2
2
|
export { createApolloServer_alias_3 as createApolloServer } from '../../_tsup-dts-rollup.cjs';
|
|
3
|
+
export { expressMiddleware_alias_3 as expressMiddleware } from '../../_tsup-dts-rollup.cjs';
|