@easyeyes_threshold/runtime 1.20260909.84286

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"easyeyes_wasm.js","sources":["../@rust/pkg/easyeyes_wasm.js"],"sourcesContent":["let wasm;\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (\n cachedUint8ArrayMemory0 === null ||\n cachedUint8ArrayMemory0.byteLength === 0\n ) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nlet cachedTextDecoder = new TextDecoder(\"utf-8\", {\n ignoreBOM: true,\n fatal: true,\n});\n\ncachedTextDecoder.decode();\n\nconst MAX_SAFARI_DECODE_BYTES = 2146435072;\nlet numBytesDecoded = 0;\nfunction decodeText(ptr, len) {\n numBytesDecoded += len;\n if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {\n cachedTextDecoder = new TextDecoder(\"utf-8\", {\n ignoreBOM: true,\n fatal: true,\n });\n cachedTextDecoder.decode();\n numBytesDecoded = len;\n }\n return cachedTextDecoder.decode(\n getUint8ArrayMemory0().subarray(ptr, ptr + len),\n );\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return decodeText(ptr, len);\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nfunction passArray8ToWasm0(arg, malloc) {\n const ptr = malloc(arg.length * 1, 1) >>> 0;\n getUint8ArrayMemory0().set(arg, ptr / 1);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n}\n\nfunction takeFromExternrefTable0(idx) {\n const value = wasm.__wbindgen_externrefs.get(idx);\n wasm.__externref_table_dealloc(idx);\n return value;\n}\n/**\n * Get variable font axes information as JSON.\n * Returns JSON with isVariable flag and axis details (tag, min, max, default).\n * Used by the compiler to validate fontVariableSettings at compile time.\n * @param {Uint8Array} font_data\n * @returns {string}\n */\nexport function get_font_variable_axes(font_data) {\n let deferred3_0;\n let deferred3_1;\n try {\n const ptr0 = passArray8ToWasm0(font_data, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.get_font_variable_axes(ptr0, len0);\n var ptr2 = ret[0];\n var len2 = ret[1];\n if (ret[3]) {\n ptr2 = 0;\n len2 = 0;\n throw takeFromExternrefTable0(ret[2]);\n }\n deferred3_0 = ptr2;\n deferred3_1 = len2;\n return getStringFromWasm0(ptr2, len2);\n } finally {\n wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);\n }\n}\n\nconst cachedTextEncoder = new TextEncoder();\n\nif (!(\"encodeInto\" in cachedTextEncoder)) {\n cachedTextEncoder.encodeInto = function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length,\n };\n };\n}\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0()\n .subarray(ptr, ptr + buf.length)\n .set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7f) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, (len = offset + arg.length * 3), 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = cachedTextEncoder.encodeInto(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nfunction getArrayU8FromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);\n}\n/**\n * Apply OpenType feature settings by injecting each enabled feature's GSUB\n * lookups into the calt feature. The Canvas 2D API has no font-feature-settings,\n * so this \"bakes\" the features into the font binary. Tags are validated up front\n * by the compiler. Disabling (value 0) clears the feature's lookup indices.\n * @param {Uint8Array} font_data\n * @param {string} feature_settings\n * @returns {Uint8Array}\n */\nexport function apply_feature_settings(font_data, feature_settings) {\n const ptr0 = passArray8ToWasm0(font_data, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(\n feature_settings,\n wasm.__wbindgen_malloc,\n wasm.__wbindgen_realloc,\n );\n const len1 = WASM_VECTOR_LEN;\n const ret = wasm.apply_feature_settings(ptr0, len0, ptr1, len1);\n if (ret[3]) {\n throw takeFromExternrefTable0(ret[2]);\n }\n var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();\n wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);\n return v3;\n}\n\n/**\n * @param {Uint8Array} font_data\n * @param {string} variable_settings\n * @returns {Uint8Array}\n */\nexport function generate_static_font_instance(font_data, variable_settings) {\n const ptr0 = passArray8ToWasm0(font_data, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(\n variable_settings,\n wasm.__wbindgen_malloc,\n wasm.__wbindgen_realloc,\n );\n const len1 = WASM_VECTOR_LEN;\n const ret = wasm.generate_static_font_instance(ptr0, len0, ptr1, len1);\n if (ret[3]) {\n throw takeFromExternrefTable0(ret[2]);\n }\n var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();\n wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);\n return v3;\n}\n\n/**\n * Process a font: apply variable-font instancing, then bake stylistic sets AND\n * feature settings into `calt` in a single GSUB rebuild (the lookups are\n * deduped, so overlapping features cost nothing extra).\n * @param {Uint8Array} font_data\n * @param {string} variable_settings\n * @param {string} stylistic_sets\n * @param {string} feature_settings\n * @returns {Uint8Array}\n */\nexport function process_font(\n font_data,\n variable_settings,\n stylistic_sets,\n feature_settings,\n) {\n const ptr0 = passArray8ToWasm0(font_data, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(\n variable_settings,\n wasm.__wbindgen_malloc,\n wasm.__wbindgen_realloc,\n );\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(\n stylistic_sets,\n wasm.__wbindgen_malloc,\n wasm.__wbindgen_realloc,\n );\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passStringToWasm0(\n feature_settings,\n wasm.__wbindgen_malloc,\n wasm.__wbindgen_realloc,\n );\n const len3 = WASM_VECTOR_LEN;\n const ret = wasm.process_font(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);\n if (ret[3]) {\n throw takeFromExternrefTable0(ret[2]);\n }\n var v5 = getArrayU8FromWasm0(ret[0], ret[1]).slice();\n wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);\n return v5;\n}\n\n/**\n * Apply stylistic sets by injecting their GSUB lookups into the calt feature.\n * The calt (Contextual Alternates) feature is typically enabled by default in\n * browsers and runs for all text, making it suitable for applying stylistic\n * set substitutions.\n * @param {Uint8Array} font_data\n * @param {string} stylistic_sets\n * @returns {Uint8Array}\n */\nexport function apply_stylistic_sets(font_data, stylistic_sets) {\n const ptr0 = passArray8ToWasm0(font_data, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(\n stylistic_sets,\n wasm.__wbindgen_malloc,\n wasm.__wbindgen_realloc,\n );\n const len1 = WASM_VECTOR_LEN;\n const ret = wasm.apply_stylistic_sets(ptr0, len0, ptr1, len1);\n if (ret[3]) {\n throw takeFromExternrefTable0(ret[2]);\n }\n var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();\n wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);\n return v3;\n}\n\n/**\n * Check whether a font supports a shaperglot language id (e.g. \"ar_Arab\").\n * @param {Uint8Array} font_data\n * @param {string} language_id\n * @returns {string}\n */\nexport function check_font_language_support(font_data, language_id) {\n let deferred3_0;\n let deferred3_1;\n try {\n const ptr0 = passArray8ToWasm0(font_data, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(\n language_id,\n wasm.__wbindgen_malloc,\n wasm.__wbindgen_realloc,\n );\n const len1 = WASM_VECTOR_LEN;\n const ret = wasm.check_font_language_support(ptr0, len0, ptr1, len1);\n deferred3_0 = ret[0];\n deferred3_1 = ret[1];\n return getStringFromWasm0(ret[0], ret[1]);\n } finally {\n wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Check whether every significant character in `text` is covered by the font.\n * Whitespace and default-ignorable characters are skipped.\n * @param {Uint8Array} font_data\n * @param {string} text\n * @returns {string}\n */\nexport function check_font_text_coverage(font_data, text) {\n let deferred3_0;\n let deferred3_1;\n try {\n const ptr0 = passArray8ToWasm0(font_data, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(\n text,\n wasm.__wbindgen_malloc,\n wasm.__wbindgen_realloc,\n );\n const len1 = WASM_VECTOR_LEN;\n const ret = wasm.check_font_text_coverage(ptr0, len0, ptr1, len1);\n deferred3_0 = ret[0];\n deferred3_1 = ret[1];\n return getStringFromWasm0(ret[0], ret[1]);\n } finally {\n wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Initialize the WASM module\n */\nexport function init() {\n wasm.init();\n}\n\nconst EXPECTED_RESPONSE_TYPES = new Set([\"basic\", \"cors\", \"default\"]);\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === \"function\" && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === \"function\") {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n } catch (e) {\n const validResponse =\n module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);\n\n if (\n validResponse &&\n module.headers.get(\"Content-Type\") !== \"application/wasm\"\n ) {\n console.warn(\n \"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\",\n e,\n );\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbg_log_461b6f6f48e94344 = function (arg0, arg1) {\n console.log(getStringFromWasm0(arg0, arg1));\n };\n imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function (arg0, arg1) {\n // Cast intrinsic for `Ref(String) -> Externref`.\n const ret = getStringFromWasm0(arg0, arg1);\n return ret;\n };\n imports.wbg.__wbindgen_init_externref_table = function () {\n const table = wasm.__wbindgen_externrefs;\n const offset = table.grow(4);\n table.set(0, undefined);\n table.set(offset + 0, undefined);\n table.set(offset + 1, null);\n table.set(offset + 2, true);\n table.set(offset + 3, false);\n };\n\n return imports;\n}\n\nfunction __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedUint8ArrayMemory0 = null;\n\n wasm.__wbindgen_start();\n return wasm;\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n if (typeof module !== \"undefined\") {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({ module } = module);\n } else {\n console.warn(\n \"using deprecated parameters for `initSync()`; pass a single object instead\",\n );\n }\n }\n\n const imports = __wbg_get_imports();\n\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n\n const instance = new WebAssembly.Instance(module, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n if (typeof module_or_path !== \"undefined\") {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({ module_or_path } = module_or_path);\n } else {\n console.warn(\n \"using deprecated parameters for the initialization function; pass a single object instead\",\n );\n }\n }\n\n if (typeof module_or_path === \"undefined\") {\n module_or_path = new URL(\"easyeyes_wasm_bg.wasm\", import.meta.url);\n }\n const imports = __wbg_get_imports();\n\n if (\n typeof module_or_path === \"string\" ||\n (typeof Request === \"function\" && module_or_path instanceof Request) ||\n (typeof URL === \"function\" && module_or_path instanceof URL)\n ) {\n module_or_path = fetch(module_or_path);\n }\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync };\nexport default __wbg_init;\n"],"names":["wasm","cachedUint8ArrayMemory0","getUint8ArrayMemory0","byteLength","Uint8Array","memory","buffer","cachedTextDecoder","TextDecoder","ignoreBOM","fatal","decode","numBytesDecoded","getStringFromWasm0","ptr","len","subarray","decodeText","WASM_VECTOR_LEN","passArray8ToWasm0","arg","malloc","length","set","takeFromExternrefTable0","idx","value","__wbindgen_externrefs","get","__externref_table_dealloc","get_font_variable_axes","font_data","deferred3_0","deferred3_1","ptr0","__wbindgen_malloc","len0","ret","ptr2","len2","__wbindgen_free","cachedTextEncoder","TextEncoder","passStringToWasm0","realloc","undefined","buf","encode","mem","offset","code","charCodeAt","slice","view","encodeInto","written","getArrayU8FromWasm0","apply_feature_settings","feature_settings","ptr1","__wbindgen_realloc","len1","v3","generate_static_font_instance","variable_settings","process_font","stylistic_sets","ptr3","len3","v5","apply_stylistic_sets","check_font_language_support","language_id","check_font_text_coverage","text","init","read","EXPECTED_RESPONSE_TYPES","Set","__wbg_get_imports","imports","wbg","__wbg_log_461b6f6f48e94344","arg0","arg1","console","log","__wbindgen_cast_2241b6af4c4b2941","__wbindgen_init_externref_table","table","grow","__wbg_finalize_init","instance","module","exports","__wbg_init","__wbindgen_wasm_module","__wbindgen_start","initSync","Object","getPrototypeOf","prototype","warn","WebAssembly","Module","Instance","async","module_or_path","Request","URL","fetch","Response","instantiateStreaming","e","ok","has","type","headers","bytes","arrayBuffer","instantiate","__wbg_load"],"mappings":"AAAA,IAAIA,kYAEJ,IAAIC,EAA0B,KAE9B,SAASC,IAOP,OAL8B,OAA5BD,GACuC,IAAvCA,EAAwBE,aAExBF,EAA0B,IAAIG,WAAWJ,EAAKK,OAAOC,SAEhDL,CACT,CAEA,IAAIM,EAAoB,IAAIC,YAAY,QAAS,CAC/CC,WAAW,EACXC,OAAO,IAGTH,EAAkBI,SAGlB,IAAIC,EAAkB,EAgBtB,SAASC,EAAmBC,EAAKC,GAE/B,OAjBF,SAAoBD,EAAKC,GAUvB,OATAH,GAAmBG,EACfH,GAJ0B,aAK5BL,EAAoB,IAAIC,YAAY,QAAS,CAC3CC,WAAW,EACXC,OAAO,IAETH,EAAkBI,SAClBC,EAAkBG,GAEbR,EAAkBI,OACvBT,IAAuBc,SAASF,EAAKA,EAAMC,GAE/C,CAISE,CADPH,KAAc,EACSC,EACzB,CAEA,IAAIG,EAAkB,EAEtB,SAASC,EAAkBC,EAAKC,GAC9B,MAAMP,EAAMO,EAAoB,EAAbD,EAAIE,OAAY,KAAO,EAG1C,OAFApB,IAAuBqB,IAAIH,EAAKN,EAAM,GACtCI,EAAkBE,EAAIE,OACfR,CACT,CAEA,SAASU,EAAwBC,GAC/B,MAAMC,EAAQ1B,EAAK2B,sBAAsBC,IAAIH,GAE7C,OADAzB,EAAK6B,0BAA0BJ,GACxBC,CACT,CAQO,SAASI,EAAuBC,GACrC,IAAIC,EACAC,EACJ,IACE,MAAMC,EAAOf,EAAkBY,EAAW/B,EAAKmC,mBACzCC,EAAOlB,EACPmB,EAAMrC,EAAK8B,uBAAuBI,EAAME,GAC9C,IAAIE,EAAOD,EAAI,GACXE,EAAOF,EAAI,GACf,GAAIA,EAAI,GAGN,MAFAC,EAAO,EACPC,EAAO,EACDf,EAAwBa,EAAI,IAIpC,OAFAL,EAAcM,EAC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AED,IAAnB2G,IACLR,OAAOC,eAAeO,KAAoBR,OAAOE,YAChDM,kBAAmBA,GAEtBtB,QAAQiB,KACN,mGAKwB,IAAnBK,IACTA,EAAiB,8kx0MAEnB,MAAM3B,EAAUD,KAGY,iBAAnB4B,GACa,mBAAZC,SAA0BD,aAA0BC,SAC5C,mBAARC,KAAsBF,aAA0BE,OAExDF,EAAiBG,MAAMH,IAGzB,MAAMf,SAAEA,EAAQC,OAAEA,SAvHpBa,eAA0Bb,EAAQb,GAChC,GAAwB,mBAAb+B,UAA2BlB,aAAkBkB,SAAU,CAChE,GAAgD,mBAArCR,YAAYS,qBACrB,IACE,aAAaT,YAAYS,qBAAqBnB,EAAQb,EACxD,CAAE,MAAOiC,GAIP,IAFEpB,EAAOqB,KAAMrC,EAAwBsC,IAAItB,EAAOuB,OAIT,qBAAvCvB,EAAOwB,QAAQzF,IAAI,gBAOnB,MAAMqF,EALN5B,QAAQiB,KACN,oMACAW,EAKN,CAGF,MAAMK,QAAczB,EAAO0B,cAC3B,aAAahB,YAAYiB,YAAYF,EAAOtC,EAC9C,CAAO,CACL,MAAMY,QAAiBW,YAAYiB,YAAY3B,EAAQb,GAEvD,OAAIY,aAAoBW,YAAYE,SAC3B,CAAEb,WAAUC,UAEZD,CAEX,CACF,CAqFqC6B,OAAiBd,EAAgB3B,GAEpE,OAAOW,EAAoBC,EAAUC,EACvC"}
@@ -0,0 +1,2 @@
1
+ !function(){try{var n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},e=(new n.Error).stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="bb7b98df-3b54-4319-bf0a-17b1cb3fd67a",n._sentryDebugIdIdentifier="sentry-dbid-bb7b98df-3b54-4319-bf0a-17b1cb3fd67a")}catch(n){}}();const n=new class{constructor(){this.currentPercentage=0,this.listeners=[],this.progressIntervalId=null}startProgressAnimation(){this.progressIntervalId||(this.progressIntervalId=setInterval((()=>{if(this.currentPercentage<90){const n=4*Math.random()+1;this.currentPercentage=Math.min(90,this.currentPercentage+n),this.notifyListeners()}}),800))}stopProgressAnimation(){this.progressIntervalId&&(clearInterval(this.progressIntervalId),this.progressIntervalId=null)}notifyListeners(){this.listeners.forEach((n=>{n(this.currentPercentage)})),"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("threshold-init-progress",{detail:{percentage:Math.round(this.currentPercentage)}}))}reset(){this.stopProgressAnimation(),this.currentPercentage=0}},e=async()=>{const[n,e]=window.location.pathname.split("/").filter(Boolean),t=new URLSearchParams(window.location.search).get("preview-deploy")||("localhost"!==window.location.hostname?"https://easyeyes.app":"http://localhost:8888"),o=await fetch(`${t}/.netlify/functions/phrases?pinned=${n}/${e}`);if(!o.ok)throw new Error(`phrases pin fetch failed: ${o.status}`);const{version:i}=await o.json(),s=await fetch(`${t}/.netlify/functions/phrases?v=${i}`);if(!s.ok)throw new Error(`phrases fetch failed: ${s.status}`);return(await s.json()).phrases};document.addEventListener("DOMContentLoaded",(()=>{document.body.setAttribute("dir","undefined"!=typeof experimentLanguageDirection&&"rtl"===String(experimentLanguageDirection).toLowerCase()?"rtl":"ltr"),n.startProgressAnimation();const t=document.createElement("div");t.className="loading-container",t.innerHTML='\n <div class="loading-content">\n <div class="loading-spinner"></div>\n <div class="loading-text"></div>\n <div class="progress-bar">\n <div class="progress-fill" id="progressFill"></div>\n </div>\n <div class="progress-percent" id="progressPercent">0%</div>\n <div id="timeoutMessage" class="timeout-message" style="display: none;"></div>\n <button id="reloadButton" class="reload-button" style="display: none;"></button>\n </div>\n ',document.body.appendChild(t);let o=!1,i=!1;const s=()=>{if(!o||!i||!t.parentNode)return;const n=document.getElementById("timeoutMessage"),e=document.getElementById("reloadButton");n&&(n.style.display="block"),e&&(e.style.display="block")};e().then((n=>{const e=((n,e)=>{let t;return t=e&&Object.prototype.hasOwnProperty.call(n.EE_LanguageEnglishName,e)?e:Object.keys(n.EE_LanguageEnglishName).find((t=>n.EE_LanguageEnglishName[t]===e)),t?{loadingText:n.RC_LoadingStudy[t],timeoutMessage:n.RC_LoadingStudyTakingLonger[t],reloadButton:n.RC_ReloadStudyButton[t]}:null})(n,experimentLanguage);if(e){const n=t.querySelector(".loading-text");n&&(n.textContent=e.loadingText);const i=document.getElementById("timeoutMessage");i&&(i.textContent=e.timeoutMessage);const r=document.getElementById("reloadButton");r&&(r.textContent=e.reloadButton),o=!0,s()}})).catch((n=>{console.warn("Failed to load phrases:",n);const e=t.querySelector(".loading-text");e&&(e.textContent="Loading …")}));const r=setTimeout((()=>{i=!0,s()}),1e4),a=document.getElementById("reloadButton");a&&a.addEventListener("click",(()=>{window.location.reload()})),window.addEventListener("threshold-init-progress",(n=>{const{percentage:e}=n.detail,t=document.getElementById("progressFill"),o=document.getElementById("progressPercent");t&&(t.style.width=e+"%"),o&&(o.textContent=Math.round(e)+"%")}));const d=()=>{clearTimeout(r),n.stopProgressAnimation(),n.currentPercentage=100,n.notifyListeners(),t.parentNode&&t.remove()};window.removeLoadingScreen=d,window.showCriticalLoadError=(e,t)=>{clearTimeout(r),n.stopProgressAnimation(),"undefined"!=typeof Swal&&Swal.fire({allowOutsideClick:!1,icon:"error",title:e||"Loading Failed",text:t||"Please refresh the page to try again.",confirmButtonText:"Refresh"}).then((()=>window.location.reload()))},window.addEventListener("threshold-ready-for-ui",(()=>{d()}))}));const t=document.createElement("style");t.textContent='\n body, html {\n margin: 0;\n padding: 0;\n }\n\n .loading-container {\n position: fixed;\n top: 0;\n left: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n transition: opacity 0.4s ease;\n padding: 0;\n margin: 0;\n height: 100vh;\n width: 100vw;\n background: white;\n z-index: 10000;\n }\n\n .loading-content {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 20px;\n width: 400px;\n max-width: 90vw;\n padding: 20px;\n }\n\n .loading-spinner {\n border: 5px solid #f3f3f3;\n border-top: 5px solid #3498db;\n border-radius: 50%;\n width: 50px;\n height: 50px;\n animation: spin 1s linear infinite;\n }\n\n .loading-text {\n font-size: 18px;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n color: #333;\n font-weight: 500;\n }\n\n .progress-bar {\n width: 100%;\n height: 8px;\n background: #e0e0e0;\n border-radius: 4px;\n overflow: hidden;\n }\n\n .progress-fill {\n height: 100%;\n background: #3498db;\n width: 0%;\n transition: width 0.3s ease;\n }\n\n .progress-percent {\n font-size: 14px;\n color: #666;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n }\n\n .progress-step {\n font-size: 12px;\n color: #999;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n min-height: 16px;\n }\n\n .timeout-message {\n font-size: 14px;\n color: #666;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n font-weight: 400;\n text-align: center;\n }\n\n .reload-button {\n background: #3498db;\n color: white;\n border: none;\n padding: 12px 24px;\n border-radius: 4px;\n font-size: 14px;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.2s ease;\n }\n\n .reload-button:hover {\n background: #2980b9;\n }\n\n .reload-button:active {\n background: #1f618d;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n\n .fade-out {\n opacity: 0;\n }\n\n /* Center-align Swal2 modal title and content for consistent alignment */\n .swal2-title,\n .swal2-html-container {\n text-align: center !important;\n }\n',document.head.appendChild(t);
2
+ //# sourceMappingURL=first.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"first.min.js","sources":["../components/timeoutUtils.js","../first.js","../components/loadingScreenText.ts"],"sourcesContent":["/**\n * Class to track initialization progress\n */\nexport class InitializationProgress {\n constructor() {\n this.currentPercentage = 0;\n this.listeners = [];\n this.progressIntervalId = null;\n }\n /**\n * Start progress animation for better UX\n * Gradually increases progress if not already at target\n */\n startProgressAnimation() {\n if (this.progressIntervalId) return; // Already running\n\n this.progressIntervalId = setInterval(() => {\n // Gradually increase progress between updates (but slower as we get higher)\n if (this.currentPercentage < 90) {\n // Math.random (not the seeded rng): first.js imports this module and\n // must stay a standalone bundle; the increment is cosmetic only.\n const increment = Math.random() * (5 - 1) + 1; // Random 1-5% increment\n this.currentPercentage = Math.min(\n 90,\n this.currentPercentage + increment,\n );\n this.notifyListeners();\n }\n }, 800); // Update every 800ms\n }\n\n /**\n * Stop progress animation\n */\n stopProgressAnimation() {\n if (this.progressIntervalId) {\n clearInterval(this.progressIntervalId);\n this.progressIntervalId = null;\n }\n }\n\n /**\n * Notify all listeners of progress update\n */\n notifyListeners() {\n this.listeners.forEach((callback) => {\n callback(this.currentPercentage);\n });\n\n // Also dispatch custom event for cross-module communication\n if (typeof window !== \"undefined\") {\n window.dispatchEvent(\n new CustomEvent(\"threshold-init-progress\", {\n detail: {\n percentage: Math.round(this.currentPercentage),\n },\n }),\n );\n }\n }\n\n /**\n * Reset progress\n */\n reset() {\n this.stopProgressAnimation();\n this.currentPercentage = 0;\n }\n}\n\n// Create a singleton instance\nexport const initProgress = new InitializationProgress();\n","// Import only what's needed for initial page rendering\nimport { initProgress } from \"./components/timeoutUtils.js\";\nimport * as sentry from \"./components/sentry\";\nimport { localizeLoadingScreen } from \"./components/loadingScreenText\";\n\n// Resolve the EasyEyes base URL for the loading-screen phrases fetch. Kept\n// self-contained (no shared imports) so first.js stays a standalone bundle —\n// see loadPhrases below. Mirrors components/easyeyesBaseUrl.ts for the deployed\n// cases (preview-deploy param, production); a local dev server is assumed at\n// :8888 without probing, since the spinner falls back gracefully on failure.\nconst getBaseUrl = () => {\n const previewDeployBase = new URLSearchParams(window.location.search).get(\n \"preview-deploy\",\n );\n if (previewDeployBase) return previewDeployBase;\n if (window.location.hostname !== \"localhost\") return \"https://easyeyes.app\";\n return \"http://localhost:8888\";\n};\n\n// Load phrases for the loading screen from the same versioned read-path the\n// experiment uses. Inlined here (not imported from preprocess/phrases-loader,\n// which has a top-level await) so first.js bundles standalone — sharing a module\n// across that async boundary would split a chunk that Pavlovia does not deploy.\n// A single attempt is enough: setupInitialUI's .catch falls back to plain text.\nconst loadPhrases = async () => {\n const [username, experimentName] = window.location.pathname\n .split(\"/\")\n .filter(Boolean);\n const base = getBaseUrl();\n // Two-step read: resolve the (mutable, uncached) pin to a version, then fetch\n // the immutable payload by explicit ?v= — the same cacheable URL the\n // experiment loader uses. Single attempt: the .catch falls back to plain text.\n const pinnedRes = await fetch(\n `${base}/.netlify/functions/phrases?pinned=${username}/${experimentName}`,\n );\n if (!pinnedRes.ok)\n throw new Error(`phrases pin fetch failed: ${pinnedRes.status}`);\n const { version } = await pinnedRes.json();\n const res = await fetch(`${base}/.netlify/functions/phrases?v=${version}`);\n if (!res.ok) throw new Error(`phrases fetch failed: ${res.status}`);\n const data = await res.json();\n return data.phrases;\n};\n\n// Initial UI setup function - show spinner immediately\nconst setupInitialUI = () => {\n // experimentLanguageDirection is defined (alongside experimentLanguage) in\n // the compile-time generated js/experimentLanguage.js loaded by index.html;\n // it holds the _language's direction per the phrases' EE_LanguageDirection.\n // Set <body dir> so every HTML element inherits the experiment's text\n // direction by default. Guarded with typeof: experiments compiled before\n // this constant existed ship an experimentLanguage.js without it.\n document.body.setAttribute(\n \"dir\",\n typeof experimentLanguageDirection !== \"undefined\" &&\n String(experimentLanguageDirection).toLowerCase() === \"rtl\"\n ? \"rtl\"\n : \"ltr\",\n );\n\n // Start the progress animation immediately (no i18n needed)\n initProgress.startProgressAnimation();\n\n // Create loading indicator with spinner only (no text initially)\n const loadingElement = document.createElement(\"div\");\n loadingElement.className = \"loading-container\";\n loadingElement.innerHTML = `\n <div class=\"loading-content\">\n <div class=\"loading-spinner\"></div>\n <div class=\"loading-text\"></div>\n <div class=\"progress-bar\">\n <div class=\"progress-fill\" id=\"progressFill\"></div>\n </div>\n <div class=\"progress-percent\" id=\"progressPercent\">0%</div>\n <div id=\"timeoutMessage\" class=\"timeout-message\" style=\"display: none;\"></div>\n <button id=\"reloadButton\" class=\"reload-button\" style=\"display: none;\"></button>\n </div>\n `;\n document.body.appendChild(loadingElement);\n\n // Show the timeout message and reload button only once BOTH conditions hold:\n // the 10s timer has fired and phrases have loaded (so they have localized\n // text). Either side can be the last to happen, so each calls this helper.\n let phrasesLoaded = false;\n let timeoutReached = false;\n const maybeShowTimeoutUI = () => {\n if (!phrasesLoaded || !timeoutReached || !loadingElement.parentNode) return;\n const timeoutMessage = document.getElementById(\"timeoutMessage\");\n const reloadButton = document.getElementById(\"reloadButton\");\n if (timeoutMessage) {\n timeoutMessage.style.display = \"block\";\n }\n if (reloadButton) {\n reloadButton.style.display = \"block\";\n }\n };\n\n // Lazy-load i18n and update text elements once available\n loadPhrases()\n .then((phrases) => {\n // experimentLanguage is loaded in the index.html\n const text = localizeLoadingScreen(phrases, experimentLanguage);\n if (text) {\n // Update text elements (DOM already has them, just populate)\n const loadingText = loadingElement.querySelector(\".loading-text\");\n if (loadingText) {\n loadingText.textContent = text.loadingText;\n }\n const timeoutMessage = document.getElementById(\"timeoutMessage\");\n if (timeoutMessage) {\n timeoutMessage.textContent = text.timeoutMessage;\n }\n const reloadButton = document.getElementById(\"reloadButton\");\n if (reloadButton) {\n reloadButton.textContent = text.reloadButton;\n }\n phrasesLoaded = true;\n maybeShowTimeoutUI();\n }\n })\n .catch((err) => {\n console.warn(\"Failed to load phrases:\", err);\n const loadingText = loadingElement.querySelector(\".loading-text\");\n if (loadingText) {\n loadingText.textContent = \"Loading …\";\n }\n });\n\n // Setup timeout warning and reload button (10 seconds)\n const timeoutWarningTimer = setTimeout(() => {\n timeoutReached = true;\n maybeShowTimeoutUI();\n }, 10000);\n\n // Reload button click handler\n const reloadButton = document.getElementById(\"reloadButton\");\n if (reloadButton) {\n reloadButton.addEventListener(\"click\", () => {\n window.location.reload();\n });\n }\n\n // Listen for initialization progress updates\n window.addEventListener(\"threshold-init-progress\", (event) => {\n const { percentage } = event.detail;\n const progressFill = document.getElementById(\"progressFill\");\n const progressPercent = document.getElementById(\"progressPercent\");\n\n if (progressFill) {\n progressFill.style.width = percentage + \"%\";\n }\n if (progressPercent) {\n progressPercent.textContent = Math.round(percentage) + \"%\";\n }\n });\n\n // Extract loading screen removal function\n const removeLoadingScreen = () => {\n // Clear timeout timer\n clearTimeout(timeoutWarningTimer);\n\n // Stop progress animation and ensure progress bar shows 100%\n initProgress.stopProgressAnimation();\n initProgress.currentPercentage = 100;\n initProgress.notifyListeners();\n\n if (loadingElement.parentNode) {\n loadingElement.remove();\n }\n };\n\n // Expose globally for threshold.js (before threshold.js loads)\n window.removeLoadingScreen = removeLoadingScreen;\n\n // Show critical load error using Swal2 (loaded in index.html before first.js)\n window.showCriticalLoadError = (title, text) => {\n clearTimeout(timeoutWarningTimer);\n initProgress.stopProgressAnimation();\n if (typeof Swal !== \"undefined\") {\n Swal.fire({\n allowOutsideClick: false,\n icon: \"error\",\n title: title || \"Loading Failed\",\n text: text || \"Please refresh the page to try again.\",\n confirmButtonText: \"Refresh\",\n }).then(() => window.location.reload());\n }\n };\n\n // Remove loading screen when ready for UI (compatibility page)\n window.addEventListener(\"threshold-ready-for-ui\", () => {\n removeLoadingScreen(); // Delegates to extracted function\n });\n};\n\n// Run immediately\ndocument.addEventListener(\"DOMContentLoaded\", setupInitialUI);\n\n// Add some CSS for the loading screen\nconst style = document.createElement(\"style\");\nstyle.textContent = `\n body, html {\n margin: 0;\n padding: 0;\n }\n\n .loading-container {\n position: fixed;\n top: 0;\n left: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n transition: opacity 0.4s ease;\n padding: 0;\n margin: 0;\n height: 100vh;\n width: 100vw;\n background: white;\n z-index: 10000;\n }\n\n .loading-content {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 20px;\n width: 400px;\n max-width: 90vw;\n padding: 20px;\n }\n\n .loading-spinner {\n border: 5px solid #f3f3f3;\n border-top: 5px solid #3498db;\n border-radius: 50%;\n width: 50px;\n height: 50px;\n animation: spin 1s linear infinite;\n }\n\n .loading-text {\n font-size: 18px;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n color: #333;\n font-weight: 500;\n }\n\n .progress-bar {\n width: 100%;\n height: 8px;\n background: #e0e0e0;\n border-radius: 4px;\n overflow: hidden;\n }\n\n .progress-fill {\n height: 100%;\n background: #3498db;\n width: 0%;\n transition: width 0.3s ease;\n }\n\n .progress-percent {\n font-size: 14px;\n color: #666;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n }\n\n .progress-step {\n font-size: 12px;\n color: #999;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n min-height: 16px;\n }\n\n .timeout-message {\n font-size: 14px;\n color: #666;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n font-weight: 400;\n text-align: center;\n }\n\n .reload-button {\n background: #3498db;\n color: white;\n border: none;\n padding: 12px 24px;\n border-radius: 4px;\n font-size: 14px;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.2s ease;\n }\n\n .reload-button:hover {\n background: #2980b9;\n }\n\n .reload-button:active {\n background: #1f618d;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n\n .fade-out {\n opacity: 0;\n }\n\n /* Center-align Swal2 modal title and content for consistent alignment */\n .swal2-title,\n .swal2-html-container {\n text-align: center !important;\n }\n`;\ndocument.head.appendChild(style);\n\n// Export things that threshold.js might need\nexport { setupInitialUI };\n","type Phrases = Record<string, Record<string, string>>;\n\nexport interface LoadingScreenText {\n loadingText: string;\n timeoutMessage: string;\n reloadButton: string;\n}\n\n/**\n * Resolve the loading-screen strings for the experiment's language (as set in\n * index.html). Accepts either a language code (e.g. \"fr\") or, for backward\n * compatibility, the full English name. Returns null when nothing matches.\n */\nexport const localizeLoadingScreen = (\n phrases: Phrases,\n experimentLanguageName: string,\n): LoadingScreenText | null => {\n let lang: string | undefined;\n // _language now takes a language code; use it directly when it is one.\n if (\n experimentLanguageName &&\n Object.prototype.hasOwnProperty.call(\n phrases.EE_LanguageEnglishName,\n experimentLanguageName,\n )\n ) {\n lang = experimentLanguageName;\n } else {\n lang = Object.keys(phrases.EE_LanguageEnglishName).find(\n (key) => phrases.EE_LanguageEnglishName[key] === experimentLanguageName,\n );\n }\n if (!lang) return null;\n return {\n loadingText: phrases.RC_LoadingStudy[lang],\n timeoutMessage: phrases.RC_LoadingStudyTakingLonger[lang],\n reloadButton: phrases.RC_ReloadStudyButton[lang],\n };\n};\n"],"names":["initProgress","constructor","this","currentPercentage","listeners","progressIntervalId","startProgressAnimation","setInterval","increment","Math","random","min","notifyListeners","stopProgressAnimation","clearInterval","forEach","callback","window","dispatchEvent","CustomEvent","detail","percentage","round","reset","loadPhrases","async","username","experimentName","location","pathname","split","filter","Boolean","base","URLSearchParams","search","get","hostname","pinnedRes","fetch","ok","Error","status","version","json","res","phrases","document","addEventListener","body","setAttribute","experimentLanguageDirection","String","toLowerCase","loadingElement","createElement","className","innerHTML","appendChild","phrasesLoaded","timeoutReached","maybeShowTimeoutUI","parentNode","timeoutMessage","getElementById","reloadButton","style","display","then","text","experimentLanguageName","lang","Object","prototype","hasOwnProperty","call","EE_LanguageEnglishName","keys","find","key","loadingText","RC_LoadingStudy","RC_LoadingStudyTakingLonger","RC_ReloadStudyButton","localizeLoadingScreen","experimentLanguage","querySelector","textContent","catch","err","console","warn","timeoutWarningTimer","setTimeout","reload","event","progressFill","progressPercent","width","removeLoadingScreen","clearTimeout","remove","showCriticalLoadError","title","Swal","fire","allowOutsideClick","icon","confirmButtonText","head"],"mappings":"gYAuEO,MAAMA,EAAe,IApErB,MACL,WAAAC,GACEC,KAAKC,kBAAoB,EACzBD,KAAKE,UAAY,GACjBF,KAAK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,QAAQ,IAK5B7E,OAAO+B,iBAAiB,2BAA4B+C,IAClD,MAAM1E,WAAEA,GAAe0E,EAAM3E,OACvB4E,EAAejD,SAASiB,eAAe,gBACvCiC,EAAkBlD,SAASiB,eAAe,mBAE5CgC,IACFA,EAAa9B,MAAMgC,MAAQ7E,EAAa,KAEtC4E,IACFA,EAAgBV,YAAc9E,KAAKa,MAAMD,GAAc,IACzD,IAIF,MAAM8E,EAAsB,KAE1BC,aAAaR,GAGb5F,EAAaa,wBACbb,EAAaG,kBAAoB,IACjCH,EAAaY,kBAET0C,EAAeQ,YACjBR,EAAe+C,QACjB,EAIFpF,OAAOkF,oBAAsBA,EAG7BlF,OAAOqF,sBAAwB,CAACC,EAAOlC,KACrC+B,aAAaR,GACb5F,EAAaa,wBACO,oBAAT2F,MACTA,KAAKC,KAAK,CACRC,mBAAmB,EACnBC,KAAM,QACNJ,MAAOA,GAAS,iBAChBlC,KAAMA,GAAQ,wCACduC,kBAAmB,YAClBxC,MAAK,IAAMnD,OAAOW,SAASkE,UAChC,EAIF7E,OAAO+B,iBAAiB,0BAA0B,KAChDmD,GAAqB,GACrB,IAOJ,MAAMjC,EAAQnB,SAASQ,cAAc,SACrCW,EAAMqB,YAAc,kyFAyHpBxC,SAAS8D,KAAKnD,YAAYQ"}
package/js/index.js ADDED
@@ -0,0 +1,7 @@
1
+ import{g as e,__tla as __tla_0}from"./threshold.min.js";let b;let __tla=Promise.all([(()=>{try{return __tla_0}catch{}})()]).then(async()=>{!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},r=(new e.Error).stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="e765b36b-92a3-410f-8ec1-9d10793b472f",e._sentryDebugIdIdentifier="sentry-dbid-e765b36b-92a3-410f-8ec1-9d10793b472f")}catch(e){}}();function r(e,r){for(var t=0;t<r.length;t++){const o=r[t];if("string"!=typeof o&&!Array.isArray(o))for(const r in o)if("default"!==r&&!(r in e)){const t=Object.getOwnPropertyDescriptor(o,r);t&&Object.defineProperty(e,r,t.get?t:{enumerable:!0,get:()=>o[r]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const t={version:"0.11.6",devDependencies:{"@ffmpeg/core":"^0.11.0"}},o={corePath:`https://unpkg.com/@ffmpeg/core@${t.devDependencies["@ffmpeg/core"].substring(1)}/dist/ffmpeg-core.js`};let a=!1,n=()=>{};var i=(e,r)=>{n({type:e,message:r}),a&&console.log(`[${e}] ${r}`)};var s=e=>`
2
+ createFFmpegCore is not defined. ffmpeg.wasm is unable to find createFFmpegCore after loading ffmpeg-core.js from ${e}. Use another URL when calling createFFmpeg():
3
+
4
+ const ffmpeg = createFFmpeg({
5
+ corePath: 'http://localhost:3000/ffmpeg-core.js',
6
+ });
7
+ `;const f=async(e,r)=>{i("info",`fetch ${e}`);const t=await (await fetch(e)).arrayBuffer();i("info",`${e} file size = ${t.byteLength} bytes`);const o=new Blob([t],{type:r}),a=URL.createObjectURL(o);return i("info",`${e} blob URL = ${a}`),a},l=Object.freeze(Object.defineProperty({__proto__:null,defaultOptions:o,fetchFile:async e=>{let r=e;if(void 0===e)return new Uint8Array;if("string"==typeof e)if(/data:_data\/([a-zA-Z]*);base64,([^"]*)/.test(e))r=atob(e.split(",")[1]).split("").map((e=>e.charCodeAt(0)));else{const t=await fetch(new URL(e,import.meta.url).href);r=await t.arrayBuffer()}else(e instanceof File||e instanceof Blob)&&(r=await (t=e,new Promise(((e,r)=>{const o=new FileReader;o.onload=()=>{e(o.result)},o.onerror=({target:{error:{code:e}}})=>{r(Error(`File could not be read! Code=${e}`))},o.readAsArrayBuffer(t)}))));var t;return new Uint8Array(r)},getCreateFFmpegCore:async({corePath:e,workerPath:r,wasmPath:t})=>{if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){if("string"!=typeof e)throw Error("corePath should be a string!");const o=new URL(e,import.meta.url).href,a=await f(o,"application/javascript"),n=await f(void 0!==t?t:o.replace("ffmpeg-core.js","ffmpeg-core.wasm"),"application/wasm"),l=await f(void 0!==r?r:o.replace("ffmpeg-core.js","ffmpeg-core.worker.js"),"application/javascript");return"undefined"==typeof createFFmpegCore?new Promise((e=>{if(globalThis.importScripts(a),"undefined"==typeof createFFmpegCore)throw Error(s(o));i("info","ffmpeg-core.js script loaded"),e({createFFmpegCore:createFFmpegCore,corePath:a,wasmPath:n,workerPath:l})})):(i("info","ffmpeg-core.js script is loaded already"),Promise.resolve({createFFmpegCore:createFFmpegCore,corePath:a,wasmPath:n,workerPath:l}))}if("string"!=typeof e)throw Error("corePath should be a string!");const o=new URL(e,import.meta.url).href,a=await f(o,"application/javascript"),n=await f(void 0!==t?t:o.replace("ffmpeg-core.js","ffmpeg-core.wasm"),"application/wasm"),l=await f(void 0!==r?r:o.replace("ffmpeg-core.js","ffmpeg-core.worker.js"),"application/javascript");return"undefined"==typeof createFFmpegCore?new Promise((e=>{const r=document.createElement("script"),t=()=>{if(r.removeEventListener("load",t),"undefined"==typeof createFFmpegCore)throw Error(s(o));i("info","ffmpeg-core.js script loaded"),e({createFFmpegCore:createFFmpegCore,corePath:a,wasmPath:n,workerPath:l})};r.src=a,r.type="text/javascript",r.addEventListener("load",t),document.getElementsByTagName("head")[0].appendChild(r)})):(i("info","ffmpeg-core.js script is loaded already"),Promise.resolve({createFFmpegCore:createFFmpegCore,corePath:a,wasmPath:n,workerPath:l}))}},Symbol.toStringTag,{value:"Module"})),c=e(l),{defaultArgs:p,baseOptions:m}={defaultArgs:["./ffmpeg","-nostdin","-y"],baseOptions:{log:!1,logger:()=>{},progress:()=>{},corePath:""}},d=(e,r)=>{const t=e._malloc(r.length*Uint32Array.BYTES_PER_ELEMENT);return r.forEach(((r,o)=>{const a=e.lengthBytesUTF8(r)+1,n=e._malloc(a);e.stringToUTF8(r,n,a),e.setValue(t+Uint32Array.BYTES_PER_ELEMENT*o,n,"i32")})),[r.length,t]},{defaultOptions:g,getCreateFFmpegCore:u}=c,{version:h}=t,w=Error("ffmpeg.wasm is not ready, make sure you have completed load().");const y=(e={})=>{const{log:r,logger:t,progress:o,...a}={...m,...g,...e};let n=null,i=null,s=null,f=null,l=!1,c=()=>{},y=r,F=o,b=0,P=0,v=!1,E=0;const j=(e,r)=>{c({type:e,message:r}),y&&console.log(`[${e}] ${r}`)},C=e=>{const[r,t,o]=e.split(":");return 60*parseFloat(r)*60+60*parseFloat(t)+parseFloat(o)},_=({type:e,message:r})=>{j(e,r),((e,r)=>{if("string"==typeof e)if(e.startsWith(" Duration")){const t=e.split(", ")[0].split(": ")[1],o=C(t);r({duration:o,ratio:E}),(0===b||b>o)&&(b=o,v=!0)}else if(v&&e.startsWith(" Stream")){const r=e.match(/([\d.]+) fps/);if(r){const e=parseFloat(r[1]);P=b*e}else P=0;v=!1}else if(e.startsWith("frame")||e.startsWith("size")){const t=e.split("time=")[1].split(" ")[0],o=C(t),a=e.match(/frame=\s*(\d+)/);if(P&&a){const e=parseFloat(a[1]);E=Math.min(e/P,1)}else E=o/b;r({ratio:E,time:o})}else e.startsWith("video:")&&(r({ratio:1}),b=0)})(r,F),(e=>{"FFMPEG_END"===e&&null!==s&&(s(),s=null,f=null,l=!1)})(r)};return j("info",`use ffmpeg.wasm v${h}`),{setProgress:e=>{F=e},setLogger:e=>{c=e},setLogging:e=>{y=e},load:async()=>{if(j("info","load ffmpeg-core"),null!==n)throw Error("ffmpeg.wasm was loaded, you should not load it again, use ffmpeg.isLoaded() to check next time.");{j("info","loading ffmpeg-core");const{createFFmpegCore:e,corePath:r,workerPath:t,wasmPath:o}=await u(a);n=await e({mainScriptUrlOrBlob:r,printErr:e=>_({type:"fferr",message:e}),print:e=>_({type:"ffout",message:e}),locateFile:(e,r)=>{if("undefined"!=typeof window||"undefined"!=typeof WorkerGlobalScope){if(void 0!==o&&e.endsWith("ffmpeg-core.wasm"))return o;if(void 0!==t&&e.endsWith("ffmpeg-core.worker.js"))return t}return r+e}}),i=n.cwrap(a.mainName||"proxy_main","number",["number","number"]),j("info","ffmpeg-core loaded")}},isLoaded:()=>null!==n,run:(...e)=>{if(j("info",`run ffmpeg command: ${e.join(" ")}`),null===n)throw w;if(l)throw Error("ffmpeg.wasm can only run one command at a time");return l=!0,new Promise(((r,t)=>{const o=[...p,...e].filter((e=>0!==e.length));s=r,f=t,i(...d(n,o))}))},exit:()=>{if(null===n)throw w;f&&f("ffmpeg has exited"),l=!1;try{n.exit(1)}catch(e){j(e.message),f&&f(e)}finally{n=null,i=null,s=null,f=null}},FS:(e,...r)=>{if(j("info",`run FS.${e} ${r.map((e=>"string"==typeof e?e:`<${e.length} bytes binary file>`)).join(" ")}`),null===n)throw w;{let o=null;try{o=n.FS[e](...r)}catch(t){throw"readdir"===e?Error(`ffmpeg.FS('readdir', '${r[0]}') error. Check if the path exists, ex: ffmpeg.FS('readdir', '/')`):"readFile"===e?Error(`ffmpeg.FS('readFile', '${r[0]}') error. Check if the path exists`):Error("Oops, something went wrong in FS operation.")}return o}}}},{fetchFile:F}=c;b=r({__proto__:null},[{createFFmpeg:y,fetchFile:F}])});export{b as i,__tla};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../node_modules/@ffmpeg/ffmpeg/src/browser/defaultOptions.js","../node_modules/@ffmpeg/ffmpeg/src/utils/log.js","../node_modules/@ffmpeg/ffmpeg/src/utils/errors.js","../node_modules/@ffmpeg/ffmpeg/src/browser/getCreateFFmpegCore.js","../node_modules/@ffmpeg/ffmpeg/src/browser/fetchFile.js","../node_modules/@ffmpeg/ffmpeg/src/createFFmpeg.js","../node_modules/@ffmpeg/ffmpeg/src/config.js","../node_modules/@ffmpeg/ffmpeg/src/utils/parseArgs.js","../node_modules/@ffmpeg/ffmpeg/src/index.js"],"sourcesContent":["import pkg from '../../package.json';\n\n/*\n * Default options for browser environment\n */\nconst corePath = typeof process !== 'undefined' && process.env.NODE_ENV === 'development'\n ? new URL('/node_modules/@ffmpeg/core/dist/ffmpeg-core.js', import.meta.url).href\n : `https://unpkg.com/@ffmpeg/core@${pkg.devDependencies['@ffmpeg/core'].substring(1)}/dist/ffmpeg-core.js`;\n\nexport default { corePath };\n","let logging = false;\nlet customLogger = () => {};\n\nconst setLogging = (_logging) => {\n logging = _logging;\n};\n\nconst setCustomLogger = (logger) => {\n customLogger = logger;\n};\n\nconst log = (type, message) => {\n customLogger({ type, message });\n if (logging) {\n console.log(`[${type}] ${message}`);\n }\n};\n\nmodule.exports = {\n logging,\n setLogging,\n setCustomLogger,\n log,\n};\n","const CREATE_FFMPEG_CORE_IS_NOT_DEFINED = (corePath) => (`\ncreateFFmpegCore is not defined. ffmpeg.wasm is unable to find createFFmpegCore after loading ffmpeg-core.js from ${corePath}. Use another URL when calling createFFmpeg():\n\nconst ffmpeg = createFFmpeg({\n corePath: 'http://localhost:3000/ffmpeg-core.js',\n});\n`);\n\nmodule.exports = {\n CREATE_FFMPEG_CORE_IS_NOT_DEFINED,\n};\n","/* eslint-disable no-undef */\nimport { log } from '../utils/log';\nimport {\n CREATE_FFMPEG_CORE_IS_NOT_DEFINED,\n} from '../utils/errors';\n\n/*\n * Fetch data from remote URL and convert to blob URL\n * to avoid CORS issue\n */\nconst toBlobURL = async (url, mimeType) => {\n log('info', `fetch ${url}`);\n const buf = await (await fetch(url)).arrayBuffer();\n log('info', `${url} file size = ${buf.byteLength} bytes`);\n const blob = new Blob([buf], { type: mimeType });\n const blobURL = URL.createObjectURL(blob);\n log('info', `${url} blob URL = ${blobURL}`);\n return blobURL;\n};\n\n// eslint-disable-next-line\nexport const getCreateFFmpegCore = async ({\n corePath: _corePath,\n workerPath: _workerPath,\n wasmPath: _wasmPath,\n}) => {\n // in Web Worker context\n // eslint-disable-next-line\n if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {\n if (typeof _corePath !== 'string') {\n throw Error('corePath should be a string!');\n }\n const coreRemotePath = new URL(_corePath, import.meta.url).href;\n const corePath = await toBlobURL(\n coreRemotePath,\n 'application/javascript',\n );\n const wasmPath = await toBlobURL(\n _wasmPath !== undefined ? _wasmPath : coreRemotePath.replace('ffmpeg-core.js', 'ffmpeg-core.wasm'),\n 'application/wasm',\n );\n const workerPath = await toBlobURL(\n _workerPath !== undefined ? _workerPath : coreRemotePath.replace('ffmpeg-core.js', 'ffmpeg-core.worker.js'),\n 'application/javascript',\n );\n if (typeof createFFmpegCore === 'undefined') {\n return new Promise((resolve) => {\n globalThis.importScripts(corePath);\n if (typeof createFFmpegCore === 'undefined') {\n throw Error(CREATE_FFMPEG_CORE_IS_NOT_DEFINED(coreRemotePath));\n }\n log('info', 'ffmpeg-core.js script loaded');\n resolve({\n createFFmpegCore,\n corePath,\n wasmPath,\n workerPath,\n });\n });\n }\n log('info', 'ffmpeg-core.js script is loaded already');\n return Promise.resolve({\n createFFmpegCore,\n corePath,\n wasmPath,\n workerPath,\n });\n }\n if (typeof _corePath !== 'string') {\n throw Error('corePath should be a string!');\n }\n const coreRemotePath = new URL(_corePath, import.meta.url).href;\n const corePath = await toBlobURL(\n coreRemotePath,\n 'application/javascript',\n );\n const wasmPath = await toBlobURL(\n _wasmPath !== undefined ? _wasmPath : coreRemotePath.replace('ffmpeg-core.js', 'ffmpeg-core.wasm'),\n 'application/wasm',\n );\n const workerPath = await toBlobURL(\n _workerPath !== undefined ? _workerPath : coreRemotePath.replace('ffmpeg-core.js', 'ffmpeg-core.worker.js'),\n 'application/javascript',\n );\n if (typeof createFFmpegCore === 'undefined') {\n return new Promise((resolve) => {\n const script = document.createElement('script');\n const eventHandler = () => {\n script.removeEventListener('load', eventHandler);\n if (typeof createFFmpegCore === 'undefined') {\n throw Error(CREATE_FFMPEG_CORE_IS_NOT_DEFINED(coreRemotePath));\n }\n log('info', 'ffmpeg-core.js script loaded');\n resolve({\n createFFmpegCore,\n corePath,\n wasmPath,\n workerPath,\n });\n };\n script.src = corePath;\n script.type = 'text/javascript';\n script.addEventListener('load', eventHandler);\n document.getElementsByTagName('head')[0].appendChild(script);\n });\n }\n log('info', 'ffmpeg-core.js script is loaded already');\n return Promise.resolve({\n createFFmpegCore,\n corePath,\n wasmPath,\n workerPath,\n });\n};\n","const readFromBlobOrFile = (blob) => (\n new Promise((resolve, reject) => {\n const fileReader = new FileReader();\n fileReader.onload = () => {\n resolve(fileReader.result);\n };\n fileReader.onerror = ({ target: { error: { code } } }) => {\n reject(Error(`File could not be read! Code=${code}`));\n };\n fileReader.readAsArrayBuffer(blob);\n })\n);\n\n// eslint-disable-next-line\nexport const fetchFile = async (_data) => {\n let data = _data;\n if (typeof _data === 'undefined') {\n return new Uint8Array();\n }\n\n if (typeof _data === 'string') {\n /* From base64 format */\n if (/data:_data\\/([a-zA-Z]*);base64,([^\"]*)/.test(_data)) {\n data = atob(_data.split(',')[1])\n .split('')\n .map((c) => c.charCodeAt(0));\n /* From remote server/URL */\n } else {\n const res = await fetch(new URL(_data, import.meta.url).href);\n data = await res.arrayBuffer();\n }\n /* From Blob or File */\n } else if (_data instanceof File || _data instanceof Blob) {\n data = await readFromBlobOrFile(_data);\n }\n\n return new Uint8Array(data);\n};\n","const { defaultArgs, baseOptions } = require('./config');\nconst parseArgs = require('./utils/parseArgs');\nconst { defaultOptions, getCreateFFmpegCore } = require('./node');\nconst { version } = require('../package.json');\n\nconst NO_LOAD = Error('ffmpeg.wasm is not ready, make sure you have completed load().');\n\nmodule.exports = (_options = {}) => {\n const {\n log: optLog,\n logger,\n progress: optProgress,\n ...options\n } = {\n ...baseOptions,\n ...defaultOptions,\n ..._options,\n };\n let Core = null;\n let ffmpeg = null;\n let runResolve = null;\n let runReject = null;\n let running = false;\n let customLogger = () => {};\n let logging = optLog;\n let progress = optProgress;\n let duration = 0;\n let frames = 0;\n let readFrames = false;\n let ratio = 0;\n\n const detectCompletion = (message) => {\n if (message === 'FFMPEG_END' && runResolve !== null) {\n runResolve();\n runResolve = null;\n runReject = null;\n running = false;\n }\n };\n const log = (type, message) => {\n customLogger({ type, message });\n if (logging) {\n console.log(`[${type}] ${message}`);\n }\n };\n const ts2sec = (ts) => {\n const [h, m, s] = ts.split(':');\n return (parseFloat(h) * 60 * 60) + (parseFloat(m) * 60) + parseFloat(s);\n };\n const parseProgress = (message, prog) => {\n if (typeof message === 'string') {\n if (message.startsWith(' Duration')) {\n const ts = message.split(', ')[0].split(': ')[1];\n const d = ts2sec(ts);\n prog({ duration: d, ratio });\n if (duration === 0 || duration > d) {\n duration = d;\n readFrames = true;\n }\n } else if (readFrames && message.startsWith(' Stream')) {\n const match = message.match(/([\\d.]+) fps/);\n if (match) {\n const fps = parseFloat(match[1]);\n frames = duration * fps;\n } else {\n frames = 0;\n }\n readFrames = false;\n } else if (message.startsWith('frame') || message.startsWith('size')) {\n const ts = message.split('time=')[1].split(' ')[0];\n const t = ts2sec(ts);\n const match = message.match(/frame=\\s*(\\d+)/);\n if (frames && match) {\n const f = parseFloat(match[1]);\n ratio = Math.min(f / frames, 1);\n } else {\n ratio = t / duration;\n }\n prog({ ratio, time: t });\n } else if (message.startsWith('video:')) {\n prog({ ratio: 1 });\n duration = 0;\n }\n }\n };\n const parseMessage = ({ type, message }) => {\n log(type, message);\n parseProgress(message, progress);\n detectCompletion(message);\n };\n\n /*\n * Load ffmpeg.wasm-core script.\n * In browser environment, the ffmpeg.wasm-core script is fetch from\n * CDN and can be assign to a local path by assigning `corePath`.\n * In node environment, we use dynamic require and the default `corePath`\n * is `$ffmpeg/core`.\n *\n * Typically the load() func might take few seconds to minutes to complete,\n * better to do it as early as possible.\n *\n */\n const load = async () => {\n log('info', 'load ffmpeg-core');\n if (Core === null) {\n log('info', 'loading ffmpeg-core');\n /*\n * In node environment, all paths are undefined as there\n * is no need to set them.\n */\n const {\n createFFmpegCore,\n corePath,\n workerPath,\n wasmPath,\n } = await getCreateFFmpegCore(options);\n Core = await createFFmpegCore({\n /*\n * Assign mainScriptUrlOrBlob fixes chrome extension web worker issue\n * as there is no document.currentScript in the context of content_scripts\n */\n mainScriptUrlOrBlob: corePath,\n printErr: (message) => parseMessage({ type: 'fferr', message }),\n print: (message) => parseMessage({ type: 'ffout', message }),\n /*\n * locateFile overrides paths of files that is loaded by main script (ffmpeg-core.js).\n * It is critical for browser environment and we override both wasm and worker paths\n * as we are using blob URL instead of original URL to avoid cross origin issues.\n */\n locateFile: (path, prefix) => {\n if (typeof window !== 'undefined' || typeof WorkerGlobalScope !== 'undefined') {\n if (typeof wasmPath !== 'undefined'\n && path.endsWith('ffmpeg-core.wasm')) {\n return wasmPath;\n }\n if (typeof workerPath !== 'undefined'\n && path.endsWith('ffmpeg-core.worker.js')) {\n return workerPath;\n }\n }\n return prefix + path;\n },\n });\n ffmpeg = Core.cwrap(options.mainName || 'proxy_main', 'number', ['number', 'number']);\n log('info', 'ffmpeg-core loaded');\n } else {\n throw Error('ffmpeg.wasm was loaded, you should not load it again, use ffmpeg.isLoaded() to check next time.');\n }\n };\n\n /*\n * Determine whether the Core is loaded.\n */\n const isLoaded = () => Core !== null;\n\n /*\n * Run ffmpeg command.\n * This is the major function in ffmpeg.wasm, you can just imagine it\n * as ffmpeg native cli and what you need to pass is the same.\n *\n * For example, you can convert native command below:\n *\n * ```\n * $ ffmpeg -i video.avi -c:v libx264 video.mp4\n * ```\n *\n * To\n *\n * ```\n * await ffmpeg.run('-i', 'video.avi', '-c:v', 'libx264', 'video.mp4');\n * ```\n *\n */\n const run = (..._args) => {\n log('info', `run ffmpeg command: ${_args.join(' ')}`);\n if (Core === null) {\n throw NO_LOAD;\n } else if (running) {\n throw Error('ffmpeg.wasm can only run one command at a time');\n } else {\n running = true;\n return new Promise((resolve, reject) => {\n const args = [...defaultArgs, ..._args].filter((s) => s.length !== 0);\n runResolve = resolve;\n runReject = reject;\n ffmpeg(...parseArgs(Core, args));\n });\n }\n };\n\n /*\n * Run FS operations.\n * For input/output file of ffmpeg.wasm, it is required to save them to MEMFS\n * first so that ffmpeg.wasm is able to consume them. Here we rely on the FS\n * methods provided by Emscripten.\n *\n * Common methods to use are:\n * ffmpeg.FS('writeFile', 'video.avi', new Uint8Array(...)): writeFile writes\n * data to MEMFS. You need to use Uint8Array for binary data.\n * ffmpeg.FS('readFile', 'video.mp4'): readFile from MEMFS.\n * ffmpeg.FS('unlink', 'video.map'): delete file from MEMFS.\n *\n * For more info, check https://emscripten.org/docs/api_reference/Filesystem-API.html\n *\n */\n const FS = (method, ...args) => {\n log('info', `run FS.${method} ${args.map((arg) => (typeof arg === 'string' ? arg : `<${arg.length} bytes binary file>`)).join(' ')}`);\n if (Core === null) {\n throw NO_LOAD;\n } else {\n let ret = null;\n try {\n ret = Core.FS[method](...args);\n } catch (e) {\n if (method === 'readdir') {\n throw Error(`ffmpeg.FS('readdir', '${args[0]}') error. Check if the path exists, ex: ffmpeg.FS('readdir', '/')`);\n } else if (method === 'readFile') {\n throw Error(`ffmpeg.FS('readFile', '${args[0]}') error. Check if the path exists`);\n } else {\n throw Error('Oops, something went wrong in FS operation.');\n }\n }\n return ret;\n }\n };\n\n /**\n * forcibly terminate the ffmpeg program.\n */\n const exit = () => {\n if (Core === null) {\n throw NO_LOAD;\n } else {\n // if there's any pending runs, reject them\n if (runReject) {\n runReject('ffmpeg has exited');\n }\n running = false;\n try {\n Core.exit(1);\n } catch (err) {\n log(err.message);\n if (runReject) {\n runReject(err);\n }\n } finally {\n Core = null;\n ffmpeg = null;\n runResolve = null;\n runReject = null;\n }\n }\n };\n\n const setProgress = (_progress) => {\n progress = _progress;\n };\n\n const setLogger = (_logger) => {\n customLogger = _logger;\n };\n\n const setLogging = (_logging) => {\n logging = _logging;\n };\n\n log('info', `use ffmpeg.wasm v${version}`);\n\n return {\n setProgress,\n setLogger,\n setLogging,\n load,\n isLoaded,\n run,\n exit,\n FS,\n };\n};\n","module.exports = {\n defaultArgs: [\n /* args[0] is always the binary path */\n './ffmpeg',\n /* Disable interaction mode */\n '-nostdin',\n /* Force to override output file */\n '-y',\n ],\n baseOptions: {\n /* Flag to turn on/off log messages in console */\n log: false,\n /*\n * Custom logger to get ffmpeg.wasm output messages.\n * a sample logger looks like this:\n *\n * ```\n * logger = ({ type, message }) => {\n * console.log(type, message);\n * }\n * ```\n *\n * type can be one of following:\n *\n * info: internal workflow debug messages\n * fferr: ffmpeg native stderr output\n * ffout: ffmpeg native stdout output\n */\n logger: () => {},\n /*\n * Progress handler to get current progress of ffmpeg command.\n * a sample progress handler looks like this:\n *\n * ```\n * progress = ({ ratio }) => {\n * console.log(ratio);\n * }\n * ```\n *\n * ratio is a float number between 0 to 1.\n */\n progress: () => {},\n /*\n * Path to find/download ffmpeg.wasm-core,\n * this value should be overwriten by `defaultOptions` in\n * each environment.\n */\n corePath: '',\n },\n};\n","module.exports = (Core, args) => {\n const argsPtr = Core._malloc(args.length * Uint32Array.BYTES_PER_ELEMENT);\n args.forEach((s, idx) => {\n const sz = Core.lengthBytesUTF8(s) + 1;\n const buf = Core._malloc(sz);\n Core.stringToUTF8(s, buf, sz);\n Core.setValue(argsPtr + (Uint32Array.BYTES_PER_ELEMENT * idx), buf, 'i32');\n });\n return [args.length, argsPtr];\n};\n","require('regenerator-runtime/runtime');\nconst createFFmpeg = require('./createFFmpeg');\nconst { fetchFile } = require('./node');\n\nmodule.exports = {\n /*\n * Create ffmpeg instance.\n * Each ffmpeg instance owns an isolated MEMFS and works\n * independently.\n *\n * For example:\n *\n * ```\n * const ffmpeg = createFFmpeg({\n * log: true,\n * logger: () => {},\n * progress: () => {},\n * corePath: '',\n * })\n * ```\n *\n * For the usage of these four arguments, check config.js\n *\n */\n createFFmpeg,\n /*\n * Helper function for fetching files from various resource.\n * Sometimes the video/audio file you want to process may located\n * in a remote URL and somewhere in your local file system.\n *\n * This helper function helps you to fetch to file and return an\n * Uint8Array variable for ffmpeg.wasm to consume.\n *\n */\n fetchFile,\n};\n"],"names":["defaultOptions$1","corePath","pkg","devDependencies","substring","logging","customLogger","log_1","type","message","console","log","errors","toBlobURL","async","url","mimeType","buf","fetch","arrayBuffer","byteLength","blob","Blob","blobURL","URL","createObjectURL","_data","data","Uint8Array","test","atob","split","map","c","charCodeAt","res","href","File","Promise","resolve","reject","fileReader","FileReader","onload","result","onerror","target","error","code","Error","readAsArrayBuffer","_corePath","workerPath","_workerPath","wasmPath","_wasmPath","WorkerGlobalScope","self","coreRemotePath","undefined","replace","createFFmpegCore","globalThis","importScripts","CREATE_FFMPEG_CORE_IS_NOT_DEFINED","script","document","createElement","eventHandler","removeEventListener","src","addEventListener","getElementsByTagName","appendChild","defaultArgs","baseOptions","logger","progress","parseArgs","Core","args","argsPtr","_malloc","length","Uint32Array","BYTES_PER_ELEMENT","forEach","s","idx","sz","lengthBytesUTF8","stringToUTF8","setValue","defaultOptions","getCreateFFmpegCore","require$$2","version","require$$3","NO_LOAD","createFFmpeg","_options","optLog","optProgress","options","ffmpeg","runResolve","runReject","running","duration","frames","readFrames","ratio","ts2sec","ts","h","m","parseFloat","parseMessage","prog","startsWith","d","match","fps","t","f","Math","min","time","parseProgress","detectCompletion","setProgress","_progress","setLogger","_logger","setLogging","_logging","load","mainScriptUrlOrBlob","printErr","print","locateFile","path","prefix","window","endsWith","cwrap","mainName","isLoaded","run","_args","join","filter","exit","err","FS","method","arg","ret","e","fetchFile"],"mappings":"i0BASAA,EAAe,CAAEC,SAFb,kCAAkCC,EAAIC,gBAAgB,gBAAgBC,UAAU,0BCPpF,IAAIC,GAAU,EACVC,EAAe,OAiBnB,IAAAC,EAPY,CAACC,EAAMC,KACjBH,EAAa,CAAEE,OAAMC,YACjBJ,GACFK,QAAQC,IAAI,IAAIH,MAASC,IAC7B,ECPA,IAAAG,EAR2CX,GAAQ,uHACiEA,+ICSpH,MAAMY,EAAYC,MAAOC,EAAKC,KAC5BL,EAAI,OAAQ,SAASI,KACrB,MAAME,cAAmBC,MAAMH,IAAMI,cACrCR,EAAI,OAAQ,GAAGI,iBAAmBE,EAAIG,oBACtC,MAAMC,EAAO,IAAIC,KAAK,CAACL,GAAM,CAAET,KAAMQ,IAC/BO,EAAUC,IAAIC,gBAAgBJ,GAEpC,OADAV,EAAI,OAAQ,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_google_ignoreList":[0,1,2,3,4,5,6,7,8]}
@@ -0,0 +1 @@
1
+ .experiment-progress-container{position:absolute;bottom:5vh;right:5px;width:30px;height:95%;background-color:#d8d8d8;border-radius:5px;border:1px solid black;z-index:1000}.experiment-progress-bar{position:absolute;bottom:0;left:0;width:100%;background-color:#0f0;border-radius:5px;z-index:1000;transition:height .3s ease}html{height:100%}body{align-items:center;display:flex;height:100%;justify-content:center;margin:0}label,input,select{box-sizing:border-box;display:block;padding-bottom:.5em}input.text,select.text{margin-bottom:1em;padding:.5em;width:100%}fieldset{border:0;margin-top:1em;padding:0}a,a:active,a:focus,a:visited{color:#007eb7;outline:0}a:hover{color:#000}.progress{box-sizing:border-box;padding:.5em 0}.logo{display:block;margin:0 auto 1em;max-height:20vh;max-width:100%}.ui-dialog{left:50%!important;margin:0!important;max-width:88vw;position:fixed!important;top:50%!important;transform:translate(-50%,-50%)}.ui-dialog .ui-dialog-titlebar{align-items:center;font-weight:400}.ui-dialog.no-close .ui-dialog-titlebar-close{display:none}.ui-dialog-titlebar-close{display:flex;align-items:center;justify-content:center;background-color:transparent;padding:0!important}.ui-dialog .ui-dialog-content{margin-top:1em;max-height:calc(100vh - 12em)!important;overflow-y:auto}.ui-dialog .ui-dialog-buttonpane{box-sizing:border-box}@media only screen and (max-width: 1080px){.ui-dialog .ui-dialog-buttonpane{padding-top:1em}}#root.initialized:after{display:none}@media screen and (-ms-high-contrast: active),(-ms-high-contrast: none){#root:after{color:#a05000;content:"Initializing the experiment... | Internet Explorer / Edge [beta]";font-weight:700}}.hide-cursor{cursor:none}body.hide-cursor.swal2-shown,body.hide-cursor.swal2-toast-shown{cursor:default}.needs-page-button{white-space:normal;word-wrap:break-word;overflow-wrap:break-word;text-wrap:balance;text-align:center;line-height:1.15;display:flex;align-items:center;justify-content:center;border-radius:.3rem;background-color:#999;color:#fff;font-weight:400;font-size:.8rem;padding:.5rem;min-width:7rem;border:none;@media screen and (max-width: 560px){min-width:auto}}.needs-page-button:hover{background-color:#aaa}.needs-page-button:active{background-color:#666}.ui-dialog{z-index:1000000!important}#rc-panel-holder{z-index:99999;width:calc(100% - 2rem);margin:0 1rem}#rc-language-label{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}#rc-language{position:fixed;top:2rem;left:2rem}#lang-picker{font-size:1.2rem;padding:3px}.rsvpReadingTargetWordsKey{display:flex;flex-direction:row;position:absolute;top:2.5vh;left:1vw;z-index:9999999;font-size:2em}.rsvpReadingTargetWord{padding:20px}.hidden{visibility:hidden}.rsvpReadingTargetWordCurrent{text-decoration:underline;background:none}.simulated-cover{height:100vh;width:100vw;z-index:99999999999999999;pointer-events:none;background-color:#d3d3d3;opacity:95%;position:absolute;top:0;left:0}.simulated-ring{border:important 15px solid coral}#rc-distance-correct{text-align:left}#rc-distance-correct-instruction,#rc-distance-correct-guide{text-align:left!important}.calibration-nudger.rc-lang-rtl #rc-distance-correct{text-align:right;direction:rtl}.calibration-nudger.rc-lang-rtl #rc-distance-correct-instruction,.calibration-nudger.rc-lang-rtl #rc-distance-correct-guide{text-align:right!important}.calibration-nudger{z-index:9999999999}.calibration-background.rc-lang-rtl .calibration-instruction{direction:rtl;text-align:right}.ee-fullscreen-pause-popup .swal2-icon.swal2-info{border-color:#28a745;color:#28a745}.ee-fullscreen-pause-popup .swal2-icon.swal2-info .swal2-icon-content{color:#28a745}.ee-fullscreen-pause-popup .swal2-actions{gap:1rem}.ee-fullscreen-pause-quit-btn,.ee-fullscreen-pause-quit-btn:hover,.ee-fullscreen-pause-quit-btn:focus,.ee-fullscreen-pause-quit-btn:active{background-color:#dc3545;border-color:#dc3545;color:#fff}.ee-fullscreen-pause-quit-btn:hover,.ee-fullscreen-pause-quit-btn:focus{background-color:#bb2d3b;border-color:#b02a37;color:#fff}.threshold-button{position:fixed;z-index:999999;font-size:1.2rem;padding:.8rem 1.2rem;border:none;outline:none;background-color:#111;color:#fff;font-weight:700;border-radius:7px;cursor:pointer}.threshold-button:hover{outline:2px solid #000;outline-offset:.2rem}.threshold-button:active{outline:2px solid #000;outline-offset:.2rem;background-color:#444}.threshold-beep-button{top:1rem;right:1rem}.threshold-proceed-button{bottom:.5rem}.order-1{order:1}.order-2{order:2}.order-3{order:3}#characterSet-holder{position:fixed;margin:0;padding:0;z-index:9999999;font-size:3rem;max-width:100%;text-align:center;user-select:none!important}#characterSet-holder .characterSet{display:inline-block;padding:.5rem 1rem;border-radius:7px;box-sizing:border-box;border:2px solid rgba(0,0,0,0)}#characterSet-holder .characterSet:hover{border-color:#000;cursor:pointer}#soundTestModalSoundLevelContainer{display:flex}#soundTestModalSpeakerSoundGainContainer{display:flex;justify-content:space-between}#responseScreen{position:absolute;top:0;left:0;display:flex;flex-direction:column}#vocoder-phrase-header{z-index:9999999;margin-top:20vh;margin-left:10vw;font-size:xx-large}#vocoder-phrase-clickable-category{display:flex;flex-direction:row;width:100%;overflow-x:auto;z-index:9999999;margin-top:10vh;margin-left:10vw}.vocoder-phrase-category-item{display:inline-block;padding:5px;border-radius:7px;box-sizing:border-box;border:2px solid rgba(0,0,0,0)}.vocoder-phrase-category-item:hover{border-color:#000;cursor:pointer}.vocoder-phrase-category-title{font-weight:700}.vocoder-phrase-item-selected{border-color:#000}.vocoder-phrase-item-not-selected{border-color:#0000}#soundParametersFromCalibration{line-height:80%}#soundTestPlots{margin-left:5%;margin-right:5%}#micId{margin-top:10px;margin-bottom:10px;size:20;width:50%;border-radius:5px}#smartphoneCheckbox,#usbCheckbox{margin:10px 5px;width:20px;height:20px;border-radius:5px;border:1px solid black;background-color:#fff;vertical-align:middle;display:inline-block;position:relative;top:2px}#manufacturerInput,#modelNumberInput,#modelNameInput,#brandInput{width:30vw;height:45px;font-size:1rem;border-radius:5px;border:1px solid black;margin-top:10px;margin-bottom:10px}.autocomplete{position:relative;display:inline-block;z-index:9999}input{padding:10px;width:300px;z-index:9999}.autocomplete-items{position:absolute;border:1px solid #d4d4d4;max-height:150px;overflow-y:auto;z-index:9999;background-color:#fff}.autocomplete-item{padding:10px;cursor:pointer;z-index:9999}.highlight{font-weight:700;color:#00f}.highlight-red{font-weight:700;color:red}#loudspeakerInstructions1{width:100%;font-size:1rem;font-weight:400}#micDropdown{width:fit-content;font-size:1rem;border-radius:5px;border:none;background-color:#ddd;padding:10px}#micNameInput,#micManufacturerInput,#micSerialNumberInput,#modelNumberInput2,#modelNameInput2{width:30vw;height:100%;font-size:1rem;border-radius:5px;border:1px solid black;margin-top:10px;margin-bottom:10px}#loudspeakerInstructions2{font-size:1rem;font-weight:400;margin-top:10px}#completeTransducerTable{border-collapse:collapse}table tr{vertical-align:top}.responseScreen{font-size:1.5rem;display:flex;text-align:center;justify-content:center;align-items:center;cursor:auto;margin-top:10vh}.phrase-identification-grid{display:grid;grid-template-columns:repeat(var(--grid-columns),1fr);grid-template-rows:repeat(var(--grid-rows),1fr);gap:2px;margin:auto;z-index:9999999;width:fit-content;height:fit-content}.phrase-identification-category-title,.phrase-identification-category-item{display:flex;align-items:center;justify-content:center;font-family:var(--font-family);font-size:var(--font-size);letter-spacing:var(--letter-spacing);color:var(--font-color);padding:10px 15px;border-radius:7px;box-sizing:border-box;border:2px solid rgba(0,0,0,0);min-height:2.5em;min-width:8em;text-align:center;white-space:nowrap}.phrase-identification-category-title{font-weight:700}.phrase-identification-category-item:hover{border-color:var(--font-color);cursor:pointer;background-color:color-mix(in srgb,var(--font-color) 5%,transparent)}.phrase-identification-item-selected{border-color:var(--font-color);background-color:color-mix(in srgb,var(--font-color) 15%,transparent)}.phrase-identification-item-correct{background-color:#00800044}.phrase-identification-item-incorrect{background-color:#ff000042}.phrase-identification-header{z-index:9999999;font-size:xx-large}.phrase-identification-clickable-categories{margin:auto;display:flex;flex-direction:row;align-content:space-between;z-index:9999999}.phrase-identification-category-item{display:inline-block;padding:5px;border-radius:7px;box-sizing:border-box;border:2px solid rgba(0,0,0,0)}.phrase-identification-category-item:hover{border-color:var(--font-color);cursor:pointer}.phrase-identification-item-selected{border-color:var(--font-color)}.phrase-identification-item-not-selected{border-color:#0000}.scientist-feedback-circle{width:50px;height:50px;border-radius:50%;border-color:#000;border-width:2px;border-style:solid;background-color:#add8e6;visibility:visible}.scientist-feedback-circle-container{display:flex;flex-direction:row;z-index:9999999;height:100px;position:absolute;bottom:0;left:calc(50% - 50vw)}.scientist-feedback-circle-correct{background-color:#00800044}.scientist-feedback-circle-incorrect{background-color:#ff000042}.phrase-identification-category-column{display:flex;flex-direction:column}#form-container{position:absolute;top:5%;left:50%;transform:translate(-50%);width:80%;max-width:1024px;height:75%;display:none;background-color:#eee;z-index:1000005}#form-pdf{position:absolute;width:100%;height:100%;display:none;z-index:1000005}#form-md{position:absolute;width:100%;height:100%;overflow:auto;display:none;z-index:1000005}#form-input{position:absolute;top:100%;left:50%;transform:translate(-50%);text-align:center;width:100%;height:max-content;display:none;z-index:0;margin-top:20px}#form-payment-info{position:absolute;top:115%;left:50%;transform:translate(-50%);width:90%;text-align:center;z-index:0}.form-input-btn{font-size:1.2rem;margin:0 .5rem;width:5rem;height:3rem!important;outline:none;border:none!important;border-radius:7px!important;font-weight:700!important;background-color:#ddd!important}.form-input-btn:hover{outline:2px solid #999!important;outline-offset:.2rem!important}.form-input-btn:active{outline:2px solid #999!important;outline-offset:.2rem!important;background-color:#bbb!important}html,body{background-color:#eee}body.easyeyes-gray-bg,html.easyeyes-gray-bg{background-color:#eee!important}body.easyeyes-gray-bg .btn,html.easyeyes-gray-bg .btn{font-weight:700!important}body.hide-ui-dialog .ui-dialog,body.hide-ui-dialog .ui-widget-overlay,body.hide-ui-dialog #expDialog,body.hide-ui-dialog .loading-container{display:none!important;visibility:hidden!important}.easyeyes-page-title{position:fixed;top:2rem;margin:0;padding:0;min-width:360px;max-width:calc(100vw - 4rem);white-space:pre-line;font-weight:400;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;z-index:1000007}.easyeyes-page-title.ltr{left:2rem;right:auto;direction:ltr;text-align:left}.easyeyes-page-title.rtl{right:2rem;left:auto;direction:rtl;text-align:right}@media (min-width: 481px){.easyeyes-page-title{font-size:2.5rem!important;line-height:100%}}@media (max-width: 480px){.easyeyes-page-title{top:1rem;font-size:1.8rem!important;line-height:120%;max-width:calc(100vw - 2rem)}.easyeyes-page-title.ltr{left:1rem}.easyeyes-page-title.rtl{right:1rem}}#exp-end-text{position:fixed;top:0;left:0;width:100%;height:100vh;background-color:#fff;font-size:1rem;display:grid;line-height:100vh;vertical-align:middle;grid-template-columns:auto;justify-content:space-around;visibility:hidden;z-index:10000;user-select:none}.popup-container{display:none;position:absolute;width:100%;height:100%;inset:0;z-index:1000007}.popup-background{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:-1}.popup{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:40%;height:30%;background-color:#fff;padding:1rem;z-index:1}.popup-title{position:relative;font-size:1.6rem}.popup-sub-text{position:relative;display:none;font-size:1rem}.popup-continue-button{position:absolute;display:none;left:1rem;bottom:1rem;text-align:center;padding:.5rem 1.2rem;background-color:#333;color:#fff;outline:none;border:none;cursor:pointer}.popup-continue-button:hover{background-color:#444}.popup-continue-button:active{background-color:#111}.sound-calibration-background{background-color:#fff;position:absolute;width:40%;top:10%!important}@keyframes fadeIn{0%{opacity:0;transform:translate3d(0,10%,0)}to{opacity:1;transform:translateZ(0)}}.fade-in{animation-name:fadeIn;animation-duration:.3s;animation-timing-function:ease-in-out;animation-fill-mode:forwards}.swal2-container,.swal2-container.swal2-backdrop-show,.swal2-container.swal2-backdrop-hide{background:#eee!important;cursor:default!important}.swal2-container.no-background{background:#00000080!important}.swal2-popup{width:80%;cursor:default;opacity:1;background:#fff!important;box-shadow:#959da533 0 8px 24px}.swal2-title{color:#000!important;font-size:1.6rem;font-weight:500;margin:3rem 2.5rem 1rem;padding:0;user-select:none;text-align:left}.swal2-radio{color:#000;flex-direction:column;font-weight:500;margin-top:.5rem;margin-bottom:.5rem}.swal2-radio .swal2-label{margin-left:1rem;font-size:1.5rem;line-height:150%;user-select:none}.swal2-radio label{width:80%!important;display:flex!important;justify-content:flex-start!important;align-items:center!important;margin:.3rem 0!important;font-size:1.5rem!important;cursor:pointer!important;padding:.5rem!important;background-color:#ddd!important;border-radius:7px!important}.swal2-radio label:hover{outline:2px solid #aaa!important;outline-offset:.2rem!important}.swal2-radio label:has(input[type=radio]:checked){background-color:#aaa!important}.swal2-radio label input{display:none}.swal2-textarea{resize:none;border-radius:7px;height:7rem}.swal2-confirm{background-color:#333!important;color:#fff!important;border:none!important;border-radius:7px!important;display:block;position:relative!important}.hidden-button{display:none!important}.swal2-input{font-family:Courier,monospace;font-size:2rem;margin:1rem 4rem 0}.swal2-input-label,.swal2-html-container{margin:2rem 4rem 0;line-height:150%}.swal2-cancel,.swal2-deny{border-radius:7px!important}.swal2-icon.swal2-error{border:none!important;margin-bottom:0!important}.swal2-file{padding:1rem}.id-collection-popup .threshold-button{position:relative}.centered-title{text-align:center}.narrow-popup{width:60%!important}.right-to-left{direction:rtl!important;text-align:right!important}.qa-answers-horizontal .swal2-radio{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(10rem,100%),1fr));gap:.5rem;width:80%!important;margin-left:auto;margin-right:auto}.qa-answers-horizontal .swal2-radio label{width:auto!important;margin:0!important;align-self:stretch!important}#trial-break-progress-bar-wrapper{display:none;position:absolute;bottom:.25rem;left:50%;transform:translate(-50%);width:2.25rem;height:.75rem;border:1px solid black;background-color:#eee;z-index:1000009}#trial-break-progress{position:absolute;top:0;bottom:0;left:0;height:100%;background-color:green;z-index:1000009}#progressMsg{display:none!important}.ui-progressbar-complete{height:110%!important;background-color:#96ceb4!important}.ui-dialog{padding:0!important;border:none!important;border-radius:7px!important;overflow:hidden;box-shadow:#00000040 0 54px 55px,#0000001f 0 -12px 30px,#0000001f 0 4px 6px,#0000002b 0 12px 13px,#00000017 0 -3px 5px!important}.ui-dialog-titlebar{border:none!important;border-radius:0!important}.ui-dialog-buttonpane{padding:.5rem!important}.ui-dialog-buttonset button{background-color:#999!important;padding:.5rem 1rem!important;border:none!important;outline:none!important;border-radius:7px!important;font-weight:700!important}.ui-dialog-buttonset button:hover{outline:2px solid #999!important;outline-offset:.2rem!important}.ui-dialog-buttonset button:active{outline:2px solid #999!important;outline-offset:.2rem!important;background-color:#bbb!important}.ui-dialog-content{padding:.5rem 1rem 1rem!important}.ui-dialog-content input{pointer-events:none!important}.hide-ui-dialog .ui-dialog{display:none!important}.psychojs-alert-text{font-weight:700;font-size:1.2rem;color:#d84532}#loader{position:absolute;left:50%;top:50%;z-index:1;width:120px;height:120px;margin:-76px 0 0 -76px;border:16px solid #f3f3f3;border-radius:50%;border-top:16px solid #afafaf;-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite}#loaderText{position:absolute;top:60%;left:44.5%;z-index:1}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.rsvp-speech-preflight{position:fixed;z-index:999998;left:50%;bottom:5rem;width:min(42rem,calc(100vw - 4rem));transform:translate(-50%);text-align:center;font-family:inherit}.rsvp-speech-preflight__message{margin:0;padding:.8rem 1rem;border-radius:.5rem;background:#ffffffeb;color:#111;font-size:1.1rem;line-height:1.4}.rsvp-speech-preflight__button:disabled{cursor:wait;opacity:.7}.rsvp-speech-preflight__button{left:50%;transform:translate(-50%)}