@luma.gl/effects 9.1.3 → 9.1.5
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.min.js +1 -1
- package/package.json +2 -2
package/dist/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
|
-
"use strict";var __exports__=(()=>{var Bt=Object.create;var N=Object.defineProperty;var It=Object.getOwnPropertyDescriptor;var Rt=Object.getOwnPropertyNames;var Dt=Object.getPrototypeOf,Ft=Object.prototype.hasOwnProperty;var $t=(r,e,t)=>e in r?N(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Nt=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Ut=(r,e)=>{for(var t in e)N(r,t,{get:e[t],enumerable:!0})},oe=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Rt(e))!Ft.call(r,s)&&s!==t&&N(r,s,{get:()=>e[s],enumerable:!(n=It(e,s))||n.enumerable});return r},ie=(r,e,t)=>(oe(r,e,"default"),t&&oe(t,e,"default")),Ht=(r,e,t)=>(t=r!=null?Bt(Dt(r)):{},oe(e||!r||!r.__esModule?N(t,"default",{value:r,enumerable:!0}):t,r)),zt=r=>oe(N({},"__esModule",{value:!0}),r);var a=(r,e,t)=>($t(r,typeof e!="symbol"?e+"":e,t),t);var Lt=Nt((ii,Pt)=>{Pt.exports=globalThis.luma});var se={};Ut(se,{Adapter:()=>we,Buffer:()=>m,CanvasContext:()=>W,CommandBuffer:()=>Q,CommandEncoder:()=>J,ComputePass:()=>K,ComputePipeline:()=>q,Device:()=>_,DeviceFeatures:()=>xe,DeviceLimits:()=>ye,ExternalTexture:()=>O,Framebuffer:()=>X,QuerySet:()=>ne,RenderPass:()=>A,RenderPipeline:()=>Z,Resource:()=>u,Sampler:()=>Y,Shader:()=>j,Texture:()=>h,TextureView:()=>V,TransformFeedback:()=>re,UniformBlock:()=>$,UniformBufferLayout:()=>F,UniformStore:()=>Ee,VertexArray:()=>te,_BufferLayoutHelper:()=>Ce,_getTextureFormatDefinition:()=>I,_getTextureFormatTable:()=>ft,decodeShaderAttributeType:()=>Se,decodeShaderUniformType:()=>ve,decodeTextureFormat:()=>ge,decodeVertexFormat:()=>ee,getAttributeInfosFromLayouts:()=>je,getDataTypeFromTypedArray:()=>Ke,getScratchArray:()=>St,getTextureFormatCapabilities:()=>be,getTypedArrayFromDataType:()=>Ct,getVertexFormatFromAttribute:()=>_t,log:()=>f,luma:()=>mt});var ae=globalThis,kt=globalThis.document||{},ue=globalThis.process||{},Gt=globalThis.console,Pr=globalThis.navigator||{};function Je(r){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&Boolean(process.versions?.electron))return!0;let e=typeof navigator<"u"&&navigator.userAgent,t=r||e;return Boolean(t&&t.indexOf("Electron")>=0)}function y(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||Je()}var _e="4.0.7";function U(){let r;if(typeof window<"u"&&window.performance)r=window.performance.now();else if(typeof process<"u"&&process.hrtime){let e=process.hrtime();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}var E=class{constructor(e,t){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=e,this.type=t,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=U(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(U()-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 L=class{constructor(e){this.stats={},this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}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 t of Object.values(this.stats))e(t)}getTable(){let e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(t=>this._getOrCreate(t))}_getOrCreate(e){let{name:t,type:n}=e,s=this.stats[t];return s||(e instanceof E?s=e:s=new E(t,n),this.stats[t]=s),s}};var Pe=class{stats=new Map;getStats(e){return this.get(e)}get(e){return this.stats.has(e)||this.stats.set(e,new L({id:e})),this.stats.get(e)}},ce=new Pe;function Vt(r){try{let e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}var fe=class{constructor(e,t,n="sessionStorage"){this.storage=Vt(n),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){let t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){let t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}};function Qe(r){let e;return r<10?e=`${r.toFixed(2)}ms`:r<100?e=`${r.toFixed(1)}ms`:r<1e3?e=`${r.toFixed(0)}ms`:e=`${(r/1e3).toFixed(2)}s`,e}function et(r,e=8){let t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var le;(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"})(le||(le={}));var Ot=10;function tt(r){return typeof r!="string"?r:(r=r.toUpperCase(),le[r]||le.WHITE)}function rt(r,e,t){return!y&&typeof r=="string"&&(e&&(r=`\x1B[${tt(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${tt(t)+Ot}m${r}\x1B[49m`)),r}function nt(r,e=["constructor"]){let t=Object.getPrototypeOf(r),n=Object.getOwnPropertyNames(t),s=r;for(let o of n){let i=s[o];typeof i=="function"&&(e.find(c=>o===c)||(s[o]=i.bind(r)))}}function H(r,e){if(!r)throw new Error(e||"Assertion failed")}function C(){let r;if(y()&&ae.performance)r=ae?.performance?.now?.();else if("hrtime"in ue){let e=ue?.hrtime?.();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}var M={debug:y()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},jt={enabled:!0,level:0};function B(){}var st={},ot={once:!0},S=class{constructor({id:e}={id:""}){this.VERSION=_e,this._startTs=C(),this._deltaTs=C(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new fe(`__probe-${this.id}__`,jt),this.timeStamp(`${this.id} started`),nt(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((C()-this._startTs).toPrecision(10))}getDelta(){return Number((C()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!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,t){this._storage.setConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){if(!e)throw new Error(t||"Assertion failed")}warn(e){return this._getLogFunction(0,e,M.warn,arguments,ot)}error(e){return this._getLogFunction(0,e,M.error,arguments)}deprecated(e,t){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(e,t){return this.error(`\`${e}\` has been removed. Use \`${t}\` instead`)}probe(e,t){return this._getLogFunction(e,t,M.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,M.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,M.debug||M.info,arguments,ot)}table(e,t,n){return t?this._getLogFunction(e,t,console.table||B,n&&[n],{tag:Xt(t)}):B}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||B)}group(e,t,n={collapsed:!1}){let s=it({logLevel:e,message:t,opts:n}),{collapsed:o}=n;return s.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(s)}groupCollapsed(e,t,n={}){return this.group(e,t,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||B)}withGroup(e,t,n){this.group(e,t)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=at(e)}_getLogFunction(e,t,n,s,o){if(this._shouldLog(e)){o=it({logLevel:e,message:t,args:s,opts:o}),n=n||o.method,H(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=C();let i=o.tag||o.message;if(o.once&&i)if(!st[i])st[i]=C();else return B;return t=Yt(this.id,o.message,o),n.bind(console,t,...o.args)}return B}};S.VERSION=_e;function at(r){if(!r)return 0;let e;switch(typeof r){case"number":e=r;break;case"object":e=r.logLevel||r.priority||0;break;default:return 0}return H(Number.isFinite(e)&&e>=0),e}function it(r){let{logLevel:e,message:t}=r;r.logLevel=at(e);let n=r.args?Array.from(r.args):[];for(;n.length&&n.shift()!==t;);switch(typeof e){case"string":case"function":t!==void 0&&n.unshift(t),r.message=e;break;case"object":Object.assign(r,e);break;default:}typeof r.message=="function"&&(r.message=r.message());let s=typeof r.message;return H(s==="string"||s==="object"),Object.assign(r,{args:n},r.opts)}function Yt(r,e,t){if(typeof e=="string"){let n=t.time?et(Qe(t.total)):"";e=t.time?`${r}: ${n} ${e}`:`${r}: ${e}`,e=rt(e,t.color,t.background)}return e}function Xt(r){for(let e in r)for(let t in r[e])return t||"untitled";return"empty"}globalThis.probe={};var ln=new S({id:"@probe.gl/log"});var f=new S({id:"luma.gl"});var Le={};function v(r="id"){Le[r]=Le[r]||1;let e=Le[r]++;return`${r}-${e}`}var u=class{toString(){return`${this[Symbol.toStringTag]||this.constructor.name}:"${this.id}"`}id;props;userData={};_device;destroyed=!1;allocatedBytes=0;_attachedResources=new Set;constructor(e,t,n){if(!e)throw new Error("no device");this._device=e,this.props=Zt(t,n);let s=this.props.id!=="undefined"?this.props.id:v(this[Symbol.toStringTag]);this.props.id=s,this.id=s,this.userData=this.props.userData||{},this.addStats()}destroy(){this.destroyResource()}delete(){return this.destroy(),this}getProps(){return this.props}attachResource(e){this._attachedResources.add(e)}detachResource(e){this._attachedResources.delete(e)}destroyAttachedResource(e){this._attachedResources.delete(e)&&e.destroy()}destroyAttachedResources(){for(let e of Object.values(this._attachedResources))e.destroy();this._attachedResources=new Set}destroyResource(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0}removeStats(){let e=this._device.statsManager.getStats("Resource Counts"),t=this[Symbol.toStringTag];e.get(`${t}s Active`).decrementCount()}trackAllocatedMemory(e,t=this[Symbol.toStringTag]){let n=this._device.statsManager.getStats("Resource Counts");n.get("GPU Memory").addCount(e),n.get(`${t} Memory`).addCount(e),this.allocatedBytes=e}trackDeallocatedMemory(e=this[Symbol.toStringTag]){let t=this._device.statsManager.getStats("Resource Counts");t.get("GPU Memory").subtractCount(this.allocatedBytes),t.get(`${e} Memory`).subtractCount(this.allocatedBytes),this.allocatedBytes=0}addStats(){let e=this._device.statsManager.getStats("Resource Counts"),t=this[Symbol.toStringTag];e.get("Resources Created").incrementCount(),e.get(`${t}s Created`).incrementCount(),e.get(`${t}s Active`).incrementCount()}};a(u,"defaultProps",{id:"undefined",handle:void 0,userData:void 0});function Zt(r,e){let t={...e};for(let n in r)r[n]!==void 0&&(t[n]=r[n]);return t}var z=class extends u{get[Symbol.toStringTag](){return"Buffer"}usage;indexType;updateTimestamp;constructor(e,t){let n={...t};(t.usage||0)&z.INDEX&&!t.indexType&&(t.data instanceof Uint32Array?n.indexType="uint32":t.data instanceof Uint16Array&&(n.indexType="uint16")),delete n.data,super(e,n,z.defaultProps),this.usage=n.usage||0,this.indexType=n.indexType,this.updateTimestamp=e.incrementTimestamp()}clone(e){return this.device.createBuffer({...this.props,...e})}readSyncWebGL(e,t){throw new Error("not implemented")}debugData=new ArrayBuffer(0);_setDebugData(e,t,n){let s=ArrayBuffer.isView(e)?e.buffer:e,o=Math.min(e?e.byteLength:n,z.DEBUG_DATA_MAX_LENGTH);s===null?this.debugData=new ArrayBuffer(o):t===0&&n===s.byteLength?this.debugData=s.slice(0,o):this.debugData=s.slice(t,t+o)}},m=z;a(m,"defaultProps",{...u.defaultProps,usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1}),a(m,"MAP_READ",1),a(m,"MAP_WRITE",2),a(m,"COPY_SRC",4),a(m,"COPY_DST",8),a(m,"INDEX",16),a(m,"VERTEX",32),a(m,"UNIFORM",64),a(m,"STORAGE",128),a(m,"INDIRECT",256),a(m,"QUERY_RESOLVE",512),a(m,"DEBUG_DATA_MAX_LENGTH",32);function de(r){let e=ut[r],t=qt(e),n=r.includes("norm"),s=!n&&!r.startsWith("float"),o=r.startsWith("s");return{dataType:ut[r],byteLength:t,integer:s,signed:o,normalized:n}}function qt(r){return Kt[r]}var ut={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},Kt={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4};var p="texture-compression-bc",d="texture-compression-astc",w="texture-compression-etc2",Jt="texture-compression-etc1-webgl",me="texture-compression-pvrtc-webgl",Me="texture-compression-atc-webgl",he="float32-renderable-webgl",Be="float16-renderable-webgl",Qt="rgb9e5ufloat-renderable-webgl",Ie="snorm8-renderable-webgl",k="norm16-renderable-webgl",Re="snorm16-renderable-webgl",pe="float32-filterable",ct="float16-filterable-webgl";function I(r){let e=lt[r];if(!e)throw new Error(`Unsupported texture format ${r}`);return e}function ft(){return lt}var lt={r8unorm:{},r8snorm:{render:Ie},r8uint:{},r8sint:{},rg8unorm:{},rg8snorm:{render:Ie},rg8uint:{},rg8sint:{},r16uint:{},r16sint:{},r16float:{render:Be,filter:"float16-filterable-webgl"},"r16unorm-webgl":{f:k},"r16snorm-webgl":{f:Re},"rgba4unorm-webgl":{channels:"rgba",bitsPerChannel:[4,4,4,4],packed:!0},"rgb565unorm-webgl":{channels:"rgb",bitsPerChannel:[5,6,5,0],packed:!0},"rgb5a1unorm-webgl":{channels:"rgba",bitsPerChannel:[5,5,5,1],packed:!0},"rgb8unorm-webgl":{},"rgb8snorm-webgl":{},rgba8unorm:{},"rgba8unorm-srgb":{},rgba8snorm:{render:Ie},rgba8uint:{},rgba8sint:{},bgra8unorm:{},"bgra8unorm-srgb":{},rg16uint:{},rg16sint:{},rg16float:{render:Be,filter:ct},"rg16unorm-webgl":{render:k},"rg16snorm-webgl":{render:Re},r32uint:{},r32sint:{},r32float:{render:he,filter:pe},rgb9e5ufloat:{channels:"rgb",packed:!0,render:Qt},rg11b10ufloat:{channels:"rgb",bitsPerChannel:[11,11,10,0],packed:!0,p:1,render:he},rgb10a2unorm:{channels:"rgba",bitsPerChannel:[10,10,10,2],packed:!0,p:1},"rgb10a2uint-webgl":{channels:"rgba",bitsPerChannel:[10,10,10,2],packed:!0,p:1,wgpu:!1},"rgb16unorm-webgl":{f:k},"rgb16snorm-webgl":{f:k},rg32uint:{},rg32sint:{},rg32float:{render:!1,filter:pe},rgba16uint:{},rgba16sint:{},rgba16float:{render:Be,filter:ct},"rgba16unorm-webgl":{render:k},"rgba16snorm-webgl":{render:Re},"rgb32float-webgl":{render:he,filter:pe},rgba32uint:{},rgba32sint:{},rgba32float:{render:he,filter:pe},stencil8:{attachment:"stencil",bitsPerChannel:[8,0,0,0],dataType:"uint8"},depth16unorm:{attachment:"depth",bitsPerChannel:[16,0,0,0],dataType:"uint16"},depth24plus:{attachment:"depth",bitsPerChannel:[24,0,0,0],dataType:"uint32"},depth32float:{attachment:"depth",bitsPerChannel:[32,0,0,0],dataType:"float32"},"depth24plus-stencil8":{attachment:"depth-stencil",bitsPerChannel:[24,8,0,0],packed:!0},"depth32float-stencil8":{attachment:"depth-stencil",bitsPerChannel:[32,8,0,0],packed:!0},"bc1-rgb-unorm-webgl":{f:p},"bc1-rgb-unorm-srgb-webgl":{f:p},"bc1-rgba-unorm":{f:p},"bc1-rgba-unorm-srgb":{f:p},"bc2-rgba-unorm":{f:p},"bc2-rgba-unorm-srgb":{f:p},"bc3-rgba-unorm":{f:p},"bc3-rgba-unorm-srgb":{f:p},"bc4-r-unorm":{f:p},"bc4-r-snorm":{f:p},"bc5-rg-unorm":{f:p},"bc5-rg-snorm":{f:p},"bc6h-rgb-ufloat":{f:p},"bc6h-rgb-float":{f:p},"bc7-rgba-unorm":{f:p},"bc7-rgba-unorm-srgb":{f:p},"etc2-rgb8unorm":{f:w},"etc2-rgb8unorm-srgb":{f:w},"etc2-rgb8a1unorm":{f:w},"etc2-rgb8a1unorm-srgb":{f:w},"etc2-rgba8unorm":{f:w},"etc2-rgba8unorm-srgb":{f:w},"eac-r11unorm":{f:w},"eac-r11snorm":{f:w},"eac-rg11unorm":{f:w},"eac-rg11snorm":{f:w},"astc-4x4-unorm":{f:d},"astc-4x4-unorm-srgb":{f:d},"astc-5x4-unorm":{f:d},"astc-5x4-unorm-srgb":{f:d},"astc-5x5-unorm":{f:d},"astc-5x5-unorm-srgb":{f:d},"astc-6x5-unorm":{f:d},"astc-6x5-unorm-srgb":{f:d},"astc-6x6-unorm":{f:d},"astc-6x6-unorm-srgb":{f:d},"astc-8x5-unorm":{f:d},"astc-8x5-unorm-srgb":{f:d},"astc-8x6-unorm":{f:d},"astc-8x6-unorm-srgb":{f:d},"astc-8x8-unorm":{f:d},"astc-8x8-unorm-srgb":{f:d},"astc-10x5-unorm":{f:d},"astc-10x5-unorm-srgb":{f:d},"astc-10x6-unorm":{f:d},"astc-10x6-unorm-srgb":{f:d},"astc-10x8-unorm":{f:d},"astc-10x8-unorm-srgb":{f:d},"astc-10x10-unorm":{f:d},"astc-10x10-unorm-srgb":{f:d},"astc-12x10-unorm":{f:d},"astc-12x10-unorm-srgb":{f:d},"astc-12x12-unorm":{f:d},"astc-12x12-unorm-srgb":{f:d},"pvrtc-rgb4unorm-webgl":{f:me},"pvrtc-rgba4unorm-webgl":{f:me},"pvrtc-rbg2unorm-webgl":{f:me},"pvrtc-rgba2unorm-webgl":{f:me},"etc1-rbg-unorm-webgl":{f:Jt},"atc-rgb-unorm-webgl":{f:Me},"atc-rgba-unorm-webgl":{f:Me},"atc-rgbai-unorm-webgl":{f:Me}};var er=["bc1","bc2","bc3","bc4","bc5","bc6","bc7","etc1","etc2","eac","atc","astc","pvrtc"],tr=/^(r|rg|rgb|rgba|bgra)([0-9]*)([a-z]*)(-srgb)?(-webgl)?$/;function De(r){return er.some(e=>r.startsWith(e))}function ge(r){let e=rr(r);if(De(r)){e.channels="rgb",e.components=3,e.bytesPerPixel=1,e.srgb=!1,e.compressed=!0;let n=nr(r);n&&(e.blockWidth=n.blockWidth,e.blockHeight=n.blockHeight)}let t=tr.exec(r);if(t){let[,n,s,o,i,c]=t,l=`${o}${s}`,b=de(l),g=b.byteLength*8,x=n.length,Mt=[g,x>=2?g:0,x>=3?g:0,x>=4?g:0];e={format:r,attachment:e.attachment,dataType:b.dataType,components:x,channels:n,integer:b.integer,signed:b.signed,normalized:b.normalized,bitsPerChannel:Mt,bytesPerPixel:b.byteLength*n.length,packed:e.packed,srgb:e.srgb},c==="-webgl"&&(e.webgl=!0),i==="-srgb"&&(e.srgb=!0)}return r.endsWith("-webgl")&&(e.webgl=!0),r.endsWith("-srgb")&&(e.srgb=!0),e}function rr(r){let e=I(r),t=e.bytesPerPixel||1,n=e.bitsPerChannel||[8,8,8,8];return delete e.bitsPerChannel,delete e.bytesPerPixel,delete e.f,delete e.render,delete e.filter,delete e.blend,delete e.store,{...e,format:r,attachment:e.attachment||"color",channels:e.channels||"r",components:e.components||e.channels?.length||1,bytesPerPixel:t,bitsPerChannel:n,dataType:e.dataType||"uint8",srgb:e.srgb??!1,packed:e.packed??!1,webgl:e.webgl??!1,integer:e.integer??!1,signed:e.signed??!1,normalized:e.normalized??!1,compressed:e.compressed??!1}}function nr(r){let t=/.*-(\d+)x(\d+)-.*/.exec(r);if(t){let[,n,s]=t;return{blockWidth:Number(n),blockHeight:Number(s)}}return null}function be(r){let e=I(r),t={format:r,create:e.f??!0,render:e.render??!0,filter:e.filter??!0,blend:e.blend??!0,store:e.store??!0},n=ge(r),s=r.startsWith("depth")||r.startsWith("stencil"),o=n?.signed,i=n?.integer,c=n?.webgl;return t.render&&=!o,t.filter&&=!s&&!o&&!i&&!c,t}var ye=class{},xe=class{features;disabledFeatures;constructor(e=[],t){this.features=new Set(e),this.disabledFeatures=t||{}}*[Symbol.iterator](){yield*this.features}has(e){return!this.disabledFeatures?.[e]&&this.features.has(e)}},Fe=class{get[Symbol.toStringTag](){return"Device"}constructor(e){this.props={...Fe.defaultProps,...e},this.id=this.props.id||v(this[Symbol.toStringTag].toLowerCase())}id;props;userData={};statsManager=ce;timestamp=0;_reused=!1;_lumaData={};getTextureFormatCapabilities(e){let t=be(e),n=i=>(typeof i=="string"?this.features.has(i):i)??!0,s=n(t.create),o={format:e,create:s,render:s&&n(t.render),filter:s&&n(t.filter),blend:s&&n(t.blend),store:s&&n(t.store)};return this._getDeviceSpecificTextureFormatCapabilities(o)}isTextureFormatSupported(e,t){return this.getTextureFormatCapabilities(e).create}isTextureFormatFilterable(e){return this.getTextureFormatCapabilities(e).filter}isTextureFormatRenderable(e){return this.getTextureFormatCapabilities(e).render}isTextureFormatCompressed(e){return De(e)}loseDevice(){return!1}reportError(e){this.props.onError(e)}getDefaultCanvasContext(){if(!this.canvasContext)throw new Error("Device has no default CanvasContext. See props.createCanvasContext");return this.canvasContext}createCommandEncoder(e={}){throw new Error("not implemented")}incrementTimestamp(){return this.timestamp++}onError(e){this.props.onError(e)}getCanvasContext(){return this.getDefaultCanvasContext()}readPixelsToArrayWebGL(e,t){throw new Error("not implemented")}readPixelsToBufferWebGL(e,t){throw new Error("not implemented")}setParametersWebGL(e){throw new Error("not implemented")}getParametersWebGL(e){throw new Error("not implemented")}withParametersWebGL(e,t){throw new Error("not implemented")}clearWebGL(e){throw new Error("not implemented")}resetWebGL(){throw new Error("not implemented")}static _getCanvasContextProps(e){return e.createCanvasContext===!0?{}:e.createCanvasContext}_normalizeBufferProps(e){(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});let t={...e};return(e.usage||0)&m.INDEX&&!e.indexType&&(e.data instanceof Uint32Array?t.indexType="uint32":e.data instanceof Uint16Array?t.indexType="uint16":f.warn("indices buffer content must be of integer type")()),t}},_=Fe;a(_,"defaultProps",{id:null,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,createCanvasContext:void 0,onError:e=>f.error(e.message)(),_reuseDevices:!1,_requestMaxLimits:!0,_factoryDestroyPolicy:"unused",_initializeFeatures:!0,_disabledFeatures:{"compilation-status-async-webgl":!0},_resourceDefaults:{},webgl:{},debug:f.get("debug")||void 0,debugShaders:f.get("debug-shaders")||void 0,debugFramebuffers:Boolean(f.get("debug-framebuffers")),debugWebGL:Boolean(f.get("debug-webgl")),debugSpectorJS:void 0,debugSpectorJSUrl:void 0,_handle:void 0});var sr=y()&&typeof document<"u",or=()=>sr&&document.readyState==="complete",ir="set luma.log.level=1 (or higher) to trace rendering",dt="No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.",R=class{stats=ce;log=f;VERSION="9.1.3";spector;preregisteredAdapters=new Map;constructor(){if(globalThis.luma){if(globalThis.luma.VERSION!==this.VERSION)throw f.error(`Found luma.gl ${globalThis.luma.VERSION} while initialzing ${this.VERSION}`)(),f.error("'yarn why @luma.gl/core' can help identify the source of the conflict")(),new Error("luma.gl - multiple versions detected: see console log");f.error("This version of luma.gl has already been initialized")()}f.log(1,`${this.VERSION} - ${ir}`)(),globalThis.luma=this}registerAdapters(e){for(let t of e)this.preregisteredAdapters.set(t.type,t)}getSupportedAdapters(e=[]){let t=this.getAdapterMap(e);return Array.from(t).map(([,n])=>n).filter(n=>n.isSupported?.()).map(n=>n.type)}getBestAvailableAdapter(e=[]){let t=this.getAdapterMap(e);return t.get("webgpu")?.isSupported?.()?"webgpu":t.get("webgl")?.isSupported?.()?"webgl":null}setDefaultDeviceProps(e){Object.assign(R.defaultProps,e)}async createDevice(e={}){e={...R.defaultProps,...e},e.waitForPageLoad&&await R.pageLoaded;let t=this.getAdapterMap(e.adapters),n=e.type||"";n==="best-available"&&(n=this.getBestAvailableAdapter(e.adapters)||n);let i=await(this.getAdapterMap(e.adapters)||t).get(n)?.create?.(e);if(i)return i;throw new Error(dt)}async attachDevice(e){let t=this.getAdapterMap(e.adapters),n="";e.handle instanceof WebGL2RenderingContext&&(n="webgl"),e.createCanvasContext&&await R.pageLoaded,e.handle===null&&(n="unknown");let o=await t.get(n)?.attach?.(null);if(o)return o;throw new Error(dt)}enforceWebGL2(e=!0,t=[]){let s=this.getAdapterMap(t).get("webgl");s||f.warn("enforceWebGL2: webgl adapter not found")(),s?.enforceWebGL2?.(e)}getAdapterMap(e=[]){let t=new Map(this.preregisteredAdapters);for(let n of e)t.set(n.type,n);return t}registerDevices(e){f.warn("luma.registerDevices() is deprecated, use luma.registerAdapters() instead");for(let t of e){let n=t.adapter;n&&this.preregisteredAdapters.set(n.type,n)}}},G=R;a(G,"defaultProps",{..._.defaultProps,type:"best-available",adapters:void 0,waitForPageLoad:!0}),a(G,"pageLoaded",ar().then(()=>{f.probe(2,"DOM is loaded")()}));var mt=new G;function ar(){return or()||typeof window>"u"?Promise.resolve():new Promise(r=>{window.addEventListener("load",()=>r())})}var we=class{};var $e=class{id;props;canvas;htmlCanvas;offscreenCanvas;type;width=1;height=1;resizeObserver;_canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1};toString(){return`${this[Symbol.toStringTag]}(${this.id})`}constructor(e){if(this.props={...$e.defaultProps,...e},e=this.props,!y()){this.id="node-canvas-context",this.type="node",this.width=this.props.width,this.height=this.props.height,this.canvas=null;return}if(e.canvas)typeof e.canvas=="string"?this.canvas=cr(e.canvas):this.canvas=e.canvas;else{let t=fr(e),n=ur(e?.container||null);n.insertBefore(t,n.firstChild),this.canvas=t,e?.visible||(this.canvas.style.visibility="hidden")}this.canvas instanceof HTMLCanvasElement?(this.id=this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):(this.id="offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas),this.canvas instanceof HTMLCanvasElement&&e.autoResize&&(this.resizeObserver=new ResizeObserver(t=>{for(let n of t)n.target===this.canvas&&this.update()}),this.resizeObserver.observe(this.canvas))}getDevicePixelRatio(e){return typeof OffscreenCanvas<"u"&&this.canvas instanceof OffscreenCanvas||(e=e===void 0?this.props.useDevicePixels:e,!e||e<=0)?1:e===!0?typeof window<"u"&&window.devicePixelRatio||1:e}getPixelSize(){switch(this.type){case"node":return[this.width,this.height];case"offscreen-canvas":return[this.canvas.width,this.canvas.height];case"html-canvas":let e=this.getDevicePixelRatio(),t=this.canvas;return t.parentElement?[t.clientWidth*e,t.clientHeight*e]:[this.canvas.width,this.canvas.height];default:throw new Error(this.type)}}getAspect(){let[e,t]=this.getPixelSize();return e/t}cssToDeviceRatio(){try{let[e]=this.getDrawingBufferSize(),t=this._canvasSizeInfo.clientWidth||this.htmlCanvas?.clientWidth;return t?e/t:1}catch{return 1}}cssToDevicePixels(e,t=!0){let n=this.cssToDeviceRatio(),[s,o]=this.getDrawingBufferSize();return lr(e,n,s,o,t)}setDevicePixelRatio(e,t={}){if(!this.htmlCanvas)return;let n="width"in t?t.width:this.htmlCanvas.clientWidth,s="height"in t?t.height:this.htmlCanvas.clientHeight;(!n||!s)&&(f.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,n=this.htmlCanvas.width||1,s=this.htmlCanvas.height||1);let o=this._canvasSizeInfo;if(o.clientWidth!==n||o.clientHeight!==s||o.devicePixelRatio!==e){let i=e,c=Math.floor(n*i),l=Math.floor(s*i);if(this.htmlCanvas.width=c,this.htmlCanvas.height=l,this.device.gl){let[g,x]=this.getDrawingBufferSize();(g!==c||x!==l)&&(i=Math.min(g/n,x/s),this.htmlCanvas.width=Math.floor(n*i),this.htmlCanvas.height=Math.floor(s*i),f.warn("Device pixel ratio clamped")()),this._canvasSizeInfo.clientWidth=n,this._canvasSizeInfo.clientHeight=s,this._canvasSizeInfo.devicePixelRatio=e}}}getDrawingBufferSize(){let e=this.device.gl;return e?[e.drawingBufferWidth,e.drawingBufferHeight]:this.getPixelSize()}_setAutoCreatedCanvasId(e){this.htmlCanvas?.id==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=e)}},W=$e;a(W,"defaultProps",{canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,alphaMode:"opaque",colorSpace:"srgb"});function ur(r){if(typeof r=="string"){let e=document.getElementById(r);if(!e)throw new Error(`${r} is not an HTML element`);return e}else if(r)return r;return document.body}function cr(r){let e=document.getElementById(r);if(!(e instanceof HTMLCanvasElement))throw new Error("Object is not a canvas element");return e}function fr(r){let{width:e,height:t}=r,n=document.createElement("canvas");return n.id=v("lumagl-auto-created-canvas"),n.width=e||1,n.height=t||1,n.style.width=Number.isFinite(e)?`${e}px`:"100%",n.style.height=Number.isFinite(t)?`${t}px`:"100%",n}function lr(r,e,t,n,s){let o=r,i=ht(o[0],e,t),c=pt(o[1],e,n,s),l=ht(o[0]+1,e,t),b=l===t-1?l:l-1;l=pt(o[1]+1,e,n,s);let g;return s?(l=l===0?l:l+1,g=c,c=l):g=l===n-1?l:l-1,{x:i,y:c,width:Math.max(b-i+1,1),height:Math.max(g-c+1,1)}}function ht(r,e,t){return Math.min(Math.round(r*e),t-1)}function pt(r,e,t,n){return n?Math.max(0,t-1-Math.round(r*e)):Math.min(Math.round(r*e),t-1)}var T=class extends u{get[Symbol.toStringTag](){return"Texture"}toString(){return`Texture(${this.id},${this.format},${this.width}x${this.height})`}dimension;format;width;height;depth;mipLevels;updateTimestamp;constructor(e,t){if(t=T.normalizeProps(e,t),super(e,t,T.defaultProps),this.dimension=this.props.dimension,this.format=this.props.format,this.width=this.props.width,this.height=this.props.height,this.depth=this.props.depth,this.props.width===void 0||this.props.height===void 0){let n=T.getTextureDataSize(this.props.data);this.width=n?.width||1,this.height=n?.height||1}this.props.mipmaps&&this.props.mipLevels===void 0&&(this.props.mipLevels="pyramid"),this.mipLevels=this.props.mipLevels==="pyramid"?T.getMipLevelCount(this.width,this.height):this.props.mipLevels||1,this.updateTimestamp=e.incrementTimestamp()}clone(e){return this.device.createTexture({...this.props,...e})}static isExternalImage(e){return typeof ImageData<"u"&&e instanceof ImageData||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement||typeof VideoFrame<"u"&&e instanceof VideoFrame||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas}static getExternalImageSize(e){if(typeof ImageData<"u"&&e instanceof ImageData||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas)return{width:e.width,height:e.height};if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement)return{width:e.naturalWidth,height:e.naturalHeight};if(typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement)return{width:e.videoWidth,height:e.videoHeight};if(typeof VideoFrame<"u"&&e instanceof VideoFrame)return{width:e.displayWidth,height:e.displayHeight};throw new Error("Unknown image type")}static isTextureLevelData(e){let t=e?.data;return ArrayBuffer.isView(t)}static getTextureDataSize(e){if(!e||ArrayBuffer.isView(e))return null;if(Array.isArray(e))return T.getTextureDataSize(e[0]);if(T.isExternalImage(e))return T.getExternalImageSize(e);if(e&&typeof e=="object"&&e.constructor===Object){let n=Object.values(e)[0];return{width:n.width,height:n.height}}throw new Error("texture size deduction failed")}static normalizeTextureData(e,t){let n;return ArrayBuffer.isView(e)?n=[{data:e,width:t.width,height:t.height}]:Array.isArray(e)?n=e:n=[e],n}static getMipLevelCount(e,t){return Math.floor(Math.log2(Math.max(e,t)))+1}static getCubeFaceDepth(e){switch(e){case"+X":return 0;case"-X":return 1;case"+Y":return 2;case"-Y":return 3;case"+Z":return 4;case"-Z":return 5;default:throw new Error(e)}}static normalizeProps(e,t){let n={...t},s=e?.props?._resourceDefaults?.texture||{};Object.assign(n,s);let{width:o,height:i}=n;return typeof o=="number"&&(n.width=Math.max(1,Math.ceil(o))),typeof i=="number"&&(n.height=Math.max(1,Math.ceil(i))),n}},h=T;a(h,"COPY_SRC",1),a(h,"COPY_DST",2),a(h,"TEXTURE",4),a(h,"STORAGE",8),a(h,"RENDER_ATTACHMENT",16),a(h,"CubeFaces",["+X","-X","+Y","-Y","+Z","-Z"]),a(h,"defaultProps",{...u.defaultProps,data:null,dimension:"2d",format:"rgba8unorm",width:void 0,height:void 0,depth:1,mipmaps:!1,compressed:!1,usage:0,mipLevels:void 0,samples:void 0,sampler:{},view:void 0,flipY:void 0}),a(h,"defaultCopyExternalImageOptions",{image:void 0,sourceX:0,sourceY:0,width:void 0,height:void 0,depth:1,mipLevel:0,x:0,y:0,z:0,aspect:"all",colorSpace:"srgb",premultipliedAlpha:!1,flipY:!1});var Ne=class extends u{get[Symbol.toStringTag](){return"TextureView"}constructor(e,t){super(e,t,Ne.defaultProps)}},V=Ne;a(V,"defaultProps",{...u.defaultProps,format:void 0,dimension:void 0,aspect:"all",baseMipLevel:0,mipLevelCount:void 0,baseArrayLayer:0,arrayLayerCount:void 0});var Ue=class extends u{get[Symbol.toStringTag](){return"ExternalTexture"}constructor(e,t){super(e,t,Ue.defaultProps)}},O=Ue;a(O,"defaultProps",{...u.defaultProps,source:void 0,colorSpace:"srgb"});function bt(r,e,t){let n="",s=e.split(/\r?\n/),o=r.slice().sort((i,c)=>i.lineNum-c.lineNum);switch(t?.showSourceCode||"no"){case"all":let i=0;for(let c=1;c<=s.length;c++)for(n+=yt(s[c-1],c,t);o.length>i&&o[i].lineNum===c;){let l=o[i++];n+=gt(l,s,l.lineNum,{...t,inlineSource:!1})}return n;case"issues":case"no":for(let c of r)n+=gt(c,s,c.lineNum,{inlineSource:t?.showSourceCode!=="no"});return n}}function gt(r,e,t,n){if(n?.inlineSource){let o=dr(e,t),i=r.linePos>0?`${" ".repeat(r.linePos+5)}^^^
|
|
7
|
+
"use strict";var __exports__=(()=>{var Bt=Object.create;var N=Object.defineProperty;var It=Object.getOwnPropertyDescriptor;var Rt=Object.getOwnPropertyNames;var Dt=Object.getPrototypeOf,Ft=Object.prototype.hasOwnProperty;var $t=(r,e,t)=>e in r?N(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Nt=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Ut=(r,e)=>{for(var t in e)N(r,t,{get:e[t],enumerable:!0})},oe=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Rt(e))!Ft.call(r,s)&&s!==t&&N(r,s,{get:()=>e[s],enumerable:!(n=It(e,s))||n.enumerable});return r},ie=(r,e,t)=>(oe(r,e,"default"),t&&oe(t,e,"default")),Ht=(r,e,t)=>(t=r!=null?Bt(Dt(r)):{},oe(e||!r||!r.__esModule?N(t,"default",{value:r,enumerable:!0}):t,r)),zt=r=>oe(N({},"__esModule",{value:!0}),r);var a=(r,e,t)=>($t(r,typeof e!="symbol"?e+"":e,t),t);var Lt=Nt((ii,Pt)=>{Pt.exports=globalThis.luma});var se={};Ut(se,{Adapter:()=>we,Buffer:()=>m,CanvasContext:()=>W,CommandBuffer:()=>Q,CommandEncoder:()=>J,ComputePass:()=>K,ComputePipeline:()=>q,Device:()=>_,DeviceFeatures:()=>xe,DeviceLimits:()=>ye,ExternalTexture:()=>O,Framebuffer:()=>X,QuerySet:()=>ne,RenderPass:()=>A,RenderPipeline:()=>Z,Resource:()=>u,Sampler:()=>Y,Shader:()=>j,Texture:()=>h,TextureView:()=>V,TransformFeedback:()=>re,UniformBlock:()=>$,UniformBufferLayout:()=>F,UniformStore:()=>Ee,VertexArray:()=>te,_BufferLayoutHelper:()=>Ce,_getTextureFormatDefinition:()=>I,_getTextureFormatTable:()=>ft,decodeShaderAttributeType:()=>Se,decodeShaderUniformType:()=>ve,decodeTextureFormat:()=>ge,decodeVertexFormat:()=>ee,getAttributeInfosFromLayouts:()=>je,getDataTypeFromTypedArray:()=>Ke,getScratchArray:()=>St,getTextureFormatCapabilities:()=>be,getTypedArrayFromDataType:()=>Ct,getVertexFormatFromAttribute:()=>_t,log:()=>f,luma:()=>mt});var ae=globalThis,kt=globalThis.document||{},ue=globalThis.process||{},Gt=globalThis.console,Pr=globalThis.navigator||{};function Je(r){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&Boolean(process.versions?.electron))return!0;let e=typeof navigator<"u"&&navigator.userAgent,t=r||e;return Boolean(t&&t.indexOf("Electron")>=0)}function y(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||Je()}var _e="4.0.7";function U(){let r;if(typeof window<"u"&&window.performance)r=window.performance.now();else if(typeof process<"u"&&process.hrtime){let e=process.hrtime();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}var E=class{constructor(e,t){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=e,this.type=t,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=U(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(U()-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 L=class{constructor(e){this.stats={},this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}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 t of Object.values(this.stats))e(t)}getTable(){let e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(t=>this._getOrCreate(t))}_getOrCreate(e){let{name:t,type:n}=e,s=this.stats[t];return s||(e instanceof E?s=e:s=new E(t,n),this.stats[t]=s),s}};var Pe=class{stats=new Map;getStats(e){return this.get(e)}get(e){return this.stats.has(e)||this.stats.set(e,new L({id:e})),this.stats.get(e)}},ce=new Pe;function Vt(r){try{let e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}var fe=class{constructor(e,t,n="sessionStorage"){this.storage=Vt(n),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){let t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){let t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}};function Qe(r){let e;return r<10?e=`${r.toFixed(2)}ms`:r<100?e=`${r.toFixed(1)}ms`:r<1e3?e=`${r.toFixed(0)}ms`:e=`${(r/1e3).toFixed(2)}s`,e}function et(r,e=8){let t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var le;(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"})(le||(le={}));var Ot=10;function tt(r){return typeof r!="string"?r:(r=r.toUpperCase(),le[r]||le.WHITE)}function rt(r,e,t){return!y&&typeof r=="string"&&(e&&(r=`\x1B[${tt(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${tt(t)+Ot}m${r}\x1B[49m`)),r}function nt(r,e=["constructor"]){let t=Object.getPrototypeOf(r),n=Object.getOwnPropertyNames(t),s=r;for(let o of n){let i=s[o];typeof i=="function"&&(e.find(c=>o===c)||(s[o]=i.bind(r)))}}function H(r,e){if(!r)throw new Error(e||"Assertion failed")}function C(){let r;if(y()&&ae.performance)r=ae?.performance?.now?.();else if("hrtime"in ue){let e=ue?.hrtime?.();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}var M={debug:y()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},jt={enabled:!0,level:0};function B(){}var st={},ot={once:!0},S=class{constructor({id:e}={id:""}){this.VERSION=_e,this._startTs=C(),this._deltaTs=C(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new fe(`__probe-${this.id}__`,jt),this.timeStamp(`${this.id} started`),nt(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((C()-this._startTs).toPrecision(10))}getDelta(){return Number((C()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!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,t){this._storage.setConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){if(!e)throw new Error(t||"Assertion failed")}warn(e){return this._getLogFunction(0,e,M.warn,arguments,ot)}error(e){return this._getLogFunction(0,e,M.error,arguments)}deprecated(e,t){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(e,t){return this.error(`\`${e}\` has been removed. Use \`${t}\` instead`)}probe(e,t){return this._getLogFunction(e,t,M.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,M.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,M.debug||M.info,arguments,ot)}table(e,t,n){return t?this._getLogFunction(e,t,console.table||B,n&&[n],{tag:Xt(t)}):B}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||B)}group(e,t,n={collapsed:!1}){let s=it({logLevel:e,message:t,opts:n}),{collapsed:o}=n;return s.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(s)}groupCollapsed(e,t,n={}){return this.group(e,t,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||B)}withGroup(e,t,n){this.group(e,t)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=at(e)}_getLogFunction(e,t,n,s,o){if(this._shouldLog(e)){o=it({logLevel:e,message:t,args:s,opts:o}),n=n||o.method,H(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=C();let i=o.tag||o.message;if(o.once&&i)if(!st[i])st[i]=C();else return B;return t=Yt(this.id,o.message,o),n.bind(console,t,...o.args)}return B}};S.VERSION=_e;function at(r){if(!r)return 0;let e;switch(typeof r){case"number":e=r;break;case"object":e=r.logLevel||r.priority||0;break;default:return 0}return H(Number.isFinite(e)&&e>=0),e}function it(r){let{logLevel:e,message:t}=r;r.logLevel=at(e);let n=r.args?Array.from(r.args):[];for(;n.length&&n.shift()!==t;);switch(typeof e){case"string":case"function":t!==void 0&&n.unshift(t),r.message=e;break;case"object":Object.assign(r,e);break;default:}typeof r.message=="function"&&(r.message=r.message());let s=typeof r.message;return H(s==="string"||s==="object"),Object.assign(r,{args:n},r.opts)}function Yt(r,e,t){if(typeof e=="string"){let n=t.time?et(Qe(t.total)):"";e=t.time?`${r}: ${n} ${e}`:`${r}: ${e}`,e=rt(e,t.color,t.background)}return e}function Xt(r){for(let e in r)for(let t in r[e])return t||"untitled";return"empty"}globalThis.probe={};var ln=new S({id:"@probe.gl/log"});var f=new S({id:"luma.gl"});var Le={};function v(r="id"){Le[r]=Le[r]||1;let e=Le[r]++;return`${r}-${e}`}var u=class{toString(){return`${this[Symbol.toStringTag]||this.constructor.name}:"${this.id}"`}id;props;userData={};_device;destroyed=!1;allocatedBytes=0;_attachedResources=new Set;constructor(e,t,n){if(!e)throw new Error("no device");this._device=e,this.props=Zt(t,n);let s=this.props.id!=="undefined"?this.props.id:v(this[Symbol.toStringTag]);this.props.id=s,this.id=s,this.userData=this.props.userData||{},this.addStats()}destroy(){this.destroyResource()}delete(){return this.destroy(),this}getProps(){return this.props}attachResource(e){this._attachedResources.add(e)}detachResource(e){this._attachedResources.delete(e)}destroyAttachedResource(e){this._attachedResources.delete(e)&&e.destroy()}destroyAttachedResources(){for(let e of Object.values(this._attachedResources))e.destroy();this._attachedResources=new Set}destroyResource(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0}removeStats(){let e=this._device.statsManager.getStats("Resource Counts"),t=this[Symbol.toStringTag];e.get(`${t}s Active`).decrementCount()}trackAllocatedMemory(e,t=this[Symbol.toStringTag]){let n=this._device.statsManager.getStats("Resource Counts");n.get("GPU Memory").addCount(e),n.get(`${t} Memory`).addCount(e),this.allocatedBytes=e}trackDeallocatedMemory(e=this[Symbol.toStringTag]){let t=this._device.statsManager.getStats("Resource Counts");t.get("GPU Memory").subtractCount(this.allocatedBytes),t.get(`${e} Memory`).subtractCount(this.allocatedBytes),this.allocatedBytes=0}addStats(){let e=this._device.statsManager.getStats("Resource Counts"),t=this[Symbol.toStringTag];e.get("Resources Created").incrementCount(),e.get(`${t}s Created`).incrementCount(),e.get(`${t}s Active`).incrementCount()}};a(u,"defaultProps",{id:"undefined",handle:void 0,userData:void 0});function Zt(r,e){let t={...e};for(let n in r)r[n]!==void 0&&(t[n]=r[n]);return t}var z=class extends u{get[Symbol.toStringTag](){return"Buffer"}usage;indexType;updateTimestamp;constructor(e,t){let n={...t};(t.usage||0)&z.INDEX&&!t.indexType&&(t.data instanceof Uint32Array?n.indexType="uint32":t.data instanceof Uint16Array&&(n.indexType="uint16")),delete n.data,super(e,n,z.defaultProps),this.usage=n.usage||0,this.indexType=n.indexType,this.updateTimestamp=e.incrementTimestamp()}clone(e){return this.device.createBuffer({...this.props,...e})}readSyncWebGL(e,t){throw new Error("not implemented")}debugData=new ArrayBuffer(0);_setDebugData(e,t,n){let s=ArrayBuffer.isView(e)?e.buffer:e,o=Math.min(e?e.byteLength:n,z.DEBUG_DATA_MAX_LENGTH);s===null?this.debugData=new ArrayBuffer(o):t===0&&n===s.byteLength?this.debugData=s.slice(0,o):this.debugData=s.slice(t,t+o)}},m=z;a(m,"defaultProps",{...u.defaultProps,usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",mappedAtCreation:!1}),a(m,"MAP_READ",1),a(m,"MAP_WRITE",2),a(m,"COPY_SRC",4),a(m,"COPY_DST",8),a(m,"INDEX",16),a(m,"VERTEX",32),a(m,"UNIFORM",64),a(m,"STORAGE",128),a(m,"INDIRECT",256),a(m,"QUERY_RESOLVE",512),a(m,"DEBUG_DATA_MAX_LENGTH",32);function de(r){let e=ut[r],t=qt(e),n=r.includes("norm"),s=!n&&!r.startsWith("float"),o=r.startsWith("s");return{dataType:ut[r],byteLength:t,integer:s,signed:o,normalized:n}}function qt(r){return Kt[r]}var ut={uint8:"uint8",sint8:"sint8",unorm8:"uint8",snorm8:"sint8",uint16:"uint16",sint16:"sint16",unorm16:"uint16",snorm16:"sint16",float16:"float16",float32:"float32",uint32:"uint32",sint32:"sint32"},Kt={uint8:1,sint8:1,uint16:2,sint16:2,float16:2,float32:4,uint32:4,sint32:4};var p="texture-compression-bc",d="texture-compression-astc",w="texture-compression-etc2",Jt="texture-compression-etc1-webgl",me="texture-compression-pvrtc-webgl",Me="texture-compression-atc-webgl",he="float32-renderable-webgl",Be="float16-renderable-webgl",Qt="rgb9e5ufloat-renderable-webgl",Ie="snorm8-renderable-webgl",k="norm16-renderable-webgl",Re="snorm16-renderable-webgl",pe="float32-filterable",ct="float16-filterable-webgl";function I(r){let e=lt[r];if(!e)throw new Error(`Unsupported texture format ${r}`);return e}function ft(){return lt}var lt={r8unorm:{},r8snorm:{render:Ie},r8uint:{},r8sint:{},rg8unorm:{},rg8snorm:{render:Ie},rg8uint:{},rg8sint:{},r16uint:{},r16sint:{},r16float:{render:Be,filter:"float16-filterable-webgl"},"r16unorm-webgl":{f:k},"r16snorm-webgl":{f:Re},"rgba4unorm-webgl":{channels:"rgba",bitsPerChannel:[4,4,4,4],packed:!0},"rgb565unorm-webgl":{channels:"rgb",bitsPerChannel:[5,6,5,0],packed:!0},"rgb5a1unorm-webgl":{channels:"rgba",bitsPerChannel:[5,5,5,1],packed:!0},"rgb8unorm-webgl":{},"rgb8snorm-webgl":{},rgba8unorm:{},"rgba8unorm-srgb":{},rgba8snorm:{render:Ie},rgba8uint:{},rgba8sint:{},bgra8unorm:{},"bgra8unorm-srgb":{},rg16uint:{},rg16sint:{},rg16float:{render:Be,filter:ct},"rg16unorm-webgl":{render:k},"rg16snorm-webgl":{render:Re},r32uint:{},r32sint:{},r32float:{render:he,filter:pe},rgb9e5ufloat:{channels:"rgb",packed:!0,render:Qt},rg11b10ufloat:{channels:"rgb",bitsPerChannel:[11,11,10,0],packed:!0,p:1,render:he},rgb10a2unorm:{channels:"rgba",bitsPerChannel:[10,10,10,2],packed:!0,p:1},"rgb10a2uint-webgl":{channels:"rgba",bitsPerChannel:[10,10,10,2],packed:!0,p:1,wgpu:!1},"rgb16unorm-webgl":{f:k},"rgb16snorm-webgl":{f:k},rg32uint:{},rg32sint:{},rg32float:{render:!1,filter:pe},rgba16uint:{},rgba16sint:{},rgba16float:{render:Be,filter:ct},"rgba16unorm-webgl":{render:k},"rgba16snorm-webgl":{render:Re},"rgb32float-webgl":{render:he,filter:pe},rgba32uint:{},rgba32sint:{},rgba32float:{render:he,filter:pe},stencil8:{attachment:"stencil",bitsPerChannel:[8,0,0,0],dataType:"uint8"},depth16unorm:{attachment:"depth",bitsPerChannel:[16,0,0,0],dataType:"uint16"},depth24plus:{attachment:"depth",bitsPerChannel:[24,0,0,0],dataType:"uint32"},depth32float:{attachment:"depth",bitsPerChannel:[32,0,0,0],dataType:"float32"},"depth24plus-stencil8":{attachment:"depth-stencil",bitsPerChannel:[24,8,0,0],packed:!0},"depth32float-stencil8":{attachment:"depth-stencil",bitsPerChannel:[32,8,0,0],packed:!0},"bc1-rgb-unorm-webgl":{f:p},"bc1-rgb-unorm-srgb-webgl":{f:p},"bc1-rgba-unorm":{f:p},"bc1-rgba-unorm-srgb":{f:p},"bc2-rgba-unorm":{f:p},"bc2-rgba-unorm-srgb":{f:p},"bc3-rgba-unorm":{f:p},"bc3-rgba-unorm-srgb":{f:p},"bc4-r-unorm":{f:p},"bc4-r-snorm":{f:p},"bc5-rg-unorm":{f:p},"bc5-rg-snorm":{f:p},"bc6h-rgb-ufloat":{f:p},"bc6h-rgb-float":{f:p},"bc7-rgba-unorm":{f:p},"bc7-rgba-unorm-srgb":{f:p},"etc2-rgb8unorm":{f:w},"etc2-rgb8unorm-srgb":{f:w},"etc2-rgb8a1unorm":{f:w},"etc2-rgb8a1unorm-srgb":{f:w},"etc2-rgba8unorm":{f:w},"etc2-rgba8unorm-srgb":{f:w},"eac-r11unorm":{f:w},"eac-r11snorm":{f:w},"eac-rg11unorm":{f:w},"eac-rg11snorm":{f:w},"astc-4x4-unorm":{f:d},"astc-4x4-unorm-srgb":{f:d},"astc-5x4-unorm":{f:d},"astc-5x4-unorm-srgb":{f:d},"astc-5x5-unorm":{f:d},"astc-5x5-unorm-srgb":{f:d},"astc-6x5-unorm":{f:d},"astc-6x5-unorm-srgb":{f:d},"astc-6x6-unorm":{f:d},"astc-6x6-unorm-srgb":{f:d},"astc-8x5-unorm":{f:d},"astc-8x5-unorm-srgb":{f:d},"astc-8x6-unorm":{f:d},"astc-8x6-unorm-srgb":{f:d},"astc-8x8-unorm":{f:d},"astc-8x8-unorm-srgb":{f:d},"astc-10x5-unorm":{f:d},"astc-10x5-unorm-srgb":{f:d},"astc-10x6-unorm":{f:d},"astc-10x6-unorm-srgb":{f:d},"astc-10x8-unorm":{f:d},"astc-10x8-unorm-srgb":{f:d},"astc-10x10-unorm":{f:d},"astc-10x10-unorm-srgb":{f:d},"astc-12x10-unorm":{f:d},"astc-12x10-unorm-srgb":{f:d},"astc-12x12-unorm":{f:d},"astc-12x12-unorm-srgb":{f:d},"pvrtc-rgb4unorm-webgl":{f:me},"pvrtc-rgba4unorm-webgl":{f:me},"pvrtc-rbg2unorm-webgl":{f:me},"pvrtc-rgba2unorm-webgl":{f:me},"etc1-rbg-unorm-webgl":{f:Jt},"atc-rgb-unorm-webgl":{f:Me},"atc-rgba-unorm-webgl":{f:Me},"atc-rgbai-unorm-webgl":{f:Me}};var er=["bc1","bc2","bc3","bc4","bc5","bc6","bc7","etc1","etc2","eac","atc","astc","pvrtc"],tr=/^(r|rg|rgb|rgba|bgra)([0-9]*)([a-z]*)(-srgb)?(-webgl)?$/;function De(r){return er.some(e=>r.startsWith(e))}function ge(r){let e=rr(r);if(De(r)){e.channels="rgb",e.components=3,e.bytesPerPixel=1,e.srgb=!1,e.compressed=!0;let n=nr(r);n&&(e.blockWidth=n.blockWidth,e.blockHeight=n.blockHeight)}let t=tr.exec(r);if(t){let[,n,s,o,i,c]=t,l=`${o}${s}`,b=de(l),g=b.byteLength*8,x=n.length,Mt=[g,x>=2?g:0,x>=3?g:0,x>=4?g:0];e={format:r,attachment:e.attachment,dataType:b.dataType,components:x,channels:n,integer:b.integer,signed:b.signed,normalized:b.normalized,bitsPerChannel:Mt,bytesPerPixel:b.byteLength*n.length,packed:e.packed,srgb:e.srgb},c==="-webgl"&&(e.webgl=!0),i==="-srgb"&&(e.srgb=!0)}return r.endsWith("-webgl")&&(e.webgl=!0),r.endsWith("-srgb")&&(e.srgb=!0),e}function rr(r){let e=I(r),t=e.bytesPerPixel||1,n=e.bitsPerChannel||[8,8,8,8];return delete e.bitsPerChannel,delete e.bytesPerPixel,delete e.f,delete e.render,delete e.filter,delete e.blend,delete e.store,{...e,format:r,attachment:e.attachment||"color",channels:e.channels||"r",components:e.components||e.channels?.length||1,bytesPerPixel:t,bitsPerChannel:n,dataType:e.dataType||"uint8",srgb:e.srgb??!1,packed:e.packed??!1,webgl:e.webgl??!1,integer:e.integer??!1,signed:e.signed??!1,normalized:e.normalized??!1,compressed:e.compressed??!1}}function nr(r){let t=/.*-(\d+)x(\d+)-.*/.exec(r);if(t){let[,n,s]=t;return{blockWidth:Number(n),blockHeight:Number(s)}}return null}function be(r){let e=I(r),t={format:r,create:e.f??!0,render:e.render??!0,filter:e.filter??!0,blend:e.blend??!0,store:e.store??!0},n=ge(r),s=r.startsWith("depth")||r.startsWith("stencil"),o=n?.signed,i=n?.integer,c=n?.webgl;return t.render&&=!o,t.filter&&=!s&&!o&&!i&&!c,t}var ye=class{},xe=class{features;disabledFeatures;constructor(e=[],t){this.features=new Set(e),this.disabledFeatures=t||{}}*[Symbol.iterator](){yield*this.features}has(e){return!this.disabledFeatures?.[e]&&this.features.has(e)}},Fe=class{get[Symbol.toStringTag](){return"Device"}constructor(e){this.props={...Fe.defaultProps,...e},this.id=this.props.id||v(this[Symbol.toStringTag].toLowerCase())}id;props;userData={};statsManager=ce;timestamp=0;_reused=!1;_lumaData={};getTextureFormatCapabilities(e){let t=be(e),n=i=>(typeof i=="string"?this.features.has(i):i)??!0,s=n(t.create),o={format:e,create:s,render:s&&n(t.render),filter:s&&n(t.filter),blend:s&&n(t.blend),store:s&&n(t.store)};return this._getDeviceSpecificTextureFormatCapabilities(o)}isTextureFormatSupported(e,t){return this.getTextureFormatCapabilities(e).create}isTextureFormatFilterable(e){return this.getTextureFormatCapabilities(e).filter}isTextureFormatRenderable(e){return this.getTextureFormatCapabilities(e).render}isTextureFormatCompressed(e){return De(e)}loseDevice(){return!1}reportError(e){this.props.onError(e)}getDefaultCanvasContext(){if(!this.canvasContext)throw new Error("Device has no default CanvasContext. See props.createCanvasContext");return this.canvasContext}createCommandEncoder(e={}){throw new Error("not implemented")}incrementTimestamp(){return this.timestamp++}onError(e){this.props.onError(e)}getCanvasContext(){return this.getDefaultCanvasContext()}readPixelsToArrayWebGL(e,t){throw new Error("not implemented")}readPixelsToBufferWebGL(e,t){throw new Error("not implemented")}setParametersWebGL(e){throw new Error("not implemented")}getParametersWebGL(e){throw new Error("not implemented")}withParametersWebGL(e,t){throw new Error("not implemented")}clearWebGL(e){throw new Error("not implemented")}resetWebGL(){throw new Error("not implemented")}static _getCanvasContextProps(e){return e.createCanvasContext===!0?{}:e.createCanvasContext}_normalizeBufferProps(e){(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});let t={...e};return(e.usage||0)&m.INDEX&&!e.indexType&&(e.data instanceof Uint32Array?t.indexType="uint32":e.data instanceof Uint16Array?t.indexType="uint16":f.warn("indices buffer content must be of integer type")()),t}},_=Fe;a(_,"defaultProps",{id:null,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,createCanvasContext:void 0,onError:e=>f.error(e.message)(),_reuseDevices:!1,_requestMaxLimits:!0,_factoryDestroyPolicy:"unused",_initializeFeatures:!0,_disabledFeatures:{"compilation-status-async-webgl":!0},_resourceDefaults:{},webgl:{},debug:f.get("debug")||void 0,debugShaders:f.get("debug-shaders")||void 0,debugFramebuffers:Boolean(f.get("debug-framebuffers")),debugWebGL:Boolean(f.get("debug-webgl")),debugSpectorJS:void 0,debugSpectorJSUrl:void 0,_handle:void 0});var sr=y()&&typeof document<"u",or=()=>sr&&document.readyState==="complete",ir="set luma.log.level=1 (or higher) to trace rendering",dt="No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.",R=class{stats=ce;log=f;VERSION="9.1.5";spector;preregisteredAdapters=new Map;constructor(){if(globalThis.luma){if(globalThis.luma.VERSION!==this.VERSION)throw f.error(`Found luma.gl ${globalThis.luma.VERSION} while initialzing ${this.VERSION}`)(),f.error("'yarn why @luma.gl/core' can help identify the source of the conflict")(),new Error("luma.gl - multiple versions detected: see console log");f.error("This version of luma.gl has already been initialized")()}f.log(1,`${this.VERSION} - ${ir}`)(),globalThis.luma=this}registerAdapters(e){for(let t of e)this.preregisteredAdapters.set(t.type,t)}getSupportedAdapters(e=[]){let t=this.getAdapterMap(e);return Array.from(t).map(([,n])=>n).filter(n=>n.isSupported?.()).map(n=>n.type)}getBestAvailableAdapter(e=[]){let t=this.getAdapterMap(e);return t.get("webgpu")?.isSupported?.()?"webgpu":t.get("webgl")?.isSupported?.()?"webgl":null}setDefaultDeviceProps(e){Object.assign(R.defaultProps,e)}async createDevice(e={}){e={...R.defaultProps,...e},e.waitForPageLoad&&await R.pageLoaded;let t=this.getAdapterMap(e.adapters),n=e.type||"";n==="best-available"&&(n=this.getBestAvailableAdapter(e.adapters)||n);let i=await(this.getAdapterMap(e.adapters)||t).get(n)?.create?.(e);if(i)return i;throw new Error(dt)}async attachDevice(e){let t=this.getAdapterMap(e.adapters),n="";e.handle instanceof WebGL2RenderingContext&&(n="webgl"),e.createCanvasContext&&await R.pageLoaded,e.handle===null&&(n="unknown");let o=await t.get(n)?.attach?.(null);if(o)return o;throw new Error(dt)}enforceWebGL2(e=!0,t=[]){let s=this.getAdapterMap(t).get("webgl");s||f.warn("enforceWebGL2: webgl adapter not found")(),s?.enforceWebGL2?.(e)}getAdapterMap(e=[]){let t=new Map(this.preregisteredAdapters);for(let n of e)t.set(n.type,n);return t}registerDevices(e){f.warn("luma.registerDevices() is deprecated, use luma.registerAdapters() instead");for(let t of e){let n=t.adapter;n&&this.preregisteredAdapters.set(n.type,n)}}},G=R;a(G,"defaultProps",{..._.defaultProps,type:"best-available",adapters:void 0,waitForPageLoad:!0}),a(G,"pageLoaded",ar().then(()=>{f.probe(2,"DOM is loaded")()}));var mt=new G;function ar(){return or()||typeof window>"u"?Promise.resolve():new Promise(r=>{window.addEventListener("load",()=>r())})}var we=class{};var $e=class{id;props;canvas;htmlCanvas;offscreenCanvas;type;width=1;height=1;resizeObserver;_canvasSizeInfo={clientWidth:0,clientHeight:0,devicePixelRatio:1};toString(){return`${this[Symbol.toStringTag]}(${this.id})`}constructor(e){if(this.props={...$e.defaultProps,...e},e=this.props,!y()){this.id="node-canvas-context",this.type="node",this.width=this.props.width,this.height=this.props.height,this.canvas=null;return}if(e.canvas)typeof e.canvas=="string"?this.canvas=cr(e.canvas):this.canvas=e.canvas;else{let t=fr(e),n=ur(e?.container||null);n.insertBefore(t,n.firstChild),this.canvas=t,e?.visible||(this.canvas.style.visibility="hidden")}this.canvas instanceof HTMLCanvasElement?(this.id=this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):(this.id="offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas),this.canvas instanceof HTMLCanvasElement&&e.autoResize&&(this.resizeObserver=new ResizeObserver(t=>{for(let n of t)n.target===this.canvas&&this.update()}),this.resizeObserver.observe(this.canvas))}getDevicePixelRatio(e){return typeof OffscreenCanvas<"u"&&this.canvas instanceof OffscreenCanvas||(e=e===void 0?this.props.useDevicePixels:e,!e||e<=0)?1:e===!0?typeof window<"u"&&window.devicePixelRatio||1:e}getPixelSize(){switch(this.type){case"node":return[this.width,this.height];case"offscreen-canvas":return[this.canvas.width,this.canvas.height];case"html-canvas":let e=this.getDevicePixelRatio(),t=this.canvas;return t.parentElement?[t.clientWidth*e,t.clientHeight*e]:[this.canvas.width,this.canvas.height];default:throw new Error(this.type)}}getAspect(){let[e,t]=this.getPixelSize();return e/t}cssToDeviceRatio(){try{let[e]=this.getDrawingBufferSize(),t=this._canvasSizeInfo.clientWidth||this.htmlCanvas?.clientWidth;return t?e/t:1}catch{return 1}}cssToDevicePixels(e,t=!0){let n=this.cssToDeviceRatio(),[s,o]=this.getDrawingBufferSize();return lr(e,n,s,o,t)}setDevicePixelRatio(e,t={}){if(!this.htmlCanvas)return;let n="width"in t?t.width:this.htmlCanvas.clientWidth,s="height"in t?t.height:this.htmlCanvas.clientHeight;(!n||!s)&&(f.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,n=this.htmlCanvas.width||1,s=this.htmlCanvas.height||1);let o=this._canvasSizeInfo;if(o.clientWidth!==n||o.clientHeight!==s||o.devicePixelRatio!==e){let i=e,c=Math.floor(n*i),l=Math.floor(s*i);if(this.htmlCanvas.width=c,this.htmlCanvas.height=l,this.device.gl){let[g,x]=this.getDrawingBufferSize();(g!==c||x!==l)&&(i=Math.min(g/n,x/s),this.htmlCanvas.width=Math.floor(n*i),this.htmlCanvas.height=Math.floor(s*i),f.warn("Device pixel ratio clamped")()),this._canvasSizeInfo.clientWidth=n,this._canvasSizeInfo.clientHeight=s,this._canvasSizeInfo.devicePixelRatio=e}}}getDrawingBufferSize(){let e=this.device.gl;return e?[e.drawingBufferWidth,e.drawingBufferHeight]:this.getPixelSize()}_setAutoCreatedCanvasId(e){this.htmlCanvas?.id==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=e)}},W=$e;a(W,"defaultProps",{canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,alphaMode:"opaque",colorSpace:"srgb"});function ur(r){if(typeof r=="string"){let e=document.getElementById(r);if(!e)throw new Error(`${r} is not an HTML element`);return e}else if(r)return r;return document.body}function cr(r){let e=document.getElementById(r);if(!(e instanceof HTMLCanvasElement))throw new Error("Object is not a canvas element");return e}function fr(r){let{width:e,height:t}=r,n=document.createElement("canvas");return n.id=v("lumagl-auto-created-canvas"),n.width=e||1,n.height=t||1,n.style.width=Number.isFinite(e)?`${e}px`:"100%",n.style.height=Number.isFinite(t)?`${t}px`:"100%",n}function lr(r,e,t,n,s){let o=r,i=ht(o[0],e,t),c=pt(o[1],e,n,s),l=ht(o[0]+1,e,t),b=l===t-1?l:l-1;l=pt(o[1]+1,e,n,s);let g;return s?(l=l===0?l:l+1,g=c,c=l):g=l===n-1?l:l-1,{x:i,y:c,width:Math.max(b-i+1,1),height:Math.max(g-c+1,1)}}function ht(r,e,t){return Math.min(Math.round(r*e),t-1)}function pt(r,e,t,n){return n?Math.max(0,t-1-Math.round(r*e)):Math.min(Math.round(r*e),t-1)}var T=class extends u{get[Symbol.toStringTag](){return"Texture"}toString(){return`Texture(${this.id},${this.format},${this.width}x${this.height})`}dimension;format;width;height;depth;mipLevels;updateTimestamp;constructor(e,t){if(t=T.normalizeProps(e,t),super(e,t,T.defaultProps),this.dimension=this.props.dimension,this.format=this.props.format,this.width=this.props.width,this.height=this.props.height,this.depth=this.props.depth,this.props.width===void 0||this.props.height===void 0){let n=T.getTextureDataSize(this.props.data);this.width=n?.width||1,this.height=n?.height||1}this.props.mipmaps&&this.props.mipLevels===void 0&&(this.props.mipLevels="pyramid"),this.mipLevels=this.props.mipLevels==="pyramid"?T.getMipLevelCount(this.width,this.height):this.props.mipLevels||1,this.updateTimestamp=e.incrementTimestamp()}clone(e){return this.device.createTexture({...this.props,...e})}static isExternalImage(e){return typeof ImageData<"u"&&e instanceof ImageData||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement||typeof VideoFrame<"u"&&e instanceof VideoFrame||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas}static getExternalImageSize(e){if(typeof ImageData<"u"&&e instanceof ImageData||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas)return{width:e.width,height:e.height};if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement)return{width:e.naturalWidth,height:e.naturalHeight};if(typeof HTMLVideoElement<"u"&&e instanceof HTMLVideoElement)return{width:e.videoWidth,height:e.videoHeight};if(typeof VideoFrame<"u"&&e instanceof VideoFrame)return{width:e.displayWidth,height:e.displayHeight};throw new Error("Unknown image type")}static isTextureLevelData(e){let t=e?.data;return ArrayBuffer.isView(t)}static getTextureDataSize(e){if(!e||ArrayBuffer.isView(e))return null;if(Array.isArray(e))return T.getTextureDataSize(e[0]);if(T.isExternalImage(e))return T.getExternalImageSize(e);if(e&&typeof e=="object"&&e.constructor===Object){let n=Object.values(e)[0];return{width:n.width,height:n.height}}throw new Error("texture size deduction failed")}static normalizeTextureData(e,t){let n;return ArrayBuffer.isView(e)?n=[{data:e,width:t.width,height:t.height}]:Array.isArray(e)?n=e:n=[e],n}static getMipLevelCount(e,t){return Math.floor(Math.log2(Math.max(e,t)))+1}static getCubeFaceDepth(e){switch(e){case"+X":return 0;case"-X":return 1;case"+Y":return 2;case"-Y":return 3;case"+Z":return 4;case"-Z":return 5;default:throw new Error(e)}}static normalizeProps(e,t){let n={...t},s=e?.props?._resourceDefaults?.texture||{};Object.assign(n,s);let{width:o,height:i}=n;return typeof o=="number"&&(n.width=Math.max(1,Math.ceil(o))),typeof i=="number"&&(n.height=Math.max(1,Math.ceil(i))),n}},h=T;a(h,"COPY_SRC",1),a(h,"COPY_DST",2),a(h,"TEXTURE",4),a(h,"STORAGE",8),a(h,"RENDER_ATTACHMENT",16),a(h,"CubeFaces",["+X","-X","+Y","-Y","+Z","-Z"]),a(h,"defaultProps",{...u.defaultProps,data:null,dimension:"2d",format:"rgba8unorm",width:void 0,height:void 0,depth:1,mipmaps:!1,compressed:!1,usage:0,mipLevels:void 0,samples:void 0,sampler:{},view:void 0,flipY:void 0}),a(h,"defaultCopyExternalImageOptions",{image:void 0,sourceX:0,sourceY:0,width:void 0,height:void 0,depth:1,mipLevel:0,x:0,y:0,z:0,aspect:"all",colorSpace:"srgb",premultipliedAlpha:!1,flipY:!1});var Ne=class extends u{get[Symbol.toStringTag](){return"TextureView"}constructor(e,t){super(e,t,Ne.defaultProps)}},V=Ne;a(V,"defaultProps",{...u.defaultProps,format:void 0,dimension:void 0,aspect:"all",baseMipLevel:0,mipLevelCount:void 0,baseArrayLayer:0,arrayLayerCount:void 0});var Ue=class extends u{get[Symbol.toStringTag](){return"ExternalTexture"}constructor(e,t){super(e,t,Ue.defaultProps)}},O=Ue;a(O,"defaultProps",{...u.defaultProps,source:void 0,colorSpace:"srgb"});function bt(r,e,t){let n="",s=e.split(/\r?\n/),o=r.slice().sort((i,c)=>i.lineNum-c.lineNum);switch(t?.showSourceCode||"no"){case"all":let i=0;for(let c=1;c<=s.length;c++)for(n+=yt(s[c-1],c,t);o.length>i&&o[i].lineNum===c;){let l=o[i++];n+=gt(l,s,l.lineNum,{...t,inlineSource:!1})}return n;case"issues":case"no":for(let c of r)n+=gt(c,s,c.lineNum,{inlineSource:t?.showSourceCode!=="no"});return n}}function gt(r,e,t,n){if(n?.inlineSource){let o=dr(e,t),i=r.linePos>0?`${" ".repeat(r.linePos+5)}^^^
|
|
8
8
|
`:"";return`
|
|
9
9
|
${o}${i}${r.type.toUpperCase()}: ${r.message}
|
|
10
10
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luma.gl/effects",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.5",
|
|
4
4
|
"description": "Post-processing effects for luma.gl",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"@math.gl/types": "^4.1.0",
|
|
54
54
|
"wgsl_reflect": "^1.0.1"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "83b1bfdcca2cacd0d614982a7dd000bec80d1a6f"
|
|
57
57
|
}
|