SourceTermAnalysisSystem_vue/node_modules/geotiff/dist-module/worker/decoder.js

10 lines
114 KiB
JavaScript
Raw Normal View History

2026-05-15 10:22:44 +08:00
import Worker from 'web-worker';
export function create() {
const source = "function A(A,e,t,i,r,I,g){try{var n=A[I](g),a=n.value}catch(A){return void t(A)}n.done?e(a):Promise.resolve(a).then(i,r)}function e(e){return function(){var t=this,i=arguments;return new Promise((function(r,I){var g=e.apply(t,i);function n(e){A(g,r,I,n,a,\"next\",e)}function a(e){A(g,r,I,n,a,\"throw\",e)}n(void 0)}))}}function t(A){return t=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&\"function\"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?\"symbol\":typeof A},t(A)}var i={exports:{}};!function(A){var e=function(A){var e,i=Object.prototype,r=i.hasOwnProperty,I=\"function\"==typeof Symbol?Symbol:{},g=I.iterator||\"@@iterator\",n=I.asyncIterator||\"@@asyncIterator\",a=I.toStringTag||\"@@toStringTag\";function o(A,e,t){return Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}),A[e]}try{o({},\"\")}catch(A){o=function(A,e,t){return A[e]=t}}function B(A,e,t,i){var r=e&&e.prototype instanceof h?e:h,I=Object.create(r.prototype),g=new S(i||[]);return I._invoke=function(A,e,t){var i=Q;return function(r,I){if(i===s)throw new Error(\"Generator is already running\");if(i===f){if(\"throw\"===r)throw I;return R()}for(t.method=r,t.arg=I;;){var g=t.delegate;if(g){var n=m(g,t);if(n){if(n===c)continue;return n}}if(\"next\"===t.method)t.sent=t._sent=t.arg;else if(\"throw\"===t.method){if(i===Q)throw i=f,t.arg;t.dispatchException(t.arg)}else\"return\"===t.method&&t.abrupt(\"return\",t.arg);i=s;var a=C(A,e,t);if(\"normal\"===a.type){if(i=t.done?f:E,a.arg===c)continue;return{value:a.arg,done:t.done}}\"throw\"===a.type&&(i=f,t.method=\"throw\",t.arg=a.arg)}}}(A,t,g),I}function C(A,e,t){try{return{type:\"normal\",arg:A.call(e,t)}}catch(A){return{type:\"throw\",arg:A}}}A.wrap=B;var Q=\"suspendedStart\",E=\"suspendedYield\",s=\"executing\",f=\"completed\",c={};function h(){}function l(){}function u(){}var w={};o(w,g,(function(){return this}));var d=Object.getPrototypeOf,D=d&&d(d(v([])));D&&D!==i&&r.call(D,g)&&(w=D);var y=u.prototype=h.prototype=Object.create(w);function k(A){[\"next\",\"throw\",\"return\"].forEach((function(e){o(A,e,(function(A){return this._invoke(e,A)}))}))}function p(A,e){function i(I,g,n,a){var o=C(A[I],A,g);if(\"throw\"!==o.type){var B=o.arg,Q=B.value;return Q&&\"object\"===t(Q)&&r.call(Q,\"__await\")?e.resolve(Q.__await).then((function(A){i(\"next\",A,n,a)}),(function(A){i(\"throw\",A,n,a)})):e.resolve(Q).then((function(A){B.value=A,n(B)}),(function(A){return i(\"throw\",A,n,a)}))}a(o.arg)}var I;this._invoke=function(A,t){function r(){return new e((function(e,r){i(A,t,e,r)}))}return I=I?I.then(r,r):r()}}function m(A,t){var i=A.iterator[t.method];if(i===e){if(t.delegate=null,\"throw\"===t.method){if(A.iterator.return&&(t.method=\"return\",t.arg=e,m(A,t),\"throw\"===t.method))return c;t.method=\"throw\",t.arg=new TypeError(\"The iterator does not provide a 'throw' method\")}return c}var r=C(i,A.iterator,t.arg);if(\"throw\"===r.type)return t.method=\"throw\",t.arg=r.arg,t.delegate=null,c;var I=r.arg;return I?I.done?(t[A.resultName]=I.value,t.next=A.nextLoc,\"return\"!==t.method&&(t.method=\"next\",t.arg=e),t.delegate=null,c):I:(t.method=\"throw\",t.arg=new TypeError(\"iterator result is not an object\"),t.delegate=null,c)}function G(A){var e={tryLoc:A[0]};1 in A&&(e.catchLoc=A[1]),2 in A&&(e.finallyLoc=A[2],e.afterLoc=A[3]),this.tryEntries.push(e)}function F(A){var e=A.completion||{};e.type=\"normal\",delete e.arg,A.completion=e}function S(A){this.tryEntries=[{tryLoc:\"root\"}],A.forEach(G,this),this.reset(!0)}function v(A){if(A){var t=A[g];if(t)return t.call(A);if(\"function\"==typeof A.next)return A;if(!isNaN(A.length)){var i=-1,I=function t(){for(;++i<A.length;)if(r.call(A,i))return t.value=A[i],t.done=!1,t;return t.value=e,t.done=!0,t};return I.next=I}}return{next:R}}function R(){return{value:e,done:!0}}return l.prototype=u,o(y,\"constructor\",u),o(u,\"constructor\",l),l.displayName=o(u,a,\"GeneratorFunction\"),A.isGeneratorFunction=function(A){var e=\"function\"==typeof A&&A.construct
return new Worker(typeof Buffer !== 'undefined'
? 'data:application/javascript;base64,' + Buffer.from(source, 'binary').toString('base64')
: URL.createObjectURL(new Blob([source], {type: 'application/javascript'})));
}