@loaders.gl/textures 3.0.10 → 3.0.14
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.
- package/dist/basis-worker.js +1 -1
- package/dist/basis-worker.js.map +1 -1
- package/dist/compressed-texture-worker.js +1 -1
- package/dist/compressed-texture-worker.js.map +1 -1
- package/dist/crunch-worker.js +1 -1
- package/dist/crunch-worker.js.map +1 -1
- package/dist/dist.es5.min.js +1 -1
- package/dist/dist.es5.min.js.map +1 -1
- package/dist/dist.min.js +1 -1
- package/dist/dist.min.js.map +1 -1
- package/dist/es5/lib/utils/version.js +1 -1
- package/dist/esm/lib/encoders/encode-texture.js +1 -1
- package/dist/esm/lib/encoders/encode-texture.js.map +1 -1
- package/dist/esm/lib/parsers/parse-dds.js +1 -1
- package/dist/esm/lib/parsers/parse-dds.js.map +1 -1
- package/dist/esm/lib/parsers/parse-npy.js +1 -1
- package/dist/esm/lib/parsers/parse-npy.js.map +1 -1
- package/dist/esm/lib/texture-api/generate-url.js +1 -1
- package/dist/esm/lib/texture-api/generate-url.js.map +1 -1
- package/dist/esm/lib/utils/texture-formats.js +1 -1
- package/dist/esm/lib/utils/texture-formats.js.map +1 -1
- package/dist/esm/lib/utils/version.js +1 -1
- package/dist/npy-worker.js +1 -1
- package/dist/npy-worker.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var _=e[r]={i:r,l:!1,exports:{}};return t[r].call(_.exports,_,_.exports,n),_.l=!0,_.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var _ in t)n.d(r,_,function(e){return t[e]}.bind(null,_));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=8)}([function(t,e,n){t.exports=n(7)},function(t,e){function n(t,e,n,r,_,o,i){try{var a=t[o](i),S=a.value}catch(t){return void n(t)}a.done?e(S):Promise.resolve(S).then(r,_)}t.exports=function(t){return function(){var e=this,r=arguments;return new Promise((function(_,o){var i=t.apply(e,r);function a(t){n(i,_,o,a,S,"next",t)}function S(t){n(i,_,o,a,S,"throw",t)}a(void 0)}))}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function n(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=n=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),n(e)}t.exports=n,t.exports.default=t.exports,t.exports.__esModule=!0},,function(t,e,n){var r=function(t){"use strict";var e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},_=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",i=r.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function S(t,e,n,r){var _=e&&e.prototype instanceof s?e:s,o=Object.create(_.prototype),i=new M(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(_,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===_)throw o;return G()}for(n.method=_,n.arg=o;;){var i=n.delegate;if(i){var a=D(i,n);if(a){if(a===R)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var S=E(t,e,n);if("normal"===S.type){if(r=n.done?"completed":"suspendedYield",S.arg===R)continue;return{value:S.arg,done:n.done}}"throw"===S.type&&(r="completed",n.method="throw",n.arg=S.arg)}}}(t,n,i),o}function E(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=S;var R={};function s(){}function f(){}function u(){}var c={};c[_]=function(){return this};var A=Object.getPrototypeOf,C=A&&A(A(O([])));C&&C!==e&&n.call(C,_)&&(c=C);var l=u.prototype=s.prototype=Object.create(c);function P(t){["next","throw","return"].forEach((function(e){a(t,e,(function(t){return this._invoke(e,t)}))}))}function p(t,e){var r;this._invoke=function(_,o){function i(){return new e((function(r,i){!function r(_,o,i,a){var S=E(t[_],t,o);if("throw"!==S.type){var R=S.arg,s=R.value;return s&&"object"==typeof s&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,a)}),(function(t){r("throw",t,i,a)})):e.resolve(s).then((function(t){R.value=t,i(R)}),(function(t){return r("throw",t,i,a)}))}a(S.arg)}(_,o,r,i)}))}return r=r?r.then(i,i):i()}}function D(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,D(t,e),"throw"===e.method))return R;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return R}var r=E(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,R;var _=r.arg;return _?_.done?(e[t.resultName]=_.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,R):_:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,R)}function h(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(h,this),this.reset(!0)}function O(t){if(t){var e=t[_];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:G}}function G(){return{value:void 0,done:!0}}return f.prototype=l.constructor=u,u.constructor=f,f.displayName=a(u,i,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,u):(t.__proto__=u,a(t,i,"GeneratorFunction")),t.prototype=Object.create(l),t},t.awrap=function(t){return{__await:t}},P(p.prototype),p.prototype[o]=function(){return this},t.AsyncIterator=p,t.async=function(e,n,r,_,o){void 0===o&&(o=Promise);var i=new p(S(e,n,r,_),o);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},P(l),a(l,i,"Generator"),l[_]=function(){return this},l.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=O,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return i.type="throw",i.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var _=this.tryEntries.length-1;_>=0;--_){var o=this.tryEntries[_],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),S=n.call(o,"finallyLoc");if(a&&S){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!S)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var _=this.tryEntries[r];if(_.tryLoc<=this.prev&&n.call(_,"finallyLoc")&&this.prev<_.finallyLoc){var o=_;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,R):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),R},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),R}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var _=r.arg;T(n)}return _}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),R}},t}(t.exports);try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}},function(t,e,n){"use strict";n.r(e);var r=n(2),_=n.n(r),o=n(1),i=n.n(o),a=n(0),S=n.n(a),E=n(3),R=n.n(E),s=n(4),f=n.n(s),u=n(5),c=n.n(u);function A(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}var C=new Map,l=function(){function t(){R()(this,t)}return f()(t,null,[{key:"onmessage",set:function(t){self.onmessage=function(e){if(P(e)){var n=e.data,r=n.type,_=n.payload;t(r,_)}}}},{key:"addEventListener",value:function(t){var e=C.get(t);e||(e=function(e){if(P(e)){var n=e.data,r=n.type,_=n.payload;t(r,_)}}),self.addEventListener("message",e)}},{key:"removeEventListener",value:function(t){var e=C.get(t);C.delete(t),self.removeEventListener("message",e)}},{key:"postMessage",value:function(t,e){if(self){var n={source:"loaders.gl",type:t,payload:e},r=function t(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,_=r||new Set;if(e){if(A(e))_.add(e);else if(A(e.buffer))_.add(e.buffer);else if(ArrayBuffer.isView(e));else if(n&&"object"===c()(e))for(var o in e)t(e[o],n,_)}else;return void 0===r?Array.from(_):[]}(e);self.postMessage(n,r)}}}]),t}();function P(t){var e=t.type,n=t.data;return"message"===e&&n&&"string"==typeof n.source&&n.source.startsWith("loaders.gl")}function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function D(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach((function(e){_()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var h=0;function T(t,e){return new Promise((function(n,r){var _=h++;l.addEventListener((function t(e,o){if(o.id===_)switch(e){case"done":l.removeEventListener(t),n(o.result);break;case"error":l.removeEventListener(t),r(o.error)}}));var o={id:_,input:t,options:e};l.postMessage("process",o)}))}function M(t){return O.apply(this,arguments)}function O(){return(O=i()(S.a.mark((function t(e){var n,r,_,o,i,a,E;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.loader,r=e.arrayBuffer,_=e.options,o=e.context,!n.parseSync&&!n.parse){t.next=6;break}i=r,a=n.parseSync||n.parse,t.next=13;break;case 6:if(!n.parseTextSync){t.next=12;break}E=new TextDecoder,i=E.decode(r),a=n.parseTextSync,t.next=13;break;case 12:throw new Error("Could not load data with ".concat(n.name," loader"));case 13:return _=D(D({},_),{},{modules:n&&n.options&&n.options.modules||{},worker:!1}),t.next=16,a(i,D({},_),o,n);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}new Uint8Array([0]);const G=[171,75,84,88,32,50,48,187,13,10,26,10];var d,y,x,B,H,v,m,g;!function(t){t[t.NONE=0]="NONE",t[t.BASISLZ=1]="BASISLZ",t[t.ZSTD=2]="ZSTD",t[t.ZLIB=3]="ZLIB"}(d||(d={})),function(t){t[t.BASICFORMAT=0]="BASICFORMAT"}(y||(y={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ETC1S=163]="ETC1S",t[t.UASTC=166]="UASTC"}(x||(x={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.SRGB=1]="SRGB"}(B||(B={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.LINEAR=1]="LINEAR",t[t.SRGB=2]="SRGB",t[t.ITU=3]="ITU",t[t.NTSC=4]="NTSC",t[t.SLOG=5]="SLOG",t[t.SLOG2=6]="SLOG2"}(H||(H={})),function(t){t[t.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",t[t.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(v||(v={})),function(t){t[t.RGB=0]="RGB",t[t.RRR=3]="RRR",t[t.GGG=4]="GGG",t[t.AAA=15]="AAA"}(m||(m={})),function(t){t[t.RGB=0]="RGB",t[t.RGBA=3]="RGBA",t[t.RRR=4]="RRR",t[t.RRRG=5]="RRRG"}(g||(g={}));class L{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=d.NONE,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:y.BASICFORMAT,versionNumber:2,descriptorBlockSize:40,colorModel:x.UNSPECIFIED,colorPrimaries:B.SRGB,transferFunction:B.SRGB,flags:v.ALPHA_STRAIGHT,texelBlockDimension:{x:4,y:4,z:1,w:1},bytesPlane:[],samples:[]}],this.keyValue={},this.globalData=null}}class X{constructor(t,e,n,r){this._dataView=new DataView(t.buffer,t.byteOffset+e,n),this._littleEndian=r,this._offset=0}_nextUint8(){const t=this._dataView.getUint8(this._offset);return this._offset+=1,t}_nextUint16(){const t=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,t}_nextUint32(){const t=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,t}_nextUint64(){const t=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,t}_skip(t){return this._offset+=t,this}_scan(t,e=0){const n=this._offset;let r=0;for(;this._dataView.getUint8(this._offset)!==e&&r<t;)r++,this._offset++;return r<t&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,r)}}function w(t){return"undefined"!=typeof TextDecoder?(new TextDecoder).decode(t):Buffer.from(t).toString("utf8")}function b(t,e){for(var n=new Array(e.mipMapLevels),r=e.width,_=e.height,o=0,i=0;i<e.mipMapLevels;++i){var a=I(e,r,_,t,i),S=U(t,i,o,a);n[i]={compressed:!0,format:e.internalFormat,data:S,width:r,height:_,levelSize:a},r=Math.max(1,r>>1),_=Math.max(1,_>>1),o+=a}return n}function U(t,e,n,r){return Array.isArray(t)?t[e].levelData:new Uint8Array(t.buffer,t.byteOffset+n,r)}function I(t,e,n,r,_){return Array.isArray(r)?t.sizeFunction(r[_]):t.sizeFunction(e,n)}var K={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919},N={131:K.COMPRESSED_RGB_S3TC_DXT1_EXT,132:K.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:K.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:K.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:K.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:K.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:K.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:K.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:K.COMPRESSED_RED_RGTC1_EXT,140:K.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:K.COMPRESSED_RED_GREEN_RGTC2_EXT,142:K.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:K.COMPRESSED_RGB8_ETC2,148:K.COMPRESSED_SRGB8_ETC2,149:K.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:K.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:K.COMPRESSED_RGBA8_ETC2_EAC,152:K.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:K.COMPRESSED_R11_EAC,154:K.COMPRESSED_SIGNED_R11_EAC,155:K.COMPRESSED_RG11_EAC,156:K.COMPRESSED_SIGNED_RG11_EAC,157:K.COMPRESSED_RGBA_ASTC_4x4_KHR,158:K.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:K.COMPRESSED_RGBA_ASTC_5x4_KHR,160:K.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:K.COMPRESSED_RGBA_ASTC_5x5_KHR,162:K.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:K.COMPRESSED_RGBA_ASTC_6x5_KHR,164:K.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:K.COMPRESSED_RGBA_ASTC_6x6_KHR,166:K.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:K.COMPRESSED_RGBA_ASTC_8x5_KHR,168:K.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:K.COMPRESSED_RGBA_ASTC_8x6_KHR,170:K.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:K.COMPRESSED_RGBA_ASTC_8x8_KHR,172:K.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:K.COMPRESSED_RGBA_ASTC_10x5_KHR,174:K.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:K.COMPRESSED_RGBA_ASTC_10x6_KHR,176:K.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:K.COMPRESSED_RGBA_ASTC_10x8_KHR,178:K.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:K.COMPRESSED_RGBA_ASTC_10x10_KHR,180:K.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:K.COMPRESSED_RGBA_ASTC_12x10_KHR,182:K.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:K.COMPRESSED_RGBA_ASTC_12x12_KHR,184:K.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:K.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:K.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:K.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:K.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:K.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:K.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:K.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:K.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:K.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:K.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:K.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:K.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:K.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:K.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:K.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:K.COMPRESSED_RGBA_ASTC_12x12_KHR};var F=[171,75,84,88,32,50,48,187,13,10,26,10];function k(t){var e,n=function(t){const e=new Uint8Array(t.buffer,t.byteOffset,G.length);if(e[0]!==G[0]||e[1]!==G[1]||e[2]!==G[2]||e[3]!==G[3]||e[4]!==G[4]||e[5]!==G[5]||e[6]!==G[6]||e[7]!==G[7]||e[8]!==G[8]||e[9]!==G[9]||e[10]!==G[10]||e[11]!==G[11])throw new Error("Missing KTX 2.0 identifier.");const n=new L,r=17*Uint32Array.BYTES_PER_ELEMENT,_=new X(t,G.length,r,!0);n.vkFormat=_._nextUint32(),n.typeSize=_._nextUint32(),n.pixelWidth=_._nextUint32(),n.pixelHeight=_._nextUint32(),n.pixelDepth=_._nextUint32(),n.layerCount=_._nextUint32(),n.faceCount=_._nextUint32();const o=_._nextUint32();n.supercompressionScheme=_._nextUint32();const i=_._nextUint32(),a=_._nextUint32(),S=_._nextUint32(),E=_._nextUint32(),R=_._nextUint64(),s=_._nextUint64(),f=new X(t,G.length+r,3*o*8,!0);for(let e=0;e<o;e++)n.levels.push({levelData:new Uint8Array(t.buffer,t.byteOffset+f._nextUint64(),f._nextUint64()),uncompressedByteLength:f._nextUint64()});const u=new X(t,i,a,!0),c={vendorId:u._skip(4)._nextUint16(),descriptorType:u._nextUint16(),versionNumber:u._nextUint16(),descriptorBlockSize:u._nextUint16(),colorModel:u._nextUint8(),colorPrimaries:u._nextUint8(),transferFunction:u._nextUint8(),flags:u._nextUint8(),texelBlockDimension:{x:u._nextUint8()+1,y:u._nextUint8()+1,z:u._nextUint8()+1,w:u._nextUint8()+1},bytesPlane:[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],samples:[]},A=(c.descriptorBlockSize/4-6)/4;for(let t=0;t<A;t++)c.samples[t]={bitOffset:u._nextUint16(),bitLength:u._nextUint8(),channelID:u._nextUint8(),samplePosition:[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],sampleLower:u._nextUint32(),sampleUpper:u._nextUint32()};n.dataFormatDescriptor.length=0,n.dataFormatDescriptor.push(c);const C=new X(t,S,E,!0);for(;C._offset<E;){const t=C._nextUint32(),e=C._scan(t),r=w(e),_=C._scan(t-e.byteLength);n.keyValue[r]=r.match(/^ktx/i)?w(_):_,t%4&&C._skip(4-t%4)}if(s<=0)return n;const l=new X(t,R,s,!0),P=l._nextUint16(),p=l._nextUint16(),D=l._nextUint32(),h=l._nextUint32(),T=l._nextUint32(),M=l._nextUint32(),O=[];for(let t=0;t<o;t++)O.push({imageFlags:l._nextUint32(),rgbSliceByteOffset:l._nextUint32(),rgbSliceByteLength:l._nextUint32(),alphaSliceByteOffset:l._nextUint32(),alphaSliceByteLength:l._nextUint32()});const d=R+l._offset,y=d+D,x=y+h,B=x+T,H=new Uint8Array(t.buffer,t.byteOffset+d,D),v=new Uint8Array(t.buffer,t.byteOffset+y,h),m=new Uint8Array(t.buffer,t.byteOffset+x,T),g=new Uint8Array(t.buffer,t.byteOffset+B,M);return n.globalData={endpointCount:P,selectorCount:p,imageDescs:O,endpointsData:H,selectorsData:v,tablesData:m,extendedData:g},n}(new Uint8Array(t)),r=Math.max(1,n.levels.length),_=n.pixelWidth,o=n.pixelHeight,i=(e=n.vkFormat,N[e]);return b(n.levels,{mipMapLevels:r,width:_,height:o,sizeFunction:function(t){return t.uncompressedByteLength},internalFormat:i})}function j(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var V={MAGIC_NUMBER:542327876,HEADER_LENGTH:31,MAGIC_NUMBER_INDEX:0,HEADER_SIZE_INDEX:1,HEADER_FLAGS_INDEX:2,HEADER_HEIGHT_INDEX:3,HEADER_WIDTH_INDEX:4,MIPMAPCOUNT_INDEX:7,HEADER_PF_FLAGS_INDEX:20,HEADER_PF_FOURCC_INDEX:21,DDSD_MIPMAPCOUNT:131072,DDPF_FOURCC:4,PIXEL_FORMATS:{DXT1:K.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:K.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:K.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":K.COMPRESSED_RGB_ATC_WEBGL,ATCA:K.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:K.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},SIZE_FUNCTIONS:{DXT1:W,DXT3:Z,DXT5:Z,"ATC ":W,ATCA:Z,ATCI:Z}};function z(t){var e=new Int32Array(t,0,V.HEADER_LENGTH),n=e[V.HEADER_PF_FOURCC_INDEX];j(Boolean(e[V.HEADER_PF_FLAGS_INDEX]&V.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");var r,_=(r=n,String.fromCharCode(255&r,r>>8&255,r>>16&255,r>>24&255)),o=V.PIXEL_FORMATS[_],i=V.SIZE_FUNCTIONS[_];j(o&&i,"DDS: Unknown pixel format ".concat(n));var a=1;e[V.HEADER_FLAGS_INDEX]&V.DDSD_MIPMAPCOUNT&&(a=Math.max(1,e[V.MIPMAPCOUNT_INDEX]));var S=e[V.HEADER_WIDTH_INDEX],E=e[V.HEADER_HEIGHT_INDEX],R=e[V.HEADER_SIZE_INDEX]+4;return b(new Uint8Array(t,R),{mipMapLevels:a,width:S,height:E,sizeFunction:i,internalFormat:o})}function W(t,e){return(t+3>>2)*(e+3>>2)*8}function Z(t,e){return(t+3>>2)*(e+3>>2)*16}var Y=55727696,q=1347834371,J=13,Q=52,$=0,tt=2,et=4,nt=6,rt=7,_t=11,ot=12,it={0:[K.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[K.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[K.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[K.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[K.COMPRESSED_RGB_ETC1_WEBGL],7:[K.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[K.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[K.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[K.COMPRESSED_RGB8_ETC2],23:[K.COMPRESSED_RGBA8_ETC2_EAC],24:[K.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[K.COMPRESSED_R11_EAC],26:[K.COMPRESSED_RG11_EAC],27:[K.COMPRESSED_RGBA_ASTC_4X4_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[K.COMPRESSED_RGBA_ASTC_5X4_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[K.COMPRESSED_RGBA_ASTC_5X5_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[K.COMPRESSED_RGBA_ASTC_6X5_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[K.COMPRESSED_RGBA_ASTC_6X6_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[K.COMPRESSED_RGBA_ASTC_8X5_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[K.COMPRESSED_RGBA_ASTC_8X6_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[K.COMPRESSED_RGBA_ASTC_8X8_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[K.COMPRESSED_RGBA_ASTC_10X5_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[K.COMPRESSED_RGBA_ASTC_10X6_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[K.COMPRESSED_RGBA_ASTC_10X8_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[K.COMPRESSED_RGBA_ASTC_10X10_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[K.COMPRESSED_RGBA_ASTC_12X10_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[K.COMPRESSED_RGBA_ASTC_12X12_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},at={0:St,1:St,2:Et,3:Et,6:Rt,7:Rt,9:st,11:st,22:Rt,23:st,24:Rt,25:Rt,26:st,27:st,28:function(t,e){return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16},29:function(t,e){return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16},30:function(t,e){return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16},31:function(t,e){return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16},32:function(t,e){return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16},33:function(t,e){return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16},34:function(t,e){return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16},35:function(t,e){return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16},36:function(t,e){return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16},37:function(t,e){return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16},38:function(t,e){return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16},39:function(t,e){return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16},40:function(t,e){return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16}};function St(t,e){return(t=Math.max(t,16))*(e=Math.max(e,8))/4}function Et(t,e){return(t=Math.max(t,8))*(e=Math.max(e,8))/2}function Rt(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8}function st(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16}function ft(t){if(function(t){var e=new Uint8Array(t.buffer||t,t.byteOffset||0,F.length);return!(e[0]!==F[0]||e[1]!==F[1]||e[2]!==F[2]||e[3]!==F[3]||e[4]!==F[4]||e[5]!==F[5]||e[6]!==F[6]||e[7]!==F[7]||e[8]!==F[8]||e[9]!==F[9]||e[10]!==F[10]||e[11]!==F[11])}(t))return k(t);if(function(t){return new Uint32Array(t,0,V.HEADER_LENGTH)[V.MAGIC_NUMBER_INDEX]===V.MAGIC_NUMBER}(t))return z(t);if(function(t){var e=new Uint32Array(t,0,J)[$];return e===Y||e===q}(t))return function(t){var e=new Uint32Array(t,0,J),n=e[tt],r=e[et],_=it[n]||[],o=_.length>1&&r?_[1]:_[0],i=at[n],a=e[_t],S=e[rt],E=e[nt],R=Q+e[ot];return b(new Uint8Array(t,R),{mipMapLevels:a,width:S,height:E,sizeFunction:i,internalFormat:o})}(t);throw new Error("Texture container format not recognized")}function ut(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ct(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ut(Object(n),!0).forEach((function(e){_()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ut(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var At,Ct,lt={name:"Texture Containers",id:"compressed-texture",module:"textures",version:"3.0.10",worker:!0,extensions:["ktx","ktx2","dds","pvr"],mimeTypes:["image/ktx2","image/ktx","image/vnd-ms.dds","image/x-dds","application/octet-stream"],binary:!0,options:{"compressed-texture":{libraryPath:"libs/"}}},Pt=ct(ct({},lt),{},{parse:(At=i()(S.a.mark((function t(e){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",ft(e));case 1:case"end":return t.stop()}}),t)}))),function(t){return At.apply(this,arguments)})});Ct=Pt,"undefined"!=typeof self&&(l.onmessage=function(){var t=i()(S.a.mark((function t(e,n){var r,_,o,i,a;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e,t.next="process"===t.t0?3:16;break;case 3:return t.prev=3,r=n.input,_=n.options,o=void 0===_?{}:_,t.next=7,M({loader:Ct,arrayBuffer:r,options:o,context:{parse:T}});case 7:i=t.sent,l.postMessage("done",{result:i}),t.next=15;break;case 11:t.prev=11,t.t1=t.catch(3),a=t.t1 instanceof Error?t.t1.message:"",l.postMessage("error",{error:a});case 15:return t.abrupt("break",16);case 16:case"end":return t.stop()}}),t,null,[[3,11]])})));return function(e,n){return t.apply(this,arguments)}}())}]);
|
|
1
|
+
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var _=e[r]={i:r,l:!1,exports:{}};return t[r].call(_.exports,_,_.exports,n),_.l=!0,_.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var _ in t)n.d(r,_,function(e){return t[e]}.bind(null,_));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=8)}([function(t,e,n){t.exports=n(7)},function(t,e){function n(t,e,n,r,_,o,i){try{var a=t[o](i),S=a.value}catch(t){return void n(t)}a.done?e(S):Promise.resolve(S).then(r,_)}t.exports=function(t){return function(){var e=this,r=arguments;return new Promise((function(_,o){var i=t.apply(e,r);function a(t){n(i,_,o,a,S,"next",t)}function S(t){n(i,_,o,a,S,"throw",t)}a(void 0)}))}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function n(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=n=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),n(e)}t.exports=n,t.exports.default=t.exports,t.exports.__esModule=!0},,function(t,e,n){var r=function(t){"use strict";var e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},_=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",i=r.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function S(t,e,n,r){var _=e&&e.prototype instanceof s?e:s,o=Object.create(_.prototype),i=new M(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(_,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===_)throw o;return G()}for(n.method=_,n.arg=o;;){var i=n.delegate;if(i){var a=D(i,n);if(a){if(a===R)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var S=E(t,e,n);if("normal"===S.type){if(r=n.done?"completed":"suspendedYield",S.arg===R)continue;return{value:S.arg,done:n.done}}"throw"===S.type&&(r="completed",n.method="throw",n.arg=S.arg)}}}(t,n,i),o}function E(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=S;var R={};function s(){}function f(){}function u(){}var c={};c[_]=function(){return this};var A=Object.getPrototypeOf,C=A&&A(A(O([])));C&&C!==e&&n.call(C,_)&&(c=C);var l=u.prototype=s.prototype=Object.create(c);function P(t){["next","throw","return"].forEach((function(e){a(t,e,(function(t){return this._invoke(e,t)}))}))}function p(t,e){var r;this._invoke=function(_,o){function i(){return new e((function(r,i){!function r(_,o,i,a){var S=E(t[_],t,o);if("throw"!==S.type){var R=S.arg,s=R.value;return s&&"object"==typeof s&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,a)}),(function(t){r("throw",t,i,a)})):e.resolve(s).then((function(t){R.value=t,i(R)}),(function(t){return r("throw",t,i,a)}))}a(S.arg)}(_,o,r,i)}))}return r=r?r.then(i,i):i()}}function D(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,D(t,e),"throw"===e.method))return R;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return R}var r=E(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,R;var _=r.arg;return _?_.done?(e[t.resultName]=_.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,R):_:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,R)}function h(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(h,this),this.reset(!0)}function O(t){if(t){var e=t[_];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:G}}function G(){return{value:void 0,done:!0}}return f.prototype=l.constructor=u,u.constructor=f,f.displayName=a(u,i,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,u):(t.__proto__=u,a(t,i,"GeneratorFunction")),t.prototype=Object.create(l),t},t.awrap=function(t){return{__await:t}},P(p.prototype),p.prototype[o]=function(){return this},t.AsyncIterator=p,t.async=function(e,n,r,_,o){void 0===o&&(o=Promise);var i=new p(S(e,n,r,_),o);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},P(l),a(l,i,"Generator"),l[_]=function(){return this},l.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=O,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return i.type="throw",i.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var _=this.tryEntries.length-1;_>=0;--_){var o=this.tryEntries[_],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),S=n.call(o,"finallyLoc");if(a&&S){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!S)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var _=this.tryEntries[r];if(_.tryLoc<=this.prev&&n.call(_,"finallyLoc")&&this.prev<_.finallyLoc){var o=_;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,R):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),R},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),R}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var _=r.arg;T(n)}return _}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),R}},t}(t.exports);try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}},function(t,e,n){"use strict";n.r(e);var r=n(2),_=n.n(r),o=n(1),i=n.n(o),a=n(0),S=n.n(a),E=n(3),R=n.n(E),s=n(4),f=n.n(s),u=n(5),c=n.n(u);function A(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}var C=new Map,l=function(){function t(){R()(this,t)}return f()(t,null,[{key:"onmessage",set:function(t){self.onmessage=function(e){if(P(e)){var n=e.data,r=n.type,_=n.payload;t(r,_)}}}},{key:"addEventListener",value:function(t){var e=C.get(t);e||(e=function(e){if(P(e)){var n=e.data,r=n.type,_=n.payload;t(r,_)}}),self.addEventListener("message",e)}},{key:"removeEventListener",value:function(t){var e=C.get(t);C.delete(t),self.removeEventListener("message",e)}},{key:"postMessage",value:function(t,e){if(self){var n={source:"loaders.gl",type:t,payload:e},r=function t(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,_=r||new Set;if(e){if(A(e))_.add(e);else if(A(e.buffer))_.add(e.buffer);else if(ArrayBuffer.isView(e));else if(n&&"object"===c()(e))for(var o in e)t(e[o],n,_)}else;return void 0===r?Array.from(_):[]}(e);self.postMessage(n,r)}}}]),t}();function P(t){var e=t.type,n=t.data;return"message"===e&&n&&"string"==typeof n.source&&n.source.startsWith("loaders.gl")}function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function D(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach((function(e){_()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var h=0;function T(t,e){return new Promise((function(n,r){var _=h++;l.addEventListener((function t(e,o){if(o.id===_)switch(e){case"done":l.removeEventListener(t),n(o.result);break;case"error":l.removeEventListener(t),r(o.error)}}));var o={id:_,input:t,options:e};l.postMessage("process",o)}))}function M(t){return O.apply(this,arguments)}function O(){return(O=i()(S.a.mark((function t(e){var n,r,_,o,i,a,E;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.loader,r=e.arrayBuffer,_=e.options,o=e.context,!n.parseSync&&!n.parse){t.next=6;break}i=r,a=n.parseSync||n.parse,t.next=13;break;case 6:if(!n.parseTextSync){t.next=12;break}E=new TextDecoder,i=E.decode(r),a=n.parseTextSync,t.next=13;break;case 12:throw new Error("Could not load data with ".concat(n.name," loader"));case 13:return _=D(D({},_),{},{modules:n&&n.options&&n.options.modules||{},worker:!1}),t.next=16,a(i,D({},_),o,n);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}new Uint8Array([0]);const G=[171,75,84,88,32,50,48,187,13,10,26,10];var d,y,x,B,H,v,m,g;!function(t){t[t.NONE=0]="NONE",t[t.BASISLZ=1]="BASISLZ",t[t.ZSTD=2]="ZSTD",t[t.ZLIB=3]="ZLIB"}(d||(d={})),function(t){t[t.BASICFORMAT=0]="BASICFORMAT"}(y||(y={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ETC1S=163]="ETC1S",t[t.UASTC=166]="UASTC"}(x||(x={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.SRGB=1]="SRGB"}(B||(B={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.LINEAR=1]="LINEAR",t[t.SRGB=2]="SRGB",t[t.ITU=3]="ITU",t[t.NTSC=4]="NTSC",t[t.SLOG=5]="SLOG",t[t.SLOG2=6]="SLOG2"}(H||(H={})),function(t){t[t.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",t[t.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(v||(v={})),function(t){t[t.RGB=0]="RGB",t[t.RRR=3]="RRR",t[t.GGG=4]="GGG",t[t.AAA=15]="AAA"}(m||(m={})),function(t){t[t.RGB=0]="RGB",t[t.RGBA=3]="RGBA",t[t.RRR=4]="RRR",t[t.RRRG=5]="RRRG"}(g||(g={}));class L{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=d.NONE,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:y.BASICFORMAT,versionNumber:2,descriptorBlockSize:40,colorModel:x.UNSPECIFIED,colorPrimaries:B.SRGB,transferFunction:B.SRGB,flags:v.ALPHA_STRAIGHT,texelBlockDimension:{x:4,y:4,z:1,w:1},bytesPlane:[],samples:[]}],this.keyValue={},this.globalData=null}}class X{constructor(t,e,n,r){this._dataView=new DataView(t.buffer,t.byteOffset+e,n),this._littleEndian=r,this._offset=0}_nextUint8(){const t=this._dataView.getUint8(this._offset);return this._offset+=1,t}_nextUint16(){const t=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,t}_nextUint32(){const t=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,t}_nextUint64(){const t=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,t}_skip(t){return this._offset+=t,this}_scan(t,e=0){const n=this._offset;let r=0;for(;this._dataView.getUint8(this._offset)!==e&&r<t;)r++,this._offset++;return r<t&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,r)}}function w(t){return"undefined"!=typeof TextDecoder?(new TextDecoder).decode(t):Buffer.from(t).toString("utf8")}function b(t,e){for(var n=new Array(e.mipMapLevels),r=e.width,_=e.height,o=0,i=0;i<e.mipMapLevels;++i){var a=I(e,r,_,t,i),S=U(t,i,o,a);n[i]={compressed:!0,format:e.internalFormat,data:S,width:r,height:_,levelSize:a},r=Math.max(1,r>>1),_=Math.max(1,_>>1),o+=a}return n}function U(t,e,n,r){return Array.isArray(t)?t[e].levelData:new Uint8Array(t.buffer,t.byteOffset+n,r)}function I(t,e,n,r,_){return Array.isArray(r)?t.sizeFunction(r[_]):t.sizeFunction(e,n)}var K={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919},N={131:K.COMPRESSED_RGB_S3TC_DXT1_EXT,132:K.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:K.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:K.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:K.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:K.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:K.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:K.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:K.COMPRESSED_RED_RGTC1_EXT,140:K.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:K.COMPRESSED_RED_GREEN_RGTC2_EXT,142:K.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:K.COMPRESSED_RGB8_ETC2,148:K.COMPRESSED_SRGB8_ETC2,149:K.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:K.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:K.COMPRESSED_RGBA8_ETC2_EAC,152:K.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:K.COMPRESSED_R11_EAC,154:K.COMPRESSED_SIGNED_R11_EAC,155:K.COMPRESSED_RG11_EAC,156:K.COMPRESSED_SIGNED_RG11_EAC,157:K.COMPRESSED_RGBA_ASTC_4x4_KHR,158:K.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:K.COMPRESSED_RGBA_ASTC_5x4_KHR,160:K.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:K.COMPRESSED_RGBA_ASTC_5x5_KHR,162:K.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:K.COMPRESSED_RGBA_ASTC_6x5_KHR,164:K.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:K.COMPRESSED_RGBA_ASTC_6x6_KHR,166:K.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:K.COMPRESSED_RGBA_ASTC_8x5_KHR,168:K.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:K.COMPRESSED_RGBA_ASTC_8x6_KHR,170:K.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:K.COMPRESSED_RGBA_ASTC_8x8_KHR,172:K.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:K.COMPRESSED_RGBA_ASTC_10x5_KHR,174:K.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:K.COMPRESSED_RGBA_ASTC_10x6_KHR,176:K.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:K.COMPRESSED_RGBA_ASTC_10x8_KHR,178:K.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:K.COMPRESSED_RGBA_ASTC_10x10_KHR,180:K.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:K.COMPRESSED_RGBA_ASTC_12x10_KHR,182:K.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:K.COMPRESSED_RGBA_ASTC_12x12_KHR,184:K.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:K.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:K.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:K.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:K.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:K.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:K.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:K.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:K.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:K.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:K.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:K.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:K.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:K.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:K.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:K.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:K.COMPRESSED_RGBA_ASTC_12x12_KHR};var F=[171,75,84,88,32,50,48,187,13,10,26,10];function k(t){var e,n=function(t){const e=new Uint8Array(t.buffer,t.byteOffset,G.length);if(e[0]!==G[0]||e[1]!==G[1]||e[2]!==G[2]||e[3]!==G[3]||e[4]!==G[4]||e[5]!==G[5]||e[6]!==G[6]||e[7]!==G[7]||e[8]!==G[8]||e[9]!==G[9]||e[10]!==G[10]||e[11]!==G[11])throw new Error("Missing KTX 2.0 identifier.");const n=new L,r=17*Uint32Array.BYTES_PER_ELEMENT,_=new X(t,G.length,r,!0);n.vkFormat=_._nextUint32(),n.typeSize=_._nextUint32(),n.pixelWidth=_._nextUint32(),n.pixelHeight=_._nextUint32(),n.pixelDepth=_._nextUint32(),n.layerCount=_._nextUint32(),n.faceCount=_._nextUint32();const o=_._nextUint32();n.supercompressionScheme=_._nextUint32();const i=_._nextUint32(),a=_._nextUint32(),S=_._nextUint32(),E=_._nextUint32(),R=_._nextUint64(),s=_._nextUint64(),f=new X(t,G.length+r,3*o*8,!0);for(let e=0;e<o;e++)n.levels.push({levelData:new Uint8Array(t.buffer,t.byteOffset+f._nextUint64(),f._nextUint64()),uncompressedByteLength:f._nextUint64()});const u=new X(t,i,a,!0),c={vendorId:u._skip(4)._nextUint16(),descriptorType:u._nextUint16(),versionNumber:u._nextUint16(),descriptorBlockSize:u._nextUint16(),colorModel:u._nextUint8(),colorPrimaries:u._nextUint8(),transferFunction:u._nextUint8(),flags:u._nextUint8(),texelBlockDimension:{x:u._nextUint8()+1,y:u._nextUint8()+1,z:u._nextUint8()+1,w:u._nextUint8()+1},bytesPlane:[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],samples:[]},A=(c.descriptorBlockSize/4-6)/4;for(let t=0;t<A;t++)c.samples[t]={bitOffset:u._nextUint16(),bitLength:u._nextUint8(),channelID:u._nextUint8(),samplePosition:[u._nextUint8(),u._nextUint8(),u._nextUint8(),u._nextUint8()],sampleLower:u._nextUint32(),sampleUpper:u._nextUint32()};n.dataFormatDescriptor.length=0,n.dataFormatDescriptor.push(c);const C=new X(t,S,E,!0);for(;C._offset<E;){const t=C._nextUint32(),e=C._scan(t),r=w(e),_=C._scan(t-e.byteLength);n.keyValue[r]=r.match(/^ktx/i)?w(_):_,t%4&&C._skip(4-t%4)}if(s<=0)return n;const l=new X(t,R,s,!0),P=l._nextUint16(),p=l._nextUint16(),D=l._nextUint32(),h=l._nextUint32(),T=l._nextUint32(),M=l._nextUint32(),O=[];for(let t=0;t<o;t++)O.push({imageFlags:l._nextUint32(),rgbSliceByteOffset:l._nextUint32(),rgbSliceByteLength:l._nextUint32(),alphaSliceByteOffset:l._nextUint32(),alphaSliceByteLength:l._nextUint32()});const d=R+l._offset,y=d+D,x=y+h,B=x+T,H=new Uint8Array(t.buffer,t.byteOffset+d,D),v=new Uint8Array(t.buffer,t.byteOffset+y,h),m=new Uint8Array(t.buffer,t.byteOffset+x,T),g=new Uint8Array(t.buffer,t.byteOffset+B,M);return n.globalData={endpointCount:P,selectorCount:p,imageDescs:O,endpointsData:H,selectorsData:v,tablesData:m,extendedData:g},n}(new Uint8Array(t)),r=Math.max(1,n.levels.length),_=n.pixelWidth,o=n.pixelHeight,i=(e=n.vkFormat,N[e]);return b(n.levels,{mipMapLevels:r,width:_,height:o,sizeFunction:function(t){return t.uncompressedByteLength},internalFormat:i})}function j(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var V={MAGIC_NUMBER:542327876,HEADER_LENGTH:31,MAGIC_NUMBER_INDEX:0,HEADER_SIZE_INDEX:1,HEADER_FLAGS_INDEX:2,HEADER_HEIGHT_INDEX:3,HEADER_WIDTH_INDEX:4,MIPMAPCOUNT_INDEX:7,HEADER_PF_FLAGS_INDEX:20,HEADER_PF_FOURCC_INDEX:21,DDSD_MIPMAPCOUNT:131072,DDPF_FOURCC:4,PIXEL_FORMATS:{DXT1:K.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:K.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:K.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":K.COMPRESSED_RGB_ATC_WEBGL,ATCA:K.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:K.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},SIZE_FUNCTIONS:{DXT1:W,DXT3:Z,DXT5:Z,"ATC ":W,ATCA:Z,ATCI:Z}};function z(t){var e=new Int32Array(t,0,V.HEADER_LENGTH),n=e[V.HEADER_PF_FOURCC_INDEX];j(Boolean(e[V.HEADER_PF_FLAGS_INDEX]&V.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");var r,_=(r=n,String.fromCharCode(255&r,r>>8&255,r>>16&255,r>>24&255)),o=V.PIXEL_FORMATS[_],i=V.SIZE_FUNCTIONS[_];j(o&&i,"DDS: Unknown pixel format ".concat(n));var a=1;e[V.HEADER_FLAGS_INDEX]&V.DDSD_MIPMAPCOUNT&&(a=Math.max(1,e[V.MIPMAPCOUNT_INDEX]));var S=e[V.HEADER_WIDTH_INDEX],E=e[V.HEADER_HEIGHT_INDEX],R=e[V.HEADER_SIZE_INDEX]+4;return b(new Uint8Array(t,R),{mipMapLevels:a,width:S,height:E,sizeFunction:i,internalFormat:o})}function W(t,e){return(t+3>>2)*(e+3>>2)*8}function Z(t,e){return(t+3>>2)*(e+3>>2)*16}var Y=55727696,q=1347834371,J=13,Q=52,$=0,tt=2,et=4,nt=6,rt=7,_t=11,ot=12,it={0:[K.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[K.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[K.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[K.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[K.COMPRESSED_RGB_ETC1_WEBGL],7:[K.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[K.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[K.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[K.COMPRESSED_RGB8_ETC2],23:[K.COMPRESSED_RGBA8_ETC2_EAC],24:[K.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[K.COMPRESSED_R11_EAC],26:[K.COMPRESSED_RG11_EAC],27:[K.COMPRESSED_RGBA_ASTC_4X4_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[K.COMPRESSED_RGBA_ASTC_5X4_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[K.COMPRESSED_RGBA_ASTC_5X5_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[K.COMPRESSED_RGBA_ASTC_6X5_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[K.COMPRESSED_RGBA_ASTC_6X6_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[K.COMPRESSED_RGBA_ASTC_8X5_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[K.COMPRESSED_RGBA_ASTC_8X6_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[K.COMPRESSED_RGBA_ASTC_8X8_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[K.COMPRESSED_RGBA_ASTC_10X5_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[K.COMPRESSED_RGBA_ASTC_10X6_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[K.COMPRESSED_RGBA_ASTC_10X8_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[K.COMPRESSED_RGBA_ASTC_10X10_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[K.COMPRESSED_RGBA_ASTC_12X10_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[K.COMPRESSED_RGBA_ASTC_12X12_KHR,K.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},at={0:St,1:St,2:Et,3:Et,6:Rt,7:Rt,9:st,11:st,22:Rt,23:st,24:Rt,25:Rt,26:st,27:st,28:function(t,e){return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16},29:function(t,e){return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16},30:function(t,e){return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16},31:function(t,e){return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16},32:function(t,e){return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16},33:function(t,e){return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16},34:function(t,e){return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16},35:function(t,e){return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16},36:function(t,e){return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16},37:function(t,e){return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16},38:function(t,e){return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16},39:function(t,e){return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16},40:function(t,e){return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16}};function St(t,e){return(t=Math.max(t,16))*(e=Math.max(e,8))/4}function Et(t,e){return(t=Math.max(t,8))*(e=Math.max(e,8))/2}function Rt(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8}function st(t,e){return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16}function ft(t){if(function(t){var e=new Uint8Array(t.buffer||t,t.byteOffset||0,F.length);return!(e[0]!==F[0]||e[1]!==F[1]||e[2]!==F[2]||e[3]!==F[3]||e[4]!==F[4]||e[5]!==F[5]||e[6]!==F[6]||e[7]!==F[7]||e[8]!==F[8]||e[9]!==F[9]||e[10]!==F[10]||e[11]!==F[11])}(t))return k(t);if(function(t){return new Uint32Array(t,0,V.HEADER_LENGTH)[V.MAGIC_NUMBER_INDEX]===V.MAGIC_NUMBER}(t))return z(t);if(function(t){var e=new Uint32Array(t,0,J)[$];return e===Y||e===q}(t))return function(t){var e=new Uint32Array(t,0,J),n=e[tt],r=e[et],_=it[n]||[],o=_.length>1&&r?_[1]:_[0],i=at[n],a=e[_t],S=e[rt],E=e[nt],R=Q+e[ot];return b(new Uint8Array(t,R),{mipMapLevels:a,width:S,height:E,sizeFunction:i,internalFormat:o})}(t);throw new Error("Texture container format not recognized")}function ut(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ct(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ut(Object(n),!0).forEach((function(e){_()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ut(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var At,Ct,lt={name:"Texture Containers",id:"compressed-texture",module:"textures",version:"3.0.14",worker:!0,extensions:["ktx","ktx2","dds","pvr"],mimeTypes:["image/ktx2","image/ktx","image/vnd-ms.dds","image/x-dds","application/octet-stream"],binary:!0,options:{"compressed-texture":{libraryPath:"libs/"}}},Pt=ct(ct({},lt),{},{parse:(At=i()(S.a.mark((function t(e){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",ft(e));case 1:case"end":return t.stop()}}),t)}))),function(t){return At.apply(this,arguments)})});Ct=Pt,"undefined"!=typeof self&&(l.onmessage=function(){var t=i()(S.a.mark((function t(e,n){var r,_,o,i,a;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e,t.next="process"===t.t0?3:16;break;case 3:return t.prev=3,r=n.input,_=n.options,o=void 0===_?{}:_,t.next=7,M({loader:Ct,arrayBuffer:r,options:o,context:{parse:T}});case 7:i=t.sent,l.postMessage("done",{result:i}),t.next=15;break;case 11:t.prev=11,t.t1=t.catch(3),a=t.t1 instanceof Error?t.t1.message:"",l.postMessage("error",{error:a});case 15:return t.abrupt("break",16);case 16:case"end":return t.stop()}}),t,null,[[3,11]])})));return function(e,n){return t.apply(this,arguments)}}())}]);
|
|
2
2
|
//# sourceMappingURL=compressed-texture-worker.js.map
|