summaryrefslogtreecommitdiff
path: root/www/lib/ngCordova/dist/ng-cordova-mocks.min.js
blob: 4277d55e9d646987077ac03e81c8b17d96287d04 (plain)
1
2
3
4
5
6
7
/*!
 * ngCordova
 * v0.1.20-alpha
 * Copyright 2015 Drifty Co. http://drifty.com/
 * See LICENSE in this repository for license information
 */
!function(){var e=angular.module("ngCordovaMocks",[]);e.factory("$cordovaAppVersion",["$q",function(e){var r=!1;return{throwsError:r,getAppVersion:function(){var r=e.defer();return r.resolve("mock v"),r.promise}}}]),e.factory("$cordovaBarcodeScanner",["$q",function(e){var r=!1,t="",o="",i=!1;return{throwsError:r,scannedText:t,scannedFormat:o,wasCancelled:i,scan:function(){var r=e.defer();return this.throwsError?r.reject("There was an error scanning."):r.resolve({text:this.scannedText,format:this.scannedFormat,cancelled:this.wasCancelled}),r.promise},encode:function(r,t){this.scannedFormat=r,this.scannedText=t;var o=e.defer();return this.throwsError?o.reject("There was an error encoding the data."):o.resolve(),o.promise}}}]),e.factory("$cordovaBLE",["$q","$timeout",function(e,r){var t={name:"Test Device",id:"AA:BB:CC:DD:EE:FF",advertising:[2,1,6,3,3,15,24,8,9,66,97,116,116,101,114,121],rssi:-55},o={name:"Test Device",id:"AA:BB:CC:DD:EE:FF",advertising:[2,1,6,3,3,15,24,8,9,66,97,116,116,101,114,121],rssi:-55,services:["1800","1801","180f"],characteristics:[{service:"1800",characteristic:"2a00",properties:["Read"]},{service:"1800",characteristic:"2a01",properties:["Read"]},{service:"1801",characteristic:"2a05",properties:["Read"]},{service:"180f",characteristic:"2a19",properties:["Read"],descriptors:[{uuid:"2901"},{uuid:"2904"}]}]},i=new ArrayBuffer(8);return{scan:function(o,i){var n=e.defer();return r(function(){n.resolve(t)},1e3*i),n.promise},connect:function(t){var i=e.defer();return r(function(){i.resolve(o)},1500),i.promise},disconnect:function(t){var o=e.defer();return r(function(){o.resolve(!0)},500),o.promise},read:function(t,o,n){var s=e.defer();return r(function(){s.resolve(i)},100),s.promise},write:function(t,o,i,n){var s=e.defer();return r(function(){s.resolve(!0)},100),s.promise},writeCommand:function(t,o,i,n){var s=e.defer();return r(function(){s.resolve(!0)},100),s.promise},notify:function(t,o,i){var n=e.defer();return r(function(){n.resolve(!0)},100),n.promise},indicate:function(t,o,i){var n=e.defer();return r(function(){n.resolve(!0)},100),n.promise},isConnected:function(r){var t=e.defer();return t.resolve(!0),t.promise},isEnabled:function(){var r=e.defer();return r.resolve(!0),r.promise}}}]),e.factory("$cordovaBrightness",["$q",function(e){var r=100;return{get:function(){var t=e.defer();return t.resolve(r),t.promise},set:function(t){var o=e.defer();return r=t,o.resolve("OK"),o.promise},setKeepScreenOn:function(r){var t=e.defer();return t.resolve("OK"),t.promise}}}]),e.factory("$cordovaCamera",["$q",function(e){var r=!1,t="";return{throwsError:r,imageData:t,getPicture:function(r){var t=e.defer();return this.throwsError?t.reject("There was an error getting the picture."):(r&&(r=r),t.resolve(this.imageData)),t.promise}}}]),e.factory("$cordovaCapture",["$q",function(e){var r=!1;return{throwsError:r,captureAudio:function(){var r=e.defer();return this.throwsError?r.reject("There was an error capturing the audio."):r.resolve(),r.promise},captureImage:function(){var r=e.defer();return this.throwsError?r.reject("There was an error capturing the image."):r.resolve(),r.promise},captureVideo:function(){var r=e.defer();return this.throwsError?r.reject("There was an error capturing the video."):r.resolve(),r.promise}}}]),e.factory("$cordovaContacts",["$q",function(e){var r=!1,t=[];return{throwsError:r,contacts:t,save:function(r){var t=e.defer();if(this.throwsError)t.reject("There was an error saving the contact.");else{for(var o=null,i=0;i<this.contacts.length;i++)if(this.contacts[i].id===r.id){o=i;break}null===o?(this.contacts.push(r),t.resolve()):t.reject("Contact already exists.")}return t.promise},remove:function(r){var t=e.defer();if(this.throwsError)t.reject("There was an error saving the contact.");else{for(var o=null,i=0;i<this.contacts.length;i++)if(this.contacts[i].id===r.id){o=i;break}null===o?t.reject("Unable to find contact."):(this.contacts.splice(o,1),t.resolve())}return t.promise},find:function(r){var t=e.defer();if(this.throwsError)t.reject("There was an error finding the contact.");else{var o=r.fields||["id","displayName"];if(delete r.fields,o)if("*"===o)t.resolve(this.contacts);else{for(var i=[],n=0;n<this.contacts.length;n++)for(var s in this.contacts[n])var a=this.contacts[n][s];t.resolve(i)}else t.reject("ContactError.INVALID_ARGUMENT_ERROR")}return t.promise}}}]),e.factory("$cordovaDatePicker",["$q",function(e){return{show:function(r){var t=e.defer();return r=r||{date:new Date,mode:"date"},t.resolve(r.date),t.promise}}}]),e.factory("$cordovaDevice",function(){var e="",r="",t="",o="",i="",n="";return{device:e,cordova:r,model:t,platform:o,uuid:i,version:n,version:n,getDevice:function(){return this.device},getCordova:function(){return this.cordova},getModel:function(){return this.model},getPlatform:function(){return this.platform},getUUID:function(){return this.uuid},getVersion:function(){return this.version},getManufacturer:function(){return this.manufacturer}}}),e.factory("$cordovaDeviceMotion",["$interval","$q",function(e,r){var t=null,o=!1,i=[],n=[];return{currentAcceleration:t,throwsError:o,positions:i,watchIntervals:n,getCurrentAcceleration:function(){var e=r.defer();return this.throwsError?e.reject("There was an error getting the current acceleration."):e.resolve(this.currentAcceleration),e.promise},watchAcceleration:function(t){var o=r.defer(),i=Math.floor(1e6*Math.random()+1);if(this.positions=[],self=this,this.throwsError)o.reject("There was an error watching the current acceleration.");else{var n=1e4;t&&t.frequency&&(n=t.frequency),this.watchIntervals.push(e(function(){self.throwsError&&o.reject("There was an error watching the acceleration.");var e=Math.floor(100*Math.random()+1),r=Math.floor(100*Math.random()+1),t=Math.floor(100*Math.random()+1),i={x:e,y:r,z:t,timestamp:Date.now()};self.positions.push(i),o.notify(i)},n))}return{watchId:i,promise:o.promise}},clearWatch:function(t){var o=r.defer();if(t)if(this.throwsError)o.reject("Unable to clear watch.");else{for(var i=-1,s=0;s<this.watchIntervals.length;s++)if(this.watchIntervals[s].watchId===t){e.cancel(n[s].interval),i=s;break}-1!==i&&this.watchIntervals.splice(i,1)}else o.reject("Unable to clear watch. No watch ID provided.");return o.promise}}}]),e.factory("$cordovaDeviceOrientation",["$interval","$q",function(e,r){var t=null,o=!1,i=[],n=[];return{currentHeading:t,throwsError:o,readings:i,watchIntervals:n,getCurrentHeading:function(){var e=r.defer();return this.throwsError?e.reject("There was an error getting the current heading."):e.resolve(this.currentHeading),e.promise},watchHeading:function(t){var o=r.defer(),i=Math.floor(1e6*Math.random()+1),s=this;if(s.readings=[],s.throwsError)o.reject("There was an error getting the compass heading.");else{var a=100;t&&t.frequency&&(a=t.frequency),s.watchIntervals.push({watchID:i,interval:e(function(){s.throwsError&&o.reject("There was an error watching the acceleration.");var e=359.99*Math.random()+1,r=359.99*Math.random()+1,t=Math.floor(360*Math.random()+1),i={magneticHeading:e,trueHeading:r,headingAccuracy:t,timestamp:Date.now()};s.readings.push(i),o.notify(i)},a)})}var c=function(r){for(var t=-1,o=0;o<s.watchIntervals.length;o++)if(s.watchIntervals[o].watchID===r){e.cancel(n[o].interval),t=o;break}-1!==t&&s.watchIntervals.splice(t,1)};return o.promise.cancel=function(){c(i)},o.promise.clearWatch=function(e){c(e||i)},o.promise.watchID=i,o.promise},clearWatch:function(t){var o=r.defer();if(t)if(this.throwsError)o.reject("Unable to clear watch.");else{for(var i=-1,s=0;s<this.watchIntervals.length;s++)if(this.watchIntervals[s].watchId===t){e.cancel(n[s].interval),i=s;break}-1!==i&&this.watchIntervals.splice(i,1)}else o.reject("Unable to clear watch. No watch ID provided.");return o.promise}}}]),e.factory("$cordovaDialogs",["$q",function(e){var r=!1,t="",o="",i="",n=0,s=!0;return{dialogText:r,dialogTitle:t,defaultValue:o,promptResponse:i,buttonLabels:[],beepCount:n,useHostAbilities:s,alert:function(r,t,o){var i=e.defer();return this.useHostAbilities?(alert(r),i.resolve()):(this.dialogText=r,this.dialogTitle=t,this.buttonLabels.push(o),i.resolve()),i.promise},confirm:function(r,t,o){var i=e.defer();if(this.useHostAbilities){var n=confirm(r);i.resolve(n?2:1)}else this.dialogText=r,this.dialogTitle=t,this.buttonLabels.push(o),i.resolve(0);return i.promise},prompt:function(r,t,o,i){var n=e.defer();if(this.useHostAbilities){var s=prompt(r,i);n.resolve(s)}else{this.dialogText=r,this.dialogTitle=t,this.defaultValue=i;for(var a=0;a<o.length;a++)this.buttonLabels.push(o[a]);n.resolve(this.promptResponse)}return n.promise},beep:function(e){this.beepCount=e}}}]),e.factory("$cordovaFacebook",["$q",function(e){return{loginShouldSucceedWith:null,showDialogShouldSucceedWith:null,apiShouldSucceedWith:null,getAccessTokenShouldSucceedWith:null,getLoginStatusShouldSucceedWith:null,logoutShouldSuceedWith:null,login:function(r){return null!==this.loginShouldSucceedWith?e.when(this.loginShouldSucceedWith):e.reject()},showDialog:function(r){return null!==this.showDialogShouldSucceedWith?e.when(this.showDialogShouldSucceedWith):e.reject()},api:function(r,t){return null!==this.apiShouldSucceedWith?e.when(this.apiShouldSucceedWith):e.reject()},getAccessToken:function(){return null!==this.getAccessTokenShouldSucceedWith?e.when(this.getAccessTokenShouldSucceedWith):e.reject()},getLoginStatus:function(){return null!==this.getLoginStatusShouldSucceedWith?e.when(this.getLoginStatusShouldSucceedWith):e.reject()},logout:function(){return null!==this.logoutShouldSuceedWith?e.when(this.logoutShouldSuceedWith):e.reject()}}}]),e.factory("$cordovaFile",["$q",function(e){var r=!1,t={},o=!1,i={},n=function(r){var t=e.defer();return this.throwsError?t.reject(r):t.resolve(),t.promise};return{throwsError:r,fileSystem:t,shouldMockFiles:o,files:i,checkDir:function(r){if(this.shouldMockFiles){var t=e.defer();return this.files[r]&&!this.files[r].isFile?t.resolve():t.reject(),t.promise}return n.call(this,"There was an error checking the directory.")},createDir:function(r,t){if(this.shouldMockFiles){var o=e.defer();return this.files[r]={isFile:!1},o.resolve(),o.promise}return n.call(this,"There was an error creating the directory.")},listDir:function(e){return n.call(this,"There was an error listing the directory")},checkFile:function(r){if(this.shouldMockFiles){var t=e.defer();return this.files[r]&&this.files[r].isFile?t.resolve():t.reject(),t.promise}return n.call(this,"There was an error checking for the file.")},createFile:function(r,t){if(this.shouldMockFiles){var o=e.defer();return this.files[r]={isFile:!0,fileContent:""},o.resolve(),o.promise}return n.call(this,"There was an error creating the file.")},removeFile:function(e,r){return n.call(this,"There was an error removng the file.")},writeFile:function(e,r,t){return this.shouldMockFiles&&e&&r&&(this.files[e]={isFile:!0,fileContent:r}),n.call(this,"There was an error writing the file.")},readFile:function(e){return this.readAsText(e)},readAsText:function(r){if(this.shouldMockFiles){var t=e.defer();return i[r]&&i[r].isFile?t.resolve(i[r].fileContent):t.reject(),t.promise}return n.call(this,"There was an error reading the file as text.")},readAsDataURL:function(e){return n.call(this,"There was an error reading the file as a data url.")},readAsBinaryString:function(e){return n.call(this,"There was an error reading the file as a binary string.")},readAsArrayBuffer:function(e){return n.call(this,"There was an error reading the file as an array buffer.")},readFileMetadata:function(e){return n.call(this,"There was an error reading the file metadata")},readFileAbsolute:function(e){return n.call(this,"There was an error reading the file from the absolute path")},readFileMetadataAbsolute:function(e){return n.call(this,"There was an error reading the file metadta from the absolute path")}}}]),e.factory("$cordovaFileOpener2",["$q",function(e){var r=!1;return{throwsError:r,open:function(r,t){var o=e.defer();return this.throwError?o.reject({status:0,message:"There was an error capturing the file."}):o.resolve(),o.promise},uninstall:function(r){var t=e.defer();return this.throwError?t.reject({status:0,message:"There was an error capturing the packageId."}):t.resolve(),t.promise},appIsInstalled:function(r){var t=e.defer();return this.throwError?t.reject({status:0,message:"There was an error capturing the packageId."}):t.resolve(),t.promise}}}]),e.factory("$cordovaFileTransfer",["$q",function(e){var r=!1,t=function(r){var t=e.defer();return this.throwsError?t.reject(r):t.resolve(),t.promise};return{throwsError:r,download:function(e,r,o,i){return t.call(this,"There was an error downloading the file.")},upload:function(e,r,o){return t.call(this,"There was an error uploading the file.")}}}]),e.factory("$cordovaGeolocation",["$interval","$q",function(e,r){var t=!1,o=!0,i=[],n=[],s=null,a=null;return{throwsError:t,watchIntervals:i,locations:n,currentPosition:s,nextPosition:a,useHostAbilities:o,getCurrentPosition:function(e){var t=r.defer();return this.throwsError?t.reject("There was an error getting the location."):(e&&(e=e),this.useHostAbilities?navigator.geolocation?navigator.geolocation.getCurrentPosition(function(e){this.currentPosition=e,t.resolve(this.currentPosition)},function(e){t.reject(e)}):t.reject("Geolocation is not supported by this browser."):t.resolve(this.currentPosition)),t.promise},watchPosition:function(t){var o=r.defer(),n=Math.floor(1e6*Math.random()+1),s=this;if(s.locations=[],s.throwsError)o.reject("There was an error getting the geolocation.");else{var a=1e3;t&&t.timeout&&(a=t.timeout),s.watchIntervals.push({watchID:n,interval:e(function(){s.throwsError&&o.reject("There was an error watching the geolocation.");var e=s.nextPosition;null===e&&(s.useHostAbilities?navigator.geolocation?navigator.geolocation.getCurrentPosition(function(e){s.currentPosition=e,s.locations.push(e),o.resolve(e)},function(e){o.reject(e)}):o.reject("Geolocation is not supported by this browser."):(e={coords:{latitude:180*Math.random()+1-90,longitude:360*Math.random()+1-180,altitude:100*Math.random()+1,accuracy:10*Math.random()+1,altitudeAccuracy:10*Math.random()+1,heading:360*Math.random()+1,speed:100*Math.random()+1},timestamp:Date.now()},s.currentPosition=e,s.locations.push(e),o.notify(e)))},a)})}var c=function(r){for(var t=-1,o=0;o<s.watchIntervals.length;o++)if(s.watchIntervals[o].watchID===r){e.cancel(i[o].interval),t=o;break}-1!==t&&s.watchIntervals.splice(t,1)};return o.promise.cancel=function(){c(n)},o.promise.clearWatch=function(e){c(e||n)},o.promise.watchID=n,o.promise},clearWatch:function(t){var o=r.defer();if(t)if(this.throwsError)o.reject("Unable to clear watch.");else{for(var n=-1,s=0;s<this.watchIntervals.length;s++)if(this.watchIntervals[s].watchID===t){e.cancel(i[s].interval),n=s;break}-1!==n&&this.watchIntervals.splice(n,1)}else o.reject("Unable to clear watch. No watch ID provided.");return o.promise}}}]),e.factory("$cordovaGlobalization",["$q",function(e){var r=!1,t=navigator.language?navigator.language:"en-US",o={value:t},i="Sunday",n={value:t};return{throwsError:r,preferredLanguage:o,localeName:n,firstDayOfWeek:i,getPreferredLanguage:function(){var r=e.defer();return this.throwsError?r.reject("There was an error getting the preferred language."):r.resolve(this.preferredLanguage),r.promise},getLocaleName:function(){var r=e.defer();return this.throwsError?r.reject("There was an error getting the locale name."):r.resolve(this.localeName),r.promise},getFirstDayOfWeek:function(){var r=e.defer();return this.throwsError?r.reject("There was an error getting the first day of week."):r.resolve(this.firstDayOfWeek),r.promise},dateToString:function(r,t){var o=e.defer();if(this.throwsError)o.reject("There was an error getting the string from the date.");else{var i="";r=r,t=t,o.resolve(i)}return o.promise},stringToDate:function(r,t){var o=e.defer();if(this.throwsError)o.reject("There was an error getting the date from the string.");else{var i="";r=r,t=t,o.resolve(i)}return o.promise},getDatePattern:function(r){var t=e.defer();if(this.throwsError)t.reject("There was an error getting the date pattern.");else{var o="";r=r,t.resolve(o)}return t.promise},getDateNames:function(r){var t=e.defer();if(this.throwsError)t.reject("There was an error getting the date names.");else{var o="";r=r,t.resolve(o)}return t.promise},isDayLightSavingsTime:function(r){var t=e.defer();if(this.throwsError)t.reject("There was an error getting if this is in daylight savings time mode.");else{var o="";r=r,t.resolve(o)}return t.promise},numberToString:function(r,t){var o=e.defer();if(this.throwsError)o.reject("There was an error convertng the number to a string.");else{var i="";r=r,t=t,o.resolve(i)}return o.promise},stringToNumber:function(r,t){var o=e.defer();if(this.throwsError)o.reject("There was an error convertng the string to a number.");else{var i="";t=t,o.resolve(i)}return o.promise},getNumberPattern:function(r){var t=e.defer();if(this.throwsError)t.reject("There was an error convertng the string to a number.");else{var o="";r=r,t.resolve(o)}return t.promise},getCurrencyPattern:function(r){var t=e.defer();if(this.throwsError)t.reject("There was an error convertng the string to a number.");else{var o="";r=r,t.resolve(o)}return t.promise}}}]),e.factory("$cordovaGoogleAnalytics",["$q",function(e){var r=!1,t={};t.throwsError=r;var o=["startTrackerWithId","setUserId","debugMode","trackView","addCustomDimension","trackEvent","trackException","trackTiming","addTransaction","addTransactionItem"];return o.forEach(function(r){t[r]=function(){var r=e.defer();return this.throwsError?r.reject():r.resolve(),r.promise}}),t}]),e.factory("$cordovaGooglePlayGame",["$q",function(e){var r=!1,t=!1,o="";return{_throwsError:r,_isSignedIn:t,_displayName:o,auth:function(){var r=e.defer();return this._throwsError?r.reject("There was a auth error."):(this.isSignedIn=!0,r.resolve("SIGN IN SUCCESS")),r.promise},signout:function(){var r=e.defer();return this.throwsError?r.reject("There was a signout error."):r.resolve(),r.promise},isSignedIn:function(){var r=e.defer();return this._throwsError?r.reject("There was a isSignedIn error."):r.resolve({isSignedIn:this._isSignedIn}),r.promise},showPlayer:function(){var r=e.defer();return this.throwsError?r.reject("There was a showPlayer error."):r.resolve({displayName:this._displayName}),r.promise},submitScore:function(r){var t=e.defer();return this._throwsError?t.reject("There was a submitScore error."):t.resolve("OK"),t.promise},showAllLeaderboards:function(){var r=e.defer();return this.throwsError?r.reject("There was a showAllLeaderboards error."):r.resolve("OK"),r.promise},showLeaderboard:function(r){var t=e.defer();return this._throwsError?t.reject("There was a showLeaderboard error."):t.resolve("OK"),t.promise},unlockAchievement:function(r){var t=e.defer();return this.throwsError?t.reject("There was a unlockAchievement error."):t.resolve("OK"),t.promise},incrementAchievement:function(r){var t=e.defer();return this._throwsError?t.reject("There was a incrementAchievement error."):t.resolve("OK"),t.promise},showAchievements:function(){var r=e.defer();return this.throwsError?r.reject("There was a showAchievements error."):r.resolve("OK"),r.promise}}}]),e.factory("$cordovaKeyboard",function(){var e=!1;return{hideAccessoryBar:function(e){},close:function(){e=!1},show:function(){e=!0},disableScroll:function(e){},isVisible:function(){return e}}}),e.factory("$cordovaKeychain",["$q",function(e){var r={};return{keychains:r,getForKey:function(r,t){var o=e.defer();return this.keychains[t]?o.resolve(this.keychains[t][r]):o.reject(),o.promise},setForKey:function(r,t,o){var i=e.defer();return this.keychains[t]||(this.keychains[t]={}),this.keychains[t][r]=o,i.resolve(),i.promise},removeForKey:function(r,t){var o=e.defer();return this.keychains[t]&&delete this.keychains[t][r],o.resolve(),o.promise}}}]),e.factory("$cordovaNetwork",function(){var e="WiFi connection",r=!0;return{connectionType:e,isConnected:r,getNetwork:function(){return this.connectionType},isOnline:function(){return this.isConnected},isOffline:function(){return!this.isConnected}}}),e.factory("$cordovaPush",["$q","$timeout","$rootScope",function(e,r,t){var o=!1,i="";return{throwsError:o,deviceToken:i,onNotification:function(e){r(function(){t.$broadcast("$cordovaPush:notificationReceived",e)})},register:function(r){var t=this,o=e.defer();return void 0!==r&&void 0===r.ecb&&(r.ecb=this.onNotification),this.throwsError?o.reject("There was a register error."):(o.resolve(this.deviceToken),r&&r.ecb&&r.ecb({event:"registered",regid:t.deviceToken})),o.promise},unregister:function(r){var t=e.defer();return this.throwsError?t.reject("There was a register error."):t.resolve(),t.promise}}}]),e.factory("$cordovaSocialSharing",["$q",function(e){var r=!1,t="",o="",i="",n="",s="",a="",c=[],h=[],u=[];return{throwsError:r,message:t,image:o,link:i,number:n,subject:a,toAddresses:c,bccAddresses:h,socialService:s,attachments:u,shareViaTwitter:function(r,t,o){var i=e.defer();return this.throwsError?i.reject("There was an error sharing via Twitter."):(this.message=r,this.image=t,this.link=o,i.resolve()),i.promise},shareViaWhatsApp:function(r,t,o){var i=e.defer();return this.throwsError?i.reject("There was an error sharing via WhatsApp."):(this.message=r,this.image=t,this.link=o,i.resolve()),i.promise},shareViaFacebook:function(r,t,o){var i=e.defer();return this.throwsError?i.reject("There was an error sharing via Facebook."):(this.message=r,this.image=t,this.link=o,i.resolve()),i.promise},shareViaSMS:function(r,t){var o=e.defer();return this.throwsError?o.reject("There was an error sharing via SMS."):(this.message=r,this.number=t,o.resolve()),o.promise},shareViaEmail:function(r,t,o,i,n){var s=e.defer();return this.throwsError?s.reject("There was an error sharing via SMS."):(this.message=r,this.subject=t,this.toAddresses=o,this.bccAddressesc=i,this.attachments=n,s.resolve()),s.promise},canShareViaEmail:function(){var r=e.defer();return this.throwsError?r.reject(!1):r.resolve(!0),r.promise},canShareVia:function(r,t,o,i,n){var s=e.defer();return this.throwsError?s.reject("There was an error sharing via SMS."):(this.message=t,this.socialService=r,this.subject=o,this.attachments=i,this.link=n,s.resolve()),s.promise},shareVia:function(r,t,o,i,n){var s=e.defer();return this.throwsError?s.reject("There was an error sharing via SMS."):(this.socialService=r,this.message=t,this.subject=o,this.attachments=i,this.link=n,s.resolve()),s.promise},share:function(r,t,o,i){var n=e.defer();return this.throwsError?n.reject("There was an error sharing via SMS."):(this.message=r,this.subject=t,this.attachments=o,this.link=i,n.resolve()),n.promise}}}]),e.factory("$cordovaSplashscreen",function(){var e=!1;return{isVisible:e,hide:function(){return this.isVisible=!1,!0},show:function(){return this.isVisible=!0,!0}}}),e.factory("$cordovaStatusbar",function(){var e=!0,r=!0;return{isStatusBarVisible:e,canOverlayWebView:r,overlaysWebView:function(e){this.canOverlayWebView=e},style:function(e){return e},styleHex:function(e){return e},styleColor:function(e){return e},hide:function(){this.isStatusBarVisible=!1},show:function(){this.isStatusBarVisible=!0},isVisible:function(){return this.isStatusBarVisible}}}),e.factory("$cordovaToast",["$q",function(e){var r=!1;return{throwsError:r,showShortTop:function(r){var t=e.defer();return this.throwsError?t.reject("There was an error showing the toast."):t.resolve(),t.promise},showShortCenter:function(r){var t=e.defer();return this.throwsError?t.reject("There was an error showing the toast."):t.resolve(),t.promise},showShortBottom:function(r){var t=e.defer();return this.throwsError?t.reject("There was an error showing the toast."):t.resolve(),t.promise},showLongTop:function(r){var t=e.defer();return this.throwsError?t.reject("There was an error showing the toast."):t.resolve(),t.promise},showLongCenter:function(r){var t=e.defer();return this.throwsError?t.reject("There was an error showing the toast."):t.resolve(),t.promise},showLongBottom:function(r){var t=e.defer();return this.throwsError?t.reject("There was an error showing the toast."):t.resolve(),t.promise},show:function(r,t,o){var i=e.defer();return this.throwsError?i.reject("There was an error showing the toast."):i.resolve(),i.promise}}}]),e.factory("$cordovaVibration",["$timeout",function(e){var r=!1,t=null;return{vibrateTimer:t,isVibrating:r,vibrate:function(r){r>0&&(this.isVibrating=!0,self=this,r instanceof Array?this.vibrateTimer=e(function(){self.isVibrating=!1,self.vibrateTimer=null},r[0]):this.vibrateTimer=e(function(){self.isVibrating=!1,self.vibrateTimer=null},r))},vibrateWithPattern:function(e,r){},cancelVibration:function(){null!==this.vibrateTimer&&this.isVibrating===!0&&(e.cancel(this.vibrateTimer),this.isVibrating=!1)}}}])}();