iwer 1.0.2 → 1.0.4

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.
@@ -1 +1 @@
1
- var e="undefined"!=typeof Float32Array?Float32Array:Array;function t(){var t=new e(16);return e!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function i(t){var i=new e(16);return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}function n(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function r(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],s=t[4],o=t[5],u=t[6],l=t[7],c=t[8],d=t[9],h=t[10],p=t[11],m=t[12],f=t[13],g=t[14],v=t[15],x=i*o-n*s,y=i*u-r*s,S=i*l-a*s,w=n*u-r*o,b=n*l-a*o,M=r*l-a*u,F=c*f-d*m,R=c*g-h*m,E=c*v-p*m,q=d*g-h*f,I=d*v-p*f,T=h*v-p*g,V=x*T-y*I+S*q+w*E-b*R+M*F;return V?(V=1/V,e[0]=(o*T-u*I+l*q)*V,e[1]=(r*I-n*T-a*q)*V,e[2]=(f*M-g*b+v*w)*V,e[3]=(h*b-d*M-p*w)*V,e[4]=(u*E-s*T-l*R)*V,e[5]=(i*T-r*E+a*R)*V,e[6]=(g*S-m*M-v*y)*V,e[7]=(c*M-h*S+p*y)*V,e[8]=(s*I-o*E+l*F)*V,e[9]=(n*E-i*I-a*F)*V,e[10]=(m*b-f*S+v*x)*V,e[11]=(d*S-c*b-p*x)*V,e[12]=(o*R-s*q-u*F)*V,e[13]=(i*q-n*R+r*F)*V,e[14]=(f*y-m*w-g*x)*V,e[15]=(c*w-d*y+h*x)*V,e):null}function a(e,t,i){var n=t[0],r=t[1],a=t[2],s=t[3],o=t[4],u=t[5],l=t[6],c=t[7],d=t[8],h=t[9],p=t[10],m=t[11],f=t[12],g=t[13],v=t[14],x=t[15],y=i[0],S=i[1],w=i[2],b=i[3];return e[0]=y*n+S*o+w*d+b*f,e[1]=y*r+S*u+w*h+b*g,e[2]=y*a+S*l+w*p+b*v,e[3]=y*s+S*c+w*m+b*x,y=i[4],S=i[5],w=i[6],b=i[7],e[4]=y*n+S*o+w*d+b*f,e[5]=y*r+S*u+w*h+b*g,e[6]=y*a+S*l+w*p+b*v,e[7]=y*s+S*c+w*m+b*x,y=i[8],S=i[9],w=i[10],b=i[11],e[8]=y*n+S*o+w*d+b*f,e[9]=y*r+S*u+w*h+b*g,e[10]=y*a+S*l+w*p+b*v,e[11]=y*s+S*c+w*m+b*x,y=i[12],S=i[13],w=i[14],b=i[15],e[12]=y*n+S*o+w*d+b*f,e[13]=y*r+S*u+w*h+b*g,e[14]=y*a+S*l+w*p+b*v,e[15]=y*s+S*c+w*m+b*x,e}function s(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function o(e,t,i){var n=t[0],r=t[1],a=t[2],s=t[3],o=n+n,u=r+r,l=a+a,c=n*o,d=n*u,h=n*l,p=r*u,m=r*l,f=a*l,g=s*o,v=s*u,x=s*l;return e[0]=1-(p+f),e[1]=d+x,e[2]=h-v,e[3]=0,e[4]=d-x,e[5]=1-(c+f),e[6]=m+g,e[7]=0,e[8]=h+v,e[9]=m-g,e[10]=1-(c+p),e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}function u(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function l(e,t){var i=t[0],n=t[1],r=t[2],a=t[4],s=t[5],o=t[6],u=t[8],l=t[9],c=t[10];return e[0]=Math.hypot(i,n,r),e[1]=Math.hypot(a,s,o),e[2]=Math.hypot(u,l,c),e}function c(t,i){var n=new e(3);l(n,i);var r=1/n[0],a=1/n[1],s=1/n[2],o=i[0]*r,u=i[1]*a,c=i[2]*s,d=i[4]*r,h=i[5]*a,p=i[6]*s,m=i[8]*r,f=i[9]*a,g=i[10]*s,v=o+h+g,x=0;return v>0?(x=2*Math.sqrt(v+1),t[3]=.25*x,t[0]=(p-f)/x,t[1]=(m-c)/x,t[2]=(u-d)/x):o>h&&o>g?(x=2*Math.sqrt(1+o-h-g),t[3]=(p-f)/x,t[0]=.25*x,t[1]=(u+d)/x,t[2]=(m+c)/x):h>g?(x=2*Math.sqrt(1+h-o-g),t[3]=(m-c)/x,t[0]=(u+d)/x,t[1]=.25*x,t[2]=(p+f)/x):(x=2*Math.sqrt(1+g-o-h),t[3]=(u-d)/x,t[0]=(m+c)/x,t[1]=(p+f)/x,t[2]=.25*x),t}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var d=function(e,t,i,n,r){var a,s=1/Math.tan(t/2);return e[0]=s/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=r&&r!==1/0?(a=1/(n-r),e[10]=(r+n)*a,e[14]=2*r*n*a):(e[10]=-1,e[14]=-2*n),e};function h(){var t=new e(3);return e!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function p(t,i,n){var r=new e(3);return r[0]=t,r[1]=i,r[2]=n,r}function m(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function f(e,t){var i=t[0],n=t[1],r=t[2],a=i*i+n*n+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function g(e,t,i,n){var r=t[0],a=t[1],s=t[2];return e[0]=r+n*(i[0]-r),e[1]=a+n*(i[1]-a),e[2]=s+n*(i[2]-s),e}function v(){var t=new e(4);return e!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function x(e,t,i){i*=.5;var n=Math.sin(i);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(i),e}function y(e,t,i,n){var r,a,s,o,u,l=t[0],c=t[1],d=t[2],h=t[3],p=i[0],m=i[1],f=i[2],g=i[3];return(a=l*p+c*m+d*f+h*g)<0&&(a=-a,p=-p,m=-m,f=-f,g=-g),1-a>1e-6?(r=Math.acos(a),s=Math.sin(r),o=Math.sin((1-n)*r)/s,u=Math.sin(n*r)/s):(o=1-n,u=n),e[0]=o*l+u*p,e[1]=o*c+u*m,e[2]=o*d+u*f,e[3]=o*h+u*g,e}h(),function(){var t,i=(t=new e(4),e!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();var S,w=function(t,i,n,r){var a=new e(4);return a[0]=t,a[1]=i,a[2]=n,a[3]=r,a},b=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},M=function(e,t,i,n,r){return e[0]=t,e[1]=i,e[2]=n,e[3]=r,e},F=function(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],s=i*i+n*n+r*r+a*a;return s>0&&(s=1/Math.sqrt(s)),e[0]=i*s,e[1]=n*s,e[2]=r*s,e[3]=a*s,e};h(),p(1,0,0),p(0,1,0),v(),v(),S=new e(9),e!=Float32Array&&(S[1]=0,S[2]=0,S[3]=0,S[5]=0,S[6]=0,S[7]=0),S[0]=1,S[4]=1,S[8]=1;const R=Symbol("@immersive-web-emulation-runtime/xr-space");class E extends EventTarget{constructor(e,n){super(),this[R]={parentSpace:e,offsetMatrix:n?i(n):t(),emulated:!0}}}class q extends E{constructor(){super(void 0,t())}}class I{static updateOffsetPosition(e,t){s(e[R].offsetMatrix,t)}static updateOffsetQuaternion(e,t){const i=e[R].offsetMatrix,n=h();u(n,i),o(i,t,n)}static updateOffsetMatrix(e,t){n(e[R].offsetMatrix,t)}static calculateGlobalOffsetMatrix(e,i=t()){return a(i,e[R].parentSpace?I.calculateGlobalOffsetMatrix(e[R].parentSpace):t(),e[R].offsetMatrix),i}}class T{constructor(e=0,t=0,i=0){this.vec3=p(e,t,i),this.tempVec3=h()}get x(){return this.vec3[0]}set x(e){this.vec3[0]=e}get y(){return this.vec3[1]}set y(e){this.vec3[1]=e}get z(){return this.vec3[2]}set z(e){this.vec3[2]=e}set(e,t,i){return function(e,t,i,n){e[0]=t,e[1]=i,e[2]=n}(this.vec3,e,t,i),this}clone(){return new T(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}normalize(){return m(this.tempVec3,this.vec3),f(this.vec3,this.tempVec3),this}add(e){return m(this.tempVec3,this.vec3),function(e,t,i){e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2]}(this.vec3,this.tempVec3,e.vec3),this}applyQuaternion(e){return m(this.tempVec3,this.vec3),function(e,t,i){var n=i[0],r=i[1],a=i[2],s=i[3],o=t[0],u=t[1],l=t[2],c=r*l-a*u,d=a*o-n*l,h=n*u-r*o,p=r*h-a*d,m=a*c-n*h,f=n*d-r*c,g=2*s;c*=g,d*=g,h*=g,p*=2,m*=2,f*=2,e[0]=o+c+p,e[1]=u+d+m,e[2]=l+h+f}(this.vec3,this.tempVec3,e.quat),this}}class V{constructor(e=0,t=0,i=0,n=1){this.quat=w(e,t,i,n),this.tempQuat=v()}get x(){return this.quat[0]}set x(e){this.quat[0]=e}get y(){return this.quat[1]}set y(e){this.quat[1]=e}get z(){return this.quat[2]}set z(e){this.quat[2]=e}get w(){return this.quat[3]}set w(e){this.quat[3]=e}set(e,t,i,n){return M(this.quat,e,t,i,n),this}clone(){return new V(this.x,this.y,this.z,this.w)}copy(e){return M(this.quat,e.x,e.y,e.z,e.w),this}normalize(){return b(this.tempQuat,this.quat),F(this.quat,this.tempQuat),this}invert(){return b(this.tempQuat,this.quat),function(e,t){e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3]}(this.quat,this.tempQuat),this}multiply(e){return b(this.tempQuat,this.quat),function(e,t,i){var n=t[0],r=t[1],a=t[2],s=t[3],o=i[0],u=i[1],l=i[2],c=i[3];e[0]=n*c+s*o+r*l-a*u,e[1]=r*c+s*u+a*o-n*l,e[2]=a*c+s*l+n*u-r*o,e[3]=s*c-n*o-r*u-a*l}(this.quat,this.tempQuat,e.quat),this}setFromAxisAngle(e,t){return x(this.quat,e.vec3,t),this}}const P=Symbol("@immersive-web-emulation-runtime/gamepad");var L,O,k;!function(e){e.None="",e.Standard="standard",e.XRStandard="xr-standard"}(L||(L={}));class A{constructor(e,t){this[P]={type:e,eventTrigger:t,pressed:!1,touched:!1,value:0,lastFrameValue:0,pendingValue:null}}get pressed(){return"manual"===this[P].type?this[P].pressed:this[P].value>0}get touched(){return"manual"===this[P].type?this[P].touched:this[P].touched||this.pressed}get value(){return this[P].value}}class z{constructor(){this.pressed=!1,this.touched=!1,this.value=0}}class D{constructor(e,t="",i=-1){this[P]={id:t,index:i,connected:!1,timestamp:performance.now(),mapping:e.mapping,buttonsMap:{},buttonsSequence:[],axesMap:{},axesSequence:[],hapticActuators:[]},e.buttons.forEach((e=>{var t;null===e?this[P].buttonsSequence.push(null):(this[P].buttonsSequence.push(e.id),this[P].buttonsMap[e.id]=new A(e.type,null!==(t=e.eventTrigger)&&void 0!==t?t:null))})),e.axes.forEach((e=>{null===e?this[P].axesSequence.push(null):(this[P].axesSequence.push(e.id+e.type),this[P].axesMap[e.id]||(this[P].axesMap[e.id]={x:0,y:0}))}))}get id(){return this[P].id}get index(){return this[P].index}get connected(){return this[P].connected}get timestamp(){return this[P].timestamp}get mapping(){return this[P].mapping}get axes(){const e=[];return this[P].axesSequence.forEach((t=>{if(null===t)e.push(null);else{const i=t.substring(0,t.length-6),n=t.substring(t.length-6);e.push("y-axis"===n?this[P].axesMap[i].y:this[P].axesMap[i].x)}})),e}get buttons(){return this[P].buttonsSequence.map((e=>null===e?new z:this[P].buttonsMap[e]))}get hapticActuators(){return this[P].hapticActuators}get vibrationActuator(){return null}}!function(e){e.None="none",e.Left="left",e.Right="right"}(O||(O={})),function(e){e.Gaze="gaze",e.TrackedPointer="tracked-pointer",e.Screen="screen",e.TransientPointer="transient-pointer"}(k||(k={}));class C extends Array{}const X=Symbol("@immersive-web-emulation-runtime/xr-input-source");class j{constructor(e,t,i,n,r,a,s){this[X]={handedness:e,targetRayMode:t,targetRaySpace:n,gripSpace:a,profiles:i,gamepad:r,hand:s}}get handedness(){return this[X].handedness}get targetRayMode(){return this[X].targetRayMode}get targetRaySpace(){return this[X].targetRaySpace}get gripSpace(){return this[X].gripSpace}get profiles(){return this[X].profiles}get gamepad(){return this[X].gamepad}get hand(){return this[X].hand}}class H extends Event{constructor(e,t){if(super(e,t),!t.frame)throw new Error("XRInputSourceEventInit.frame is required");if(!t.inputSource)throw new Error("XRInputSourceEventInit.inputSource is required");this.frame=t.frame,this.inputSource=t.inputSource}}const N=Symbol("@immersive-web-emulation-runtime/xr-tracked-input"),B={[O.Left]:{position:new T(-.25,1.5,-.4),quaternion:new V},[O.Right]:{position:new T(.25,1.5,-.4),quaternion:new V},[O.None]:{position:new T(.25,1.5,-.4),quaternion:new V}};class G{constructor(e){this[N]={inputSource:e,position:B[e.handedness].position.clone(),quaternion:B[e.handedness].quaternion.clone(),connected:!0,lastFrameConnected:!1,inputSourceChanged:!0}}get position(){return this[N].position}get quaternion(){return this[N].quaternion}get inputSource(){return this[N].inputSource}get connected(){return this[N].connected}set connected(e){this[N].connected=e,this[N].inputSource.gamepad[P].connected=e}onFrameStart(e){o(this[N].inputSource.targetRaySpace[R].offsetMatrix,this[N].quaternion.quat,this[N].position.vec3);const t=e.session;this[N].inputSource.gamepad.buttons.forEach((i=>{i instanceof A&&(i[P].lastFrameValue=i[P].value,null!=i[P].pendingValue&&(i[P].value=i[P].pendingValue,i[P].pendingValue=null),null!=i[P].eventTrigger&&(0===i[P].lastFrameValue&&i[P].value>0?(t.dispatchEvent(new H(i[P].eventTrigger,{frame:e,inputSource:this[N].inputSource})),t.dispatchEvent(new H(i[P].eventTrigger+"start",{frame:e,inputSource:this[N].inputSource}))):i[P].lastFrameValue>0&&0===i[P].value&&t.dispatchEvent(new H(i[P].eventTrigger+"end",{frame:e,inputSource:this[N].inputSource}))))})),this[N].inputSourceChanged=this.connected!==this[N].lastFrameConnected,this[N].lastFrameConnected=this.connected}}const Q=Symbol("@immersive-web-emulation-runtime/xr-controller");class K extends G{constructor(e,t,i){if(!e.layout[t])throw new DOMException("Handedness not supported","InvalidStateError");const n=new E(i),r=e.layout[t].gripOffsetMatrix?new E(n,e.layout[t].gripOffsetMatrix):void 0,a=[e.profileId,...e.fallbackProfileIds];super(new j(t,k.TrackedPointer,a,n,new D(e.layout[t].gamepad),r)),this[Q]={gamepadConfig:e.layout[t].gamepad}}get gamepadConfig(){return this[Q].gamepadConfig}updateButtonValue(e,t){if(t>1||t<0)return void console.warn(`Out-of-range value ${t} provided for button ${e}.`);const i=this[N].inputSource.gamepad[P].buttonsMap[e];if(i){if("binary"===i[P].type&&1!=t&&0!=t)return void console.warn(`Non-binary value ${t} provided for binary button ${e}.`);i[P].pendingValue=t}else console.warn(`Current controller does not have button ${e}.`)}updateButtonTouch(e,t){const i=this[N].inputSource.gamepad[P].buttonsMap[e];i?i[P].touched=t:console.warn(`Current controller does not have button ${e}.`)}updateAxis(e,t,i){if(i>1||i<-1)return void console.warn(`Out-of-range value ${i} provided for ${e} axes.`);const n=this[N].inputSource.gamepad[P].axesMap[e];n?"x-axis"===t?n.x=i:"y-axis"===t&&(n.y=i):console.warn(`Current controller does not have ${e} axes.`)}updateAxes(e,t,i){if(t>1||t<-1||i>1||i<-1)return void console.warn(`Out-of-range value x:${t}, y:${i} provided for ${e} axes.`);const n=this[N].inputSource.gamepad[P].axesMap[e];n?(n.x=t,n.y=i):console.warn(`Current controller does not have ${e} axes.`)}}const _=Symbol("@immersive-web-emulation-runtime/xr-view");var $,U;!function(e){e.None="none",e.Left="left",e.Right="right"}($||($={}));class W{constructor(e,t,i,n){this[_]={eye:e,projectionMatrix:t,transform:i,recommendedViewportScale:null,requestedViewportScale:1,session:n}}get eye(){return this[_].eye}get projectionMatrix(){return this[_].projectionMatrix}get transform(){return this[_].transform}get recommendedViewportScale(){return this[_].recommendedViewportScale}requestViewportScale(e){null===e||e<=0||e>1?console.warn("Invalid scale value. Scale must be > 0 and <= 1."):this[_].requestedViewportScale=e}}!function(e){e.Wrist="wrist",e.ThumbMetacarpal="thumb-metacarpal",e.ThumbPhalanxProximal="thumb-phalanx-proximal",e.ThumbPhalanxDistal="thumb-phalanx-distal",e.ThumbTip="thumb-tip",e.IndexFingerMetacarpal="index-finger-metacarpal",e.IndexFingerPhalanxProximal="index-finger-phalanx-proximal",e.IndexFingerPhalanxIntermediate="index-finger-phalanx-intermediate",e.IndexFingerPhalanxDistal="index-finger-phalanx-distal",e.IndexFingerTip="index-finger-tip",e.MiddleFingerMetacarpal="middle-finger-metacarpal",e.MiddleFingerPhalanxProximal="middle-finger-phalanx-proximal",e.MiddleFingerPhalanxIntermediate="middle-finger-phalanx-intermediate",e.MiddleFingerPhalanxDistal="middle-finger-phalanx-distal",e.MiddleFingerTip="middle-finger-tip",e.RingFingerMetacarpal="ring-finger-metacarpal",e.RingFingerPhalanxProximal="ring-finger-phalanx-proximal",e.RingFingerPhalanxIntermediate="ring-finger-phalanx-intermediate",e.RingFingerPhalanxDistal="ring-finger-phalanx-distal",e.RingFingerTip="ring-finger-tip",e.PinkyFingerMetacarpal="pinky-finger-metacarpal",e.PinkyFingerPhalanxProximal="pinky-finger-phalanx-proximal",e.PinkyFingerPhalanxIntermediate="pinky-finger-phalanx-intermediate",e.PinkyFingerPhalanxDistal="pinky-finger-phalanx-distal",e.PinkyFingerTip="pinky-finger-tip"}(U||(U={}));class J extends Map{}const Y=Symbol("@immersive-web-emulation-runtime/xr-joint-space");class Z extends E{constructor(e,t,i){super(t,i),this[Y]={jointName:e,radius:0}}get jointName(){return this[Y].jointName}}const ee={profileId:"oculus-hand",fallbackProfileIds:["generic-hand","generic-hand-select","generic-trigger"],poses:{default:{jointTransforms:{wrist:{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.04913589730858803,.0021463718730956316,.11701996624469757,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.07536252588033676,-.9959676265716553,-.04867160692811012,0,.5877083539962769,-.08379616588354111,.8047218918800354,0,-.8055551648139954,.032041035592556,.5916536450386047,0,-.010643752291798592,.0006936835707165301,.08736639469861984,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.1374533325433731,-.9904957413673401,.004982374142855406,0,.5534393787384033,.08097179979085922,.8289443850517273,0,-.8214688897132874,-.11118389666080475,.559309184551239,0,.015547193586826324,-.0003480653394944966,.0681300163269043,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.04330715537071228,.003409178927540779,.0492292083799839,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.062003348022699356,.004069602582603693,.03322213143110275,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.02009812369942665,.008770795539021492,.08660387247800827,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9001791477203369,-.2598813474178314,.3494834005832672,0,.06073702871799469,.8695210218429565,.490146666765213,0,-.4312632381916046,-.41999316215515137,.7985095381736755,0,-.00017739279428496957,.03890012577176094,.039073407649993896,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9082008600234985,-.20898112654685974,.36262574791908264,0,.11045389622449875,.9553793668746948,.27395179867744446,0,-.40369608998298645,-.20874978601932526,.8907597661018372,0,.01617925800383091,.05482936650514603,.008788082748651505,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.02599053829908371,.059902746230363846,-.012860597111284733,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.03362493962049484,.06421422213315964,-.033461250364780426,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.03627845644950867,.011579737067222595,.08550142496824265,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9876697659492493,-.06786545366048813,.1410750150680542,0,-.015095947310328484,.855663537979126,.5173118710517883,0,-.15582047402858734,-.5130629539489746,.8440889716148376,0,-.021259509027004242,.04587256908416748,.03659208118915558,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.988391637802124,-.04354291781783104,.14555205404758453,0,.008894841186702251,.9729899168014526,.23067504167556763,0,-.15166506171226501,-.22670257091522217,.9620829224586487,0,-.014570588245987892,.06789684295654297,.0003578895702958107,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.010392282158136368,.07414241135120392,-.026147106662392616,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.0069718430750072,.08024183660745621,-.05014154314994812,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.05402477830648422,.015797706320881844,.08152295649051666,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9940828680992126,.05735103040933609,.09224652498960495,0,-.10022822767496109,.8116500377655029,.5754809379577637,0,-.041867565363645554,-.5813214182853699,.8125960826873779,0,-.041623555123806,.04171867296099663,.03582974523305893,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9843675494194031,.12044742703437805,.12850022315979004,0,-.15629759430885315,.9337108135223389,.3221098482608795,0,-.08118485659360886,-.3371586799621582,.937940776348114,0,-.039990875869989395,.06438793987035751,.004141641780734062,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03783353418111801,.07334739714860916,-.020782606676220894,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03445569798350334,.0802423357963562,-.04392268508672714,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9181402921676636,.35625091195106506,.17350243031978607,0,-.39615097641944885,.8352503180503845,.38134080171585083,0,-.009065053425729275,-.41885748505592346,.9080066680908203,0,-.06191859766840935,.013620133511722088,.07850203663110733,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9714386463165283,.236698180437088,-.016745081171393394,0,-.18462024629116058,.7982627749443054,.5733163952827454,0,.14906984567642212,-.5538501739501953,.8191629648208618,0,-.061502378433942795,.032741155475378036,.03705105185508728,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9337416291236877,.35620439052581787,-.03527557849884033,0,-.33203884959220886,.8987522721290588,.28634607791900635,0,.13370157778263092,-.2556603252887726,.9574766755104065,0,-.06608185172080994,.049755651503801346,.011886020191013813,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.0687975287437439,.054948460310697556,-.007561664097011089,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.06947512179613113,.0613851435482502,-.028543535619974136,1],radius:.005425984505563974}},gripOffsetMatrix:[-.0005348679260350764,-.8648636937141418,-.5020061135292053,0,-.2741127908229828,-.48265108466148376,.8318111896514893,0,-.9616971015930176,.13805119693279266,-.2368120402097702,0,-.02878567762672901,.0017147823236882687,.04536811262369156,1]},pinch:{jointTransforms:{wrist:{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06867414712905884,-.009423808194696903,.10627774149179459,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.5012241005897522,-.8650535345077515,-.0213695727288723,0,.7415963411331177,-.4421543478965759,.5045139193534851,0,-.44587990641593933,.23702676594257355,.8631392121315002,0,-.032122574746608734,-.01196830440312624,.07194234430789948,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[-.3175753057003021,-.9460570216178894,-.06419729441404343,0,.8958902955055237,-.32153913378715515,.30658137798309326,0,-.3106854259967804,.03984907269477844,.9496771097183228,0,-.017625702545046806,-.01967475935816765,.04387917369604111,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,-.007126678712666035,-.021021386608481407,.011786630377173424,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,.0003423091256991029,-.024528030306100845,-.011410919018089771,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.038037415593862534,-.0020236473064869642,.07626739144325256,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.7986818552017212,-.35985732078552246,.48229536414146423,0,.538311243057251,.7854709625244141,-.30537736415863037,0,-.2689369022846222,.5035246014595032,.8210577368736267,0,-.006869405973702669,.033938243985176086,.04206443578004837,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.8285930156707764,-.32672837376594543,.4546217918395996,0,.5577570199966431,.4116027057170868,-.7207564115524292,0,.04836784675717354,.8507823944091797,.5232869386672974,0,.0033306588884443045,.014840902760624886,.010923954658210278,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,.0021551470272243023,-.0058362227864563465,-.0017938464879989624,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,-.00131594471167773,-.025222131982445717,-.012442642822861671,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.05395089089870453,.003063359996303916,.07402937114238739,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9187911748886108,-.1530158370733261,.36387869715690613,0,.038666240870952606,.9522662162780762,.302808940410614,0,-.3928440511226654,-.26414817571640015,.8808513283729553,0,-.02717282809317112,.04162866622209549,.03678669035434723,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9228746294975281,-.12856416404247284,.36300456523895264,0,.14524033665657043,.9892153143882751,-.01890045404434204,0,-.3566599190235138,.07016586512327194,.9315956234931946,0,-.01030921470373869,.05296773463487625,-.0010256498353555799,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,-.0004833847051486373,.05103470757603645,-.026690717786550522,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,.008158999495208263,.05004044249653816,-.050120558589696884,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06732909381389618,.007902119308710098,.07209732383489609,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9391821026802063,-.027994679287075996,.34227466583251953,0,-.18282271921634674,.8029410243034363,.5673282742500305,0,-.2907087206840515,-.5954000353813171,.7489906549453735,0,-.047129884362220764,.03806127607822418,.032147664576768875,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9249380826950073,.03699534013867378,.3783116042613983,0,-.12898847460746765,.9667453765869141,.2208271026611328,0,-.3575615882873535,-.25304901599884033,.8989526629447937,0,-.03579339757561684,.06127955764532089,.002939916681498289,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.026291755959391594,.06800390034914017,-.02094830758869648,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.016345610842108727,.07300511747598648,-.04263874143362045,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.8769711852073669,.31462907791137695,.36322021484375,0,-.4506046175956726,.801031768321991,.39408499002456665,0,-.16696058213710785,-.5092697143554688,.8442559838294983,0,-.07460174709558487,.0062340241856873035,.06756893545389175,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9498357176780701,.1553308218717575,.2714462876319885,0,-.3019258379936218,.6817675232887268,.6663586497306824,0,-.08155745267868042,-.7148879170417786,.694466233253479,0,-.06697750836610794,.029482364654541016,.02902858518064022,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9214097261428833,.27928245067596436,.2701927423477173,0,-.3670244514942169,.8538867831230164,.36901235580444336,0,-.12765564024448395,-.43917882442474365,.8892839550971985,0,-.06447203457355499,.05144399777054787,.0076942890882492065,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.06187915802001953,.060364335775375366,-.010368337854743004,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.056796226650476456,.07042007893323898,-.02921444922685623,1],radius:.005425984505563974}},gripOffsetMatrix:[.08027800917625427,-.8086723685264587,-.5827556252479553,0,-.4154181480407715,-.5585916638374329,.7179154753684998,0,-.9060805439949036,.1844543218612671,-.3807799518108368,0,-.038054611533880234,-.002910431008785963,.03720742464065552,1]},point:{jointTransforms:{wrist:{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05789132043719292,.01670890860259533,.11183350533246994,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[.02145560085773468,-.9978390336036682,.0621047280728817,0,.41311800479888916,.06541631370782852,.9083252549171448,0,-.9104245901107788,.006167683284729719,.4136286973953247,0,-.016488194465637207,.012708572670817375,.08862338215112686,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.21270370483398438,-.966137707233429,.14606566727161407,0,.49890995025634766,.2359165996313095,.8339261412620544,0,-.8401462435722351,-.10450579971075058,.5321959853172302,0,.013112368993461132,.012508046813309193,.07517509907484055,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.04150351136922836,.016039609909057617,.05719054117798805,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.06548332422971725,.01683700829744339,.0516640841960907,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.02592567168176174,.019982583820819855,.08479326963424683,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9063700437545776,-.21756279468536377,.3621589243412018,0,.0970839336514473,.9415287375450134,.3226419687271118,0,-.41117796301841736,-.2572731077671051,.8744958639144897,0,-.0015709538711234927,.043078210204839706,.034657616168260574,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9159826040267944,-.1651475727558136,.36565208435058594,0,.09755707532167435,.9756820797920227,.1962820291519165,0,-.3891757130622864,-.14411886036396027,.9098196625709534,0,.014023927971720695,.052835866808891296,.0014903299743309617,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.023482320830225945,.05633850023150444,-.020621655508875847,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.03096788562834263,.06281610578298569,-.040703095495700836,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.04184452444314957,.022474845871329308,.08177298307418823,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9720265865325928,-.08313076198101044,.21966552734375,0,.20477405190467834,.7580050826072693,-.6192700862884521,0,-.11502730846405029,.6469289064407349,.7538246512413025,0,-.022107340395450592,.05035499855875969,.02970452979207039,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9779140949249268,-.07129573822021484,.19646917283535004,0,.1287083923816681,-.5352076292037964,-.8348574042320251,0,.1646735966205597,.8417060971260071,-.5142109394073486,0,-.017169542610645294,.022584279999136925,-.00265491777099669,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02170622907578945,-.0006043742760084569,.011511396616697311,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02438267692923546,-.0026927536819130182,.03627248480916023,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05944233387708664,.0264605600386858,.07478221505880356,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9842101335525513,.024470895528793335,.1753024309873581,0,.12200043350458145,.6237703561782837,-.7720272541046143,0,-.12824076414108276,.7812241315841675,.610936164855957,0,-.04249368980526924,.0467497780919075,.027722163125872612,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9941774606704712,.05949164181947708,.08983955532312393,0,.10504482686519623,-.7208291888237,-.6851072907447815,0,.024001073092222214,.6905553936958313,-.7228817939758301,0,-.0374927744269371,.016285063698887825,.0038980208337306976,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.038130562752485275,-.0020653479732573032,.02310742810368538,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.0390593595802784,.004176302347332239,.0466572530567646,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9147363901138306,.3458845317363739,.20885537564754486,0,-.3923271894454956,.8839452862739563,.2544005811214447,0,-.09662359952926636,-.3146490156650543,.9442773461341858,0,-.06715242564678192,.024195827543735504,.07137546688318253,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9613109827041626,.22439135611057281,.15977802872657776,0,.01002211682498455,.5511574745178223,-.8343409299850464,0,-.27528178691864014,.8036624789237976,.5275853276252747,0,-.06273911893367767,.038559623062610626,.028268879279494286,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9820972084999084,.18811029195785522,-.00995189044624567,0,.14063723385334015,-.7673450708389282,-.6256227493286133,0,-.12532226741313934,.6130226850509644,-.7800630927085876,0,-.05428232625126839,.013870777562260628,.012061242014169693,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05173685774207115,.0014194445684552193,.02790539152920246,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05098633095622063,.008463085629045963,.048688892275094986,1],radius:.005425984505563974}},gripOffsetMatrix:[.005510995630174875,-.9149997234344482,-.40341615676879883,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.9340395331382751,.13936474919319153,-.32885703444480896,0,-.031803809106349945,.007837686687707901,.04313928261399269,1]}}},te={mapping:L.None,buttons:[{id:"pinch",type:"analog",eventTrigger:"select"}],axes:[]},ie=h(),ne=v(),re=h(),ae=h(),se=v(),oe=h(),ue=h(),le=v(),ce=h(),de=(e,t,i,n)=>(u(ie,t),c(ne,t),l(re,t),u(ae,i),c(se,i),l(oe,i),g(ue,ie,ae,n),y(le,ne,se,n),g(ce,re,oe,n),function(e,t,i,n){var r=t[0],a=t[1],s=t[2],o=t[3],u=r+r,l=a+a,c=s+s,d=r*u,h=r*l,p=r*c,m=a*l,f=a*c,g=s*c,v=o*u,x=o*l,y=o*c,S=n[0],w=n[1],b=n[2];e[0]=(1-(m+g))*S,e[1]=(h+y)*S,e[2]=(p-x)*S,e[3]=0,e[4]=(h-y)*w,e[5]=(1-(d+g))*w,e[6]=(f+v)*w,e[7]=0,e[8]=(p+x)*b,e[9]=(f-v)*b,e[10]=(1-(d+m))*b,e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1}(e,le,ue,ce),e),he=[1,-1,-1,0,-1,1,1,0,-1,1,1,0,-1,1,1,1],pe=Symbol("@immersive-web-emulation-runtime/xr-hand-input");class me extends G{constructor(e,t,i){if(t!==O.Left&&t!==O.Right)throw new DOMException('handedness for XRHandInput must be either "left" or "right"',"InvalidStateError");if(!e.poses.default||!e.poses.pinch)throw new DOMException('"default" and "pinch" hand pose configs are required',"InvalidStateError");const n=new E(i),r=new E(n),a=[e.profileId,...e.fallbackProfileIds],s=new J;Object.values(U).forEach((e=>{s.set(e,new Z(e,n))}));super(new j(t,k.TrackedPointer,a,n,new D(te),r,s)),this[pe]={poseId:"default",poses:e.poses},this.updateHandPose()}get poseId(){return this[pe].poseId}set poseId(e){this[pe].poses[e]?this[pe].poseId=e:console.warn(`Pose config ${e} not found`)}updateHandPose(){const e=this[pe].poses[this[pe].poseId],t=this[pe].poses.pinch;Object.values(U).forEach((i=>{const n=e.jointTransforms[i].offsetMatrix,r=t.jointTransforms[i].offsetMatrix,a=this.inputSource.hand.get(i);de(a[R].offsetMatrix,n,r,this.pinchValue),this.inputSource.handedness===O.Right&&(e=>{for(let t=0;t<16;t++)e[t]*=he[t]})(a[R].offsetMatrix),a[Y].radius=(1-this.pinchValue)*e.jointTransforms[i].radius+this.pinchValue*t.jointTransforms[i].radius})),e.gripOffsetMatrix&&t.gripOffsetMatrix&&de(this.inputSource.gripSpace[R].offsetMatrix,e.gripOffsetMatrix,t.gripOffsetMatrix,this.pinchValue)}get pinchValue(){return this[N].inputSource.gamepad[P].buttonsMap.pinch.value}updatePinchValue(e){if(e>1||e<0)return void console.warn(`Out-of-range value ${e} provided for pinch`);this[N].inputSource.gamepad[P].buttonsMap.pinch[P].pendingValue=e}onFrameStart(e){super.onFrameStart(e),this.updateHandPose()}}const fe=Symbol("@immersive-web-emulation-runtime/xr-pose");class ge{constructor(e,t=!1,i=void 0,n=void 0){this[fe]={transform:e,emulatedPosition:t,linearVelocity:i,angularVelocity:n}}get transform(){return this[fe].transform}get emulatedPosition(){return this[fe].emulatedPosition}get linearVelocity(){return this[fe].linearVelocity}get angularVelocity(){return this[fe].angularVelocity}}const ve=Symbol("@immersive-web-emulation-runtime/xr-joint-pose");class xe extends ge{constructor(e,t,i=!1,n=void 0,r=void 0){super(e,i,n,r),this[ve]={radius:t}}get radius(){return this[ve].radius}}class ye{constructor(e=0,t=0,i=0,n=1){this.x=e,this.y=t,this.z=i,this.w=n,Object.freeze(this)}static fromPoint(e){return new ye(e.x,e.y,e.z,e.w)}matrixTransform(e){return new ye}toJSON(){return{x:this.x,y:this.y,z:this.z,w:this.w}}}const Se=void 0!==globalThis.DOMPointReadOnly?globalThis.DOMPointReadOnly:ye,we=Symbol("@immersive-web-emulation-runtime/xr-rigid-transform");class be{constructor(e,i){const n=p(0,0,0),r=v();this[we]={matrix:t(),position:e?p(e.x,e.y,e.z):n,orientation:i?F(v(),w(i.x,i.y,i.z,i.w)):r,inverse:null},this.updateMatrix()}updateMatrix(){o(this[we].matrix,this[we].orientation,this[we].position)}get matrix(){return this[we].matrix}get position(){const e=this[we].position;return new Se(e[0],e[1],e[2],1)}get orientation(){const e=this[we].orientation;return new Se(e[0],e[1],e[2],e[3])}get inverse(){if(!this[we].inverse){const e=t();if(!r(e,this[we].matrix))throw new Error("Matrix is not invertible.");let i=h();u(i,e);let n=v();c(n,e),this[we].inverse=new be(new Se(i[0],i[1],i[2],1),new Se(n[0],n[1],n[2],n[3])),this[we].inverse[we].inverse=this}return this[we].inverse}}const Me=Symbol("@immersive-web-emulation-runtime/xr-viewer-pose");class Fe extends ge{constructor(e,t,i=!1,n=void 0,r=void 0){super(e,i,n,r),this[Me]={views:Object.freeze(t)}}get views(){return this[Me].views}}const Re=Symbol("@immersive-web-emulation-runtime/xr-frame"),Ee=t(),qe=t(),Ie=t(),Te=(e,t,i)=>{I.calculateGlobalOffsetMatrix(t,Ee),I.calculateGlobalOffsetMatrix(i,qe),r(Ie,qe),a(e,Ie,Ee)};class Ve{constructor(e,i,n,r,a){this[Re]={session:e,id:i,active:n,animationFrame:r,predictedDisplayTime:a,tempMat4:t()}}get session(){return this[Re].session}get predictedDisplayTime(){return this[Re].predictedDisplayTime}getPose(e,t){if(!this[Re].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");Te(this[Re].tempMat4,e,t);const i=h();u(i,this[Re].tempMat4);const n=v();return c(n,this[Re].tempMat4),new ge(new be({x:i[0],y:i[1],z:i[2],w:1},{x:n[0],y:n[1],z:n[2],w:n[3]}),e[R].emulated)}getViewerPose(e){if(!this[Re].animationFrame)throw new DOMException("getViewerPose can only be called on XRFrame objects passed to XRSession.requestAnimationFrame callbacks.","InvalidStateError");const t=this[Re].session,i=t[He].device,n=this.getPose(i.viewerSpace,e),r=t[He].mode===je.Inline?[$.None]:[$.Left,$.Right],a=[];return r.forEach((n=>{const r=i.viewSpaces[n],s=this.getPose(r,e),o=t[He].getProjectionMatrix(n),u=new W(n,new Float32Array(o),s.transform,t);a.push(u)})),new Fe(n.transform,a,!1)}getJointPose(e,t){const i=this.getPose(e,t),n=e[Y].radius;return new xe(i.transform,n,!1)}fillJointRadii(e,t){if(e=Array.from(e),!this[Re].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(e.length>t.length)throw new DOMException("The length of jointSpaces is larger than the number of elements in radii","TypeError");let i=!0;for(let n=0;n<e.length;n++)e[n][Y].radius?t[n]=e[n][Y].radius:(t[n]=NaN,i=!1);return i}fillPoses(e,t,i){if(e=Array.from(e),!this[Re].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(16*e.length>i.length)throw new DOMException("The length of spaces multiplied by 16 is larger than the number of elements in transforms","TypeError");return e.forEach(((e,n)=>{Te(this[Re].tempMat4,e,t);for(let e=0;e<16;e++)i[16*n+e]=this[Re].tempMat4[e]})),!0}}class Pe extends Event{constructor(e,t){if(super(e,t),!t.session)throw new Error("XRInputSourcesChangeEventInit.session is required");if(!t.added)throw new Error("XRInputSourcesChangeEventInit.added is required");if(!t.removed)throw new Error("XRInputSourcesChangeEventInit.removed is required");this.session=t.session,this.added=t.added,this.removed=t.removed}}var Le;const Oe=Symbol("@immersive-web-emulation-runtime/xr-reference-space");var ke;!function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded"}(ke||(ke={}));class Ae extends E{constructor(e,t,i){super(t,i),this[Le]={type:null,onreset:()=>{}},this[Oe].type=e}get onreset(){var e;return null!==(e=this[Oe].onreset)&&void 0!==e?e:()=>{}}set onreset(e){this[Oe].onreset&&this.removeEventListener("reset",this[Oe].onreset),this[Oe].onreset=e,e&&this.addEventListener("reset",e)}getOffsetReferenceSpace(e){return new Ae(this[Oe].type,this,e)}}Le=Oe;const ze=Symbol("@immersive-web-emulation-runtime/xr-render-state");class De{constructor(e={},t){this[ze]={depthNear:e.depthNear||(null==t?void 0:t.depthNear)||.1,depthFar:e.depthFar||(null==t?void 0:t.depthFar)||1e3,inlineVerticalFieldOfView:e.inlineVerticalFieldOfView||(null==t?void 0:t.inlineVerticalFieldOfView)||null,baseLayer:e.baseLayer||(null==t?void 0:t.baseLayer)||null}}get depthNear(){return this[ze].depthNear}get depthFar(){return this[ze].depthFar}get inlineVerticalFieldOfView(){return this[ze].inlineVerticalFieldOfView}get baseLayer(){return this[ze].baseLayer}}class Ce extends Event{constructor(e,t){if(super(e,t),!t.session)throw new Error("XRSessionEventInit.session is required");this.session=t.session}}var Xe,je;!function(e){e.Visible="visible",e.VisibleBlurred="visible-blurred",e.Hidden="hidden"}(Xe||(Xe={})),function(e){e.Inline="inline",e.ImmersiveVR="immersive-vr",e.ImmersiveAR="immersive-ar"}(je||(je={}));const He=Symbol("@immersive-web-emulation-runtime/xr-session");class Ne extends EventTarget{constructor(e,i,r){super(),this[He]={device:e,mode:i,renderState:new De,pendingRenderState:null,enabledFeatures:r,isSystemKeyboardSupported:!1,ended:!1,projectionMatrices:{[$.Left]:t(),[$.Right]:t(),[$.None]:t()},getProjectionMatrix:e=>this[He].projectionMatrices[e],referenceSpaceIsSupported:e=>{if(!this[He].enabledFeatures.includes(e))return!1;switch(e){case ke.Viewer:return!0;case ke.Local:case ke.LocalFloor:case ke.BoundedFloor:case ke.Unbounded:return this[He].mode!=je.Inline}},frameHandle:0,frameCallbacks:[],currentFrameCallbacks:null,onDeviceFrame:()=>{if(this[He].ended)return;this[He].deviceFrameHandle=globalThis.requestAnimationFrame(this[He].onDeviceFrame),null!=this[He].pendingRenderState&&(this[He].renderState=this[He].pendingRenderState,this[He].pendingRenderState=null,this[He].device[tt].onBaseLayerSet(this[He].renderState.baseLayer));const e=this[He].renderState.baseLayer;if(null===e)return;const t=e.context,i=t.canvas;if(this[He].mode!=je.Inline){const e=t.getParameter(t.COLOR_CLEAR_VALUE),i=t.getParameter(t.DEPTH_CLEAR_VALUE),n=t.getParameter(t.STENCIL_CLEAR_VALUE);t.clearColor(0,0,0,0),t.clearDepth(1),t.clearStencil(0),t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT|t.STENCIL_BUFFER_BIT),t.clearColor(e[0],e[1],e[2],e[3]),t.clearDepth(i),t.clearStencil(n)}const{depthNear:r,depthFar:a}=this[He].renderState,{width:s,height:o}=i;if(this[He].mode!==je.Inline){const e=s*(this[He].device.stereoEnabled?.5:1)/o;d(this[He].projectionMatrices[$.Left],this[He].device.fovy,e,r,a),n(this[He].projectionMatrices[$.Right],this[He].projectionMatrices[$.Left])}else{const e=s/o;d(this[He].projectionMatrices[$.None],this[He].renderState.inlineVerticalFieldOfView,e,r,a)}const u=new Ve(this,this[He].frameHandle,!0,!0,performance.now());this[He].device[tt].onFrameStart(u),this[He].updateActiveInputSources();const l=this[He].currentFrameCallbacks=this[He].frameCallbacks;this[He].frameCallbacks=[];const c=performance.now();for(let e=0;e<l.length;e++)try{l[e].cancelled||l[e].callback(c,u)}catch(e){console.error(e)}this[He].currentFrameCallbacks=null,u[Re].active=!1},nominalFrameRate:e.internalNominalFrameRate,referenceSpaces:[],inputSourceArray:[],activeInputSources:[],updateActiveInputSources:()=>{const e=this[He].enabledFeatures.includes(et.HandTracking),t=this[He].activeInputSources,i=this[He].device.inputSources.filter((t=>!t.hand||e)),n=i.filter((e=>!t.includes(e))),r=t.filter((e=>!i.includes(e)));(n.length>0||r.length>0)&&this.dispatchEvent(new Pe("inputsourceschange",{session:this,added:n,removed:r})),this[He].activeInputSources=i},onend:null,oninputsourceschange:null,onselect:null,onselectstart:null,onselectend:null,onsqueeze:null,onsqueezestart:null,onsqueezeend:null,onvisibilitychange:null,onframeratechange:null},this[He].onDeviceFrame()}get visibilityState(){return this[He].device.visibilityState}get frameRate(){return this[He].nominalFrameRate}get supportedFrameRates(){return new Float32Array(this[He].device.supportedFrameRates)}get renderState(){return this[He].renderState}get inputSources(){return this[He].inputSourceArray.length=0,this[He].ended||this[He].mode===je.Inline||this[He].inputSourceArray.push(...this[He].activeInputSources),this[He].inputSourceArray}get enabledFeatures(){return this[He].enabledFeatures}get isSystemKeyboardSupported(){return this[He].isSystemKeyboardSupported}updateRenderState(e={}){var t,i,n,r;if(this[He].ended)throw new DOMException("XRSession has already ended.","InvalidStateError");if(e.baseLayer&&e.baseLayer[Ge].session!==this)throw new DOMException("Base layer was created by a different XRSession","InvalidStateError");if(null!=e.inlineVerticalFieldOfView&&this[He].mode!==je.Inline)throw new DOMException("InlineVerticalFieldOfView must not be set for an immersive session","InvalidStateError");const a={baseLayer:e.baseLayer||(null===(t=this[He].pendingRenderState)||void 0===t?void 0:t.baseLayer)||void 0,depthFar:e.depthFar||(null===(i=this[He].pendingRenderState)||void 0===i?void 0:i.depthFar)||void 0,depthNear:e.depthNear||(null===(n=this[He].pendingRenderState)||void 0===n?void 0:n.depthNear)||void 0,inlineVerticalFieldOfView:e.inlineVerticalFieldOfView||(null===(r=this[He].pendingRenderState)||void 0===r?void 0:r.inlineVerticalFieldOfView)||void 0};this[He].pendingRenderState=new De(a,this[He].renderState)}async updateTargetFrameRate(e){return new Promise(((t,i)=>{this[He].ended?i(new DOMException("XRSession has already ended.","InvalidStateError")):this[He].device.supportedFrameRates.includes(e)?(this[He].nominalFrameRate===e?console.log("Requested frame rate is the same as the current nominal frame rate, no update made"):(this[He].nominalFrameRate=e,this.dispatchEvent(new Ce("frameratechange",{session:this})),console.log(`Nominal frame rate updated to ${e}`)),t()):i(new DOMException("Requested frame rate not supported.","InvalidStateError"))}))}async requestReferenceSpace(e){return new Promise(((t,i)=>{if(this[He].ended||!this[He].referenceSpaceIsSupported(e))return void i(new DOMException("The requested reference space type is not supported.","NotSupportedError"));let n;switch(e){case ke.Viewer:n=this[He].device.viewerSpace;break;case ke.Local:n=new Ae(e,this[He].device[tt].globalSpace,this[He].device.viewerSpace[R].offsetMatrix);break;case ke.LocalFloor:case ke.BoundedFloor:case ke.Unbounded:n=new Ae(e,this[He].device[tt].globalSpace)}this[He].referenceSpaces.push(n),t(n)}))}requestAnimationFrame(e){if(this[He].ended)return 0;const t=++this[He].frameHandle;return this[He].frameCallbacks.push({handle:t,callback:e,cancelled:!1}),t}cancelAnimationFrame(e){let t=this[He].frameCallbacks,i=t.findIndex((t=>t&&t.handle===e));i>-1&&(t[i].cancelled=!0,t.splice(i,1)),t=this[He].currentFrameCallbacks,t&&(i=t.findIndex((t=>t&&t.handle===e)),i>-1&&(t[i].cancelled=!0))}async end(){return new Promise(((e,t)=>{this[He].ended||null===this[He].deviceFrameHandle?t(new DOMException("XRSession has already ended.","InvalidStateError")):(globalThis.cancelAnimationFrame(this[He].deviceFrameHandle),this[He].device[tt].onSessionEnd(),this.dispatchEvent(new Ce("end",{session:this})),e())}))}get onend(){var e;return null!==(e=this[He].onend)&&void 0!==e?e:()=>{}}set onend(e){this[He].onend&&this.removeEventListener("end",this[He].onend),this[He].onend=e,e&&this.addEventListener("end",e)}get oninputsourceschange(){var e;return null!==(e=this[He].oninputsourceschange)&&void 0!==e?e:()=>{}}set oninputsourceschange(e){this[He].oninputsourceschange&&this.removeEventListener("inputsourceschange",this[He].oninputsourceschange),this[He].oninputsourceschange=e,e&&this.addEventListener("inputsourceschange",e)}get onselect(){var e;return null!==(e=this[He].onselect)&&void 0!==e?e:()=>{}}set onselect(e){this[He].onselect&&this.removeEventListener("select",this[He].onselect),this[He].onselect=e,e&&this.addEventListener("select",e)}get onselectstart(){var e;return null!==(e=this[He].onselectstart)&&void 0!==e?e:()=>{}}set onselectstart(e){this[He].onselectstart&&this.removeEventListener("selectstart",this[He].onselectstart),this[He].onselectstart=e,e&&this.addEventListener("selectstart",e)}get onselectend(){var e;return null!==(e=this[He].onselectend)&&void 0!==e?e:()=>{}}set onselectend(e){this[He].onselectend&&this.removeEventListener("selectend",this[He].onselectend),this[He].onselectend=e,e&&this.addEventListener("selectend",e)}get onsqueeze(){var e;return null!==(e=this[He].onsqueeze)&&void 0!==e?e:()=>{}}set onsqueeze(e){this[He].onsqueeze&&this.removeEventListener("squeeze",this[He].onsqueeze),this[He].onsqueeze=e,e&&this.addEventListener("squeeze",e)}get onsqueezestart(){var e;return null!==(e=this[He].onsqueezestart)&&void 0!==e?e:()=>{}}set onsqueezestart(e){this[He].onsqueezestart&&this.removeEventListener("squeezestart",this[He].onsqueezestart),this[He].onsqueezestart=e,e&&this.addEventListener("squeezestart",e)}get onsqueezeend(){var e;return null!==(e=this[He].onsqueezeend)&&void 0!==e?e:()=>{}}set onsqueezeend(e){this[He].onsqueezeend&&this.removeEventListener("squeezeend",this[He].onsqueezeend),this[He].onsqueezeend=e,e&&this.addEventListener("squeezeend",e)}get onvisibilitychange(){var e;return null!==(e=this[He].onvisibilitychange)&&void 0!==e?e:()=>{}}set onvisibilitychange(e){this[He].onvisibilitychange&&this.removeEventListener("visibilitychange",this[He].onvisibilitychange),this[He].onvisibilitychange=e,e&&this.addEventListener("visibilitychange",e)}get onframeratechange(){var e;return null!==(e=this[He].onframeratechange)&&void 0!==e?e:()=>{}}set onframeratechange(e){this[He].onframeratechange&&this.removeEventListener("frameratechange",this[He].onframeratechange),this[He].onframeratechange=e,e&&this.addEventListener("frameratechange",e)}}class Be extends EventTarget{}const Ge=Symbol("@immersive-web-emulation-runtime/XRWebGLLayer"),Qe={antialias:!0,depth:!0,stencil:!1,alpha:!0,ignoreDepthValues:!1,framebufferScaleFactor:1};class Ke extends Be{constructor(e,t,i={}){if(super(),e[He].ended)throw new DOMException("Session has ended","InvalidStateError");const n={...Qe,...i};this[Ge]={session:e,context:t,antialias:n.antialias}}get context(){return this[Ge].context}get antialias(){return this[Ge].antialias}get ignoreDepthValues(){return!0}get framebuffer(){return null}get framebufferWidth(){return this[Ge].context.drawingBufferWidth}get framebufferHeight(){return this[Ge].context.drawingBufferHeight}getViewport(e){if(e[_].session!==this[Ge].session)throw new DOMException("View's session differs from Layer's session","InvalidStateError");return this[Ge].session[He].device[tt].getViewport(this,e)}static getNativeFramebufferScaleFactor(e){if(!(e instanceof Ne))throw new TypeError("getNativeFramebufferScaleFactor must be passed a session.");return e[He].ended?0:1}}const _e=Symbol("@immersive-web-emulation-runtime/xr-system");class $e extends EventTarget{constructor(e){super(),this[_e]={device:e}}isSessionSupported(e){return new Promise(((t,i)=>{e===je.Inline?t(!0):t(this[_e].device.supportedSessionModes.includes(e))}))}requestSession(e,t={}){return new Promise(((i,n)=>{this.isSessionSupported(e).then((r=>{if(!r)return void n(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"));if(this[_e].activeSession)return void n(new DOMException("An active XRSession already exists.","InvalidStateError"));const{requiredFeatures:a=[],optionalFeatures:s=[]}=t,{supportedFeatures:o}=this[_e].device;if(!a.every((e=>o.includes(e))))return void n(new Error("One or more required features are not supported by the device."));const u=s.filter((e=>o.includes(e))),l=Array.from(new Set([...a,...u,et.Viewer,et.Local])),c=new Ne(this[_e].device,e,l);this[_e].activeSession=c,c.addEventListener("end",(()=>{this[_e].activeSession=void 0})),i(c)})).catch(n)}))}}const Ue=Symbol("@immersive-web-emulation-runtime/action-player");class We{constructor(e,t,i){const{schema:n,frames:r}=t;if(!r||!n||0===r.length)throw new DOMException("wrong recording format","NotSupportedError");const a=new Ae(ke.Viewer,e),o={[$.Left]:new E(a),[$.Right]:new E(a),[$.None]:new E(a)};this[Ue]={refSpace:e,inputSources:new Map,inputSchemas:new Map,frames:r,recordedFramePointer:0,startingTimeStamp:r[0][0],endingTimeStamp:r[r.length-1][0],playbackTime:r[0][0],playing:!1,viewerSpace:a,viewSpaces:o,vec3:h(),quat:v()},s(this[Ue].viewSpaces[$.Left][R].offsetMatrix,p(-i/2,0,0)),s(this[Ue].viewSpaces[$.Right][R].offsetMatrix,p(i/2,0,0)),n.forEach((t=>{const i=t[0],n=t[1];let r;if(n.hasGamepad){const e=[];for(let t=0;t<n.numButtons;t++)e.push({id:t.toString(),type:"manual"});const t=[];for(let e=0;e<n.numAxes;e++)t.push({id:e.toString(),type:"manual"});r=new D({mapping:n.mapping,buttons:e,axes:t})}const a=new E(e);let s;n.hasHand&&(s=new J,Object.values(U).forEach((e=>{s.set(e,new Z(e,a))})));const o=new j(n.handedness,n.targetRayMode,n.profiles,a,r,n.hasGrip?new E(e):void 0,n.hasHand?s:void 0);this[Ue].inputSources.set(i,{active:!1,source:o}),this[Ue].inputSchemas.set(i,n)}))}play(){this[Ue].recordedFramePointer=0,this[Ue].playbackTime=this[Ue].startingTimeStamp,this[Ue].playing=!0,this[Ue].actualTimeStamp=performance.now()}stop(){this[Ue].playing=!1}get playing(){return this[Ue].playing}get viewerSpace(){return this[Ue].viewerSpace}get viewSpaces(){return this[Ue].viewSpaces}get inputSources(){return Array.from(this[Ue].inputSources.values()).filter((e=>e.active)).map((e=>e.source))}playFrame(){const e=performance.now(),t=e-this[Ue].actualTimeStamp;if(this[Ue].actualTimeStamp=e,this[Ue].playbackTime+=t,this[Ue].playbackTime>this[Ue].endingTimeStamp)return void this.stop();for(;this[Ue].frames[this[Ue].recordedFramePointer+1][0]<this[Ue].playbackTime;)this[Ue].recordedFramePointer++;const i=this[Ue].frames[this[Ue].recordedFramePointer],n=this[Ue].frames[this[Ue].recordedFramePointer+1],r=(this[Ue].playbackTime-i[0])/(n[0]-i[0]);this.updateXRSpaceFromMergedFrames(this[Ue].viewerSpace,i.slice(1,8),n.slice(1,8),r);const a=new Map;for(let e=8;e<i.length;e++){const{index:t,inputData:n}=this.processRawInputData(i[e]);a.set(t,n)}const s=new Map;for(let e=8;e<n.length;e++){const{index:t,inputData:i}=this.processRawInputData(n[e]);s.set(t,i)}this[Ue].inputSources.forEach((e=>{e.active=!1})),s.forEach(((e,t)=>{this[Ue].inputSources.get(t).active=!0;const i=this[Ue].inputSources.get(t).source,n=this[Ue].inputSchemas.get(t);this.updateInputSource(i,n,a.has(t)?a.get(t):e,e,r)}))}updateInputSource(e,t,i,n,r){if(this.updateXRSpaceFromMergedFrames(e.targetRaySpace,i.targetRayTransform,n.targetRayTransform,r),t.hasGrip&&this.updateXRSpaceFromMergedFrames(e.gripSpace,i.gripTransform,n.gripTransform,r),t.hasHand)for(let a=0;a<25;a++){const s=i.handTransforms.slice(8*a,8*a+7),o=n.handTransforms.slice(8*a,8*a+7),u=i.handTransforms[8*a+7],l=n.handTransforms[8*a+7],c=e.hand.get(t.jointSequence[a]);this.updateXRSpaceFromMergedFrames(c,s,o,r),c[Y].radius=(l-u)*r+u}if(t.hasGamepad){const t=e.gamepad;n.buttons.forEach(((e,n)=>{const a=t.buttons[n];a[P].pressed=1===e[0],a[P].touched=1===e[1];const s=i.buttons[n][2],o=e[2];a[P].value=(o-s)*r+s})),n.axes.forEach(((e,n)=>{const a=i.axes[n];t[P].axesMap[n.toString()].x=(e-a)*r+a}))}}updateXRSpaceFromMergedFrames(e,t,i,n){const r=p(t[0],t[1],t[2]),a=w(t[3],t[4],t[5],t[6]),s=p(i[0],i[1],i[2]),u=w(i[3],i[4],i[5],i[6]);g(this[Ue].vec3,r,s,n),y(this[Ue].quat,a,u,n),o(e[R].offsetMatrix,this[Ue].quat,this[Ue].vec3)}processRawInputData(e){const t=e[0],i=this[Ue].inputSchemas.get(t),n={targetRayTransform:e.slice(1,8)};let r=8;if(i.hasGrip&&(n.gripTransform=e[r++]),i.hasHand&&(n.handTransforms=e[r++]),i.hasGamepad){const t=e[r];n.buttons=t.slice(0,i.numButtons),n.axes=t.slice(i.numButtons)}return{index:t,inputData:n}}}class Je extends Event{constructor(e,t){if(super(e,t),!t.referenceSpace)throw new Error("XRReferenceSpaceEventInit.referenceSpace is required");this.referenceSpace=t.referenceSpace,this.transform=t.transform}}const Ye=Symbol("@immersive-web-emulation-runtime/xr-viewport");class Ze{constructor(e,t,i,n){this[Ye]={x:e,y:t,width:i,height:n}}get x(){return this[Ye].x}get y(){return this[Ye].y}get width(){return this[Ye].width}get height(){return this[Ye].height}}var et;!function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded",e.DomOverlay="dom-overlay",e.Anchors="anchors",e.PlaneDetection="plane-detection",e.MeshDetection="mesh-detection",e.HitTest="hit-test",e.HandTracking="hand-tracking",e.DepthSensing="depth-sensing"}(et||(et={}));const tt=Symbol("@immersive-web-emulation-runtime/xr-device"),it={ipd:.063,fovy:Math.PI/2,headsetPosition:new T(0,1.6,0),headsetQuaternion:new V,stereoEnabled:!1};class nt{constructor(e,i={}){var n,r,a,u,l,c;const d=new q,h=new Ae(ke.Viewer,d),m={[$.Left]:new E(h),[$.Right]:new E(h),[$.None]:new E(h)},f=e.controllerConfig,g={};f&&Object.values(O).forEach((e=>{f.layout[e]&&(g[e]=new K(f,e,d))}));const v={[O.Left]:new me(ee,O.Left,d),[O.Right]:new me(ee,O.Right,d)},x=null!==(n=i.canvasContainer)&&void 0!==n?n:document.createElement("div");x.dataset.webxr_runtime="Immersive Web Emulation Runtime v1.0.2",x.style.position="fixed",x.style.width="100%",x.style.height="100%",x.style.top="0",x.style.left="0",x.style.display="flex",x.style.justifyContent="center",x.style.alignItems="center",x.style.overflow="hidden",x.style.zIndex="999",this[tt]={name:e.name,supportedSessionModes:e.supportedSessionModes,supportedFeatures:e.supportedFeatures,supportedFrameRates:e.supportedFrameRates,isSystemKeyboardSupported:e.isSystemKeyboardSupported,internalNominalFrameRate:e.internalNominalFrameRate,userAgent:e.userAgent,position:null!==(r=i.headsetPosition)&&void 0!==r?r:it.headsetPosition.clone(),quaternion:null!==(a=i.headsetQuaternion)&&void 0!==a?a:it.headsetQuaternion.clone(),stereoEnabled:null!==(u=i.stereoEnabled)&&void 0!==u?u:it.stereoEnabled,ipd:null!==(l=i.ipd)&&void 0!==l?l:it.ipd,fovy:null!==(c=i.fovy)&&void 0!==c?c:it.fovy,controllers:g,hands:v,primaryInputMode:"controller",pendingReferenceSpaceReset:!1,visibilityState:Xe.Visible,pendingVisibilityState:null,xrSystem:null,matrix:t(),globalSpace:d,viewerSpace:h,viewSpaces:m,canvasContainer:x,getViewport:(e,t)=>{const i=e.context.canvas,{width:n,height:r}=i;switch(t.eye){case $.None:return new Ze(0,0,n,r);case $.Left:return new Ze(0,0,this[tt].stereoEnabled?n/2:n,r);case $.Right:return new Ze(n/2,0,this[tt].stereoEnabled?n/2:0,r)}},updateViews:()=>{o(this[tt].viewerSpace[R].offsetMatrix,this[tt].quaternion.quat,this[tt].position.vec3),s(this[tt].viewSpaces[$.Left][R].offsetMatrix,p(-this[tt].ipd/2,0,0)),s(this[tt].viewSpaces[$.Right][R].offsetMatrix,p(this[tt].ipd/2,0,0))},onBaseLayerSet:e=>{if(!e)return;const t=e.context.canvas;t.parentElement!==this[tt].canvasContainer&&(this[tt].canvasData={canvas:t,parent:t.parentElement,width:t.width,height:t.height},this[tt].canvasContainer.appendChild(t),document.body.appendChild(this[tt].canvasContainer)),t.width=window.innerWidth,t.height=window.innerHeight},onSessionEnd:()=>{if(this[tt].canvasData){const{canvas:e,parent:t,width:i,height:n}=this[tt].canvasData;e.width=i,e.height=n,t?t.appendChild(e):this[tt].canvasContainer.removeChild(e),document.body.removeChild(this[tt].canvasContainer),window.dispatchEvent(new Event("resize"))}},onFrameStart:e=>{var t;if(null===(t=this[tt].actionPlayer)||void 0===t?void 0:t.playing)this[tt].actionPlayer.playFrame();else{const t=e.session;this[tt].updateViews(),this[tt].pendingVisibilityState&&(this[tt].visibilityState=this[tt].pendingVisibilityState,this[tt].pendingVisibilityState=null,t.dispatchEvent(new Ce("visibilitychange",{session:t}))),this[tt].visibilityState===Xe.Visible&&this.activeInputs.forEach((t=>{t.onFrameStart(e)})),this[tt].pendingReferenceSpaceReset&&(t[He].referenceSpaces.forEach((e=>{switch(e[Oe].type){case ke.Local:case ke.LocalFloor:case ke.BoundedFloor:case ke.Unbounded:e.dispatchEvent(new Je("reset",{referenceSpace:e}))}})),this[tt].pendingReferenceSpaceReset=!1)}this[tt].updateViews()}},this[tt].updateViews()}installRuntime(e=globalThis){Object.defineProperty(WebGL2RenderingContext.prototype,"makeXRCompatible",{value:function(){return new Promise(((e,t)=>{e(!0)}))},configurable:!0}),this[tt].xrSystem=new $e(this),Object.defineProperty(globalThis.navigator,"xr",{value:this[tt].xrSystem,configurable:!0}),Object.defineProperty(navigator,"userAgent",{value:this[tt].userAgent,writable:!1,configurable:!1,enumerable:!0}),e.XRSystem=$e,e.XRSession=Ne,e.XRRenderState=De,e.XRFrame=Ve,e.XRSpace=E,e.XRReferenceSpace=Ae,e.XRJointSpace=Z,e.XRView=W,e.XRViewport=Ze,e.XRRigidTransform=be,e.XRPose=ge,e.XRViewerPose=Fe,e.XRJointPose=xe,e.XRInputSource=j,e.XRInputSourceArray=C,e.XRHand=J,e.XRLayer=Be,e.XRWebGLLayer=Ke,e.XRSessionEvent=Ce,e.XRInputSourceEvent=H,e.XRInputSourcesChangeEvent=Pe,e.XRReferenceSpaceEvent=Je}get supportedSessionModes(){return this[tt].supportedSessionModes}get supportedFeatures(){return this[tt].supportedFeatures}get supportedFrameRates(){return this[tt].supportedFrameRates}get isSystemKeyboardSupported(){return this[tt].isSystemKeyboardSupported}get internalNominalFrameRate(){return this[tt].internalNominalFrameRate}get stereoEnabled(){return this[tt].stereoEnabled}set stereoEnabled(e){this[tt].stereoEnabled=e}get ipd(){return this[tt].ipd}set ipd(e){this[tt].ipd=e}get fovy(){return this[tt].fovy}set fovy(e){this[tt].fovy=e}get position(){return this[tt].position}get quaternion(){return this[tt].quaternion}get viewerSpace(){var e;return(null===(e=this[tt].actionPlayer)||void 0===e?void 0:e.playing)?this[tt].actionPlayer.viewerSpace:this[tt].viewerSpace}get viewSpaces(){var e;return(null===(e=this[tt].actionPlayer)||void 0===e?void 0:e.playing)?this[tt].actionPlayer.viewSpaces:this[tt].viewSpaces}get controllers(){return this[tt].controllers}get hands(){return this[tt].hands}get primaryInputMode(){return this[tt].primaryInputMode}set primaryInputMode(e){"controller"===e||"hand"===e?this[tt].primaryInputMode=e:console.warn('primary input mode can only be "controller" or "hand"')}get activeInputs(){if(this[tt].visibilityState!==Xe.Visible)return[];return("controller"===this[tt].primaryInputMode?Object.values(this[tt].controllers):Object.values(this[tt].hands)).filter((e=>e.connected))}get inputSources(){var e;return(null===(e=this[tt].actionPlayer)||void 0===e?void 0:e.playing)?this[tt].actionPlayer.inputSources:this.activeInputs.map((e=>e.inputSource))}get canvasContainer(){return this[tt].canvasContainer}get activeSession(){var e;return null===(e=this[tt].xrSystem)||void 0===e?void 0:e[_e].activeSession}recenter(){const e=new T(-this.position.x,0,-this.position.z),t=new T(0,0,-1).applyQuaternion(this.quaternion);t.y=0,t.normalize();const i=Math.atan2(t.x,-t.z),n=(new V).setFromAxisAngle(new T(0,1,0),i);this.position.add(e),this.quaternion.multiply(n),[...Object.values(this[tt].controllers),...Object.values(this[tt].hands)].forEach((t=>{t.position.add(e),t.quaternion.multiply(n),t.position.applyQuaternion(n)})),this[tt].pendingReferenceSpaceReset=!0}get visibilityState(){return this[tt].visibilityState}updateVisibilityState(e){if(!Object.values(Xe).includes(e))throw new DOMException("Invalid XRVisibilityState value","NotSupportedError");e!==this[tt].visibilityState&&(this[tt].pendingVisibilityState=e)}createActionPlayer(e,t){return this[tt].actionPlayer=new We(e,t,this[tt].ipd),this[tt].actionPlayer}}const rt={mapping:L.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"x-button",type:"binary"},{id:"y-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},at={mapping:L.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"a-button",type:"binary"},{id:"b-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},st={profileId:"oculus-touch-v3",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rt,gripOffsetMatrix:[.9925461411476135,2.0823669899527886e-8,-.12186937034130096,0,.08617465198040009,.7071067094802856,.701836109161377,0,.08617466688156128,-.7071067690849304,.7018360495567322,0,-.003979838453233242,-.015857907012104988,.04964181408286095,1],numHapticActuators:1},right:{gamepad:at,gripOffsetMatrix:[.9925461411476135,-8.329467959811154e-8,.12186941504478455,0,-.08617465943098068,.7071066498756409,.7018361687660217,0,-.08617471158504486,-.7071068286895752,.7018359303474426,0,.003979798872023821,-.015857888385653496,.049641866236925125,1],numHapticActuators:1}}},ot={profileId:"meta-quest-touch-pro",fallbackProfileIds:["oculus-touch-v2","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rt,gripOffsetMatrix:[.9925461411476135,-1.5779937356796836e-8,-.12186935544013977,0,.08617467433214188,.7071067094802856,.701836109161377,0,.0861746296286583,-.7071067690849304,.7018360495567322,0,-.003979836590588093,-.015857847407460213,.049641840159893036,1],numHapticActuators:3},right:{gamepad:at,gripOffsetMatrix:[.9925461411476135,9267653311439972e-26,.12186937034130096,0,-.08617467433214188,.7071067094802856,.7018361687660217,0,-.08617464452981949,-.7071067690849304,.7018360495567322,0,.003979847766458988,-.01585782691836357,.04964186251163483,1],numHapticActuators:3}}},ut={profileId:"meta-quest-touch-plus",fallbackProfileIds:["oculus-touch-v3","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rt,gripOffsetMatrix:[.9925461411476135,1.0736208366779465e-8,-.12186933308839798,0,.08617459982633591,.70710688829422,.7018360495567322,0,.08617466688156128,-.7071067094802856,.7018362283706665,0,-.003979803062975407,-.015857873484492302,.04964187368750572,1],numHapticActuators:1},right:{gamepad:at,gripOffsetMatrix:[.9925461411476135,-2.6238110351073374e-8,.12186934053897858,0,-.0861746147274971,.7071067690849304,.7018360495567322,0,-.08617465943098068,-.7071067094802856,.701836109161377,0,.003979838453233242,-.015857869759202003,.04964182525873184,1],numHapticActuators:1}}},lt={name:"Oculus Quest 1",controllerConfig:{profileId:"oculus-touch-v2",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:rt,gripOffsetMatrix:[.9925461411476135,4.673031295254759e-9,-.12186938524246216,0,.08617470413446426,.7071065306663513,.7018362283706665,0,.0861746296286583,-.70710688829422,.7018358707427979,0,-.003979847766458988,-.01585787907242775,.04964185878634453,1],numHapticActuators:1},right:{gamepad:at,gripOffsetMatrix:[.9925461411476135,3.688163374704345e-8,.12186937034130096,0,-.08617469668388367,.7071066498756409,.7018361687660217,0,-.0861746147274971,-.7071068286895752,.7018359899520874,0,.003979853354394436,-.01585787907242775,.04964182525873184,1],numHapticActuators:1}}},supportedSessionModes:[je.Inline,je.ImmersiveVR,je.ImmersiveAR],supportedFeatures:[et.Viewer,et.Local,et.LocalFloor,et.BoundedFloor,et.Unbounded,et.Anchors,et.PlaneDetection,et.HandTracking],supportedFrameRates:[72,80,90],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 1) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},ct={name:"Meta Quest 2",controllerConfig:st,supportedSessionModes:[je.Inline,je.ImmersiveVR,je.ImmersiveAR],supportedFeatures:[et.Viewer,et.Local,et.LocalFloor,et.BoundedFloor,et.Unbounded,et.Anchors,et.PlaneDetection,et.MeshDetection,et.HitTest,et.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},dt={name:"Meta Quest Pro",controllerConfig:ot,supportedSessionModes:[je.Inline,je.ImmersiveVR,je.ImmersiveAR],supportedFeatures:[et.Viewer,et.Local,et.LocalFloor,et.BoundedFloor,et.Unbounded,et.Anchors,et.PlaneDetection,et.MeshDetection,et.HitTest,et.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest Pro) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},ht={name:"Meta Quest 3",controllerConfig:ut,supportedSessionModes:[je.Inline,je.ImmersiveVR,je.ImmersiveAR],supportedFeatures:[et.Viewer,et.Local,et.LocalFloor,et.BoundedFloor,et.Unbounded,et.Anchors,et.PlaneDetection,et.MeshDetection,et.HitTest,et.HandTracking,et.DepthSensing],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 3) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},pt=Symbol("@immersive-web-emulation-runtime/action-recorder"),mt=e=>{const t=[];return e.forEach((e=>{t.push(parseFloat(e.toFixed(3)))})),t};class ft{constructor(e,t){this[pt]={session:e,refSpace:t,inputMap:new Map,schemaMap:new Map,compressedFrames:[],jointRadii:new Float32Array(25),jointTransforms:new Float32Array(400)}}recordFrame(e){var t;const i=performance.now(),n=null===(t=e.getViewerPose(this[pt].refSpace))||void 0===t?void 0:t.transform.matrix;if(!n)return;const r={timeStamp:i,position:u(h(),n),quaternion:c(v(),n),inputFrames:[]};this[pt].session.inputSources.forEach((t=>{var i,n;if(!this[pt].inputMap.has(t)){const e={handedness:t.handedness,targetRayMode:t.targetRayMode,profiles:t.profiles,hasGrip:null!=t.gripSpace,hasHand:null!=t.hand,hasGamepad:null!=t.gamepad};e.hasHand&&(e.jointSequence=Array.from(t.hand.values()).map((e=>e.jointName))),e.hasGamepad&&(e.mapping=t.gamepad.mapping,e.numButtons=t.gamepad.buttons.length,e.numAxes=t.gamepad.axes.length);const i=this[pt].inputMap.size;this[pt].inputMap.set(t,i),this[pt].schemaMap.set(i,e)}const a=this[pt].inputMap.get(t),s=this[pt].schemaMap.get(a),o=null===(i=e.getPose(t.targetRaySpace,this[pt].refSpace))||void 0===i?void 0:i.transform.matrix;if(o){const i={index:a,targetRayTransform:{position:u(h(),o),quaternion:c(v(),o)}};if(s.hasGrip){const r=null===(n=e.getPose(t.gripSpace,this[pt].refSpace))||void 0===n?void 0:n.transform.matrix;if(r){const e=u(h(),r),t=c(v(),r);i.gripTransform={position:e,quaternion:t}}}if(s.hasHand){const n=Array.from(t.hand.values());let r=!0;if(r&&(r=e.fillPoses(n,t.targetRaySpace,this[pt].jointTransforms)),r&&(r=e.fillJointRadii(n,this[pt].jointRadii)),r){const e={};for(let t=0;t<25;t++){const i=this[pt].jointTransforms.slice(16*t,16*(t+1)),r=this[pt].jointRadii[t],a=u(h(),i),s=c(v(),i);e[n[t].jointName]={position:a,quaternion:s,radius:r}}i.hand=e}}if(s.hasGamepad){const e={buttons:t.gamepad.buttons.map((e=>e?[e.pressed?1:0,e.touched?1:0,e.value]:null)),axes:Array.from(t.gamepad.axes)};i.gamepad=e}r.inputFrames.push(i)}})),this[pt].compressedFrames.push(this.compressActionFrame(r))}compressActionFrame(e){const t=[Math.round(10*e.timeStamp)/10,...mt(e.position),...mt(e.quaternion)];return e.inputFrames.forEach((e=>{const i=e.index,n=this[pt].schemaMap.get(i),r=[i,...mt(e.targetRayTransform.position),...mt(e.targetRayTransform.quaternion)];if(n.hasGrip&&r.push([...mt(e.gripTransform.position),...mt(e.gripTransform.quaternion)]),n.hasHand){const t=[];Object.values(e.hand).forEach((({position:e,quaternion:i,radius:n})=>{t.push(...mt(e),...mt(i),parseFloat(n.toFixed(3)))})),r.push(t)}n.hasGamepad&&r.push([...e.gamepad.buttons,...e.gamepad.axes]),t.push(r)})),t}log(){const e={schema:Array.from(this[pt].schemaMap.entries()),frames:this[pt].compressedFrames};console.log(JSON.stringify(e))}}export{ft as ActionRecorder,nt as XRDevice,Ve as XRFrame,J as XRHand,j as XRInputSource,C as XRInputSourceArray,H as XRInputSourceEvent,Pe as XRInputSourcesChangeEvent,xe as XRJointPose,Z as XRJointSpace,Be as XRLayer,ge as XRPose,Ae as XRReferenceSpace,Je as XRReferenceSpaceEvent,De as XRRenderState,be as XRRigidTransform,Ne as XRSession,Ce as XRSessionEvent,E as XRSpace,$e as XRSystem,W as XRView,Fe as XRViewerPose,Ze as XRViewport,Ke as XRWebGLLayer,ct as metaQuest2,ht as metaQuest3,dt as metaQuestPro,lt as oculusQuest1};
1
+ var e="undefined"!=typeof Float32Array?Float32Array:Array;function t(){var t=new e(16);return e!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function i(t){var i=new e(16);return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}function n(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function r(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],s=t[4],o=t[5],u=t[6],l=t[7],d=t[8],c=t[9],h=t[10],p=t[11],m=t[12],f=t[13],g=t[14],v=t[15],x=i*o-n*s,y=i*u-r*s,S=i*l-a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,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function o(e,t,i){var n=t[0],r=t[1],a=t[2],s=t[3],o=n+n,u=r+r,l=a+a,d=n*o,c=n*u,h=n*l,p=r*u,m=r*l,f=a*l,g=s*o,v=s*u,x=s*l;return e[0]=1-(p+f),e[1]=c+x,e[2]=h-v,e[3]=0,e[4]=c-x,e[5]=1-(d+f),e[6]=m+g,e[7]=0,e[8]=h+v,e[9]=m-g,e[10]=1-(d+p),e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}function u(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function l(e,t){var i=t[0],n=t[1],r=t[2],a=t[4],s=t[5],o=t[6],u=t[8],l=t[9],d=t[10];return e[0]=Math.hypot(i,n,r),e[1]=Math.hypot(a,s,o),e[2]=Math.hypot(u,l,d),e}function d(t,i){var n=new e(3);l(n,i);var r=1/n[0],a=1/n[1],s=1/n[2],o=i[0]*r,u=i[1]*a,d=i[2]*s,c=i[4]*r,h=i[5]*a,p=i[6]*s,m=i[8]*r,f=i[9]*a,g=i[10]*s,v=o+h+g,x=0;return v>0?(x=2*Math.sqrt(v+1),t[3]=.25*x,t[0]=(p-f)/x,t[1]=(m-d)/x,t[2]=(u-c)/x):o>h&&o>g?(x=2*Math.sqrt(1+o-h-g),t[3]=(p-f)/x,t[0]=.25*x,t[1]=(u+c)/x,t[2]=(m+d)/x):h>g?(x=2*Math.sqrt(1+h-o-g),t[3]=(m-d)/x,t[0]=(u+c)/x,t[1]=.25*x,t[2]=(p+f)/x):(x=2*Math.sqrt(1+g-o-h),t[3]=(u-c)/x,t[0]=(m+d)/x,t[1]=(p+f)/x,t[2]=.25*x),t}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var c=function(e,t,i,n,r){var a,s=1/Math.tan(t/2);return e[0]=s/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=r&&r!==1/0?(a=1/(n-r),e[10]=(r+n)*a,e[14]=2*r*n*a):(e[10]=-1,e[14]=-2*n),e};function h(){var t=new e(3);return e!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function p(t,i,n){var r=new e(3);return r[0]=t,r[1]=i,r[2]=n,r}function m(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function f(e,t){var i=t[0],n=t[1],r=t[2],a=i*i+n*n+r*r;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function g(e,t,i,n){var r=t[0],a=t[1],s=t[2];return e[0]=r+n*(i[0]-r),e[1]=a+n*(i[1]-a),e[2]=s+n*(i[2]-s),e}function v(){var t=new e(4);return e!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function x(e,t,i){i*=.5;var n=Math.sin(i);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(i),e}function y(e,t,i,n){var r,a,s,o,u,l=t[0],d=t[1],c=t[2],h=t[3],p=i[0],m=i[1],f=i[2],g=i[3];return(a=l*p+d*m+c*f+h*g)<0&&(a=-a,p=-p,m=-m,f=-f,g=-g),1-a>1e-6?(r=Math.acos(a),s=Math.sin(r),o=Math.sin((1-n)*r)/s,u=Math.sin(n*r)/s):(o=1-n,u=n),e[0]=o*l+u*p,e[1]=o*d+u*m,e[2]=o*c+u*f,e[3]=o*h+u*g,e}h(),function(){var t,i=(t=new e(4),e!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();var S,w=function(t,i,n,r){var a=new e(4);return a[0]=t,a[1]=i,a[2]=n,a[3]=r,a},b=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},M=function(e,t,i,n,r){return e[0]=t,e[1]=i,e[2]=n,e[3]=r,e},F=function(e,t){var i=t[0],n=t[1],r=t[2],a=t[3],s=i*i+n*n+r*r+a*a;return s>0&&(s=1/Math.sqrt(s)),e[0]=i*s,e[1]=n*s,e[2]=r*s,e[3]=a*s,e};h(),p(1,0,0),p(0,1,0),v(),v(),S=new e(9),e!=Float32Array&&(S[1]=0,S[2]=0,S[3]=0,S[5]=0,S[6]=0,S[7]=0),S[0]=1,S[4]=1,S[8]=1;const R=Symbol("@immersive-web-emulation-runtime/xr-space");class E extends EventTarget{constructor(e,n){super(),this[R]={parentSpace:e,offsetMatrix:n?i(n):t(),emulated:!0}}}class q extends E{constructor(){super(void 0,t())}}class I{static updateOffsetPosition(e,t){s(e[R].offsetMatrix,t)}static updateOffsetQuaternion(e,t){const i=e[R].offsetMatrix,n=h();u(n,i),o(i,t,n)}static updateOffsetMatrix(e,t){n(e[R].offsetMatrix,t)}static calculateGlobalOffsetMatrix(e,i=t()){return a(i,e[R].parentSpace?I.calculateGlobalOffsetMatrix(e[R].parentSpace):t(),e[R].offsetMatrix),i}}class V{constructor(e=0,t=0,i=0){this.vec3=p(e,t,i),this.tempVec3=h()}get x(){return this.vec3[0]}set x(e){this.vec3[0]=e}get y(){return this.vec3[1]}set y(e){this.vec3[1]=e}get z(){return this.vec3[2]}set z(e){this.vec3[2]=e}set(e,t,i){return function(e,t,i,n){e[0]=t,e[1]=i,e[2]=n}(this.vec3,e,t,i),this}clone(){return new V(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}normalize(){return m(this.tempVec3,this.vec3),f(this.vec3,this.tempVec3),this}add(e){return m(this.tempVec3,this.vec3),function(e,t,i){e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2]}(this.vec3,this.tempVec3,e.vec3),this}applyQuaternion(e){return m(this.tempVec3,this.vec3),function(e,t,i){var n=i[0],r=i[1],a=i[2],s=i[3],o=t[0],u=t[1],l=t[2],d=r*l-a*u,c=a*o-n*l,h=n*u-r*o,p=r*h-a*c,m=a*d-n*h,f=n*c-r*d,g=2*s;d*=g,c*=g,h*=g,p*=2,m*=2,f*=2,e[0]=o+d+p,e[1]=u+c+m,e[2]=l+h+f}(this.vec3,this.tempVec3,e.quat),this}}class T{constructor(e=0,t=0,i=0,n=1){this.quat=w(e,t,i,n),this.tempQuat=v()}get x(){return this.quat[0]}set x(e){this.quat[0]=e}get y(){return this.quat[1]}set y(e){this.quat[1]=e}get z(){return this.quat[2]}set z(e){this.quat[2]=e}get w(){return this.quat[3]}set w(e){this.quat[3]=e}set(e,t,i,n){return M(this.quat,e,t,i,n),this}clone(){return new T(this.x,this.y,this.z,this.w)}copy(e){return M(this.quat,e.x,e.y,e.z,e.w),this}normalize(){return b(this.tempQuat,this.quat),F(this.quat,this.tempQuat),this}invert(){return b(this.tempQuat,this.quat),function(e,t){e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3]}(this.quat,this.tempQuat),this}multiply(e){return b(this.tempQuat,this.quat),function(e,t,i){var n=t[0],r=t[1],a=t[2],s=t[3],o=i[0],u=i[1],l=i[2],d=i[3];e[0]=n*d+s*o+r*l-a*u,e[1]=r*d+s*u+a*o-n*l,e[2]=a*d+s*l+n*u-r*o,e[3]=s*d-n*o-r*u-a*l}(this.quat,this.tempQuat,e.quat),this}setFromAxisAngle(e,t){return x(this.quat,e.vec3,t),this}}const P=Symbol("@immersive-web-emulation-runtime/gamepad");var O,L,A;!function(e){e.None="",e.Standard="standard",e.XRStandard="xr-standard"}(O||(O={}));class k{constructor(e,t){this[P]={type:e,eventTrigger:t,pressed:!1,touched:!1,value:0,lastFrameValue:0,pendingValue:null}}get pressed(){return"manual"===this[P].type?this[P].pressed:this[P].value>0}get touched(){return"manual"===this[P].type?this[P].touched:this[P].touched||this.pressed}get value(){return this[P].value}}class z{constructor(){this.pressed=!1,this.touched=!1,this.value=0}}class D{constructor(e,t="",i=-1){this[P]={id:t,index:i,connected:!1,timestamp:performance.now(),mapping:e.mapping,buttonsMap:{},buttonsSequence:[],axesMap:{},axesSequence:[],hapticActuators:[]},e.buttons.forEach((e=>{var t;null===e?this[P].buttonsSequence.push(null):(this[P].buttonsSequence.push(e.id),this[P].buttonsMap[e.id]=new k(e.type,null!==(t=e.eventTrigger)&&void 0!==t?t:null))})),e.axes.forEach((e=>{null===e?this[P].axesSequence.push(null):(this[P].axesSequence.push(e.id+e.type),this[P].axesMap[e.id]||(this[P].axesMap[e.id]={x:0,y:0}))}))}get id(){return this[P].id}get index(){return this[P].index}get connected(){return this[P].connected}get timestamp(){return this[P].timestamp}get mapping(){return this[P].mapping}get axes(){const e=[];return this[P].axesSequence.forEach((t=>{if(null===t)e.push(null);else{const i=t.substring(0,t.length-6),n=t.substring(t.length-6);e.push("y-axis"===n?this[P].axesMap[i].y:this[P].axesMap[i].x)}})),e}get buttons(){return this[P].buttonsSequence.map((e=>null===e?new z:this[P].buttonsMap[e]))}get hapticActuators(){return this[P].hapticActuators}get vibrationActuator(){return null}}!function(e){e.None="none",e.Left="left",e.Right="right"}(L||(L={})),function(e){e.Gaze="gaze",e.TrackedPointer="tracked-pointer",e.Screen="screen",e.TransientPointer="transient-pointer"}(A||(A={}));class C extends Array{}const X=Symbol("@immersive-web-emulation-runtime/xr-input-source");class j{constructor(e,t,i,n,r,a,s){this[X]={handedness:e,targetRayMode:t,targetRaySpace:n,gripSpace:a,profiles:i,gamepad:r,hand:s}}get handedness(){return this[X].handedness}get targetRayMode(){return this[X].targetRayMode}get targetRaySpace(){return this[X].targetRaySpace}get gripSpace(){return this[X].gripSpace}get profiles(){return this[X].profiles}get gamepad(){return this[X].gamepad}get hand(){return this[X].hand}}class H extends Event{constructor(e,t){if(super(e,t),!t.frame)throw new Error("XRInputSourceEventInit.frame is required");if(!t.inputSource)throw new Error("XRInputSourceEventInit.inputSource is required");this.frame=t.frame,this.inputSource=t.inputSource}}const N=Symbol("@immersive-web-emulation-runtime/xr-tracked-input"),B={[L.Left]:{position:new V(-.25,1.5,-.4),quaternion:new T},[L.Right]:{position:new V(.25,1.5,-.4),quaternion:new T},[L.None]:{position:new V(.25,1.5,-.4),quaternion:new T}};class G{constructor(e){this[N]={inputSource:e,position:B[e.handedness].position.clone(),quaternion:B[e.handedness].quaternion.clone(),connected:!0,lastFrameConnected:!1,inputSourceChanged:!0}}get position(){return this[N].position}get quaternion(){return this[N].quaternion}get inputSource(){return this[N].inputSource}get connected(){return this[N].connected}set connected(e){this[N].connected=e,this[N].inputSource.gamepad[P].connected=e}onFrameStart(e){o(this[N].inputSource.targetRaySpace[R].offsetMatrix,this[N].quaternion.quat,this[N].position.vec3);const t=e.session;this[N].inputSource.gamepad.buttons.forEach((i=>{i instanceof k&&(i[P].lastFrameValue=i[P].value,null!=i[P].pendingValue&&(i[P].value=i[P].pendingValue,i[P].pendingValue=null),null!=i[P].eventTrigger&&(0===i[P].lastFrameValue&&i[P].value>0?(t.dispatchEvent(new H(i[P].eventTrigger,{frame:e,inputSource:this[N].inputSource})),t.dispatchEvent(new H(i[P].eventTrigger+"start",{frame:e,inputSource:this[N].inputSource}))):i[P].lastFrameValue>0&&0===i[P].value&&t.dispatchEvent(new H(i[P].eventTrigger+"end",{frame:e,inputSource:this[N].inputSource}))))})),this[N].inputSourceChanged=this.connected!==this[N].lastFrameConnected,this[N].lastFrameConnected=this.connected}}const Q=Symbol("@immersive-web-emulation-runtime/xr-controller");class K extends G{constructor(e,t,i){if(!e.layout[t])throw new DOMException("Handedness not supported","InvalidStateError");const n=new E(i),r=e.layout[t].gripOffsetMatrix?new E(n,e.layout[t].gripOffsetMatrix):void 0,a=[e.profileId,...e.fallbackProfileIds];super(new j(t,A.TrackedPointer,a,n,new D(e.layout[t].gamepad),r)),this[Q]={gamepadConfig:e.layout[t].gamepad}}get gamepadConfig(){return this[Q].gamepadConfig}updateButtonValue(e,t){if(t>1||t<0)return void console.warn(`Out-of-range value ${t} provided for button ${e}.`);const i=this[N].inputSource.gamepad[P].buttonsMap[e];if(i){if("binary"===i[P].type&&1!=t&&0!=t)return void console.warn(`Non-binary value ${t} provided for binary button ${e}.`);i[P].pendingValue=t}else console.warn(`Current controller does not have button ${e}.`)}updateButtonTouch(e,t){const i=this[N].inputSource.gamepad[P].buttonsMap[e];i?i[P].touched=t:console.warn(`Current controller does not have button ${e}.`)}updateAxis(e,t,i){if(i>1||i<-1)return void console.warn(`Out-of-range value ${i} provided for ${e} axes.`);const n=this[N].inputSource.gamepad[P].axesMap[e];n?"x-axis"===t?n.x=i:"y-axis"===t&&(n.y=i):console.warn(`Current controller does not have ${e} axes.`)}updateAxes(e,t,i){if(t>1||t<-1||i>1||i<-1)return void console.warn(`Out-of-range value x:${t}, y:${i} provided for ${e} axes.`);const n=this[N].inputSource.gamepad[P].axesMap[e];n?(n.x=t,n.y=i):console.warn(`Current controller does not have ${e} axes.`)}}const W=Symbol("@immersive-web-emulation-runtime/xr-view");var _;!function(e){e.None="none",e.Left="left",e.Right="right"}(_||(_={}));class ${constructor(e,t,i,n){this[W]={eye:e,projectionMatrix:t,transform:i,recommendedViewportScale:null,requestedViewportScale:1,session:n}}get eye(){return this[W].eye}get projectionMatrix(){return this[W].projectionMatrix}get transform(){return this[W].transform}get recommendedViewportScale(){return this[W].recommendedViewportScale}requestViewportScale(e){null===e||e<=0||e>1?console.warn("Invalid scale value. Scale must be > 0 and <= 1."):this[W].requestedViewportScale=e}}const U=Symbol("@immersive-web-emulation-runtime/xr-joint-space");class J extends E{constructor(e,t,i){super(t,i),this[U]={jointName:e,radius:0}}get jointName(){return this[U].jointName}}const Y=Symbol("@immersive-web-emulation-runtime/xr-pose");class Z{constructor(e,t=!1,i=void 0,n=void 0){this[Y]={transform:e,emulatedPosition:t,linearVelocity:i,angularVelocity:n}}get transform(){return this[Y].transform}get emulatedPosition(){return this[Y].emulatedPosition}get linearVelocity(){return this[Y].linearVelocity}get angularVelocity(){return this[Y].angularVelocity}}const ee=Symbol("@immersive-web-emulation-runtime/xr-joint-pose");class te extends Z{constructor(e,t,i=!1,n=void 0,r=void 0){super(e,i,n,r),this[ee]={radius:t}}get radius(){return this[ee].radius}}class ie{constructor(e=0,t=0,i=0,n=1){this.x=e,this.y=t,this.z=i,this.w=n,Object.freeze(this)}static fromPoint(e){return new ie(e.x,e.y,e.z,e.w)}matrixTransform(e){return new ie}toJSON(){return{x:this.x,y:this.y,z:this.z,w:this.w}}}const ne=void 0!==globalThis.DOMPointReadOnly?globalThis.DOMPointReadOnly:ie,re=Symbol("@immersive-web-emulation-runtime/xr-rigid-transform");class ae{constructor(e,i){const n=p(0,0,0),r=v();this[re]={matrix:t(),position:e?p(e.x,e.y,e.z):n,orientation:i?F(v(),w(i.x,i.y,i.z,i.w)):r,inverse:null},this.updateMatrix()}updateMatrix(){o(this[re].matrix,this[re].orientation,this[re].position)}get matrix(){return this[re].matrix}get position(){const e=this[re].position;return new ne(e[0],e[1],e[2],1)}get orientation(){const e=this[re].orientation;return new ne(e[0],e[1],e[2],e[3])}get inverse(){if(!this[re].inverse){const e=t();if(!r(e,this[re].matrix))throw new Error("Matrix is not invertible.");let i=h();u(i,e);let n=v();d(n,e),this[re].inverse=new ae(new ne(i[0],i[1],i[2],1),new ne(n[0],n[1],n[2],n[3])),this[re].inverse[re].inverse=this}return this[re].inverse}}const se=Symbol("@immersive-web-emulation-runtime/xr-viewer-pose");class oe extends Z{constructor(e,t,i=!1,n=void 0,r=void 0){super(e,i,n,r),this[se]={views:Object.freeze(t)}}get views(){return this[se].views}}const ue=Symbol("@immersive-web-emulation-runtime/xr-frame"),le=t(),de=t(),ce=t(),he=(e,t,i)=>{I.calculateGlobalOffsetMatrix(t,le),I.calculateGlobalOffsetMatrix(i,de),r(ce,de),a(e,ce,le)};class pe{constructor(e,i,n,r,a){this[ue]={session:e,id:i,active:n,animationFrame:r,predictedDisplayTime:a,tempMat4:t()}}get session(){return this[ue].session}get predictedDisplayTime(){return this[ue].predictedDisplayTime}getPose(e,t){if(!this[ue].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");he(this[ue].tempMat4,e,t);const i=h();u(i,this[ue].tempMat4);const n=v();return d(n,this[ue].tempMat4),new Z(new ae({x:i[0],y:i[1],z:i[2],w:1},{x:n[0],y:n[1],z:n[2],w:n[3]}),e[R].emulated)}getViewerPose(e){if(!this[ue].animationFrame)throw new DOMException("getViewerPose can only be called on XRFrame objects passed to XRSession.requestAnimationFrame callbacks.","InvalidStateError");const t=this[ue].session,i=t[Te].device,n=this.getPose(i.viewerSpace,e),r=t[Te].mode===qe.Inline?[_.None]:[_.Left,_.Right],a=[];return r.forEach((n=>{const r=i.viewSpaces[n],s=this.getPose(r,e),o=t[Te].getProjectionMatrix(n),u=new $(n,new Float32Array(o),s.transform,t);a.push(u)})),new oe(n.transform,a,!1)}getJointPose(e,t){const i=this.getPose(e,t),n=e[U].radius;return new te(i.transform,n,!1)}fillJointRadii(e,t){if(e=Array.from(e),!this[ue].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(e.length>t.length)throw new DOMException("The length of jointSpaces is larger than the number of elements in radii","TypeError");let i=!0;for(let n=0;n<e.length;n++)e[n][U].radius?t[n]=e[n][U].radius:(t[n]=NaN,i=!1);return i}fillPoses(e,t,i){if(e=Array.from(e),!this[ue].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(16*e.length>i.length)throw new DOMException("The length of spaces multiplied by 16 is larger than the number of elements in transforms","TypeError");return e.forEach(((e,n)=>{he(this[ue].tempMat4,e,t);for(let e=0;e<16;e++)i[16*n+e]=this[ue].tempMat4[e]})),!0}}class me extends Event{constructor(e,t){if(super(e,t),!t.session)throw new Error("XRInputSourcesChangeEventInit.session is required");if(!t.added)throw new Error("XRInputSourcesChangeEventInit.added is required");if(!t.removed)throw new Error("XRInputSourcesChangeEventInit.removed is required");this.session=t.session,this.added=t.added,this.removed=t.removed}}var fe;const ge=Symbol("@immersive-web-emulation-runtime/xr-reference-space");var ve;!function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded"}(ve||(ve={}));class xe extends E{constructor(e,t,i){super(t,i),this[fe]={type:null,onreset:()=>{}},this[ge].type=e}get onreset(){var e;return null!==(e=this[ge].onreset)&&void 0!==e?e:()=>{}}set onreset(e){this[ge].onreset&&this.removeEventListener("reset",this[ge].onreset),this[ge].onreset=e,e&&this.addEventListener("reset",e)}getOffsetReferenceSpace(e){return new xe(this[ge].type,this,e)}}fe=ge;const ye=Symbol("@immersive-web-emulation-runtime/xr-render-state");class Se{constructor(e={},t){this[ye]={depthNear:e.depthNear||(null==t?void 0:t.depthNear)||.1,depthFar:e.depthFar||(null==t?void 0:t.depthFar)||1e3,inlineVerticalFieldOfView:e.inlineVerticalFieldOfView||(null==t?void 0:t.inlineVerticalFieldOfView)||null,baseLayer:e.baseLayer||(null==t?void 0:t.baseLayer)||null}}get depthNear(){return this[ye].depthNear}get depthFar(){return this[ye].depthFar}get inlineVerticalFieldOfView(){return this[ye].inlineVerticalFieldOfView}get baseLayer(){return this[ye].baseLayer}}class we extends Event{constructor(e,t){if(super(e,t),!t.session)throw new Error("XRSessionEventInit.session is required");this.session=t.session}}class be extends EventTarget{}const Me=Symbol("@immersive-web-emulation-runtime/XRWebGLLayer"),Fe={antialias:!0,depth:!0,stencil:!1,alpha:!0,ignoreDepthValues:!1,framebufferScaleFactor:1};class Re extends be{constructor(e,t,i={}){if(super(),e[Te].ended)throw new DOMException("Session has ended","InvalidStateError");const n={...Fe,...i};this[Me]={session:e,context:t,antialias:n.antialias}}get context(){return this[Me].context}get antialias(){return this[Me].antialias}get ignoreDepthValues(){return!0}get framebuffer(){return null}get framebufferWidth(){return this[Me].context.drawingBufferWidth}get framebufferHeight(){return this[Me].context.drawingBufferHeight}getViewport(e){if(e[W].session!==this[Me].session)throw new DOMException("View's session differs from Layer's session","InvalidStateError");return this[Me].session[Te].device[nt].getViewport(this,e)}static getNativeFramebufferScaleFactor(e){if(!(e instanceof Pe))throw new TypeError("getNativeFramebufferScaleFactor must be passed a session.");return e[Te].ended?0:1}}var Ee,qe,Ie,Ve;!function(e){e.Visible="visible",e.VisibleBlurred="visible-blurred",e.Hidden="hidden"}(Ee||(Ee={})),function(e){e.Inline="inline",e.ImmersiveVR="immersive-vr",e.ImmersiveAR="immersive-ar"}(qe||(qe={})),function(e){e.Opaque="opaque",e.AlphaBlend="alpha-blend",e.Additive="additive"}(Ie||(Ie={})),function(e){e.ScreenSpace="screen-space",e.WorldSpace="world-space"}(Ve||(Ve={}));const Te=Symbol("@immersive-web-emulation-runtime/xr-session");class Pe extends EventTarget{constructor(e,i,r){super(),this[Te]={device:e,mode:i,renderState:new Se,pendingRenderState:null,enabledFeatures:r,isSystemKeyboardSupported:!1,ended:!1,projectionMatrices:{[_.Left]:t(),[_.Right]:t(),[_.None]:t()},getProjectionMatrix:e=>this[Te].projectionMatrices[e],referenceSpaceIsSupported:e=>{if(!this[Te].enabledFeatures.includes(e))return!1;switch(e){case ve.Viewer:return!0;case ve.Local:case ve.LocalFloor:case ve.BoundedFloor:case ve.Unbounded:return this[Te].mode!=qe.Inline}},frameHandle:0,frameCallbacks:[],currentFrameCallbacks:null,onDeviceFrame:()=>{if(this[Te].ended)return;this[Te].deviceFrameHandle=globalThis.requestAnimationFrame(this[Te].onDeviceFrame),null!=this[Te].pendingRenderState&&(this[Te].renderState=this[Te].pendingRenderState,this[Te].pendingRenderState=null,this[Te].device[nt].onBaseLayerSet(this[Te].renderState.baseLayer));const e=this[Te].renderState.baseLayer;if(null===e)return;const t=e.context,i=t.canvas;if(this[Te].mode!=qe.Inline){const e=t.getParameter(t.COLOR_CLEAR_VALUE),i=t.getParameter(t.DEPTH_CLEAR_VALUE),n=t.getParameter(t.STENCIL_CLEAR_VALUE);t.clearColor(0,0,0,0),t.clearDepth(1),t.clearStencil(0),t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT|t.STENCIL_BUFFER_BIT),t.clearColor(e[0],e[1],e[2],e[3]),t.clearDepth(i),t.clearStencil(n)}const{depthNear:r,depthFar:a}=this[Te].renderState,{width:s,height:o}=i;if(this[Te].mode!==qe.Inline){const e=s*(this[Te].device.stereoEnabled?.5:1)/o;c(this[Te].projectionMatrices[_.Left],this[Te].device.fovy,e,r,a),n(this[Te].projectionMatrices[_.Right],this[Te].projectionMatrices[_.Left])}else{const e=s/o;c(this[Te].projectionMatrices[_.None],this[Te].renderState.inlineVerticalFieldOfView,e,r,a)}const u=new pe(this,this[Te].frameHandle,!0,!0,performance.now());this[Te].device[nt].onFrameStart(u),this[Te].updateActiveInputSources();const l=this[Te].currentFrameCallbacks=this[Te].frameCallbacks;this[Te].frameCallbacks=[];const d=performance.now();for(let e=0;e<l.length;e++)try{l[e].cancelled||l[e].callback(d,u)}catch(e){console.error(e)}this[Te].currentFrameCallbacks=null,u[ue].active=!1},nominalFrameRate:e.internalNominalFrameRate,referenceSpaces:[],inputSourceArray:[],activeInputSources:[],updateActiveInputSources:()=>{const e=this[Te].enabledFeatures.includes(it.HandTracking),t=this[Te].activeInputSources,i=this[Te].device.inputSources.filter((t=>!t.hand||e)),n=i.filter((e=>!t.includes(e))),r=t.filter((e=>!i.includes(e)));this[Te].activeInputSources=i,(n.length>0||r.length>0)&&this.dispatchEvent(new me("inputsourceschange",{session:this,added:n,removed:r}))},onend:null,oninputsourceschange:null,onselect:null,onselectstart:null,onselectend:null,onsqueeze:null,onsqueezestart:null,onsqueezeend:null,onvisibilitychange:null,onframeratechange:null},this[Te].onDeviceFrame()}get visibilityState(){return this[Te].device.visibilityState}get frameRate(){return this[Te].nominalFrameRate}get supportedFrameRates(){return new Float32Array(this[Te].device.supportedFrameRates)}get renderState(){return this[Te].renderState}get inputSources(){return this[Te].inputSourceArray.length=0,this[Te].ended||this[Te].mode===qe.Inline||this[Te].inputSourceArray.push(...this[Te].activeInputSources),this[Te].inputSourceArray}get enabledFeatures(){return this[Te].enabledFeatures}get isSystemKeyboardSupported(){return this[Te].isSystemKeyboardSupported}get environmentBlendMode(){var e;return null!==(e=this[Te].device[nt].environmentBlendModes[this[Te].mode])&&void 0!==e?e:Ie.Opaque}get interactionMode(){return this[Te].device[nt].interactionMode}updateRenderState(e={}){var t,i,n,r;if(this[Te].ended)throw new DOMException("XRSession has already ended.","InvalidStateError");if(e.baseLayer&&e.baseLayer[Me].session!==this)throw new DOMException("Base layer was created by a different XRSession","InvalidStateError");if(null!=e.inlineVerticalFieldOfView&&this[Te].mode!==qe.Inline)throw new DOMException("InlineVerticalFieldOfView must not be set for an immersive session","InvalidStateError");const a={baseLayer:e.baseLayer||(null===(t=this[Te].pendingRenderState)||void 0===t?void 0:t.baseLayer)||void 0,depthFar:e.depthFar||(null===(i=this[Te].pendingRenderState)||void 0===i?void 0:i.depthFar)||void 0,depthNear:e.depthNear||(null===(n=this[Te].pendingRenderState)||void 0===n?void 0:n.depthNear)||void 0,inlineVerticalFieldOfView:e.inlineVerticalFieldOfView||(null===(r=this[Te].pendingRenderState)||void 0===r?void 0:r.inlineVerticalFieldOfView)||void 0};this[Te].pendingRenderState=new Se(a,this[Te].renderState)}async updateTargetFrameRate(e){return new Promise(((t,i)=>{this[Te].ended?i(new DOMException("XRSession has already ended.","InvalidStateError")):this[Te].device.supportedFrameRates.includes(e)?(this[Te].nominalFrameRate===e?console.log("Requested frame rate is the same as the current nominal frame rate, no update made"):(this[Te].nominalFrameRate=e,this.dispatchEvent(new we("frameratechange",{session:this})),console.log(`Nominal frame rate updated to ${e}`)),t()):i(new DOMException("Requested frame rate not supported.","InvalidStateError"))}))}async requestReferenceSpace(e){return new Promise(((t,i)=>{if(this[Te].ended||!this[Te].referenceSpaceIsSupported(e))return void i(new DOMException("The requested reference space type is not supported.","NotSupportedError"));let n;switch(e){case ve.Viewer:n=this[Te].device.viewerSpace;break;case ve.Local:n=new xe(e,this[Te].device[nt].globalSpace,this[Te].device.viewerSpace[R].offsetMatrix);break;case ve.LocalFloor:case ve.BoundedFloor:case ve.Unbounded:n=new xe(e,this[Te].device[nt].globalSpace)}this[Te].referenceSpaces.push(n),t(n)}))}requestAnimationFrame(e){if(this[Te].ended)return 0;const t=++this[Te].frameHandle;return this[Te].frameCallbacks.push({handle:t,callback:e,cancelled:!1}),t}cancelAnimationFrame(e){let t=this[Te].frameCallbacks,i=t.findIndex((t=>t&&t.handle===e));i>-1&&(t[i].cancelled=!0,t.splice(i,1)),t=this[Te].currentFrameCallbacks,t&&(i=t.findIndex((t=>t&&t.handle===e)),i>-1&&(t[i].cancelled=!0))}async end(){return new Promise(((e,t)=>{this[Te].ended||null===this[Te].deviceFrameHandle?t(new DOMException("XRSession has already ended.","InvalidStateError")):(globalThis.cancelAnimationFrame(this[Te].deviceFrameHandle),this[Te].device[nt].onSessionEnd(),this.dispatchEvent(new we("end",{session:this})),e())}))}get onend(){var e;return null!==(e=this[Te].onend)&&void 0!==e?e:()=>{}}set onend(e){this[Te].onend&&this.removeEventListener("end",this[Te].onend),this[Te].onend=e,e&&this.addEventListener("end",e)}get oninputsourceschange(){var e;return null!==(e=this[Te].oninputsourceschange)&&void 0!==e?e:()=>{}}set oninputsourceschange(e){this[Te].oninputsourceschange&&this.removeEventListener("inputsourceschange",this[Te].oninputsourceschange),this[Te].oninputsourceschange=e,e&&this.addEventListener("inputsourceschange",e)}get onselect(){var e;return null!==(e=this[Te].onselect)&&void 0!==e?e:()=>{}}set onselect(e){this[Te].onselect&&this.removeEventListener("select",this[Te].onselect),this[Te].onselect=e,e&&this.addEventListener("select",e)}get onselectstart(){var e;return null!==(e=this[Te].onselectstart)&&void 0!==e?e:()=>{}}set onselectstart(e){this[Te].onselectstart&&this.removeEventListener("selectstart",this[Te].onselectstart),this[Te].onselectstart=e,e&&this.addEventListener("selectstart",e)}get onselectend(){var e;return null!==(e=this[Te].onselectend)&&void 0!==e?e:()=>{}}set onselectend(e){this[Te].onselectend&&this.removeEventListener("selectend",this[Te].onselectend),this[Te].onselectend=e,e&&this.addEventListener("selectend",e)}get onsqueeze(){var e;return null!==(e=this[Te].onsqueeze)&&void 0!==e?e:()=>{}}set onsqueeze(e){this[Te].onsqueeze&&this.removeEventListener("squeeze",this[Te].onsqueeze),this[Te].onsqueeze=e,e&&this.addEventListener("squeeze",e)}get onsqueezestart(){var e;return null!==(e=this[Te].onsqueezestart)&&void 0!==e?e:()=>{}}set onsqueezestart(e){this[Te].onsqueezestart&&this.removeEventListener("squeezestart",this[Te].onsqueezestart),this[Te].onsqueezestart=e,e&&this.addEventListener("squeezestart",e)}get onsqueezeend(){var e;return null!==(e=this[Te].onsqueezeend)&&void 0!==e?e:()=>{}}set onsqueezeend(e){this[Te].onsqueezeend&&this.removeEventListener("squeezeend",this[Te].onsqueezeend),this[Te].onsqueezeend=e,e&&this.addEventListener("squeezeend",e)}get onvisibilitychange(){var e;return null!==(e=this[Te].onvisibilitychange)&&void 0!==e?e:()=>{}}set onvisibilitychange(e){this[Te].onvisibilitychange&&this.removeEventListener("visibilitychange",this[Te].onvisibilitychange),this[Te].onvisibilitychange=e,e&&this.addEventListener("visibilitychange",e)}get onframeratechange(){var e;return null!==(e=this[Te].onframeratechange)&&void 0!==e?e:()=>{}}set onframeratechange(e){this[Te].onframeratechange&&this.removeEventListener("frameratechange",this[Te].onframeratechange),this[Te].onframeratechange=e,e&&this.addEventListener("frameratechange",e)}}var Oe;!function(e){e.Wrist="wrist",e.ThumbMetacarpal="thumb-metacarpal",e.ThumbPhalanxProximal="thumb-phalanx-proximal",e.ThumbPhalanxDistal="thumb-phalanx-distal",e.ThumbTip="thumb-tip",e.IndexFingerMetacarpal="index-finger-metacarpal",e.IndexFingerPhalanxProximal="index-finger-phalanx-proximal",e.IndexFingerPhalanxIntermediate="index-finger-phalanx-intermediate",e.IndexFingerPhalanxDistal="index-finger-phalanx-distal",e.IndexFingerTip="index-finger-tip",e.MiddleFingerMetacarpal="middle-finger-metacarpal",e.MiddleFingerPhalanxProximal="middle-finger-phalanx-proximal",e.MiddleFingerPhalanxIntermediate="middle-finger-phalanx-intermediate",e.MiddleFingerPhalanxDistal="middle-finger-phalanx-distal",e.MiddleFingerTip="middle-finger-tip",e.RingFingerMetacarpal="ring-finger-metacarpal",e.RingFingerPhalanxProximal="ring-finger-phalanx-proximal",e.RingFingerPhalanxIntermediate="ring-finger-phalanx-intermediate",e.RingFingerPhalanxDistal="ring-finger-phalanx-distal",e.RingFingerTip="ring-finger-tip",e.PinkyFingerMetacarpal="pinky-finger-metacarpal",e.PinkyFingerPhalanxProximal="pinky-finger-phalanx-proximal",e.PinkyFingerPhalanxIntermediate="pinky-finger-phalanx-intermediate",e.PinkyFingerPhalanxDistal="pinky-finger-phalanx-distal",e.PinkyFingerTip="pinky-finger-tip"}(Oe||(Oe={}));class Le extends Map{}const Ae={profileId:"oculus-hand",fallbackProfileIds:["generic-hand","generic-hand-select","generic-trigger"],poses:{default:{jointTransforms:{wrist:{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.04913589730858803,.0021463718730956316,.11701996624469757,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.07536252588033676,-.9959676265716553,-.04867160692811012,0,.5877083539962769,-.08379616588354111,.8047218918800354,0,-.8055551648139954,.032041035592556,.5916536450386047,0,-.010643752291798592,.0006936835707165301,.08736639469861984,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.1374533325433731,-.9904957413673401,.004982374142855406,0,.5534393787384033,.08097179979085922,.8289443850517273,0,-.8214688897132874,-.11118389666080475,.559309184551239,0,.015547193586826324,-.0003480653394944966,.0681300163269043,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.04330715537071228,.003409178927540779,.0492292083799839,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.062003348022699356,.004069602582603693,.03322213143110275,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.02009812369942665,.008770795539021492,.08660387247800827,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9001791477203369,-.2598813474178314,.3494834005832672,0,.06073702871799469,.8695210218429565,.490146666765213,0,-.4312632381916046,-.41999316215515137,.7985095381736755,0,-.00017739279428496957,.03890012577176094,.039073407649993896,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9082008600234985,-.20898112654685974,.36262574791908264,0,.11045389622449875,.9553793668746948,.27395179867744446,0,-.40369608998298645,-.20874978601932526,.8907597661018372,0,.01617925800383091,.05482936650514603,.008788082748651505,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.02599053829908371,.059902746230363846,-.012860597111284733,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.03362493962049484,.06421422213315964,-.033461250364780426,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.03627845644950867,.011579737067222595,.08550142496824265,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9876697659492493,-.06786545366048813,.1410750150680542,0,-.015095947310328484,.855663537979126,.5173118710517883,0,-.15582047402858734,-.5130629539489746,.8440889716148376,0,-.021259509027004242,.04587256908416748,.03659208118915558,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.988391637802124,-.04354291781783104,.14555205404758453,0,.008894841186702251,.9729899168014526,.23067504167556763,0,-.15166506171226501,-.22670257091522217,.9620829224586487,0,-.014570588245987892,.06789684295654297,.0003578895702958107,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.010392282158136368,.07414241135120392,-.026147106662392616,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.0069718430750072,.08024183660745621,-.05014154314994812,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.05402477830648422,.015797706320881844,.08152295649051666,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9940828680992126,.05735103040933609,.09224652498960495,0,-.10022822767496109,.8116500377655029,.5754809379577637,0,-.041867565363645554,-.5813214182853699,.8125960826873779,0,-.041623555123806,.04171867296099663,.03582974523305893,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9843675494194031,.12044742703437805,.12850022315979004,0,-.15629759430885315,.9337108135223389,.3221098482608795,0,-.08118485659360886,-.3371586799621582,.937940776348114,0,-.039990875869989395,.06438793987035751,.004141641780734062,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03783353418111801,.07334739714860916,-.020782606676220894,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03445569798350334,.0802423357963562,-.04392268508672714,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9181402921676636,.35625091195106506,.17350243031978607,0,-.39615097641944885,.8352503180503845,.38134080171585083,0,-.009065053425729275,-.41885748505592346,.9080066680908203,0,-.06191859766840935,.013620133511722088,.07850203663110733,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9714386463165283,.236698180437088,-.016745081171393394,0,-.18462024629116058,.7982627749443054,.5733163952827454,0,.14906984567642212,-.5538501739501953,.8191629648208618,0,-.061502378433942795,.032741155475378036,.03705105185508728,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9337416291236877,.35620439052581787,-.03527557849884033,0,-.33203884959220886,.8987522721290588,.28634607791900635,0,.13370157778263092,-.2556603252887726,.9574766755104065,0,-.06608185172080994,.049755651503801346,.011886020191013813,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.0687975287437439,.054948460310697556,-.007561664097011089,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.06947512179613113,.0613851435482502,-.028543535619974136,1],radius:.005425984505563974}},gripOffsetMatrix:[-.0005348679260350764,-.8648636937141418,-.5020061135292053,0,-.2741127908229828,-.48265108466148376,.8318111896514893,0,-.9616971015930176,.13805119693279266,-.2368120402097702,0,-.02878567762672901,.0017147823236882687,.04536811262369156,1]},pinch:{jointTransforms:{wrist:{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06867414712905884,-.009423808194696903,.10627774149179459,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.5012241005897522,-.8650535345077515,-.0213695727288723,0,.7415963411331177,-.4421543478965759,.5045139193534851,0,-.44587990641593933,.23702676594257355,.8631392121315002,0,-.032122574746608734,-.01196830440312624,.07194234430789948,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[-.3175753057003021,-.9460570216178894,-.06419729441404343,0,.8958902955055237,-.32153913378715515,.30658137798309326,0,-.3106854259967804,.03984907269477844,.9496771097183228,0,-.017625702545046806,-.01967475935816765,.04387917369604111,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,-.007126678712666035,-.021021386608481407,.011786630377173424,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,.0003423091256991029,-.024528030306100845,-.011410919018089771,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.038037415593862534,-.0020236473064869642,.07626739144325256,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.7986818552017212,-.35985732078552246,.48229536414146423,0,.538311243057251,.7854709625244141,-.30537736415863037,0,-.2689369022846222,.5035246014595032,.8210577368736267,0,-.006869405973702669,.033938243985176086,.04206443578004837,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.8285930156707764,-.32672837376594543,.4546217918395996,0,.5577570199966431,.4116027057170868,-.7207564115524292,0,.04836784675717354,.8507823944091797,.5232869386672974,0,.0033306588884443045,.014840902760624886,.010923954658210278,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,.0021551470272243023,-.0058362227864563465,-.0017938464879989624,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,-.00131594471167773,-.025222131982445717,-.012442642822861671,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.05395089089870453,.003063359996303916,.07402937114238739,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9187911748886108,-.1530158370733261,.36387869715690613,0,.038666240870952606,.9522662162780762,.302808940410614,0,-.3928440511226654,-.26414817571640015,.8808513283729553,0,-.02717282809317112,.04162866622209549,.03678669035434723,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9228746294975281,-.12856416404247284,.36300456523895264,0,.14524033665657043,.9892153143882751,-.01890045404434204,0,-.3566599190235138,.07016586512327194,.9315956234931946,0,-.01030921470373869,.05296773463487625,-.0010256498353555799,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,-.0004833847051486373,.05103470757603645,-.026690717786550522,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,.008158999495208263,.05004044249653816,-.050120558589696884,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06732909381389618,.007902119308710098,.07209732383489609,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9391821026802063,-.027994679287075996,.34227466583251953,0,-.18282271921634674,.8029410243034363,.5673282742500305,0,-.2907087206840515,-.5954000353813171,.7489906549453735,0,-.047129884362220764,.03806127607822418,.032147664576768875,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9249380826950073,.03699534013867378,.3783116042613983,0,-.12898847460746765,.9667453765869141,.2208271026611328,0,-.3575615882873535,-.25304901599884033,.8989526629447937,0,-.03579339757561684,.06127955764532089,.002939916681498289,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.026291755959391594,.06800390034914017,-.02094830758869648,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.016345610842108727,.07300511747598648,-.04263874143362045,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.8769711852073669,.31462907791137695,.36322021484375,0,-.4506046175956726,.801031768321991,.39408499002456665,0,-.16696058213710785,-.5092697143554688,.8442559838294983,0,-.07460174709558487,.0062340241856873035,.06756893545389175,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9498357176780701,.1553308218717575,.2714462876319885,0,-.3019258379936218,.6817675232887268,.6663586497306824,0,-.08155745267868042,-.7148879170417786,.694466233253479,0,-.06697750836610794,.029482364654541016,.02902858518064022,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9214097261428833,.27928245067596436,.2701927423477173,0,-.3670244514942169,.8538867831230164,.36901235580444336,0,-.12765564024448395,-.43917882442474365,.8892839550971985,0,-.06447203457355499,.05144399777054787,.0076942890882492065,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.06187915802001953,.060364335775375366,-.010368337854743004,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.056796226650476456,.07042007893323898,-.02921444922685623,1],radius:.005425984505563974}},gripOffsetMatrix:[.08027800917625427,-.8086723685264587,-.5827556252479553,0,-.4154181480407715,-.5585916638374329,.7179154753684998,0,-.9060805439949036,.1844543218612671,-.3807799518108368,0,-.038054611533880234,-.002910431008785963,.03720742464065552,1]},point:{jointTransforms:{wrist:{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05789132043719292,.01670890860259533,.11183350533246994,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[.02145560085773468,-.9978390336036682,.0621047280728817,0,.41311800479888916,.06541631370782852,.9083252549171448,0,-.9104245901107788,.006167683284729719,.4136286973953247,0,-.016488194465637207,.012708572670817375,.08862338215112686,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.21270370483398438,-.966137707233429,.14606566727161407,0,.49890995025634766,.2359165996313095,.8339261412620544,0,-.8401462435722351,-.10450579971075058,.5321959853172302,0,.013112368993461132,.012508046813309193,.07517509907484055,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.04150351136922836,.016039609909057617,.05719054117798805,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.06548332422971725,.01683700829744339,.0516640841960907,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.02592567168176174,.019982583820819855,.08479326963424683,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9063700437545776,-.21756279468536377,.3621589243412018,0,.0970839336514473,.9415287375450134,.3226419687271118,0,-.41117796301841736,-.2572731077671051,.8744958639144897,0,-.0015709538711234927,.043078210204839706,.034657616168260574,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9159826040267944,-.1651475727558136,.36565208435058594,0,.09755707532167435,.9756820797920227,.1962820291519165,0,-.3891757130622864,-.14411886036396027,.9098196625709534,0,.014023927971720695,.052835866808891296,.0014903299743309617,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.023482320830225945,.05633850023150444,-.020621655508875847,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.03096788562834263,.06281610578298569,-.040703095495700836,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.04184452444314957,.022474845871329308,.08177298307418823,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9720265865325928,-.08313076198101044,.21966552734375,0,.20477405190467834,.7580050826072693,-.6192700862884521,0,-.11502730846405029,.6469289064407349,.7538246512413025,0,-.022107340395450592,.05035499855875969,.02970452979207039,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9779140949249268,-.07129573822021484,.19646917283535004,0,.1287083923816681,-.5352076292037964,-.8348574042320251,0,.1646735966205597,.8417060971260071,-.5142109394073486,0,-.017169542610645294,.022584279999136925,-.00265491777099669,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02170622907578945,-.0006043742760084569,.011511396616697311,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02438267692923546,-.0026927536819130182,.03627248480916023,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05944233387708664,.0264605600386858,.07478221505880356,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9842101335525513,.024470895528793335,.1753024309873581,0,.12200043350458145,.6237703561782837,-.7720272541046143,0,-.12824076414108276,.7812241315841675,.610936164855957,0,-.04249368980526924,.0467497780919075,.027722163125872612,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9941774606704712,.05949164181947708,.08983955532312393,0,.10504482686519623,-.7208291888237,-.6851072907447815,0,.024001073092222214,.6905553936958313,-.7228817939758301,0,-.0374927744269371,.016285063698887825,.0038980208337306976,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.038130562752485275,-.0020653479732573032,.02310742810368538,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.0390593595802784,.004176302347332239,.0466572530567646,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9147363901138306,.3458845317363739,.20885537564754486,0,-.3923271894454956,.8839452862739563,.2544005811214447,0,-.09662359952926636,-.3146490156650543,.9442773461341858,0,-.06715242564678192,.024195827543735504,.07137546688318253,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9613109827041626,.22439135611057281,.15977802872657776,0,.01002211682498455,.5511574745178223,-.8343409299850464,0,-.27528178691864014,.8036624789237976,.5275853276252747,0,-.06273911893367767,.038559623062610626,.028268879279494286,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9820972084999084,.18811029195785522,-.00995189044624567,0,.14063723385334015,-.7673450708389282,-.6256227493286133,0,-.12532226741313934,.6130226850509644,-.7800630927085876,0,-.05428232625126839,.013870777562260628,.012061242014169693,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05173685774207115,.0014194445684552193,.02790539152920246,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05098633095622063,.008463085629045963,.048688892275094986,1],radius:.005425984505563974}},gripOffsetMatrix:[.005510995630174875,-.9149997234344482,-.40341615676879883,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.9340395331382751,.13936474919319153,-.32885703444480896,0,-.031803809106349945,.007837686687707901,.04313928261399269,1]}}},ke={mapping:O.None,buttons:[{id:"pinch",type:"analog",eventTrigger:"select"}],axes:[]},ze=h(),De=v(),Ce=h(),Xe=h(),je=v(),He=h(),Ne=h(),Be=v(),Ge=h(),Qe=(e,t,i,n)=>(u(ze,t),d(De,t),l(Ce,t),u(Xe,i),d(je,i),l(He,i),g(Ne,ze,Xe,n),y(Be,De,je,n),g(Ge,Ce,He,n),function(e,t,i,n){var r=t[0],a=t[1],s=t[2],o=t[3],u=r+r,l=a+a,d=s+s,c=r*u,h=r*l,p=r*d,m=a*l,f=a*d,g=s*d,v=o*u,x=o*l,y=o*d,S=n[0],w=n[1],b=n[2];e[0]=(1-(m+g))*S,e[1]=(h+y)*S,e[2]=(p-x)*S,e[3]=0,e[4]=(h-y)*w,e[5]=(1-(c+g))*w,e[6]=(f+v)*w,e[7]=0,e[8]=(p+x)*b,e[9]=(f-v)*b,e[10]=(1-(c+m))*b,e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1}(e,Be,Ne,Ge),e),Ke=[1,-1,-1,0,-1,1,1,0,-1,1,1,0,-1,1,1,1],We=Symbol("@immersive-web-emulation-runtime/xr-hand-input");class _e extends G{constructor(e,t,i){if(t!==L.Left&&t!==L.Right)throw new DOMException('handedness for XRHandInput must be either "left" or "right"',"InvalidStateError");if(!e.poses.default||!e.poses.pinch)throw new DOMException('"default" and "pinch" hand pose configs are required',"InvalidStateError");const n=new E(i),r=new E(n),a=[e.profileId,...e.fallbackProfileIds],s=new Le;Object.values(Oe).forEach((e=>{s.set(e,new J(e,n))}));super(new j(t,A.TrackedPointer,a,n,new D(ke),r,s)),this[We]={poseId:"default",poses:e.poses},this.updateHandPose()}get poseId(){return this[We].poseId}set poseId(e){this[We].poses[e]?this[We].poseId=e:console.warn(`Pose config ${e} not found`)}updateHandPose(){const e=this[We].poses[this[We].poseId],t=this[We].poses.pinch;Object.values(Oe).forEach((i=>{const n=e.jointTransforms[i].offsetMatrix,r=t.jointTransforms[i].offsetMatrix,a=this.inputSource.hand.get(i);Qe(a[R].offsetMatrix,n,r,this.pinchValue),this.inputSource.handedness===L.Right&&(e=>{for(let t=0;t<16;t++)e[t]*=Ke[t]})(a[R].offsetMatrix),a[U].radius=(1-this.pinchValue)*e.jointTransforms[i].radius+this.pinchValue*t.jointTransforms[i].radius})),e.gripOffsetMatrix&&t.gripOffsetMatrix&&Qe(this.inputSource.gripSpace[R].offsetMatrix,e.gripOffsetMatrix,t.gripOffsetMatrix,this.pinchValue)}get pinchValue(){return this[N].inputSource.gamepad[P].buttonsMap.pinch.value}updatePinchValue(e){if(e>1||e<0)return void console.warn(`Out-of-range value ${e} provided for pinch`);this[N].inputSource.gamepad[P].buttonsMap.pinch[P].pendingValue=e}onFrameStart(e){super.onFrameStart(e),this.updateHandPose()}}const $e=Symbol("@immersive-web-emulation-runtime/xr-system");class Ue extends EventTarget{constructor(e){super(),this[$e]={device:e}}isSessionSupported(e){return new Promise(((t,i)=>{e===qe.Inline?t(!0):t(this[$e].device.supportedSessionModes.includes(e))}))}requestSession(e,t={}){return new Promise(((i,n)=>{this.isSessionSupported(e).then((r=>{if(!r)return void n(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"));if(this[$e].activeSession)return void n(new DOMException("An active XRSession already exists.","InvalidStateError"));const{requiredFeatures:a=[],optionalFeatures:s=[]}=t,{supportedFeatures:o}=this[$e].device;if(!a.every((e=>o.includes(e))))return void n(new Error("One or more required features are not supported by the device."));const u=s.filter((e=>o.includes(e))),l=Array.from(new Set([...a,...u,it.Viewer,it.Local])),d=new Pe(this[$e].device,e,l);this[$e].activeSession=d,d.addEventListener("end",(()=>{this[$e].activeSession=void 0})),i(d)})).catch(n)}))}}const Je=Symbol("@immersive-web-emulation-runtime/action-player");class Ye{constructor(e,t,i){const{schema:n,frames:r}=t;if(!r||!n||0===r.length)throw new DOMException("wrong recording format","NotSupportedError");const a=new xe(ve.Viewer,e),o={[_.Left]:new E(a),[_.Right]:new E(a),[_.None]:new E(a)};this[Je]={refSpace:e,inputSources:new Map,inputSchemas:new Map,frames:r,recordedFramePointer:0,startingTimeStamp:r[0][0],endingTimeStamp:r[r.length-1][0],playbackTime:r[0][0],playing:!1,viewerSpace:a,viewSpaces:o,vec3:h(),quat:v()},s(this[Je].viewSpaces[_.Left][R].offsetMatrix,p(-i/2,0,0)),s(this[Je].viewSpaces[_.Right][R].offsetMatrix,p(i/2,0,0)),n.forEach((t=>{const i=t[0],n=t[1];let r;if(n.hasGamepad){const e=[];for(let t=0;t<n.numButtons;t++)e.push({id:t.toString(),type:"manual"});const t=[];for(let e=0;e<n.numAxes;e++)t.push({id:e.toString(),type:"manual"});r=new D({mapping:n.mapping,buttons:e,axes:t})}const a=new E(e);let s;n.hasHand&&(s=new Le,Object.values(Oe).forEach((e=>{s.set(e,new J(e,a))})));const o=new j(n.handedness,n.targetRayMode,n.profiles,a,r,n.hasGrip?new E(e):void 0,n.hasHand?s:void 0);this[Je].inputSources.set(i,{active:!1,source:o}),this[Je].inputSchemas.set(i,n)}))}play(){this[Je].recordedFramePointer=0,this[Je].playbackTime=this[Je].startingTimeStamp,this[Je].playing=!0,this[Je].actualTimeStamp=performance.now()}stop(){this[Je].playing=!1}get playing(){return this[Je].playing}get viewerSpace(){return this[Je].viewerSpace}get viewSpaces(){return this[Je].viewSpaces}get inputSources(){return Array.from(this[Je].inputSources.values()).filter((e=>e.active)).map((e=>e.source))}playFrame(){const e=performance.now(),t=e-this[Je].actualTimeStamp;if(this[Je].actualTimeStamp=e,this[Je].playbackTime+=t,this[Je].playbackTime>this[Je].endingTimeStamp)return void this.stop();for(;this[Je].frames[this[Je].recordedFramePointer+1][0]<this[Je].playbackTime;)this[Je].recordedFramePointer++;const i=this[Je].frames[this[Je].recordedFramePointer],n=this[Je].frames[this[Je].recordedFramePointer+1],r=(this[Je].playbackTime-i[0])/(n[0]-i[0]);this.updateXRSpaceFromMergedFrames(this[Je].viewerSpace,i.slice(1,8),n.slice(1,8),r);const a=new Map;for(let e=8;e<i.length;e++){const{index:t,inputData:n}=this.processRawInputData(i[e]);a.set(t,n)}const s=new Map;for(let e=8;e<n.length;e++){const{index:t,inputData:i}=this.processRawInputData(n[e]);s.set(t,i)}this[Je].inputSources.forEach((e=>{e.active=!1})),s.forEach(((e,t)=>{this[Je].inputSources.get(t).active=!0;const i=this[Je].inputSources.get(t).source,n=this[Je].inputSchemas.get(t);this.updateInputSource(i,n,a.has(t)?a.get(t):e,e,r)}))}updateInputSource(e,t,i,n,r){if(this.updateXRSpaceFromMergedFrames(e.targetRaySpace,i.targetRayTransform,n.targetRayTransform,r),t.hasGrip&&this.updateXRSpaceFromMergedFrames(e.gripSpace,i.gripTransform,n.gripTransform,r),t.hasHand)for(let a=0;a<25;a++){const s=i.handTransforms.slice(8*a,8*a+7),o=n.handTransforms.slice(8*a,8*a+7),u=i.handTransforms[8*a+7],l=n.handTransforms[8*a+7],d=e.hand.get(t.jointSequence[a]);this.updateXRSpaceFromMergedFrames(d,s,o,r),d[U].radius=(l-u)*r+u}if(t.hasGamepad){const t=e.gamepad;n.buttons.forEach(((e,n)=>{const a=t.buttons[n];a[P].pressed=1===e[0],a[P].touched=1===e[1];const s=i.buttons[n][2],o=e[2];a[P].value=(o-s)*r+s})),n.axes.forEach(((e,n)=>{const a=i.axes[n];t[P].axesMap[n.toString()].x=(e-a)*r+a}))}}updateXRSpaceFromMergedFrames(e,t,i,n){const r=p(t[0],t[1],t[2]),a=w(t[3],t[4],t[5],t[6]),s=p(i[0],i[1],i[2]),u=w(i[3],i[4],i[5],i[6]);g(this[Je].vec3,r,s,n),y(this[Je].quat,a,u,n),o(e[R].offsetMatrix,this[Je].quat,this[Je].vec3)}processRawInputData(e){const t=e[0],i=this[Je].inputSchemas.get(t),n={targetRayTransform:e.slice(1,8)};let r=8;if(i.hasGrip&&(n.gripTransform=e[r++]),i.hasHand&&(n.handTransforms=e[r++]),i.hasGamepad){const t=e[r];n.buttons=t.slice(0,i.numButtons),n.axes=t.slice(i.numButtons)}return{index:t,inputData:n}}}class Ze extends Event{constructor(e,t){if(super(e,t),!t.referenceSpace)throw new Error("XRReferenceSpaceEventInit.referenceSpace is required");this.referenceSpace=t.referenceSpace,this.transform=t.transform}}const et=Symbol("@immersive-web-emulation-runtime/xr-viewport");class tt{constructor(e,t,i,n){this[et]={x:e,y:t,width:i,height:n}}get x(){return this[et].x}get y(){return this[et].y}get width(){return this[et].width}get height(){return this[et].height}}var it;!function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded",e.DomOverlay="dom-overlay",e.Anchors="anchors",e.PlaneDetection="plane-detection",e.MeshDetection="mesh-detection",e.HitTest="hit-test",e.HandTracking="hand-tracking",e.DepthSensing="depth-sensing"}(it||(it={}));const nt=Symbol("@immersive-web-emulation-runtime/xr-device"),rt={ipd:.063,fovy:Math.PI/2,headsetPosition:new V(0,1.6,0),headsetQuaternion:new T,stereoEnabled:!1};class at{constructor(e,i={}){var n,r,a,u,l,d;const c=new q,h=new xe(ve.Viewer,c),m={[_.Left]:new E(h),[_.Right]:new E(h),[_.None]:new E(h)},f=e.controllerConfig,g={};f&&Object.values(L).forEach((e=>{f.layout[e]&&(g[e]=new K(f,e,c))}));const v={[L.Left]:new _e(Ae,L.Left,c),[L.Right]:new _e(Ae,L.Right,c)},x=null!==(n=i.canvasContainer)&&void 0!==n?n:document.createElement("div");x.dataset.webxr_runtime="Immersive Web Emulation Runtime v1.0.4",x.style.position="fixed",x.style.width="100%",x.style.height="100%",x.style.top="0",x.style.left="0",x.style.display="flex",x.style.justifyContent="center",x.style.alignItems="center",x.style.overflow="hidden",x.style.zIndex="999",this[nt]={name:e.name,supportedSessionModes:e.supportedSessionModes,supportedFeatures:e.supportedFeatures,supportedFrameRates:e.supportedFrameRates,isSystemKeyboardSupported:e.isSystemKeyboardSupported,internalNominalFrameRate:e.internalNominalFrameRate,environmentBlendModes:e.environmentBlendModes,interactionMode:e.interactionMode,userAgent:e.userAgent,position:null!==(r=i.headsetPosition)&&void 0!==r?r:rt.headsetPosition.clone(),quaternion:null!==(a=i.headsetQuaternion)&&void 0!==a?a:rt.headsetQuaternion.clone(),stereoEnabled:null!==(u=i.stereoEnabled)&&void 0!==u?u:rt.stereoEnabled,ipd:null!==(l=i.ipd)&&void 0!==l?l:rt.ipd,fovy:null!==(d=i.fovy)&&void 0!==d?d:rt.fovy,controllers:g,hands:v,primaryInputMode:"controller",pendingReferenceSpaceReset:!1,visibilityState:Ee.Visible,pendingVisibilityState:null,xrSystem:null,matrix:t(),globalSpace:c,viewerSpace:h,viewSpaces:m,canvasContainer:x,getViewport:(e,t)=>{const i=e.context.canvas,{width:n,height:r}=i;switch(t.eye){case _.None:return new tt(0,0,n,r);case _.Left:return new tt(0,0,this[nt].stereoEnabled?n/2:n,r);case _.Right:return new tt(n/2,0,this[nt].stereoEnabled?n/2:0,r)}},updateViews:()=>{o(this[nt].viewerSpace[R].offsetMatrix,this[nt].quaternion.quat,this[nt].position.vec3),s(this[nt].viewSpaces[_.Left][R].offsetMatrix,p(-this[nt].ipd/2,0,0)),s(this[nt].viewSpaces[_.Right][R].offsetMatrix,p(this[nt].ipd/2,0,0))},onBaseLayerSet:e=>{if(!e)return;const t=e.context.canvas;t.parentElement!==this[nt].canvasContainer&&(this[nt].canvasData={canvas:t,parent:t.parentElement,width:t.width,height:t.height},this[nt].canvasContainer.appendChild(t),document.body.appendChild(this[nt].canvasContainer)),t.width=window.innerWidth,t.height=window.innerHeight},onSessionEnd:()=>{if(this[nt].canvasData){const{canvas:e,parent:t,width:i,height:n}=this[nt].canvasData;e.width=i,e.height=n,t?t.appendChild(e):this[nt].canvasContainer.removeChild(e),document.body.removeChild(this[nt].canvasContainer),window.dispatchEvent(new Event("resize"))}},onFrameStart:e=>{var t;if(null===(t=this[nt].actionPlayer)||void 0===t?void 0:t.playing)this[nt].actionPlayer.playFrame();else{const t=e.session;this[nt].updateViews(),this[nt].pendingVisibilityState&&(this[nt].visibilityState=this[nt].pendingVisibilityState,this[nt].pendingVisibilityState=null,t.dispatchEvent(new we("visibilitychange",{session:t}))),this[nt].visibilityState===Ee.Visible&&this.activeInputs.forEach((t=>{t.onFrameStart(e)})),this[nt].pendingReferenceSpaceReset&&(t[Te].referenceSpaces.forEach((e=>{switch(e[ge].type){case ve.Local:case ve.LocalFloor:case ve.BoundedFloor:case ve.Unbounded:e.dispatchEvent(new Ze("reset",{referenceSpace:e}))}})),this[nt].pendingReferenceSpaceReset=!1)}this[nt].updateViews()}},this[nt].updateViews()}installRuntime(e=globalThis){Object.defineProperty(WebGL2RenderingContext.prototype,"makeXRCompatible",{value:function(){return new Promise(((e,t)=>{e(!0)}))},configurable:!0}),this[nt].xrSystem=new Ue(this),Object.defineProperty(globalThis.navigator,"xr",{value:this[nt].xrSystem,configurable:!0}),Object.defineProperty(navigator,"userAgent",{value:this[nt].userAgent,writable:!1,configurable:!1,enumerable:!0}),e.XRSystem=Ue,e.XRSession=Pe,e.XRRenderState=Se,e.XRFrame=pe,e.XRSpace=E,e.XRReferenceSpace=xe,e.XRJointSpace=J,e.XRView=$,e.XRViewport=tt,e.XRRigidTransform=ae,e.XRPose=Z,e.XRViewerPose=oe,e.XRJointPose=te,e.XRInputSource=j,e.XRInputSourceArray=C,e.XRHand=Le,e.XRLayer=be,e.XRWebGLLayer=Re,e.XRSessionEvent=we,e.XRInputSourceEvent=H,e.XRInputSourcesChangeEvent=me,e.XRReferenceSpaceEvent=Ze}get supportedSessionModes(){return this[nt].supportedSessionModes}get supportedFeatures(){return this[nt].supportedFeatures}get supportedFrameRates(){return this[nt].supportedFrameRates}get isSystemKeyboardSupported(){return this[nt].isSystemKeyboardSupported}get internalNominalFrameRate(){return this[nt].internalNominalFrameRate}get stereoEnabled(){return this[nt].stereoEnabled}set stereoEnabled(e){this[nt].stereoEnabled=e}get ipd(){return this[nt].ipd}set ipd(e){this[nt].ipd=e}get fovy(){return this[nt].fovy}set fovy(e){this[nt].fovy=e}get position(){return this[nt].position}get quaternion(){return this[nt].quaternion}get viewerSpace(){var e;return(null===(e=this[nt].actionPlayer)||void 0===e?void 0:e.playing)?this[nt].actionPlayer.viewerSpace:this[nt].viewerSpace}get viewSpaces(){var e;return(null===(e=this[nt].actionPlayer)||void 0===e?void 0:e.playing)?this[nt].actionPlayer.viewSpaces:this[nt].viewSpaces}get controllers(){return this[nt].controllers}get hands(){return this[nt].hands}get primaryInputMode(){return this[nt].primaryInputMode}set primaryInputMode(e){"controller"===e||"hand"===e?this[nt].primaryInputMode=e:console.warn('primary input mode can only be "controller" or "hand"')}get activeInputs(){if(this[nt].visibilityState!==Ee.Visible)return[];return("controller"===this[nt].primaryInputMode?Object.values(this[nt].controllers):Object.values(this[nt].hands)).filter((e=>e.connected))}get inputSources(){var e;return(null===(e=this[nt].actionPlayer)||void 0===e?void 0:e.playing)?this[nt].actionPlayer.inputSources:this.activeInputs.map((e=>e.inputSource))}get canvasContainer(){return this[nt].canvasContainer}get activeSession(){var e;return null===(e=this[nt].xrSystem)||void 0===e?void 0:e[$e].activeSession}recenter(){const e=new V(-this.position.x,0,-this.position.z),t=new V(0,0,-1).applyQuaternion(this.quaternion);t.y=0,t.normalize();const i=Math.atan2(t.x,-t.z),n=(new T).setFromAxisAngle(new V(0,1,0),i);this.position.add(e),this.quaternion.multiply(n),[...Object.values(this[nt].controllers),...Object.values(this[nt].hands)].forEach((t=>{t.position.add(e),t.quaternion.multiply(n),t.position.applyQuaternion(n)})),this[nt].pendingReferenceSpaceReset=!0}get visibilityState(){return this[nt].visibilityState}updateVisibilityState(e){if(!Object.values(Ee).includes(e))throw new DOMException("Invalid XRVisibilityState value","NotSupportedError");e!==this[nt].visibilityState&&(this[nt].pendingVisibilityState=e)}createActionPlayer(e,t){return this[nt].actionPlayer=new Ye(e,t,this[nt].ipd),this[nt].actionPlayer}}const st={mapping:O.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"x-button",type:"binary"},{id:"y-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},ot={mapping:O.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"a-button",type:"binary"},{id:"b-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},ut={profileId:"oculus-touch-v3",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:st,gripOffsetMatrix:[.9925461411476135,2.0823669899527886e-8,-.12186937034130096,0,.08617465198040009,.7071067094802856,.701836109161377,0,.08617466688156128,-.7071067690849304,.7018360495567322,0,-.003979838453233242,-.015857907012104988,.04964181408286095,1],numHapticActuators:1},right:{gamepad:ot,gripOffsetMatrix:[.9925461411476135,-8.329467959811154e-8,.12186941504478455,0,-.08617465943098068,.7071066498756409,.7018361687660217,0,-.08617471158504486,-.7071068286895752,.7018359303474426,0,.003979798872023821,-.015857888385653496,.049641866236925125,1],numHapticActuators:1}}},lt={profileId:"meta-quest-touch-pro",fallbackProfileIds:["oculus-touch-v2","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:st,gripOffsetMatrix:[.9925461411476135,-1.5779937356796836e-8,-.12186935544013977,0,.08617467433214188,.7071067094802856,.701836109161377,0,.0861746296286583,-.7071067690849304,.7018360495567322,0,-.003979836590588093,-.015857847407460213,.049641840159893036,1],numHapticActuators:3},right:{gamepad:ot,gripOffsetMatrix:[.9925461411476135,9267653311439972e-26,.12186937034130096,0,-.08617467433214188,.7071067094802856,.7018361687660217,0,-.08617464452981949,-.7071067690849304,.7018360495567322,0,.003979847766458988,-.01585782691836357,.04964186251163483,1],numHapticActuators:3}}},dt={profileId:"meta-quest-touch-plus",fallbackProfileIds:["oculus-touch-v3","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:st,gripOffsetMatrix:[.9925461411476135,1.0736208366779465e-8,-.12186933308839798,0,.08617459982633591,.70710688829422,.7018360495567322,0,.08617466688156128,-.7071067094802856,.7018362283706665,0,-.003979803062975407,-.015857873484492302,.04964187368750572,1],numHapticActuators:1},right:{gamepad:ot,gripOffsetMatrix:[.9925461411476135,-2.6238110351073374e-8,.12186934053897858,0,-.0861746147274971,.7071067690849304,.7018360495567322,0,-.08617465943098068,-.7071067094802856,.701836109161377,0,.003979838453233242,-.015857869759202003,.04964182525873184,1],numHapticActuators:1}}},ct={name:"Oculus Quest 1",controllerConfig:{profileId:"oculus-touch-v2",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:st,gripOffsetMatrix:[.9925461411476135,4.673031295254759e-9,-.12186938524246216,0,.08617470413446426,.7071065306663513,.7018362283706665,0,.0861746296286583,-.70710688829422,.7018358707427979,0,-.003979847766458988,-.01585787907242775,.04964185878634453,1],numHapticActuators:1},right:{gamepad:ot,gripOffsetMatrix:[.9925461411476135,3.688163374704345e-8,.12186937034130096,0,-.08617469668388367,.7071066498756409,.7018361687660217,0,-.0861746147274971,-.7071068286895752,.7018359899520874,0,.003979853354394436,-.01585787907242775,.04964182525873184,1],numHapticActuators:1}}},supportedSessionModes:[qe.Inline,qe.ImmersiveVR,qe.ImmersiveAR],supportedFeatures:[it.Viewer,it.Local,it.LocalFloor,it.BoundedFloor,it.Unbounded,it.Anchors,it.PlaneDetection,it.HandTracking],supportedFrameRates:[72,80,90],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,environmentBlendModes:{[qe.ImmersiveVR]:Ie.Opaque,[qe.ImmersiveAR]:Ie.AlphaBlend},interactionMode:Ve.WorldSpace,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 1) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},ht={name:"Meta Quest 2",controllerConfig:ut,supportedSessionModes:[qe.Inline,qe.ImmersiveVR,qe.ImmersiveAR],supportedFeatures:[it.Viewer,it.Local,it.LocalFloor,it.BoundedFloor,it.Unbounded,it.Anchors,it.PlaneDetection,it.MeshDetection,it.HitTest,it.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,environmentBlendModes:{[qe.ImmersiveVR]:Ie.Opaque,[qe.ImmersiveAR]:Ie.AlphaBlend},interactionMode:Ve.WorldSpace,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},pt={name:"Meta Quest Pro",controllerConfig:lt,supportedSessionModes:[qe.Inline,qe.ImmersiveVR,qe.ImmersiveAR],supportedFeatures:[it.Viewer,it.Local,it.LocalFloor,it.BoundedFloor,it.Unbounded,it.Anchors,it.PlaneDetection,it.MeshDetection,it.HitTest,it.HandTracking],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,environmentBlendModes:{[qe.ImmersiveVR]:Ie.Opaque,[qe.ImmersiveAR]:Ie.AlphaBlend},interactionMode:Ve.WorldSpace,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest Pro) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},mt={name:"Meta Quest 3",controllerConfig:dt,supportedSessionModes:[qe.Inline,qe.ImmersiveVR,qe.ImmersiveAR],supportedFeatures:[it.Viewer,it.Local,it.LocalFloor,it.BoundedFloor,it.Unbounded,it.Anchors,it.PlaneDetection,it.MeshDetection,it.HitTest,it.HandTracking,it.DepthSensing],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,environmentBlendModes:{[qe.ImmersiveVR]:Ie.Opaque,[qe.ImmersiveAR]:Ie.AlphaBlend},interactionMode:Ve.WorldSpace,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 3) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},ft=Symbol("@immersive-web-emulation-runtime/action-recorder"),gt=e=>{const t=[];return e.forEach((e=>{t.push(parseFloat(e.toFixed(3)))})),t};class vt{constructor(e,t){this[ft]={session:e,refSpace:t,inputMap:new Map,schemaMap:new Map,compressedFrames:[],jointRadii:new Float32Array(25),jointTransforms:new Float32Array(400)}}recordFrame(e){var t;const i=performance.now(),n=null===(t=e.getViewerPose(this[ft].refSpace))||void 0===t?void 0:t.transform.matrix;if(!n)return;const r={timeStamp:i,position:u(h(),n),quaternion:d(v(),n),inputFrames:[]};this[ft].session.inputSources.forEach((t=>{var i,n;if(!this[ft].inputMap.has(t)){const e={handedness:t.handedness,targetRayMode:t.targetRayMode,profiles:t.profiles,hasGrip:null!=t.gripSpace,hasHand:null!=t.hand,hasGamepad:null!=t.gamepad};e.hasHand&&(e.jointSequence=Array.from(t.hand.values()).map((e=>e.jointName))),e.hasGamepad&&(e.mapping=t.gamepad.mapping,e.numButtons=t.gamepad.buttons.length,e.numAxes=t.gamepad.axes.length);const i=this[ft].inputMap.size;this[ft].inputMap.set(t,i),this[ft].schemaMap.set(i,e)}const a=this[ft].inputMap.get(t),s=this[ft].schemaMap.get(a),o=null===(i=e.getPose(t.targetRaySpace,this[ft].refSpace))||void 0===i?void 0:i.transform.matrix;if(o){const i={index:a,targetRayTransform:{position:u(h(),o),quaternion:d(v(),o)}};if(s.hasGrip){const r=null===(n=e.getPose(t.gripSpace,this[ft].refSpace))||void 0===n?void 0:n.transform.matrix;if(r){const e=u(h(),r),t=d(v(),r);i.gripTransform={position:e,quaternion:t}}}if(s.hasHand){const n=Array.from(t.hand.values());let r=!0;if(r&&(r=e.fillPoses(n,t.targetRaySpace,this[ft].jointTransforms)),r&&(r=e.fillJointRadii(n,this[ft].jointRadii)),r){const e={};for(let t=0;t<25;t++){const i=this[ft].jointTransforms.slice(16*t,16*(t+1)),r=this[ft].jointRadii[t],a=u(h(),i),s=d(v(),i);e[n[t].jointName]={position:a,quaternion:s,radius:r}}i.hand=e}}if(s.hasGamepad){const e={buttons:t.gamepad.buttons.map((e=>e?[e.pressed?1:0,e.touched?1:0,e.value]:null)),axes:Array.from(t.gamepad.axes)};i.gamepad=e}r.inputFrames.push(i)}})),this[ft].compressedFrames.push(this.compressActionFrame(r))}compressActionFrame(e){const t=[Math.round(10*e.timeStamp)/10,...gt(e.position),...gt(e.quaternion)];return e.inputFrames.forEach((e=>{const i=e.index,n=this[ft].schemaMap.get(i),r=[i,...gt(e.targetRayTransform.position),...gt(e.targetRayTransform.quaternion)];if(n.hasGrip&&r.push([...gt(e.gripTransform.position),...gt(e.gripTransform.quaternion)]),n.hasHand){const t=[];Object.values(e.hand).forEach((({position:e,quaternion:i,radius:n})=>{t.push(...gt(e),...gt(i),parseFloat(n.toFixed(3)))})),r.push(t)}n.hasGamepad&&r.push([...e.gamepad.buttons,...e.gamepad.axes]),t.push(r)})),t}log(){const e={schema:Array.from(this[ft].schemaMap.entries()),frames:this[ft].compressedFrames};console.log(JSON.stringify(e))}}export{vt as ActionRecorder,at as XRDevice,pe as XRFrame,Le as XRHand,j as XRInputSource,C as XRInputSourceArray,H as XRInputSourceEvent,me as XRInputSourcesChangeEvent,te as XRJointPose,J as XRJointSpace,be as XRLayer,Z as XRPose,xe as XRReferenceSpace,Ze as XRReferenceSpaceEvent,Se as XRRenderState,ae as XRRigidTransform,Pe as XRSession,we as XRSessionEvent,E as XRSpace,Ue as XRSystem,$ as XRView,oe as XRViewerPose,tt as XRViewport,Re as XRWebGLLayer,ht as metaQuest2,mt as metaQuest3,pt as metaQuestPro,ct as oculusQuest1};
@@ -7,12 +7,12 @@
7
7
  import { GlobalSpace, XRSpace } from '../spaces/XRSpace.js';
8
8
  import { Quaternion, Vector3 } from '../utils/Math.js';
9
9
  import { XRController, XRControllerConfig } from './XRController.js';
10
+ import { XREnvironmentBlendMode, XRInteractionMode, XRSession, XRSessionMode, XRVisibilityState } from '../session/XRSession.js';
10
11
  import { XREye, XRView } from '../views/XRView.js';
11
12
  import { XRHandInput } from './XRHandInput.js';
12
13
  import { XRHandedness, XRInputSource } from '../input/XRInputSource.js';
13
14
  import { XRWebGLLayer } from '../layers/XRWebGLLayer.js';
14
15
  import { XRReferenceSpace } from '../spaces/XRReferenceSpace.js';
15
- import { XRSession, XRSessionMode, XRVisibilityState } from '../session/XRSession.js';
16
16
  import { XRSystem } from '../initialization/XRSystem.js';
17
17
  import { mat4 } from 'gl-matrix';
18
18
  import { ActionPlayer } from '../action/ActionPlayer.js';
@@ -42,6 +42,10 @@ export interface XRDeviceConfig {
42
42
  supportedFrameRates: number[];
43
43
  isSystemKeyboardSupported: boolean;
44
44
  internalNominalFrameRate: number;
45
+ environmentBlendModes: Partial<{
46
+ [sessionMode in XRSessionMode]: XREnvironmentBlendMode;
47
+ }>;
48
+ interactionMode: XRInteractionMode;
45
49
  userAgent: string;
46
50
  }
47
51
  export interface XRDeviceOptions {
@@ -65,6 +69,10 @@ export declare class XRDevice {
65
69
  supportedFrameRates: number[];
66
70
  isSystemKeyboardSupported: boolean;
67
71
  internalNominalFrameRate: number;
72
+ environmentBlendModes: Partial<{
73
+ [sessionMode in XRSessionMode]: XREnvironmentBlendMode;
74
+ }>;
75
+ interactionMode: XRInteractionMode;
68
76
  userAgent: string;
69
77
  position: Vector3;
70
78
  quaternion: Quaternion;
@@ -1 +1 @@
1
- {"version":3,"file":"XRDevice.d.ts","sourceRoot":"","sources":["../../src/device/XRDevice.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACN,WAAW,EAEX,OAAO,EACP,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAoB,MAAM,kBAAkB,CAAC;AACjE,OAAO,EACN,YAAY,EACZ,aAAa,EAEb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAW,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAEN,gBAAgB,EAEhB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEN,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEN,QAAQ,EACR,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,IAAI,EAAQ,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAWlD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,oBAAY,aAAa;IACxB,MAAM,W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AI,wBAAwB,WAE3B;IAED,IAAI,aAAa,IAIQ,OAAO,CAF/B;IAED,IAAI,aAAa,CAAC,KAAK,EAAE,OAAO,EAE/B;IAED,IAAI,GAAG,IAIQ,MAAM,CAFpB;IAED,IAAI,GAAG,CAAC,KAAK,EAAE,MAAM,EAEpB;IAED,IAAI,IAAI,IAIQ,MAAM,CAFrB;IAED,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAErB;IAED,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,IAAI,UAAU,IAAI,UAAU,CAE3B;IAED,IAAI,WAAW,qBAMd;IAED,IAAI,UAAU;;;;MAMb;IAED,IAAI,WAAW;;;;MAEd;IAED,IAAI,KAAK;;;;MAER;IAED,IAAI,gBAAgB,IAIO,YAAY,GAAG,MAAM,CAF/C;IAED,IAAI,gBAAgB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,EAM/C;IAED,IAAI,YAAY,IAAI,cAAc,EAAE,CASnC;IAED,IAAI,YAAY,IAAI,aAAa,EAAE,CAMlC;IAED,IAAI,eAAe,IAAI,cAAc,CAEpC;IAED,IAAI,aAAa,IAAI,SAAS,GAAG,SAAS,CAEzC;IAED,QAAQ;IAyBR,IAAI,eAAe,sBAElB;IAGD,qBAAqB,CAAC,KAAK,EAAE,iBAAiB;IAY9C,kBAAkB,CACjB,QAAQ,EAAE,gBAAgB,EAC1B,SAAS,EAAE;QACV,MAAM,EAAE;YACP,CAAC,EAAE,MAAM,CAAC;YACV,CAAC,EAAE,WAAW,CAAC;SACf,EAAE,CAAC;QACJ,MAAM,EAAE,GAAG,EAAE,CAAC;KACd;CASF"}
@@ -7,12 +7,12 @@
7
7
  import { GlobalSpace, PRIVATE as XRSPACE_PRIVATE, XRSpace, } from '../spaces/XRSpace.js';
8
8
  import { Quaternion, Vector3 } from '../utils/Math.js';
9
9
  import { XRController } from './XRController.js';
10
+ import { PRIVATE as XRSESSION_PRIVATE, XRSession, XRVisibilityState, } from '../session/XRSession.js';
10
11
  import { XREye, XRView } from '../views/XRView.js';
11
12
  import { XRHandInput, oculusHandConfig } from './XRHandInput.js';
12
13
  import { XRHandedness, XRInputSource, XRInputSourceArray, } from '../input/XRInputSource.js';
13
14
  import { XRLayer, XRWebGLLayer } from '../layers/XRWebGLLayer.js';
14
15
  import { PRIVATE as XRREFERENCESPACE_PRIVATE, XRReferenceSpace, XRReferenceSpaceType, } from '../spaces/XRReferenceSpace.js';
15
- import { PRIVATE as XRSESSION_PRIVATE, XRSession, XRVisibilityState, } from '../session/XRSession.js';
16
16
  import { PRIVATE as XRSYSTEM_PRIVATE, XRSystem, } from '../initialization/XRSystem.js';
17
17
  import { mat4, vec3 } from 'gl-matrix';
18
18
  import { ActionPlayer } from '../action/ActionPlayer.js';
@@ -99,6 +99,8 @@ export class XRDevice {
99
99
  supportedFrameRates: deviceConfig.supportedFrameRates,
100
100
  isSystemKeyboardSupported: deviceConfig.isSystemKeyboardSupported,
101
101
  internalNominalFrameRate: deviceConfig.internalNominalFrameRate,
102
+ environmentBlendModes: deviceConfig.environmentBlendModes,
103
+ interactionMode: deviceConfig.interactionMode,
102
104
  userAgent: deviceConfig.userAgent,
103
105
  position: (_b = deviceOptions.headsetPosition) !== null && _b !== void 0 ? _b : DEFAULTS.headsetPosition.clone(),
104
106
  quaternion: (_c = deviceOptions.headsetQuaternion) !== null && _c !== void 0 ? _c : DEFAULTS.headsetQuaternion.clone(),
@@ -1 +1 @@
1
- {"version":3,"file":"XRDevice.js","sourceRoot":"","sources":["../../src/device/XRDevice.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACN,WAAW,EACX,OAAO,IAAI,eAAe,EAC1B,OAAO,GACP,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAsB,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,oBA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AAW,CAAC,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,CAAC,CAAC,0BAA0B,GAAG,IAAI,CAAC;IACjD,CAAC;IAED,IAAI,eAAe;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC;IACtC,CAAC;IAED,0EAA0E;IAC1E,qBAAqB,CAAC,KAAwB;QAC7C,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YACtD,MAAM,IAAI,YAAY,CACrB,iCAAiC,EACjC,mBAAmB,CACnB,CAAC;SACF;QACD,IAAI,KAAK,KAAK,IAAI,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE;YAC5C,IAAI,CAAC,OAAO,CAAC,CAAC,sBAAsB,GAAG,KAAK,CAAC;SAC7C;IACF,CAAC;IAED,kBAAkB,CACjB,QAA0B,EAC1B,SAMC;QAED,IAAI,CAAC,OAAO,CAAC,CAAC,YAAY,GAAG,IAAI,YAAY,CAC5C,QAAQ,EACR,SAAS,EACT,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CACjB,CAAC;QACF,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC;IACnC,CAAC;CACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../../src/device/configs/headset/meta.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAiB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAUlE,eAAO,MAAM,YAAY,EAAE,cAuB1B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cAyBxB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,cAyB1B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cA0BxB,CAAC"}
1
+ {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../../src/device/configs/headset/meta.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAiB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAalE,eAAO,MAAM,YAAY,EAAE,cA4B1B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cA8BxB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,cA8B1B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cA+BxB,CAAC"}
@@ -5,8 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import { WebXRFeatures } from '../../XRDevice.js';
8
+ import { XREnvironmentBlendMode, XRInteractionMode, XRSessionMode, } from '../../../session/XRSession.js';
8
9
  import { metaQuestTouchPlus, metaQuestTouchPro, oculusTouchV2, oculusTouchV3, } from '../controller/meta.js';
9
- import { XRSessionMode } from '../../../session/XRSession.js';
10
10
  export const oculusQuest1 = {
11
11
  name: 'Oculus Quest 1',
12
12
  controllerConfig: oculusTouchV2,
@@ -28,6 +28,11 @@ export const oculusQuest1 = {
28
28
  supportedFrameRates: [72, 80, 90],
29
29
  isSystemKeyboardSupported: true,
30
30
  internalNominalFrameRate: 72,
31
+ environmentBlendModes: {
32
+ [XRSessionMode.ImmersiveVR]: XREnvironmentBlendMode.Opaque,
33
+ [XRSessionMode.ImmersiveAR]: XREnvironmentBlendMode.AlphaBlend,
34
+ },
35
+ interactionMode: XRInteractionMode.WorldSpace,
31
36
  userAgent: 'Mozilla/5.0 (X11; Linux x86_64; Quest 1) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36',
32
37
  };
33
38
  export const metaQuest2 = {
@@ -53,6 +58,11 @@ export const metaQuest2 = {
53
58
  supportedFrameRates: [72, 80, 90, 120],
54
59
  isSystemKeyboardSupported: true,
55
60
  internalNominalFrameRate: 72,
61
+ environmentBlendModes: {
62
+ [XRSessionMode.ImmersiveVR]: XREnvironmentBlendMode.Opaque,
63
+ [XRSessionMode.ImmersiveAR]: XREnvironmentBlendMode.AlphaBlend,
64
+ },
65
+ interactionMode: XRInteractionMode.WorldSpace,
56
66
  userAgent: 'Mozilla/5.0 (X11; Linux x86_64; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36',
57
67
  };
58
68
  export const metaQuestPro = {
@@ -78,6 +88,11 @@ export const metaQuestPro = {
78
88
  supportedFrameRates: [72, 80, 90, 120],
79
89
  isSystemKeyboardSupported: true,
80
90
  internalNominalFrameRate: 90,
91
+ environmentBlendModes: {
92
+ [XRSessionMode.ImmersiveVR]: XREnvironmentBlendMode.Opaque,
93
+ [XRSessionMode.ImmersiveAR]: XREnvironmentBlendMode.AlphaBlend,
94
+ },
95
+ interactionMode: XRInteractionMode.WorldSpace,
81
96
  userAgent: 'Mozilla/5.0 (X11; Linux x86_64; Quest Pro) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36',
82
97
  };
83
98
  export const metaQuest3 = {
@@ -104,6 +119,11 @@ export const metaQuest3 = {
104
119
  supportedFrameRates: [72, 80, 90, 120],
105
120
  isSystemKeyboardSupported: true,
106
121
  internalNominalFrameRate: 90,
122
+ environmentBlendModes: {
123
+ [XRSessionMode.ImmersiveVR]: XREnvironmentBlendMode.Opaque,
124
+ [XRSessionMode.ImmersiveAR]: XREnvironmentBlendMode.AlphaBlend,
125
+ },
126
+ interactionMode: XRInteractionMode.WorldSpace,
107
127
  userAgent: 'Mozilla/5.0 (X11; Linux x86_64; Quest 3) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36',
108
128
  };
109
129
  //# sourceMappingURL=meta.js.map