import * as Long from 'long' ; import { Writer , Reader , util , configure } from 'protobufjs/minimal' ; /**
 *  Wrapper message for `double`.
 *
 *  The JSON representation for `DoubleValue` is JSON number.
 */ export interface DoubleValue { /**
     *  The double value.
     */ value : number ; } /**
 *  Wrapper message for `float`.
 *
 *  The JSON representation for `FloatValue` is JSON number.
 */ export interface FloatValue { /**
     *  The float value.
     */ value : number ; } /**
 *  Wrapper message for `int64`.
 *
 *  The JSON representation for `Int64Value` is JSON string.
 */ export interface Int64Value { /**
     *  The int64 value.
     */ value : number ; } /**
 *  Wrapper message for `uint64`.
 *
 *  The JSON representation for `UInt64Value` is JSON string.
 */ export interface UInt64Value { /**
     *  The uint64 value.
     */ value : number ; } /**
 *  Wrapper message for `int32`.
 *
 *  The JSON representation for `Int32Value` is JSON number.
 */ export interface Int32Value { /**
     *  The int32 value.
     */ value : number ; } /**
 *  Wrapper message for `uint32`.
 *
 *  The JSON representation for `UInt32Value` is JSON number.
 */ export interface UInt32Value { /**
     *  The uint32 value.
     */ value : number ; } /**
 *  Wrapper message for `bool`.
 *
 *  The JSON representation for `BoolValue` is JSON `true` and `false`.
 */ export interface BoolValue { /**
     *  The bool value.
     */ value : boolean ; } /**
 *  Wrapper message for `string`.
 *
 *  The JSON representation for `StringValue` is JSON string.
 */ export interface StringValue { /**
     *  The string value.
     */ value : string ; } /**
 *  Wrapper message for `bytes`.
 *
 *  The JSON representation for `BytesValue` is JSON string.
 */ export interface BytesValue { /**
     *  The bytes value.
     */ value : Uint8Array ; } const baseDoubleValue = { value : 0 , } ; const baseFloatValue = { value : 0 , } ; const baseInt64Value = { value : 0 , } ; const baseUInt64Value = { value : 0 , } ; const baseInt32Value = { value : 0 , } ; const baseUInt32Value = { value : 0 , } ; const baseBoolValue = { value : false , } ; const baseStringValue = { value : "" , } ; const baseBytesValue = { } ; function longToNumber ( long ) { if ( long . gt ( Number . MAX_SAFE_INTEGER ) ) { throw new globalThis . Error ( "Value is larger than Number.MAX_SAFE_INTEGER" ) ; } return long . toNumber ( ) ; } export const protobufPackage = 'google.protobuf' ; export const DoubleValue = { encode ( message , writer = Writer . create ( ) ) { writer . uint32 ( 9 ) . double ( message . value ) ; return writer ; } , decode ( input , length ? ) { const reader = input instanceof Uint8Array ? new Reader ( input ) : input ; let end = length === undefined ? reader . len : reader . pos + length ; const message = { ... baseDoubleValue } as DoubleValue ; while ( reader . pos < end ) { const tag = reader . uint32 ( ) ; switch ( tag >>> 3 ) { case 1 : message . value = reader . double ( ) ; break ; default : reader . skipType ( tag & 7 ) ; break ; } } return message ; } , fromJSON ( object ) { const message = { ... baseDoubleValue } as DoubleValue ; if ( object . value !== undefined && object . value !== null ) { message . value = Number ( object . value ) ; } return message ; } , fromPartial ( object ) { const message = { ... baseDoubleValue } as DoubleValue ; if ( object . value !== undefined && object . value !== null ) { message . value = object . value ; } return message ; } , toJSON ( message ) { const obj = { } ; message . value !== undefined && ( obj . value = message . value ) ; return obj ; } , } ; export const FloatValue = { encode ( message , writer = Writer . create ( ) ) { writer . uint32 ( 13 ) . float ( message . value ) ; return writer ; } , decode ( input , length ? ) { const reader = input instanceof Uint8Array ? new Reader ( input ) : input ; let end = length === undefined ? reader . len : reader . pos + length ; const message = { ... baseFloatValue } as FloatValue ; while ( reader . pos < end ) { const tag = reader . uint32 ( ) ; switch ( tag >>> 3 ) { case 1 : message . value = reader . float ( ) ; break ; default : reader . skipType ( tag & 7 ) ; break ; } } return message ; } , fromJSON ( object ) { const message = { ... baseFloatValue } as FloatValue ; if ( object . value !== undefined && object . value !== null ) { message . value = Number ( object . value ) ; } return message ; } , fromPartial ( object ) { const message = { ... baseFloatValue } as FloatValue ; if ( object . value !== undefined && object . value !== null ) { message . value = object . value ; } return message ; } , toJSON ( message ) { const obj = { } ; message . value !== undefined && ( obj . value = message . value ) ; return obj ; } , } ; export const Int64Value = { encode ( message , writer = Writer . create ( ) ) { writer . uint32 ( 8 ) . int64 ( message . value ) ; return writer ; } , decode ( input , length ? ) { const reader = input instanceof Uint8Array ? new Reader ( input ) : input ; let end = length === undefined ? reader . len : reader . pos + length ; const message = { ... baseInt64Value } as Int64Value ; while ( reader . pos < end ) { const tag = reader . uint32 ( ) ; switch ( tag >>> 3 ) { case 1 : message . value = longToNumber ( reader . int64 ( ) as Long ) ; break ; default : reader . skipType ( tag & 7 ) ; break ; } } return message ; } , fromJSON ( object ) { const message = { ... baseInt64Value } as Int64Value ; if ( object . value !== undefined && object . value !== null ) { message . value = Number ( object . value ) ; } return message ; } , fromPartial ( object ) { const message = { ... baseInt64Value } as Int64Value ; if ( object . value !== undefined && object . value !== null ) { message . value = object . value ; } return message ; } , toJSON ( message ) { const obj = { } ; message . value !== undefined && ( obj . value = message . value ) ; return obj ; } , } ; export const UInt64Value = { encode ( message , writer = Writer . create ( ) ) { writer . uint32 ( 8 ) . uint64 ( message . value ) ; return writer ; } , decode ( input , length ? ) { const reader = input instanceof Uint8Array ? new Reader ( input ) : input ; let end = length === undefined ? reader . len : reader . pos + length ; const message = { ... baseUInt64Value } as UInt64Value ; while ( reader . pos < end ) { const tag = reader . uint32 ( ) ; switch ( tag >>> 3 ) { case 1 : message . value = longToNumber ( reader . uint64 ( ) as Long ) ; break ; default : reader . skipType ( tag & 7 ) ; break ; } } return message ; } , fromJSON ( object ) { const message = { ... baseUInt64Value } as UInt64Value ; if ( object . value !== undefined && object . value !== null ) { message . value = Number ( object . value ) ; } return message ; } , fromPartial ( object ) { const message = { ... baseUInt64Value } as UInt64Value ; if ( object . value !== undefined && object . value !== null ) { message . value = object . value ; } return message ; } , toJSON ( message ) { const obj = { } ; message . value !== undefined && ( obj . value = message . value ) ; return obj ; } , } ; export const Int32Value = { encode ( message , writer = Writer . create ( ) ) { writer . uint32 ( 8 ) . int32 ( message . value ) ; return writer ; } , decode ( input , length ? ) { const reader = input instanceof Uint8Array ? new Reader ( input ) : input ; let end = length === undefined ? reader . len : reader . pos + length ; const message = { ... baseInt32Value } as Int32Value ; while ( reader . pos < end ) { const tag = reader . uint32 ( ) ; switch ( tag >>> 3 ) { case 1 : message . value = reader . int32 ( ) ; break ; default : reader . skipType ( tag & 7 ) ; break ; } } return message ; } , fromJSON ( object ) { const message = { ... baseInt32Value } as Int32Value ; if ( object . value !== undefined && object . value !== null ) { message . value = Number ( object . value ) ; } return message ; } , fromPartial ( object ) { const message = { ... baseInt32Value } as Int32Value ; if ( object . value !== undefined && object . value !== null ) { message . value = object . value ; } return message ; } , toJSON ( message ) { const obj = { } ; message . value !== undefined && ( obj . value = message . value ) ; return obj ; } , } ; export const UInt32Value = { encode ( message , writer = Writer . create ( ) ) { writer . uint32 ( 8 ) . uint32 ( message . value ) ; return writer ; } , decode ( input , length ? ) { const reader = input instanceof Uint8Array ? new Reader ( input ) : input ; let end = length === undefined ? reader . len : reader . pos + length ; const message = { ... baseUInt32Value } as UInt32Value ; while ( reader . pos < end ) { const tag = reader . uint32 ( ) ; switch ( tag >>> 3 ) { case 1 : message . value = reader . uint32 ( ) ; break ; default : reader . skipType ( tag & 7 ) ; break ; } } return message ; } , fromJSON ( object ) { const message = { ... baseUInt32Value } as UInt32Value ; if ( object . value !== undefined && object . value !== null ) { message . value = Number ( object . value ) ; } return message ; } , fromPartial ( object ) { const message = { ... baseUInt32Value } as UInt32Value ; if ( object . value !== undefined && object . value !== null ) { message . value = object . value ; } return message ; } , toJSON ( message ) { const obj = { } ; message . value !== undefined && ( obj . value = message . value ) ; return obj ; } , } ; export const BoolValue = { encode ( message , writer = Writer . create ( ) ) { writer . uint32 ( 8 ) . bool ( message . value ) ; return writer ; } , decode ( input , length ? ) { const reader = input instanceof Uint8Array ? new Reader ( input ) : input ; let end = length === undefined ? reader . len : reader . pos + length ; const message = { ... baseBoolValue } as BoolValue ; while ( reader . pos < end ) { const tag = reader . uint32 ( ) ; switch ( tag >>> 3 ) { case 1 : message . value = reader . bool ( ) ; break ; default : reader . skipType ( tag & 7 ) ; break ; } } return message ; } , fromJSON ( object ) { const message = { ... baseBoolValue } as BoolValue ; if ( object . value !== undefined && object . value !== null ) { message . value = Boolean ( object . value ) ; } return message ; } , fromPartial ( object ) { const message = { ... baseBoolValue } as BoolValue ; if ( object . value !== undefined && object . value !== null ) { message . value = object . value ; } return message ; } , toJSON ( message ) { const obj = { } ; message . value !== undefined && ( obj . value = message . value ) ; return obj ; } , } ; export const StringValue = { encode ( message , writer = Writer . create ( ) ) { writer . uint32 ( 10 ) . string ( message . value ) ; return writer ; } , decode ( input , length ? ) { const reader = input instanceof Uint8Array ? new Reader ( input ) : input ; let end = length === undefined ? reader . len : reader . pos + length ; const message = { ... baseStringValue } as StringValue ; while ( reader . pos < end ) { const tag = reader . uint32 ( ) ; switch ( tag >>> 3 ) { case 1 : message . value = reader . string ( ) ; break ; default : reader . skipType ( tag & 7 ) ; break ; } } return message ; } , fromJSON ( object ) { const message = { ... baseStringValue } as StringValue ; if ( object . value !== undefined && object . value !== null ) { message . value = String ( object . value ) ; } return message ; } , fromPartial ( object ) { const message = { ... baseStringValue } as StringValue ; if ( object . value !== undefined && object . value !== null ) { message . value = object . value ; } return message ; } , toJSON ( message ) { const obj = { } ; message . value !== undefined && ( obj . value = message . value ) ; return obj ; } , } ; export const BytesValue = { encode ( message , writer = Writer . create ( ) ) { writer . uint32 ( 10 ) . bytes ( message . value ) ; return writer ; } , decode ( input , length ? ) { const reader = input instanceof Uint8Array ? new Reader ( input ) : input ; let end = length === undefined ? reader . len : reader . pos + length ; const message = { ... baseBytesValue } as BytesValue ; while ( reader . pos < end ) { const tag = reader . uint32 ( ) ; switch ( tag >>> 3 ) { case 1 : message . value = reader . bytes ( ) ; break ; default : reader . skipType ( tag & 7 ) ; break ; } } return message ; } , fromJSON ( object ) { const message = { ... baseBytesValue } as BytesValue ; if ( object . value !== undefined && object . value !== null ) { message . value = bytesFromBase64 ( object . value ) ; } return message ; } , fromPartial ( object ) { const message = { ... baseBytesValue } as BytesValue ; if ( object . value !== undefined && object . value !== null ) { message . value = object . value ; } return message ; } , toJSON ( message ) { const obj = { } ; message . value !== undefined && ( obj . value = base64FromBytes ( message . value !== undefined ? message . value : new Uint8Array ( ) ) ) ; return obj ; } , } ; if ( util . Long !== Long as any ) { util . Long = Long as any ; configure ( ) ; } interface WindowBase64 { atob ( b64 ) : string ; btoa ( bin ) : string ; } const windowBase64 = ( globalThis as unknown as WindowBase64 ) ; const atob = windowBase64 . atob || ( ( b64 ) => Buffer . from ( b64 , 'base64' ) . toString ( 'binary' ) ) ; const btoa = windowBase64 . btoa || ( ( bin ) => Buffer . from ( bin , 'binary' ) . toString ( 'base64' ) ) ; function bytesFromBase64 ( b64 ) { const bin = atob ( b64 ) ; const arr = new Uint8Array ( bin . length ) ; for ( let i = 0 ; i < bin . length ; ++ i ) { arr [ i ] = bin . charCodeAt ( i ) ; } return arr ; } function base64FromBytes ( arr ) { const bin = [ ] ; for ( let i = 0 ; i < arr . byteLength ; ++ i ) { bin . push ( String . fromCharCode ( arr [ i ] ) ) ; } return btoa ( bin . join ( '' ) ) ; } type Builtin = Date | Function | Uint8Array | string | number | undefined ; export type DeepPartial < T > = T extends Builtin ? T : T extends Array < infer U > ? Array < DeepPartial < U > > : T extends ReadonlyArray < infer U > ? ReadonlyArray < DeepPartial < U > > : T extends { $case : string ; } ? { [ K in keyof Omit < T , '$case' > ] ? : DeepPartial < T [ K ] > ; } & { $case : T [ '$case' ] ; } : T extends { } ? { [ K in keyof T ] ? : DeepPartial < T [ K ] > ; } : Partial < T > ;