{"version":3,"sources":["../../src/telemetry/storage.ts"],"names":["Telemetry","TELEMETRY_KEY_ENABLED","TELEMETRY_KEY_NOTIFY_DATE","TELEMETRY_KEY_ID","TELEMETRY_KEY_SALT","getStorageDirectory","distDir","isLikelyEphemeral","ciEnvironment","isCI","isDockerFunction","path","join","undefined","constructor","notify","isDisabled","conf","get","set","Date","now","toString","console","log","magenta","bold","cyan","setEnabled","_enabled","enabled","oneWayHash","payload","hash","createHash","update","salt","digest","record","_events","deferred","prom","Promise","resolve","isFulfilled","isRejected","value","submitRecord","then","catch","reason","res","queue","delete","Array","isArray","_controller","add","flush","all","flushDetached","mode","dir","allEvents","forEach","item","abort","push","_","fs","mkdirSync","recursive","writeFileSync","JSON","stringify","child_process","require","spawn","NEXT_TELEMETRY_DEBUG","spawnSync","process","execPath","detached","windowsHide","shell","stdio","events","length","eventName","error","context","anonymousId","projectId","getProjectId","sessionId","meta","getAnonymousMeta","postController","AbortController","_postPayload","map","fields","signal","NEXT_TELEMETRY_DISABLED","env","storageDirectory","Conf","projectName","cwd","randomBytes","Set","val","generated","isEnabled","loadProjectId","getRawProjectId"],"mappings":";;;;+BA4DaA;;;eAAAA;;;4BA3DuB;6DACnB;wBACuB;iEACX;6DACZ;+BAEgB;gEACF;6BACF;2BACG;0BACA;2DACjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEf,+EAA+E;AAC/E,MAAMC,wBAAwB;AAE9B,4EAA4E;AAC5E,wBAAwB;AACxB,MAAMC,4BAA4B;AAElC,8EAA8E;AAC9E,uDAAuD;AACvD,MAAMC,mBAAmB,CAAC,qBAAqB,CAAC;AAEhD,6EAA6E;AAC7E,+EAA+E;AAC/E,oEAAoE;AACpE,iCAAiC;AACjC,MAAMC,qBAAqB,CAAC,cAAc,CAAC;AAqB3C,SAASC,oBAAoBC,OAAe;IAC1C,MAAMC,oBAAoBC,QAAcC,IAAI,IAAIC,IAAAA,iBAAgB;IAEhE,IAAIH,mBAAm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