3 lines
44 KiB
JavaScript
3 lines
44 KiB
JavaScript
|
"use strict";var pianoverse=(()=>{var de=Object.defineProperty;var ut=Object.getOwnPropertyDescriptor;var ct=Object.getOwnPropertyNames;var ft=Object.prototype.hasOwnProperty;var lt=(t,e)=>{for(var n in e)de(t,n,{get:e[n],enumerable:!0})},mt=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ct(e))!ft.call(t,r)&&r!==n&&de(t,r,{get:()=>e[r],enumerable:!(s=ut(e,r))||s.enumerable});return t};var dt=t=>mt(de({},"__esModule",{value:!0}),t);var Lt={};lt(Lt,{ClientMessage:()=>Oe,ClientMessage_Ban:()=>ae,ClientMessage_EventType:()=>le,ClientMessage_Heartbeat:()=>L,ClientMessage_Room:()=>oe,Move:()=>D,Press:()=>$,Profile:()=>F,Release:()=>C,Role:()=>q,ServerMessage:()=>Fe,ServerMessage_Chat:()=>V,ServerMessage_EventType:()=>me,ServerMessage_Room:()=>ue,ServerMessage_Sustain:()=>fe,ServerMessage_Welcome:()=>ce});function g(t,e){if(!t)throw new Error(e)}var pt=34028234663852886e22,ht=-34028234663852886e22,gt=4294967295,bt=2147483647,yt=-2147483648;function E(t){if(typeof t!="number")throw new Error("invalid int 32: "+typeof t);if(!Number.isInteger(t)||t>bt||t<yt)throw new Error("invalid int 32: "+t)}function J(t){if(typeof t!="number")throw new Error("invalid uint 32: "+typeof t);if(!Number.isInteger(t)||t>gt||t<0)throw new Error("invalid uint 32: "+t)}function G(t){if(typeof t!="number")throw new Error("invalid float 32: "+typeof t);if(Number.isFinite(t)&&(t>pt||t<ht))throw new Error("invalid float 32: "+t)}var Pe=Symbol("@bufbuild/protobuf/enum-type");function Ee(t){let e=t[Pe];return g(e,"missing enum type on enum object"),e}function pe(t,e,n,s){t[Pe]=he(e,n.map(r=>({no:r.no,name:r.name,localName:t[r.no]})),s)}function he(t,e,n){let s=Object.create(null),r=Object.create(null),i=[];for(let o of e){let a=Me(o);i.push(a),s[o.name]=a,r[o.no]=a}return{typeName:t,values:i,findName(o){return s[o]},findNumber(o){return r[o]}}}function Be(t,e,n){let s={};for(let r of e){let i=Me(r);s[i.localName]=i.no,s[i.no]=i.localName}return pe(s,t,e,n),s}function Me(t){return"localName"in t?t:Object.assign(Object.assign({},t),{localName:t.name})}var k=class{equals(e){return this.getType().runtime.util.equals(this.getType(),this,e)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(e,n){let s=this.getType(),r=s.runtime.bin,i=r.makeReadOptions(n);return r.readMessage(this,i.readerFactory(e),e.byteLength,i),this}fromJson(e,n){let s=this.getType(),r=s.runtime.json,i=r.makeReadOptions(n);return r.readMessage(s,e,i,this),this}fromJsonString(e,n){let s;try{s=JSON.parse(e)}catch(r){throw new Error(`cannot decode ${this.getType().typeName} from JSON: ${r instanceof Error?r.message:String(r)}`)}return this.fromJson(s,n)}toBinary(e){let n=this.getType(),s=n.runtime.bin,r=s.makeWriteOptions(e),i=r.writerFactory();return s.writeMessage(this,i,r),i.finish()}toJson(e){let n=this.getType(),s=n.runtime.json,r=s.makeWriteOptions(e);return s.writeMessage(this,r)}toJsonString(e){var n;let s=this.toJson(e);return JSON.stringify(s,null,(n=e?.prettySpaces)!==null&&n!==void 0?n:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}};function Je(t,e,n,s){var r;let i=(r=s?.localName)!==null&&r!==void 0?r:e.substring(e.lastIndexOf(".")+1),o={[i]:function(a){t.util.initFields(this),t.util.initPartial(a,this)}}[i];return Object.setPrototypeOf(o.prototype,new k),Object.assign(o,{runtime:t,typeName:e,fields:t.util.newFieldList(n),fromBinary(a,c){return new o().fromBinary(a,c)},fromJson(a,c){return new o().fromJson(a,c)},fromJsonString(a,c){return new o().fromJsonString(a,c)},equals(a,c){return t.util.equals(o,a,c)}}),o}function Ue(){let t=0,e=0;for(let s=0;s<28;s+=7){let r=this.buf[this.pos++];if(t|=(r&127)<<s,!(r&128))return this.assertBounds(),[t,e]}let n=this.buf[this.pos++];if(t|=(n&15)<<28,e=(n&112)>>4,!(n&128))return this.assertBounds(),[t,e];for(let s=3;s<=31;s+=7){let r=this.buf[this.pos++];if(e|=(r&127)<<s,!(r&128))return this.assertBounds(),[t,e]}throw new Error("invalid varint")}function W(t,e,n){for(let i=0;i<28;i=i+7){let o=t>>>i,a=!(!(o>>>7)&&e==0),c=(a?o|128:o)&255;if(n.pu
|
||
|
`:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(r){case 0:o=i,r=1;break;case 1:n[s++]=o<<2|(i&48)>>4,o=i,r=2;break;case 2:n[s++]=(o&15)<<4|(i&60)>>2,o=i,r=3;break;case 3:n[s++]=(o&3)<<6|i,r=0;break}}if(r==1)throw Error("invalid base64 string.");return n.subarray(0,s)},enc(t){let e="",n=0,s,r=0;for(let i=0;i<t.length;i++)switch(s=t[i],n){case 0:e+=O[s>>2],r=(s&3)<<4,n=1;break;case 1:e+=O[r|s>>4],r=(s&15)<<2,n=2;break;case 2:e+=O[r|s>>6],e+=O[s&63],n=0;break}return n&&(e+=O[r],e+="=",n==1&&(e+="=")),e}};function Ce(t,e,n){Ge(e,t);let s=e.runtime.bin.makeReadOptions(n),r=$e(t.getType().runtime.bin.listUnknownFields(t),e.field),[i,o]=j(e);for(let a of r)e.runtime.bin.readField(i,s.readerFactory(a.data),e.field,a.wireType,s);return o()}function qe(t,e,n,s){Ge(e,t);let r=e.runtime.bin.makeReadOptions(s),i=e.runtime.bin.makeWriteOptions(s);if(Ne(t,e)){let l=t.getType().runtime.bin.listUnknownFields(t).filter(f=>f.no!=e.field.no);t.getType().runtime.bin.discardUnknownFields(t);for(let f of l)t.getType().runtime.bin.onUnknownField(t,f.no,f.wireType,f.data)}let o=i.writerFactory(),a=e.field;!a.opt&&!a.repeated&&(a.kind=="enum"||a.kind=="scalar")&&(a=Object.assign(Object.assign({},e.field),{opt:!0})),e.runtime.bin.writeField(a,n,o,i);let c=r.readerFactory(o.finish());for(;c.pos<c.len;){let[l,f]=c.tag(),p=c.skip(f,l);t.getType().runtime.bin.onUnknownField(t,l,f,p)}}function Ne(t,e){let n=t.getType();return e.extendee.typeName===n.typeName&&!!n.runtime.bin.listUnknownFields(t).find(s=>s.no==e.field.no)}function Ge(t,e){g(t.extendee.typeName==e.getType().typeName,`extension ${t.typeName} can only be applied to message ${t.extendee.typeName}`)}function Z(t,e){let n=t.localName;if(t.repeated)return e[n].length>0;if(t.oneof)return e[t.oneof.localName].case===n;switch(t.kind){case"enum":case"scalar":return t.opt||t.req?e[n]!==void 0:t.kind=="enum"?e[n]!==t.T.values[0].no:!v(t.T,e[n]);case"message":return e[n]!==void 0;case"map":return Object.keys(e[n]).length>0}}function Te(t,e){let n=t.localName,s=!t.opt&&!t.req;if(t.repeated)e[n]=[];else if(t.oneof)e[t.oneof.localName]={case:void 0};else switch(t.kind){case"map":e[n]={};break;case"enum":e[n]=s?t.T.values[0].no:void 0;break;case"scalar":e[n]=s?T(t.T,t.L):void 0;break;case"message":e[n]=void 0;break}}function I(t,e){if(t===null||typeof t!="object"||!Object.getOwnPropertyNames(k.prototype).every(s=>s in t&&typeof t[s]=="function"))return!1;let n=t.getType();return n===null||typeof n!="function"||!("typeName"in n)||typeof n.typeName!="string"?!1:e===void 0?!0:n.typeName==e.typeName}function z(t,e){return I(e)||!t.fieldWrapper?e:t.fieldWrapper.wrapField(e)}var gn={"google.protobuf.DoubleValue":u.DOUBLE,"google.protobuf.FloatValue":u.FLOAT,"google.protobuf.Int64Value":u.INT64,"google.protobuf.UInt64Value":u.UINT64,"google.protobuf.Int32Value":u.INT32,"google.protobuf.UInt32Value":u.UINT32,"google.protobuf.BoolValue":u.BOOL,"google.protobuf.StringValue":u.STRING,"google.protobuf.BytesValue":u.BYTES};var Xe={ignoreUnknownFields:!1},We={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function Tt(t){return t?Object.assign(Object.assign({},Xe),t):Xe}function It(t){return t?Object.assign(Object.assign({},We),t):We}var ee=Symbol(),Q=Symbol();function Ye(){return{makeReadOptions:Tt,makeWriteOptions:It,readMessage(t,e,n,s){if(e==null||Array.isArray(e)||typeof e!="object")throw new Error(`cannot decode message ${t.typeName} from JSON: ${S(e)}`);s=s??new t;let r=new Map,i=n.typeRegistry;for(let[o,a]of Object.entries(e)){let c=t.fields.findJsonName(o);if(c){if(c.oneof){if(a===null&&c.kind=="scalar")continue;let l=r.get(c.oneof);if(l!==void 0)throw new Error(`cannot decode message ${t.typeName} from JSON: multiple keys for oneof "${c.oneof.name}" present: "${l}", "${o}"`);r.set(c.oneof,o)}ve(s,a,c,n,t)}else{let l=!1;if(i?.findExtension&&o.startsWith("[")&&o.endsWith("]")){let f=i.findExtension(o.substring(1,o.length-1));if(f&&f.extendee.typeName==t.typeName){l=!0;let[p,b]=j(f);ve(p,a,f.field,n,f),qe(s,f,b(),n)}}if(!l&&!n.ignoreUnknownFie
|