mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
1 line
30 KiB
JSON
1 line
30 KiB
JSON
{"ast":null,"code":"import _asyncToGenerator from \"C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { __decorate } from \"tslib\";\nimport __NG_CLI_RESOURCE__0 from \"./home.page.html?ngResource\";\nimport __NG_CLI_RESOURCE__1 from \"./home.page.scss?ngResource\";\nimport { Component } from '@angular/core';\nimport { NotificationsService } from '../services/notifications.service';\nimport { AlertController, Platform } from '@ionic/angular';\nimport { Router } from '@angular/router';\nimport { ToDayEventStorage } from '../store/to-day-event-storage.service';\nimport { TotalDocumentStore } from '../store/total-document.service';\nimport { ExpedienteGdStore } from '../store/expedientegd-store.service';\nimport { SessionStore } from '../store/session.service';\nimport { PermissionService } from '../services/permission.service';\nimport { BackgroundService } from 'src/app/services/background.service';\nimport { Storage } from '@ionic/storage';\nimport { EventsService } from 'src/app/services/events.service';\nimport { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';\nimport { ProcessesService } from 'src/app/services/processes.service';\nimport { RoleIdService } from 'src/app/services/role-id.service';\nimport { ActiveTabService } from 'src/app/services/active-tab.service';\nimport { Device } from '@capacitor/device';\nimport { RouteService } from 'src/app/services/route.service';\nimport { NetworkServiceService, ConnectionStatus } from 'src/app/services/network-service.service';\nimport { NativeNotificationService } from 'src/app/services/native-notification.service';\nimport { PermissionList } from '../models/permission/permissionList';\nlet HomePage = class HomePage {\n constructor(router, modalCtrl, notificationsService, platform, p, backgroundservice, storage, eventservice, processservice, RouteService, NativeNotificationService, RochetChatConnectorService, NetworkServiceService, eventService, ActiveTabService, RoleIdService) {\n this.router = router;\n this.modalCtrl = modalCtrl;\n this.notificationsService = notificationsService;\n this.platform = platform;\n this.p = p;\n this.backgroundservice = backgroundservice;\n this.storage = storage;\n this.eventservice = eventservice;\n this.processservice = processservice;\n this.RouteService = RouteService;\n this.NativeNotificationService = NativeNotificationService;\n this.RochetChatConnectorService = RochetChatConnectorService;\n this.NetworkServiceService = NetworkServiceService;\n this.eventService = eventService;\n this.ActiveTabService = ActiveTabService;\n this.RoleIdService = RoleIdService;\n this.totalEvent = 0;\n this.totalExpediente = 0;\n this.toDayEventStorage = ToDayEventStorage;\n this.totalDocumentStore = TotalDocumentStore;\n this.expedienteGdStore = ExpedienteGdStore;\n this.adding = \"intervenient\";\n this.mobileComponent = {\n showAddNewEvent: false,\n showEditEvent: false,\n showEventDetails: false,\n showEventList: false,\n transparentEventList: false,\n transparentEventToApprove: false,\n showEventToApprove: false,\n showAttendees: false,\n showAttendeeModal: false\n };\n this.tabButton = {\n home: false,\n agenda: false,\n gabinete: false,\n actions: false,\n chat: false\n };\n this.eventToaprove = {\n back: false,\n serialNumber: \"\",\n saveData: {}\n };\n this.status = \"\";\n this.audioName = \"\";\n this.permissionList = new PermissionList();\n this.SessionStore = SessionStore;\n this.logDeviceInfo = /*#__PURE__*/_asyncToGenerator(function* () {\n const info = yield Device.getInfo();\n });\n if (SessionStore.exist) {\n this.user = SessionStore.user;\n }\n this.NativeNotificationService.askForPermission();\n this.NativeNotificationService.foregroundNotification();\n this.router.events.subscribe(val => {\n document.querySelectorAll('ion-modal').forEach(e => e.remove());\n document.querySelectorAll('popover-viewport').forEach(e => e.remove());\n document.querySelectorAll('.loading-blocker').forEach(e => e.remove());\n document.querySelectorAll('ion-popover').forEach(e => e.remove());\n });\n window['platform'] = platform;\n window['inactivity/function'] = () => {\n if (window.location.pathname != '/inactivity' && window.location.pathname != '/') {\n document.querySelectorAll('ion-modal').forEach(e => e.remove());\n document.querySelectorAll('.popover-viewport').forEach(e => e.remove());\n document.querySelectorAll('.loading-blocker').forEach(e => e.remove());\n const pathname = window.location.pathname;\n SessionStore.setUrlBeforeInactivity(pathname);\n if (this.platform.is('mobileweb')) {\n window.location.pathname = '/inactivity';\n } else {\n window.location.pathname = '/';\n }\n }\n };\n }\n goto(url) {\n this.router.navigate([url], {\n replaceUrl: true\n });\n }\n refreshing() {}\n ngOnInit() {\n var _this = this;\n this.logDeviceInfo();\n this.notificationsService.onReciveForeground();\n this.notificationsService.onReciveBackground();\n window.addEventListener('online', () => {\n this.backgroundservice.online();\n if (this.platform.is('desktop') || this.platform.is('mobileweb')) {} else {\n this.synchWhenOnline();\n }\n });\n this.RochetChatConnectorService.registerCallback({\n type: 'reConnect',\n funx: function () {\n var _ref2 = _asyncToGenerator(function* () {\n _this.backgroundservice.online();\n });\n return function funx() {\n return _ref2.apply(this, arguments);\n };\n }()\n });\n this.NetworkServiceService.onNetworkChange().subscribe(status => {\n if (status == ConnectionStatus.Online) {\n this.backgroundservice.online();\n }\n });\n window.addEventListener('offline', () => {\n this.backgroundservice.offline();\n });\n this.updateList();\n this.clearTabButtonSelection();\n setTimeout(() => {\n if (this.p.userPermission([this.p.permissionList.Gabinete.md_tasks]) && this.p.userPermission([this.p.permissionList.Gabinete.pr_tasks])) {\n throw SessionStore.user.FullName + 'cant have MD and PR authorization at same time';\n }\n if (this.p.userPermission([this.p.permissionList.Chat.access]) && !SessionStore.user?.ChatData?.data) {\n throw 'Chat temporarily unavailable for ' + SessionStore.user.FullName + '. No ChatData';\n }\n if (this.p.userPermission([this.p.permissionList.Agenda.access]) && !this.eventService.hasAnyCalendar) {\n throw 'User ' + SessionStore.user.FullName + 'has No calendar';\n }\n if (this.p.userPermission([this.p.permissionList.Gabinete.pr_tasks]) && SessionStore.user.RoleID != this.RoleIdService.PRES) {\n throw 'User has PRES permission but not roleId';\n }\n if (!this.p.userPermission([this.p.permissionList.Gabinete.pr_tasks]) && SessionStore.user.RoleID == this.RoleIdService.PRES) {\n throw `User doesn't have PRES permission but has roleId`;\n }\n if (this.p.userPermission([this.p.permissionList.Gabinete.md_tasks]) && SessionStore.user.RoleID != this.RoleIdService.PV) {\n throw 'User has vice president permission but not roleId';\n }\n if (!this.p.userPermission([this.p.permissionList.Gabinete.md_tasks]) && SessionStore.user.RoleID == this.RoleIdService.PV) {\n throw `User doesn't has vice president permission but has roleId`;\n }\n }, 1000);\n }\n clearTabButtonSelection() {\n this.tabButton.home = false;\n this.tabButton.agenda = false;\n this.tabButton.gabinete = false;\n this.tabButton.actions = false;\n this.tabButton.chat = false;\n }\n selectedTab(url) {\n this.clearTabButtonSelection();\n if (url == '/home/events') {\n this.tabButton.home = true;\n } else if (url == '/home/agenda') {\n this.tabButton.agenda = true;\n } else if (url == '/home/gabinete-digital') {\n this.tabButton.gabinete = true;\n } else if (url == '/home/publications') {\n this.tabButton.actions = true;\n } else if (url == '/home/chat') {\n this.tabButton.chat = true;\n } else {\n this.clearTabButtonSelection();\n }\n }\n updateList() {\n document.addEventListener('pause', function () {});\n document.addEventListener('resume', function () {});\n }\n synchWhenOnline() {\n var _this2 = this;\n return _asyncToGenerator(function* () {\n try {\n yield _this2.storage.get('eventEdit').then(req => {\n JSON.parse(req).forEach(element => {\n _this2.eventservice.editEvent(element, 2, 3).subscribe(res => {\n _this2.storage.remove('eventEdit');\n //this.sqliteservice.deleteeventsTable();\n });\n });\n });\n } catch (error) {}\n try {\n yield _this2.storage.get('eventDelete').then(req => {\n JSON.parse(req).forEach(element => {\n _this2.eventservice.deleteEvent(element.eventid, element.eventDeleteType, element.calendarName).subscribe(res => {\n _this2.storage.remove('eventDelete');\n });\n });\n });\n } catch (error) {}\n try {\n yield _this2.storage.get('event-listRever').then(req => {\n JSON.parse(req).forEach(element => {\n _this2.processservice.PostTaskAction(element).subscribe(res => {\n _this2.storage.remove('event-listRever');\n });\n });\n });\n } catch (error) {}\n // this.sqliteservice.deleteAllTables();\n })();\n }\n};\n\nHomePage.ctorParameters = () => [{\n type: Router\n}, {\n type: AlertController\n}, {\n type: NotificationsService\n}, {\n type: Platform\n}, {\n type: PermissionService\n}, {\n type: BackgroundService\n}, {\n type: Storage\n}, {\n type: EventsService\n}, {\n type: ProcessesService\n}, {\n type: RouteService\n}, {\n type: NativeNotificationService\n}, {\n type: RochetChatConnectorService\n}, {\n type: NetworkServiceService\n}, {\n type: EventsService\n}, {\n type: ActiveTabService\n}, {\n type: RoleIdService\n}];\nHomePage = __decorate([Component({\n selector: 'app-home',\n template: __NG_CLI_RESOURCE__0,\n styles: [__NG_CLI_RESOURCE__1]\n})], HomePage);\nexport { HomePage };","map":{"version":3,"mappings":";;;;AAAA,SAASA,SAAS,QAAgB,eAAe;AAEjD,SAASC,oBAAoB,QAAQ,mCAAmC;AACxE,SAASC,eAAe,EAAEC,QAAQ,QAAQ,gBAAgB;AAC1D,SAASC,MAAM,QAAQ,iBAAiB;AACxC,SAASC,iBAAiB,QAAQ,uCAAuC;AACzE,SAASC,kBAAkB,QAAQ,iCAAiC;AACpE,SAASC,iBAAiB,QAAQ,qCAAqC;AACvE,SAASC,YAAY,QAAQ,0BAA0B;AACvD,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,SAASC,iBAAiB,QAAQ,qCAAqC;AACvE,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SAASC,aAAa,QAAQ,iCAAiC;AAC/D,SAASC,0BAA0B,QAAQ,qDAAqD;AAChG,SAASC,gBAAgB,QAAQ,oCAAoC;AACrE,SAASC,aAAa,QAAQ,kCAAkC;AAChE,SAASC,gBAAgB,QAAQ,qCAAqC;AACtE,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,YAAY,QAAQ,gCAAgC;AAC7D,SAASC,qBAAqB,EAAEC,gBAAgB,QAAQ,0CAA0C;AAClG,SAASC,yBAAyB,QAAQ,8CAA8C;AAExF,SAASC,cAAc,QAAQ,qCAAqC;AAQ7D,IAAMC,QAAQ,GAAd,MAAMA,QAAQ;EA8CnBC,YACUC,MAAc,EACfC,SAA0B,EACzBC,oBAA0C,EAC3CC,QAAkB,EAClBC,CAAoB,EACnBC,iBAAoC,EACpCC,OAAgB,EAChBC,YAA2B,EAC3BC,cAAgC,EACjCf,YAA0B,EACzBG,yBAAoD,EACpDR,0BAAsD,EACtDM,qBAA4C,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AEhC,CAAC,GACWxG,QAAQ;SAARA,QAAQ","names":["Component","NotificationsService","AlertController","Platform","Router","ToDayEventStorage","TotalDocumentStore","ExpedienteGdStore","SessionStore","PermissionService","BackgroundService","Storage","EventsService","RochetChatConnectorService","ProcessesService","RoleIdService","ActiveTabService","Device","RouteService","NetworkServiceService","ConnectionStatus","NativeNotificationService","PermissionList","HomePage","constructor","router","modalCtrl","notificationsService","platform","p","backgroundservice","storage","eventservice","processservice","eventService","showAddNewEvent","showEditEvent","showEventDetails","showEventList","transparentEventList","transparentEventToApprove","showEventToApprove","showAttendees","showAttendeeModal","home","agenda","gabinete","actions","chat","back","serialNumber","saveData","info","getInfo","exist","user","askForPermission","foregroundNotification","events","subscribe","val","document","querySelectorAll","forEach","e","remove","window","location","pathname","setUrlBeforeInactivity","is","goto","url","navigate","replaceUrl","refreshing","ngOnInit","logDeviceInfo","onReciveForeground","onReciveBackground","addEventListener","online","synchWhenOnline","registerCallback","type","funx","_this","onNetworkChange","status","Online","offline","updateList","clearTabButtonSelection","setTimeout","userPermission","permissionList","Gabinete","md_tasks","pr_tasks","FullName","Chat","access","ChatData","data","Agenda","hasAnyCalendar","RoleID","PRES","PV","tabButton","selectedTab","_this2","get","then","req","JSON","parse","element","editEvent","res","error","deleteEvent","eventid","eventDeleteType","calendarName","PostTaskAction","selector","template"],"sourceRoot":"","sources":["C:\\Users\\eudes.inacio\\GabineteDigital\\gabinete-digital-fo\\src\\app\\home\\home.page.ts"],"sourcesContent":["import { Component, OnInit } from '@angular/core';\r\nimport { Event } from '../models/event.model';\r\nimport { NotificationsService } from '../services/notifications.service';\r\nimport { AlertController, Platform } from '@ionic/angular';\r\nimport { Router } from '@angular/router';\r\nimport { ToDayEventStorage } from '../store/to-day-event-storage.service';\r\nimport { TotalDocumentStore } from '../store/total-document.service';\r\nimport { ExpedienteGdStore } from '../store/expedientegd-store.service';\r\nimport { SessionStore } from '../store/session.service';\r\nimport { PermissionService } from '../services/permission.service';\r\nimport { BackgroundService } from 'src/app/services/background.service';\r\nimport { Storage } from '@ionic/storage';\r\nimport { EventsService } from 'src/app/services/events.service';\r\nimport { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';\r\nimport { ProcessesService } from 'src/app/services/processes.service';\r\nimport { RoleIdService } from 'src/app/services/role-id.service';\r\nimport { ActiveTabService } from 'src/app/services/active-tab.service';\r\nimport { Device } from '@capacitor/device';\r\nimport { RouteService } from 'src/app/services/route.service';\r\nimport { NetworkServiceService, ConnectionStatus } from 'src/app/services/network-service.service';\r\nimport { NativeNotificationService } from 'src/app/services/native-notification.service';\r\nimport { UserSession } from '../models/user.model';\r\nimport { PermissionList } from '../models/permission/permissionList';\r\n\r\n\r\n@Component({\r\n selector: 'app-home',\r\n templateUrl: './home.page.html',\r\n styleUrls: ['./home.page.scss'],\r\n})\r\nexport class HomePage implements OnInit {\r\n eventsList: Event[];\r\n prEventList: Event[];\r\n mdEventList: Event[];\r\n\r\n totalEvent = 0;\r\n totalExpediente = 0;\r\n profile: string;\r\n\r\n toDayEventStorage = ToDayEventStorage\r\n totalDocumentStore = TotalDocumentStore\r\n expedienteGdStore = ExpedienteGdStore\r\n adding: \"intervenient\" | \"CC\" = \"intervenient\";\r\n mobileComponent = {\r\n showAddNewEvent: false,\r\n showEditEvent: false,\r\n showEventDetails: false,\r\n showEventList: false,\r\n transparentEventList: false,\r\n transparentEventToApprove: false,\r\n showEventToApprove: false,\r\n showAttendees: false,\r\n showAttendeeModal: false\r\n }\r\n tabButton = {\r\n home: false,\r\n agenda: false,\r\n gabinete: false,\r\n actions: false,\r\n chat: false,\r\n }\r\n eventToaprove: any = {\r\n back: false,\r\n serialNumber: \"\",\r\n saveData: {}\r\n }\r\n selectedEvent: Event;\r\n postEvent: any;\r\n folderId: string;\r\n\r\n status: string = \"\";\r\n audioName: string = \"\";\r\n public user: UserSession;\r\n permissionList = new PermissionList();\r\n SessionStore = SessionStore\r\n\r\n constructor(\r\n private router: Router,\r\n public modalCtrl: AlertController,\r\n private notificationsService: NotificationsService,\r\n public platform: Platform,\r\n public p: PermissionService,\r\n private backgroundservice: BackgroundService,\r\n private storage: Storage,\r\n private eventservice: EventsService,\r\n private processservice: ProcessesService,\r\n public RouteService: RouteService,\r\n private NativeNotificationService: NativeNotificationService,\r\n private RochetChatConnectorService: RochetChatConnectorService,\r\n private NetworkServiceService: NetworkServiceService,\r\n public eventService: EventsService,\r\n public ActiveTabService: ActiveTabService,\r\n private RoleIdService: RoleIdService\r\n ) {\r\n if (SessionStore.exist) {\r\n this.user = SessionStore.user;\r\n }\r\n\r\n this.NativeNotificationService.askForPermission();\r\n this.NativeNotificationService.foregroundNotification();\r\n\r\n this.router.events.subscribe((val) => {\r\n document.querySelectorAll('ion-modal').forEach((e: any) => e.remove())\r\n document.querySelectorAll('popover-viewport').forEach((e: any) => e.remove())\r\n document.querySelectorAll('.loading-blocker').forEach((e: any) => e.remove())\r\n document.querySelectorAll('ion-popover').forEach((e: any) => e.remove())\r\n });\r\n\r\n window['platform'] = platform\r\n\r\n window['inactivity/function'] = () => {\r\n\r\n if (window.location.pathname != '/inactivity' && window.location.pathname != '/') {\r\n\r\n document.querySelectorAll('ion-modal').forEach((e: any) => e.remove());\r\n document.querySelectorAll('.popover-viewport').forEach((e: any) => e.remove());\r\n document.querySelectorAll('.loading-blocker').forEach((e: any) => e.remove());\r\n\r\n const pathname = window.location.pathname\r\n SessionStore.setUrlBeforeInactivity(pathname)\r\n\r\n if (this.platform.is('mobileweb')) {\r\n window.location.pathname = '/inactivity'\r\n } else {\r\n window.location.pathname = '/'\r\n }\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n goto(url) {\r\n this.router.navigate([url], { replaceUrl: true })\r\n }\r\n\r\n refreshing() { }\r\n\r\n ngOnInit() {\r\n\r\n this.logDeviceInfo();\r\n\r\n this.notificationsService.onReciveForeground();\r\n this.notificationsService.onReciveBackground();\r\n\r\n window.addEventListener('online', () => {\r\n this.backgroundservice.online()\r\n if (this.platform.is('desktop') || this.platform.is('mobileweb')) {\r\n } else {\r\n this.synchWhenOnline()\r\n }\r\n });\r\n\r\n this.RochetChatConnectorService.registerCallback({\r\n type: 'reConnect',\r\n funx: async () => {\r\n this.backgroundservice.online()\r\n }\r\n })\r\n\r\n this.NetworkServiceService.onNetworkChange().subscribe((status) => {\r\n if (status == ConnectionStatus.Online) {\r\n this.backgroundservice.online()\r\n }\r\n })\r\n\r\n window.addEventListener('offline', () => {\r\n this.backgroundservice.offline()\r\n });\r\n\r\n this.updateList()\r\n\r\n this.clearTabButtonSelection();\r\n\r\n setTimeout(() => {\r\n if (this.p.userPermission([this.p.permissionList.Gabinete.md_tasks]) && this.p.userPermission([this.p.permissionList.Gabinete.pr_tasks])) {\r\n throw (SessionStore.user.FullName + 'cant have MD and PR authorization at same time');\r\n }\r\n\r\n if (this.p.userPermission([this.p.permissionList.Chat.access]) && !SessionStore.user?.ChatData?.data) {\r\n throw ('Chat temporarily unavailable for ' + SessionStore.user.FullName + '. No ChatData');\r\n }\r\n\r\n if (this.p.userPermission([this.p.permissionList.Agenda.access]) && !this.eventService.hasAnyCalendar) {\r\n throw ('User ' + SessionStore.user.FullName + 'has No calendar');\r\n }\r\n if (this.p.userPermission([this.p.permissionList.Gabinete.pr_tasks]) && SessionStore.user.RoleID != this.RoleIdService.PRES) {\r\n throw ('User has PRES permission but not roleId');\r\n }\r\n if (!this.p.userPermission([this.p.permissionList.Gabinete.pr_tasks]) && SessionStore.user.RoleID == this.RoleIdService.PRES) {\r\n throw (`User doesn't have PRES permission but has roleId`);\r\n }\r\n\r\n\r\n if (this.p.userPermission([this.p.permissionList.Gabinete.md_tasks]) && SessionStore.user.RoleID != this.RoleIdService.PV) {\r\n throw ('User has vice president permission but not roleId');\r\n }\r\n if (!this.p.userPermission([this.p.permissionList.Gabinete.md_tasks]) && SessionStore.user.RoleID == this.RoleIdService.PV) {\r\n throw (`User doesn't has vice president permission but has roleId`);\r\n }\r\n }, 1000)\r\n\r\n }\r\n\r\n clearTabButtonSelection() {\r\n this.tabButton.home = false;\r\n this.tabButton.agenda = false;\r\n this.tabButton.gabinete = false;\r\n this.tabButton.actions = false;\r\n this.tabButton.chat = false;\r\n }\r\n\r\n selectedTab(url?: string) {\r\n this.clearTabButtonSelection();\r\n if (url == '/home/events') {\r\n this.tabButton.home = true;\r\n }\r\n else if (url == '/home/agenda') {\r\n this.tabButton.agenda = true;\r\n }\r\n else if (url == '/home/gabinete-digital') {\r\n this.tabButton.gabinete = true;\r\n }\r\n else if (url == '/home/publications') {\r\n this.tabButton.actions = true;\r\n }\r\n else if (url == '/home/chat') {\r\n this.tabButton.chat = true;\r\n }\r\n else {\r\n this.clearTabButtonSelection();\r\n }\r\n }\r\n\r\n logDeviceInfo = async () => {\r\n const info = await Device.getInfo();\r\n }\r\n\r\n updateList() {\r\n\r\n document.addEventListener('pause', function () {\r\n\r\n });\r\n\r\n document.addEventListener('resume', function () {\r\n\r\n });\r\n\r\n }\r\n\r\n async synchWhenOnline() {\r\n try {\r\n await this.storage.get('eventEdit').then((req) => {\r\n JSON.parse(req).forEach(element => {\r\n this.eventservice.editEvent(element, 2, 3).subscribe((res) => {\r\n this.storage.remove('eventEdit')\r\n //this.sqliteservice.deleteeventsTable();\r\n })\r\n });\r\n })\r\n } catch (error) {\r\n\r\n }\r\n\r\n try {\r\n await this.storage.get('eventDelete').then((req) => {\r\n JSON.parse(req).forEach(element => {\r\n this.eventservice.deleteEvent(element.eventid, element.eventDeleteType, element.calendarName).subscribe((res) => {\r\n this.storage.remove('eventDelete')\r\n })\r\n });\r\n })\r\n } catch (error) {\r\n\r\n }\r\n\r\n try {\r\n await this.storage.get('event-listRever').then((req) => {\r\n JSON.parse(req).forEach(element => {\r\n this.processservice.PostTaskAction(element).subscribe((res) => {\r\n this.storage.remove('event-listRever')\r\n })\r\n });\r\n })\r\n } catch (error) {\r\n\r\n }\r\n\r\n // this.sqliteservice.deleteAllTables();\r\n }\r\n\r\n}"]},"metadata":{},"sourceType":"module"} |