{"version":3,"sources":["./src/app/pages/start/start.page.ts","./src/app/pages/start/start.page.html","./src/app/pages/start/start.module.ts"],"names":["StartPage","platform","router","alertController","loadingController","globalVariableService","storageService","connect_url","connect_window","callback","event","window","removeEventListener","this","close","data","url","includes","navigateByUrl","substr","indexOf","replaceUrl","api_client_id","api_redirect_uri","is","open","addEventListener","connect","signup","openTermsOfService","openPrivacyPolicy","routes","path","component","StartPageModule","forChild"],"mappings":"iQAaO,Y,MAAMA,EAKT,YACYC,EACAC,EACDC,EACAC,EACAC,EACAC,GALC,KAAAL,WACA,KAAAC,SACD,KAAAC,kBACA,KAAAC,oBACA,KAAAC,wBACA,KAAAC,iBATX,KAAAC,YAAc,KACd,KAAAC,eAAiB,KAkCT,KAAAC,SAAYC,IAChBC,OAAOC,oBAAoB,UAAWC,KAAKJ,UAC3CI,KAAKL,eAAeM,QAChBJ,EAAMK,KAAKC,KAAON,EAAMK,KAAKC,IAAIC,SAAS,WAC1CJ,KAAKX,OAAOgB,cACR,kBAAoBR,EAAMK,KAAKC,IAAIG,OAAOT,EAAMK,KAAKC,IAAII,QAAQ,MACjE,CAAEC,YAAY,KA7B1B,YAIM,U,kDACFR,KAAKN,YACD,oFAEAM,KAAKR,sBAAsBiB,cAC3B,iBACAT,KAAKR,sBAAsBkB,iBAC3BV,KAAKZ,SAASuB,GAAG,mBACX,IAAQC,KAAK,CAAET,IAAKH,KAAKN,eAE/BM,KAAKL,eAAiBG,OAAOc,KACzBZ,KAAKN,YACL,SACA,yDAEJI,OAAOe,iBAAiB,UAAWb,KAAKJ,aAe1C,S,kDACFI,KAAKN,YAAc,wCACfM,KAAKZ,SAASuB,GAAG,mBACX,IAAQC,KAAK,CAAET,IAAKH,KAAKN,eAE/BM,KAAKL,eAAiBG,OAAOc,KACzBZ,KAAKN,YACL,SACA,yDAEJI,OAAOe,iBAAiB,UAAWb,KAAKJ,aAI1C,qB,kDACF,IAAIO,EAAM,gDACNH,KAAKZ,SAASuB,GAAG,mBACX,IAAQC,KAAK,CAAET,IAAKA,IAE1BL,OAAOc,KACHT,EACA,SACA,2DAKN,oB,kDACF,IAAIA,EAAM,4CACNH,KAAKZ,SAASuB,GAAG,mBACX,IAAQC,KAAK,CAAET,IAAKA,IAE1BL,OAAOc,KACHT,EACA,SACA,4D,6CAnFHhB,GAAS,8D,uBAATA,EAAS,kWCbtB,sBAEI,gBACI,qBACI,oBACI,oBACI,oBACJ,OACJ,OACA,oBACI,oBACI,uBAAY,+BAAS,EAAA2B,YAAyB,gBAAK,OACvD,OACJ,OACA,mBACI,qBACI,wBAAY,+BAAS,EAAAC,WAA0B,mBAAO,OAC1D,OACJ,OACJ,OACJ,OAEA,iBACI,oBACI,mBACI,mBACI,uBACI,wBAA4B,+BAAS,EAAAC,uBAAsB,wBAAY,OAAc,eAAE,yBAA0B,+BAAS,EAAAC,sBAAqB,0BAAc,OACjK,OACJ,OACJ,OACJ,OACJ,OAEJ,S,upCDrBO,G,gBELP,MAAMC,EAAiB,CACrB,CACEC,KAAM,GACNC,UAAW,IAcR,Y,MAAMC,G,6CAAAA,I,uBAAAA,I,2BATF,CACP,IACA,IACA,IACA,IACA,IAAaC,SAASJ,O,GAInB","file":"75.4fc10cebae84abb91875.js","sourcesContent":["import { Component, OnInit } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { LoadingController, AlertController } from '@ionic/angular';\nimport { GlobalVariableService } from '../../services/globalvariable.service';\nimport { Platform } from '@ionic/angular';\nimport { Browser } from '@capacitor/browser';\nimport { StorageService } from '../../services/storage.service';\n\n@Component({\n selector: 'app-start',\n templateUrl: 'start.page.html',\n styleUrls: ['start.page.scss'],\n})\nexport class StartPage implements OnInit {\n\n connect_url = null;\n connect_window = null;\n\n constructor(\n private platform: Platform,\n private router: Router,\n public alertController: AlertController,\n public loadingController: LoadingController,\n public globalVariableService: GlobalVariableService,\n public storageService: StorageService\n ) { }\n\n ngOnInit() {\n\n }\n\n async connect() {\n this.connect_url =\n 'https://api.fundpay.co.nz/merchant/oauth2/authorize?response_type=code' +\n '&client_id=' +\n this.globalVariableService.api_client_id +\n '&redirect_uri=' +\n this.globalVariableService.api_redirect_uri;\n if (this.platform.is('capacitor')) {\n await Browser.open({ url: this.connect_url });\n } else {\n this.connect_window = window.open(\n this.connect_url,\n '_blank',\n 'toolbar=no,transitionstyle=fliphorizontal,location=no'\n );\n window.addEventListener('message', this.callback);\n }\n }\n\n private callback = (event) => {\n window.removeEventListener('message', this.callback);\n this.connect_window.close();\n if (event.data.url && event.data.url.includes('?code=')) {\n this.router.navigateByUrl(\n '/oauth-callback' + event.data.url.substr(event.data.url.indexOf('?')),\n { replaceUrl: true }\n );\n }\n };\n\n async signup() {\n this.connect_url = 'https://signup.fundpay.co.nz/merchant';\n if (this.platform.is('capacitor')) {\n await Browser.open({ url: this.connect_url });\n } else {\n this.connect_window = window.open(\n this.connect_url,\n '_blank',\n 'toolbar=no,transitionstyle=fliphorizontal,location=no'\n );\n window.addEventListener('message', this.callback);\n }\n }\n\n async openTermsOfService() {\n let url = 'https://www.fundpay.co.nz/merchant-agreement/';\n if (this.platform.is('capacitor')) {\n await Browser.open({ url: url });\n } else {\n window.open(\n url,\n '_blank',\n 'toolbar=no,transitionstyle=fliphorizontal,location=no'\n );\n }\n }\n\n async openPrivacyPolicy() {\n let url = 'https://www.fundpay.co.nz/privacy-policy/';\n if (this.platform.is('capacitor')) {\n await Browser.open({ url: url });\n } else {\n window.open(\n url,\n '_blank',\n 'toolbar=no,transitionstyle=fliphorizontal,location=no'\n );\n }\n } \n\n}\n","\n\n
\n \n \n \n \n \n \n \n \n Login\n \n \n \n \n Sign up\n \n \n \n
\n\n
\n \n \n \n \n Terms of use | Privacy policy\n \n \n \n \n
\n\n
\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { Routes, RouterModule } from '@angular/router';\nimport { IonicModule } from '@ionic/angular';\nimport { StartPage } from './start.page';\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\n\nconst routes: Routes = [\n {\n path: '',\n component: StartPage\n }\n];\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n IonicModule,\n FontAwesomeModule,\n RouterModule.forChild(routes)\n ],\n declarations: [StartPage]\n})\nexport class StartPageModule {}\n"],"sourceRoot":"webpack:///"}