@luma.gl/webgpu 9.0.0-beta.2 → 9.0.0-beta.3
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/dist.dev.js +4 -1
- package/dist.min.js +1 -1
- package/package.json +3 -3
package/dist/dist.dev.js
CHANGED
|
@@ -1038,12 +1038,15 @@ var __exports__ = (() => {
|
|
|
1038
1038
|
readPixelsToArrayWebGL(source, options) {
|
|
1039
1039
|
throw new Error("not implemented");
|
|
1040
1040
|
}
|
|
1041
|
-
|
|
1041
|
+
readPixelsToBufferWebGL(source, options) {
|
|
1042
1042
|
throw new Error("not implemented");
|
|
1043
1043
|
}
|
|
1044
1044
|
setParametersWebGL(parameters) {
|
|
1045
1045
|
throw new Error("not implemented");
|
|
1046
1046
|
}
|
|
1047
|
+
getParametersWebGL(parameters) {
|
|
1048
|
+
throw new Error("not implemented");
|
|
1049
|
+
}
|
|
1047
1050
|
withParametersWebGL(parameters, func) {
|
|
1048
1051
|
throw new Error("not implemented");
|
|
1049
1052
|
}
|
package/dist.min.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
else if (typeof define === 'function' && define.amd) define([], factory);
|
|
5
5
|
else if (typeof exports === 'object') exports['luma'] = factory();
|
|
6
6
|
else root['luma'] = factory();})(globalThis, function () {
|
|
7
|
-
var __exports__=(()=>{var Dt=Object.defineProperty;var Qo=Object.getOwnPropertyDescriptor;var ei=Object.getOwnPropertyNames;var ti=Object.prototype.hasOwnProperty;var ri=(e,t)=>{for(var r in t)Dt(e,r,{get:t[r],enumerable:!0})},ni=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ei(t))!ti.call(e,o)&&o!==r&&Dt(e,o,{get:()=>t[o],enumerable:!(n=Qo(t,o))||n.enumerable});return e};var oi=e=>ni(Dt({},"__esModule",{value:!0}),e);var pl={};ri(pl,{WebGPUBuffer:()=>bt,WebGPUDevice:()=>mr,WebGPUSampler:()=>K,WebGPUShader:()=>St,WebGPUTexture:()=>_t});function Le(e){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function M(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Le()}var ii=globalThis.self||globalThis.window||globalThis.global,oe=globalThis.window||globalThis.self||globalThis.global,ai=globalThis.document||{},Z=globalThis.process||{},ui=globalThis.console,vr=globalThis.navigator||{};var Ve=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",gl=M();var Bt=globalThis;function He(e){if(!e&&!M())return"Node";if(Le(e))return"Electron";let t=e||vr.userAgent||"";if(t.indexOf("Edge")>-1)return"Edge";let r=t.indexOf("MSIE ")!==-1,n=t.indexOf("Trident/")!==-1;return r||n?"IE":Bt.chrome?"Chrome":Bt.safari?"Safari":Bt.mozInnerScreenX?"Firefox":"Unknown"}function fi(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var Ke=class{constructor(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=fi(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function br(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function gr(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function $e(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,o=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let i=e.width*r,a=e.height*r,l=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(i/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(o,");"),"background-size:".concat(i,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),l]}var Ye;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Ye||(Ye={}));var ci=10;function wr(e){return typeof e!="string"?e:(e=e.toUpperCase(),Ye[e]||Ye.WHITE)}function _r(e,t,r){if(!M&&typeof e=="string"){if(t){let n=wr(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=wr(r);e="\x1B[".concat(n+ci,"m").concat(e,"\x1B[49m")}}return e}function Or(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),o=e;for(let i of n){let a=o[i];typeof a=="function"&&(t.find(l=>i===l)||(o[i]=a.bind(e)))}}function ie(e,t){if(!e)throw new Error(t||"Assertion failed")}function J(){let e;if(M()&&oe.performance){var t,r;e=oe===null||oe===void 0||(t=oe.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in Z){var n;let o=Z===null||Z===void 0||(n=Z.hrtime)===null||n===void 0?void 0:n.call(Z);e=o[0]*1e3+o[1]/1e6}else e=Date.now();return e}var ae={debug:M()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},si={enabled:!0,level:0};function H(){}var Pr={},Sr={once:!0},X=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=Ve,this._startTs=J(),this._deltaTs=J(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new Ke("__probe-".concat(this.id,"__"),si),this.timeStamp("".concat(this.id," started")),Or(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((J()-this._startTs).toPrecision(10))}getDelta(){return Number((J()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){ie(t,r)}warn(t){return this._getLogFunction(0,t,ae.warn,arguments,Sr)}error(t){return this._getLogFunction(0,t,ae.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,ae.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,ae.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,ae.debug||ae.info,arguments,Sr)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||H,n&&[n],{tag:di(r)}):H}image(t){let{logLevel:r,priority:n,image:o,message:i="",scale:a=1}=t;return this._shouldLog(r||n)?M()?hi({image:o,message:i,scale:a}):pi({image:o,message:i,scale:a}):H}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||H)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},o=Tr({logLevel:t,message:r,opts:n}),{collapsed:i}=n;return o.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(o)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||H)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=jr(t)}_getLogFunction(t,r,n,o,i){if(this._shouldLog(t)){i=Tr({logLevel:t,message:r,args:o,opts:i}),n=n||i.method,ie(n),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=J();let a=i.tag||i.message;if(i.once&&a)if(!Pr[a])Pr[a]=J();else return H;return r=li(this.id,i.message,i),n.bind(console,r,...i.args)}return H}};X.VERSION=Ve;function jr(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return ie(Number.isFinite(t)&&t>=0),t}function Tr(e){let{logLevel:t,message:r}=e;e.logLevel=jr(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let o=typeof e.message;return ie(o==="string"||o==="object"),Object.assign(e,{args:n},e.opts)}function li(e,t,r){if(typeof t=="string"){let n=r.time?gr(br(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=_r(t,r.color,r.background)}return t}function pi(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),H}function hi(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let i=new Image;return i.onload=()=>{let a=$e(i,r,n);console.log(...a)},i.src=t,H}let o=t.nodeName||"";if(o.toLowerCase()==="img")return console.log(...$e(t,r,n)),H;if(o.toLowerCase()==="canvas"){let i=new Image;return i.onload=()=>console.log(...$e(i,r,n)),i.src=t.toDataURL(),H}return H}function di(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var ql=new X({id:"@probe.gl/log"});var S=new X({id:"luma.gl"});function De(){let e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){let t=process.hrtime();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var Q=class{constructor(t,r){this.name=void 0,this.type=void 0,this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=t,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=De(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(De()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var ue=class{constructor(t){this.id=void 0,this.stats={},this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:t,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let t of Object.values(this.stats))t.reset();return this}forEach(t){for(let r of Object.values(this.stats))t(r)}getTable(){let t={};return this.forEach(r=>{t[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),t}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:n}=t,o=this.stats[r];return o||(t instanceof Q?o=t:o=new Q(r,n),this.stats[r]=o),o}};function Be(e){return Be=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Be(e)}function Er(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,mi(n.key),n)}}function yi(e,t,r){return t&&Er(e.prototype,t),r&&Er(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function mi(e){var t=vi(e,"string");return Be(t)==="symbol"?t:String(t)}function vi(e,t){if(Be(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Be(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var gi=function(){function e(){bi(this,e),this.stats=new Map}var t=e.prototype;return t.getStats=function(n){return this.get(n)},t.get=function(n){return this.stats.has(n)||this.stats.set(n,new ue({id:n})),this.stats.get(n)},yi(e)}(),Xe=new gi;function wi(){var e=typeof __VERSION__<"u"?__VERSION__:"running from source",t="set luma.log.level=1 (or higher) to trace rendering";if(globalThis.luma&&globalThis.luma.VERSION!==e)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(e));return globalThis.luma||(M()&&S.log(1,"".concat(e," - ").concat(t))(),globalThis.luma=globalThis.luma||{VERSION:e,version:e,log:S,stats:Xe}),e}var xr=wi();var Gt={};function Y(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";Gt[e]=Gt[e]||1;var t=Gt[e]++;return"".concat(e,"-").concat(t)}function Nt(e){var t=!0;for(var r in e){t=!1;break}return t}function Ge(e){return Ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ge(e)}function Rr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function _i(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Rr(Object(r),!0).forEach(function(n){Oi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Oi(e,t,r){return t=Ir(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ar(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ir(n.key),n)}}function Pi(e,t,r){return t&&Ar(e.prototype,t),r&&Ar(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ir(e){var t=Si(e,"string");return Ge(t)==="symbol"?t:String(t)}function Si(e,t){if(Ge(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ge(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ti(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var E=function(){function e(r,n,o){if(Ti(this,e),this.id=void 0,this.props=void 0,this.userData={},this.device=void 0,this._device=void 0,this.destroyed=!1,this.allocatedBytes=0,this._attachedResources=new Set,!r)throw new Error("no device");this._device=r,this.props=ji(n,o);var i=this.props.id!=="undefined"?this.props.id:Y(this[Symbol.toStringTag]);this.props.id=i,this.id=i,this.userData=this.props.userData||{},this.addStats()}var t=e.prototype;return t.destroy=function(){this.destroyResource()},t.delete=function(){return this.destroy(),this},t.toString=function(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")},t.getProps=function(){return this.props},t.attachResource=function(n){this._attachedResources.add(n)},t.detachResource=function(n){this._attachedResources.delete(n)},t.destroyAttachedResource=function(n){this._attachedResources.delete(n)&&n.destroy()},t.destroyAttachedResources=function(){for(var n=0,o=Object.values(this._attachedResources);n<o.length;n++){var i=o[n];i.destroy()}this._attachedResources=new Set},t.destroyResource=function(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0},t.removeStats=function(){var n=this._device.statsManager.getStats("Resource Counts"),o=this[Symbol.toStringTag];n.get("".concat(o,"s Active")).decrementCount()},t.trackAllocatedMemory=function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag],i=this._device.statsManager.getStats("Resource Counts");i.get("GPU Memory").addCount(n),i.get("".concat(o," Memory")).addCount(n),this.allocatedBytes=n},t.trackDeallocatedMemory=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag],o=this._device.statsManager.getStats("Resource Counts");o.get("GPU Memory").subtractCount(this.allocatedBytes),o.get("".concat(n," Memory")).subtractCount(this.allocatedBytes),this.allocatedBytes=0},t.addStats=function(){var n=this._device.statsManager.getStats("Resource Counts"),o=this[Symbol.toStringTag];n.get("Resources Created").incrementCount(),n.get("".concat(o,"s Created")).incrementCount(),n.get("".concat(o,"s Active")).incrementCount()},Pi(e)}();E.defaultProps={id:"undefined",handle:void 0,userData:void 0};function ji(e,t){var r=_i({},t);for(var n in e)e[n]!==void 0&&(r[n]=e[n]);return r}function fe(e){return fe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fe(e)}var Br;function Lr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ct(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lr(Object(r),!0).forEach(function(n){Ei(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ei(e,t,r){return t=Gr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Gr(n.key),n)}}function Ri(e,t,r){return t&&Dr(e.prototype,t),r&&Dr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gr(e){var t=Ai(e,"string");return fe(t)==="symbol"?t:String(t)}function Ai(e,t){if(fe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(fe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ii(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kt(e,t)}function kt(e,t){return kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},kt(e,t)}function Li(e){var t=Gi();return function(){var n=qe(e),o;if(t){var i=qe(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Di(this,o)}}function Di(e,t){if(t&&(fe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Bi(e)}function Bi(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gi(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function qe(e){return qe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},qe(e)}Br=Symbol.toStringTag;var N=function(e){Ii(r,e);var t=Li(r);function r(o,i){var a;xi(this,r);var l=Ct({},i);return(i.usage||0)&r.INDEX&&!i.indexType&&(i.data instanceof Uint32Array?l.indexType="uint32":i.data instanceof Uint16Array&&(l.indexType="uint16")),a=t.call(this,o,l,r.defaultProps),a.usage=void 0,a.indexType=void 0,a.byteLength=void 0,a.debugData=new ArrayBuffer(0),a.usage=i.usage||0,a.indexType=l.indexType,a}var n=r.prototype;return n.readSyncWebGL2=function(i,a){throw new Error("not implemented")},n._setDebugData=function(i,a,l){var s=ArrayBuffer.isView(i)?i.buffer:i,h=Math.min(i?i.byteLength:l,r.DEBUG_DATA_MAX_LENGTH);i===null?this.debugData=new ArrayBuffer(h):a===0&&l===i.byteLength?this.debugData=s.slice(0,h):this.debugData=s.slice(a,a+h)},Ri(r,[{key:Br,get:function(){return"Buffer"}}]),r}(E);N.defaultProps=Ct(Ct({},E.defaultProps),{},{usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1});N.MAP_READ=1;N.MAP_WRITE=2;N.COPY_SRC=4;N.COPY_DST=8;N.INDEX=16;N.VERTEX=32;N.UNIFORM=64;N.STORAGE=128;N.INDIRECT=256;N.QUERY_RESOLVE=512;N.DEBUG_DATA_MAX_LENGTH=32;function Ne(e){return Ne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ne(e)}var kr;function Nr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Mt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Nr(Object(r),!0).forEach(function(n){Ni(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ni(e,t,r){return t=Mr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ci(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Mr(n.key),n)}}function ki(e,t,r){return t&&Cr(e.prototype,t),r&&Cr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Mr(e){var t=Mi(e,"string");return Ne(t)==="symbol"?t:String(t)}function Mi(e,t){if(Ne(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ne(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}kr=Symbol.toStringTag;var Ce=function(){function e(r){Ci(this,e),this.id=void 0,this.statsManager=Xe,this.props=void 0,this.userData={},this._lumaData={},this.info=void 0,this.lost=void 0,this.canvasContext=void 0,this.props=Mt(Mt({},e.defaultProps),r),this.id=this.props.id||Y(this[Symbol.toStringTag].toLowerCase())}var t=e.prototype;return t.loseDevice=function(){return!1},t.getCanvasContext=function(){if(!this.canvasContext)throw new Error("Device has no CanvasContext");return this.canvasContext},t.createTexture=function(n){return(n instanceof Promise||typeof n=="string")&&(n={data:n}),this._createTexture(n)},t.createCommandEncoder=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};throw new Error("not implemented")},t.readPixelsToArrayWebGL=function(n,o){throw new Error("not implemented")},t.readPixelsToBufferWebGL2=function(n,o){throw new Error("not implemented")},t.setParametersWebGL=function(n){throw new Error("not implemented")},t.withParametersWebGL=function(n,o){throw new Error("not implemented")},t.clearWebGL=function(n){throw new Error("not implemented")},t._getBufferProps=function(n){(n instanceof ArrayBuffer||ArrayBuffer.isView(n))&&(n={data:n});var o=Mt({},n);return(n.usage||0)&N.INDEX&&!n.indexType&&(n.data instanceof Uint32Array?o.indexType="uint32":n.data instanceof Uint16Array?o.indexType="uint16":S.warn("indices buffer content must be of integer type")()),o},ki(e,[{key:kr,get:function(){return"Device"}}]),e}();Ce.defaultProps={id:null,type:"best-available",canvas:null,container:null,webgl2:!0,webgl1:!0,manageState:!0,width:800,height:600,debug:Boolean(S.get("debug")),break:[],gl:null};Ce.VERSION=xr;function ke(e){return ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ke(e)}function Ze(e,t){return Fi(e)||Wi(e,t)||Kr(e,t)||Ui()}function Ui(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
7
|
+
var __exports__=(()=>{var Dt=Object.defineProperty;var Qo=Object.getOwnPropertyDescriptor;var ei=Object.getOwnPropertyNames;var ti=Object.prototype.hasOwnProperty;var ri=(e,t)=>{for(var r in t)Dt(e,r,{get:t[r],enumerable:!0})},ni=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ei(t))!ti.call(e,o)&&o!==r&&Dt(e,o,{get:()=>t[o],enumerable:!(n=Qo(t,o))||n.enumerable});return e};var oi=e=>ni(Dt({},"__esModule",{value:!0}),e);var pl={};ri(pl,{WebGPUBuffer:()=>bt,WebGPUDevice:()=>mr,WebGPUSampler:()=>K,WebGPUShader:()=>St,WebGPUTexture:()=>_t});function Le(e){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function M(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Le()}var ii=globalThis.self||globalThis.window||globalThis.global,oe=globalThis.window||globalThis.self||globalThis.global,ai=globalThis.document||{},Z=globalThis.process||{},ui=globalThis.console,vr=globalThis.navigator||{};var Ve=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",gl=M();var Bt=globalThis;function He(e){if(!e&&!M())return"Node";if(Le(e))return"Electron";let t=e||vr.userAgent||"";if(t.indexOf("Edge")>-1)return"Edge";let r=t.indexOf("MSIE ")!==-1,n=t.indexOf("Trident/")!==-1;return r||n?"IE":Bt.chrome?"Chrome":Bt.safari?"Safari":Bt.mozInnerScreenX?"Firefox":"Unknown"}function fi(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var Ke=class{constructor(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=fi(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function br(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function gr(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function $e(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,o=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let i=e.width*r,a=e.height*r,l=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(i/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(o,");"),"background-size:".concat(i,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),l]}var Ye;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Ye||(Ye={}));var ci=10;function wr(e){return typeof e!="string"?e:(e=e.toUpperCase(),Ye[e]||Ye.WHITE)}function _r(e,t,r){if(!M&&typeof e=="string"){if(t){let n=wr(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=wr(r);e="\x1B[".concat(n+ci,"m").concat(e,"\x1B[49m")}}return e}function Or(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),o=e;for(let i of n){let a=o[i];typeof a=="function"&&(t.find(l=>i===l)||(o[i]=a.bind(e)))}}function ie(e,t){if(!e)throw new Error(t||"Assertion failed")}function J(){let e;if(M()&&oe.performance){var t,r;e=oe===null||oe===void 0||(t=oe.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in Z){var n;let o=Z===null||Z===void 0||(n=Z.hrtime)===null||n===void 0?void 0:n.call(Z);e=o[0]*1e3+o[1]/1e6}else e=Date.now();return e}var ae={debug:M()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},si={enabled:!0,level:0};function H(){}var Pr={},Sr={once:!0},X=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=Ve,this._startTs=J(),this._deltaTs=J(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new Ke("__probe-".concat(this.id,"__"),si),this.timeStamp("".concat(this.id," started")),Or(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((J()-this._startTs).toPrecision(10))}getDelta(){return Number((J()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){ie(t,r)}warn(t){return this._getLogFunction(0,t,ae.warn,arguments,Sr)}error(t){return this._getLogFunction(0,t,ae.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,ae.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,ae.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,ae.debug||ae.info,arguments,Sr)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||H,n&&[n],{tag:di(r)}):H}image(t){let{logLevel:r,priority:n,image:o,message:i="",scale:a=1}=t;return this._shouldLog(r||n)?M()?hi({image:o,message:i,scale:a}):pi({image:o,message:i,scale:a}):H}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||H)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},o=Tr({logLevel:t,message:r,opts:n}),{collapsed:i}=n;return o.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(o)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||H)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=jr(t)}_getLogFunction(t,r,n,o,i){if(this._shouldLog(t)){i=Tr({logLevel:t,message:r,args:o,opts:i}),n=n||i.method,ie(n),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=J();let a=i.tag||i.message;if(i.once&&a)if(!Pr[a])Pr[a]=J();else return H;return r=li(this.id,i.message,i),n.bind(console,r,...i.args)}return H}};X.VERSION=Ve;function jr(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return ie(Number.isFinite(t)&&t>=0),t}function Tr(e){let{logLevel:t,message:r}=e;e.logLevel=jr(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let o=typeof e.message;return ie(o==="string"||o==="object"),Object.assign(e,{args:n},e.opts)}function li(e,t,r){if(typeof t=="string"){let n=r.time?gr(br(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=_r(t,r.color,r.background)}return t}function pi(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),H}function hi(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let i=new Image;return i.onload=()=>{let a=$e(i,r,n);console.log(...a)},i.src=t,H}let o=t.nodeName||"";if(o.toLowerCase()==="img")return console.log(...$e(t,r,n)),H;if(o.toLowerCase()==="canvas"){let i=new Image;return i.onload=()=>console.log(...$e(i,r,n)),i.src=t.toDataURL(),H}return H}function di(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var ql=new X({id:"@probe.gl/log"});var S=new X({id:"luma.gl"});function De(){let e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){let t=process.hrtime();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}var Q=class{constructor(t,r){this.name=void 0,this.type=void 0,this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=t,this.type=r,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=De(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(De()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var ue=class{constructor(t){this.id=void 0,this.stats={},this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:t,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let t of Object.values(this.stats))t.reset();return this}forEach(t){for(let r of Object.values(this.stats))t(r)}getTable(){let t={};return this.forEach(r=>{t[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),t}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>this._getOrCreate(r))}_getOrCreate(t){let{name:r,type:n}=t,o=this.stats[r];return o||(t instanceof Q?o=t:o=new Q(r,n),this.stats[r]=o),o}};function Be(e){return Be=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Be(e)}function Er(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,mi(n.key),n)}}function yi(e,t,r){return t&&Er(e.prototype,t),r&&Er(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function mi(e){var t=vi(e,"string");return Be(t)==="symbol"?t:String(t)}function vi(e,t){if(Be(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Be(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var gi=function(){function e(){bi(this,e),this.stats=new Map}var t=e.prototype;return t.getStats=function(n){return this.get(n)},t.get=function(n){return this.stats.has(n)||this.stats.set(n,new ue({id:n})),this.stats.get(n)},yi(e)}(),Xe=new gi;function wi(){var e=typeof __VERSION__<"u"?__VERSION__:"running from source",t="set luma.log.level=1 (or higher) to trace rendering";if(globalThis.luma&&globalThis.luma.VERSION!==e)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(e));return globalThis.luma||(M()&&S.log(1,"".concat(e," - ").concat(t))(),globalThis.luma=globalThis.luma||{VERSION:e,version:e,log:S,stats:Xe}),e}var xr=wi();var Gt={};function Y(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";Gt[e]=Gt[e]||1;var t=Gt[e]++;return"".concat(e,"-").concat(t)}function Nt(e){var t=!0;for(var r in e){t=!1;break}return t}function Ge(e){return Ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ge(e)}function Rr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function _i(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Rr(Object(r),!0).forEach(function(n){Oi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Oi(e,t,r){return t=Ir(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ar(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ir(n.key),n)}}function Pi(e,t,r){return t&&Ar(e.prototype,t),r&&Ar(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ir(e){var t=Si(e,"string");return Ge(t)==="symbol"?t:String(t)}function Si(e,t){if(Ge(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ge(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ti(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var E=function(){function e(r,n,o){if(Ti(this,e),this.id=void 0,this.props=void 0,this.userData={},this.device=void 0,this._device=void 0,this.destroyed=!1,this.allocatedBytes=0,this._attachedResources=new Set,!r)throw new Error("no device");this._device=r,this.props=ji(n,o);var i=this.props.id!=="undefined"?this.props.id:Y(this[Symbol.toStringTag]);this.props.id=i,this.id=i,this.userData=this.props.userData||{},this.addStats()}var t=e.prototype;return t.destroy=function(){this.destroyResource()},t.delete=function(){return this.destroy(),this},t.toString=function(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")},t.getProps=function(){return this.props},t.attachResource=function(n){this._attachedResources.add(n)},t.detachResource=function(n){this._attachedResources.delete(n)},t.destroyAttachedResource=function(n){this._attachedResources.delete(n)&&n.destroy()},t.destroyAttachedResources=function(){for(var n=0,o=Object.values(this._attachedResources);n<o.length;n++){var i=o[n];i.destroy()}this._attachedResources=new Set},t.destroyResource=function(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0},t.removeStats=function(){var n=this._device.statsManager.getStats("Resource Counts"),o=this[Symbol.toStringTag];n.get("".concat(o,"s Active")).decrementCount()},t.trackAllocatedMemory=function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag],i=this._device.statsManager.getStats("Resource Counts");i.get("GPU Memory").addCount(n),i.get("".concat(o," Memory")).addCount(n),this.allocatedBytes=n},t.trackDeallocatedMemory=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag],o=this._device.statsManager.getStats("Resource Counts");o.get("GPU Memory").subtractCount(this.allocatedBytes),o.get("".concat(n," Memory")).subtractCount(this.allocatedBytes),this.allocatedBytes=0},t.addStats=function(){var n=this._device.statsManager.getStats("Resource Counts"),o=this[Symbol.toStringTag];n.get("Resources Created").incrementCount(),n.get("".concat(o,"s Created")).incrementCount(),n.get("".concat(o,"s Active")).incrementCount()},Pi(e)}();E.defaultProps={id:"undefined",handle:void 0,userData:void 0};function ji(e,t){var r=_i({},t);for(var n in e)e[n]!==void 0&&(r[n]=e[n]);return r}function fe(e){return fe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fe(e)}var Br;function Lr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ct(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lr(Object(r),!0).forEach(function(n){Ei(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ei(e,t,r){return t=Gr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Gr(n.key),n)}}function Ri(e,t,r){return t&&Dr(e.prototype,t),r&&Dr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gr(e){var t=Ai(e,"string");return fe(t)==="symbol"?t:String(t)}function Ai(e,t){if(fe(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(fe(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ii(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kt(e,t)}function kt(e,t){return kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},kt(e,t)}function Li(e){var t=Gi();return function(){var n=qe(e),o;if(t){var i=qe(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return Di(this,o)}}function Di(e,t){if(t&&(fe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Bi(e)}function Bi(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gi(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function qe(e){return qe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},qe(e)}Br=Symbol.toStringTag;var N=function(e){Ii(r,e);var t=Li(r);function r(o,i){var a;xi(this,r);var l=Ct({},i);return(i.usage||0)&r.INDEX&&!i.indexType&&(i.data instanceof Uint32Array?l.indexType="uint32":i.data instanceof Uint16Array&&(l.indexType="uint16")),a=t.call(this,o,l,r.defaultProps),a.usage=void 0,a.indexType=void 0,a.byteLength=void 0,a.debugData=new ArrayBuffer(0),a.usage=i.usage||0,a.indexType=l.indexType,a}var n=r.prototype;return n.readSyncWebGL2=function(i,a){throw new Error("not implemented")},n._setDebugData=function(i,a,l){var s=ArrayBuffer.isView(i)?i.buffer:i,h=Math.min(i?i.byteLength:l,r.DEBUG_DATA_MAX_LENGTH);i===null?this.debugData=new ArrayBuffer(h):a===0&&l===i.byteLength?this.debugData=s.slice(0,h):this.debugData=s.slice(a,a+h)},Ri(r,[{key:Br,get:function(){return"Buffer"}}]),r}(E);N.defaultProps=Ct(Ct({},E.defaultProps),{},{usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1});N.MAP_READ=1;N.MAP_WRITE=2;N.COPY_SRC=4;N.COPY_DST=8;N.INDEX=16;N.VERTEX=32;N.UNIFORM=64;N.STORAGE=128;N.INDIRECT=256;N.QUERY_RESOLVE=512;N.DEBUG_DATA_MAX_LENGTH=32;function Ne(e){return Ne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ne(e)}var kr;function Nr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Mt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Nr(Object(r),!0).forEach(function(n){Ni(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ni(e,t,r){return t=Mr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ci(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Mr(n.key),n)}}function ki(e,t,r){return t&&Cr(e.prototype,t),r&&Cr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Mr(e){var t=Mi(e,"string");return Ne(t)==="symbol"?t:String(t)}function Mi(e,t){if(Ne(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ne(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}kr=Symbol.toStringTag;var Ce=function(){function e(r){Ci(this,e),this.id=void 0,this.statsManager=Xe,this.props=void 0,this.userData={},this._lumaData={},this.info=void 0,this.lost=void 0,this.canvasContext=void 0,this.props=Mt(Mt({},e.defaultProps),r),this.id=this.props.id||Y(this[Symbol.toStringTag].toLowerCase())}var t=e.prototype;return t.loseDevice=function(){return!1},t.getCanvasContext=function(){if(!this.canvasContext)throw new Error("Device has no CanvasContext");return this.canvasContext},t.createTexture=function(n){return(n instanceof Promise||typeof n=="string")&&(n={data:n}),this._createTexture(n)},t.createCommandEncoder=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};throw new Error("not implemented")},t.readPixelsToArrayWebGL=function(n,o){throw new Error("not implemented")},t.readPixelsToBufferWebGL=function(n,o){throw new Error("not implemented")},t.setParametersWebGL=function(n){throw new Error("not implemented")},t.getParametersWebGL=function(n){throw new Error("not implemented")},t.withParametersWebGL=function(n,o){throw new Error("not implemented")},t.clearWebGL=function(n){throw new Error("not implemented")},t._getBufferProps=function(n){(n instanceof ArrayBuffer||ArrayBuffer.isView(n))&&(n={data:n});var o=Mt({},n);return(n.usage||0)&N.INDEX&&!n.indexType&&(n.data instanceof Uint32Array?o.indexType="uint32":n.data instanceof Uint16Array?o.indexType="uint16":S.warn("indices buffer content must be of integer type")()),o},ki(e,[{key:kr,get:function(){return"Device"}}]),e}();Ce.defaultProps={id:null,type:"best-available",canvas:null,container:null,webgl2:!0,webgl1:!0,manageState:!0,width:800,height:600,debug:Boolean(S.get("debug")),break:[],gl:null};Ce.VERSION=xr;function ke(e){return ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ke(e)}function Ze(e,t){return Fi(e)||Wi(e,t)||Kr(e,t)||Ui()}function Ui(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
8
8
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wi(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,a,l=[],s=!0,h=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);s=!0);}catch(b){h=!0,o=b}finally{try{if(!s&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(h)throw o}}return l}}function Fi(e){if(Array.isArray(e))return e}function zi(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Kr(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(h){throw h},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
9
9
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,l;return{s:function(){r=r.call(e)},n:function(){var h=r.next();return i=h.done,h},e:function(h){a=!0,l=h},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(a)throw l}}}}function Kr(e,t){if(e){if(typeof e=="string")return Ur(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ur(e,t)}}function Ur(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Wr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Fr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Wr(Object(r),!0).forEach(function(n){Vi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Vi(e,t,r){return t=$r(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$r(n.key),n)}}function Ki(e,t,r){return t&&zr(e.prototype,t),r&&zr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function $r(e){var t=$i(e,"string");return ke(t)==="symbol"?t:String(t)}function $i(e,t){if(ke(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ke(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yi=M()&&typeof document<"u",Je=function(){return Yi&&document.readyState==="complete"},Xi={canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,colorSpace:"srgb",alphaMode:"opaque"},ce=function(){function e(r){var n=this;if(Hi(this,e),this.device=void 0,this.id=void 0,this.props=void 0,this.canvas=void 0,this.htmlCanvas=void 0,this.offscreenCanvas=void 0,this.type=void 0,this.width=1,this.height=1,this.resizeObserver=void 0,this._canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1},this.props=Fr(Fr({},Xi),r),r=this.props,!M()){this.id="node-canvas-context",this.type="node",this.width=this.props.width,this.height=this.props.height,this.canvas=null;return}if(r.canvas)typeof r.canvas=="string"?this.canvas=Ji(r.canvas):this.canvas=r.canvas;else{var o,i,a=Qi(r),l=Zi(((o=r)===null||o===void 0?void 0:o.container)||null);l.insertBefore(a,l.firstChild),this.canvas=a,(i=r)!==null&&i!==void 0&&i.visible||(this.canvas.style.visibility="hidden")}this.canvas instanceof HTMLCanvasElement?(this.id=this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):(this.id="offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas),this.canvas instanceof HTMLCanvasElement&&r.autoResize&&(this.resizeObserver=new ResizeObserver(function(s){var h=zi(s),b;try{for(h.s();!(b=h.n()).done;){var m=b.value;m.target===n.canvas&&n.update()}}catch(w){h.e(w)}finally{h.f()}}),this.resizeObserver.observe(this.canvas))}var t=e.prototype;return t.getDevicePixelRatio=function(n){if(typeof OffscreenCanvas<"u"&&this.canvas instanceof OffscreenCanvas||(n=n===void 0?this.props.useDevicePixels:n,!n||n<=0))return 1;if(n===!0){var o=typeof window<"u"&&window.devicePixelRatio;return o||1}return n},t.getPixelSize=function(){switch(this.type){case"node":return[this.width,this.height];case"offscreen-canvas":return[this.canvas.width,this.canvas.height];case"html-canvas":var n=this.getDevicePixelRatio(),o=this.canvas;return o.parentElement?[o.clientWidth*n,o.clientHeight*n]:[this.canvas.width,this.canvas.height];default:throw new Error(this.type)}},t.getAspect=function(){var n=this.getPixelSize(),o=Ze(n,2),i=o[0],a=o[1];return i/a},t.cssToDeviceRatio=function(){try{var n=this.getDrawingBufferSize(),o=Ze(n,1),i=o[0],a=this._canvasSizeInfo.clientWidth;return a?i/a:1}catch{return 1}},t.cssToDevicePixels=function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=this.cssToDeviceRatio(),a=this.getDrawingBufferSize(),l=Ze(a,2),s=l[0],h=l[1];return ea(n,i,s,h,o)},t.setDevicePixelRatio=function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.htmlCanvas){var i="width"in o?o.width:this.htmlCanvas.clientWidth,a="height"in o?o.height:this.htmlCanvas.clientHeight;(!i||!a)&&(S.log(1,"Canvas clientWidth/clientHeight is 0")(),n=1,i=this.htmlCanvas.width||1,a=this.htmlCanvas.height||1);var l=this._canvasSizeInfo;if(l.clientWidth!==i||l.clientHeight!==a||l.devicePixelRatio!==n){var s=n,h=Math.floor(i*s),b=Math.floor(a*s);this.htmlCanvas.width=h,this.htmlCanvas.height=b;var m=this.getDrawingBufferSize(),w=Ze(m,2),O=w[0],P=w[1];(O!==h||P!==b)&&(s=Math.min(O/i,P/a),this.htmlCanvas.width=Math.floor(i*s),this.htmlCanvas.height=Math.floor(a*s),S.warn("Device pixel ratio clamped")()),this._canvasSizeInfo.clientWidth=i,this._canvasSizeInfo.clientHeight=a,this._canvasSizeInfo.devicePixelRatio=n}}},t.getDrawingBufferSize=function(){var n=this.device.gl;if(!n)throw new Error("canvas size");return[n.drawingBufferWidth,n.drawingBufferHeight]},t._setAutoCreatedCanvasId=function(n){var o;((o=this.htmlCanvas)===null||o===void 0?void 0:o.id)==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=n)},Ki(e,null,[{key:"isPageLoaded",get:function(){return Je()}}]),e}();ce.pageLoaded=qi();function qi(){return Je()||typeof window>"u"?Promise.resolve():new Promise(function(e){window.addEventListener("load",function(){return e()})})}function Zi(e){if(typeof e=="string"){var t=document.getElementById(e);if(!t&&!Je())throw new Error("Accessing '".concat(e,"' before page was loaded"));if(!t)throw new Error("".concat(e," is not an HTML element"));return t}else if(e)return e;return document.body}function Ji(e){var t=document.getElementById(e);if(!t&&!Je())throw new Error("Accessing '".concat(e,"' before page was loaded"));if(!(t instanceof HTMLCanvasElement))throw new Error("Object is not a canvas element");return t}function Qi(e){var t=e.width,r=e.height,n=document.createElement("canvas");return n.id="lumagl-auto-created-canvas",n.width=t||1,n.height=r||1,n.style.width=Number.isFinite(t)?"".concat(t,"px"):"100%",n.style.height=Number.isFinite(r)?"".concat(r,"px"):"100%",n}function ea(e,t,r,n,o){var i=e,a=Vr(i[0],t,r),l=Hr(i[1],t,n,o),s=Vr(i[0]+1,t,r),h=s===r-1?s:s-1;s=Hr(i[1]+1,t,n,o);var b;return o?(s=s===0?s:s+1,b=l,l=s):b=s===n-1?s:s-1,{x:a,y:l,width:Math.max(h-a+1,1),height:Math.max(b-l+1,1)}}function Vr(e,t,r){var n=Math.min(Math.round(e*t),r-1);return n}function Hr(e,t,r,n){return n?Math.max(0,r-1-Math.round(e*t)):Math.min(Math.round(e*t),r-1)}function se(e){return se=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},se(e)}var Zr;function Yr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Xr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yr(Object(r),!0).forEach(function(n){ta(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ta(e,t,r){return t=Jr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ra(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Jr(n.key),n)}}function na(e,t,r){return t&&qr(e.prototype,t),r&&qr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jr(e){var t=oa(e,"string");return se(t)==="symbol"?t:String(t)}function oa(e,t){if(se(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(se(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ia(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ut(e,t)}function Ut(e,t){return Ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Ut(e,t)}function aa(e){var t=ca();return function(){var n=Qe(e),o;if(t){var i=Qe(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return ua(this,o)}}function ua(e,t){if(t&&(se(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fa(e)}function fa(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ca(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Qe(e){return Qe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Qe(e)}Zr=Symbol.toStringTag;var V=function(e){ia(r,e);var t=aa(r);function r(n,o){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.defaultProps;return ra(this,r),i=t.call(this,n,o,a),i.dimension=void 0,i.format=void 0,i.width=void 0,i.height=void 0,i.depth=void 0,i.sampler=void 0,i.dimension=i.props.dimension,i.format=i.props.format,i.width=i.props.width,i.height=i.props.height,i.depth=i.props.depth,i}return na(r,[{key:Zr,get:function(){return"Texture"}}]),r}(E);V.defaultProps=Xr(Xr({},E.defaultProps),{},{data:null,dimension:"2d",format:"rgba8unorm",width:void 0,height:void 0,depth:1,mipmaps:!0,sampler:{},compressed:!1,usage:0,mipLevels:void 0,samples:void 0,type:void 0});V.COPY_SRC=1;V.COPY_DST=2;V.TEXTURE_BINDING=4;V.STORAGE_BINDING=8;V.RENDER_ATTACHMENT=16;function le(e){return le=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},le(e)}var rn;function Qr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function en(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qr(Object(r),!0).forEach(function(n){sa(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function sa(e,t,r){return t=nn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function la(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,nn(n.key),n)}}function pa(e,t,r){return t&&tn(e.prototype,t),r&&tn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function nn(e){var t=ha(e,"string");return le(t)==="symbol"?t:String(t)}function ha(e,t){if(le(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(le(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function da(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wt(e,t)}function Wt(e,t){return Wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Wt(e,t)}function ya(e){var t=ba();return function(){var n=et(e),o;if(t){var i=et(this).constructor;o=Reflect.construct(n,arguments,i)}else o=n.apply(this,arguments);return ma(this,o)}}function ma(e,t){if(t&&(le(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return va(e)}function va(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ba(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function et(e){return et=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},et(e)}rn=Symbol.toStringTag;var tt=function(e){da(r,e);var t=ya(r);function r(n,o){return la(this,r),t.call(this,n,o,r.defaultProps)}return pa(r,[{key:rn,get:function(){return"ExternalTexture"}}]),r}(E);tt.defaultProps=en(en({},E.defaultProps),{},{source:null,colorSpace:"srgb"});function Me(e){return Me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Me(e)}function ga(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=wa(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(h){throw h},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
10
10
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,l;return{s:function(){r=r.call(e)},n:function(){var h=r.next();return i=h.done,h},e:function(h){a=!0,l=h},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(a)throw l}}}}function wa(e,t){if(e){if(typeof e=="string")return on(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return on(e,t)}}function on(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function an(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function un(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?an(Object(r),!0).forEach(function(n){_a(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):an(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _a(e,t,r){return t=Oa(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Oa(e){var t=Pa(e,"string");return Me(t)==="symbol"?t:String(t)}function Pa(e,t){if(Me(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Me(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cn(e,t,r){var n="",o=t.split(/\r?\n/),i=e.slice().sort(function(w,O){return w.lineNum-O.lineNum});switch(r?.showSourceCode||"no"){case"all":for(var a=0,l=1;l<=o.length;l++)for(n+=sn(o[l-1],l,r);i.length>a&&i[a].lineNum===l;){var s=i[a++];n+=fn(s,o,s.lineNum,un(un({},r),{},{inlineSource:!1}))}return n;case"issues":case"no":var h=ga(e),b;try{for(h.s();!(b=h.n()).done;){var m=b.value;n+=fn(m,o,m.lineNum,{inlineSource:r?.showSourceCode!=="no"})}}catch(w){h.e(w)}finally{h.f()}return n}}function fn(e,t,r,n){if(n!=null&&n.inlineSource){var o=Sa(t,r),i=e.linePos>0?"".concat(" ".repeat(e.linePos+5),`^^^
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luma.gl/webgpu",
|
|
3
|
-
"version": "9.0.0-beta.
|
|
3
|
+
"version": "9.0.0-beta.3",
|
|
4
4
|
"description": "WebGPU adapter for the luma.gl API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@babel/runtime": "^7.0.0",
|
|
40
|
-
"@luma.gl/core": "9.0.0-beta.
|
|
40
|
+
"@luma.gl/core": "9.0.0-beta.3",
|
|
41
41
|
"@probe.gl/env": "^4.0.2",
|
|
42
42
|
"@webgpu/types": "^0.1.34"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "236a5e51ca79fe11f9cb9fd7b0af6520e9c52e87"
|
|
45
45
|
}
|