text: !function(){var e=document.getElementsByTagName("script"),t=e[e.length-1].src;angular.module("CityClock",[]).directive("ngCityClock",["$interval","TimeFactory","TimeService",function(e,a,i){return{restrict:"E",scope:{},templateUrl:t.replace("ngcityclock.js","templates/clock.html"),link:function(t,n,o){"undefined"!=typeof o.city&&(t.city=o.city,i.getLatLon(t.city).then(function(n){if(n.data.results[0].geometry.location.lat){var o=n.data.results[0].geometry.location.lat,c=n.data.results[0].geometry.location.lng;i.getCorrectTime(o,c).then(function(i){"undefined"!=typeof i.data.rawOffset&&(t.actTime=a.calcTime(i.data.rawOffset+i.data.dstOffset),t.actTime&&e(function(){"undefined"!=typeof t.timeStamp?t.timeStamp+=1e3:(t.dateObj=t.actTime,t.timeStamp=t.dateObj.getTime()+1e3),t.dateObj=new Date(t.timeStamp),t.currentTime=a.formatAMPM(t.dateObj)},1e3))})}}))}}}]).service("TimeService",["$http",function(e){this.getLatLon=function(t){return e.get("https://maps.googleapis.com/maps/api/geocode/json?address="+t+"&sensor=false")},this.getCorrectTime=function(t,a,i){return myDate=new Date,e.get("https://maps.googleapis.com/maps/api/timezone/json?location="+t+","+a+"&timestamp="+myDate.getTime()/1e3)}}]).factory("TimeFactory",function(){return TimeFactory={},TimeFactory.formatAMPM=function(e){var t=e.getHours(),a=e.getMinutes(),i=e.getSeconds(),n=t>=12?"PM":"AM";t%=12,t=t?t:12,a=10>a?"0"+a:a,i=10>i?"0"+i:i;var o=t+":"+a+":"+i+" "+n;return o},TimeFactory.calcTime=function(e){var t=new Date,a=t.getTime()+6e4*t.getTimezoneOffset(),i=new Date(a+1e3*e);return i},TimeFactory})}();