UNPKG

23.1 kBJavaScriptView Raw
1"use strict";var __extends=this&&this.__extends||function(){var i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}();Object.defineProperty(exports,"__esModule",{value:!0});var jayeson_lib_record_1=require("@jayesol/jayeson.lib.record"),data_structure_1=require("./data_structure"),codec_1=require("./codec"),Collections=require("typescript-collections"),Const=function(){function t(){}return t.generateKey=function(t){return t.source()+this.SEPARATOR+t.id()},t.AGGREGATE_KEY="AGGREGATE_KEY",t.SEPARATOR="_",t}();exports.Const=Const;var Builder,IndexedSnapshotBuilder=function(){function t(t){if(this._matches={},this._partitions=new Collections.Dictionary,null!=t){for(var e=0,r=t.matches();e<r.length;e++){var i=r[e];this._matches[i.id()]=i}for(var o=0,n=t.getPartitionMap().keys();o<n.length;o++){var s=n[o];this._partitions.setValue(s,t.getPartitionMap().getValue(s))}}}return t.prototype.matches=function(){return this._matches},t.prototype.partitions=function(){return this._partitions},t.prototype.setPartition=function(t){this._partitions=t},t.prototype.setPartitionValue=function(t,e){this._partitions.setValue(t,e)},t.prototype.removePartitionKey=function(t){return this._partitions.remove(t)},t.prototype.markPartitionAsUpdated=function(t,e){null==e&&(e=(new Date).getMilliseconds()),this._partitions.setValue(t,e)},t.prototype.replaceMatch=function(t){this._matches[t.id()]=t},t.prototype.reset=function(t){if(!this._partitions.containsKey(t))return null;var e=this._matches,r=BuilderProvider.getSnapshotBuilder(this.build());r._matches={},r._partitions.clear();var i=this.removePartitionKey(t);for(var o in r.setPartitionValue(t,i),this._matches){var n=this._matches[o],s=BuilderProvider.getMatchBuilder(n),a=s.reset(t);null==a||a.isEmpty()||r.insertChild(a.build()),s.isEmpty()?delete e[n.id()]:e[n.id()]=s.build()}return this._matches=e,r},t.prototype.insertChild=function(t){var e=this._matches[t.id()],r=null;if(null==e)this._matches[t.id()]=t;else{r=t.id();var i=BuilderProvider.getMatchBuilder(e);i.aggregateInsert(t),this._matches[t.id()]=i.build()}return r},t.prototype.updateChild=function(t){var e=this._matches[t.id()];if(null!=e){var r=BuilderProvider.getMatchBuilder(e);r.aggregateUpdate(t),this._matches[t.id()]=r.build()}else console.error("[UpdateMatch] Cannot found matchId %s to execute update match from %s",t.id(),t.meta()[Const.AGGREGATE_KEY])},t.prototype.deleteChild=function(t){var e=this._matches[t.id()],r=null;if(null!=e){var i=BuilderProvider.getMatchBuilder(e);return i.aggregateDelete(t)?delete this._matches[t.id()]:(this._matches[t.id()]=i.build(),r=t.id()),r}console.error("[DeleteMatch] Cannot found matchId %s to execute delete match from %s",t.id(),t.meta()[Const.AGGREGATE_KEY])},t.prototype.build=function(){var t={};for(var e in this._matches){var r=this._matches[e],i=t[r.sportType()];null==i&&(i=[],t[r.sportType()]=i),i.push(r)}return new data_structure_1.IndexedSnapshotImpl(t,this._partitions)},t}(),B2MatchBuilder=function(){function t(t){this._events={},this.mergeFrom(t)}return t.prototype.meta=function(){return this._meta},t.prototype.startTime=function(){return this._startTime},t.prototype.events=function(){return this._events},t.prototype.id=function(){return this._id},t.prototype.league=function(){return this._league},t.prototype.sport=function(){return this._sport},t.prototype.meata=function(){return this._meta},t.prototype.p1=function(){return this._p1},t.prototype.p2=function(){return this._p2},t.prototype.setEvent=function(t){this._events=t},t.prototype.mergeFrom=function(t){for(var e in this._startTime=t.startTime(),this._id=t.id(),this._league=t.league(),this._sport=t.sportType(),this._meta={},t.meta())this._meta[e]=t.meta()[e];if(null!=t.events())for(var r=0,i=t.events();r<i.length;r++){var o=i[r];this._events[o.id()]=o}var n=t;this._p1=n.participantOne(),this._p2=n.participantTwo()},t.prototype.replaceEvent=function(t){this._events[t.id()]=t},t.prototype.reset=function(t){var e=t.toString(),r=this._meta[Const.AGGREGATE_KEY];if(!codec_1.Util.containsKey(r,e))return null;var i=BuilderProvider.getMatchBuilder(this.build()),o=codec_1.Util.removeKey(r,e);this._meta[Const.AGGREGATE_KEY]=o,i._meta[Const.AGGREGATE_KEY]=e;var n={};for(var s in i._events={},this._events){var a=this._events[s],u=BuilderProvider.getEventBuilder(a),h=u.reset(t);null==h||h.isEmpty()||i.insertChild(h.build()),u.isEmpty()?delete n[a.id()]:n[a.id()]=u.build()}return this._events=n,i},t.prototype.aggregateInsert=function(t){for(var e in t.meta())e!==Const.AGGREGATE_KEY&&(this._meta[e]=t.meta()[e]);var r=t.meta()[Const.AGGREGATE_KEY],i=this._meta[Const.AGGREGATE_KEY];this._meta[Const.AGGREGATE_KEY]=codec_1.Util.addKey(i,r)},t.prototype.aggregateUpdate=function(t){for(var e in t.meta())e!==Const.AGGREGATE_KEY&&(this._meta[e]=t.meta()[e])},t.prototype.aggregateDelete=function(t){var e=t.meta()[Const.AGGREGATE_KEY],r=this._meta[Const.AGGREGATE_KEY],i=codec_1.Util.removeKey(r,e);return""===(this._meta[Const.AGGREGATE_KEY]=i)},t.prototype.isEmpty=function(){var t=this._meta[Const.AGGREGATE_KEY];return null==t||""==t},t.prototype.insertChild=function(t){var e=this._events[t.id()],r=null;if(null==e)this._events[t.id()]=t;else{var i=BuilderProvider.getEventBuilder(e);i.aggregateInsert(t),this._events[t.id()]=i.build(),r=t.id()}return r},t.prototype.updateChild=function(t){var e=this._events[t.id()];if(null!=e){var r=BuilderProvider.getEventBuilder(e);r.aggregateUpdate(t),this._events[t.id()]=r.build()}else console.error("[UpdateEvent] Cannot found eventId %s to execute update event from %s",t.id(),t.meta()[Const.AGGREGATE_KEY])},t.prototype.deleteChild=function(t){var e=this._events[t.id()],r=null;if(null!=e){var i=BuilderProvider.getEventBuilder(e);return i.aggregateDelete(t)?delete this._events[t.id()]:(r=t.id(),this._events[t.id()]=i.build()),r}console.error("[DeleteEvent] Cannot found eventId %s to execute delete event from %s",t.id(),t.meta()[Const.AGGREGATE_KEY])},t.prototype.build=function(){throw new TypeError("Not supported in Abstract class")},t}(),B2EventBuilder=function(){function t(t){this._records={},this._states={},this.mergeFrom(t)}return t.prototype.id=function(){return this._id},t.prototype.records=function(){return this._records},t.prototype.matchId=function(){return this._matchId},t.prototype.eventType=function(){return this._eventType},t.prototype.meta=function(){return this._meta},t.prototype.states=function(){return this._states},t.prototype.mergeFrom=function(t){var e=t;if(this._id=t.id(),null!=t.records())for(var r=0,i=e.records();r<i.length;r++){var o=i[r],n=Const.generateKey(o);this._records[n]=o}for(var n in this.setStates(e.eventStates()),this._matchId=t.matchId(),this._eventType=t.eventType(),this._meta={},t.meta())this._meta[n]=t.meta()[n]},t.prototype.setStates=function(t){if(null!=t)for(var e=0,r=t;e<r.length;e++){var i=r[e];this._states[i.partitionKey().toString()]=i}},t.prototype.insertChild=function(t){return this._records[Const.generateKey(t)]=t,null},t.prototype.updateChild=function(t){var e=this._records[Const.generateKey(t)];if(null!=e){var r=BuilderProvider.getRecordBuilder(e);r.merge(t),this._records[Const.generateKey(e)]=r.build()}else console.error("[UpdateOdd] Cannot find record "+this._matchId+" "+this._id+" "+t.source()+" "+t.id())},t.prototype.deleteChild=function(t){return delete this._records[Const.generateKey(t)],null},t.prototype.aggregateInsert=function(t){var e=this;t.eventStates().forEach(function(t){e._states[t.partitionKey().toString()]=t})},t.prototype.aggregateUpdate=function(t){var e=this;t.eventStates().forEach(function(t){e._states[t.partitionKey().toString()]=t})},t.prototype.aggregateDelete=function(t){var e=this;return t.eventStates().forEach(function(t){delete e._states[t.partitionKey().toString()]}),0==Object.keys(this._states).length},t.prototype.reset=function(t){if(null==this._states[t.toString()])return null;var e=BuilderProvider.getEventBuilder(this.build());e._states={},e._records={};var r=this._states[t.toString()];e._states[t.toString()]=r,delete this._states[t.toString()];for(var i=0,o=Object.keys(this._records);i<o.length;i++){var n=o[i],s=this._records[n];s.source()===t.source()&&this.getOddTypeInt(s.oddType())===this.getOddTypeInt(t.oddType())&&(e.insertChild(s),delete this._records[n])}return e},t.prototype.getOddTypeInt=function(t){return isNaN(t)?Number(jayeson_lib_record_1.OddType[t]):Number(t)},t.prototype.isEmpty=function(){return null==this._states||0==Object.keys(this._states).length},t.prototype.build=function(){throw new TypeError("Not Implemented for abstract class")},t}(),B2EventStateBuilder=function(){function t(t){this.mergeFrom(t)}return t.prototype.statsOne=function(){return this._statsOne},t.prototype.stateTwo=function(){return this._statsTwo},t.prototype.duration=function(){return this._duration},t.prototype.key=function(){return this._key},t.prototype.matchId=function(){return this._matchId},t.prototype.eventId=function(){return this._eventId},t.prototype.createdTime=function(){return this._createdTime},t.prototype.build=function(){throw new TypeError("UnSupported Operation in abstract class")},t.prototype.mergeFrom=function(t){var e=t;this._statsOne=e.statsOne(),this._statsTwo=e.statsTwo(),this._duration=e.duration(),this._key=e.partitionKey(),this._matchId=e.matchId(),this._eventId=e.eventId(),this._createdTime=(new Date).getMilliseconds()},t.prototype.merge=function(t){var e=t;this.setStatsOne(e.statsOf(0)),this.setStatsTwo(e.statsOf(1)),this.setDuration(e.duration()),this.setEventId(e.eventId()),this.setMatchId(e.matchId()),this.setKey(e.partitionKey())},t.prototype.setStatsOne=function(t){this._statsOne=t},t.prototype.setStatsTwo=function(t){this._statsTwo=t},t.prototype.setDuration=function(t){this._duration=t},t.prototype.setKey=function(t){this._key=t},t.prototype.setMatchId=function(t){this._matchId=t},t.prototype.setEventId=function(t){this._eventId=t},t.prototype.setCreatedTime=function(t){this._createdTime=t},t}(),B2RecordBuilder=function(){function t(t){this.mergeFrom(t)}return t.prototype.eventId=function(){return this._eventId},t.prototype.matchId=function(){return this._matchId},t.prototype.id=function(){return this._id},t.prototype.oddType=function(){return this._oddType},t.prototype.lbType=function(){return this._lbType},t.prototype.timetype=function(){return this._timetype},t.prototype.sportbook=function(){return this._sportbook},t.prototype.meta=function(){return this._meta},t.prototype.oddFormat=function(){return this._oddFormat},t.prototype.rateOver=function(){return this._rateOver},t.prototype.rateUnder=function(){return this._rateUnder},t.prototype.rateEqual=function(){return this._rateEqual},t.prototype.pivotValue=function(){return this._pivotValue},t.prototype.pivotType=function(){return this._pivotType},t.prototype.pivotBias=function(){return this._pivotBias},t.prototype.rateOverId=function(){return this._rateOverId},t.prototype.rateUnderId=function(){return this._rateUnderId},t.prototype.rateEqualId=function(){return this._rateEqualId},t.prototype.isSwapped=function(){return this._isSwapped},t.prototype.setEventId=function(t){this._eventId=t},t.prototype.setMatchId=function(t){this._matchId=t},t.prototype.setId=function(t){this._id=t},t.prototype.setOddType=function(t){this._oddType=t},t.prototype.setLbType=function(t){this._lbType=t},t.prototype.setTimeType=function(t){this._timetype=t},t.prototype.setSportbook=function(t){this._sportbook=t},t.prototype.setMeta=function(t){this._meta=t},t.prototype.setOddFormat=function(t){this._oddFormat=t},t.prototype.setRateOver=function(t){this._rateOver=t},t.prototype.setRateUnder=function(t){this._rateUnder=t},t.prototype.setRateEqual=function(t){this._rateEqual=t},t.prototype.setPivotValue=function(t){this._pivotValue=t},t.prototype.setPivotType=function(t){this._pivotType=t},t.prototype.setPivotBias=function(t){this._pivotBias=t},t.prototype.setRateOverId=function(t){this._rateOverId=t},t.prototype.setRateUnderId=function(t){this._rateUnderId=t},t.prototype.setRateEqualId=function(t){this._rateEqualId=t},t.prototype.setSwapped=function(t){this._isSwapped=t},t.prototype.build=function(){throw new TypeError("UnSupported in Abstract class")},t.prototype.merge=function(t){var e=t;this.setRateOver(e.rateOver()),this.setRateUnder(e.rateUnder()),this.setRateEqual(e.rateEqual()),e.rateOverId&&this.setRateOverId(e.rateOverId()),e.rateUnderId&&this.setRateOverId(e.rateUnderId()),e.rateEqualId&&this.setRateOverId(e.rateEqualId())},t.prototype.mergeFrom=function(t){var e=t;this._eventId=e.eventId(),this._matchId=e.matchId(),this._id=e.id(),this._oddType=e.oddType(),this._lbType=e.lbType(),this._timetype=e.timeType(),this._sportbook=e.source(),this._meta=e.meta(),this._oddFormat=e.oddFormat(),this._rateOver=e.rateOver(),this._rateUnder=e.rateUnder(),this._rateEqual=e.rateEqual(),this._pivotValue=e.pivotValue(),this._pivotType=e.pivotType(),this._pivotBias=e.pivotBias(),this._rateOverId=e.rateOverId(),this._rateUnderId=e.rateUnderId(),this._rateEqualId=e.rateEqualId(),this._isSwapped=e.isSwapped()},t}();exports.B2RecordBuilder=B2RecordBuilder,function(t){var e=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t}(IndexedSnapshotBuilder);t.Snapshot=e}(Builder||(Builder={})),function(t){!function(t){var e=function(r){function t(t){return r.call(this,t)||this}return __extends(t,r),t.prototype.setGender=function(t){this.gender=t},t.prototype.setCountry=function(t){this.country=t},t.prototype.mergeFrom=function(t){r.prototype.mergeFrom.call(this,t);var e=t;this.setGender(e.gender()),this.setCountry(e.country())},t.prototype.build=function(){for(var t=[],e=0,r=Object.keys(this._events);e<r.length;e++){var i=r[e];t.push(this._events[i])}return new jayeson_lib_record_1.TennisMatchImpl(this._p1,this._p2,this._startTime,t,this._id,this._league,this.gender,this.country,this._meta)},t}(B2MatchBuilder);t.Tennis=e;var r=function(r){function t(t){return r.call(this,t)||this}return __extends(t,r),t.prototype.leagueType=function(){return this._leagueType},t.prototype.gender=function(){return this._gender},t.prototype.country=function(){return this._country},t.prototype.setLeagueType=function(t){this._leagueType=t},t.prototype.setGender=function(t){this._gender=t},t.prototype.setCountry=function(t){this._country=t},t.prototype.mergeFrom=function(t){r.prototype.mergeFrom.call(this,t);var e=t;this.setLeagueType(e.leagueType()),this.setCountry(t.country()),this.setGender(e.gender())},t.prototype.build=function(){for(var t=[],e=0,r=Object.keys(this._events);e<r.length;e++){var i=r[e];t.push(this._events[i])}return new jayeson_lib_record_1.SoccerMatchImpl(this._p1,this._p2,this._startTime,t,this._id,this._league,this._meta,this._leagueType,this._gender,this._country)},t}(B2MatchBuilder);t.Soccer=r;var i=function(r){function t(t){return r.call(this,t)||this}return __extends(t,r),t.prototype.gender=function(){return this._gender},t.prototype.country=function(){return this._country},t.prototype.setGender=function(t){this._gender=t},t.prototype.setCountry=function(t){this._country=t},t.prototype.build=function(){for(var t=[],e=0,r=Object.keys(this._events);e<r.length;e++){var i=r[e];t.push(this._events[i])}return new jayeson_lib_record_1.BasketballMatchImpl(this._p1,this._p2,this._startTime,t,this._id,this._league,this._gender,this._country,this._meta)},t.prototype.mergeFrom=function(t){r.prototype.mergeFrom.call(this,t);var e=t;this.setGender(e.gender()),this.setCountry(e.country())},t}(B2MatchBuilder);t.Basketball=i}(t.Match||(t.Match={}))}(Builder||(Builder={})),function(t){!function(t){var e=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.build=function(){for(var t=[],e=0,r=Object.keys(this._records);e<r.length;e++){var i=r[e];t.push(this._records[i])}for(var o=[],n=0,s=Object.keys(this._states);n<s.length;n++){var a=s[n];o.push(this._states[a])}return new jayeson_lib_record_1.TennisEventImpl(this._id,t,o,this._matchId,this._eventType,this._meta)},t}(B2EventBuilder);t.Tennis=e;var r=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.build=function(){for(var t=[],e=0,r=Object.keys(this._records);e<r.length;e++){var i=r[e];t.push(this._records[i])}for(var o=[],n=0,s=Object.keys(this._states);n<s.length;n++){var a=s[n];o.push(this._states[a])}return new jayeson_lib_record_1.SoccerEventImpl(this._id,t,o,this._matchId,this._eventType,this._meta)},t}(B2EventBuilder);t.Soccer=r;var i=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.build=function(){for(var t=[],e=0,r=Object.keys(this._records);e<r.length;e++){var i=r[e];t.push(this._records[i])}for(var o=[],n=0,s=Object.keys(this._states);n<s.length;n++){var a=s[n];o.push(this._states[a])}return new jayeson_lib_record_1.BasketballEventImpl(this._id,t,o,this._matchId,this._eventType,this._meta)},t}(B2EventBuilder);t.Basketball=i}(t.Event||(t.Event={}))}(Builder||(Builder={})),function(t){!function(t){var e=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.build=function(){return new jayeson_lib_record_1.TennisRecord(this._matchId,this._eventId,this._id,this._oddType,this._lbType,this._timetype,this._sportbook,this._oddFormat,this._meta,this._rateOver,this._rateUnder,this._rateEqual,this._pivotValue,this._pivotType,this._pivotBias,this._rateOverId,this._rateUnderId,this._rateEqualId,this._isSwapped)},t}(B2RecordBuilder);t.Tennis=e;var r=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.build=function(){return new jayeson_lib_record_1.SoccerRecord(this._matchId,this._eventId,this._id,this._oddType,this._lbType,this._timetype,this._sportbook,this._oddFormat,this._meta,this._rateOver,this._rateUnder,this._rateEqual,this._pivotValue,this._pivotType,this._pivotBias,this._rateOverId,this._rateUnderId,this._rateEqualId,this._isSwapped)},t}(B2RecordBuilder);t.Soccer=r;var i=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.build=function(){return new jayeson_lib_record_1.BasketballRecord(this._matchId,this._eventId,this._id,this._oddType,this._lbType,this._timetype,this._sportbook,this._oddFormat,this._meta,this._rateOver,this._rateUnder,this._rateEqual,this._pivotValue,this._pivotType,this._pivotBias,this._rateOverId,this._rateUnderId,this._rateEqualId,this._isSwapped)},t}(B2RecordBuilder);t.Basketball=i}(t.Record||(t.Record={}))}(Builder||(Builder={})),function(t){!function(t){var e=function(r){function t(t){return r.call(this,t)||this}return __extends(t,r),t.prototype.build=function(){return new jayeson_lib_record_1.SoccerEventState(this._duration,this._key,this._matchId,this._eventId,null,this._statsOne.getScores()[0],this._statsTwo.getScores()[0],this._statsOne.getScores()[1],this._statsTwo.getScores()[1],this.segment,this.bookPriority)},t.prototype.setHostScore=function(t){var e=this._statsOne.getScores();e[0]=t,this._statsOne.setScores(e)},t.prototype.setHostCard=function(t){var e=this._statsOne.getScores();e[1]=t,this._statsOne.setScores(e)},t.prototype.setGuestScore=function(t){var e=this._statsTwo.getScores();e[0]=t,this._statsTwo.setScores(e)},t.prototype.setGuestCard=function(t){var e=this._statsTwo.getScores();e[1]=t,this._statsTwo.setScores(e)},t.prototype.setSegment=function(t){this.segment=t},t.prototype.setBookPriority=function(t){this.bookPriority=t},t.prototype.mergeFrom=function(t){r.prototype.mergeFrom.call(this,t);var e=t;this.setHostCard(e.hostCard()),this.setGuestCard(e.guestCard()),this.setHostScore(e.hostScore()),this.setGuestScore(e.guestScore()),this.setSegment(e.segment()),this.setBookPriority(e.bookPriority())},t.prototype.merge=function(t){r.prototype.merge.call(this,t);var e=t;null!=e.segment&&this.setSegment(e.segment())},t}(B2EventStateBuilder);t.Soccer=e;var r=function(r){function t(t){return r.call(this,t)||this}return __extends(t,r),t.prototype.build=function(){return new jayeson_lib_record_1.TennisEventState(this._statsOne,this._statsTwo,this._duration,this._key,this._matchId,this._eventId,this._createdTime,this.setScore,this.game,this.bookPriority)},t.prototype.setSet=function(t){this.setScore=t},t.prototype.setGame=function(t){this.game=t},t.prototype.setBookPriority=function(t){this.bookPriority=t},t.prototype.mergeFrom=function(t){r.prototype.mergeFrom.call(this,t);var e=t;this.setSet(e.set()),this.setGame(e.game()),this.setBookPriority(e.bookPriority())},t}(B2EventStateBuilder);t.Tennis=r;var i=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),t.prototype.build=function(){return new jayeson_lib_record_1.BasketballEventState(this._statsOne,this._statsTwo,this._duration,this._key,this._matchId,this._eventId,this._createdTime,this.segment,this.isTimeout,this.bookPriority)},t.prototype.setSegment=function(t){this.segment=t},t.prototype.setBookPriority=function(t){this.bookPriority=t},t.prototype.setTimeout=function(t){this.isTimeout=t},t.prototype.mergeFrom=function(t){e.prototype.mergeFrom.call(this,t)},t}(B2EventStateBuilder);t.Basketball=i}(t.EventState||(t.EventState={}))}(Builder||(Builder={}));var BuilderProvider=function(){function t(){}return t.getMatchBuilder=function(t){if(t instanceof jayeson_lib_record_1.SoccerMatchImpl)return new Builder.Match.Soccer(t);if(t instanceof jayeson_lib_record_1.TennisMatchImpl)return new Builder.Match.Tennis(t);if(t instanceof jayeson_lib_record_1.BasketballMatchImpl)return new Builder.Match.Basketball(t);throw new TypeError("Cannot Create Builder for "+t.constructor.toString())},t.getEventBuilder=function(t){if(t instanceof jayeson_lib_record_1.SoccerEventImpl)return new Builder.Event.Soccer(t);if(t instanceof jayeson_lib_record_1.TennisEventImpl)return new Builder.Event.Tennis(t);if(t instanceof jayeson_lib_record_1.BasketballEventImpl)return new Builder.Event.Basketball(t);throw new TypeError("Cannot Create Builder for "+t.constructor.toString())},t.getRecordBuilder=function(t){if(t instanceof jayeson_lib_record_1.SoccerRecord)return new Builder.Record.Soccer(t);if(t instanceof jayeson_lib_record_1.TennisRecord)return new Builder.Record.Tennis(t);if(t instanceof jayeson_lib_record_1.BasketballRecord)return new Builder.Record.Basketball(t);throw new TypeError("Cannot Create Builder for "+t.constructor.toString())},t.getEventStateBuilder=function(t){if(t instanceof jayeson_lib_record_1.SoccerEventState)return new Builder.EventState.Soccer(t);if(t instanceof jayeson_lib_record_1.TennisEventState)return new Builder.EventState.Tennis(t);if(t instanceof jayeson_lib_record_1.BasketballEventState)return new Builder.EventState.Basketball(t);throw new TypeError("Cannot Create Builder for "+t.constructor.toString())},t.getSnapshotBuilder=function(t){return new Builder.Snapshot(t)},t}();exports.BuilderProvider=BuilderProvider;
\No newline at end of file