@luma.gl/core 9.0.0-alpha.21 → 9.0.0-alpha.24
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 +87 -28
- package/dist.min.js +4 -4
- package/package.json +6 -6
package/dist/dist.dev.js
CHANGED
|
@@ -862,14 +862,17 @@ var __exports__ = (() => {
|
|
|
862
862
|
var DEFAULT_RESOURCE_PROPS = {
|
|
863
863
|
id: "undefined",
|
|
864
864
|
handle: void 0,
|
|
865
|
-
userData:
|
|
865
|
+
userData: void 0
|
|
866
866
|
};
|
|
867
867
|
var Resource = class {
|
|
868
868
|
/** props.id, for debugging. */
|
|
869
869
|
userData = {};
|
|
870
|
+
/** Whether this resource has been destroyed */
|
|
870
871
|
destroyed = false;
|
|
871
872
|
/** For resources that allocate GPU memory */
|
|
872
873
|
allocatedBytes = 0;
|
|
874
|
+
/** Attached resources will be destroyed when this resource is destroyed. Tracks auto-created "sub" resources. */
|
|
875
|
+
_attachedResources = /* @__PURE__ */ new Set();
|
|
873
876
|
/**
|
|
874
877
|
* Create a new Resource. Called from Subclass
|
|
875
878
|
*/
|
|
@@ -889,7 +892,7 @@ var __exports__ = (() => {
|
|
|
889
892
|
* destroy can be called on any resource to release it before it is garbage collected.
|
|
890
893
|
*/
|
|
891
894
|
destroy() {
|
|
892
|
-
this.
|
|
895
|
+
this.destroyResource();
|
|
893
896
|
}
|
|
894
897
|
/** @deprecated Use destroy() */
|
|
895
898
|
delete() {
|
|
@@ -906,14 +909,41 @@ var __exports__ = (() => {
|
|
|
906
909
|
getProps() {
|
|
907
910
|
return this.props;
|
|
908
911
|
}
|
|
912
|
+
// ATTACHED RESOURCES
|
|
913
|
+
/**
|
|
914
|
+
* Attaches a resource. Attached resources are auto destroyed when this resource is destroyed
|
|
915
|
+
* Called automatically when sub resources are auto created but can be called by application
|
|
916
|
+
*/
|
|
917
|
+
attachResource(resource) {
|
|
918
|
+
this._attachedResources.add(resource);
|
|
919
|
+
}
|
|
920
|
+
/**
|
|
921
|
+
* Detach an attached resource. The resource will no longer be auto-destroyed when this resource is destroyed.
|
|
922
|
+
*/
|
|
923
|
+
detachResource(resource) {
|
|
924
|
+
this._attachedResources.delete(resource);
|
|
925
|
+
}
|
|
926
|
+
/**
|
|
927
|
+
* Destroys a resource (only if owned), and removes from the owned (auto-destroy) list for this resource.
|
|
928
|
+
*/
|
|
929
|
+
destroyAttachedResource(resource) {
|
|
930
|
+
if (this._attachedResources.delete(resource)) {
|
|
931
|
+
resource.destroy();
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
/** Destroy all owned resources. Make sure the resources are no longer needed before calling. */
|
|
935
|
+
destroyAttachedResources() {
|
|
936
|
+
for (const resource of Object.values(this._attachedResources)) {
|
|
937
|
+
resource.destroy();
|
|
938
|
+
}
|
|
939
|
+
this._attachedResources = /* @__PURE__ */ new Set();
|
|
940
|
+
}
|
|
909
941
|
// PROTECTED METHODS
|
|
910
|
-
/**
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
stats.get(`${name}s Created`).incrementCount();
|
|
916
|
-
stats.get(`${name}s Active`).incrementCount();
|
|
942
|
+
/** Perform all destroy steps. Can be called by derived resources when overriding destroy() */
|
|
943
|
+
destroyResource() {
|
|
944
|
+
this.destroyAttachedResources();
|
|
945
|
+
this.removeStats();
|
|
946
|
+
this.destroyed = true;
|
|
917
947
|
}
|
|
918
948
|
/** Called by .destroy() to track object destruction. Subclass must call if overriding destroy() */
|
|
919
949
|
removeStats() {
|
|
@@ -935,7 +965,17 @@ var __exports__ = (() => {
|
|
|
935
965
|
stats.get(`${name} Memory`).subtractCount(this.allocatedBytes);
|
|
936
966
|
this.allocatedBytes = 0;
|
|
937
967
|
}
|
|
968
|
+
/** Called by resource constructor to track object creation */
|
|
969
|
+
addStats() {
|
|
970
|
+
const stats = this._device.statsManager.getStats("Resource Counts");
|
|
971
|
+
const name = this[Symbol.toStringTag];
|
|
972
|
+
stats.get("Resources Created").incrementCount();
|
|
973
|
+
stats.get(`${name}s Created`).incrementCount();
|
|
974
|
+
stats.get(`${name}s Active`).incrementCount();
|
|
975
|
+
}
|
|
938
976
|
};
|
|
977
|
+
/** Default properties for resource */
|
|
978
|
+
__publicField(Resource, "defaultProps", DEFAULT_RESOURCE_PROPS);
|
|
939
979
|
function selectivelyMerge(props, defaultProps) {
|
|
940
980
|
const mergedProps = {
|
|
941
981
|
...defaultProps
|
|
@@ -963,6 +1003,7 @@ var __exports__ = (() => {
|
|
|
963
1003
|
get [Symbol.toStringTag]() {
|
|
964
1004
|
return "Buffer";
|
|
965
1005
|
}
|
|
1006
|
+
/** Length of buffer in bytes */
|
|
966
1007
|
constructor(device, props) {
|
|
967
1008
|
const deducedProps = {
|
|
968
1009
|
...props
|
|
@@ -1083,34 +1124,30 @@ var __exports__ = (() => {
|
|
|
1083
1124
|
}
|
|
1084
1125
|
statsManager = lumaStats;
|
|
1085
1126
|
userData = {};
|
|
1127
|
+
// Capabilities
|
|
1086
1128
|
/** Information about the device (vendor, versions etc) */
|
|
1087
1129
|
/** Optional capability discovery */
|
|
1088
1130
|
/** WebGPU style device limits */
|
|
1089
1131
|
/** Check if device supports a specific texture format (creation and `nearest` sampling) */
|
|
1090
1132
|
/** Check if linear filtering (sampler interpolation) is supported for a specific texture format */
|
|
1091
1133
|
/** Check if device supports rendering to a specific texture format */
|
|
1092
|
-
|
|
1093
|
-
/**
|
|
1094
|
-
/**
|
|
1134
|
+
// Device loss
|
|
1135
|
+
/** `true` if device is already lost */
|
|
1136
|
+
/** Promise that resolves when device is lost */
|
|
1137
|
+
/**
|
|
1138
|
+
* Trigger device loss.
|
|
1139
|
+
* @returns `true` if context loss could actually be triggered.
|
|
1140
|
+
* @note primarily intended for testing how application reacts to device loss
|
|
1141
|
+
*/
|
|
1142
|
+
loseDevice() {
|
|
1143
|
+
return false;
|
|
1144
|
+
}
|
|
1145
|
+
// Canvas context
|
|
1146
|
+
/** Default / primary canvas context. Can be null as WebGPU devices can be created without a CanvasContext */
|
|
1095
1147
|
/** Creates a new CanvasContext (WebGPU only) */
|
|
1096
1148
|
/** Call after rendering a frame (necessary e.g. on WebGL OffscreenCanvas) */
|
|
1097
1149
|
// Resource creation
|
|
1098
1150
|
/** Create a buffer */
|
|
1099
|
-
createBuffer(props) {
|
|
1100
|
-
if (props instanceof ArrayBuffer || ArrayBuffer.isView(props)) {
|
|
1101
|
-
return this._createBuffer({
|
|
1102
|
-
data: props
|
|
1103
|
-
});
|
|
1104
|
-
}
|
|
1105
|
-
if ((props.usage || 0) & Buffer2.INDEX && !props.indexType) {
|
|
1106
|
-
if (props.data instanceof Uint32Array) {
|
|
1107
|
-
props.indexType = "uint32";
|
|
1108
|
-
} else if (props.data instanceof Uint16Array) {
|
|
1109
|
-
props.indexType = "uint16";
|
|
1110
|
-
}
|
|
1111
|
-
}
|
|
1112
|
-
return this._createBuffer(props);
|
|
1113
|
-
}
|
|
1114
1151
|
/** Create a texture */
|
|
1115
1152
|
createTexture(props) {
|
|
1116
1153
|
if (props instanceof Promise || typeof props === "string") {
|
|
@@ -1125,9 +1162,31 @@ var __exports__ = (() => {
|
|
|
1125
1162
|
/** Create a shader */
|
|
1126
1163
|
/** Create a render pipeline (aka program) */
|
|
1127
1164
|
/** Create a compute pipeline (aka program) */
|
|
1165
|
+
createCommandEncoder(props = {}) {
|
|
1166
|
+
throw new Error("not implemented");
|
|
1167
|
+
}
|
|
1128
1168
|
/** Create a RenderPass */
|
|
1129
1169
|
/** Create a ComputePass */
|
|
1130
|
-
|
|
1170
|
+
/** Get a renderpass that is set up to render to the primary CanvasContext */
|
|
1171
|
+
// Resource creation helpers
|
|
1172
|
+
_getBufferProps(props) {
|
|
1173
|
+
if (props instanceof ArrayBuffer || ArrayBuffer.isView(props)) {
|
|
1174
|
+
return {
|
|
1175
|
+
data: props
|
|
1176
|
+
};
|
|
1177
|
+
}
|
|
1178
|
+
const newProps = {
|
|
1179
|
+
...props
|
|
1180
|
+
};
|
|
1181
|
+
if ((props.usage || 0) & Buffer2.INDEX && !props.indexType) {
|
|
1182
|
+
if (props.data instanceof Uint32Array) {
|
|
1183
|
+
props.indexType = "uint32";
|
|
1184
|
+
} else if (props.data instanceof Uint16Array) {
|
|
1185
|
+
props.indexType = "uint16";
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
return newProps;
|
|
1189
|
+
}
|
|
1131
1190
|
};
|
|
1132
1191
|
__publicField(Device, "VERSION", VERSION2);
|
|
1133
1192
|
|
package/dist.min.js
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
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 ge=Object.create;var nt=Object.defineProperty;var ye=Object.getOwnPropertyDescriptor;var ve=Object.getOwnPropertyNames;var be=Object.getPrototypeOf,_e=Object.prototype.hasOwnProperty;var yt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),we=(t,e)=>{for(var r in e)nt(t,r,{get:e[r],enumerable:!0})},Gt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ve(e))!_e.call(t,o)&&o!==r&&nt(t,o,{get:()=>e[o],enumerable:!(n=ye(e,o))||n.enumerable});return t};var Se=(t,e,r)=>(r=t!=null?ge(be(t)):{},Gt(e||!t||!t.__esModule?nt(r,"default",{value:t,enumerable:!0}):r,t)),Te=t=>Gt(nt({},"__esModule",{value:!0}),t);var Qt=yt((mn,I)=>{function wt(t){return I.exports=wt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I.exports.__esModule=!0,I.exports.default=I.exports,wt(t)}I.exports=wt,I.exports.__esModule=!0,I.exports.default=I.exports});var Zt=yt((pn,j)=>{var Le=Qt().default;function $t(){"use strict";j.exports=$t=function(){return t},j.exports.__esModule=!0,j.exports.default=j.exports;var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(c,i,s){c[i]=s.value},o=typeof Symbol=="function"?Symbol:{},a=o.iterator||"@@iterator",p=o.asyncIterator||"@@asyncIterator",d=o.toStringTag||"@@toStringTag";function f(c,i,s){return Object.defineProperty(c,i,{value:s,enumerable:!0,configurable:!0,writable:!0}),c[i]}try{f({},"")}catch{f=function(s,l,h){return s[l]=h}}function g(c,i,s,l){var h=i&&i.prototype instanceof k?i:k,m=Object.create(h.prototype),y=new dt(l||[]);return n(m,"_invoke",{value:he(c,s,y)}),m}function O(c,i,s){try{return{type:"normal",arg:c.call(i,s)}}catch(l){return{type:"throw",arg:l}}}t.wrap=g;var v={};function k(){}function C(){}function N(){}var mt={};f(mt,a,function(){return this});var pt=Object.getPrototypeOf,et=pt&&pt(pt(gt([])));et&&et!==e&&r.call(et,a)&&(mt=et);var U=N.prototype=k.prototype=Object.create(mt);function Nt(c){["next","throw","return"].forEach(function(i){f(c,i,function(s){return this._invoke(i,s)})})}function rt(c,i){function s(h,m,y,b){var _=O(c[h],c,m);if(_.type!=="throw"){var L=_.arg,R=L.value;return R&&Le(R)=="object"&&r.call(R,"__await")?i.resolve(R.__await).then(function(B){s("next",B,y,b)},function(B){s("throw",B,y,b)}):i.resolve(R).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(m,y){function b(){return new i(function(_,L){s(m,y,_,L)})}return l=l?l.then(b,b):b()}})}function he(c,i,s){var l="suspendedStart";return function(h,m){if(l==="executing")throw new Error("Generator is already running");if(l==="completed"){if(h==="throw")throw m;return Bt()}for(s.method=h,s.arg=m;;){var y=s.delegate;if(y){var b=Lt(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 Lt(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,Lt(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 m=h.arg;return m?m.done?(i[c.resultName]=m.value,i.next=c.nextLoc,i.method!=="return"&&(i.method="next",i.arg=void 0),i.delegate=null,v):m:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,v)}function de(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 ht(c){var i=c.completion||{};i.type="normal",delete i.arg,c.completion=i}function dt(c){this.tryEntries=[{tryLoc:"root"}],c.forEach(de,this),this.reset(!0)}function gt(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(r.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:Bt}}function Bt(){return{value:void 0,done:!0}}return C.prototype=N,n(U,"constructor",{value:N,configurable:!0}),n(N,"constructor",{value:C,configurable:!0}),C.displayName=f(N,d,"GeneratorFunction"),t.isGeneratorFunction=function(c){var i=typeof c=="function"&&c.constructor;return!!i&&(i===C||(i.displayName||i.name)==="GeneratorFunction")},t.mark=function(c){return Object.setPrototypeOf?Object.setPrototypeOf(c,N):(c.__proto__=N,f(c,d,"GeneratorFunction")),c.prototype=Object.create(U),c},t.awrap=function(c){return{__await:c}},Nt(rt.prototype),f(rt.prototype,p,function(){return this}),t.AsyncIterator=rt,t.async=function(c,i,s,l,h){h===void 0&&(h=Promise);var m=new rt(g(c,i,s,l),h);return t.isGeneratorFunction(i)?m:m.next().then(function(y){return y.done?y.value:m.next()})},Nt(U),f(U,d,"Generator"),f(U,a,function(){return this}),f(U,"toString",function(){return"[object Generator]"}),t.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 m=s.pop();if(m in i)return h.value=m,h.done=!1,h}return h.done=!0,h}},t.values=gt,dt.prototype={constructor:dt,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(ht),!i)for(var s in this)s.charAt(0)==="t"&&r.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,R){return y.type="throw",y.arg=i,s.next=L,R&&(s.method="next",s.arg=void 0),!!R}for(var h=this.tryEntries.length-1;h>=0;--h){var m=this.tryEntries[h],y=m.completion;if(m.tryLoc==="root")return l("end");if(m.tryLoc<=this.prev){var b=r.call(m,"catchLoc"),_=r.call(m,"finallyLoc");if(b&&_){if(this.prev<m.catchLoc)return l(m.catchLoc,!0);if(this.prev<m.finallyLoc)return l(m.finallyLoc)}else if(b){if(this.prev<m.catchLoc)return l(m.catchLoc,!0)}else{if(!_)throw new Error("try statement without catch or finally");if(this.prev<m.finallyLoc)return l(m.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&&r.call(h,"finallyLoc")&&this.prev<h.finallyLoc){var m=h;break}}m&&(i==="break"||i==="continue")&&m.tryLoc<=s&&s<=m.finallyLoc&&(m=null);var y=m?m.completion:{};return y.type=i,y.arg=s,m?(this.method="next",this.next=m.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),ht(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 m=h.arg;ht(l)}return m}}throw new Error("illegal catch attempt")},delegateYield:function(i,s,l){return this.delegate={iterator:gt(i),resultName:s,nextLoc:l},this.method==="next"&&(this.arg=void 0),v}},t}j.exports=$t,j.exports.__esModule=!0,j.exports.default=j.exports});var ee=yt((hn,te)=>{var ut=Zt()();te.exports=ut;try{regeneratorRuntime=ut}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=ut:Function("r","regeneratorRuntime = r")(ut)}});var Ke={};we(Ke,{Device:()=>ct,Timeline:()=>Dt,assert:()=>tt,log:()=>A,luma:()=>Z,uid:()=>H});function vt(t){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 e=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=t||e;return!!(r&&r.indexOf("Electron")>=0)}function w(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||vt()}var xe=globalThis.self||globalThis.window||globalThis.global,V=globalThis.window||globalThis.self||globalThis.global,Ee=globalThis.document||{},G=globalThis.process||{},Oe=globalThis.console,$e=globalThis.navigator||{};var ot=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",er=w();function P(t){return P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P(t)}function bt(t,e){if(P(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(P(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function J(t){var e=bt(t,"string");return P(e)==="symbol"?e:String(e)}function u(t,e,r){return e=J(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Pe(t){try{let e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch{return null}}var it=class{constructor(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";u(this,"storage",void 0),u(this,"id",void 0),u(this,"config",void 0),this.storage=Pe(n),this.id=e,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let e={};if(this.storage){let r=this.storage.getItem(this.id);e=r?JSON.parse(r):{}}return Object.assign(this.config,e),this}};function Mt(t){let e;return t<10?e="".concat(t.toFixed(2),"ms"):t<100?e="".concat(t.toFixed(1),"ms"):t<1e3?e="".concat(t.toFixed(0),"ms"):e="".concat((t/1e3).toFixed(2),"s"),e}function Ft(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(e-t.length,0);return"".concat(" ".repeat(r)).concat(t)}function at(t,e,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,o=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(r=Math.min(r,n/t.width));let a=t.width*r,p=t.height*r,d=["font-size:1px;","padding:".concat(Math.floor(p/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(p,"px;"),"background:url(".concat(o,");"),"background-size:".concat(a,"px ").concat(p,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),d]}var st;(function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(st||(st={}));var Ae=10;function Ht(t){return typeof t!="string"?t:(t=t.toUpperCase(),st[t]||st.WHITE)}function Ut(t,e,r){if(!w&&typeof t=="string"){if(e){let n=Ht(e);t="\x1B[".concat(n,"m").concat(t,"\x1B[39m")}if(r){let n=Ht(r);t="\x1B[".concat(n+Ae,"m").concat(t,"\x1B[49m")}}return t}function Vt(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(t),n=Object.getOwnPropertyNames(r),o=t;for(let a of n){let p=o[a];typeof p=="function"&&(e.find(d=>a===d)||(o[a]=p.bind(t)))}}function z(t,e){if(!t)throw new Error(e||"Assertion failed")}function M(){let t;if(w()&&V.performance){var e,r;t=V===null||V===void 0||(e=V.performance)===null||e===void 0||(r=e.now)===null||r===void 0?void 0:r.call(e)}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);t=o[0]*1e3+o[1]/1e6}else t=Date.now();return t}var Y={debug:w()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Ie={enabled:!0,level:0};function x(){}var zt={},Yt={once:!0},D=class{constructor(){let{id:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};u(this,"id",void 0),u(this,"VERSION",ot),u(this,"_startTs",M()),u(this,"_deltaTs",M()),u(this,"_storage",void 0),u(this,"userData",{}),u(this,"LOG_THROTTLE_TIMEOUT",0),this.id=e,this.userData={},this._storage=new it("__probe-".concat(this.id,"__"),Ie),this.timeStamp("".concat(this.id," started")),Vt(this),Object.seal(this)}set level(e){this.setLevel(e)}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(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,r){this._storage.setConfiguration({[e]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,r){z(e,r)}warn(e){return this._getLogFunction(0,e,Y.warn,arguments,Yt)}error(e){return this._getLogFunction(0,e,Y.error,arguments)}deprecated(e,r){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(e,r){return this.error("`".concat(e,"` has been removed. Use `").concat(r,"` instead"))}probe(e,r){return this._getLogFunction(e,r,Y.log,arguments,{time:!0,once:!0})}log(e,r){return this._getLogFunction(e,r,Y.debug,arguments)}info(e,r){return this._getLogFunction(e,r,console.info,arguments)}once(e,r){return this._getLogFunction(e,r,Y.debug||Y.info,arguments,Yt)}table(e,r,n){return r?this._getLogFunction(e,r,console.table||x,n&&[n],{tag:Re(r)}):x}image(e){let{logLevel:r,priority:n,image:o,message:a="",scale:p=1}=e;return this._shouldLog(r||n)?w()?Ce({image:o,message:a,scale:p}):ke({image:o,message:a,scale:p}):x}time(e,r){return this._getLogFunction(e,r,console.time?console.time:console.info)}timeEnd(e,r){return this._getLogFunction(e,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,r){return this._getLogFunction(e,r,console.timeStamp||x)}group(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},o=Wt({logLevel:e,message:r,opts:n}),{collapsed:a}=n;return o.method=(a?console.groupCollapsed:console.group)||console.info,this._getLogFunction(o)}groupCollapsed(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(e,r,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||x)}withGroup(e,r,n){this.group(e,r)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=Kt(e)}_getLogFunction(e,r,n,o,a){if(this._shouldLog(e)){a=Wt({logLevel:e,message:r,args:o,opts:a}),n=n||a.method,z(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=M();let p=a.tag||a.message;if(a.once&&p)if(!zt[p])zt[p]=M();else return x;return r=je(this.id,a.message,a),n.bind(console,r,...a.args)}return x}};u(D,"VERSION",ot);function Kt(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return z(Number.isFinite(e)&&e>=0),e}function Wt(t){let{logLevel:e,message:r}=t;t.logLevel=Kt(e);let n=t.args?Array.from(t.args):[];for(;n.length&&n.shift()!==r;);switch(typeof e){case"string":case"function":r!==void 0&&n.unshift(r),t.message=e;break;case"object":Object.assign(t,e);break;default:}typeof t.message=="function"&&(t.message=t.message());let o=typeof t.message;return z(o==="string"||o==="object"),Object.assign(t,{args:n},t.opts)}function je(t,e,r){if(typeof e=="string"){let n=r.time?Ft(Mt(r.total)):"";e=r.time?"".concat(t,": ").concat(n," ").concat(e):"".concat(t,": ").concat(e),e=Ut(e,r.color,r.background)}return e}function ke(t){let{image:e,message:r="",scale:n=1}=t;return console.warn("removed"),x}function Ce(t){let{image:e,message:r="",scale:n=1}=t;if(typeof e=="string"){let a=new Image;return a.onload=()=>{let p=at(a,r,n);console.log(...p)},a.src=e,x}let o=e.nodeName||"";if(o.toLowerCase()==="img")return console.log(...at(e,r,n)),x;if(o.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...at(a,r,n)),a.src=e.toDataURL(),x}return x}function Re(t){for(let e in t)for(let r in t[e])return r||"untitled";return"empty"}var Lr=new D({id:"@probe.gl/log"});var A=new D({id:"luma.gl"});function S(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,J(n.key),n)}}function T(t,e,r){return e&&Xt(t.prototype,e),r&&Xt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Q(){let t;if(typeof window<"u"&&window.performance)t=window.performance.now();else if(typeof process<"u"&&process.hrtime){let e=process.hrtime();t=e[0]*1e3+e[1]/1e6}else t=Date.now();return t}var F=class{constructor(e,r){u(this,"name",void 0),u(this,"type",void 0),u(this,"sampleSize",1),u(this,"time",0),u(this,"count",0),u(this,"samples",0),u(this,"lastTiming",0),u(this,"lastSampleTime",0),u(this,"lastSampleCount",0),u(this,"_count",0),u(this,"_time",0),u(this,"_samples",0),u(this,"_startTime",0),u(this,"_timerPending",!1),this.name=e,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(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,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(e){u(this,"id",void 0),u(this,"stats",{}),this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:e,type:r})}get size(){return Object.keys(this.stats).length}reset(){for(let e of Object.values(this.stats))e.reset();return this}forEach(e){for(let r of Object.values(this.stats))e(r)}getTable(){let e={};return this.forEach(r=>{e[r.name]={time:r.time||0,count:r.count||0,average:r.getAverageTime()||0,hz:r.getHz()||0}}),e}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(r=>this._getOrCreate(r))}_getOrCreate(e){let{name:r,type:n}=e,o=this.stats[r];return o||(e instanceof F?o=e:o=new F(r,n),this.stats[r]=o),o}};var De=function(){function t(){S(this,t),u(this,"stats",new Map)}return T(t,[{key:"getStats",value:function(r){return this.get(r)}},{key:"get",value:function(r){return this.stats.has(r)||this.stats.set(r,new W({id:r})),this.stats.get(r)}}]),t}(),K=new De;function Ne(){var t=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",e="set luma.log.level=1 (or higher) to trace rendering";if(globalThis.luma&&globalThis.luma.VERSION!==t)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(t));return globalThis.luma||(w()&&A.log(1,"luma.gl ".concat(t," - ").concat(e))(),globalThis.luma=globalThis.luma||{VERSION:t,version:t,log:A,stats:K}),t}var qt=Ne();function Jt(t,e,r,n,o,a,p){try{var d=t[a](p),f=d.value}catch(g){r(g);return}d.done?e(f):Promise.resolve(f).then(n,o)}function _t(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function p(f){Jt(a,n,o,p,d,"next",f)}function d(f){Jt(a,n,o,p,d,"throw",f)}p(void 0)})}}var Pt=Se(ee(),1);var St={};function H(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";St[t]=St[t]||1;var e=St[t]++;return"".concat(t,"-").concat(e)}function $(t,e){return $=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},$(t,e)}function Tt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$(t,e)}function xt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Et(t,e){if(e&&(P(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xt(t)}function X(t){return X=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},X(t)}function re(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function Be(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?re(Object(r),!0).forEach(function(n){u(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):re(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var ne={id:"undefined",handle:void 0,userData:{}},oe=function(){function t(e,r,n){if(S(this,t),u(this,"id",void 0),u(this,"props",void 0),u(this,"userData",{}),u(this,"device",void 0),u(this,"_device",void 0),u(this,"destroyed",!1),u(this,"allocatedBytes",0),!e)throw new Error("no device");this._device=e,this.props=Ge(r,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(t,[{key:"destroy",value:function(){this.removeStats()}},{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:"addStats",value:function(){var r=this._device.statsManager.getStats("Resource Counts"),n=this[Symbol.toStringTag];r.get("Resources Created").incrementCount(),r.get("".concat(n,"s Created")).incrementCount(),r.get("".concat(n,"s Active")).incrementCount()}},{key:"removeStats",value:function(){var r=this._device.statsManager.getStats("Resource Counts"),n=this[Symbol.toStringTag];r.get("".concat(n,"s Active")).decrementCount()}},{key:"trackAllocatedMemory",value:function(r){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(r),o.get("".concat(n," Memory")).addCount(r),this.allocatedBytes=r}},{key:"trackDeallocatedMemory",value:function(){var r=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(r," Memory")).subtractCount(this.allocatedBytes),this.allocatedBytes=0}}]),t}();function Ge(t,e){var r=Be({},e);for(var n in t)t[n]!==void 0&&(r[n]=t[n]);return r}var ae;function Me(t){var e=Fe();return function(){var n=X(t),o;if(e){var a=X(this).constructor;o=Reflect.construct(n,arguments,a)}else o=n.apply(this,arguments);return Et(this,o)}}function Fe(){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 ie(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function Ot(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ie(Object(r),!0).forEach(function(n){u(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ie(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var He=Ot(Ot({},ne),{},{usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1});ae=Symbol.toStringTag;var E=function(t){Tt(r,t);var e=Me(r);function r(n,o){S(this,r);var a=Ot({},o);return(o.usage||0)&r.INDEX&&!o.indexType&&(o.data instanceof Uint32Array?a.indexType="uint32":o.data instanceof Uint16Array&&(a.indexType="uint16")),e.call(this,n,a,He)}return T(r,[{key:ae,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")}}]),r}(oe);u(E,"MAP_READ",1);u(E,"MAP_WRITE",2);u(E,"COPY_SRC",4);u(E,"COPY_DST",8);u(E,"INDEX",16);u(E,"VERTEX",32);u(E,"UNIFORM",64);u(E,"STORAGE",128);u(E,"INDIRECT",256);u(E,"QUERY_RESOLVE",512);var fe;function se(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function ue(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?se(Object(r),!0).forEach(function(n){u(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):se(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var ft={id:null,type:"best-available",canvas:null,container:null,webgl2:!0,webgl1:!0,manageState:!0,width:800,height:600,debug:Boolean(A.get("debug")),break:[],gl:null};fe=Symbol.toStringTag;var ct=function(){function t(e){S(this,t),u(this,"id",void 0),u(this,"statsManager",K),u(this,"props",void 0),u(this,"userData",{}),u(this,"info",void 0),u(this,"lost",void 0),u(this,"canvasContext",void 0),this.props=ue(ue({},ft),e),this.id=this.props.id||H(this[Symbol.toStringTag].toLowerCase())}return T(t,[{key:fe,get:function(){return"Device"}},{key:"createBuffer",value:function(r){return r instanceof ArrayBuffer||ArrayBuffer.isView(r)?this._createBuffer({data:r}):((r.usage||0)&E.INDEX&&!r.indexType&&(r.data instanceof Uint32Array?r.indexType="uint32":r.data instanceof Uint16Array&&(r.indexType="uint16")),this._createBuffer(r))}},{key:"createTexture",value:function(r){return(r instanceof Promise||typeof r=="string")&&(r={data:r}),this._createTexture(r)}}]),t}();u(ct,"VERSION",qt);function ce(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function le(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ce(Object(r),!0).forEach(function(n){u(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ce(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ue(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Ve(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(g){throw g},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
8
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,
|
|
9
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
10
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,
|
|
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((mn,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((pn,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(f,i,s){f[i]=s.value},o=typeof Symbol=="function"?Symbol:{},a=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",d=o.toStringTag||"@@toStringTag";function c(f,i,s){return Object.defineProperty(f,i,{value:s,enumerable:!0,configurable:!0,writable:!0}),f[i]}try{c({},"")}catch{c=function(s,m,h){return s[m]=h}}function g(f,i,s,m){var h=i&&i.prototype instanceof R?i:R,p=Object.create(h.prototype),y=new ge(m||[]);return n(p,"_invoke",{value:ht(f,s,y)}),p}function P(f,i,s){try{return{type:"normal",arg:f.call(i,s)}}catch(m){return{type:"throw",arg:m}}}r.wrap=g;var v={};function R(){}function j(){}function N(){}var pe={};c(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(f){["next","throw","return"].forEach(function(i){c(f,i,function(s){return this._invoke(i,s)})})}function ne(f,i){function s(h,p,y,b){var _=P(f[h],f,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 m;n(this,"_invoke",{value:function(p,y){function b(){return new i(function(_,L){s(p,y,_,L)})}return m=m?m.then(b,b):b()}})}function ht(f,i,s){var m="suspendedStart";return function(h,p){if(m==="executing")throw new Error("Generator is already running");if(m==="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(m==="suspendedStart")throw m="completed",s.arg;s.dispatchException(s.arg)}else s.method==="return"&&s.abrupt("return",s.arg);m="executing";var _=P(f,i,s);if(_.type==="normal"){if(m=s.done?"completed":"suspendedYield",_.arg===v)continue;return{value:_.arg,done:s.done}}_.type==="throw"&&(m="completed",s.method="throw",s.arg=_.arg)}}}function Me(f,i){var s=i.method,m=f.iterator[s];if(m===void 0)return i.delegate=null,s==="throw"&&f.iterator.return&&(i.method="return",i.arg=void 0,Me(f,i),i.method==="throw")||s!=="return"&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+s+"' method")),v;var h=P(m,f.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[f.resultName]=p.value,i.next=f.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(f){var i={tryLoc:f[0]};1 in f&&(i.catchLoc=f[1]),2 in f&&(i.finallyLoc=f[2],i.afterLoc=f[3]),this.tryEntries.push(i)}function de(f){var i=f.completion||{};i.type="normal",delete i.arg,f.completion=i}function ge(f){this.tryEntries=[{tryLoc:"root"}],f.forEach(dt,this),this.reset(!0)}function ye(f){if(f){var i=f[a];if(i)return i.call(f);if(typeof f.next=="function")return f;if(!isNaN(f.length)){var s=-1,m=function h(){for(;++s<f.length;)if(e.call(f,s))return h.value=f[s],h.done=!1,h;return h.value=void 0,h.done=!0,h};return m.next=m}}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=c(N,d,"GeneratorFunction"),r.isGeneratorFunction=function(f){var i=typeof f=="function"&&f.constructor;return!!i&&(i===j||(i.displayName||i.name)==="GeneratorFunction")},r.mark=function(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,N):(f.__proto__=N,c(f,d,"GeneratorFunction")),f.prototype=Object.create(U),f},r.awrap=function(f){return{__await:f}},Ge(ne.prototype),c(ne.prototype,l,function(){return this}),r.AsyncIterator=ne,r.async=function(f,i,s,m,h){h===void 0&&(h=Promise);var p=new ne(g(f,i,s,m),h);return r.isGeneratorFunction(i)?p:p.next().then(function(y){return y.done?y.value:p.next()})},Ge(U),c(U,d,"Generator"),c(U,a,function(){return this}),c(U,"toString",function(){return"[object Generator]"}),r.keys=function(f){var i=Object(f),s=[];for(var m in i)s.push(m);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 m(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 m("end");if(p.tryLoc<=this.prev){var b=e.call(p,"catchLoc"),_=e.call(p,"finallyLoc");if(b&&_){if(this.prev<p.catchLoc)return m(p.catchLoc,!0);if(this.prev<p.finallyLoc)return m(p.finallyLoc)}else if(b){if(this.prev<p.catchLoc)return m(p.catchLoc,!0)}else{if(!_)throw new Error("try statement without catch or finally");if(this.prev<p.finallyLoc)return m(p.finallyLoc)}}}},abrupt:function(i,s){for(var m=this.tryEntries.length-1;m>=0;--m){var h=this.tryEntries[m];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 m=this.tryEntries[s];if(m.finallyLoc===i)return this.complete(m.completion,m.afterLoc),de(m),v}},catch:function(i){for(var s=this.tryEntries.length-1;s>=0;--s){var m=this.tryEntries[s];if(m.tryLoc===i){var h=m.completion;if(h.type==="throw"){var p=h.arg;de(m)}return p}}throw new Error("illegal catch attempt")},delegateYield:function(i,s,m){return this.delegate={iterator:ye(i),resultName:s,nextLoc:m},this.method==="next"&&(this.arg=void 0),v}},r}k.exports=tt,k.exports.__esModule=!0,k.exports.default=k.exports});var ot=ve((hn,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:()=>A,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||{},Pt=globalThis.console,Zt=globalThis.navigator||{};var ie=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",tr=w();function O(r){return O=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},O(r)}function _e(r,t){if(O(r)!=="object"||r===null)return r;var e=r[Symbol.toPrimitive];if(e!==void 0){var n=e.call(r,t||"default");if(O(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 O(t)==="symbol"?t:String(t)}function u(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 Ot(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";u(this,"storage",void 0),u(this,"id",void 0),u(this,"config",void 0),this.storage=Ot(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,l=r.height*e,d=["font-size:1px;","padding:".concat(Math.floor(l/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(l,"px;"),"background:url(".concat(o,");"),"background-size:".concat(a,"px ").concat(l,"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 l=o[a];typeof l=="function"&&(t.find(d=>a===d)||(o[a]=l.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:""};u(this,"id",void 0),u(this,"VERSION",ie),u(this,"_startTs",M()),u(this,"_deltaTs",M()),u(this,"_storage",void 0),u(this,"userData",{}),u(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:l=1}=t;return this._shouldLog(e||n)?w()?jt({image:o,message:a,scale:l}):Rt({image:o,message:a,scale:l}):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 l=a.tag||a.message;if(a.once&&l)if(!Ke[l])Ke[l]=M();else return x;return e=kt(this.id,a.message,a),n.bind(console,e,...a.args)}return x}};u(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 l=se(a,e,n);console.log(...l)},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 Lr=new D({id:"@probe.gl/log"});var A=new D({id:"luma.gl"});function S(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}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 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){u(this,"name",void 0),u(this,"type",void 0),u(this,"sampleSize",1),u(this,"time",0),u(this,"count",0),u(this,"samples",0),u(this,"lastTiming",0),u(this,"lastSampleTime",0),u(this,"lastSampleCount",0),u(this,"_count",0),u(this,"_time",0),u(this,"_samples",0),u(this,"_startTime",0),u(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){u(this,"id",void 0),u(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),u(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()&&A.log(1,"luma.gl ".concat(r," - ").concat(t))(),globalThis.luma=globalThis.luma||{VERSION:r,version:r,log:A,stats:K}),r}var Ze=Nt();function $e(r,t,e,n,o,a,l){try{var d=r[a](l),c=d.value}catch(g){e(g);return}d.done?t(c):Promise.resolve(c).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 l(c){$e(a,n,o,l,d,"next",c)}function d(c){$e(a,n,o,l,d,"throw",c)}l(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&&(O(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){u(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 Pe={id:"undefined",handle:void 0,userData:void 0},Oe=function(){function r(t,e,n){if(S(this,r),u(this,"id",void 0),u(this,"props",void 0),u(this,"userData",{}),u(this,"device",void 0),u(this,"_device",void 0),u(this,"destroyed",!1),u(this,"allocatedBytes",0),u(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}();u(Oe,"defaultProps",Pe);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){u(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({},Pe),{},{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 l=Ae({},o);return(o.usage||0)&e.INDEX&&!o.indexType&&(o.data instanceof Uint32Array?l.indexType="uint32":o.data instanceof Uint16Array&&(l.indexType="uint16")),a=t.call(this,n,l,Ht),u(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}(Oe);u(E,"MAP_READ",1);u(E,"MAP_WRITE",2);u(E,"COPY_SRC",4);u(E,"COPY_DST",8);u(E,"INDEX",16);u(E,"VERTEX",32);u(E,"UNIFORM",64);u(E,"STORAGE",128);u(E,"INDIRECT",256);u(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){u(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(A.get("debug")),break:[],gl:null};ct=Symbol.toStringTag;var le=function(){function r(t){S(this,r),u(this,"id",void 0),u(this,"statsManager",K),u(this,"props",void 0),u(this,"userData",{}),u(this,"info",void 0),u(this,"lost",void 0),u(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}();u(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){u(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
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,l=!1,d;return{s:function(){e=e.call(r)},n:function(){var g=e.next();return a=g.done,g},e:function(g){l=!0,d=g},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(l)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(l){n.e(l)}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,l=arguments;return ke.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:o=l.length>0&&l[0]!==void 0?l[0]:{},o=lt(lt({},fe),o),o.gl&&(o.type="webgl"),c.t0=o.type,c.next=c.t0==="webgpu"?6:c.t0==="webgl"||c.t0==="webgl1"||c.t0==="webgl2"?12:c.t0==="best-available"?18:24;break;case 6:if(a=q.get("webgpu"),!a){c.next=11;break}return c.next=10,a.create(o);case 10:return c.abrupt("return",c.sent);case 11:return c.abrupt("break",24);case 12:if(a=q.get("webgl"),!a){c.next=17;break}return c.next=16,a.create(o);case 16:return c.abrupt("return",c.sent);case 17:return c.abrupt("break",24);case 18:if(a=q.get("webgl"),!(a&&a.isSupported())){c.next=23;break}return c.next=22,a.create(o);case 22:return c.abrupt("return",c.sent);case 23:return c.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 c.stop()}},n)}));function e(){return t.apply(this,arguments)}return e}()}]),r}();u(ee,"stats",K);u(ee,"log",A);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,l,d=[],c=!0,g=!1;try{if(a=(e=e.call(r)).next,t===0){if(Object(e)!==e)return;c=!1}else for(;!(c=(n=a.call(e)).done)&&(d.push(n.value),d.length!==t);c=!0);}catch(P){g=!0,o=P}finally{try{if(!c&&e.return!=null&&(l=e.return(),Object(l)!==l))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
|
+
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
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,l=!1,d;return{s:function(){e=e.call(r)},n:function(){var g=e.next();return a=g.done,g},e:function(g){l=!0,d=g},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(l)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),u(this,"time",0),u(this,"channels",new Map),u(this,"animations",new Map),u(this,"playing",!1),u(this,"lastEngineTime",-1)}return T(r,[{key:"addChannel",value:function(e){var n=e.delay,o=n===void 0?0:n,a=e.duration,l=a===void 0?Number.POSITIVE_INFINITY:a,d=e.rate,c=d===void 0?1:d,g=e.repeat,P=g===void 0?1:g,v=Yt++,R={time:0,delay:o,duration:l,rate:c,repeat:P};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),l=a[0],d=a[1];d.channel===e&&this.detachAnimation(l)}}catch(c){n.e(c)}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 l=a.value;this._setChannelTime(l,this.time)}}catch(j){o.e(j)}finally{o.f()}var d=this.animations.values(),c=Le(d),g;try{for(c.s();!(g=c.n()).done;){var P=g.value,v=P.animation,R=P.channel;v.setTime(this.getTime(R))}}catch(j){c.e(j)}finally{c.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);})();
|
|
11
11
|
/*! Bundled license information:
|
|
12
12
|
|
|
13
13
|
@babel/runtime/helpers/regeneratorRuntime.js:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luma.gl/core",
|
|
3
|
-
"version": "9.0.0-alpha.
|
|
3
|
+
"version": "9.0.0-alpha.24",
|
|
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.
|
|
44
|
-
"@luma.gl/engine": "9.0.0-alpha.
|
|
45
|
-
"@luma.gl/shadertools": "9.0.0-alpha.
|
|
46
|
-
"@luma.gl/webgl": "9.0.0-alpha.
|
|
43
|
+
"@luma.gl/constants": "9.0.0-alpha.24",
|
|
44
|
+
"@luma.gl/engine": "9.0.0-alpha.24",
|
|
45
|
+
"@luma.gl/shadertools": "9.0.0-alpha.24",
|
|
46
|
+
"@luma.gl/webgl": "9.0.0-alpha.24"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "3707968c288edbfef7ab4060195493ca8f00e7d5"
|
|
49
49
|
}
|