@luma.gl/core 9.0.0-alpha.25 → 9.0.0-alpha.27

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 CHANGED
@@ -1134,9 +1134,9 @@ var __exports__ = (() => {
1134
1134
  };
1135
1135
  if ((props.usage || 0) & Buffer2.INDEX && !props.indexType) {
1136
1136
  if (props.data instanceof Uint32Array) {
1137
- props.indexType = "uint32";
1137
+ newProps.indexType = "uint32";
1138
1138
  } else if (props.data instanceof Uint16Array) {
1139
- props.indexType = "uint16";
1139
+ newProps.indexType = "uint16";
1140
1140
  }
1141
1141
  }
1142
1142
  return newProps;
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 gt=Object.create;var oe=Object.defineProperty;var yt=Object.getOwnPropertyDescriptor;var vt=Object.getOwnPropertyNames;var bt=Object.getPrototypeOf,_t=Object.prototype.hasOwnProperty;var ve=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),wt=(r,t)=>{for(var e in t)oe(r,e,{get:t[e],enumerable:!0})},He=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of vt(t))!_t.call(r,o)&&o!==e&&oe(r,o,{get:()=>t[o],enumerable:!(n=yt(t,o))||n.enumerable});return r};var St=(r,t,e)=>(e=r!=null?gt(bt(r)):{},He(t||!r||!r.__esModule?oe(e,"default",{value:r,enumerable:!0}):e,r)),Tt=r=>He(oe({},"__esModule",{value:!0}),r);var et=ve((un,I)=>{function Se(r){return I.exports=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},I.exports.__esModule=!0,I.exports.default=I.exports,Se(r)}I.exports=Se,I.exports.__esModule=!0,I.exports.default=I.exports});var rt=ve((cn,k)=>{var Lt=et().default;function tt(){"use strict";k.exports=tt=function(){return r},k.exports.__esModule=!0,k.exports.default=k.exports;var r={},t=Object.prototype,e=t.hasOwnProperty,n=Object.defineProperty||function(c,i,s){c[i]=s.value},o=typeof Symbol=="function"?Symbol:{},a=o.iterator||"@@iterator",f=o.asyncIterator||"@@asyncIterator",d=o.toStringTag||"@@toStringTag";function u(c,i,s){return Object.defineProperty(c,i,{value:s,enumerable:!0,configurable:!0,writable:!0}),c[i]}try{u({},"")}catch{u=function(s,l,h){return s[l]=h}}function g(c,i,s,l){var h=i&&i.prototype instanceof R?i:R,p=Object.create(h.prototype),y=new ge(l||[]);return n(p,"_invoke",{value:ht(c,s,y)}),p}function O(c,i,s){try{return{type:"normal",arg:c.call(i,s)}}catch(l){return{type:"throw",arg:l}}}r.wrap=g;var v={};function R(){}function j(){}function N(){}var pe={};u(pe,a,function(){return this});var he=Object.getPrototypeOf,re=he&&he(he(ye([])));re&&re!==t&&e.call(re,a)&&(pe=re);var U=N.prototype=R.prototype=Object.create(pe);function Ge(c){["next","throw","return"].forEach(function(i){u(c,i,function(s){return this._invoke(i,s)})})}function ne(c,i){function s(h,p,y,b){var _=O(c[h],c,p);if(_.type!=="throw"){var L=_.arg,C=L.value;return C&&Lt(C)=="object"&&e.call(C,"__await")?i.resolve(C.__await).then(function(B){s("next",B,y,b)},function(B){s("throw",B,y,b)}):i.resolve(C).then(function(B){L.value=B,y(L)},function(B){return s("throw",B,y,b)})}b(_.arg)}var l;n(this,"_invoke",{value:function(p,y){function b(){return new i(function(_,L){s(p,y,_,L)})}return l=l?l.then(b,b):b()}})}function ht(c,i,s){var l="suspendedStart";return function(h,p){if(l==="executing")throw new Error("Generator is already running");if(l==="completed"){if(h==="throw")throw p;return Fe()}for(s.method=h,s.arg=p;;){var y=s.delegate;if(y){var b=Me(y,s);if(b){if(b===v)continue;return b}}if(s.method==="next")s.sent=s._sent=s.arg;else if(s.method==="throw"){if(l==="suspendedStart")throw l="completed",s.arg;s.dispatchException(s.arg)}else s.method==="return"&&s.abrupt("return",s.arg);l="executing";var _=O(c,i,s);if(_.type==="normal"){if(l=s.done?"completed":"suspendedYield",_.arg===v)continue;return{value:_.arg,done:s.done}}_.type==="throw"&&(l="completed",s.method="throw",s.arg=_.arg)}}}function Me(c,i){var s=i.method,l=c.iterator[s];if(l===void 0)return i.delegate=null,s==="throw"&&c.iterator.return&&(i.method="return",i.arg=void 0,Me(c,i),i.method==="throw")||s!=="return"&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+s+"' method")),v;var h=O(l,c.iterator,i.arg);if(h.type==="throw")return i.method="throw",i.arg=h.arg,i.delegate=null,v;var p=h.arg;return p?p.done?(i[c.resultName]=p.value,i.next=c.nextLoc,i.method!=="return"&&(i.method="next",i.arg=void 0),i.delegate=null,v):p:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,v)}function dt(c){var i={tryLoc:c[0]};1 in c&&(i.catchLoc=c[1]),2 in c&&(i.finallyLoc=c[2],i.afterLoc=c[3]),this.tryEntries.push(i)}function de(c){var i=c.completion||{};i.type="normal",delete i.arg,c.completion=i}function ge(c){this.tryEntries=[{tryLoc:"root"}],c.forEach(dt,this),this.reset(!0)}function ye(c){if(c){var i=c[a];if(i)return i.call(c);if(typeof c.next=="function")return c;if(!isNaN(c.length)){var s=-1,l=function h(){for(;++s<c.length;)if(e.call(c,s))return h.value=c[s],h.done=!1,h;return h.value=void 0,h.done=!0,h};return l.next=l}}return{next:Fe}}function Fe(){return{value:void 0,done:!0}}return j.prototype=N,n(U,"constructor",{value:N,configurable:!0}),n(N,"constructor",{value:j,configurable:!0}),j.displayName=u(N,d,"GeneratorFunction"),r.isGeneratorFunction=function(c){var i=typeof c=="function"&&c.constructor;return!!i&&(i===j||(i.displayName||i.name)==="GeneratorFunction")},r.mark=function(c){return Object.setPrototypeOf?Object.setPrototypeOf(c,N):(c.__proto__=N,u(c,d,"GeneratorFunction")),c.prototype=Object.create(U),c},r.awrap=function(c){return{__await:c}},Ge(ne.prototype),u(ne.prototype,f,function(){return this}),r.AsyncIterator=ne,r.async=function(c,i,s,l,h){h===void 0&&(h=Promise);var p=new ne(g(c,i,s,l),h);return r.isGeneratorFunction(i)?p:p.next().then(function(y){return y.done?y.value:p.next()})},Ge(U),u(U,d,"Generator"),u(U,a,function(){return this}),u(U,"toString",function(){return"[object Generator]"}),r.keys=function(c){var i=Object(c),s=[];for(var l in i)s.push(l);return s.reverse(),function h(){for(;s.length;){var p=s.pop();if(p in i)return h.value=p,h.done=!1,h}return h.done=!0,h}},r.values=ye,ge.prototype={constructor:ge,reset:function(i){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(de),!i)for(var s in this)s.charAt(0)==="t"&&e.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=void 0)},stop:function(){this.done=!0;var i=this.tryEntries[0].completion;if(i.type==="throw")throw i.arg;return this.rval},dispatchException:function(i){if(this.done)throw i;var s=this;function l(L,C){return y.type="throw",y.arg=i,s.next=L,C&&(s.method="next",s.arg=void 0),!!C}for(var h=this.tryEntries.length-1;h>=0;--h){var p=this.tryEntries[h],y=p.completion;if(p.tryLoc==="root")return l("end");if(p.tryLoc<=this.prev){var b=e.call(p,"catchLoc"),_=e.call(p,"finallyLoc");if(b&&_){if(this.prev<p.catchLoc)return l(p.catchLoc,!0);if(this.prev<p.finallyLoc)return l(p.finallyLoc)}else if(b){if(this.prev<p.catchLoc)return l(p.catchLoc,!0)}else{if(!_)throw new Error("try statement without catch or finally");if(this.prev<p.finallyLoc)return l(p.finallyLoc)}}}},abrupt:function(i,s){for(var l=this.tryEntries.length-1;l>=0;--l){var h=this.tryEntries[l];if(h.tryLoc<=this.prev&&e.call(h,"finallyLoc")&&this.prev<h.finallyLoc){var p=h;break}}p&&(i==="break"||i==="continue")&&p.tryLoc<=s&&s<=p.finallyLoc&&(p=null);var y=p?p.completion:{};return y.type=i,y.arg=s,p?(this.method="next",this.next=p.finallyLoc,v):this.complete(y)},complete:function(i,s){if(i.type==="throw")throw i.arg;return i.type==="break"||i.type==="continue"?this.next=i.arg:i.type==="return"?(this.rval=this.arg=i.arg,this.method="return",this.next="end"):i.type==="normal"&&s&&(this.next=s),v},finish:function(i){for(var s=this.tryEntries.length-1;s>=0;--s){var l=this.tryEntries[s];if(l.finallyLoc===i)return this.complete(l.completion,l.afterLoc),de(l),v}},catch:function(i){for(var s=this.tryEntries.length-1;s>=0;--s){var l=this.tryEntries[s];if(l.tryLoc===i){var h=l.completion;if(h.type==="throw"){var p=h.arg;de(l)}return p}}throw new Error("illegal catch attempt")},delegateYield:function(i,s,l){return this.delegate={iterator:ye(i),resultName:s,nextLoc:l},this.method==="next"&&(this.arg=void 0),v}},r}k.exports=tt,k.exports.__esModule=!0,k.exports.default=k.exports});var ot=ve((fn,nt)=>{var ce=rt()();nt.exports=ce;try{regeneratorRuntime=ce}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=ce:Function("r","regeneratorRuntime = r")(ce)}});var Kt={};wt(Kt,{Device:()=>le,Timeline:()=>Be,assert:()=>te,log:()=>P,luma:()=>ee,uid:()=>H});function be(r){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,e=r||t;return!!(e&&e.indexOf("Electron")>=0)}function w(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||be()}var xt=globalThis.self||globalThis.window||globalThis.global,V=globalThis.window||globalThis.self||globalThis.global,Et=globalThis.document||{},G=globalThis.process||{},Ot=globalThis.console,Zt=globalThis.navigator||{};var ie=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",tr=w();function Pt(r){try{let t=window[r],e="__storage_test__";return t.setItem(e,e),t.removeItem(e),t}catch{return null}}var ae=class{constructor(t,e){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=Pt(n),this.id=t,this.config=e,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}}_loadConfiguration(){let t={};if(this.storage){let e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}};function Ue(r){let t;return r<10?t="".concat(r.toFixed(2),"ms"):r<100?t="".concat(r.toFixed(1),"ms"):r<1e3?t="".concat(r.toFixed(0),"ms"):t="".concat((r/1e3).toFixed(2),"s"),t}function Ve(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,e=Math.max(t-r.length,0);return"".concat(" ".repeat(e)).concat(r)}function se(r,t,e){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,o=r.src.replace(/\(/g,"%28").replace(/\)/g,"%29");r.width>n&&(e=Math.min(e,n/r.width));let a=r.width*e,f=r.height*e,d=["font-size:1px;","padding:".concat(Math.floor(f/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(f,"px;"),"background:url(".concat(o,");"),"background-size:".concat(a,"px ").concat(f,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),d]}var ue;(function(r){r[r.BLACK=30]="BLACK",r[r.RED=31]="RED",r[r.GREEN=32]="GREEN",r[r.YELLOW=33]="YELLOW",r[r.BLUE=34]="BLUE",r[r.MAGENTA=35]="MAGENTA",r[r.CYAN=36]="CYAN",r[r.WHITE=37]="WHITE",r[r.BRIGHT_BLACK=90]="BRIGHT_BLACK",r[r.BRIGHT_RED=91]="BRIGHT_RED",r[r.BRIGHT_GREEN=92]="BRIGHT_GREEN",r[r.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",r[r.BRIGHT_BLUE=94]="BRIGHT_BLUE",r[r.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",r[r.BRIGHT_CYAN=96]="BRIGHT_CYAN",r[r.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(ue||(ue={}));var At=10;function ze(r){return typeof r!="string"?r:(r=r.toUpperCase(),ue[r]||ue.WHITE)}function Ye(r,t,e){if(!w&&typeof r=="string"){if(t){let n=ze(t);r="\x1B[".concat(n,"m").concat(r,"\x1B[39m")}if(e){let n=ze(e);r="\x1B[".concat(n+At,"m").concat(r,"\x1B[49m")}}return r}function We(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],e=Object.getPrototypeOf(r),n=Object.getOwnPropertyNames(e),o=r;for(let a of n){let f=o[a];typeof f=="function"&&(t.find(d=>a===d)||(o[a]=f.bind(r)))}}function z(r,t){if(!r)throw new Error(t||"Assertion failed")}function M(){let r;if(w()&&V.performance){var t,e;r=V===null||V===void 0||(t=V.performance)===null||t===void 0||(e=t.now)===null||e===void 0?void 0:e.call(t)}else if("hrtime"in G){var n;let o=G===null||G===void 0||(n=G.hrtime)===null||n===void 0?void 0:n.call(G);r=o[0]*1e3+o[1]/1e6}else r=Date.now();return r}var Y={debug:w()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},It={enabled:!0,level:0};function x(){}var Ke={},Xe={once:!0},D=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=ie,this._startTs=M(),this._deltaTs=M(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new ae("__probe-".concat(this.id,"__"),It),this.timeStamp("".concat(this.id," started")),We(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((M()-this._startTs).toPrecision(10))}getDelta(){return Number((M()-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,e){this._storage.setConfiguration({[t]:e})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,e){z(t,e)}warn(t){return this._getLogFunction(0,t,Y.warn,arguments,Xe)}error(t){return this._getLogFunction(0,t,Y.error,arguments)}deprecated(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}removed(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}probe(t,e){return this._getLogFunction(t,e,Y.log,arguments,{time:!0,once:!0})}log(t,e){return this._getLogFunction(t,e,Y.debug,arguments)}info(t,e){return this._getLogFunction(t,e,console.info,arguments)}once(t,e){return this._getLogFunction(t,e,Y.debug||Y.info,arguments,Xe)}table(t,e,n){return e?this._getLogFunction(t,e,console.table||x,n&&[n],{tag:Ct(e)}):x}image(t){let{logLevel:e,priority:n,image:o,message:a="",scale:f=1}=t;return this._shouldLog(e||n)?w()?jt({image:o,message:a,scale:f}):Rt({image:o,message:a,scale:f}):x}time(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}timeEnd(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,e){return this._getLogFunction(t,e,console.timeStamp||x)}group(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},o=qe({logLevel:t,message:e,opts:n}),{collapsed:a}=n;return o.method=(a?console.groupCollapsed:console.group)||console.info,this._getLogFunction(o)}groupCollapsed(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,e,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||x)}withGroup(t,e,n){this.group(t,e)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=Je(t)}_getLogFunction(t,e,n,o,a){if(this._shouldLog(t)){a=qe({logLevel:t,message:e,args:o,opts:a}),n=n||a.method,z(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=M();let f=a.tag||a.message;if(a.once&&f)if(!Ke[f])Ke[f]=M();else return x;return e=kt(this.id,a.message,a),n.bind(console,e,...a.args)}return x}};D.VERSION=ie;function Je(r){if(!r)return 0;let t;switch(typeof r){case"number":t=r;break;case"object":t=r.logLevel||r.priority||0;break;default:return 0}return z(Number.isFinite(t)&&t>=0),t}function qe(r){let{logLevel:t,message:e}=r;r.logLevel=Je(t);let n=r.args?Array.from(r.args):[];for(;n.length&&n.shift()!==e;);switch(typeof t){case"string":case"function":e!==void 0&&n.unshift(e),r.message=t;break;case"object":Object.assign(r,t);break;default:}typeof r.message=="function"&&(r.message=r.message());let o=typeof r.message;return z(o==="string"||o==="object"),Object.assign(r,{args:n},r.opts)}function kt(r,t,e){if(typeof t=="string"){let n=e.time?Ve(Ue(e.total)):"";t=e.time?"".concat(r,": ").concat(n," ").concat(t):"".concat(r,": ").concat(t),t=Ye(t,e.color,e.background)}return t}function Rt(r){let{image:t,message:e="",scale:n=1}=r;return console.warn("removed"),x}function jt(r){let{image:t,message:e="",scale:n=1}=r;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let f=se(a,e,n);console.log(...f)},a.src=t,x}let o=t.nodeName||"";if(o.toLowerCase()==="img")return console.log(...se(t,e,n)),x;if(o.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...se(a,e,n)),a.src=t.toDataURL(),x}return x}function Ct(r){for(let t in r)for(let e in r[t])return e||"untitled";return"empty"}var Or=new D({id:"@probe.gl/log"});var P=new D({id:"luma.gl"});function S(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function A(r){return A=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},A(r)}function _e(r,t){if(A(r)!=="object"||r===null)return r;var e=r[Symbol.toPrimitive];if(e!==void 0){var n=e.call(r,t||"default");if(A(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}function J(r){var t=_e(r,"string");return A(t)==="symbol"?t:String(t)}function Qe(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,J(n.key),n)}}function T(r,t,e){return t&&Qe(r.prototype,t),e&&Qe(r,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function m(r,t,e){return t=J(t),t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function Q(){let r;if(typeof window<"u"&&window.performance)r=window.performance.now();else if(typeof process<"u"&&process.hrtime){let t=process.hrtime();r=t[0]*1e3+t[1]/1e6}else r=Date.now();return r}var F=class{constructor(t,e){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=e,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=Q(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Q()-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 W=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 e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:t,type:e})}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 e of Object.values(this.stats))t(e)}getTable(){let t={};return this.forEach(e=>{t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}}),t}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(e=>this._getOrCreate(e))}_getOrCreate(t){let{name:e,type:n}=t,o=this.stats[e];return o||(t instanceof F?o=t:o=new F(e,n),this.stats[e]=o),o}};var Dt=function(){function r(){S(this,r),m(this,"stats",new Map)}return T(r,[{key:"getStats",value:function(e){return this.get(e)}},{key:"get",value:function(e){return this.stats.has(e)||this.stats.set(e,new W({id:e})),this.stats.get(e)}}]),r}(),K=new Dt;function Nt(){var r=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",t="set luma.log.level=1 (or higher) to trace rendering";if(globalThis.luma&&globalThis.luma.VERSION!==r)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(r));return globalThis.luma||(w()&&P.log(1,"luma.gl ".concat(r," - ").concat(t))(),globalThis.luma=globalThis.luma||{VERSION:r,version:r,log:P,stats:K}),r}var Ze=Nt();function $e(r,t,e,n,o,a,f){try{var d=r[a](f),u=d.value}catch(g){e(g);return}d.done?t(u):Promise.resolve(u).then(n,o)}function we(r){return function(){var t=this,e=arguments;return new Promise(function(n,o){var a=r.apply(t,e);function f(u){$e(a,n,o,f,d,"next",u)}function d(u){$e(a,n,o,f,d,"throw",u)}f(void 0)})}}var ke=St(ot(),1);var Te={};function H(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";Te[r]=Te[r]||1;var t=Te[r]++;return"".concat(r,"-").concat(t)}function Z(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function $(r,t){return $=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},$(r,t)}function xe(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),t&&$(r,t)}function Ee(r,t){if(t&&(A(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Z(r)}function X(r){return X=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},X(r)}function it(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),e.push.apply(e,n)}return e}function Bt(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?it(Object(e),!0).forEach(function(n){m(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):it(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var Oe={id:"undefined",handle:void 0,userData:void 0},Pe=function(){function r(t,e,n){if(S(this,r),m(this,"id",void 0),m(this,"props",void 0),m(this,"userData",{}),m(this,"device",void 0),m(this,"_device",void 0),m(this,"destroyed",!1),m(this,"allocatedBytes",0),m(this,"_attachedResources",new Set),!t)throw new Error("no device");this._device=t,this.props=Gt(e,n);var o=this.props.id!=="undefined"?this.props.id:H(this[Symbol.toStringTag]);this.props.id=o,this.id=o,this.userData=this.props.userData||{},this.addStats()}return T(r,[{key:"destroy",value:function(){this.destroyResource()}},{key:"delete",value:function(){return this.destroy(),this}},{key:"toString",value:function(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")}},{key:"getProps",value:function(){return this.props}},{key:"attachResource",value:function(e){this._attachedResources.add(e)}},{key:"detachResource",value:function(e){this._attachedResources.delete(e)}},{key:"destroyAttachedResource",value:function(e){this._attachedResources.delete(e)&&e.destroy()}},{key:"destroyAttachedResources",value:function(){for(var e=0,n=Object.values(this._attachedResources);e<n.length;e++){var o=n[e];o.destroy()}this._attachedResources=new Set}},{key:"destroyResource",value:function(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0}},{key:"removeStats",value:function(){var e=this._device.statsManager.getStats("Resource Counts"),n=this[Symbol.toStringTag];e.get("".concat(n,"s Active")).decrementCount()}},{key:"trackAllocatedMemory",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag],o=this._device.statsManager.getStats("Resource Counts");o.get("GPU Memory").addCount(e),o.get("".concat(n," Memory")).addCount(e),this.allocatedBytes=e}},{key:"trackDeallocatedMemory",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag],n=this._device.statsManager.getStats("Resource Counts");n.get("GPU Memory").subtractCount(this.allocatedBytes),n.get("".concat(e," Memory")).subtractCount(this.allocatedBytes),this.allocatedBytes=0}},{key:"addStats",value:function(){var e=this._device.statsManager.getStats("Resource Counts"),n=this[Symbol.toStringTag];e.get("Resources Created").incrementCount(),e.get("".concat(n,"s Created")).incrementCount(),e.get("".concat(n,"s Active")).incrementCount()}}]),r}();m(Pe,"defaultProps",Oe);function Gt(r,t){var e=Bt({},t);for(var n in r)r[n]!==void 0&&(e[n]=r[n]);return e}var st;function Mt(r){var t=Ft();return function(){var n=X(r),o;if(t){var a=X(this).constructor;o=Reflect.construct(n,arguments,a)}else o=n.apply(this,arguments);return Ee(this,o)}}function Ft(){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 at(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),e.push.apply(e,n)}return e}function Ae(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?at(Object(e),!0).forEach(function(n){m(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):at(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var Ht=Ae(Ae({},Oe),{},{usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1});st=Symbol.toStringTag;var E=function(r){xe(e,r);var t=Mt(e);function e(n,o){var a;S(this,e);var f=Ae({},o);return(o.usage||0)&e.INDEX&&!o.indexType&&(o.data instanceof Uint32Array?f.indexType="uint32":o.data instanceof Uint16Array&&(f.indexType="uint16")),a=t.call(this,n,f,Ht),m(Z(a),"byteLength",void 0),a}return T(e,[{key:st,get:function(){return"Buffer"}},{key:"write",value:function(o,a){throw new Error("not implemented")}},{key:"readAsync",value:function(o,a){throw new Error("not implemented")}},{key:"getData",value:function(){throw new Error("not implemented")}}]),e}(Pe);m(E,"MAP_READ",1);m(E,"MAP_WRITE",2);m(E,"COPY_SRC",4);m(E,"COPY_DST",8);m(E,"INDEX",16);m(E,"VERTEX",32);m(E,"UNIFORM",64);m(E,"STORAGE",128);m(E,"INDIRECT",256);m(E,"QUERY_RESOLVE",512);var ct;function ut(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),e.push.apply(e,n)}return e}function Ie(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?ut(Object(e),!0).forEach(function(n){m(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):ut(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var fe={id:null,type:"best-available",canvas:null,container:null,webgl2:!0,webgl1:!0,manageState:!0,width:800,height:600,debug:Boolean(P.get("debug")),break:[],gl:null};ct=Symbol.toStringTag;var le=function(){function r(t){S(this,r),m(this,"id",void 0),m(this,"statsManager",K),m(this,"props",void 0),m(this,"userData",{}),m(this,"info",void 0),m(this,"lost",void 0),m(this,"canvasContext",void 0),this.props=Ie(Ie({},fe),t),this.id=this.props.id||H(this[Symbol.toStringTag].toLowerCase())}return T(r,[{key:ct,get:function(){return"Device"}},{key:"loseDevice",value:function(){return!1}},{key:"createTexture",value:function(e){return(e instanceof Promise||typeof e=="string")&&(e={data:e}),this._createTexture(e)}},{key:"createCommandEncoder",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};throw new Error("not implemented")}},{key:"_getBufferProps",value:function(e){if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return{data:e};var n=Ie({},e);return(e.usage||0)&E.INDEX&&!e.indexType&&(e.data instanceof Uint32Array?e.indexType="uint32":e.data instanceof Uint16Array&&(e.indexType="uint16")),n}}]),r}();m(le,"VERSION",Ze);function ft(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),e.push.apply(e,n)}return e}function lt(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?ft(Object(e),!0).forEach(function(n){m(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):ft(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function Ut(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=Vt(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,o=function(){};return{s:o,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(g){throw g},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
7
+ var __exports__=(()=>{var gt=Object.create;var oe=Object.defineProperty;var yt=Object.getOwnPropertyDescriptor;var vt=Object.getOwnPropertyNames;var bt=Object.getPrototypeOf,_t=Object.prototype.hasOwnProperty;var ve=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),wt=(r,t)=>{for(var e in t)oe(r,e,{get:t[e],enumerable:!0})},He=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of vt(t))!_t.call(r,o)&&o!==e&&oe(r,o,{get:()=>t[o],enumerable:!(n=yt(t,o))||n.enumerable});return r};var St=(r,t,e)=>(e=r!=null?gt(bt(r)):{},He(t||!r||!r.__esModule?oe(e,"default",{value:r,enumerable:!0}):e,r)),Tt=r=>He(oe({},"__esModule",{value:!0}),r);var et=ve((un,I)=>{function Se(r){return I.exports=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},I.exports.__esModule=!0,I.exports.default=I.exports,Se(r)}I.exports=Se,I.exports.__esModule=!0,I.exports.default=I.exports});var rt=ve((cn,k)=>{var Lt=et().default;function tt(){"use strict";k.exports=tt=function(){return r},k.exports.__esModule=!0,k.exports.default=k.exports;var r={},t=Object.prototype,e=t.hasOwnProperty,n=Object.defineProperty||function(c,i,s){c[i]=s.value},o=typeof Symbol=="function"?Symbol:{},a=o.iterator||"@@iterator",f=o.asyncIterator||"@@asyncIterator",d=o.toStringTag||"@@toStringTag";function u(c,i,s){return Object.defineProperty(c,i,{value:s,enumerable:!0,configurable:!0,writable:!0}),c[i]}try{u({},"")}catch{u=function(s,l,h){return s[l]=h}}function g(c,i,s,l){var h=i&&i.prototype instanceof R?i:R,p=Object.create(h.prototype),y=new ge(l||[]);return n(p,"_invoke",{value:ht(c,s,y)}),p}function O(c,i,s){try{return{type:"normal",arg:c.call(i,s)}}catch(l){return{type:"throw",arg:l}}}r.wrap=g;var v={};function R(){}function j(){}function N(){}var pe={};u(pe,a,function(){return this});var he=Object.getPrototypeOf,re=he&&he(he(ye([])));re&&re!==t&&e.call(re,a)&&(pe=re);var U=N.prototype=R.prototype=Object.create(pe);function Ge(c){["next","throw","return"].forEach(function(i){u(c,i,function(s){return this._invoke(i,s)})})}function ne(c,i){function s(h,p,y,b){var _=O(c[h],c,p);if(_.type!=="throw"){var L=_.arg,C=L.value;return C&&Lt(C)=="object"&&e.call(C,"__await")?i.resolve(C.__await).then(function(B){s("next",B,y,b)},function(B){s("throw",B,y,b)}):i.resolve(C).then(function(B){L.value=B,y(L)},function(B){return s("throw",B,y,b)})}b(_.arg)}var l;n(this,"_invoke",{value:function(p,y){function b(){return new i(function(_,L){s(p,y,_,L)})}return l=l?l.then(b,b):b()}})}function ht(c,i,s){var l="suspendedStart";return function(h,p){if(l==="executing")throw new Error("Generator is already running");if(l==="completed"){if(h==="throw")throw p;return Fe()}for(s.method=h,s.arg=p;;){var y=s.delegate;if(y){var b=Me(y,s);if(b){if(b===v)continue;return b}}if(s.method==="next")s.sent=s._sent=s.arg;else if(s.method==="throw"){if(l==="suspendedStart")throw l="completed",s.arg;s.dispatchException(s.arg)}else s.method==="return"&&s.abrupt("return",s.arg);l="executing";var _=O(c,i,s);if(_.type==="normal"){if(l=s.done?"completed":"suspendedYield",_.arg===v)continue;return{value:_.arg,done:s.done}}_.type==="throw"&&(l="completed",s.method="throw",s.arg=_.arg)}}}function Me(c,i){var s=i.method,l=c.iterator[s];if(l===void 0)return i.delegate=null,s==="throw"&&c.iterator.return&&(i.method="return",i.arg=void 0,Me(c,i),i.method==="throw")||s!=="return"&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+s+"' method")),v;var h=O(l,c.iterator,i.arg);if(h.type==="throw")return i.method="throw",i.arg=h.arg,i.delegate=null,v;var p=h.arg;return p?p.done?(i[c.resultName]=p.value,i.next=c.nextLoc,i.method!=="return"&&(i.method="next",i.arg=void 0),i.delegate=null,v):p:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,v)}function dt(c){var i={tryLoc:c[0]};1 in c&&(i.catchLoc=c[1]),2 in c&&(i.finallyLoc=c[2],i.afterLoc=c[3]),this.tryEntries.push(i)}function de(c){var i=c.completion||{};i.type="normal",delete i.arg,c.completion=i}function ge(c){this.tryEntries=[{tryLoc:"root"}],c.forEach(dt,this),this.reset(!0)}function ye(c){if(c){var i=c[a];if(i)return i.call(c);if(typeof c.next=="function")return c;if(!isNaN(c.length)){var s=-1,l=function h(){for(;++s<c.length;)if(e.call(c,s))return h.value=c[s],h.done=!1,h;return h.value=void 0,h.done=!0,h};return l.next=l}}return{next:Fe}}function Fe(){return{value:void 0,done:!0}}return j.prototype=N,n(U,"constructor",{value:N,configurable:!0}),n(N,"constructor",{value:j,configurable:!0}),j.displayName=u(N,d,"GeneratorFunction"),r.isGeneratorFunction=function(c){var i=typeof c=="function"&&c.constructor;return!!i&&(i===j||(i.displayName||i.name)==="GeneratorFunction")},r.mark=function(c){return Object.setPrototypeOf?Object.setPrototypeOf(c,N):(c.__proto__=N,u(c,d,"GeneratorFunction")),c.prototype=Object.create(U),c},r.awrap=function(c){return{__await:c}},Ge(ne.prototype),u(ne.prototype,f,function(){return this}),r.AsyncIterator=ne,r.async=function(c,i,s,l,h){h===void 0&&(h=Promise);var p=new ne(g(c,i,s,l),h);return r.isGeneratorFunction(i)?p:p.next().then(function(y){return y.done?y.value:p.next()})},Ge(U),u(U,d,"Generator"),u(U,a,function(){return this}),u(U,"toString",function(){return"[object Generator]"}),r.keys=function(c){var i=Object(c),s=[];for(var l in i)s.push(l);return s.reverse(),function h(){for(;s.length;){var p=s.pop();if(p in i)return h.value=p,h.done=!1,h}return h.done=!0,h}},r.values=ye,ge.prototype={constructor:ge,reset:function(i){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(de),!i)for(var s in this)s.charAt(0)==="t"&&e.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=void 0)},stop:function(){this.done=!0;var i=this.tryEntries[0].completion;if(i.type==="throw")throw i.arg;return this.rval},dispatchException:function(i){if(this.done)throw i;var s=this;function l(L,C){return y.type="throw",y.arg=i,s.next=L,C&&(s.method="next",s.arg=void 0),!!C}for(var h=this.tryEntries.length-1;h>=0;--h){var p=this.tryEntries[h],y=p.completion;if(p.tryLoc==="root")return l("end");if(p.tryLoc<=this.prev){var b=e.call(p,"catchLoc"),_=e.call(p,"finallyLoc");if(b&&_){if(this.prev<p.catchLoc)return l(p.catchLoc,!0);if(this.prev<p.finallyLoc)return l(p.finallyLoc)}else if(b){if(this.prev<p.catchLoc)return l(p.catchLoc,!0)}else{if(!_)throw new Error("try statement without catch or finally");if(this.prev<p.finallyLoc)return l(p.finallyLoc)}}}},abrupt:function(i,s){for(var l=this.tryEntries.length-1;l>=0;--l){var h=this.tryEntries[l];if(h.tryLoc<=this.prev&&e.call(h,"finallyLoc")&&this.prev<h.finallyLoc){var p=h;break}}p&&(i==="break"||i==="continue")&&p.tryLoc<=s&&s<=p.finallyLoc&&(p=null);var y=p?p.completion:{};return y.type=i,y.arg=s,p?(this.method="next",this.next=p.finallyLoc,v):this.complete(y)},complete:function(i,s){if(i.type==="throw")throw i.arg;return i.type==="break"||i.type==="continue"?this.next=i.arg:i.type==="return"?(this.rval=this.arg=i.arg,this.method="return",this.next="end"):i.type==="normal"&&s&&(this.next=s),v},finish:function(i){for(var s=this.tryEntries.length-1;s>=0;--s){var l=this.tryEntries[s];if(l.finallyLoc===i)return this.complete(l.completion,l.afterLoc),de(l),v}},catch:function(i){for(var s=this.tryEntries.length-1;s>=0;--s){var l=this.tryEntries[s];if(l.tryLoc===i){var h=l.completion;if(h.type==="throw"){var p=h.arg;de(l)}return p}}throw new Error("illegal catch attempt")},delegateYield:function(i,s,l){return this.delegate={iterator:ye(i),resultName:s,nextLoc:l},this.method==="next"&&(this.arg=void 0),v}},r}k.exports=tt,k.exports.__esModule=!0,k.exports.default=k.exports});var ot=ve((fn,nt)=>{var ce=rt()();nt.exports=ce;try{regeneratorRuntime=ce}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=ce:Function("r","regeneratorRuntime = r")(ce)}});var Kt={};wt(Kt,{Device:()=>le,Timeline:()=>Be,assert:()=>te,log:()=>P,luma:()=>ee,uid:()=>H});function be(r){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,e=r||t;return!!(e&&e.indexOf("Electron")>=0)}function w(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||be()}var xt=globalThis.self||globalThis.window||globalThis.global,V=globalThis.window||globalThis.self||globalThis.global,Et=globalThis.document||{},G=globalThis.process||{},Ot=globalThis.console,Zt=globalThis.navigator||{};var ie=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",tr=w();function Pt(r){try{let t=window[r],e="__storage_test__";return t.setItem(e,e),t.removeItem(e),t}catch{return null}}var ae=class{constructor(t,e){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=Pt(n),this.id=t,this.config=e,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}}_loadConfiguration(){let t={};if(this.storage){let e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}};function Ue(r){let t;return r<10?t="".concat(r.toFixed(2),"ms"):r<100?t="".concat(r.toFixed(1),"ms"):r<1e3?t="".concat(r.toFixed(0),"ms"):t="".concat((r/1e3).toFixed(2),"s"),t}function Ve(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,e=Math.max(t-r.length,0);return"".concat(" ".repeat(e)).concat(r)}function se(r,t,e){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,o=r.src.replace(/\(/g,"%28").replace(/\)/g,"%29");r.width>n&&(e=Math.min(e,n/r.width));let a=r.width*e,f=r.height*e,d=["font-size:1px;","padding:".concat(Math.floor(f/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(f,"px;"),"background:url(".concat(o,");"),"background-size:".concat(a,"px ").concat(f,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),d]}var ue;(function(r){r[r.BLACK=30]="BLACK",r[r.RED=31]="RED",r[r.GREEN=32]="GREEN",r[r.YELLOW=33]="YELLOW",r[r.BLUE=34]="BLUE",r[r.MAGENTA=35]="MAGENTA",r[r.CYAN=36]="CYAN",r[r.WHITE=37]="WHITE",r[r.BRIGHT_BLACK=90]="BRIGHT_BLACK",r[r.BRIGHT_RED=91]="BRIGHT_RED",r[r.BRIGHT_GREEN=92]="BRIGHT_GREEN",r[r.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",r[r.BRIGHT_BLUE=94]="BRIGHT_BLUE",r[r.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",r[r.BRIGHT_CYAN=96]="BRIGHT_CYAN",r[r.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(ue||(ue={}));var At=10;function ze(r){return typeof r!="string"?r:(r=r.toUpperCase(),ue[r]||ue.WHITE)}function Ye(r,t,e){if(!w&&typeof r=="string"){if(t){let n=ze(t);r="\x1B[".concat(n,"m").concat(r,"\x1B[39m")}if(e){let n=ze(e);r="\x1B[".concat(n+At,"m").concat(r,"\x1B[49m")}}return r}function We(r){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],e=Object.getPrototypeOf(r),n=Object.getOwnPropertyNames(e),o=r;for(let a of n){let f=o[a];typeof f=="function"&&(t.find(d=>a===d)||(o[a]=f.bind(r)))}}function z(r,t){if(!r)throw new Error(t||"Assertion failed")}function M(){let r;if(w()&&V.performance){var t,e;r=V===null||V===void 0||(t=V.performance)===null||t===void 0||(e=t.now)===null||e===void 0?void 0:e.call(t)}else if("hrtime"in G){var n;let o=G===null||G===void 0||(n=G.hrtime)===null||n===void 0?void 0:n.call(G);r=o[0]*1e3+o[1]/1e6}else r=Date.now();return r}var Y={debug:w()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},It={enabled:!0,level:0};function x(){}var Ke={},Xe={once:!0},D=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=ie,this._startTs=M(),this._deltaTs=M(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new ae("__probe-".concat(this.id,"__"),It),this.timeStamp("".concat(this.id," started")),We(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((M()-this._startTs).toPrecision(10))}getDelta(){return Number((M()-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,e){this._storage.setConfiguration({[t]:e})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,e){z(t,e)}warn(t){return this._getLogFunction(0,t,Y.warn,arguments,Xe)}error(t){return this._getLogFunction(0,t,Y.error,arguments)}deprecated(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}removed(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}probe(t,e){return this._getLogFunction(t,e,Y.log,arguments,{time:!0,once:!0})}log(t,e){return this._getLogFunction(t,e,Y.debug,arguments)}info(t,e){return this._getLogFunction(t,e,console.info,arguments)}once(t,e){return this._getLogFunction(t,e,Y.debug||Y.info,arguments,Xe)}table(t,e,n){return e?this._getLogFunction(t,e,console.table||x,n&&[n],{tag:Ct(e)}):x}image(t){let{logLevel:e,priority:n,image:o,message:a="",scale:f=1}=t;return this._shouldLog(e||n)?w()?jt({image:o,message:a,scale:f}):Rt({image:o,message:a,scale:f}):x}time(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}timeEnd(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,e){return this._getLogFunction(t,e,console.timeStamp||x)}group(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},o=qe({logLevel:t,message:e,opts:n}),{collapsed:a}=n;return o.method=(a?console.groupCollapsed:console.group)||console.info,this._getLogFunction(o)}groupCollapsed(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,e,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||x)}withGroup(t,e,n){this.group(t,e)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=Je(t)}_getLogFunction(t,e,n,o,a){if(this._shouldLog(t)){a=qe({logLevel:t,message:e,args:o,opts:a}),n=n||a.method,z(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=M();let f=a.tag||a.message;if(a.once&&f)if(!Ke[f])Ke[f]=M();else return x;return e=kt(this.id,a.message,a),n.bind(console,e,...a.args)}return x}};D.VERSION=ie;function Je(r){if(!r)return 0;let t;switch(typeof r){case"number":t=r;break;case"object":t=r.logLevel||r.priority||0;break;default:return 0}return z(Number.isFinite(t)&&t>=0),t}function qe(r){let{logLevel:t,message:e}=r;r.logLevel=Je(t);let n=r.args?Array.from(r.args):[];for(;n.length&&n.shift()!==e;);switch(typeof t){case"string":case"function":e!==void 0&&n.unshift(e),r.message=t;break;case"object":Object.assign(r,t);break;default:}typeof r.message=="function"&&(r.message=r.message());let o=typeof r.message;return z(o==="string"||o==="object"),Object.assign(r,{args:n},r.opts)}function kt(r,t,e){if(typeof t=="string"){let n=e.time?Ve(Ue(e.total)):"";t=e.time?"".concat(r,": ").concat(n," ").concat(t):"".concat(r,": ").concat(t),t=Ye(t,e.color,e.background)}return t}function Rt(r){let{image:t,message:e="",scale:n=1}=r;return console.warn("removed"),x}function jt(r){let{image:t,message:e="",scale:n=1}=r;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let f=se(a,e,n);console.log(...f)},a.src=t,x}let o=t.nodeName||"";if(o.toLowerCase()==="img")return console.log(...se(t,e,n)),x;if(o.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...se(a,e,n)),a.src=t.toDataURL(),x}return x}function Ct(r){for(let t in r)for(let e in r[t])return e||"untitled";return"empty"}var Or=new D({id:"@probe.gl/log"});var P=new D({id:"luma.gl"});function S(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function A(r){return A=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},A(r)}function _e(r,t){if(A(r)!=="object"||r===null)return r;var e=r[Symbol.toPrimitive];if(e!==void 0){var n=e.call(r,t||"default");if(A(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}function J(r){var t=_e(r,"string");return A(t)==="symbol"?t:String(t)}function Qe(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,J(n.key),n)}}function T(r,t,e){return t&&Qe(r.prototype,t),e&&Qe(r,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function m(r,t,e){return t=J(t),t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function Q(){let r;if(typeof window<"u"&&window.performance)r=window.performance.now();else if(typeof process<"u"&&process.hrtime){let t=process.hrtime();r=t[0]*1e3+t[1]/1e6}else r=Date.now();return r}var F=class{constructor(t,e){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=e,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=Q(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Q()-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 W=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 e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:t,type:e})}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 e of Object.values(this.stats))t(e)}getTable(){let t={};return this.forEach(e=>{t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}}),t}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(e=>this._getOrCreate(e))}_getOrCreate(t){let{name:e,type:n}=t,o=this.stats[e];return o||(t instanceof F?o=t:o=new F(e,n),this.stats[e]=o),o}};var Dt=function(){function r(){S(this,r),m(this,"stats",new Map)}return T(r,[{key:"getStats",value:function(e){return this.get(e)}},{key:"get",value:function(e){return this.stats.has(e)||this.stats.set(e,new W({id:e})),this.stats.get(e)}}]),r}(),K=new Dt;function Nt(){var r=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",t="set luma.log.level=1 (or higher) to trace rendering";if(globalThis.luma&&globalThis.luma.VERSION!==r)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(r));return globalThis.luma||(w()&&P.log(1,"luma.gl ".concat(r," - ").concat(t))(),globalThis.luma=globalThis.luma||{VERSION:r,version:r,log:P,stats:K}),r}var Ze=Nt();function $e(r,t,e,n,o,a,f){try{var d=r[a](f),u=d.value}catch(g){e(g);return}d.done?t(u):Promise.resolve(u).then(n,o)}function we(r){return function(){var t=this,e=arguments;return new Promise(function(n,o){var a=r.apply(t,e);function f(u){$e(a,n,o,f,d,"next",u)}function d(u){$e(a,n,o,f,d,"throw",u)}f(void 0)})}}var ke=St(ot(),1);var Te={};function H(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";Te[r]=Te[r]||1;var t=Te[r]++;return"".concat(r,"-").concat(t)}function Z(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function $(r,t){return $=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},$(r,t)}function xe(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),t&&$(r,t)}function Ee(r,t){if(t&&(A(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Z(r)}function X(r){return X=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},X(r)}function it(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),e.push.apply(e,n)}return e}function Bt(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?it(Object(e),!0).forEach(function(n){m(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):it(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var Oe={id:"undefined",handle:void 0,userData:void 0},Pe=function(){function r(t,e,n){if(S(this,r),m(this,"id",void 0),m(this,"props",void 0),m(this,"userData",{}),m(this,"device",void 0),m(this,"_device",void 0),m(this,"destroyed",!1),m(this,"allocatedBytes",0),m(this,"_attachedResources",new Set),!t)throw new Error("no device");this._device=t,this.props=Gt(e,n);var o=this.props.id!=="undefined"?this.props.id:H(this[Symbol.toStringTag]);this.props.id=o,this.id=o,this.userData=this.props.userData||{},this.addStats()}return T(r,[{key:"destroy",value:function(){this.destroyResource()}},{key:"delete",value:function(){return this.destroy(),this}},{key:"toString",value:function(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")}},{key:"getProps",value:function(){return this.props}},{key:"attachResource",value:function(e){this._attachedResources.add(e)}},{key:"detachResource",value:function(e){this._attachedResources.delete(e)}},{key:"destroyAttachedResource",value:function(e){this._attachedResources.delete(e)&&e.destroy()}},{key:"destroyAttachedResources",value:function(){for(var e=0,n=Object.values(this._attachedResources);e<n.length;e++){var o=n[e];o.destroy()}this._attachedResources=new Set}},{key:"destroyResource",value:function(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0}},{key:"removeStats",value:function(){var e=this._device.statsManager.getStats("Resource Counts"),n=this[Symbol.toStringTag];e.get("".concat(n,"s Active")).decrementCount()}},{key:"trackAllocatedMemory",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag],o=this._device.statsManager.getStats("Resource Counts");o.get("GPU Memory").addCount(e),o.get("".concat(n," Memory")).addCount(e),this.allocatedBytes=e}},{key:"trackDeallocatedMemory",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag],n=this._device.statsManager.getStats("Resource Counts");n.get("GPU Memory").subtractCount(this.allocatedBytes),n.get("".concat(e," Memory")).subtractCount(this.allocatedBytes),this.allocatedBytes=0}},{key:"addStats",value:function(){var e=this._device.statsManager.getStats("Resource Counts"),n=this[Symbol.toStringTag];e.get("Resources Created").incrementCount(),e.get("".concat(n,"s Created")).incrementCount(),e.get("".concat(n,"s Active")).incrementCount()}}]),r}();m(Pe,"defaultProps",Oe);function Gt(r,t){var e=Bt({},t);for(var n in r)r[n]!==void 0&&(e[n]=r[n]);return e}var st;function Mt(r){var t=Ft();return function(){var n=X(r),o;if(t){var a=X(this).constructor;o=Reflect.construct(n,arguments,a)}else o=n.apply(this,arguments);return Ee(this,o)}}function Ft(){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 at(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),e.push.apply(e,n)}return e}function Ae(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?at(Object(e),!0).forEach(function(n){m(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):at(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var Ht=Ae(Ae({},Oe),{},{usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1});st=Symbol.toStringTag;var E=function(r){xe(e,r);var t=Mt(e);function e(n,o){var a;S(this,e);var f=Ae({},o);return(o.usage||0)&e.INDEX&&!o.indexType&&(o.data instanceof Uint32Array?f.indexType="uint32":o.data instanceof Uint16Array&&(f.indexType="uint16")),a=t.call(this,n,f,Ht),m(Z(a),"byteLength",void 0),a}return T(e,[{key:st,get:function(){return"Buffer"}},{key:"write",value:function(o,a){throw new Error("not implemented")}},{key:"readAsync",value:function(o,a){throw new Error("not implemented")}},{key:"getData",value:function(){throw new Error("not implemented")}}]),e}(Pe);m(E,"MAP_READ",1);m(E,"MAP_WRITE",2);m(E,"COPY_SRC",4);m(E,"COPY_DST",8);m(E,"INDEX",16);m(E,"VERTEX",32);m(E,"UNIFORM",64);m(E,"STORAGE",128);m(E,"INDIRECT",256);m(E,"QUERY_RESOLVE",512);var ct;function ut(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),e.push.apply(e,n)}return e}function Ie(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?ut(Object(e),!0).forEach(function(n){m(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):ut(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}var fe={id:null,type:"best-available",canvas:null,container:null,webgl2:!0,webgl1:!0,manageState:!0,width:800,height:600,debug:Boolean(P.get("debug")),break:[],gl:null};ct=Symbol.toStringTag;var le=function(){function r(t){S(this,r),m(this,"id",void 0),m(this,"statsManager",K),m(this,"props",void 0),m(this,"userData",{}),m(this,"info",void 0),m(this,"lost",void 0),m(this,"canvasContext",void 0),this.props=Ie(Ie({},fe),t),this.id=this.props.id||H(this[Symbol.toStringTag].toLowerCase())}return T(r,[{key:ct,get:function(){return"Device"}},{key:"loseDevice",value:function(){return!1}},{key:"createTexture",value:function(e){return(e instanceof Promise||typeof e=="string")&&(e={data:e}),this._createTexture(e)}},{key:"createCommandEncoder",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};throw new Error("not implemented")}},{key:"_getBufferProps",value:function(e){if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return{data:e};var n=Ie({},e);return(e.usage||0)&E.INDEX&&!e.indexType&&(e.data instanceof Uint32Array?n.indexType="uint32":e.data instanceof Uint16Array&&(n.indexType="uint16")),n}}]),r}();m(le,"VERSION",Ze);function ft(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),e.push.apply(e,n)}return e}function lt(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?ft(Object(e),!0).forEach(function(n){m(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):ft(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function Ut(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=Vt(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,o=function(){};return{s:o,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(g){throw g},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
8
8
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,f=!1,d;return{s:function(){e=e.call(r)},n:function(){var g=e.next();return a=g.done,g},e:function(g){f=!0,d=g},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(f)throw d}}}}function Vt(r,t){if(r){if(typeof r=="string")return mt(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return mt(r,t)}}function mt(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var q=new Map,ee=function(){function r(){S(this,r)}return T(r,null,[{key:"registerDevices",value:function(e){var n=Ut(e),o;try{for(n.s();!(o=n.n()).done;){var a=o.value;te(a.type&&a.isSupported&&a.create),q.set(a.type,a)}}catch(f){n.e(f)}finally{n.f()}}},{key:"getAvailableDevices",value:function(){return Array.from(q).map(function(e){return e.type})}},{key:"getSupportedDevices",value:function(){return Array.from(q).filter(function(e){return e.isSupported()}).map(function(e){return e.type})}},{key:"setDefaultDeviceProps",value:function(e){Object.assign(fe,e)}},{key:"createDevice",value:function(){var t=we(ke.default.mark(function n(){var o,a,f=arguments;return ke.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:o=f.length>0&&f[0]!==void 0?f[0]:{},o=lt(lt({},fe),o),o.gl&&(o.type="webgl"),u.t0=o.type,u.next=u.t0==="webgpu"?6:u.t0==="webgl"||u.t0==="webgl1"||u.t0==="webgl2"?12:u.t0==="best-available"?18:24;break;case 6:if(a=q.get("webgpu"),!a){u.next=11;break}return u.next=10,a.create(o);case 10:return u.abrupt("return",u.sent);case 11:return u.abrupt("break",24);case 12:if(a=q.get("webgl"),!a){u.next=17;break}return u.next=16,a.create(o);case 16:return u.abrupt("return",u.sent);case 17:return u.abrupt("break",24);case 18:if(a=q.get("webgl"),!(a&&a.isSupported())){u.next=23;break}return u.next=22,a.create(o);case 22:return u.abrupt("return",u.sent);case 23:return u.abrupt("break",24);case 24:throw new Error("No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.");case 25:case"end":return u.stop()}},n)}));function e(){return t.apply(this,arguments)}return e}()}]),r}();m(ee,"stats",K);m(ee,"log",P);function Re(r){if(Array.isArray(r))return r}function je(r,t){var e=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(e!=null){var n,o,a,f,d=[],u=!0,g=!1;try{if(a=(e=e.call(r)).next,t===0){if(Object(e)!==e)return;u=!1}else for(;!(u=(n=a.call(e)).done)&&(d.push(n.value),d.length!==t);u=!0);}catch(O){g=!0,o=O}finally{try{if(!u&&e.return!=null&&(f=e.return(),Object(f)!==f))return}finally{if(g)throw o}}return d}}function me(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function Ce(r,t){if(r){if(typeof r=="string")return me(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return me(r,t)}}function De(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
9
9
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ne(r,t){return Re(r)||je(r,t)||Ce(r,t)||De()}function te(r,t){if(!r)throw new Error(t||"luma.gl: assertion failed.")}function Le(r,t){var e=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=zt(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,o=function(){};return{s:o,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(g){throw g},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 a=!0,f=!1,d;return{s:function(){e=e.call(r)},n:function(){var g=e.next();return a=g.done,g},e:function(g){f=!0,d=g},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(f)throw d}}}}function zt(r,t){if(r){if(typeof r=="string")return pt(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return pt(r,t)}}function pt(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}var Yt=1,Wt=1,Be=function(){function r(){S(this,r),m(this,"time",0),m(this,"channels",new Map),m(this,"animations",new Map),m(this,"playing",!1),m(this,"lastEngineTime",-1)}return T(r,[{key:"addChannel",value:function(e){var n=e.delay,o=n===void 0?0:n,a=e.duration,f=a===void 0?Number.POSITIVE_INFINITY:a,d=e.rate,u=d===void 0?1:d,g=e.repeat,O=g===void 0?1:g,v=Yt++,R={time:0,delay:o,duration:f,rate:u,repeat:O};return this._setChannelTime(R,this.time),this.channels.set(v,R),v}},{key:"removeChannel",value:function(e){this.channels.delete(e);var n=Le(this.animations),o;try{for(n.s();!(o=n.n()).done;){var a=Ne(o.value,2),f=a[0],d=a[1];d.channel===e&&this.detachAnimation(f)}}catch(u){n.e(u)}finally{n.f()}}},{key:"isFinished",value:function(e){var n=this.channels.get(e);return n===void 0?!1:this.time>=n.delay+n.duration*n.repeat}},{key:"getTime",value:function(e){if(e===void 0)return this.time;var n=this.channels.get(e);return n===void 0?-1:n.time}},{key:"setTime",value:function(e){this.time=Math.max(0,e);var n=this.channels.values(),o=Le(n),a;try{for(o.s();!(a=o.n()).done;){var f=a.value;this._setChannelTime(f,this.time)}}catch(j){o.e(j)}finally{o.f()}var d=this.animations.values(),u=Le(d),g;try{for(u.s();!(g=u.n()).done;){var O=g.value,v=O.animation,R=O.channel;v.setTime(this.getTime(R))}}catch(j){u.e(j)}finally{u.f()}}},{key:"play",value:function(){this.playing=!0}},{key:"pause",value:function(){this.playing=!1,this.lastEngineTime=-1}},{key:"reset",value:function(){this.setTime(0)}},{key:"attachAnimation",value:function(e,n){var o=Wt++;return this.animations.set(o,{animation:e,channel:n}),e.setTime(this.getTime(n)),o}},{key:"detachAnimation",value:function(e){this.animations.delete(e)}},{key:"update",value:function(e){this.playing&&(this.lastEngineTime===-1&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}},{key:"_setChannelTime",value:function(e,n){var o=n-e.delay,a=e.duration*e.repeat;o>=a?e.time=e.duration*e.rate:(e.time=Math.max(0,o)%e.duration,e.time*=e.rate)}}]),r}();return Tt(Kt);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luma.gl/core",
3
- "version": "9.0.0-alpha.25",
3
+ "version": "9.0.0-alpha.27",
4
4
  "description": "WebGL2 Components for High Performance Rendering and Computation",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -40,10 +40,10 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@babel/runtime": "^7.0.0",
43
- "@luma.gl/constants": "9.0.0-alpha.25",
44
- "@luma.gl/engine": "9.0.0-alpha.25",
45
- "@luma.gl/shadertools": "9.0.0-alpha.25",
46
- "@luma.gl/webgl": "9.0.0-alpha.25"
43
+ "@luma.gl/constants": "9.0.0-alpha.27",
44
+ "@luma.gl/engine": "9.0.0-alpha.27",
45
+ "@luma.gl/shadertools": "9.0.0-alpha.27",
46
+ "@luma.gl/webgl": "9.0.0-alpha.27"
47
47
  },
48
- "gitHead": "a91e00399e59c1b5310bdfd842648238c5abf908"
48
+ "gitHead": "4052244031cb80c27fa0e3fd4c3d5514daa08b78"
49
49
  }