{
  "version": 3,
  "sources": ["../src/createTLSchema.ts"],
  "sourcesContent": ["import { Migrations, StoreSchema } from '@bigbluebutton/store'\nimport { objectMapValues } from '@bigbluebutton/utils'\nimport { TLStoreProps, createIntegrityChecker, onValidationFailure } from './TLStore'\nimport { AssetRecordType } from './records/TLAsset'\nimport { CameraRecordType } from './records/TLCamera'\nimport { DocumentRecordType } from './records/TLDocument'\nimport { createInstanceRecordType } from './records/TLInstance'\nimport { PageRecordType } from './records/TLPage'\nimport { InstancePageStateRecordType } from './records/TLPageState'\nimport { PointerRecordType } from './records/TLPointer'\nimport { InstancePresenceRecordType } from './records/TLPresence'\nimport { TLRecord } from './records/TLRecord'\nimport { createShapeRecordType, getShapePropKeysByStyle } from './records/TLShape'\nimport { storeMigrations } from './store-migrations'\nimport { StyleProp } from './styles/StyleProp'\n\n/** @public */\nexport type SchemaShapeInfo = {\n\tmigrations?: Migrations\n\tprops?: Record<string, { validate: (prop: any) => any }>\n\tmeta?: Record<string, { validate: (prop: any) => any }>\n}\n\n/** @public */\nexport type TLSchema = StoreSchema<TLRecord, TLStoreProps>\n\n/**\n * Create a TLSchema with custom shapes. Custom shapes cannot override default shapes.\n *\n * @param opts - Options\n *\n * @public */\nexport function createTLSchema({ shapes }: { shapes: Record<string, SchemaShapeInfo> }): TLSchema {\n\tconst stylesById = new Map<string, StyleProp<unknown>>()\n\tfor (const shape of objectMapValues(shapes)) {\n\t\tfor (const style of getShapePropKeysByStyle(shape.props ?? {}).keys()) {\n\t\t\tif (stylesById.has(style.id) && stylesById.get(style.id) !== style) {\n\t\t\t\tthrow new Error(`Multiple StyleProp instances with the same id: ${style.id}`)\n\t\t\t}\n\t\t\tstylesById.set(style.id, style)\n\t\t}\n\t}\n\n\tconst ShapeRecordType = createShapeRecordType(shapes)\n\tconst InstanceRecordType = createInstanceRecordType(stylesById)\n\n\treturn StoreSchema.create(\n\t\t{\n\t\t\tasset: AssetRecordType,\n\t\t\tcamera: CameraRecordType,\n\t\t\tdocument: DocumentRecordType,\n\t\t\tinstance: InstanceRecordType,\n\t\t\tinstance_page_state: InstancePageStateRecordType,\n\t\t\tpage: PageRecordType,\n\t\t\tshape: ShapeRecordType,\n\t\t\tinstance_presence: InstancePresenceRecordType,\n\t\t\tpointer: PointerRecordType,\n\t\t},\n\t\t{\n\t\t\tsnapshotMigrations: storeMigrations,\n\t\t\tonValidationFailure,\n\t\t\tcreateIntegrityChecker: createIntegrityChecker,\n\t\t}\n\t)\n}\n"],
  "mappings": "AAAA,SAAqB,mBAAmB;AACxC,SAAS,uBAAuB;AAChC,SAAuB,wBAAwB,2BAA2B;AAC1E,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,gCAAgC;AACzC,SAAS,sBAAsB;AAC/B,SAAS,mCAAmC;AAC5C,SAAS,yBAAyB;AAClC,SAAS,kCAAkC;AAE3C,SAAS,uBAAuB,+BAA+B;AAC/D,SAAS,uBAAuB;AAmBzB,SAAS,eAAe,EAAE,OAAO,GAA0D;AACjG,QAAM,aAAa,oBAAI,IAAgC;AACvD,aAAW,SAAS,gBAAgB,MAAM,GAAG;AAC5C,eAAW,SAAS,wBAAwB,MAAM,SAAS,CAAC,CAAC,EAAE,KAAK,GAAG;AACtE,UAAI,WAAW,IAAI,MAAM,EAAE,KAAK,WAAW,IAAI,MAAM,EAAE,MAAM,OAAO;AACnE,cAAM,IAAI,MAAM,kDAAkD,MAAM,EAAE,EAAE;AAAA,MAC7E;AACA,iBAAW,IAAI,MAAM,IAAI,KAAK;AAAA,IAC/B;AAAA,EACD;AAEA,QAAM,kBAAkB,sBAAsB,MAAM;AACpD,QAAM,qBAAqB,yBAAyB,UAAU;AAE9D,SAAO,YAAY;AAAA,IAClB;AAAA,MACC,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,UAAU;AAAA,MACV,qBAAqB;AAAA,MACrB,MAAM;AAAA,MACN,OAAO;AAAA,MACP,mBAAmB;AAAA,MACnB,SAAS;AAAA,IACV;AAAA,IACA;AAAA,MACC,oBAAoB;AAAA,MACpB;AAAA,MACA;AAAA,IACD;AAAA,EACD;AACD;",
  "names": []
}
