9d4e1f212bc434dcc3c05e97e4d9a8c9e3eaf6945823181ef1688aeef8c805d9.json 5.3 KB

1
  1. {"ast":null,"code":"/* eslint-disable @typescript-eslint/naming-convention */\n/**\n * This file is only for internal use only and should not be used in your code\n */\nimport { IsWindowObjectExist } from \"./domManagement.js\";\nimport { Tools } from \"./tools.js\";\nlet _UniqueResolveID = 0;\n/**\n * Load an asynchronous script (identified by an url) in a module way. When the url returns, the\n * content of this file is added into a new script element, attached to the DOM (body element)\n * @param scriptUrl defines the url of the script to load\n * @param scriptId defines the id of the script element\n * @returns a promise request object\n * It is up to the caller to provide a script that will do the import and prepare a \"returnedValue\" variable\n * @internal DO NOT USE outside of Babylon.js core\n */\nexport function _LoadScriptModuleAsync(scriptUrl, scriptId) {\n return new Promise((resolve, reject) => {\n // Need a relay\n let windowAsAny;\n let windowString;\n if (IsWindowObjectExist()) {\n windowAsAny = window;\n windowString = \"window\";\n } else if (typeof self !== \"undefined\") {\n windowAsAny = self;\n windowString = \"self\";\n } else {\n reject(new Error(\"Cannot load script module outside of a window or a worker\"));\n return;\n }\n if (!windowAsAny._LoadScriptModuleResolve) {\n windowAsAny._LoadScriptModuleResolve = {};\n }\n windowAsAny._LoadScriptModuleResolve[_UniqueResolveID] = resolve;\n scriptUrl += `\n ${windowString}._LoadScriptModuleResolve[${_UniqueResolveID}](returnedValue);\n ${windowString}._LoadScriptModuleResolve[${_UniqueResolveID}] = undefined;\n `;\n _UniqueResolveID++;\n Tools.LoadScript(scriptUrl, undefined, (message, exception) => {\n reject(exception || new Error(message));\n }, scriptId, true);\n });\n}","map":{"version":3,"names":["IsWindowObjectExist","Tools","_UniqueResolveID","_LoadScriptModuleAsync","scriptUrl","scriptId","Promise","resolve","reject","windowAsAny","windowString","window","self","Error","_LoadScriptModuleResolve","LoadScript","undefined","message","exception"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Misc/tools.internals.js"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\n/**\n * This file is only for internal use only and should not be used in your code\n */\nimport { IsWindowObjectExist } from \"./domManagement.js\";\nimport { Tools } from \"./tools.js\";\nlet _UniqueResolveID = 0;\n/**\n * Load an asynchronous script (identified by an url) in a module way. When the url returns, the\n * content of this file is added into a new script element, attached to the DOM (body element)\n * @param scriptUrl defines the url of the script to load\n * @param scriptId defines the id of the script element\n * @returns a promise request object\n * It is up to the caller to provide a script that will do the import and prepare a \"returnedValue\" variable\n * @internal DO NOT USE outside of Babylon.js core\n */\nexport function _LoadScriptModuleAsync(scriptUrl, scriptId) {\n return new Promise((resolve, reject) => {\n // Need a relay\n let windowAsAny;\n let windowString;\n if (IsWindowObjectExist()) {\n windowAsAny = window;\n windowString = \"window\";\n }\n else if (typeof self !== \"undefined\") {\n windowAsAny = self;\n windowString = \"self\";\n }\n else {\n reject(new Error(\"Cannot load script module outside of a window or a worker\"));\n return;\n }\n if (!windowAsAny._LoadScriptModuleResolve) {\n windowAsAny._LoadScriptModuleResolve = {};\n }\n windowAsAny._LoadScriptModuleResolve[_UniqueResolveID] = resolve;\n scriptUrl += `\r\n ${windowString}._LoadScriptModuleResolve[${_UniqueResolveID}](returnedValue);\r\n ${windowString}._LoadScriptModuleResolve[${_UniqueResolveID}] = undefined;\r\n `;\n _UniqueResolveID++;\n Tools.LoadScript(scriptUrl, undefined, (message, exception) => {\n reject(exception || new Error(message));\n }, scriptId, true);\n });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,SAASA,mBAAmB,QAAQ,oBAAoB;AACxD,SAASC,KAAK,QAAQ,YAAY;AAClC,IAAIC,gBAAgB,GAAG,CAAC;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAACC,SAAS,EAAEC,QAAQ,EAAE;EACxD,OAAO,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;IACpC;IACA,IAAIC,WAAW;IACf,IAAIC,YAAY;IAChB,IAAIV,mBAAmB,CAAC,CAAC,EAAE;MACvBS,WAAW,GAAGE,MAAM;MACpBD,YAAY,GAAG,QAAQ;IAC3B,CAAC,MACI,IAAI,OAAOE,IAAI,KAAK,WAAW,EAAE;MAClCH,WAAW,GAAGG,IAAI;MAClBF,YAAY,GAAG,MAAM;IACzB,CAAC,MACI;MACDF,MAAM,CAAC,IAAIK,KAAK,CAAC,2DAA2D,CAAC,CAAC;MAC9E;IACJ;IACA,IAAI,CAACJ,WAAW,CAACK,wBAAwB,EAAE;MACvCL,WAAW,CAACK,wBAAwB,GAAG,CAAC,CAAC;IAC7C;IACAL,WAAW,CAACK,wBAAwB,CAACZ,gBAAgB,CAAC,GAAGK,OAAO;IAChEH,SAAS,IAAI;AACrB,cAAcM,YAAY,6BAA6BR,gBAAgB;AACvE,cAAcQ,YAAY,6BAA6BR,gBAAgB;AACvE,SAAS;IACDA,gBAAgB,EAAE;IAClBD,KAAK,CAACc,UAAU,CAACX,SAAS,EAAEY,SAAS,EAAE,CAACC,OAAO,EAAEC,SAAS,KAAK;MAC3DV,MAAM,CAACU,SAAS,IAAI,IAAIL,KAAK,CAACI,OAAO,CAAC,CAAC;IAC3C,CAAC,EAAEZ,QAAQ,EAAE,IAAI,CAAC;EACtB,CAAC,CAAC;AACN","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}