/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/checkpoint-client@1.1.33/dist/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var path$2=require("path"),os$1=require("os"),require$$0=require("fs"),require$$2=require("util"),fs$1=require("fs/promises"),crypto=require("crypto"),child_process=require("child_process");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var path__default=_interopDefaultLegacy(path$2),os__default=_interopDefaultLegacy(os$1),require$$0__default=_interopDefaultLegacy(require$$0),require$$2__default=_interopDefaultLegacy(require$$2),fs__default=_interopDefaultLegacy(fs$1),crypto__default=_interopDefaultLegacy(crypto);const rnds8Pool=new Uint8Array(256);let poolPtr=rnds8Pool.length;function rng(){return poolPtr>rnds8Pool.length-16&&(crypto__default.default.randomFillSync(rnds8Pool),poolPtr=0),rnds8Pool.slice(poolPtr,poolPtr+=16)}const byteToHex=[];for(let e=0;e<256;++e)byteToHex.push((e+256).toString(16).slice(1));function unsafeStringify(e,t=0){return byteToHex[e[t+0]]+byteToHex[e[t+1]]+byteToHex[e[t+2]]+byteToHex[e[t+3]]+"-"+byteToHex[e[t+4]]+byteToHex[e[t+5]]+"-"+byteToHex[e[t+6]]+byteToHex[e[t+7]]+"-"+byteToHex[e[t+8]]+byteToHex[e[t+9]]+"-"+byteToHex[e[t+10]]+byteToHex[e[t+11]]+byteToHex[e[t+12]]+byteToHex[e[t+13]]+byteToHex[e[t+14]]+byteToHex[e[t+15]]}var native={randomUUID:crypto__default.default.randomUUID};function v4(e,t,r){if(native.randomUUID&&!t&&!e)return native.randomUUID();const s=(e=e||{}).random||(e.rng||rng)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=s[e];return t}return unsafeStringify(s)}var envPaths$1={exports:{}};const path$1=path__default.default,os=os__default.default,homedir=os.homedir(),tmpdir=os.tmpdir(),{env:env}=process,macos=e=>{const t=path$1.join(homedir,"Library");return{data:path$1.join(t,"Application Support",e),config:path$1.join(t,"Preferences",e),cache:path$1.join(t,"Caches",e),log:path$1.join(t,"Logs",e),temp:path$1.join(tmpdir,e)}},windows=e=>{const t=env.APPDATA||path$1.join(homedir,"AppData","Roaming"),r=env.LOCALAPPDATA||path$1.join(homedir,"AppData","Local");return{data:path$1.join(r,e,"Data"),config:path$1.join(t,e,"Config"),cache:path$1.join(r,e,"Cache"),log:path$1.join(r,e,"Log"),temp:path$1.join(tmpdir,e)}},linux=e=>{const t=path$1.basename(homedir);return{data:path$1.join(env.XDG_DATA_HOME||path$1.join(homedir,".local","share"),e),config:path$1.join(env.XDG_CONFIG_HOME||path$1.join(homedir,".config"),e),cache:path$1.join(env.XDG_CACHE_HOME||path$1.join(homedir,".cache"),e),log:path$1.join(env.XDG_STATE_HOME||path$1.join(homedir,".local","state"),e),temp:path$1.join(tmpdir,t,e)}},envPaths=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected string, got "+typeof e);return(t=Object.assign({suffix:"nodejs"},t)).suffix&&(e+=`-${t.suffix}`),"darwin"===process.platform?macos(e):"win32"===process.platform?windows(e):linux(e)};envPaths$1.exports=envPaths,envPaths$1.exports.default=envPaths;var paths=envPaths$1.exports,makeDir$2={exports:{}};const debug$1="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var debug_1=debug$1;const SEMVER_SPEC_VERSION="2.0.0",MAX_LENGTH$1=256,MAX_SAFE_INTEGER$1=Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH=16,MAX_SAFE_BUILD_LENGTH=MAX_LENGTH$1-6,RELEASE_TYPES=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var constants={MAX_LENGTH:MAX_LENGTH$1,MAX_SAFE_COMPONENT_LENGTH:MAX_SAFE_COMPONENT_LENGTH,MAX_SAFE_BUILD_LENGTH:MAX_SAFE_BUILD_LENGTH,MAX_SAFE_INTEGER:MAX_SAFE_INTEGER$1,RELEASE_TYPES:RELEASE_TYPES,SEMVER_SPEC_VERSION:SEMVER_SPEC_VERSION,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},re$1={exports:{}};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:s}=constants,i=debug_1,a=(t=e.exports={}).re=[],n=t.safeRe=[],o=t.src=[],c=t.t={};let h=0;const p="[a-zA-Z0-9-]",E=[["\\s",1],["\\d",r],[p,s]],l=(e,t,r)=>{const s=(e=>{for(const[t,r]of E)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),p=h++;i(e,p,t),c[e]=p,o[p]=t,a[p]=new RegExp(t,r?"g":void 0),n[p]=new RegExp(s,r?"g":void 0)};l("NUMERICIDENTIFIER","0|[1-9]\\d*"),l("NUMERICIDENTIFIERLOOSE","\\d+"),l("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${p}*`),l("MAINVERSION",`(${o[c.NUMERICIDENTIFIER]})\\.(${o[c.NUMERICIDENTIFIER]})\\.(${o[c.NUMERICIDENTIFIER]})`),l("MAINVERSIONLOOSE",`(${o[c.NUMERICIDENTIFIERLOOSE]})\\.(${o[c.NUMERICIDENTIFIERLOOSE]})\\.(${o[c.NUMERICIDENTIFIERLOOSE]})`),l("PRERELEASEIDENTIFIER",`(?:${o[c.NUMERICIDENTIFIER]}|${o[c.NONNUMERICIDENTIFIER]})`),l("PRERELEASEIDENTIFIERLOOSE",`(?:${o[c.NUMERICIDENTIFIERLOOSE]}|${o[c.NONNUMERICIDENTIFIER]})`),l("PRERELEASE",`(?:-(${o[c.PRERELEASEIDENTIFIER]}(?:\\.${o[c.PRERELEASEIDENTIFIER]})*))`),l("PRERELEASELOOSE",`(?:-?(${o[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${o[c.PRERELEASEIDENTIFIERLOOSE]})*))`),l("BUILDIDENTIFIER",`${p}+`),l("BUILD",`(?:\\+(${o[c.BUILDIDENTIFIER]}(?:\\.${o[c.BUILDIDENTIFIER]})*))`),l("FULLPLAIN",`v?${o[c.MAINVERSION]}${o[c.PRERELEASE]}?${o[c.BUILD]}?`),l("FULL",`^${o[c.FULLPLAIN]}$`),l("LOOSEPLAIN",`[v=\\s]*${o[c.MAINVERSIONLOOSE]}${o[c.PRERELEASELOOSE]}?${o[c.BUILD]}?`),l("LOOSE",`^${o[c.LOOSEPLAIN]}$`),l("GTLT","((?:<|>)?=?)"),l("XRANGEIDENTIFIERLOOSE",`${o[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),l("XRANGEIDENTIFIER",`${o[c.NUMERICIDENTIFIER]}|x|X|\\*`),l("XRANGEPLAIN",`[v=\\s]*(${o[c.XRANGEIDENTIFIER]})(?:\\.(${o[c.XRANGEIDENTIFIER]})(?:\\.(${o[c.XRANGEIDENTIFIER]})(?:${o[c.PRERELEASE]})?${o[c.BUILD]}?)?)?`),l("XRANGEPLAINLOOSE",`[v=\\s]*(${o[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[c.XRANGEIDENTIFIERLOOSE]})(?:${o[c.PRERELEASELOOSE]})?${o[c.BUILD]}?)?)?`),l("XRANGE",`^${o[c.GTLT]}\\s*${o[c.XRANGEPLAIN]}$`),l("XRANGELOOSE",`^${o[c.GTLT]}\\s*${o[c.XRANGEPLAINLOOSE]}$`),l("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),l("COERCERTL",o[c.COERCE],!0),l("LONETILDE","(?:~>?)"),l("TILDETRIM",`(\\s*)${o[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",l("TILDE",`^${o[c.LONETILDE]}${o[c.XRANGEPLAIN]}$`),l("TILDELOOSE",`^${o[c.LONETILDE]}${o[c.XRANGEPLAINLOOSE]}$`),l("LONECARET","(?:\\^)"),l("CARETTRIM",`(\\s*)${o[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",l("CARET",`^${o[c.LONECARET]}${o[c.XRANGEPLAIN]}$`),l("CARETLOOSE",`^${o[c.LONECARET]}${o[c.XRANGEPLAINLOOSE]}$`),l("COMPARATORLOOSE",`^${o[c.GTLT]}\\s*(${o[c.LOOSEPLAIN]})$|^$`),l("COMPARATOR",`^${o[c.GTLT]}\\s*(${o[c.FULLPLAIN]})$|^$`),l("COMPARATORTRIM",`(\\s*)${o[c.GTLT]}\\s*(${o[c.LOOSEPLAIN]}|${o[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",l("HYPHENRANGE",`^\\s*(${o[c.XRANGEPLAIN]})\\s+-\\s+(${o[c.XRANGEPLAIN]})\\s*$`),l("HYPHENRANGELOOSE",`^\\s*(${o[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${o[c.XRANGEPLAINLOOSE]})\\s*$`),l("STAR","(<|>)?=?\\s*\\*"),l("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),l("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(re$1,re$1.exports);const looseOption=Object.freeze({loose:!0}),emptyOpts=Object.freeze({}),parseOptions$1=e=>e?"object"!=typeof e?looseOption:e:emptyOpts;var parseOptions_1=parseOptions$1;const numeric=/^[0-9]+$/,compareIdentifiers$1=(e,t)=>{const r=numeric.test(e),s=numeric.test(t);return r&&s&&(e=+e,t=+t),e===t?0:r&&!s?-1:s&&!r?1:e<t?-1:1},rcompareIdentifiers=(e,t)=>compareIdentifiers$1(t,e);var identifiers={compareIdentifiers:compareIdentifiers$1,rcompareIdentifiers:rcompareIdentifiers};const debug=debug_1,{MAX_LENGTH:MAX_LENGTH,MAX_SAFE_INTEGER:MAX_SAFE_INTEGER}=constants,{safeRe:re,t:t}=re$1.exports,parseOptions=parseOptions_1,{compareIdentifiers:compareIdentifiers}=identifiers;class SemVer$1{constructor(e,r){if(r=parseOptions(r),e instanceof SemVer$1){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>MAX_LENGTH)throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);debug("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const s=e.trim().match(r.loose?re[t.LOOSE]:re[t.FULL]);if(!s)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>MAX_SAFE_INTEGER||this.major<0)throw new TypeError("Invalid major version");if(this.minor>MAX_SAFE_INTEGER||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>MAX_SAFE_INTEGER||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<MAX_SAFE_INTEGER)return t}return e})):this.prerelease=[],this.build=s[5]?s[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(debug("SemVer.compare",this.version,this.options,e),!(e instanceof SemVer$1)){if("string"==typeof e&&e===this.version)return 0;e=new SemVer$1(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof SemVer$1||(e=new SemVer$1(e,this.options)),compareIdentifiers(this.major,e.major)||compareIdentifiers(this.minor,e.minor)||compareIdentifiers(this.patch,e.patch)}comparePre(e){if(e instanceof SemVer$1||(e=new SemVer$1(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],s=e.prerelease[t];if(debug("prerelease compare",t,r,s),void 0===r&&void 0===s)return 0;if(void 0===s)return 1;if(void 0===r)return-1;if(r!==s)return compareIdentifiers(r,s)}while(++t)}compareBuild(e){e instanceof SemVer$1||(e=new SemVer$1(e,this.options));let t=0;do{const r=this.build[t],s=e.build[t];if(debug("prerelease compare",t,r,s),void 0===r&&void 0===s)return 0;if(void 0===s)return 1;if(void 0===r)return-1;if(r!==s)return compareIdentifiers(r,s)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let s=this.prerelease.length;for(;--s>=0;)"number"==typeof this.prerelease[s]&&(this.prerelease[s]++,s=-2);if(-1===s){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let s=[t,e];!1===r&&(s=[t]),0===compareIdentifiers(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}var semver=SemVer$1;const SemVer=semver,compare$1=(e,t,r)=>new SemVer(e,r).compare(new SemVer(t,r));var compare_1=compare$1;const compare=compare_1,gte=(e,t,r)=>compare(e,t,r)>=0;var gte_1=gte;const fs=require$$0__default.default,path=path__default.default,{promisify:promisify}=require$$2__default.default,semverGte=gte_1,useNativeRecursiveOption=semverGte(process.version,"10.12.0"),checkPath=e=>{if("win32"===process.platform){if(/[<>:"|?*]/.test(e.replace(path.parse(e).root,""))){const t=new Error(`Path contains invalid characters: ${e}`);throw t.code="EINVAL",t}}},processOptions=e=>({...{mode:511,fs:fs},...e}),permissionError=e=>{const t=new Error(`operation not permitted, mkdir '${e}'`);return t.code="EPERM",t.errno=-4048,t.path=e,t.syscall="mkdir",t},makeDir=async(e,t)=>{checkPath(e),t=processOptions(t);const r=promisify(t.fs.mkdir),s=promisify(t.fs.stat);if(useNativeRecursiveOption&&t.fs.mkdir===fs.mkdir){const s=path.resolve(e);return await r(s,{mode:t.mode,recursive:!0}),s}const i=async e=>{try{return await r(e,t.mode),e}catch(t){if("EPERM"===t.code)throw t;if("ENOENT"===t.code){if(path.dirname(e)===e)throw permissionError(e);if(t.message.includes("null bytes"))throw t;return await i(path.dirname(e)),i(e)}try{if(!(await s(e)).isDirectory())throw new Error("The path is not a directory")}catch{throw t}return e}};return i(path.resolve(e))};makeDir$2.exports=makeDir,makeDir$2.exports.sync=(e,t)=>{if(checkPath(e),t=processOptions(t),useNativeRecursiveOption&&t.fs.mkdirSync===fs.mkdirSync){const r=path.resolve(e);return fs.mkdirSync(r,{mode:t.mode,recursive:!0}),r}const r=e=>{try{t.fs.mkdirSync(e,t.mode)}catch(s){if("EPERM"===s.code)throw s;if("ENOENT"===s.code){if(path.dirname(e)===e)throw permissionError(e);if(s.message.includes("null bytes"))throw s;return r(path.dirname(e)),r(e)}try{if(!t.fs.statSync(e).isDirectory())throw new Error("The path is not a directory")}catch{throw s}}return e};return r(path.resolve(e))};var makeDir$1=makeDir$2.exports;const PRISMA_SIGNATURE="signature";async function getSignature(e){const t=paths("checkpoint");e=e||path__default.default.join(t.cache,PRISMA_SIGNATURE);const r=await readSignature(e);return r||await createSignatureFile(e)}function isSignatureValid(e){return"string"==typeof e&&36===e.length}async function readSignature(e){try{const t=await fs__default.default.readFile(e,"utf8"),{signature:r}=JSON.parse(t);return isSignatureValid(r)?r:""}catch(e){return""}}async function createSignatureFile(e,t){const r={signature:t||v4()};return await makeDir$1(path__default.default.dirname(e)),await fs__default.default.writeFile(e,JSON.stringify(r,null,"  ")),r.signature}async function getInfo(){const e=paths("checkpoint").cache;require$$0.existsSync(e)||await fs__default.default.mkdir(e,{recursive:!0});const t=await fs__default.default.readdir(e),r=[];for(const s of t)if(s.includes("-"))try{const t=JSON.parse(await fs__default.default.readFile(path__default.default.join(e,s),{encoding:"utf-8"}));t.output&&!t.output.cli_path_hash&&(t.output.cli_path_hash=s.split("-")[1]),r.push(t)}catch(e){console.error(e)}return{signature:await getSignature(),cachePath:e,cacheItems:r}}const defaultSchema={last_reminder:0,cached_at:0,version:"",cli_path:"",output:{client_event_id:"",previous_client_event_id:"",product:"",cli_path_hash:"",local_timestamp:"",previous_version:"",current_version:"",current_release_date:0,current_download_url:"",current_changelog_url:"",package:"",release_tag:"",install_command:"",project_website:"",outdated:!1,alerts:[]}};class Config{static async new(e,t=defaultSchema){return await makeDir$1(path__default.default.dirname(e.cache_file)),new Config(e,t)}constructor(e,t){this.state=e,this.defaultSchema=t}async checkCache(e){const t=e.now(),r=await this.all();return r?e.version!==r.version||t-r.cached_at>e.cache_duration?{cache:r,stale:!0}:{cache:r,stale:!1}:{cache:void 0,stale:!0}}async set(e){const t=await this.all()||{},r=Object.assign(t,e);for(let e in this.defaultSchema)void 0===r[e]&&(r[e]=this.defaultSchema[e]);await fs__default.default.writeFile(this.state.cache_file,JSON.stringify(r,null,"  "))}async all(){try{const e=await fs__default.default.readFile(this.state.cache_file,"utf8");return JSON.parse(e)}catch(e){return}}async get(e){const t=await this.all();if(void 0!==t)return t[e]}async reset(){await fs__default.default.writeFile(this.state.cache_file,JSON.stringify(this.defaultSchema,null,"  "))}async delete(){try{return void await fs__default.default.unlink(this.state.cache_file)}catch(e){return}}}var s=1e3,m=60*s,h=60*m,d=24*h,w=7*d,y=365.25*d,ms=function(e,t){t=t||{};var r=typeof e;if("string"===r&&e.length>0)return parse(e);if("number"===r&&isFinite(e))return t.long?fmtLong(e):fmtShort(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*y;case"weeks":case"week":case"w":return r*w;case"days":case"day":case"d":return r*d;case"hours":case"hour":case"hrs":case"hr":case"h":return r*h;case"minutes":case"minute":case"mins":case"min":case"m":return r*m;case"seconds":case"second":case"secs":case"sec":case"s":return r*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function fmtShort(e){var t=Math.abs(e);return t>=d?Math.round(e/d)+"d":t>=h?Math.round(e/h)+"h":t>=m?Math.round(e/m)+"m":t>=s?Math.round(e/s)+"s":e+"ms"}function fmtLong(e){var t=Math.abs(e);return t>=d?plural(e,t,d,"day"):t>=h?plural(e,t,h,"hour"):t>=m?plural(e,t,m,"minute"):t>=s?plural(e,t,s,"second"):e+" ms"}function plural(e,t,r,s){var i=t>=1.5*r;return Math.round(e/r)+" "+s+(i?"s":"")}const TELEMETRY_ENDPOINT_URL_PRODUCTION="https://checkpoint.prisma.io",childPath=path__default.default.join(eval("__dirname"),"child");async function check(e){const t=getCacheFile(e.product,e.cli_path_hash||"default"),r=require("ci-info"),s=e.endpoint||process.env.PRISMA_TELEMETRY_ENDPOINT||TELEMETRY_ENDPOINT_URL_PRODUCTION,i={product:e.product,version:e.version,cli_install_type:e.cli_install_type||"",information:e.information||"",local_timestamp:e.local_timestamp||rfc3339(new Date),project_hash:e.project_hash,cli_path:e.cli_path||"",cli_path_hash:e.cli_path_hash||"",endpoint:s,disable:void 0!==e.disable&&e.disable,arch:e.arch||os__default.default.arch(),os:e.os||os__default.default.platform(),node_version:e.node_version||process.version,ci:void 0!==e.ci?e.ci:r.isCI,ci_name:void 0!==e.ci_name?e.ci_name||"":r.name||"",command:e.command||"",schema_providers:e.schema_providers||[],schema_preview_features:e.schema_preview_features||[],schema_generators_providers:e.schema_generators_providers||[],cache_file:e.cache_file||t,cache_duration:void 0===e.cache_duration?ms("12h"):e.cache_duration,remind_duration:void 0===e.remind_duration?ms("48h"):e.remind_duration,force:void 0!==e.force&&e.force,timeout:getTimeout(e.timeout),unref:void 0===e.unref||e.unref,child_path:e.child_path||childPath,now:()=>Date.now(),client_event_id:e.client_event_id||"",previous_client_event_id:e.previous_client_event_id||"",check_if_update_available:!1};if((process.env.CHECKPOINT_DISABLE||i.disable)&&!i.force)return{status:"disabled"};const a=await Config.new(i),n=await a.checkCache(i);i.check_if_update_available=!0===n.stale||!n.cache;const o=spawn(i);if(i.unref&&(o.unref(),o.disconnect()),!0===n.stale||!n.cache)return{status:"waiting",data:o};for(const e of Object.keys(i))i[e]&&await a.set({[e]:i[e]});return i.now()-n.cache.last_reminder<i.remind_duration?{status:"reminded",data:n.cache.output}:(await a.set({last_reminder:i.now()}),{status:"ok",data:n.cache.output})}function getCacheFile(e,t){const r=paths("checkpoint");return path__default.default.join(r.cache,`${e}-${t}`)}function getTimeout(e){if(void 0!==e)return e;const t=process.env.CHECKPOINT_TIMEOUT;if(void 0===t)return 5e3;const r=parseInt(t,10);return isNaN(r)?5e3:r}function getForkOpts(e){return!0===e.unref?{detached:!0,stdio:process.env.CHECKPOINT_DEBUG_STDOUT?"inherit":"ignore",env:process.env}:{detached:!1,stdio:"pipe",env:process.env}}function spawn(e){return child_process.fork(childPath,[JSON.stringify(e)],getForkOpts(e))}function rfc3339(e){function t(e){return e<10?"0"+e:e}return e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+"T"+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+function(e){let r;return 0===e?"Z":(r=e>0?"-":"+",e=Math.abs(e),r+t(Math.floor(e/60))+":"+t(e%60))}(e.getTimezoneOffset())}exports.check=check,exports.getInfo=getInfo,exports.getSignature=getSignature;
//# sourceMappingURL=/sm/dc4aaf5f739728200baa7474c8c4c611cd7e08f692dfe7ceb5c4acb2dab3c213.map