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I,IAAI;QAC7C,IAAIA,IAAI,KAAK,IAAI,EAAE;UACjB,IAAGA,IAAI,CAACA,IAAI,KAAKC,SAAS,EAAE;YAC1B,IAAGD,IAAI,CAACA,IAAI,CAACvG,UAAU,KAAKwG,SAAS,EAAE;cACrC,IAAGxC,CAAC,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE;gBAC1BA,CAAC,CAAC,WAAW,CAAC,CAACY,IAAI,CAAC,MAAM,EAAE2B,IAAI,CAACA,IAAI,CAACvG,UAAU,CAAC;;;;;MAK3D,CAAC,CAAC;MAEF,aAAaG,KAAK,CAAC4C,WAAW,CAAC0D,OAAO,EAAE;IAAC;EAC3C;;;;;;;;;;;;;;;AA9HW1F,gBAAgB,GAAAN,iDAAA,EAL5BhB,wDAAS,CAAC;EACTiB,QAAQ,EAAE,mBAAmB;EAC7BC,QAAA,EAAAC,gEAAwC;;CAEzC,CAAC,GACWG,gBAAgB,CAgI5B;;;;;;;;;;AC9ID;AACA,4CAA4C,mBAAO,CAAC,uEAA6D;AACjH,kCAAkC,mBAAO,CAAC,gEAAsD;AAChG;AACA;AACA,iDAAiD,kEAAkE;AACnH;AACA","sources":["./src/app/components/modals/search-modal/search.modal.page.ts","./src/app/libro-virtual/libro-virtual-routing.module.ts","./src/app/libro-virtual/libro-virtual.module.ts","./src/app/libro-virtual/libro-virtual.page.ts","./src/app/libro-virtual/libro-virtual.page.scss"],"sourcesContent":["import { Component, Input } from '@angular/core';\nimport { ModalController } from '@ionic/angular';\n\n@Component({\n selector: 'search-modal-page',\n templateUrl: './search.modal.html',\n})\nexport class SearchModalPage {\n\n @Input() count:number = 0;\n private pageNumber:number = 0;\n\n constructor(\n private modalCtrl: ModalController\n ) {}\n\n onPageNumberChange(e) {\n let _root = this;\n \n if(parseInt(e.currentTarget.value) > _root.count) {\n _root.pageNumber = 1;\n e.currentTarget.value = 1;\n }\n else {\n _root.pageNumber = parseInt(e.currentTarget.value);\n }\n }\n\n onSearch() {\n let _root = this;\n\n if(_root.pageNumber > 0) {\n _root.modalCtrl.dismiss({\n pageNumber: _root.pageNumber\n });\n }\n }\n\n}","import { NgModule } from '@angular/core';\nimport { Routes, RouterModule } from '@angular/router';\n\nimport { LibroVirtualPage } from './libro-virtual.page';\n\nconst routes: Routes = [\n {\n path: '',\n component: LibroVirtualPage\n }\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class LibroVirtualPageRoutingModule {}\n","import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\nimport { PinchZoomModule } from '@meddv/ngx-pinch-zoom';\n\nimport { IonicModule } from '@ionic/angular';\n\nimport { LibroVirtualPageRoutingModule } from './libro-virtual-routing.module';\n\nimport { LibroVirtualPage } from './libro-virtual.page';\nimport { SearchModalPage } from '../components/modals/search-modal/search.modal.page';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n IonicModule,\n LibroVirtualPageRoutingModule,\n FontAwesomeModule,\n PinchZoomModule,\n SearchModalPage\n ],\n declarations: [LibroVirtualPage, SearchModalPage],\n schemas: [CUSTOM_ELEMENTS_SCHEMA]\n})\nexport class LibroVirtualPageModule {}\n","import { Component, OnInit } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { ModalController } from '@ionic/angular';\nimport { SearchModalPage } from '../components/modals/search-modal/search.modal.page';\nimport { ApiService } from '../services/api.service';\nimport { GlobalService } from '../services/global.service';\n\ndeclare var $: any;\n\n@Component({\n selector: 'app-libro-virtual',\n templateUrl: './libro-virtual.page.html',\n styleUrls: ['./libro-virtual.page.scss'],\n})\nexport class LibroVirtualPage implements OnInit {\n\n private platformDevice:string = '';\n private loading:boolean = false;\n private title:string = '';\n private uuid:string = '';\n private count:number = 0;\n private flipbookViewport = null;\n private flipbook = null;\n private navBookPosVertical = 'center';\n private modalSearch = null;\n\n constructor(\n private router: Router,\n private activatedRoute: ActivatedRoute,\n private modalCtrl: ModalController,\n private globalService: GlobalService,\n private apiService: ApiService\n ) {\n\n }\n\n ngOnInit() {\n let _root = this;\n if(_root.router.getCurrentNavigation().extras.state.uuid) {\n _root.title = _root.router.getCurrentNavigation().extras.state.title;\n _root.uuid = _root.router.getCurrentNavigation().extras.state.uuid;\n _root.count = _root.router.getCurrentNavigation().extras.state.count;\n _root.loading = true;\n _root.apiService.getVirtualBookPage(_root.uuid, '1').subscribe(\n result => {\n let blob = new Blob([result], { type: 'image/jpg' });\n let urlCreator = window.URL || window.webkitURL;\n let imageUrl = urlCreator.createObjectURL( blob );\n $('#flipbook').html(`
`);\n\n _root.platformDevice = this.globalService.getDeviceType();\n $(document).ready((e) => {\n let stageHeight = $(window).height();\n let stageWidth = $(window).width();\n let _width = ((stageHeight - 100) * 0.80) * 2;\n let _height = (stageHeight - 100);\n let _display = 'double';\n \n if(_root.platformDevice == 'mobile') {\n _root.navBookPosVertical = 'bottom';\n _display = 'single';\n _width = stageWidth;\n _height = stageWidth * 1.25;\n }\n \n _root.flipbookViewport = $('.flipbook-viewport');\n _root.loading = false;\n $('#flipbook').turn({\n display: _display,\n width: _width,\n height: _height,\n pages: _root.count,\n autoCenter: true,\n elevation: 50,\n when: {\n turning: function(e, page) {\n const range = $('#flipbook').turn('range', page);\n \n for (page = range[0]; page <= range[1]; page++) {\n if (!$('#flipbook').turn('hasPage', page)) {\n const element = $('
', {});\n element.html('
Cargando página...

');\n $('#flipbook').turn('addPage', element, page);\n\n _root.apiService.getVirtualBookPage(_root.uuid, page).subscribe(\n result_page => {\n let blob_page = new Blob([result_page], { type: 'image/jpg' });\n let urlCreator_page = window.URL || window.webkitURL;\n let imageUrl_page = urlCreator_page.createObjectURL( blob_page );\n element.html(``);\n },\n error => {\n console.log(error);\n }\n );\n }\n }\n }\n }\n });\n });\n },\n error => {\n _root.loading = false;\n }\n );\n }\n }\n\n onNavigateBook(direction) {\n let _root = this;\n\n if($('#flipbook') !== null) {\n $('#flipbook').turn(direction);\n }\n }\n\n async onSeacrhModal() {\n let _root = this;\n _root.modalSearch = await _root.modalCtrl.create({\n component: SearchModalPage,\n cssClass: 'modal-search-page',\n componentProps: {\n 'count': _root.count\n }\n });\n\n _root.modalSearch.onDidDismiss().then((data) => {\n if (data !== null) {\n if(data.data !== undefined) {\n if(data.data.pageNumber !== undefined) {\n if($('#flipbook') !== null) {\n $('#flipbook').turn(\"page\", data.data.pageNumber);\n }\n }\n }\n }\n });\n\n return await _root.modalSearch.present();\n }\n\n}\n","// Imports\nvar ___CSS_LOADER_API_SOURCEMAP_IMPORT___ = require(\"../../../node_modules/css-loader/dist/runtime/sourceMaps.js\");\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../node_modules/css-loader/dist/runtime/api.js\");\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, ``, \"\",{\"version\":3,\"sources\":[],\"names\":[],\"mappings\":\"\",\"sourceRoot\":\"\"}]);\n// Exports\nmodule.exports = ___CSS_LOADER_EXPORT___.toString();\n"],"names":["Component","Input","ModalController","SearchModalPage","constructor","modalCtrl","count","pageNumber","onPageNumberChange","e","_root","parseInt","currentTarget","value","onSearch","dismiss","__decorate","selector","template","__NG_CLI_RESOURCE__0","NgModule","RouterModule","LibroVirtualPage","routes","path","component","LibroVirtualPageRoutingModule","imports","forChild","exports","CUSTOM_ELEMENTS_SCHEMA","CommonModule","FormsModule","FontAwesomeModule","PinchZoomModule","IonicModule","LibroVirtualPageModule","declarations","schemas","ActivatedRoute","Router","ApiService","GlobalService","router","activatedRoute","globalService","apiService","platformDevice","loading","title","uuid","flipbookViewport","flipbook","navBookPosVertical","modalSearch","ngOnInit","getCurrentNavigation","extras","state","getVirtualBookPage","subscribe","result","blob","Blob","type","urlCreator","window","URL","webkitURL","imageUrl","createObjectURL","$","html","getDeviceType","document","ready","stageHeight","height","stageWidth","width","_width","_height","_display","turn","display","pages","autoCenter","elevation","when","turning","page","range","element","result_page","blob_page","urlCreator_page","imageUrl_page","error","console","log","onNavigateBook","direction","onSeacrhModal","_this","_asyncToGenerator","create","cssClass","componentProps","onDidDismiss","then","data","undefined","present"],"sourceRoot":"webpack:///","x_google_ignoreList":[]}