"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.commonState=exports.READY=void 0,exports.isTransferable=isTransferable,exports.isMovable=isMovable,exports.markMovable=markMovable,exports.createHistogramSummary=createHistogramSummary,exports.toHistogramIntegerNano=toHistogramIntegerNano,exports.maybeFileURLToPath=maybeFileURLToPath,exports.getAvailableParallelism=getAvailableParallelism;const node_url_1=require("node:url"),node_os_1=require("node:os"),symbols_1=require("./symbols");function isTransferable(e){return null!=e&&"object"==typeof e&&symbols_1.kTransferable in e&&symbols_1.kValue in e}function isMovable(e){return isTransferable(e)&&!0===e[symbols_1.kMovable]}function markMovable(e){Object.defineProperty(e,symbols_1.kMovable,{enumerable:!1,configurable:!0,writable:!0,value:!0})}function createHistogramSummary(e){const{mean:r,stddev:t,min:a,max:o}=e;return{average:r/1e3,mean:r/1e3,stddev:t,min:a/1e3,max:o/1e3,p0_001:e.percentile(.001)/1e3,p0_01:e.percentile(.01)/1e3,p0_1:e.percentile(.1)/1e3,p1:e.percentile(1)/1e3,p2_5:e.percentile(2.5)/1e3,p10:e.percentile(10)/1e3,p25:e.percentile(25)/1e3,p50:e.percentile(50)/1e3,p75:e.percentile(75)/1e3,p90:e.percentile(90)/1e3,p97_5:e.percentile(97.5)/1e3,p99:e.percentile(99)/1e3,p99_9:e.percentile(99.9)/1e3,p99_99:e.percentile(99.99)/1e3,p99_999:e.percentile(99.999)/1e3}}function toHistogramIntegerNano(e){return Math.max(1,Math.trunc(1e3*e))}function maybeFileURLToPath(e){return e.startsWith("file:")?(0,node_url_1.fileURLToPath)(new node_url_1.URL(e)):e}function getAvailableParallelism(){if("function"==typeof node_os_1.availableParallelism)return(0,node_os_1.availableParallelism)();try{return(0,node_os_1.cpus)().length}catch{return 1}}exports.READY="_WORKER_READY",exports.commonState={isWorkerThread:!1,workerData:void 0};