UNPKG

typegpu

Version:

A thin layer between JS and WebGPU/WGSL that improves development experience and allows for faster iteration.

41 lines 46 kB
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7;var P="0.5.9";var r=Symbol(`typegpu:${P}:$internal`),se= exports.b =Symbol(`typegpu:${P}:$wgslDataType`),dt= exports.c =Symbol(`typegpu:${P}:$gpuValueOf`),O= exports.d =Symbol(`typegpu:${P}:$getNameForward`);function Ve(e){return!!_optionalChain([e, 'optionalAccess', _2 => _2[O]])}function C(e){return Ve(e)?C(e[O]):_optionalChain([ve, 'call', _3 => _3(e), 'optionalAccess', _4 => _4.name])}function ie(e,t){_e(e,{name:t})}function gt(e){return!!_optionalChain([e, 'optionalAccess', _5 => _5.$name])}function ve(e){return globalThis.__TYPEGPU_META__.get(e)}function _e(e,t){globalThis.__TYPEGPU_META__??=new WeakMap;let n=globalThis.__TYPEGPU_META__;n.set(e,{...n.get(e),...t})}var K="Invariant failed";function Y(e,t){if(e)return;throw new Error(K)}var ae=class e extends Error{constructor(n,a){let s=a.map(i=>`- ${i}`);s.length>20&&(s=[...s.slice(0,11),"...",...s.slice(-10)]);super(`Resolution of the following tree failed: ${s.join(` `)}: ${n&&typeof n=="object"&&"message"in n?n.message:n}`);this.cause=n;this.trace=a;Object.setPrototypeOf(this,e.prototype)}appendToTrace(n){let a=[n,...this.trace];return new e(this.cause,a)}},oe= exports.l =class e extends Error{constructor(n){super(`Missing value for '${n}'`);this.slot=n;Object.setPrototypeOf(this,e.prototype)}},he= exports.m =class e extends Error{constructor(t){super(`Buffer '${_nullishCoalesce(C(t), () => ("<unnamed>"))}' is not bindable as a uniform. Use .$usage('uniform') to allow it.`),Object.setPrototypeOf(this,e.prototype)}},ue= exports.n =class e extends Error{constructor(t,n){super(`The function '${_nullishCoalesce(t, () => ("<unnamed>"))}' is missing links to the following external values: ${n}.`),Object.setPrototypeOf(this,e.prototype)}},ye= exports.o =class e extends Error{constructor(t){super(`Missing bind groups for layouts: '${[...t].map(n=>_nullishCoalesce(C(n), () => ("<unnamed>"))).join(", ")}'. Please provide it using pipeline.with(layout, bindGroup).(...)`),Object.setPrototypeOf(this,e.prototype)}},ce= exports.p =class e extends Error{constructor(t){super(`Missing vertex buffers for layouts: '${[...t].map(n=>_nullishCoalesce(C(n), () => ("<unnamed>"))).join(", ")}'. Please provide it using pipeline.with(layout, buffer).(...)`),Object.setPrototypeOf(this,e.prototype)}};var d=Symbol("Type token for the inferred (CPU & GPU) representation of a resource");function _t(e){return!!_optionalChain([e, 'optionalAccess', _6 => _6[se]])}var At={[r]:!0,type:"void",[d]:void 0},Ae=["bool","f32","f16","i32","u32","vec2f","vec2h","vec2i","vec2u","vec2<bool>","vec3f","vec3h","vec3i","vec3u","vec3<bool>","vec4f","vec4h","vec4i","vec4u","vec4<bool>","mat2x2f","mat3x3f","mat4x4f","struct","array","ptr","atomic","decorated","abstractInt","abstractFloat","void"];function Ie(e){let t=e;return!!_optionalChain([t, 'optionalAccess', _7 => _7[r]])&&typeof _optionalChain([t, 'access', _8 => _8.kind, 'optionalAccess', _9 => _9.startsWith])=="function"&&t.kind.startsWith("vec")}function $e(e){let t=e;return!!_optionalChain([t, 'optionalAccess', _10 => _10[r]])&&typeof _optionalChain([t, 'access', _11 => _11.type, 'optionalAccess', _12 => _12.startsWith])=="function"&&_optionalChain([t, 'access', _13 => _13.type, 'access', _14 => _14.startsWith, 'optionalCall', _15 => _15("vec2")])}function ke(e){let t=e;return!!_optionalChain([t, 'optionalAccess', _16 => _16[r]])&&typeof _optionalChain([t, 'access', _17 => _17.type, 'optionalAccess', _18 => _18.startsWith])=="function"&&t.type.startsWith("vec3")}function Se(e){let t=e;return!!_optionalChain([t, 'optionalAccess', _19 => _19[r]])&&typeof _optionalChain([t, 'access', _20 => _20.type, 'optionalAccess', _21 => _21.startsWith])=="function"&&t.type.startsWith("vec4")}function le(e){return $e(e)||ke(e)||Se(e)}function It(e){let t=e;return!!_optionalChain([t, 'optionalAccess', _22 => _22[r]])&&typeof _optionalChain([t, 'access', _23 => _23.kind, 'optionalAccess', _24 => _24.startsWith])=="function"&&t.kind.startsWith("mat")}function De(e){return _optionalChain([e, 'optionalAccess', _25 => _25[r]])&&_optionalChain([e, 'optionalAccess', _26 => _26.type])==="mat2x2f"}function Pe(e){return _optionalChain([e, 'optionalAccess', _27 => _27[r]])&&_optionalChain([e, 'optionalAccess', _28 => _28.type])==="mat3x3f"}function Ce(e){return _optionalChain([e, 'optionalAccess', _29 => _29[r]])&&_optionalChain([e, 'optionalAccess', _30 => _30.type])==="mat4x4f"}function $t(e){return De(e)||Pe(e)||Ce(e)}function kt(e){return Ie(e)&&["vec2f","vec3f","vec4f"].includes(e.kind)}function xe(e){return _optionalChain([e, 'optionalAccess', _31 => _31[r]])&&Ae.includes(_optionalChain([e, 'optionalAccess', _32 => _32.type]))}function St(e){return _optionalChain([e, 'optionalAccess', _33 => _33[r]])&&_optionalChain([e, 'optionalAccess', _34 => _34.type])==="array"}function Dt(e){return _optionalChain([e, 'optionalAccess', _35 => _35[r]])&&_optionalChain([e, 'optionalAccess', _36 => _36.type])==="struct"}function Pt(e){return _optionalChain([e, 'optionalAccess', _37 => _37[r]])&&_optionalChain([e, 'optionalAccess', _38 => _38.type])==="ptr"}function Ct(e){return _optionalChain([e, 'optionalAccess', _39 => _39[r]])&&_optionalChain([e, 'optionalAccess', _40 => _40.type])==="atomic"}function we(e){return _optionalChain([e, 'optionalAccess', _41 => _41[r]])&&_optionalChain([e, 'optionalAccess', _42 => _42.type])==="@align"}function de(e){return _optionalChain([e, 'optionalAccess', _43 => _43[r]])&&_optionalChain([e, 'optionalAccess', _44 => _44.type])==="@size"}function pe(e){return _optionalChain([e, 'optionalAccess', _45 => _45[r]])&&_optionalChain([e, 'optionalAccess', _46 => _46.type])==="@location"}function Ft(e){return _optionalChain([e, 'optionalAccess', _47 => _47[r]])&&_optionalChain([e, 'optionalAccess', _48 => _48.type])==="@interpolate"}function Mt(e){return _optionalChain([e, 'optionalAccess', _49 => _49[r]])&&_optionalChain([e, 'optionalAccess', _50 => _50.type])==="@builtin"}function me(e){return _optionalChain([e, 'optionalAccess', _51 => _51[r]])&&_optionalChain([e, 'optionalAccess', _52 => _52.type])==="decorated"}function Nt(e){return _optionalChain([e, 'optionalAccess', _53 => _53[r]])&&e.type==="void"}var ge=["uint8","uint8x2","uint8x4","sint8","sint8x2","sint8x4","unorm8","unorm8x2","unorm8x4","snorm8","snorm8x2","snorm8x4","uint16","uint16x2","uint16x4","sint16","sint16x2","sint16x4","unorm16","unorm16x2","unorm16x4","snorm16","snorm16x2","snorm16x4","float16","float16x2","float16x4","float32","float32x2","float32x3","float32x4","uint32","uint32x2","uint32x3","uint32x4","sint32","sint32x2","sint32x3","sint32x4","unorm10-10-10-2","unorm8x4-bgra"],Ut= exports.x ={f32:"float32",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",f16:"float16",vec2h:"float16x2",vec4h:"float16x4",u32:"uint32",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",i32:"sint32",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4"};var Me=["unstruct","disarray","loose-decorated",...ge];function Ne(e){return _optionalChain([e, 'optionalAccess', _54 => _54[r]])&&Me.includes(_optionalChain([e, 'optionalAccess', _55 => _55.type]))}function Lt(e){return _optionalChain([e, 'optionalAccess', _56 => _56[r]])&&_optionalChain([e, 'optionalAccess', _57 => _57.type])==="disarray"}function jt(e){return _optionalChain([e, 'optionalAccess', _58 => _58[r]])&&_optionalChain([e, 'optionalAccess', _59 => _59.type])==="unstruct"}function Gt(e){return _optionalChain([e, 'optionalAccess', _60 => _60[r]])&&_optionalChain([e, 'optionalAccess', _61 => _61.type])==="loose-decorated"}function Et(e){return _optionalChain([e, 'access', _62 => _62.attribs, 'optionalAccess', _63 => _63.find, 'call', _64 => _64(we), 'optionalAccess', _65 => _65.value])}function Ot(e){return _optionalChain([e, 'access', _66 => _66.attribs, 'optionalAccess', _67 => _67.find, 'call', _68 => _68(de), 'optionalAccess', _69 => _69.value])}function Kt(e){return _optionalChain([e, 'access', _70 => _70.attribs, 'optionalAccess', _71 => _71.find, 'call', _72 => _72(pe), 'optionalAccess', _73 => _73.value])}function Yt(e){return xe(e)||Ne(e)}var Ht={type:"unknown",toString(){return"unknown"}},W=class{constructor(t,n){this.value=t;this.dataType=n}};function y(e,t){return new W(e,t.type==="decorated"||t.type==="loose-decorated"?t.inner:t)}function Xt(e){return e instanceof W}var _typedbinary = require('typed-binary'); var _typedbinary2 = _interopRequireDefault(_typedbinary);var L=null,Ue=Symbol("CPU"),Be=Symbol("GPU"),Re= exports.q ={CPU:Ue,GPU:Be},F=[];function qt(e,t){Y(L===null,"Cannot nest context providers"),L=e;try{return t()}finally{L=null}}function Qt(){return L}function en(e){F.push(e)}function tn(e){let t=F.pop();e!==void 0&&Y(t===e,"Unexpected mode")}var fe=()=>F.length>0&&F[F.length-1]===Re.GPU;function*on(e){let t=0;for(;;)e.has(t)||(yield t),t++}function o(e,t,n,a){let s=(...i)=>fe()?t(...i):e(...i);return s[r]={implementation:e,argTypes:a},ie(s,n),s}var xn={[r]:!0,type:"abstractInt"},wn= exports.ia ={[r]:!0,type:"abstractFloat"},G= exports.ja ={[r]:!0,type:"bool"},We=o(e=>typeof e=="boolean"?e?1:0:Number.isInteger(e)?((e<0||e>4294967295)&&console.warn(`u32 value ${e} overflowed`),(e&4294967295)>>>0):Math.max(0,Math.min(4294967295,Math.floor(e))),e=>y(`u32(${e.value})`,M),"u32Cast"),M= exports.ka =Object.assign(We,{type:"u32"}),Le=o(e=>{if(typeof e=="boolean")return e?1:0;if(Number.isInteger(e))return(e<-2147483648||e>2147483647)&&console.warn(`i32 value ${e} overflowed`),(e|0)&4294967295;let t=e<0?Math.ceil(e):Math.floor(e);return Math.max(-2147483648,Math.min(2147483647,t))},e=>y(`i32(${e.value})`,N),"i32Cast"),N= exports.la =Object.assign(Le,{type:"i32"}),je=o(e=>{if(typeof e=="boolean")return e?1:0;let t=new Float32Array(1);return t[0]=e,t[0]},e=>y(`f32(${e.value})`,U),"f32Cast"),U= exports.ma =Object.assign(je,{type:"f32"}),Ge=o(e=>{if(typeof e=="boolean")return e?1:0;let t=new ArrayBuffer(2);return _typedbinary2.default.f16.write(new _typedbinary2.default.BufferWriter(t),e),_typedbinary2.default.f16.read(new _typedbinary2.default.BufferReader(t))},e=>y(`f16(${e.value})`,B),"f16Cast"),B= exports.na =Object.assign(Ge,{type:"f16"});var R= (_class =class extends Array{constructor(...args) { super(...args); _class.prototype.__init.call(this); }__init() {this[r]=!0}"~resolve"(){return`${this.kind}(${this.join(", ")})`}toString(){return this["~resolve"]()}get xx(){return new this._Vec2(this[0],this[0])}get xy(){return new this._Vec2(this[0],this[1])}get xz(){return new this._Vec2(this[0],this[2])}get xw(){return new this._Vec2(this[0],this[3])}get yx(){return new this._Vec2(this[1],this[0])}get yy(){return new this._Vec2(this[1],this[1])}get yz(){return new this._Vec2(this[1],this[2])}get yw(){return new this._Vec2(this[1],this[3])}get zx(){return new this._Vec2(this[2],this[0])}get zy(){return new this._Vec2(this[2],this[1])}get zz(){return new this._Vec2(this[2],this[2])}get zw(){return new this._Vec2(this[2],this[3])}get wx(){return new this._Vec2(this[3],this[0])}get wy(){return new this._Vec2(this[3],this[1])}get wz(){return new this._Vec2(this[3],this[2])}get ww(){return new this._Vec2(this[3],this[3])}get xxx(){return new this._Vec3(this[0],this[0],this[0])}get xxy(){return new this._Vec3(this[0],this[0],this[1])}get xxz(){return new this._Vec3(this[0],this[0],this[2])}get xxw(){return new this._Vec3(this[0],this[0],this[3])}get xyx(){return new this._Vec3(this[0],this[1],this[0])}get xyy(){return new this._Vec3(this[0],this[1],this[1])}get xyz(){return new this._Vec3(this[0],this[1],this[2])}get xyw(){return new this._Vec3(this[0],this[1],this[3])}get xzx(){return new this._Vec3(this[0],this[2],this[0])}get xzy(){return new this._Vec3(this[0],this[2],this[1])}get xzz(){return new this._Vec3(this[0],this[2],this[2])}get xzw(){return new this._Vec3(this[0],this[2],this[3])}get xwx(){return new this._Vec3(this[0],this[3],this[0])}get xwy(){return new this._Vec3(this[0],this[3],this[1])}get xwz(){return new this._Vec3(this[0],this[3],this[2])}get xww(){return new this._Vec3(this[0],this[3],this[3])}get yxx(){return new this._Vec3(this[1],this[0],this[0])}get yxy(){return new this._Vec3(this[1],this[0],this[1])}get yxz(){return new this._Vec3(this[1],this[0],this[2])}get yxw(){return new this._Vec3(this[1],this[0],this[3])}get yyx(){return new this._Vec3(this[1],this[1],this[0])}get yyy(){return new this._Vec3(this[1],this[1],this[1])}get yyz(){return new this._Vec3(this[1],this[1],this[2])}get yyw(){return new this._Vec3(this[1],this[1],this[3])}get yzx(){return new this._Vec3(this[1],this[2],this[0])}get yzy(){return new this._Vec3(this[1],this[2],this[1])}get yzz(){return new this._Vec3(this[1],this[2],this[2])}get yzw(){return new this._Vec3(this[1],this[2],this[3])}get ywx(){return new this._Vec3(this[1],this[3],this[0])}get ywy(){return new this._Vec3(this[1],this[3],this[1])}get ywz(){return new this._Vec3(this[1],this[3],this[2])}get yww(){return new this._Vec3(this[1],this[3],this[3])}get zxx(){return new this._Vec3(this[2],this[0],this[0])}get zxy(){return new this._Vec3(this[2],this[0],this[1])}get zxz(){return new this._Vec3(this[2],this[0],this[2])}get zxw(){return new this._Vec3(this[2],this[0],this[3])}get zyx(){return new this._Vec3(this[2],this[1],this[0])}get zyy(){return new this._Vec3(this[2],this[1],this[1])}get zyz(){return new this._Vec3(this[2],this[1],this[2])}get zyw(){return new this._Vec3(this[2],this[1],this[3])}get zzx(){return new this._Vec3(this[2],this[2],this[0])}get zzy(){return new this._Vec3(this[2],this[2],this[1])}get zzz(){return new this._Vec3(this[2],this[2],this[2])}get zzw(){return new this._Vec3(this[2],this[2],this[3])}get zwx(){return new this._Vec3(this[2],this[3],this[0])}get zwy(){return new this._Vec3(this[2],this[3],this[1])}get zwz(){return new this._Vec3(this[2],this[3],this[2])}get zww(){return new this._Vec3(this[2],this[3],this[3])}get wxx(){return new this._Vec3(this[3],this[0],this[0])}get wxy(){return new this._Vec3(this[3],this[0],this[1])}get wxz(){return new this._Vec3(this[3],this[0],this[2])}get wxw(){return new this._Vec3(this[3],this[0],this[3])}get wyx(){return new this._Vec3(this[3],this[1],this[0])}get wyy(){return new this._Vec3(this[3],this[1],this[1])}get wyz(){return new this._Vec3(this[3],this[1],this[2])}get wyw(){return new this._Vec3(this[3],this[1],this[3])}get wzx(){return new this._Vec3(this[3],this[2],this[0])}get wzy(){return new this._Vec3(this[3],this[2],this[1])}get wzz(){return new this._Vec3(this[3],this[2],this[2])}get wzw(){return new this._Vec3(this[3],this[2],this[3])}get wwx(){return new this._Vec3(this[3],this[3],this[0])}get wwy(){return new this._Vec3(this[3],this[3],this[1])}get wwz(){return new this._Vec3(this[3],this[3],this[2])}get www(){return new this._Vec3(this[3],this[3],this[3])}get xxxx(){return new this._Vec4(this[0],this[0],this[0],this[0])}get xxxy(){return new this._Vec4(this[0],this[0],this[0],this[1])}get xxxz(){return new this._Vec4(this[0],this[0],this[0],this[2])}get xxxw(){return new this._Vec4(this[0],this[0],this[0],this[3])}get xxyx(){return new this._Vec4(this[0],this[0],this[1],this[0])}get xxyy(){return new this._Vec4(this[0],this[0],this[1],this[1])}get xxyz(){return new this._Vec4(this[0],this[0],this[1],this[2])}get xxyw(){return new this._Vec4(this[0],this[0],this[1],this[3])}get xxzx(){return new this._Vec4(this[0],this[0],this[2],this[0])}get xxzy(){return new this._Vec4(this[0],this[0],this[2],this[1])}get xxzz(){return new this._Vec4(this[0],this[0],this[2],this[2])}get xxzw(){return new this._Vec4(this[0],this[0],this[2],this[3])}get xxwx(){return new this._Vec4(this[0],this[0],this[3],this[0])}get xxwy(){return new this._Vec4(this[0],this[0],this[3],this[1])}get xxwz(){return new this._Vec4(this[0],this[0],this[3],this[2])}get xxww(){return new this._Vec4(this[0],this[0],this[3],this[3])}get xyxx(){return new this._Vec4(this[0],this[1],this[0],this[0])}get xyxy(){return new this._Vec4(this[0],this[1],this[0],this[1])}get xyxz(){return new this._Vec4(this[0],this[1],this[0],this[2])}get xyxw(){return new this._Vec4(this[0],this[1],this[0],this[3])}get xyyx(){return new this._Vec4(this[0],this[1],this[1],this[0])}get xyyy(){return new this._Vec4(this[0],this[1],this[1],this[1])}get xyyz(){return new this._Vec4(this[0],this[1],this[1],this[2])}get xyyw(){return new this._Vec4(this[0],this[1],this[1],this[3])}get xyzx(){return new this._Vec4(this[0],this[1],this[2],this[0])}get xyzy(){return new this._Vec4(this[0],this[1],this[2],this[1])}get xyzz(){return new this._Vec4(this[0],this[1],this[2],this[2])}get xyzw(){return new this._Vec4(this[0],this[1],this[2],this[3])}get xywx(){return new this._Vec4(this[0],this[1],this[3],this[0])}get xywy(){return new this._Vec4(this[0],this[1],this[3],this[1])}get xywz(){return new this._Vec4(this[0],this[1],this[3],this[2])}get xyww(){return new this._Vec4(this[0],this[1],this[3],this[3])}get xzxx(){return new this._Vec4(this[0],this[2],this[0],this[0])}get xzxy(){return new this._Vec4(this[0],this[2],this[0],this[1])}get xzxz(){return new this._Vec4(this[0],this[2],this[0],this[2])}get xzxw(){return new this._Vec4(this[0],this[2],this[0],this[3])}get xzyx(){return new this._Vec4(this[0],this[2],this[1],this[0])}get xzyy(){return new this._Vec4(this[0],this[2],this[1],this[1])}get xzyz(){return new this._Vec4(this[0],this[2],this[1],this[2])}get xzyw(){return new this._Vec4(this[0],this[2],this[1],this[3])}get xzzx(){return new this._Vec4(this[0],this[2],this[2],this[0])}get xzzy(){return new this._Vec4(this[0],this[2],this[2],this[1])}get xzzz(){return new this._Vec4(this[0],this[2],this[2],this[2])}get xzzw(){return new this._Vec4(this[0],this[2],this[2],this[3])}get xzwx(){return new this._Vec4(this[0],this[2],this[3],this[0])}get xzwy(){return new this._Vec4(this[0],this[2],this[3],this[1])}get xzwz(){return new this._Vec4(this[0],this[2],this[3],this[2])}get xzww(){return new this._Vec4(this[0],this[2],this[3],this[3])}get xwxx(){return new this._Vec4(this[0],this[3],this[0],this[0])}get xwxy(){return new this._Vec4(this[0],this[3],this[0],this[1])}get xwxz(){return new this._Vec4(this[0],this[3],this[0],this[2])}get xwxw(){return new this._Vec4(this[0],this[3],this[0],this[3])}get xwyx(){return new this._Vec4(this[0],this[3],this[1],this[0])}get xwyy(){return new this._Vec4(this[0],this[3],this[1],this[1])}get xwyz(){return new this._Vec4(this[0],this[3],this[1],this[2])}get xwyw(){return new this._Vec4(this[0],this[3],this[1],this[3])}get xwzx(){return new this._Vec4(this[0],this[3],this[2],this[0])}get xwzy(){return new this._Vec4(this[0],this[3],this[2],this[1])}get xwzz(){return new this._Vec4(this[0],this[3],this[2],this[2])}get xwzw(){return new this._Vec4(this[0],this[3],this[2],this[3])}get xwwx(){return new this._Vec4(this[0],this[3],this[3],this[0])}get xwwy(){return new this._Vec4(this[0],this[3],this[3],this[1])}get xwwz(){return new this._Vec4(this[0],this[3],this[3],this[2])}get xwww(){return new this._Vec4(this[0],this[3],this[3],this[3])}get yxxx(){return new this._Vec4(this[1],this[0],this[0],this[0])}get yxxy(){return new this._Vec4(this[1],this[0],this[0],this[1])}get yxxz(){return new this._Vec4(this[1],this[0],this[0],this[2])}get yxxw(){return new this._Vec4(this[1],this[0],this[0],this[3])}get yxyx(){return new this._Vec4(this[1],this[0],this[1],this[0])}get yxyy(){return new this._Vec4(this[1],this[0],this[1],this[1])}get yxyz(){return new this._Vec4(this[1],this[0],this[1],this[2])}get yxyw(){return new this._Vec4(this[1],this[0],this[1],this[3])}get yxzx(){return new this._Vec4(this[1],this[0],this[2],this[0])}get yxzy(){return new this._Vec4(this[1],this[0],this[2],this[1])}get yxzz(){return new this._Vec4(this[1],this[0],this[2],this[2])}get yxzw(){return new this._Vec4(this[1],this[0],this[2],this[3])}get yxwx(){return new this._Vec4(this[1],this[0],this[3],this[0])}get yxwy(){return new this._Vec4(this[1],this[0],this[3],this[1])}get yxwz(){return new this._Vec4(this[1],this[0],this[3],this[2])}get yxww(){return new this._Vec4(this[1],this[0],this[3],this[3])}get yyxx(){return new this._Vec4(this[1],this[1],this[0],this[0])}get yyxy(){return new this._Vec4(this[1],this[1],this[0],this[1])}get yyxz(){return new this._Vec4(this[1],this[1],this[0],this[2])}get yyxw(){return new this._Vec4(this[1],this[1],this[0],this[3])}get yyyx(){return new this._Vec4(this[1],this[1],this[1],this[0])}get yyyy(){return new this._Vec4(this[1],this[1],this[1],this[1])}get yyyz(){return new this._Vec4(this[1],this[1],this[1],this[2])}get yyyw(){return new this._Vec4(this[1],this[1],this[1],this[3])}get yyzx(){return new this._Vec4(this[1],this[1],this[2],this[0])}get yyzy(){return new this._Vec4(this[1],this[1],this[2],this[1])}get yyzz(){return new this._Vec4(this[1],this[1],this[2],this[2])}get yyzw(){return new this._Vec4(this[1],this[1],this[2],this[3])}get yywx(){return new this._Vec4(this[1],this[1],this[3],this[0])}get yywy(){return new this._Vec4(this[1],this[1],this[3],this[1])}get yywz(){return new this._Vec4(this[1],this[1],this[3],this[2])}get yyww(){return new this._Vec4(this[1],this[1],this[3],this[3])}get yzxx(){return new this._Vec4(this[1],this[2],this[0],this[0])}get yzxy(){return new this._Vec4(this[1],this[2],this[0],this[1])}get yzxz(){return new this._Vec4(this[1],this[2],this[0],this[2])}get yzxw(){return new this._Vec4(this[1],this[2],this[0],this[3])}get yzyx(){return new this._Vec4(this[1],this[2],this[1],this[0])}get yzyy(){return new this._Vec4(this[1],this[2],this[1],this[1])}get yzyz(){return new this._Vec4(this[1],this[2],this[1],this[2])}get yzyw(){return new this._Vec4(this[1],this[2],this[1],this[3])}get yzzx(){return new this._Vec4(this[1],this[2],this[2],this[0])}get yzzy(){return new this._Vec4(this[1],this[2],this[2],this[1])}get yzzz(){return new this._Vec4(this[1],this[2],this[2],this[2])}get yzzw(){return new this._Vec4(this[1],this[2],this[2],this[3])}get yzwx(){return new this._Vec4(this[1],this[2],this[3],this[0])}get yzwy(){return new this._Vec4(this[1],this[2],this[3],this[1])}get yzwz(){return new this._Vec4(this[1],this[2],this[3],this[2])}get yzww(){return new this._Vec4(this[1],this[2],this[3],this[3])}get ywxx(){return new this._Vec4(this[1],this[3],this[0],this[0])}get ywxy(){return new this._Vec4(this[1],this[3],this[0],this[1])}get ywxz(){return new this._Vec4(this[1],this[3],this[0],this[2])}get ywxw(){return new this._Vec4(this[1],this[3],this[0],this[3])}get ywyx(){return new this._Vec4(this[1],this[3],this[1],this[0])}get ywyy(){return new this._Vec4(this[1],this[3],this[1],this[1])}get ywyz(){return new this._Vec4(this[1],this[3],this[1],this[2])}get ywyw(){return new this._Vec4(this[1],this[3],this[1],this[3])}get ywzx(){return new this._Vec4(this[1],this[3],this[2],this[0])}get ywzy(){return new this._Vec4(this[1],this[3],this[2],this[1])}get ywzz(){return new this._Vec4(this[1],this[3],this[2],this[2])}get ywzw(){return new this._Vec4(this[1],this[3],this[2],this[3])}get ywwx(){return new this._Vec4(this[1],this[3],this[3],this[0])}get ywwy(){return new this._Vec4(this[1],this[3],this[3],this[1])}get ywwz(){return new this._Vec4(this[1],this[3],this[3],this[2])}get ywww(){return new this._Vec4(this[1],this[3],this[3],this[3])}get zxxx(){return new this._Vec4(this[2],this[0],this[0],this[0])}get zxxy(){return new this._Vec4(this[2],this[0],this[0],this[1])}get zxxz(){return new this._Vec4(this[2],this[0],this[0],this[2])}get zxxw(){return new this._Vec4(this[2],this[0],this[0],this[3])}get zxyx(){return new this._Vec4(this[2],this[0],this[1],this[0])}get zxyy(){return new this._Vec4(this[2],this[0],this[1],this[1])}get zxyz(){return new this._Vec4(this[2],this[0],this[1],this[2])}get zxyw(){return new this._Vec4(this[2],this[0],this[1],this[3])}get zxzx(){return new this._Vec4(this[2],this[0],this[2],this[0])}get zxzy(){return new this._Vec4(this[2],this[0],this[2],this[1])}get zxzz(){return new this._Vec4(this[2],this[0],this[2],this[2])}get zxzw(){return new this._Vec4(this[2],this[0],this[2],this[3])}get zxwx(){return new this._Vec4(this[2],this[0],this[3],this[0])}get zxwy(){return new this._Vec4(this[2],this[0],this[3],this[1])}get zxwz(){return new this._Vec4(this[2],this[0],this[3],this[2])}get zxww(){return new this._Vec4(this[2],this[0],this[3],this[3])}get zyxx(){return new this._Vec4(this[2],this[1],this[0],this[0])}get zyxy(){return new this._Vec4(this[2],this[1],this[0],this[1])}get zyxz(){return new this._Vec4(this[2],this[1],this[0],this[2])}get zyxw(){return new this._Vec4(this[2],this[1],this[0],this[3])}get zyyx(){return new this._Vec4(this[2],this[1],this[1],this[0])}get zyyy(){return new this._Vec4(this[2],this[1],this[1],this[1])}get zyyz(){return new this._Vec4(this[2],this[1],this[1],this[2])}get zyyw(){return new this._Vec4(this[2],this[1],this[1],this[3])}get zyzx(){return new this._Vec4(this[2],this[1],this[2],this[0])}get zyzy(){return new this._Vec4(this[2],this[1],this[2],this[1])}get zyzz(){return new this._Vec4(this[2],this[1],this[2],this[2])}get zyzw(){return new this._Vec4(this[2],this[1],this[2],this[3])}get zywx(){return new this._Vec4(this[2],this[1],this[3],this[0])}get zywy(){return new this._Vec4(this[2],this[1],this[3],this[1])}get zywz(){return new this._Vec4(this[2],this[1],this[3],this[2])}get zyww(){return new this._Vec4(this[2],this[1],this[3],this[3])}get zzxx(){return new this._Vec4(this[2],this[2],this[0],this[0])}get zzxy(){return new this._Vec4(this[2],this[2],this[0],this[1])}get zzxz(){return new this._Vec4(this[2],this[2],this[0],this[2])}get zzxw(){return new this._Vec4(this[2],this[2],this[0],this[3])}get zzyx(){return new this._Vec4(this[2],this[2],this[1],this[0])}get zzyy(){return new this._Vec4(this[2],this[2],this[1],this[1])}get zzyz(){return new this._Vec4(this[2],this[2],this[1],this[2])}get zzyw(){return new this._Vec4(this[2],this[2],this[1],this[3])}get zzzx(){return new this._Vec4(this[2],this[2],this[2],this[0])}get zzzy(){return new this._Vec4(this[2],this[2],this[2],this[1])}get zzzz(){return new this._Vec4(this[2],this[2],this[2],this[2])}get zzzw(){return new this._Vec4(this[2],this[2],this[2],this[3])}get zzwx(){return new this._Vec4(this[2],this[2],this[3],this[0])}get zzwy(){return new this._Vec4(this[2],this[2],this[3],this[1])}get zzwz(){return new this._Vec4(this[2],this[2],this[3],this[2])}get zzww(){return new this._Vec4(this[2],this[2],this[3],this[3])}get zwxx(){return new this._Vec4(this[2],this[3],this[0],this[0])}get zwxy(){return new this._Vec4(this[2],this[3],this[0],this[1])}get zwxz(){return new this._Vec4(this[2],this[3],this[0],this[2])}get zwxw(){return new this._Vec4(this[2],this[3],this[0],this[3])}get zwyx(){return new this._Vec4(this[2],this[3],this[1],this[0])}get zwyy(){return new this._Vec4(this[2],this[3],this[1],this[1])}get zwyz(){return new this._Vec4(this[2],this[3],this[1],this[2])}get zwyw(){return new this._Vec4(this[2],this[3],this[1],this[3])}get zwzx(){return new this._Vec4(this[2],this[3],this[2],this[0])}get zwzy(){return new this._Vec4(this[2],this[3],this[2],this[1])}get zwzz(){return new this._Vec4(this[2],this[3],this[2],this[2])}get zwzw(){return new this._Vec4(this[2],this[3],this[2],this[3])}get zwwx(){return new this._Vec4(this[2],this[3],this[3],this[0])}get zwwy(){return new this._Vec4(this[2],this[3],this[3],this[1])}get zwwz(){return new this._Vec4(this[2],this[3],this[3],this[2])}get zwww(){return new this._Vec4(this[2],this[3],this[3],this[3])}get wxxx(){return new this._Vec4(this[3],this[0],this[0],this[0])}get wxxy(){return new this._Vec4(this[3],this[0],this[0],this[1])}get wxxz(){return new this._Vec4(this[3],this[0],this[0],this[2])}get wxxw(){return new this._Vec4(this[3],this[0],this[0],this[3])}get wxyx(){return new this._Vec4(this[3],this[0],this[1],this[0])}get wxyy(){return new this._Vec4(this[3],this[0],this[1],this[1])}get wxyz(){return new this._Vec4(this[3],this[0],this[1],this[2])}get wxyw(){return new this._Vec4(this[3],this[0],this[1],this[3])}get wxzx(){return new this._Vec4(this[3],this[0],this[2],this[0])}get wxzy(){return new this._Vec4(this[3],this[0],this[2],this[1])}get wxzz(){return new this._Vec4(this[3],this[0],this[2],this[2])}get wxzw(){return new this._Vec4(this[3],this[0],this[2],this[3])}get wxwx(){return new this._Vec4(this[3],this[0],this[3],this[0])}get wxwy(){return new this._Vec4(this[3],this[0],this[3],this[1])}get wxwz(){return new this._Vec4(this[3],this[0],this[3],this[2])}get wxww(){return new this._Vec4(this[3],this[0],this[3],this[3])}get wyxx(){return new this._Vec4(this[3],this[1],this[0],this[0])}get wyxy(){return new this._Vec4(this[3],this[1],this[0],this[1])}get wyxz(){return new this._Vec4(this[3],this[1],this[0],this[2])}get wyxw(){return new this._Vec4(this[3],this[1],this[0],this[3])}get wyyx(){return new this._Vec4(this[3],this[1],this[1],this[0])}get wyyy(){return new this._Vec4(this[3],this[1],this[1],this[1])}get wyyz(){return new this._Vec4(this[3],this[1],this[1],this[2])}get wyyw(){return new this._Vec4(this[3],this[1],this[1],this[3])}get wyzx(){return new this._Vec4(this[3],this[1],this[2],this[0])}get wyzy(){return new this._Vec4(this[3],this[1],this[2],this[1])}get wyzz(){return new this._Vec4(this[3],this[1],this[2],this[2])}get wyzw(){return new this._Vec4(this[3],this[1],this[2],this[3])}get wywx(){return new this._Vec4(this[3],this[1],this[3],this[0])}get wywy(){return new this._Vec4(this[3],this[1],this[3],this[1])}get wywz(){return new this._Vec4(this[3],this[1],this[3],this[2])}get wyww(){return new this._Vec4(this[3],this[1],this[3],this[3])}get wzxx(){return new this._Vec4(this[3],this[2],this[0],this[0])}get wzxy(){return new this._Vec4(this[3],this[2],this[0],this[1])}get wzxz(){return new this._Vec4(this[3],this[2],this[0],this[2])}get wzxw(){return new this._Vec4(this[3],this[2],this[0],this[3])}get wzyx(){return new this._Vec4(this[3],this[2],this[1],this[0])}get wzyy(){return new this._Vec4(this[3],this[2],this[1],this[1])}get wzyz(){return new this._Vec4(this[3],this[2],this[1],this[2])}get wzyw(){return new this._Vec4(this[3],this[2],this[1],this[3])}get wzzx(){return new this._Vec4(this[3],this[2],this[2],this[0])}get wzzy(){return new this._Vec4(this[3],this[2],this[2],this[1])}get wzzz(){return new this._Vec4(this[3],this[2],this[2],this[2])}get wzzw(){return new this._Vec4(this[3],this[2],this[2],this[3])}get wzwx(){return new this._Vec4(this[3],this[2],this[3],this[0])}get wzwy(){return new this._Vec4(this[3],this[2],this[3],this[1])}get wzwz(){return new this._Vec4(this[3],this[2],this[3],this[2])}get wzww(){return new this._Vec4(this[3],this[2],this[3],this[3])}get wwxx(){return new this._Vec4(this[3],this[3],this[0],this[0])}get wwxy(){return new this._Vec4(this[3],this[3],this[0],this[1])}get wwxz(){return new this._Vec4(this[3],this[3],this[0],this[2])}get wwxw(){return new this._Vec4(this[3],this[3],this[0],this[3])}get wwyx(){return new this._Vec4(this[3],this[3],this[1],this[0])}get wwyy(){return new this._Vec4(this[3],this[3],this[1],this[1])}get wwyz(){return new this._Vec4(this[3],this[3],this[1],this[2])}get wwyw(){return new this._Vec4(this[3],this[3],this[1],this[3])}get wwzx(){return new this._Vec4(this[3],this[3],this[2],this[0])}get wwzy(){return new this._Vec4(this[3],this[3],this[2],this[1])}get wwzz(){return new this._Vec4(this[3],this[3],this[2],this[2])}get wwzw(){return new this._Vec4(this[3],this[3],this[2],this[3])}get wwwx(){return new this._Vec4(this[3],this[3],this[3],this[0])}get wwwy(){return new this._Vec4(this[3],this[3],this[3],this[1])}get wwwz(){return new this._Vec4(this[3],this[3],this[3],this[2])}get wwww(){return new this._Vec4(this[3],this[3],this[3],this[3])}}, _class),l=class extends R{constructor(t,n){super(2),this[0]=_nullishCoalesce(t, () => (this.getDefaultValue())),this[1]=_nullishCoalesce(_nullishCoalesce(n, () => (t)), () => (this.getDefaultValue()))}get x(){return this[0]}get y(){return this[1]}set x(t){this[0]=t}set y(t){this[1]=t}},x=class extends R{constructor(t,n,a){super(3),this[0]=_nullishCoalesce(t, () => (this.getDefaultValue())),this[1]=_nullishCoalesce(_nullishCoalesce(n, () => (t)), () => (this.getDefaultValue())),this[2]=_nullishCoalesce(_nullishCoalesce(a, () => (t)), () => (this.getDefaultValue()))}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}set x(t){this[0]=t}set y(t){this[1]=t}set z(t){this[2]=t}},w=class extends R{constructor(t,n,a,s){super(4),this[0]=_nullishCoalesce(t, () => (this.getDefaultValue())),this[1]=_nullishCoalesce(_nullishCoalesce(n, () => (t)), () => (this.getDefaultValue())),this[2]=_nullishCoalesce(_nullishCoalesce(a, () => (t)), () => (this.getDefaultValue())),this[3]=_nullishCoalesce(_nullishCoalesce(s, () => (t)), () => (this.getDefaultValue()))}get x(){return this[0]}get y(){return this[1]}get z(){return this[2]}get w(){return this[3]}set x(t){this[0]=t}set y(t){this[1]=t}set z(t){this[2]=t}set w(t){this[3]=t}},p=class e extends l{getDefaultValue(){return 0}get kind(){return"vec2f"}get _Vec2(){return e}get _Vec3(){return b}get _Vec4(){return A}},m=class e extends l{getDefaultValue(){return 0}get kind(){return"vec2h"}get _Vec2(){return e}get _Vec3(){return z}get _Vec4(){return I}},g=class e extends l{getDefaultValue(){return 0}get kind(){return"vec2i"}get _Vec2(){return e}get _Vec3(){return V}get _Vec4(){return $}},f=class e extends l{getDefaultValue(){return 0}get kind(){return"vec2u"}get _Vec2(){return e}get _Vec3(){return v}get _Vec4(){return k}},T=class e extends l{getDefaultValue(){return!1}get kind(){return"vec2<bool>"}get _Vec2(){return e}get _Vec3(){return _}get _Vec4(){return S}},b=class e extends x{getDefaultValue(){return 0}get kind(){return"vec3f"}get _Vec2(){return p}get _Vec3(){return e}get _Vec4(){return A}},z=class e extends x{getDefaultValue(){return 0}get kind(){return"vec3h"}get _Vec2(){return m}get _Vec3(){return e}get _Vec4(){return I}},V=class e extends x{getDefaultValue(){return 0}get kind(){return"vec3i"}get _Vec2(){return g}get _Vec3(){return e}get _Vec4(){return $}},v=class e extends x{getDefaultValue(){return 0}get kind(){return"vec3u"}get _Vec2(){return f}get _Vec3(){return e}get _Vec4(){return k}},_=class e extends x{getDefaultValue(){return!1}get kind(){return"vec3<bool>"}get _Vec2(){return T}get _Vec3(){return e}get _Vec4(){return S}},A=class e extends w{getDefaultValue(){return 0}get kind(){return"vec4f"}get _Vec2(){return p}get _Vec3(){return b}get _Vec4(){return e}},I=class e extends w{getDefaultValue(){return 0}get kind(){return"vec4h"}get _Vec2(){return m}get _Vec3(){return z}get _Vec4(){return e}},$=class e extends w{getDefaultValue(){return 0}get kind(){return"vec4i"}get _Vec2(){return g}get _Vec3(){return V}get _Vec4(){return e}},k=class e extends w{getDefaultValue(){return 0}get kind(){return"vec4u"}get _Vec2(){return f}get _Vec3(){return v}get _Vec4(){return e}},S=class e extends w{getDefaultValue(){return!1}get kind(){return"vec4<bool>"}get _Vec2(){return T}get _Vec3(){return _}get _Vec4(){return e}};var H=h(p),Ee= exports.pa =h(m),Oe= exports.qa =h(g),Ke= exports.ra =h(f),Ye= exports.sa =h(T),X= exports.ta =h(b),He= exports.ua =h(z),Xe= exports.va =h(V),Ze= exports.wa =h(v),Je= exports.xa =h(_),Z= exports.ya =h(A),qe= exports.za =h(I),Qe= exports.Aa =h($),et= exports.Ba =h(k),tt= exports.Ca =h(S),nt={vec2f:H,vec2h:Ee,vec2i:Oe,vec2u:Ke,"vec2<bool>":Ye,vec3f:X,vec3h:He,vec3i:Xe,vec3u:Ze,"vec3<bool>":Je,vec4f:Z,vec4h:qe,vec4i:Qe,vec4u:et,"vec4<bool>":tt},rt= exports.Da ={vec2f:U,vec2h:B,vec2i:N,vec2u:M,"vec2<bool>":G,vec3f:U,vec3h:B,vec3i:N,vec3u:M,"vec3<bool>":G,vec4f:U,vec4h:B,vec4i:N,vec4u:M,"vec4<bool>":G};function h(e){let{kind:t,length:n}=new e,a=o((...s)=>{let i=new Array(s.length),u=0;for(let D of s)if(typeof D=="number"||typeof D=="boolean")i[u++]=D;else for(let E=0;E<D.length;++E)i[u++]=D[E];if(i.length<=1||i.length===n)return new e(...i);throw new Error(`'${t}' constructor called with invalid number of arguments.`)},(...s)=>y(`${t}(${s.map(i=>i.value).join(", ")})`,nt[t]),t,(...s)=>s.map(i=>{let u=i.dataType;return me(u)&&(u=u.inner),le(u)?u:rt[t]}));return Object.assign(a,{type:t,[d]:void 0})}function re(e){let t={[r]:!0,[d]:void 0,type:e.type,identity:ot[e.columns],translation:e.columns===4?ht:void 0,scaling:e.columns===4?ut:void 0,rotationX:e.columns===4?yt:void 0,rotationY:e.columns===4?ct:void 0,rotationZ:e.columns===4?lt:void 0},n=o((...a)=>{let s=[];for(let i of a)if(typeof i=="number")s.push(i);else for(let u=0;u<i.length;++u)s.push(i[u]);if(s.length!==0&&s.length!==e.columns*e.rows)throw new Error(`'${e.type}' constructor called with invalid number of arguments.`);for(let i=s.length;i<e.columns*e.rows;++i)s.push(0);return e.makeFromElements(...s)},(...a)=>y(`${t.type}(${a.map(s=>s.value).join(", ")})`,t),t.type);return Object.assign(n,t)}var J= (_class2 =class{__init2() {this[r]=!0}__init3() {this.length=4}constructor(...t){;_class2.prototype.__init2.call(this);_class2.prototype.__init3.call(this);this.columns=[this.makeColumn(t[0],t[1]),this.makeColumn(t[2],t[3])]}get 0(){return this.columns[0].x}get 1(){return this.columns[0].y}get 2(){return this.columns[1].x}get 3(){return this.columns[1].y}set 0(t){this.columns[0].x=t}set 1(t){this.columns[0].y=t}set 2(t){this.columns[1].x=t}set 3(t){this.columns[1].y=t}*[Symbol.iterator](){yield this[0],yield this[1],yield this[2],yield this[3]}"~resolve"(){return`${this.kind}(${Array.from({length:this.length}).map((t,n)=>this[n]).join(", ")})`}}, _class2),q= (_class3 =class extends J{constructor(...args2) { super(...args2); _class3.prototype.__init4.call(this); }__init4() {this.kind="mat2x2f"}makeColumn(t,n){return H(t,n)}}, _class3),Q= (_class4 =class{__init5() {this[r]=!0}__init6() {this.length=12}constructor(...t){;_class4.prototype.__init5.call(this);_class4.prototype.__init6.call(this);this.columns=[this.makeColumn(t[0],t[1],t[2]),this.makeColumn(t[3],t[4],t[5]),this.makeColumn(t[6],t[7],t[8])]}get 0(){return this.columns[0].x}get 1(){return this.columns[0].y}get 2(){return this.columns[0].z}get 3(){return 0}get 4(){return this.columns[1].x}get 5(){return this.columns[1].y}get 6(){return this.columns[1].z}get 7(){return 0}get 8(){return this.columns[2].x}get 9(){return this.columns[2].y}get 10(){return this.columns[2].z}get 11(){return 0}set 0(t){this.columns[0].x=t}set 1(t){this.columns[0].y=t}set 2(t){this.columns[0].z=t}set 3(t){}set 4(t){this.columns[1].x=t}set 5(t){this.columns[1].y=t}set 6(t){this.columns[1].z=t}set 7(t){}set 8(t){this.columns[2].x=t}set 9(t){this.columns[2].y=t}set 10(t){this.columns[2].z=t}set 11(t){}*[Symbol.iterator](){for(let t=0;t<12;t++)yield this[t]}"~resolve"(){return`${this.kind}(${this[0]}, ${this[1]}, ${this[2]}, ${this[4]}, ${this[5]}, ${this[6]}, ${this[8]}, ${this[9]}, ${this[10]})`}}, _class4),ee= (_class5 =class extends Q{constructor(...args3) { super(...args3); _class5.prototype.__init7.call(this); }__init7() {this.kind="mat3x3f"}makeColumn(t,n,a){return X(t,n,a)}}, _class5),te= (_class6 =class{__init8() {this[r]=!0}constructor(...t){;_class6.prototype.__init8.call(this);_class6.prototype.__init9.call(this);this.columns=[this.makeColumn(t[0],t[1],t[2],t[3]),this.makeColumn(t[4],t[5],t[6],t[7]),this.makeColumn(t[8],t[9],t[10],t[11]),this.makeColumn(t[12],t[13],t[14],t[15])]}__init9() {this.length=16}get 0(){return this.columns[0].x}get 1(){return this.columns[0].y}get 2(){return this.columns[0].z}get 3(){return this.columns[0].w}get 4(){return this.columns[1].x}get 5(){return this.columns[1].y}get 6(){return this.columns[1].z}get 7(){return this.columns[1].w}get 8(){return this.columns[2].x}get 9(){return this.columns[2].y}get 10(){return this.columns[2].z}get 11(){return this.columns[2].w}get 12(){return this.columns[3].x}get 13(){return this.columns[3].y}get 14(){return this.columns[3].z}get 15(){return this.columns[3].w}set 0(t){this.columns[0].x=t}set 1(t){this.columns[0].y=t}set 2(t){this.columns[0].z=t}set 3(t){this.columns[0].w=t}set 4(t){this.columns[1].x=t}set 5(t){this.columns[1].y=t}set 6(t){this.columns[1].z=t}set 7(t){this.columns[1].w=t}set 8(t){this.columns[2].x=t}set 9(t){this.columns[2].y=t}set 10(t){this.columns[2].z=t}set 11(t){this.columns[2].w=t}set 12(t){this.columns[3].x=t}set 13(t){this.columns[3].y=t}set 14(t){this.columns[3].z=t}set 15(t){this.columns[3].w=t}*[Symbol.iterator](){for(let t=0;t<16;t++)yield this[t]}"~resolve"(){return`${this.kind}(${Array.from({length:this.length}).map((t,n)=>this[n]).join(", ")})`}}, _class6),ne= (_class7 =class extends te{constructor(...args4) { super(...args4); _class7.prototype.__init10.call(this); }__init10() {this.kind="mat4x4f"}makeColumn(t,n,a,s){return Z(t,n,a,s)}}, _class7),st= exports.Ea =o(()=>Te(1,0,0,1),()=>({value:`mat4x4f( 1.0, 0.0, 0.0, 1.0 )`,dataType:Te}),"identity2"),it= exports.Fa =o(()=>be(1,0,0,0,1,0,0,0,1),()=>({value:`mat4x4f( 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, )`,dataType:be}),"identity3"),at= exports.Ga =o(()=>c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),()=>({value:`mat4x4f( 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 )`,dataType:c}),"identity4"),ot={2:st,3:it,4:at},ht= exports.Ha =o(e=>c(1,0,0,0,0,1,0,0,0,0,1,0,e.x,e.y,e.z,1),e=>({value:`mat4x4f( 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ${e.value}.x, ${e.value}.y, ${e.value}.z, 1 )`,dataType:c}),"translation4"),ut= exports.Ia =o(e=>c(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1),e=>({value:`mat4x4f( ${e.value}.x, 0, 0, 0, 0, ${e.value}.y, 0, 0, 0, 0, ${e.value}.z, 0, 0, 0, 0, 1 )`,dataType:c}),"scaling4"),yt= exports.Ja =o(e=>c(1,0,0,0,0,Math.cos(e),Math.sin(e),0,0,-Math.sin(e),Math.cos(e),0,0,0,0,1),e=>y(`mat4x4f( 1, 0, 0, 0, 0, cos(${e.value}), sin(${e.value}), 0, 0, -sin(${e.value}), cos(${e.value}), 0, 0, 0, 0, 1 )`,c),"rotationX4"),ct= exports.Ka =o(e=>c(Math.cos(e),0,-Math.sin(e),0,0,1,0,0,Math.sin(e),0,Math.cos(e),0,0,0,0,1),e=>y(`mat4x4f( cos(${e.value}), 0, -sin(${e.value}), 0, 0, 1, 0, 0, sin(${e.value}), 0, cos(${e.value}), 0, 0, 0, 0, 1 )`,c),"rotationY4"),lt= exports.La =o(e=>c(Math.cos(e),Math.sin(e),0,0,-Math.sin(e),Math.cos(e),0,0,0,0,1,0,0,0,0,1),e=>y(`mat4x4f( cos(${e.value}), sin(${e.value}), 0, 0, -sin(${e.value}), cos(${e.value}), 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 )`,c),"rotationZ4"),Te= exports.Ma =re({type:"mat2x2f",rows:2,columns:2,makeFromElements:(...e)=>new q(...e)}),be= exports.Na =re({type:"mat3x3f",rows:3,columns:3,makeFromElements:(...e)=>new ee(...e)}),c= exports.Oa =re({type:"mat4x4f",rows:4,columns:4,makeFromElements:(...e)=>new ne(...e)});function Sn(e){return e.kind==="mat3x3f"?[e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]]:Array.from({length:e.length}).map((t,n)=>e[n])}function Cn(e){return{[r]:!0,type:"ptr",inner:e,addressSpace:"function",access:"read-write"}}function Fn(e){return{[r]:!0,type:"ptr",inner:e,addressSpace:"private",access:"read-write"}}function Mn(e){return{[r]:!0,type:"ptr",inner:e,addressSpace:"workgroup",access:"read-write"}}function Nn(e,t="read"){return{[r]:!0,type:"ptr",inner:e,addressSpace:"storage",access:t}}function Un(e){return{[r]:!0,type:"ptr",inner:e,addressSpace:"uniform",access:"read"}}function Bn(e){return{[r]:!0,type:"ptr",inner:e,addressSpace:"handle",access:"read"}}exports.a = r; exports.b = se; exports.c = dt; exports.d = O; exports.e = C; exports.f = ie; exports.g = gt; exports.h = ve; exports.i = _e; exports.j = Y; exports.k = ae; exports.l = oe; exports.m = he; exports.n = ue; exports.o = ye; exports.p = ce; exports.q = Re; exports.r = qt; exports.s = Qt; exports.t = en; exports.u = tn; exports.v = fe; exports.w = ge; exports.x = Ut; exports.y = d; exports.z = _t; exports.A = At; exports.B = Ie; exports.C = $e; exports.D = ke; exports.E = le; exports.F = It; exports.G = De; exports.H = Pe; exports.I = $t; exports.J = kt; exports.K = xe; exports.L = St; exports.M = Dt; exports.N = Pt; exports.O = Ct; exports.P = we; exports.Q = de; exports.R = pe; exports.S = Ft; exports.T = Mt; exports.U = me; exports.V = Nt; exports.W = Ne; exports.X = Lt; exports.Y = jt; exports.Z = Gt; exports._ = Et; exports.$ = Ot; exports.aa = Kt; exports.ba = Yt; exports.ca = Ht; exports.da = y; exports.ea = Xt; exports.fa = on; exports.ga = o; exports.ha = xn; exports.ia = wn; exports.ja = G; exports.ka = M; exports.la = N; exports.ma = U; exports.na = B; exports.oa = H; exports.pa = Ee; exports.qa = Oe; exports.ra = Ke; exports.sa = Ye; exports.ta = X; exports.ua = He; exports.va = Xe; exports.wa = Ze; exports.xa = Je; exports.ya = Z; exports.za = qe; exports.Aa = Qe; exports.Ba = et; exports.Ca = tt; exports.Da = rt; exports.Ea = st; exports.Fa = it; exports.Ga = at; exports.Ha = ht; exports.Ia = ut; exports.Ja = yt; exports.Ka = ct; exports.La = lt; exports.Ma = Te; exports.Na = be; exports.Oa = c; exports.Pa = Sn; exports.Qa = Cn; exports.Ra = Fn; exports.Sa = Mn; exports.Ta = Nn; exports.Ua = Un; exports.Va = Bn; //# sourceMappingURL=chunk-BJSN5UVV.cjs.map