UNPKG

dualsense-ts

Version:

A natural interface for your DualSense controller, with Typescript

2 lines 318 kB
/*! For license information please see main.0432376e.js.LICENSE.txt */ (()=>{var e={9287:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BasicComparator=t.ThresholdComparator=t.VirtualComparator=void 0,t.VirtualComparator=function(){return!0},t.ThresholdComparator=function(e,t,n,r){if("number"!==typeof n||"number"!==typeof r)throw new Error("Bad threshold comparison");return Math.abs(n-r)>e&&(Math.abs(r)>t||Math.abs(n)>t)},t.BasicComparator=function(e,t){return e!==t}},5948:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Dualsense=void 0;const r=n(8656),o=n(6592),a=n(2364);class i extends o.Input{get active(){return Object.values(this).some((e=>e!==this&&e instanceof o.Input&&e.active))}constructor(){var e,t,n,i,l,s,c,u,d,f,h,p,m,g,v,y;let b=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(b),this.state=this,this.ps=new r.Momentary({icon:"\u33b0",name:"Home",...null!==(e=b.ps)&&void 0!==e?e:{}}),this.mute=new r.Mute({icon:"\ud83d\udd69",name:"Mute",...null!==(t=b.mute)&&void 0!==t?t:{}}),this.options=new r.Momentary({icon:"\u22ef",name:"Options",...null!==(n=b.options)&&void 0!==n?n:{}}),this.create=new r.Momentary({icon:"\ud83d\udd89",name:"Create",...null!==(i=b.create)&&void 0!==i?i:{}}),this.triangle=new r.Momentary({icon:"\ud83d\udfd5",name:"Triangle",...null!==(l=b.triangle)&&void 0!==l?l:{}}),this.circle=new r.Momentary({icon:"\u229a",name:"Circle",...null!==(s=b.circle)&&void 0!==s?s:{}}),this.cross=new r.Momentary({icon:"\u2bbf",name:"Cross",...null!==(c=b.cross)&&void 0!==c?c:{}}),this.square=new r.Momentary({icon:"\ud83d\udfd7",name:"Square",...null!==(u=b.square)&&void 0!==u?u:{}}),this.dpad=new r.Dpad({icon:"D",name:"D-pad",...null!==(d=b.dpad)&&void 0!==d?d:{}}),this.left=new r.Unisense({icon:"L",name:"Left",...null!==(f=b.left)&&void 0!==f?f:{}}),this.right=new r.Unisense({icon:"R",name:"Right",...null!==(h=b.right)&&void 0!==h?h:{}}),this.touchpad=new r.Touchpad({icon:"\u239a",name:"Touchpad",...null!==(p=b.touchpad)&&void 0!==p?p:{}}),this.connection=new r.Momentary({icon:"\ud83d\udd17",name:"Connected",...null!==(m=b.square)&&void 0!==m?m:{}}),this.gyroscope=new r.Gyroscope({icon:"\u221e",name:"Gyroscope",threshold:.01,...null!==(g=b.gyroscope)&&void 0!==g?g:{}}),this.accelerometer=new r.Accelerometer({icon:"\u2932",name:"Accelerometer",threshold:.01,...null!==(v=b.accelerometer)&&void 0!==v?v:{}}),this.connection[o.InputSet](!1),this.hid=null!==(y=b.hid)&&void 0!==y?y:new a.DualsenseHID(new a.PlatformHIDProvider),this.hid.register((e=>{this.processHID(e)})),setInterval((()=>{const{provider:{connected:e}}=this.hid;this.connection[o.InputSet](e),e||this.hid.provider.connect()}),200);const w={left:-1,right:-1};setInterval((()=>{const e=this.left.rumble(),t=this.right.rumble();!this.connection.active||e===w.left&&t===w.right||(this.hid.setRumble(255*e,255*t),w.left=e,w.right=t)}),1e3/30)}get rumbleIntensity(){return(this.left.rumble()+this.right.rumble())/2}rumble(e){return this.left.rumble(e),this.right.rumble(e),this.rumbleIntensity}processHID(e){this.ps[o.InputSet](e.Playstation),this.options[o.InputSet](e.Options),this.create[o.InputSet](e.Create),this.mute[o.InputSet](e.Mute),this.mute.status[o.InputSet](e.Status),this.triangle[o.InputSet](e.Triangle),this.circle[o.InputSet](e.Circle),this.cross[o.InputSet](e.Cross),this.square[o.InputSet](e.Square),this.dpad.up[o.InputSet](e.Up),this.dpad.down[o.InputSet](e.Down),this.dpad.right[o.InputSet](e.Right),this.dpad.left[o.InputSet](e.Left),this.touchpad.button[o.InputSet](e.TouchButton),this.touchpad.left.x[o.InputSet](e.TouchX0),this.touchpad.left.y[o.InputSet](e.TouchY0),this.touchpad.left.contact[o.InputSet](e.TouchContact0),this.touchpad.left.tracker[o.InputSet](e.TouchId0),this.touchpad.right.x[o.InputSet](e.TouchX1),this.touchpad.right.y[o.InputSet](e.TouchY1),this.touchpad.right.contact[o.InputSet](e.TouchContact1),this.touchpad.right.tracker[o.InputSet](e.TouchId1),this.left.analog.x[o.InputSet](e.LX),this.left.analog.y[o.InputSet](e.LY),this.left.analog.button[o.InputSet](e.L3),this.left.bumper[o.InputSet](e.L1),this.left.trigger[o.InputSet](e.L2),this.left.trigger.button[o.InputSet](e.L2Button),this.right.analog.x[o.InputSet](e.RX),this.right.analog.y[o.InputSet](e.RY),this.right.analog.button[o.InputSet](e.R3),this.right.bumper[o.InputSet](e.R1),this.right.trigger[o.InputSet](e.R2),this.right.trigger.button[o.InputSet](e.R2Button),this.gyroscope.x[o.InputSet](e.GyroX),this.gyroscope.y[o.InputSet](e.GyroY),this.gyroscope.z[o.InputSet](e.GyroZ),this.accelerometer.x[o.InputSet](e.AccelX),this.accelerometer.y[o.InputSet](e.AccelY),this.accelerometer.z[o.InputSet](e.AccelZ)}}t.Dualsense=i},419:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Accelerometer=void 0;const r=n(6592),o=n(2897);class a extends r.Input{constructor(e){super(e),this.state=this,this.active=!1;const{x:t,y:n,z:r}=null!==e&&void 0!==e?e:{};this.x=new o.Axis({icon:"AX",name:"X",...e,...t}),this.y=new o.Axis({icon:"AY",name:"Y",...e,...n}),this.z=new o.Axis({icon:"AZ",name:"Z",...e,...r})}}t.Accelerometer=a},6008:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Analog=void 0;const r=n(2897),o=n(9199),a=n(6592);class i extends a.Input{constructor(e){super(e),this.state=this,this.deadzone=.05;const{button:t,x:n,y:a,deadzone:i}=null!==e&&void 0!==e?e:{};i&&(this.deadzone=i),this.button=new o.Momentary({icon:"3",name:"Button",...t}),this.x=new r.Axis({icon:"\u2194",name:"X",...e,...n}),this.y=new r.Axis({icon:"\u2195",name:"Y",...e,...a})}get active(){return this.magnitude>0||this.button.active}get vector(){return{direction:this.direction,magnitude:this.magnitude}}get force(){return Math.max(Math.min(Math.hypot(this.x.force,this.y.force),1),-1)}get magnitude(){const e=Math.abs(this.force);return e<this.deadzone?0:(e-this.deadzone)/(1-this.deadzone)}get direction(){return Math.atan2(this.y.force,this.x.force)}get radians(){return this.direction}get angle(){return this.direction}get directionDegrees(){return 180*this.direction/Math.PI}get degrees(){return this.directionDegrees}get angleDegrees(){return this.directionDegrees}}t.Analog=i},2897:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Axis=void 0;const r=n(6592);class o extends r.Input{constructor(e){super(e),this.state=0,this.deadzone=.05;const{deadzone:t}=null!==e&&void 0!==e?e:{};t&&(this.deadzone=t)}get active(){return Math.abs(this.state)>this.deadzone}get force(){return this.active?this.state:0}get magnitude(){const e=Math.abs(this.force);return e<this.deadzone?0:(e-this.deadzone)/(1-this.deadzone)}}t.Axis=o},9254:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Dpad=void 0;const r=n(9199),o=n(6592);class a extends o.Input{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(e),this.state=this;const{up:t,down:n,left:o,right:a}=e;this.up=new r.Momentary({icon:"\u2b89",name:"Up",...null!==t&&void 0!==t?t:{}}),this.down=new r.Momentary({icon:"\u2b8b",name:"Down",...null!==n&&void 0!==n?n:{}}),this.left=new r.Momentary({icon:"\u2b88",name:"Left",...null!==o&&void 0!==o?o:{}}),this.right=new r.Momentary({icon:"\u2b8a",name:"Right",...null!==a&&void 0!==a?a:{}})}get active(){return this.up.active||this.down.active||this.left.active||this.right.active}}t.Dpad=a},8905:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Gyroscope=void 0;const r=n(6592),o=n(2897);class a extends r.Input{constructor(e){super(e),this.state=this,this.active=!1;const{x:t,y:n,z:r}=null!==e&&void 0!==e?e:{};this.x=new o.Axis({icon:"GX",name:"X",...e,...t}),this.y=new o.Axis({icon:"GY",name:"Y",...e,...n}),this.z=new o.Axis({icon:"GZ",name:"Z",...e,...r})}}t.Gyroscope=a},4757:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Increment=void 0;const r=n(6592);class o extends r.Input{constructor(){super(...arguments),this.state=0,this.active=!1}}t.Increment=o},8656:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(419),t),o(n(6008),t),o(n(2897),t),o(n(9254),t),o(n(8905),t),o(n(4757),t),o(n(9199),t),o(n(4299),t),o(n(4642),t),o(n(5461),t),o(n(9475),t),o(n(8482),t),o(n(9792),t)},9199:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Momentary=void 0;const r=n(6592);class o extends r.Input{constructor(){super(...arguments),this.state=!1}get active(){return this.state}}t.Momentary=o},4299:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Motion=void 0;const r=n(8905),o=n(419);t.Motion=class{constructor(){this.gyroscope=new r.Gyroscope,this.accelerometer=new o.Accelerometer}}},4642:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Mute=void 0;const r=n(9199);class o extends r.Momentary{constructor(){super(...arguments),this.indicator={},this.status=new r.Momentary({icon:"!",name:"Status"})}}t.Mute=o},5461:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Touch=void 0;const r=n(6008),o=n(4757);class a extends r.Analog{constructor(){super(...arguments),this.state=this,this.contact=this.button,this.tracker=new o.Increment,this.deadzone=0}get active(){return this.contact.active}}t.Touch=a},9475:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Touchpad=void 0;const r=n(9199),o=n(5461),a=n(6592);class i extends a.Input{get active(){return this.left.contact.active}constructor(e){super(e),this.state=this,this.button=new r.Momentary({icon:"[__]"}),this.left=new o.Touch,this.right=new o.Touch}}t.Touchpad=i},8482:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Trigger=void 0;const r=n(6592),o=n(9199);class a extends r.Input{constructor(){super(...arguments),this.state=0,this.button=new o.Momentary}get active(){return this.state>0}get pressure(){return this.state}get magnitude(){return this.state}changes(e){return this.state!==e}}t.Trigger=a},9792:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Unisense=void 0;const r=n(8482),o=n(9199),a=n(6008),i=n(6592);class l extends i.Input{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(e),this.state=this,this.rumbleIntensity=0;const{trigger:t,bumper:n,analog:i}=e;this.trigger=new r.Trigger({icon:"2",name:"Trigger",threshold:1/255,...t}),this.bumper=new o.Momentary({icon:"1",name:"Bumper",...n}),this.analog=new a.Analog({icon:"\u2a01",name:"Analog",threshold:1/128,deadzone:8/128,...i})}rumble(e){return"number"===typeof e&&(this.rumbleIntensity=Math.max(Math.min(e,1),0)),!1===e&&(this.rumbleIntensity=0),!0===e&&(this.rumbleIntensity=1),this.rumbleIntensity}get active(){return this.trigger.active||this.bumper.active||this.analog.active}}t.Unisense=l},6424:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7974:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2139:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DualsenseHID=void 0;const r=n(1492);class o{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30;this.provider=e,this.subscribers=new Set,this.errorSubscribers=new Set,this.pendingCommands=[],this.state={...r.DefaultDualsenseHIDState},e.onData=this.set.bind(this),e.onError=this.handleError.bind(this),setInterval((()=>{this.pendingCommands.length>0&&(async()=>{const t=[...this.pendingCommands];this.pendingCommands=[],await e.write(o.buildFeatureReport(t))})().catch((e=>{this.handleError(new Error("HID write failed: ".concat(JSON.stringify(e))))}))}),1e3/t)}register(e){this.subscribers.add(e)}unregister(e){this.subscribers.delete(e)}on(e,t){"error"===e&&this.errorSubscribers.add(t)}set(e){this.state=e,this.subscribers.forEach((t=>t(e)))}handleError(e){this.errorSubscribers.forEach((t=>t(e)))}static buildFeatureReport(e){const t=new Uint8Array(46).fill(0);return t[0]=2,t[1]=e.filter((e=>{let{scope:{index:t}}=e;return 1===t})).reduce(((e,t)=>{let{scope:{value:n}}=t;return e|n}),0),t[2]=e.filter((e=>{let{scope:{index:t}}=e;return 2===t})).reduce(((e,t)=>{let{scope:{value:n}}=t;return e|n}),0),e.forEach((e=>{let{values:n}=e;n.forEach((e=>{let{index:n,value:r}=e;t[n]=r}))})),t}setRumble(e,t){this.pendingCommands.push({scope:{index:1,value:3},values:[{index:3,value:t},{index:4,value:e}]}),this.pendingCommands.push({scope:{index:2,value:64},values:[]})}setLeftTriggerFeedback(e,t){this.pendingCommands.push({scope:{index:1,value:8},values:[{index:22,value:e},...t.map(((e,t)=>({index:23+t,value:e})))]})}setRightTriggerFeedback(e,t){this.pendingCommands.push({scope:{index:1,value:4},values:[{index:11,value:e},...t.map(((e,t)=>({index:12+t,value:e})))]})}setMicrophoneLED(e){this.pendingCommands.push({scope:{index:2,value:1},values:[{index:9,value:e}]})}setPlayerId(e){this.pendingCommands.push({scope:{index:2,value:16},values:[{index:44,value:e}]})}}t.DualsenseHID=o},1492:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:255;return 2/t*Math.max(0,Math.min(t,e))-1}function i(e){return 1/255*Math.max(0,Math.min(255,e))}function l(e,t){let n=t<<8|e;return n>32767&&(n-=65536),a(n+32767,65535)}Object.defineProperty(t,"__esModule",{value:!0}),t.HIDProvider=t.DefaultDualsenseHIDState=t.mapGyroAccel=t.mapTrigger=t.mapAxis=void 0,o(n(3744),t),t.mapAxis=a,t.mapTrigger=i,t.mapGyroAccel=l,t.DefaultDualsenseHIDState={LX:0,LY:0,RX:0,RY:0,L2:0,R2:0,Triangle:!1,Circle:!1,Cross:!1,Square:!1,Dpad:0,Up:!1,Down:!1,Left:!1,Right:!1,R3:!1,L3:!1,Options:!1,Create:!1,R2Button:!1,L2Button:!1,R1:!1,L1:!1,Playstation:!1,TouchButton:!1,Mute:!1,Status:!1,TouchX0:0,TouchY0:0,TouchContact0:!1,TouchId0:0,TouchX1:0,TouchY1:0,TouchContact1:!1,TouchId1:0,GyroX:0,GyroY:0,GyroZ:0,AccelX:0,AccelY:0,AccelZ:0};class s{constructor(){this.onData=()=>{},this.onError=()=>{}}processReport(e){const n=e.readUint8(0);switch(n){case 1:return this.wireless?this.processBluetoothInputReport01(e):this.processUsbInputReport01(e);case 49:return this.processBluetoothInputReport31(e);default:return this.onError(new Error("Cannot process report, unexpected report id: ".concat(n))),this.disconnect(),{...t.DefaultDualsenseHIDState}}}reset(){this.device=void 0,this.wireless=void 0,this.buffer=void 0,this.limited=void 0,this.onData(t.DefaultDualsenseHIDState)}processBluetoothInputReport01(e){this.limited=!0;const n=e.readUint8(5),r=n>>4,o=15&n,l=e.readUint8(6),s=e.readUint8(7);return{...t.DefaultDualsenseHIDState,LX:a(e.readUint8(1)),LY:-a(e.readUint8(2)),RX:a(e.readUint8(3)),RY:-a(e.readUint8(4)),L2:i(e.readUint8(8)),R2:i(e.readUint8(9)),Triangle:(8&r)>0,Circle:(4&r)>0,Cross:(2&r)>0,Square:(1&r)>0,Dpad:o,Up:o<2||7===o,Down:o>2&&o<6,Left:o>4&&o<8,Right:o>0&&o<4,L2Button:(4&l)>0,R2Button:(8&l)>0,L1:(1&l)>0,R1:(2&l)>0,Create:(16&l)>0,Options:(32&l)>0,L3:(64&l)>0,R3:(128&l)>0,Playstation:(1&s)>0,TouchButton:(2&s)>0}}processBluetoothInputReport31(e){this.limited=!1;const t=e.readUint8(9),n=t>>4,r=15&t,o=e.readUint8(10),s=e.readUint8(11);return{LX:a(e.readUint8(2)),LY:-a(e.readUint8(3)),RX:a(e.readUint8(4)),RY:-a(e.readUint8(5)),L2:i(e.readUint8(6)),R2:i(e.readUint8(7)),Triangle:(8&n)>0,Circle:(4&n)>0,Cross:(2&n)>0,Square:(1&n)>0,Dpad:r,Up:r<2||7===r,Down:r>2&&r<6,Left:r>4&&r<8,Right:r>0&&r<4,L2Button:(4&o)>0,R2Button:(8&o)>0,L1:(1&o)>0,R1:(2&o)>0,Create:(16&o)>0,Options:(32&o)>0,L3:(64&o)>0,R3:(128&o)>0,Playstation:(1&s)>0,TouchButton:(2&s)>0,Mute:(4&s)>0,GyroX:l(e.readUint8(17),e.readUint8(18)),GyroY:l(e.readUint8(19),e.readUint8(20)),GyroZ:l(e.readUint8(21),e.readUint8(22)),AccelX:l(e.readUint8(23),e.readUint8(24)),AccelY:l(e.readUint8(25),e.readUint8(26)),AccelZ:l(e.readUint8(27),e.readUint8(28)),TouchId0:127&e.readUint8(34),TouchContact0:0===(128&e.readUint8(34)),TouchX0:a(e.readUint16LE(35)<<20>>20,1920),TouchY0:a(e.readUint16LE(36)>>4,1080),TouchId1:127&e.readUint8(38),TouchContact1:0===(128&e.readUint8(38)),TouchX1:a(e.readUint16LE(39)<<20>>20,1920),TouchY1:a(e.readUint16LE(40)>>4,1080),Status:(4&e.readUint8(55))>0}}processUsbInputReport01(e){this.limited=!1;const t=e.readUint8(8),n=t>>4,r=15&t,o=e.readUint8(9),s=e.readUint8(10);return{LX:a(e.readUint8(1)),LY:-a(e.readUint8(2)),RX:a(e.readUint8(3)),RY:-a(e.readUint8(4)),L2:i(e.readUint8(5)),R2:i(e.readUint8(6)),Triangle:(8&n)>0,Circle:(4&n)>0,Cross:(2&n)>0,Square:(1&n)>0,Dpad:r,Up:r<2||7===r,Down:r>2&&r<6,Left:r>4&&r<8,Right:r>0&&r<4,L2Button:(4&o)>0,R2Button:(8&o)>0,L1:(1&o)>0,R1:(2&o)>0,Create:(16&o)>0,Options:(32&o)>0,L3:(64&o)>0,R3:(128&o)>0,Playstation:(1&s)>0,TouchButton:(2&s)>0,Mute:(4&s)>0,GyroX:l(e.readUint8(16),e.readUint8(17)),GyroY:l(e.readUint8(18),e.readUint8(19)),GyroZ:l(e.readUint8(20),e.readUint8(21)),AccelX:l(e.readUint8(22),e.readUint8(23)),AccelY:l(e.readUint8(24),e.readUint8(25)),AccelZ:l(e.readUint8(26),e.readUint8(27)),TouchId0:127&e.readUint8(33),TouchContact0:0===(128&e.readUint8(33)),TouchX0:a(e.readUint16LE(34)<<20>>20,1920),TouchY0:a(e.readUint16LE(35)>>4,1080),TouchId1:127&e.readUint8(37),TouchContact1:0===(128&e.readUint8(37)),TouchX1:a(e.readUint16LE(38)<<20>>20,1920),TouchY1:a(e.readUint16LE(39)>>4,1080),Status:(4&e.readUint8(54))>0}}}t.HIDProvider=s,s.vendorId=1356,s.productId=3302,s.usagePage=1,s.usage=5},2364:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(6424),t),o(n(7974),t),o(n(2139),t),o(n(1492),t),o(n(3990),t),o(n(5311),t),o(n(6268),t)},3990:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.NodeHIDProvider=void 0;const i=n(1492);class l extends i.HIDProvider{async connect(){return"undefined"!==typeof window?this.onError(new Error("Attempted to use node-hid in browser environment")):Promise.resolve().then((()=>a(n(5078)))).then((e=>{let{HID:t,devices:n}=e;this.disconnect();const r=n(i.HIDProvider.vendorId,i.HIDProvider.productId);if(0===r.length||!r[0].path)return this.onError(new Error("No controllers (".concat(n().length," other devices)")));this.wireless=-1===r[0].interface;const o=new t(r[0].path);o.getFeatureReport(5,41),o.on("data",(e=>{this.buffer=e,this.onData(this.process(e))})),o.on("error",(e=>{this.onError(e)})),this.device=o})).catch((e=>{this.onError(new Error("Could not import 'node-hid'. Did you add it?\nError: ".concat(e instanceof Error?e.message:"???")))}))}write(e){return this.device?(this.device.write(Array.from(e)),Promise.resolve()):Promise.resolve()}get connected(){return void 0!==this.device}disconnect(){this.device&&(this.device.removeAllListeners(),this.device.close()),this.reset()}process(e){const t={length:e.length,readUint8:t=>e.readUint8(t),readUint16LE:t=>e.readUint16LE(t)};return this.processReport(t)}}t.NodeHIDProvider=l},5311:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PlatformHIDProvider=void 0;const r=n(3990),o=n(6268);t.PlatformHIDProvider="undefined"===typeof window?r.NodeHIDProvider:o.WebHIDProvider},6268:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebHIDProvider=void 0;const r=n(1492);class o extends r.HIDProvider{constructor(){if(super(),!navigator.hid)throw new Error("WebHID not supported by this browser");navigator.hid.addEventListener("disconnect",(e=>{let{device:t}=e;t===this.device&&(this.device=void 0,this.disconnect())})),navigator.hid.addEventListener("connect",(e=>{let{device:t}=e;this.device||this.attach(t)}))}detectConnectionType(){if(this.wireless=void 0,this.device)for(const t of this.device.collections){var e;if(t.usagePage!==r.HIDProvider.usagePage||t.usage!==r.HIDProvider.usage)continue;const n=(null!==(e=t.inputReports)&&void 0!==e?e:[]).reduce(((e,t)=>{var n;return Math.max(e,(null!==(n=t.items)&&void 0!==n?n:[]).reduce(((e,t)=>{var n,r;return e+(null!==(n=t.reportSize)&&void 0!==n?n:0)*(null!==(r=t.reportCount)&&void 0!==r?r:0)}),0))}),0);504==n?this.wireless=!1:616==n&&(this.wireless=!0)}}attach(e){e.open().then((()=>(this.device=e,this.detectConnectionType(),this.device.receiveFeatureReport(5)))).then((()=>{if(!this.device)throw Error("Controller disconnected before setup");this.device.addEventListener("inputreport",(e=>{let{reportId:t,data:n}=e;this.buffer=n,this.onData(this.process({reportId:t,buffer:n}))}))})).catch((e=>{this.onError(e),this.disconnect()}))}getRequest(){return()=>navigator.hid.requestDevice({filters:[{vendorId:r.HIDProvider.vendorId,productId:r.HIDProvider.productId,usagePage:r.HIDProvider.usagePage,usage:r.HIDProvider.usage}]}).then((e=>{if(0===e.length)return this.onError(new Error("No controllers available"));this.attach(e[0])})).catch((e=>{this.onError(e)}))}connect(){}get connected(){return void 0!==this.device}disconnect(){this.device?this.device.close().finally((()=>this.reset())):this.reset()}async write(e){if(this.device)return this.device.sendFeatureReport(0,e)}process(e){let{reportId:t,buffer:n}=e;const r={length:n.byteLength+1,readUint8:e=>e>0?n.getUint8(e-1):t,readUint16LE:e=>e>0?n.getUint16(e-1,!0):t<<8|n.getUint8(0)};return this.processReport(r)}}t.WebHIDProvider=o},3744:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3969:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(9287),t),o(n(5948),t),o(n(3744),t),o(n(6592),t),o(n(2431),t),o(n(8656),t),o(n(2364),t)},6592:(e,t,n)=>{"use strict";var r,o,a,i,l,s;Object.defineProperty(t,"__esModule",{value:!0}),t.Input=t.InputIcon=t.InputName=t.InputSet=t.InputSetComparator=void 0;const c=n(9287);t.InputSetComparator=Symbol("InputSetComparator"),t.InputSet=Symbol("InputSet"),t.InputName=Symbol("InputName"),t.InputIcon=Symbol("InputIcon");const u=Symbol("InputOns"),d=Symbol("InputOnces"),f=Symbol("InputAdopt"),h=Symbol("InputParents"),p=Symbol("InputComparator");class m{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.id="Unknown",this.threshold=0,this.deadzone=0,this[r]=new Map,this[o]=new Map,this[a]=c.BasicComparator,this[i]="Unknown Input",this[l]="???",this[s]=new Set;const{name:n,icon:u,threshold:d,deadzone:h}=e;n&&(this[t.InputName]=n),u&&(this[t.InputIcon]=u),d&&(this.threshold=d),h&&(this.deadzone=h),setTimeout((()=>{this[t.InputSetComparator](),Object.values(this).forEach((e=>{e!==this&&e instanceof m&&e[f](this)}))}))}on(e,t){const n=this[u].get(e);return n?(n.push(t),this):(this[u].set(e,[]),this.on(e,t))}once(e,t){const n=this[d].get(e);return n?(n.push(t),this):(this[d].set(e,[]),this.once(e,t))}emit(e,t){var n;(null!==(n=this[u].get(e))&&void 0!==n?n:[]).forEach((e=>{e(this,t)})),"input"!==e&&(this.emitOnce(e,t),this[h].forEach((n=>{n.emit(e,t)})))}emitOnce(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;const r=null!==(t=this[d].get(e))&&void 0!==t?t:[];this[d].set(e,[]),r.forEach((e=>{e(this,n)}))}addEventListener(e,t){let{once:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{once:!1};if(n){if("input"===e)throw new Error("Can't listen once to `input` events");return this.once(e,t)}return this.on(e,t)}next(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"change";return new Promise((t=>{this.once(e,(()=>{t({value:this,done:!1})}))}))}promise(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"change";return new Promise((t=>{this.once(e,(()=>t(this)))}))}toString(){return"".concat(this[t.InputIcon]," [").concat(this.active?"X":"_","]")}[(r=u,o=d,a=p,Symbol.asyncIterator)](){return this}[Symbol.toPrimitive](e){return"string"===e?String(this.state):"number"===typeof this.state?this.state:Number(this.state)}get[Symbol.toStringTag](){return this.toString()}[(i=t.InputName,l=t.InputIcon,s=h,f)](e){this[h].add(e)}[t.InputSetComparator](){"number"===typeof this.state?this[p]=c.ThresholdComparator.bind(this,this.threshold,this.deadzone):this.state instanceof m?this[p]=c.VirtualComparator:this[p]=c.BasicComparator}[t.InputSet](e){this[p](this.state,e)&&(this.state=e,this.emit("change",this),"boolean"===typeof e&&this.emit(e?"press":"release",this)),this.emit("input",this)}}t.Input=m},2431:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5353:(e,t,n)=>{"use strict";var r;n.d(t,{J:()=>r}),function(e){e[e.STANDARD=16]="STANDARD",e[e.LARGE=20]="LARGE"}(r||(r={}))},1694:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var i=o.apply(null,n);i&&e.push(i)}}else if("object"===a){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var l in n)r.call(n,l)&&n[l]&&e.push(l)}}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},2110:(e,t,n)=>{"use strict";var r=n(8309),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?i:l[e.$$typeof]||o}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(p){var o=h(n);o&&o!==p&&e(t,o,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var l=s(t),m=s(n),g=0;g<i.length;++g){var v=i[g];if(!a[v]&&(!r||!r[v])&&(!m||!m[v])&&(!l||!l[v])){var y=f(n,v);try{c(t,v,y)}catch(b){}}}}return t}},746:(e,t)=>{"use strict";var n="function"===typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function S(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case a:case l:case i:case h:return e;default:switch(e=e&&e.$$typeof){case c:case f:case g:case m:case s:return e;default:return t}}case o:return t}}}function k(e){return S(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=s,t.Element=r,t.ForwardRef=f,t.Fragment=a,t.Lazy=g,t.Memo=m,t.Portal=o,t.Profiler=l,t.StrictMode=i,t.Suspense=h,t.isAsyncMode=function(e){return k(e)||S(e)===u},t.isConcurrentMode=k,t.isContextConsumer=function(e){return S(e)===c},t.isContextProvider=function(e){return S(e)===s},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return S(e)===f},t.isFragment=function(e){return S(e)===a},t.isLazy=function(e){return S(e)===g},t.isMemo=function(e){return S(e)===m},t.isPortal=function(e){return S(e)===o},t.isProfiler=function(e){return S(e)===l},t.isStrictMode=function(e){return S(e)===i},t.isSuspense=function(e){return S(e)===h},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===a||e===d||e===l||e===i||e===h||e===p||"object"===typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===f||e.$$typeof===y||e.$$typeof===b||e.$$typeof===w||e.$$typeof===v)},t.typeOf=S},8309:(e,t,n)=>{"use strict";e.exports=n(746)},7254:(e,t,n)=>{"use strict";n.d(t,{B:()=>i});function r(e){return e.toLowerCase()}var o=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],a=/[^A-Z0-9]+/gi;function i(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,i=void 0===n?o:n,s=t.stripRegexp,c=void 0===s?a:s,u=t.transform,d=void 0===u?r:u,f=t.delimiter,h=void 0===f?" ":f,p=l(l(e,i,"$1\0$2"),c,"\0"),m=0,g=p.length;"\0"===p.charAt(m);)m++;for(;"\0"===p.charAt(g-1);)g--;return p.slice(m,g).split("\0").map(d).join(h)}function l(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}},5530:(e,t,n)=>{"use strict";n.d(t,{Ho:()=>i});var r=n(5971),o=n(7254);function a(e,t){var n=e.charAt(0),r=e.substr(1).toLowerCase();return t>0&&n>="0"&&n<="9"?"_"+n+r:""+n.toUpperCase()+r}function i(e,t){return void 0===t&&(t={}),(0,o.B)(e,(0,r.pi)({delimiter:"",transform:a},t))}},4463:(e,t,n)=>{"use strict";var r=n(2791),o=n(5296);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,l={};function s(e,t){c(e,t),c(e+"Capture",t)}function c(e,t){for(l[e]=t,e=0;e<t.length;e++)i.add(t[e])}var u=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),d=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},p={};function m(e,t,n,r,o,a,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=i}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){g[e]=new m(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];g[t]=new m(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){g[e]=new m(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){g[e]=new m(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){g[e]=new m(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){g[e]=new m(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){g[e]=new m(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){g[e]=new m(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){g[e]=new m(e,5,!1,e.toLowerCase(),null,!1,!1)}));var v=/[\-:]([a-z])/g;function y(e){return e[1].toUpperCase()}function b(e,t,n,r){var o=g.hasOwnProperty(t)?g[t]:null;(null!==o?0!==o.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null===t||"undefined"===typeof t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!d.call(p,e)||!d.call(h,e)&&(f.test(e)?p[e]=!0:(h[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(v,y);g[t]=new m(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(v,y);g[t]=new m(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(v,y);g[t]=new m(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!1,!1)})),g.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!0,!0)}));var w=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,S=Symbol.for("react.element"),k=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),_=Symbol.for("react.provider"),P=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),L=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var D=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var N=Symbol.iterator;function I(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=N&&e[N]||e["@@iterator"])?e:null}var z,M=Object.assign;function F(e){if(void 0===z)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);z=t&&t[1]||""}return"\n"+z+e}var U=!1;function j(e,t){if(!e||U)return"";U=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&"string"===typeof c.stack){for(var o=c.stack.split("\n"),a=r.stack.split("\n"),i=o.length-1,l=a.length-1;1<=i&&0<=l&&o[i]!==a[l];)l--;for(;1<=i&&0<=l;i--,l--)if(o[i]!==a[l]){if(1!==i||1!==l)do{if(i--,0>--l||o[i]!==a[l]){var s="\n"+o[i].replace(" at new "," at ");return e.displayName&&s.includes("<anonymous>")&&(s=s.replace("<anonymous>",e.displayName)),s}}while(1<=i&&0<=l);break}}}finally{U=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?F(e):""}function B(e){switch(e.tag){case 5:return F(e.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return e=j(e.type,!1);case 11:return e=j(e.type.render,!1);case 1:return e=j(e.type,!0);default:return""}}function H(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case C:return"Fragment";case k:return"Portal";case E:return"Profiler";case x:return"StrictMode";case R:return"Suspense";case O:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case P:return(e.displayName||"Context")+".Consumer";case _:return(e._context.displayName||"Context")+".Provider";case T:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case A:return null!==(t=e.displayName||null)?t:H(e.type)||"Memo";case L:t=e._payload,e=e._init;try{return H(e(t))}catch(n){}}return null}function G(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return H(t);case 8:return t===x?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t}return null}function V(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function W(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function $(e){e._valueTracker||(e._valueTracker=function(e){var t=W(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var o=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function q(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=W(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function K(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Y(e,t){var n=t.checked;return M({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function Q(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=V(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function X(e,t){null!=(t=t.checked)&&b(e,"checked",t,!1)}function Z(e,t){X(e,t);var n=V(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,n):t.hasOwnProperty("defaultValue")&&ee(e,t.type,V(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function J(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ee(e,t,n){"number"===t&&K(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var te=Array.isArray;function ne(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+V(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function re(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(a(91));return M({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function oe(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(a(92));if(te(n)){if(1<n.length)throw Error(a(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:V(n)}}function ae(e,t){var n=V(t.value),r=V(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ie(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function le(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function se(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?le(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ce,ue,de=(ue=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ce=ce||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return ue(e,t)}))}:ue);function fe(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var he={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pe=["Webkit","ms","Moz","O"];function me(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||he.hasOwnProperty(e)&&he[e]?(""+t).trim():t+"px"}function ge(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=me(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(he).forEach((function(e){pe.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),he[t]=he[e]}))}));var ve=M({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ye(e,t){if(t){if(ve[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(a(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(a(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(a(62))}}function be(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var we=null;function Se(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var ke=null,Ce=null,xe=null;function Ee(e){if(e=wo(e)){if("function"!==typeof ke)throw Error(a(280));var t=e.stateNode;t&&(t=ko(t),ke(e.stateNode,e.type,t))}}function _e(e){Ce?xe?xe.push(e):xe=[e]:Ce=e}function Pe(){if(Ce){var e=Ce,t=xe;if(xe=Ce=null,Ee(e),t)for(e=0;e<t.length;e++)Ee(t[e])}}function Te(e,t){return e(t)}function Re(){}var Oe=!1;function Ae(e,t,n){if(Oe)return e(t,n);Oe=!0;try{return Te(e,t,n)}finally{Oe=!1,(null!==Ce||null!==xe)&&(Re(),Pe())}}function Le(e,t){var n=e.stateNode;if(null===n)return null;var r=ko(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(a(231,t,typeof n));return n}var De=!1;if(u)try{var Ne={};Object.defineProperty(Ne,"passive",{get:function(){De=!0}}),window.addEventListener("test",Ne,Ne),window.removeEventListener("test",Ne,Ne)}catch(ue){De=!1}function Ie(e,t,n,r,o,a,i,l,s){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var ze=!1,Me=null,Fe=!1,Ue=null,je={onError:function(e){ze=!0,Me=e}};function Be(e,t,n,r,o,a,i,l,s){ze=!1,Me=null,Ie.apply(je,arguments)}function He(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Ge(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Ve(e){if(He(e)!==e)throw Error(a(188))}function We(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=He(e)))throw Error(a(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(null===o)break;var i=o.alternate;if(null===i){if(null!==(r=o.return)){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return Ve(o),e;if(i===r)return Ve(o),t;i=i.sibling}throw Error(a(188))}if(n.return!==r.return)n=o,r=i;else{for(var l=!1,s=o.child;s;){if(s===n){l=!0,n=o,r=i;break}if(s===r){l=!0,r=o,n=i;break}s=s.sibling}if(!l){for(s=i.child;s;){if(s===n){l=!0,n=i,r=o;break}if(s===r){l=!0,r=i,n=o;break}s=s.sibling}if(!l)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?e:t}(e))?$e(e):null}function $e(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=$e(e);if(null!==t)return t;e=e.sibling}return null}var qe=o.unstable_scheduleCallback,Ke=o.unstable_cancelCallback,Ye=o.unstable_shouldYield,Qe=o.unstable_requestPaint,Xe=o.unstable_now,Ze=o.unstable_getCurrentPriorityLevel,Je=o.unstable_ImmediatePriority,et=o.unstable_UserBlockingPriority,tt=o.unstable_NormalPriority,nt=o.unstable_LowPriority,rt=o.unstable_IdlePriority,ot=null,at=null;var it=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(lt(e)/st|0)|0},lt=Math.log,st=Math.LN2;var ct=64,ut=4194304;function dt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:r