turtle-wow-source-kinda/Dumps/Source Code/9 - Development_website_old/master/dist/js/turtle.min.js
Brian Oost a1d5bb70b2 Init
2024-08-06 18:06:40 +02:00

1 line
54 KiB
JavaScript

"use strict";angular.module("achievement-titles",[]).controller("AchievementTitlesCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow")}]),angular.module("changelog",[]).controller("ChangelogCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow"),e.logIndex=0,o.post({m:"changelog",w:"get",p:{}}).then(function(t){e.changelog=t.data.result,console.log(e.changelog)}),e.log=function(t){(-1!=t||0!=e.logIndex)&&(1!=t||e.logIndex!=e.changelog.length-1)&&(e.logIndex=e.logIndex+t)}}]),angular.module("additional-transport-routes",[]).controller("AdditionalTransportRoutesCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow")}]),angular.module("beginners-guild",[]).controller("BeginnersGuildCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow")}]),angular.module("chronoboon-displacer",[]).controller("ChronoboonDisplacerCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow")}]),angular.module("character-customizations",[]).controller("CharacterCustomizationsCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow"),e.customizations=[{title:"a",subtitle:"b",file:"unknown (1).png",description:"Description is empty, to be added."},{title:"a",subtitle:"b",file:"unknown (10).png",description:"Description is empty, to be added."},{title:"a",subtitle:"b",file:"unknown (11).png",description:"Description is empty, to be added."},{title:"a",subtitle:"b",file:"unknown (12).png",description:"Description is empty, to be added."},{title:"a",subtitle:"b",file:"unknown (13).png",description:"Description is empty, to be added."},{title:"a",subtitle:"b",file:"unknown (14).png",description:"Description is empty, to be added."},{title:"a",subtitle:"b",file:"unknown (15).png",description:"Description is empty, to be added."},{title:"a",subtitle:"b",file:"unknown (16).png",description:"Description is empty, to be added."},{title:"a",subtitle:"b",file:"unknown (17).png",description:"Description is empty, to be added."},{title:"a",subtitle:"b",file:"unknown (2).png",description:"Description is empty, to be added."},{title:"a",subtitle:"b",file:"unknown (3).png",description:"Description is empty, to be added."},{title:"a",subtitle:"b",file:"unknown (4).png",description:"Description is empty, to be added."},{title:"a",subtitle:"b",file:"unknown (5).png",description:"Description is empty, to be added."},{title:"a",subtitle:"b",file:"unknown (6).png",description:"Description is empty, to be added."},{title:"a",subtitle:"b",file:"unknown (7).png",description:"Description is empty, to be added."},{title:"a",subtitle:"b",file:"unknown (8).png",description:"Description is empty, to be added."},{title:"a",subtitle:"b",file:"unknown (9).png",description:"Description is empty, to be added."},{title:"a",subtitle:"b",file:"unknown.png",description:"Description is empty, to be added."},{title:"a",subtitle:"b",file:"unknown_1.png",description:"Description is empty, to be added."},]}]),angular.module("class-race-combinations",[]).controller("ClassRaceCombinationsCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow")}]),angular.module("client-interface-improvements",[]).controller("ClientInterfaceImprovementsCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow")}]),angular.module("community-artworks",[]).controller("CommunityArtworksCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow"),e.artworks=[{author:"Artwork by Handi (Adelaidde)",file:"4.png"},{author:"Gurubashi Camper, by Kato",file:"12.png"},{author:'"You called?", by Chiruk',file:"17.jpg"},{author:"Crescent Grove, by Illdrawer",file:"8.jpg"},{author:"Adventure begins, by Chevvah",file:"10.jpg"},{author:"Storm over Redridge, by Pathos",file:"14.png"},{author:"Artwork by Chevvah",file:"15.jpg"},{author:"Artwork by Hone",file:"6.png"},{author:"Sykira the Dark Ranger, by Deekin Bearcat",file:"18.jpg"},{author:"Artwork by Afa",file:"1.png"},{author:"Artwork by Blackscar",file:"9.jpg"},{author:"Artwork by MIXEEB",file:"3.png"},{author:"Artwork by Josephine Wagner",file:"30.png"},{author:"Artwork by Josephine Wagner",file:"31.jpeg"},{author:"A Skirmish at Dawn, by Valamar",file:"11.png"},{author:"Mysterious Stranger by Dryst",file:"20.png"},{author:"Honeclaw & Hatebeak, by Zin'tulak",file:"21.png"},{author:"Echo Ridge Mine, by by PureOfHearts",file:"33.jpg"},{author:"The Wayward Apprentice, by by PureOfHearts",file:"34.jpg"},{author:"A Priest and His Loa, by Leaf",file:"22.jpg"},{author:"Princess Inxe, by Kaguranaomi",file:"13.png"},{author:"Sand Troll, by Jambiya",file:"16.jpg"},{author:"Struggles of Zebrian Farm, artwork by GGena",file:"26.png"},{author:"Artwork by Iffeliphe",file:"5.png"},{author:"Artwork by Breno",file:"7.png"},{author:"The Thoughtless Companion, by LazyRat",file:"25.png"},{author:"Turtle WoW Rulez, by Escalotes",file:"19.png"},{author:"Artwork by Uwuowo",file:"2.png"},{author:"Brief Respite, Artwork by Werdun",file:"35.png"},]}]),angular.module("donate",[]).controller("DonateCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow"),e.discounts=[[30,7.5],[40,10],[50,12.5],[60,15],[70,17.5],[80,20],[90,22.5],[100,25],[200,40],[300,40]],e._round=function(e){return Math.round(e)},e.now_time=Math.floor(new Date().getTime()/1e3),e.enot_merchant_id="49589",e.enot_sign="",e.enot_secret="3aFMHr8YzPiOR0EQzPSJF0apk4-cSnNL",e.enot_infos={enot_price:1,enot_points:10,enot_price_updated:0},e.pw_infos={sign:"",key:"712faa19d7e316afa26e27fcc4045219",widget:"p1_1",sign_version:"2",uid:e.user.user_id,email:e.user.email},e.pw_url="",e.gp_infos={code:"",msg:""},e.donate_panel_visible=0,e.donate_visible_enum={NONE:0,PW:1,GP:2,ENOT:4,SBERBANK:8,BOOSTY:22,PAYPAL:50},e._now=function(){return Math.floor(new Date().getTime()/1e3)},e._enotSign=function(){return e.now_time=e._now(),hex_md5(e.enot_merchant_id+":"+e.enot_infos.enot_price_updated+":"+e.enot_secret+":"+e.now_time)},e._pwSign=function(){o.post({m:"pingback",w:"pwsign",p:e.pw_infos}).then(function(t){t=t.data.result,e.pw_infos.sign=t.signature,e.pw_url=n.trustAsResourceUrl("https://api.paymentwall.com/api/ps/?"+t.params)})},e._pwSign(),e._ksort=function(e){var t=[],o=[],n=0;for(r in e)o[n++]=r;n=(o=o.sort()).length;for(var r=0;r<n;r++)t[o[r]]=e[o[r]];return t},e.pp_status=0,o.post({m:"register",w:"d_status",p:{}}).then(function(t){e.pp_status=parseInt(t.data.result)}),e.donateIsVisible=function(t){return e.donate_panel_visible==t},e.donateSetVisible=function(t){(t!=e.donate_visible_enum.PAYPAL||0!=e.pp_status)&&(e.donate_panel_visible=t)},e.enotUpdatePoints=function(){if(e.enot_infos.enot_price_updated=80*e.enot_infos.enot_price,e.enot_sign=e._enotSign(),e.enot_infos.enot_price<30)e.enot_infos.enot_points=Math.ceil(10*e.enot_infos.enot_price);else{for(var t=10*e.enot_infos.enot_price,o=0;o<e.discounts.length-1;o++)if(t>=10*e.discounts[o][0]&&t<10*e.discounts[o+1][0]){e.enot_infos.enot_points=t+Math.ceil(t*e.discounts[o][1]/100);break}t>=10*e.discounts[e.discounts.length-1][0]&&(e.enot_infos.enot_points=t+Math.ceil(t*e.discounts[e.discounts.length-1][1]/100))}},e.useGPCode=function(){o.post({m:"pingback",w:"gamepoints",p:{account:e.user.user_id,code:e.gp_infos.code}}).then(function(t){0!=(t=t.data.result).result?e.gp_infos.msg=t.error:(e.gp_infos.msg="",e.goToPage("success"))})},e.isGPErrorVisible=function(){return e.gp_infos.msg.length>0},e.refreshPoints=function(){o.post({m:"register",w:"getPoints",p:{user_id:e.user.user_id}}).then(function(t){0==(t=t.data.result).result&&(e.user.tokens=t.tokens,localStorage.setItem("tokens",t.tokens))})},null!==e.user&&e.refreshPoints(),e.enotUpdatePoints()}]),angular.module("dynamic-mount-speed",[]).controller("DynamicMountSpeedCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow")}]),angular.module("everlook-broadcasting",[]).controller("EverlookBroadcastingCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow")}]),angular.module("fail",[]).controller("FailCtrl",["$scope","$location","http","$sce",function(e,t,o,n){}]),angular.module("guild-banks",[]).controller("GuildBanksCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow")}]),angular.module("hardcore-mode",[]).controller("HardcoreModeCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow")}]),angular.module("items-and-recipes",[]).controller("ItemsAndRecipesCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow")}]),angular.module("logos",[]).controller("LogosCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow")}]),angular.module("new-challenges",[]).controller("NewChallengesCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow")}]),angular.module("new-factions-and-quests",[]).controller("NewFactionsAndQuestsCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow")}]),angular.module("new-locations-and-maps",[]).controller("NewLocationsAndMapsCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow"),e.gallery=["turtlewow_arathi_highlands.png","turtlewow_azshara.png","turtlewow_deadwind_pass.png","turtlewow_durotar.png","turtlewow_eastern_plaguelands.png","turtlewow_gilijim.png","turtlewow_hinterlands.png","turtlewow_lapidis.png","turtlewow_sunnyglade.png","turtlewow_swamps_of_sorrow.png","turtlewow_tirisfal_uplands.png","turtlewow_wetlands.png","turtlewow_gilneas.png","turtlewow_telabim.png","turtlewow_winterveil.png",],e.LBimage="",e.openLB=function(t){var o=[];angular.forEach(e.gallery,function(e,n){o.push({image:"images/maps/"+e,active:e==t})}),e.add_lightbox_images(o),$("#lightbox").modal("show")}}]),angular.module("new-races",[]).controller("NewRacesCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow")}]),angular.module("pets-and-mounts",[]).controller("PetsAndMountsCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow")}]),angular.module("player-versus-player-content",[]).controller("PlayerVersusPlayerContentCtrl",["$scope","$location","$anchorScroll","$timeout",function(e,t,o,n){"war-mode"===t.hash()?n(function(){o()},100):$("html, body").animate({scrollTop:0},"slow")}]),angular.module("population-graph",[]).controller("PopulationGraphCtrl",["$scope","$location","http","$sce",function(e,t,o,n){function r(e,t){var o=t.labels,n=t.dataA,r=t.dataH,a=t.dataQ,s=t.dataT;t.dataC;var i=document.getElementById("population-graph-"+e).getContext("2d");return new Chart(i,{type:"line",data:{labels:o,datasets:[{label:"Alliance Players",cubicInterpolationMode:"monotone",data:n,borderColor:"#0c6cef",pointBackgroundColor:"#0c6cef",borderWidth:1,pointRadius:1,pointHoverRadius:5},{label:"Horde Players",cubicInterpolationMode:"monotone",data:r,borderColor:"#e71b1b",pointBackgroundColor:"#e71b1b",borderWidth:1,pointRadius:1,pointHoverRadius:5},{label:"Queued Players",cubicInterpolationMode:"monotone",data:a,borderColor:"#FFFF00",pointBackgroundColor:"#FFFF00",borderWidth:1,pointRadius:1,pointHoverRadius:5,backgroundColor:"rgba(94,91,85,0.13)",fill:!0},{label:"Total Players",cubicInterpolationMode:"monotone",data:s,borderColor:"#8cbe4b",pointBackgroundColor:"#8cbe4b",borderWidth:1,pointRadius:1,pointHoverRadius:5,backgroundColor:"rgba(94,91,85,0.13)",fill:!0}]},options:{responsive:!0,maintainAspectRatio:!1,interaction:{intersect:!1,mode:"index"},scales:{x:{grid:{display:!1}},y:{beginAtZero:!0,grid:{color:"rgba(158,151,131,0.13)"}}},plugins:{legend:{display:!0,labels:{boxWidth:10,boxHeight:10}},annotation:{annotations:[{type:"line",mode:"horizontal",scaleID:"y",value:1e4,borderColor:"red",borderWidth:1,borderDash:[5,5],label:{content:"Limit to 10000",enabled:!0,position:"right"}}]}}}})}function a(e,t){return r(e,t)}$("html, body").animate({scrollTop:0},"slow");var s={};o.post({m:"stats",w:"get_population_graph",p:{}}).then(function(e){var t=e.data.result;angular.forEach(t,function(e,t){s[t]=r(t,e)})}),e.refreshChart=function(e){s[e]&&s[e].resize()}}]),angular.module("raids-and-dungeons",[]).controller("RaidsAndDungeonsCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow")}]),angular.module("register",[]).controller("RegisterCtrl",["$scope","$http","http","$location","$state","$sce","$rootScope",function(e,t,o,n,r,a,s){e.modal="register",window.onload=function(){o.post({m:"matomo",w:"getGeoLocation"}).then(function(e){var t=(e=e.data.result).response;("CN"===t||"IN"===t||"SG"===t||"TW"===t||"HK"===t)&&(window.location.href="https://cn.turtle-wow.org")}),window.onloadTurnstileCallback()},e.changeModal=function(t){e.modal=t,e.response="",e.register_data={account_name:"",email_address:"",user_password:"",user_password2:"",forum_name:"",captchaInput:""}},e.openLoginModal=function(e){window.location.href="login.php?redirect="+e},e.openRegisterModal=function(){o.post({m:"matomo",w:"getGeoLocation"}).then(function(t){"CN"===(t=t.data.result).response?window.location.href="https://cn.turtle-wow.org":(e.changeModal("register"),$("#register").modal("show"))})},e.validEmail=function(e){return e.match(/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)},e.register_data={account_name:"",email_address:"",user_password:"",user_password2:"",forum_name:"",captchaInput:""},e.register_err=!1,e.response="",e.user={user_id:localStorage.getItem("user_id"),username:localStorage.getItem("username"),email:localStorage.getItem("email"),tokens:localStorage.getItem("tokens"),rank:localStorage.getItem("rank")},e.registering=!1,e.forgot=function(){if(e.registering)return!1;if(!e.validEmail(e.register_data.email_address)){e.register_err=!0;return}e.registering=!0,o.post({m:"register",w:"reset",p:{email:e.register_data.email_address}}).then(function(t){if(e.registering=!1,e.response=t.data.result.response,-1!==e.response.indexOf("This email doe")){e.modal="forgot";return}e.modal="resetok",e.register_data={account_name:"",email_address:"",user_password:"",user_password2:"",forum_name:"",captchaInput:""}})},e.cap_input="",e.register=function(){if(e.registering)return!1;if(e.register_data.account_name<=2||!e.validEmail(e.register_data.email_address)||e.register_data.forum_name<=2||e.register_data.user_password<=2||e.register_data.user_password2<=2||e.register_data.user_password!=e.register_data.user_password2){e.register_err=!0,turnstile.reset("#turnstile_reg");return}e.registering=!0,o.post({m:"register",w:"register",p:{data:e.register_data}}).then(function(t){if(e.registering=!1,e.response=t.data.result.response,-1!==e.response.indexOf("Captcha verification failed")||-1!==e.response.indexOf("already in use")||-1!==e.response.indexOf("You must")||-1!==e.response.indexOf("There was a problem creating your account, please")||-1!==e.response.indexOf("There was a problem creating your account and you")){turnstile.reset("#turnstile_reg"),e.modal="register";return}e.modal="ok",e.register_data={account_name:"",email_address:"",user_password:"",user_password2:"",forum_name:"",captchaInput:""}})}}]),angular.module("roleplay",[]).controller("RoleplayCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow")}]),angular.module("seasonal-events",[]).controller("SeasonalEventsCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow")}]),angular.module("shellcoin",[]).controller("ShellcoinCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow"),e.data=[],e.data7d=[],e.amount=0,o.post({m:"shellcoin",w:"get7d",p:{}}).then(function(t){e.data7d=t.data.result,e.amount=e.data7d[e.data7d.length-1].count;var o=[],n=[];angular.forEach(e.data7d,function(e,t){o.push(e.date_nice),n.push(e.price)}),new Chart(document.getElementById("shellcoin-graph7d").getContext("2d"),{type:"line",data:{labels:o,datasets:[{label:"Last week",cubicInterpolationMode:"monotone",data:n,borderColor:"#8dc63f",pointBackgroundColor:"#8dc63f",borderWidth:1,pointRadius:1,pointHoverRadius:5},]},options:{responsive:!1,maintainAspectRatio:!1,interaction:{intersect:!1,mode:"index"},scales:{x:{grid:{display:!1},ticks:{callback:function(e,t){return t%2==0?this.getLabelForValue(e):""}}},y:{beginAtZero:!1,grid:{color:"rgba(158,151,131,0.13)"},ticks:{callback:function(e){return Math.floor(e/100/100)+"g "+Math.floor(e/100%100)+"s "+Math.floor(e%100)+"c"}}}},plugins:{legend:{display:!0,labels:{boxWidth:10,boxHeight:10}},tooltip:{callbacks:{label:function(e){var t=e.parsed.y;return Math.floor(t/100/100)+"g "+Math.floor(t/100%100)+"s "+Math.floor(t%100)+"c"}}}}}})}),o.post({m:"shellcoin",w:"get",p:{}}).then(function(t){e.data=t.data.result,e.amount=e.data[e.data.length-1].count;var o=[],n=[];angular.forEach(t.data.result,function(e,t){o.push(e.date_nice),n.push(e.price)}),new Chart(document.getElementById("shellcoin-graph").getContext("2d"),{type:"line",data:{labels:o,datasets:[{label:"Total",cubicInterpolationMode:"monotone",data:n,borderColor:"#8dc63f",pointBackgroundColor:"#8dc63f",borderWidth:1,pointRadius:1,pointHoverRadius:5},]},options:{responsive:!1,maintainAspectRatio:!1,interaction:{intersect:!1,mode:"index"},scales:{x:{grid:{display:!1},ticks:{callback:function(e,t){return t%2==0?this.getLabelForValue(e):""}}},y:{beginAtZero:!1,grid:{color:"rgba(158,151,131,0.13)"},ticks:{callback:function(e){return Math.floor(e/100/100)+"g "+Math.floor(e/100%100)+"s "+Math.floor(e%100)+"c"}}}},plugins:{legend:{display:!0,labels:{boxWidth:10,boxHeight:10}},tooltip:{callbacks:{label:function(e){var t=e.parsed.y;return Math.floor(t/100/100)+"g "+Math.floor(t/100%100)+"s "+Math.floor(t%100)+"c"}}}}}})})}]),angular.module("slow-and-steady",[]).controller("SlowAndSteadyCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow")}]),angular.module("sound-design",[]).controller("SoundDesignCtrl",["$scope","$location","http","$sce","$timeout",function(e,t,o,n,r){$("html, body").animate({scrollTop:0},"slow"),e.music=["https://player.vimeo.com/video/748474780?h=033ab32047","https://player.vimeo.com/video/748474358?h=9fac750f85","https://player.vimeo.com/video/748474632?h=75ef6bf3e2","https://player.vimeo.com/video/750755246?h=4b97183b37","https://player.vimeo.com/video/748474794?h=4cd90f5f65","https://player.vimeo.com/video/748474461?h=90a98255df","https://player.vimeo.com/video/748531205?h=f699c1aa67","https://player.vimeo.com/video/748519424?h=fc6d3fed49","https://player.vimeo.com/video/761775255?h=177f61bb5f"],e.music_links=[],angular.forEach(e.music,function(t,o){e.music_links.push(n.trustAsResourceUrl(t))}),o.post({m:"sounds",w:"get",p:{}}).then(function(t){angular.forEach(t.data.result,function(e,t){angular.forEach(e.sounds,function(e,t){e.file=n.trustAsResourceUrl(e.file)})}),e.sounds=t.data.result,r(function(){GreenAudioPlayer.init({selector:".player",stopOthersOnPlay:!0})},100)})}]),angular.module("success",[]).controller("SuccessCtrl",["$scope","$location","http","$sce",function(e,t,o,n){}]),angular.module("survival-and-gardening",[]).controller("SurvivalAndGardeningCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow")}]),angular.module("transmogrification",[]).controller("TransmogrificationCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow")}]),angular.module("vagrants-endeavor",[]).controller("VagrantsEndeavorCtrl",["$scope","$location","http","$sce",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow")}]),angular.module("watch",[]).controller("WatchCtrl",["$scope","$location","http","$sce","$stateParams","$timeout",function(e,t,o,n,r,a){var s=window.scrollY;window.onscroll=function(){var e=window.scrollY;s>e?document.getElementById("main-navbar").style.top="0":document.getElementById("main-navbar").style.top="-80px",s=e},e.view="all",e.searchQuery="",e.comment="",e.reply="",e.currentVideo=[],e.lid=0,e.lidReplies=0,e.showMore=!0,e.chars=[],e.char=localStorage.getItem("postingChar"),e.moderation=[],e.getComments=function(t){var n=!1;void 0===t&&(t=2147483647,n=!0),e.comment="",o.post({m:"video",w:"getComments",p:{id:e.id,lid:t}}).then(function(t){n&&(e.currentVideo.comments=[]),angular.forEach(t.data.result.comments,function(t,o){t.showReplies=!1,t.confirmation=-1,e.lid=t.id,e.currentVideo.comments.push(t)}),e.currentVideo.commentsCount=t.data.result.commentsCount,e.showMore=t.data.result.commentsCount>e.currentVideo.comments.length})},e.getLikes=function(){o.post({m:"video",w:"likes",p:{id:e.id}}).then(function(t){e.likes=t.data.result})},e.getViews=function(t){o.post({m:"video",w:"getViews",p:{id:t}}).then(function(t){e.currentVideo.views=t.data.result})},e.nothing=!0,e.filterChannels=function(){e.channels=e.getChannels(),e.id=r.id,e.view="",e.currentChannel=[],e.currentVideo=[],e.otherVideos=[],-1!==t.$$path.indexOf("watch")&&-1===t.$$path.indexOf("watch/")&&(e.view="all",$("html, body").animate({scrollTop:0},"slow")),-1!==t.$$path.indexOf("channel")&&(e.view="channel",angular.forEach(e.channels,function(t,o){e.id==t.name_slug&&(e.currentChannel=t)}),$("html, body").animate({scrollTop:0},"slow")),-1!==t.$$path.indexOf("watch/")&&-1===t.$$path.indexOf("watch/channel")&&(e.view="video",e.channel="",angular.forEach(e.channels,function(t,o){angular.forEach(t.videos,function(o,n){o.id==e.id&&(e.getViews(e.id),e.getComments(),e.getLikes(),e.currentVideo=o,e.channel=t.name)})}),angular.forEach(e.channels,function(t,o){t.name==e.channel&&angular.forEach(t.videos,function(t,o){t.id!==e.currentVideo.id&&e.otherVideos.push(t)})}),$("html, body").animate({scrollTop:245},"slow")),-1!==t.$$path.indexOf("moderation")&&(e.view="moderation",e.nothing=!0,o.post({m:"video",w:"commentsAdmin"}).then(function(t){if("here"===t.data.result.nothing){e.nothing=!0;return}e.nothing=!1,e.moderation=t.data.result}))},e.moderate=function(t,n){o.post({m:"video",w:"moderate",p:{id:t,i:n}}).then(function(o){"ok"==o.data.result.moderated&&angular.forEach(e.moderation,function(o,n){o.id===t&&e.moderation.splice(n,1)})})},e.initVideos=function(){0===e.channelsNum()?o.post({m:"video",w:"get"}).then(function(t){e.setChannels(t.data.result),e.filterChannels()}):e.filterChannels()},e.initVideos(),e.$on("initVideos",function(t,o){e.setChannels([]),e.initVideos()}),e.addingComment=!1,e.commentLimit=!1,e.commentLevel=!1,e.toAddComment=function(){if(e.addingComment){e.addingComment=!1;return}o.post({m:"video",w:"ci",p:{}}).then(function(t){t.data.result.login?(e.comment="",e.addingComment=!0,a(function(){document.getElementById("comment").focus()},100),e.getChars()):e.openLoginModal("watch/"+e.currentVideo.id)})},e.cancelAddComment=function(){e.comment="",e.addingComment=!1},e.working=!1,e.addComment=function(t){!e.working&&t.length>0&&(e.commentLimit=!1,e.commentLevel=!1,e.working=!0,o.post({m:"video",w:"comment",p:{id:e.currentVideo.id,comment:t,char:e.char}}).then(function(t){if(e.working=!1,t.data.result.limit){e.commentLimit=!0;return}if(t.data.result.minlvl15){e.commentLevel=!0;return}e.addingComment=!1,e.currentVideo.commentsCount=t.data.result.commentsCount,t.data.result.comment.confirmation=-1,e.currentVideo.comments.unshift(t.data.result.comment)}))},e.showReplies=function(t,n){if(void 0===n&&(n=0,void 0===t.replies&&(t.replies=[])),t.showReplies&&0===n){t.showReplies=!1;return}if(0===n&&t.replies.length>0){t.showReplies=!t.showReplies;return}o.post({m:"video",w:"getReplies",p:{parent:t.id,lid:n}}).then(function(o){angular.forEach(o.data.result.replies,function(o,n){e.lidReplies=o.id,t.replies.push(o),t.reply="",o.confirmation=-1}),t.showMoreReplies=o.data.result.repliesCount>t.replies.length,t.showPreviousReplies=!1,t.showReplies=!0})},e.showPreviousReplies=function(e,t){o.post({m:"video",w:"getReplies",p:{parent:e.id,lid:t,previous:!0}}).then(function(t){angular.forEach(t.data.result.replies,function(t,o){t.confirmation=-1,e.replies.unshift(t)}),e.showPreviousReplies=e.repliesCount>e.replies.length})},e.toReply=function(t){e.reply="",o.post({m:"video",w:"ci",p:{}}).then(function(o){o.data.result.login?(t.addingReply=!t.addingReply,t.addingReply&&(a(function(){document.getElementById("reply-"+t.id).focus()},100),e.getChars())):e.openLoginModal("watch/"+e.currentVideo.id)})},e.cancelAddReply=function(e){e.reply="",e.addingReply=!1},e.addReply=function(t){!e.working&&t.reply.length>0&&(t.replyLimit=!1,t.replyLevel=!1,e.working=!0,o.post({m:"video",w:"comment",p:{id:e.currentVideo.id,parent:t.id,comment:t.reply,char:e.char}}).then(function(o){if(e.working=!1,o.data.result.limit){t.replyLimit=!0;return}if(o.data.result.limit){t.replyLevel=!0;return}e.cancelAddReply(t),angular.forEach(o.data.result.replies,function(e,t){e.confirmation=-1}),t.replies=o.data.result.replies,t.repliesCount=o.data.result.repliesCount,t.showMoreReplies=!1,t.showPreviousReplies=t.repliesCount>o.data.result.replies.length,t.showReplies=!0}))},e.like=function(t){o.post({m:"video",w:"like",p:{id:e.id,l:t}}).then(function(t){0==t.data.result.login?e.openLoginModal("watch/"+e.currentVideo.id):e.getLikes()})},e.editComment=function(t,n){if("open"===n){t.edit=!0,t.originalComment=t.comment,a(function(){document.getElementById("edit-"+t.id).focus()},100),0===e.chars.length&&e.getChars();return}if("save"===n&&t.comment.length>0){if(t.comment===t.originalComment&&t.char===e.char){t.edit=!1;return}o.post({m:"video",w:"editComment",p:{id:t.id,comment:t.comment,char:e.char}}).then(function(e){t.char=e.data.result.char,t.class=e.data.result.class,t.edit=!1})}},e.editReply=function(t,n){if("open"===n){t.edit=!0,t.originalReply=t.reply,a(function(){document.getElementById("editReply-"+t.id).focus()},100),0===e.chars.length&&e.getChars();return}if("save"===n&&t.reply.length>0){if(t.reply===t.originalReply&&t.char===e.char){t.edit=!1;return}o.post({m:"video",w:"editComment",p:{id:t.id,comment:t.reply,char:e.char}}).then(function(e){t.char=e.data.result.char,t.class=e.data.result.class,t.edit=!1})}},e.cancelEditComment=function(e){e.edit=!1,e.comment=e.originalComment},e.cancelEditReply=function(e){e.edit=!1,e.reply=e.originalReply},e.deleteComment=function(t,n){t.confirmation=n,1===t.confirmation&&o.post({m:"video",w:"deleteComment",p:{id:t.id}}).then(function(o){angular.forEach(e.currentVideo.comments,function(o,n){o.id==t.id&&(e.currentVideo.comments.splice(n,1),e.currentVideo.commentsCount--)}),e.showMore=e.currentVideo.commentsCount>e.currentVideo.comments.length})},e.deleteReply=function(e,t,n){e.confirmation=n,1===e.confirmation&&o.post({m:"video",w:"deleteComment",p:{id:e.id}}).then(function(o){angular.forEach(t.replies,function(o,n){o.id===e.id&&(t.replies.splice(n,1),t.repliesCount--)}),0==t.repliesCount&&(t.showMoreReplies=!1,t.showReplies=!1)})},e.selectingChar=!1,e.changeChar=function(t){if(0===t){e.selectingChar=!0;return}e.char=t,localStorage.setItem("postingChar",t),e.selectingChar=!1},e.getChars=function(){0===e.chars.length&&o.post({m:"video",w:"getChars",p:{}}).then(function(t){e.chars=t.data.result,null===e.char&&(e.char=e.chars[0].name,localStorage.setItem("postingChar",e.char))})}}]),angular.module("activate",[]).controller("ActivateCtrl",["$scope","$location","http","$stateParams",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow"),e.result="",""!=n.email&&""!=n.token?o.post({m:"register",w:"activate",p:{email:n.email,token:n.token}}).then(function(t){e.result=t.data.result.response}):e.result="404"}]),angular.module("armory",[]).controller("ArmoryCtrl",["$scope","$location","http","$sce","$stateParams","$timeout",function(e,t,o,n,r,a){e.state="",r.character&&(e.state="character"),e.q="",e.results={},e.armorySearch=function(t){t&&(t.length<2||o.post({m:"armory",w:"search",p:{q:t}}).then(function(t){e.results=t.data.result}))},e.goToCharacter=function(e){t.url("armory/character/"+e)},e.c={},e.getCharacter=function(t){o.post({m:"armory",w:"character",p:{c:t}}).then(function(t){e.c=t.data.result})},"character"==e.state&&e.getCharacter(r.character),e.getItem=function(t){var o=!1;return angular.forEach(e.c.gear,function(e,n){parseInt(e.slot)===t&&(o=e)}),o}}]),angular.module("classes",[]).controller("ClassesCtrl",["$scope","$location","http","$sce",function(e,t,o,n){}]),angular.module("home",[]).controller("HomeCtrl",["$scope","$location","http","$sce",function(e,t,o,n){e.videos=[n.trustAsResourceUrl("https://player.vimeo.com/video/748353959?h=cd57f9c652")],e.videosIndex=0,e.ytVideo=function(t){if("prev"==t){if(0==e.videosIndex)return;e.videosIndex--}if("next"==t){if(e.videosIndex==e.videos.length-1)return;e.videosIndex++}}}]),angular.module("reset",[]).controller("ResetCtrl",["$scope","$location","http","$stateParams",function(e,t,o,n){$("html, body").animate({scrollTop:0},"slow"),e.result="",""!=n.token_key&&""!=n.pass?o.post({m:"register",w:"token_key",p:{token_key:n.token_key,pass:n.pass}}).then(function(t){"ok"==t.data.result.response?e.result="Your password has been successfully changed.":e.result="This link has expired."}):e.result="404"}]),angular.module("rules",[]).controller("RulesCtrl",["$scope","$location","http","$sce","$stateParams","$timeout","$anchorScroll",function(e,t,o,n,r,a,s){e.checkTabFromUrl=function(){var e=t.hash();e.includes("tab-1")?$("#rules-tab-1").tab("show"):e.includes("tab-2")&&$("#rules-tab-2").tab("show")},e.checkTabFromUrl(),""!==t.hash()?a(function(){s.yOffset=150,s()},100):$("html, body").animate({scrollTop:0},"slow"),e.tab1=[],e.tab2=[],o.post({m:"rules",w:"get",p:{view:e.view}}).then(function(t){angular.forEach(t.data.result.tab1,function(o,r){t.data.result.tab1[r].description=n.trustAsHtml(o.description),e.tab1.push(o)}),angular.forEach(t.data.result.tab2,function(o,r){t.data.result.tab2[r].description=n.trustAsHtml(o.description),e.tab2.push(o)})})}]),angular.module("ucp",["ui.bootstrap"]).controller("UcpCtrl",["$scope","$location","http","$sce","$stateParams","$timeout",function(e,t,o,n,r,a){var s;$("html, body").animate({scrollTop:0},"slow"),e.emailChange={old:"",new:"",result:"",done:!1},e.rank=localStorage.getItem("rank"),e.shop_logs=[],e.shop_coins_history=[],e.logsPage=1,e.historyPage=1,e.logsLimit=10,e.historyLimit=10,e.total_logs_pages=0,e.total_pages_shop_coins=0,e.pageChanged=function(t,o){e.logsPage=t,e.historyPage=o,e.get_history_shop()},e.get_history_shop=function(){o.post({m:"ucp",w:"get_history_shop",p:{logsPage:e.logsPage,logsLimit:e.logsLimit,historyPage:e.historyPage,historyLimit:e.historyLimit}}).then(function(t){t.data.result.details&&"Not logged in."==t.data.result.details&&e.logout(),e.shop_logs=t.data.result.shop_logs,e.shop_coins_history=t.data.result.shop_coins_history,e.logsPage=t.data.result.current_logs_page,e.historyPage=t.data.result.current_history_page,e.total_logs_pages=t.data.result.total_logs_pages,e.total_pages_shop_coins=t.data.result.total_pages_shop_coins,e.total_logs_items=e.total_logs_pages*e.logsLimit,e.total_coins=e.total_pages_shop_coins*e.historyLimit})},e.unstuck_characters=[],e.unstuck={character:"0"},e.unstucking=!1,e.unstuck_complete=!1,e.unstuck_result="",e.get_unstuck_characters=function(){o.post({m:"ucp",w:"get_unstuck_list",p:{}}).then(function(t){t.data.result.details&&"Not logged in."==t.data.result.details&&e.logout(),e.unstuck_characters=t.data.result})},e.unstuck_eligible_status=function(t){var o=-1,n=-1;return angular.forEach(e.unstuck_characters,function(e,r){e.guid==t&&(o=0,n=0,1==e.online&&(o=1),0!=e.cd&&(o=2,n=e.cd))}),{status:o,cooldown:n}},e.unstuck_do=function(t){e.unstucking=!0,o.post({m:"ucp",w:"unstuck",p:{guid:t}}).then(function(t){t.data.result.details&&"Not logged in."==t.data.result.details&&e.logout(),e.unstucking=!1,t.data.result.err?e.unstuck_complete=!1:e.unstuck_complete=!0,e.unstuck_result=t.data.result.details})},void 0!==r.token?(e.view="email-changed",e.emailChange.result="",o.post({m:"ucp",w:"activateNewEmail",p:{token:r.token}}).then(function(t){t.data.result.details&&"Not logged in."==t.data.result.details&&e.logout(),e.emailChange.result=t.data.result.details})):(e.view=r.route,"services"==e.view&&e.get_unstuck_characters(),"history_shop"==e.view&&e.get_history_shop()),e.data={},e.getUCP=function(){o.post({m:"ucp",w:"get",p:{view:e.view}}).then(function(t){t.data.result.details&&"Not logged in."==t.data.result.details&&e.logout(),"overview"==e.view&&angular.forEach(t.data.result.status.messages,function(e,t){e.m=n.trustAsHtml(e.message)}),e.data=t.data.result})},e.getUCP(),e.toggleEmailChangeModal=function(){e.emailChange={old:"",new:"",result:"",done:!1},$("#emailChange").modal("toggle")},e.appeal={message:"",err:""},e.toggleBanAppealModal=function(){e.appeal={message:"",err:""},o.post({m:"ucp",w:"mark_read",p:{}}).then(function(t){t.data.result.details&&"Not logged in."==t.data.result.details&&e.logout()}),$("#banAppeal").modal("toggle"),a(function(){$("#messageHistory").animate({scrollTop:$("#messageHistory").prop("scrollHeight")},100)},500)},e.sendAppeal=function(){o.post({m:"ucp",w:"add_appeal",p:{message:e.appeal.message}}).then(function(t){t.data.result.details&&"Not logged in."==t.data.result.details&&e.logout(),e.appeal.err=t.data.result.details,t.data.result.err||(e.appeal.message="",o.post({m:"ucp",w:"get",p:{view:e.view}}).then(function(t){t.data.result.details&&"Not logged in."==t.data.result.details&&e.logout(),"overview"==e.view&&angular.forEach(t.data.result.status.messages,function(e,t){e.m=n.trustAsHtml(e.message)}),e.data=t.data.result,a(function(){$("#messageHistory").animate({scrollTop:$("#messageHistory").prop("scrollHeight")},100)},500)}))})},e.changeEmailAddress=function(){if(!e.emailChange.old){e.emailChange.result="Invalid old email address";return}if(!e.emailChange.new){e.emailChange.result="Invalid new email address";return}if(0===e.emailChange.old.length||0===e.emailChange.new.length){e.emailChange.result="Email address can't be empty";return}if(e.emailChange.old===e.emailChange.new){e.emailChange.result="New and old addresses cannot be the same.";return}o.post({m:"ucp",w:"changeEmail",p:{old:e.emailChange.old,new:e.emailChange.new}}).then(function(t){t.data.result.details&&"Not logged in."==t.data.result.details&&e.logout(),e.emailChange.result=t.data.result.details,e.emailChange.done=!t.data.result.err})},e.transfer_complete=!1,e.confirmation_checked=!1,e.transfer_account={needNewAccount:!1,banned:!1,online:!1,in_progress:!1,account_name:"",user_password:"",user_password2:"",realm_id:"0"},e.character_queue_status=[],e.realm_lists=[{id:2,realmName:"Ravenshire"},{id:3,realmName:"Emerald Dream"}],e.transfer_err=!1,e.toggleTransferAccountModal=function(t){o.post({m:"ucp",w:"checkTransferStatus"}).then(function(t){(t=t.data.result).in_progress&&(e.transfer_account.in_progress=t.in_progress),t.transfer_complete&&(e.transfer_complete=t.transfer_complete),t.characters&&(e.character_queue_status=t.characters),t.banned&&(e.transfer_account.banned=t.banned),t.online&&(e.transfer_account.online=t.online),t.username_exists&&(e.transfer_account.needNewAccount=t.username_exists),t.error&&(e.transfer_err=t.error)}),t&&$("#transferAccount").modal("toggle")},e.transferAccount=function(){if(e.transfer_account.needNewAccount&&(e.transfer_account.account_name<=2||e.transfer_account.user_password<=2||e.transfer_account.user_password2<=2||e.transfer_account.user_password!=e.transfer_account.user_password2)){e.transfer_err=!0;return}o.post({m:"ucp",w:"transferAccount",p:{data:e.transfer_account}}).then(function(t){t.data.result.response.username?e.response=t.data.result.response.username:e.response=t.data.result.response,t.data.result.error&&(e.transfer_err=t.data.result.error),-1!==e.response.indexOf("Successfully added")&&(e.transfer_account.in_progress=!0,e.toggleTransferAccountModal(!1))})},e.beginTransferCharacter=function(t){e.transfer_err=!1,e.response="",o.post({m:"ucp",w:"beginTransferCharacter",p:{guid:t}}).then(function(t){t.data.result.error&&(e.transfer_err=t.data.result.error),t.data.result.response&&(e.response=t.data.result.response),e.transfer_err||e.toggleTransferAccountModal(!1)})},e.completeTransferCharacter=function(t){e.transfer_err=!1,e.response="",o.post({m:"ucp",w:"completeTransferCharacter",p:{guid:t}}).then(function(t){t.data.result.error&&(e.transfer_err=t.data.result.error),t.data.result.response&&(e.response=t.data.result.response),t.data.result.transferComplete&&e.logout(!0),e.transfer_err||e.toggleTransferAccountModal(!1)})},e.delete_account={checkbox:!1,email:"",password:"",result:""},e.toggleDeleteAccountModal=function(){e.delete_account={checkbox:!1,email:"",password:"",result:""},$("#deleteAccount").modal("toggle")},e.delete_account_checkbox_toggle=function(){e.delete_account.checkbox=!e.delete_account.checkbox},e.deleteAccount=function(){o.post({m:"ucp",w:"deleteAccount",p:{email:e.delete_account.email,password:e.delete_account.password}}).then(function(t){t.data.result.details&&"Not logged in."==t.data.result.details&&e.logout(),t.data.result.err?e.delete_account.result=t.data.result.details:($("#deleteAccount").modal("toggle"),a(function(){e.logout()},750))})},e.toggleEmailSub=function(){1===e.data.email_sub?e.data.email_sub=0:e.data.email_sub=1,a.cancel(s),s=a(function(){o.post({m:"ucp",w:"setEmailSub",p:{to:e.data.email_sub}}).then(function(t){t.data.result.details&&"Not logged in."==t.data.result.details&&e.logout()})},1e3)},e.security={c_password:"",n_password:"",n_password2:"",pw_change_result:""},e.change_password=function(){e.passwords_valid()&&o.post({m:"ucp",w:"change_password",p:{data:e.security}}).then(function(t){t.data.result.details&&"Not logged in."==t.data.result.details&&e.logout(),t.data.result.err||(e.security={c_password:"",n_password:"",n_password2:""}),e.security.pw_change_result=t.data.result.details})},e.passwords_valid=function(){return""!=e.security.c_password&&""!=e.security.n_password&&""!=e.security.n_password&&(""==e.security.n_password||e.security.n_password==e.security.n_password2)&&/^[\dA-Za-z!?%*$\-+]{4,16}$/.test(e.security.n_password)},e.pw_valid=function(e){return""==e||/^[\dA-Za-z!?%*$\-+]{4,16}$/.test(e)},e.restore_result="Character restored",e.restoreCharacter=function(t){o.post({m:"ucp",w:"restoreCharacter",p:{name:t}}).then(function(t){t.data.result.details&&"Not logged in."==t.data.result.details&&e.logout(),e.restore_result=t.data.result.details,t.data.result.err||e.getUCP()})}}]),angular.module("directives",["turtle-video"]).directive("enterSubmit",[function(){return function(e,t,o){t.bind("keydown keypress",function(t){13===t.which&&(e.$apply(function(){e.$eval(o.enterSubmit)}),t.preventDefault())})}}]).directive("tooltip",[function(){return{link:function(e,t){t.tooltip()}}}]),angular.module("turtle-video",[]).directive("turtleVideo",[function(){return{restrict:"E",replace:!0,scope:{video:"="},templateUrl:"src/_directives/turtle-video.html",controller:["$scope","$sce",function(e,t){e.urlSCE=t.trustAsResourceUrl(e.video.url),e.id="turtle-video-"+e.video.id,e.thumb=e.video.url.replace("webm","jpg")}]}}]).directive("turtleVideoThumb",["$location",function(e){return{restrict:"E",replace:!0,scope:{v:"=",vertical:"="},templateUrl:"src/_directives/turtle-video-thumb.html",controller:["$scope",function(t){t.goToPage=function(t){e.url(t)}}]}}]).directive("turtleVideoEmbed",[function(){return{restrict:"E",replace:!0,scope:{id:"=",height:"=?"},templateUrl:"src/_directives/turtle-video-embed.html",controller:["$scope","$sce","http",function(e,t,o){e.height=angular.isDefined(e.height)?e.height:"100%",e.aloaded=!1,e.currentVideo={url:""},o.post({m:"video",w:"getVideo",p:{id:e.id}}).then(function(t){e.currentVideo=t.data.result,e.aloaded=!0})}]}}]),angular.module("filters",["ucfirst"]),angular.module("ucfirst",[]).filter("ucfirst",[function(){return function(e){return e?e.charAt(0).toUpperCase()+e.substr(1).toLowerCase():""}}]),angular.module("http.service",[]).factory("http",["$http",function(e){return{get:function(t){return e({url:"api/",method:"GET",params:t})},post:function(t){return e({method:"POST",url:void 0!==t.url?"api/"+t.url:"api/index.php?url="+t.m+"/"+t.w,headers:{"Content-Type":"application/x-www-form-urlencoded"},transformRequest:function(e){var t=[];return angular.forEach(e,function(e,o){"object"==typeof e&&(e=angular.toJson(e)),t.push(encodeURIComponent(o)+"="+encodeURIComponent(e))}),t.join("&")},data:t})}}}]),angular.module("modules",["filters","directives","home","donate","success","fail","changelog","sound-design","reset","activate","new-races","class-race-combinations","seasonal-events","new-locations-and-maps","additional-transport-routes","client-interface-improvements","player-versus-player-content","hardcore-mode","slow-and-steady","beginners-guild","chronoboon-displacer","character-customizations","achievement-titles","guild-banks","transmogrification","dynamic-mount-speed","survival-and-gardening","raids-and-dungeons","new-factions-and-quests","items-and-recipes","pets-and-mounts","roleplay","logos","classes","population-graph","community-artworks","shellcoin","watch","ucp","rules","everlook-broadcasting","vagrants-endeavor","new-challenges"]),angular.module("tw",["ui.router","templates","http.service","modules",]).run(["$rootScope","$templateCache",function(e,t){}]).config(["$stateProvider","$urlRouterProvider",function(e,t){e.state("home",{url:"/home",views:{main:{templateUrl:"/home/home.html",controller:"HomeCtrl"}}}).state("reset",{url:"/reset/:token_key/:pass",views:{main:{templateUrl:"/reset/reset.html",controller:"ResetCtrl"}}}).state("activate",{url:"/activate/:email/:token",views:{main:{templateUrl:"/activate/activate.html",controller:"ActivateCtrl"}}}).state("donate",{url:"/donate",views:{main:{templateUrl:"/donate/donate.html",controller:"DonateCtrl"}}}).state("donatedev",{url:"/donatedev",views:{main:{templateUrl:"/donate/donate.html",controller:"DonateCtrl"}}}).state("success",{url:"/success",views:{main:{templateUrl:"/success/success.html",controller:"SuccessCtrl"}}}).state("fail",{url:"/fail",views:{main:{templateUrl:"/fail/fail.html",controller:"FailCtrl"}}}).state("changelog",{url:"/changelog",views:{main:{templateUrl:"/changelog/changelog.html",controller:"ChangelogCtrl"}}}).state("sound-design",{url:"/sound-design",views:{main:{templateUrl:"/sound-design/sound-design.html",controller:"SoundDesignCtrl"}}}).state("new-races",{url:"/new-races",views:{main:{templateUrl:"/new-races/new-races.html",controller:"NewRacesCtrl"}}}).state("class-race-combinations",{url:"/class-race-combinations",views:{main:{templateUrl:"/class-race-combinations/class-race-combinations.html",controller:"ClassRaceCombinationsCtrl"}}}).state("seasonal-events",{url:"/seasonal-events",views:{main:{templateUrl:"/seasonal-events/seasonal-events.html",controller:"SeasonalEventsCtrl"}}}).state("new-locations-and-maps",{url:"/new-locations-and-maps",views:{main:{templateUrl:"/new-locations-and-maps/new-locations-and-maps.html",controller:"NewLocationsAndMapsCtrl"}}}).state("additional-transport-routes",{url:"/additional-transport-routes",views:{main:{templateUrl:"/additional-transport-routes/additional-transport-routes.html",controller:"AdditionalTransportRoutesCtrl"}}}).state("client-interface-improvements",{url:"/client-interface-improvements",views:{main:{templateUrl:"/client-interface-improvements/client-interface-improvements.html",controller:"ClientInterfaceImprovementsCtrl"}}}).state("player-versus-player-content",{url:"/player-versus-player-content",views:{main:{templateUrl:"/player-versus-player-content/player-versus-player-content.html",controller:"PlayerVersusPlayerContentCtrl"}}}).state("hardcore-mode",{url:"/hardcore-mode",views:{main:{templateUrl:"/hardcore-mode/hardcore-mode.html",controller:"HardcoreModeCtrl"}}}).state("slow-and-steady",{url:"/slow-and-steady",views:{main:{templateUrl:"/slow-and-steady/slow-and-steady.html",controller:"SlowAndSteadyCtrl"}}}).state("chronoboon-displacer",{url:"/chronoboon-displacer",views:{main:{templateUrl:"/chronoboon-displacer/chronoboon-displacer.html",controller:"ChronoboonDisplacerCtrl"}}}).state("character-customizations",{url:"/character-customizations",views:{main:{templateUrl:"/character-customizations/character-customizations.html",controller:"CharacterCustomizationsCtrl"}}}).state("achievement-titles",{url:"/achievement-titles",views:{main:{templateUrl:"/achievement-titles/achievement-titles.html",controller:"AchievementTitlesCtrl"}}}).state("guild-banks",{url:"/guild-banks",views:{main:{templateUrl:"/guild-banks/guild-banks.html",controller:"GuildBanksCtrl"}}}).state("transmogrification",{url:"/transmogrification",views:{main:{templateUrl:"/transmogrification/transmogrification.html",controller:"TransmogrificationCtrl"}}}).state("dynamic-mount-speed",{url:"/dynamic-mount-speed",views:{main:{templateUrl:"/dynamic-mount-speed/dynamic-mount-speed.html",controller:"DynamicMountSpeedCtrl"}}}).state("survival-and-gardening",{url:"/survival-and-gardening",views:{main:{templateUrl:"/survival-and-gardening/survival-and-gardening.html",controller:"SurvivalAndGardeningCtrl"}}}).state("raids-and-dungeons",{url:"/raids-and-dungeons",views:{main:{templateUrl:"/raids-and-dungeons/raids-and-dungeons.html",controller:"RaidsAndDungeonsCtrl"}}}).state("new-factions-and-quests",{url:"/new-factions-and-quests",views:{main:{templateUrl:"/new-factions-and-quests/new-factions-and-quests.html",controller:"NewFactionsAndQuestsCtrl"}}}).state("items-and-recipes",{url:"/items-and-recipes",views:{main:{templateUrl:"/items-and-recipes/items-and-recipes.html",controller:"ItemsAndRecipesCtrl"}}}).state("pets-and-mounts",{url:"/pets-and-mounts",views:{main:{templateUrl:"/pets-and-mounts/pets-and-mounts.html",controller:"PetsAndMountsCtrl"}}}).state("roleplay",{url:"/roleplay",views:{main:{templateUrl:"/roleplay/roleplay.html",controller:"RoleplayCtrl"}}}).state("logos",{url:"/logos",views:{main:{templateUrl:"/logos/logos.html",controller:"LogosCtrl"}}}).state("druid",{url:"/druid",views:{main:{templateUrl:"/classes/druid.html",controller:"ClassesCtrl"}}}).state("hunter",{url:"/hunter",views:{main:{templateUrl:"/classes/hunter.html",controller:"ClassesCtrl"}}}).state("mage",{url:"/mage",views:{main:{templateUrl:"/classes/mage.html",controller:"ClassesCtrl"}}}).state("paladin",{url:"/paladin",views:{main:{templateUrl:"/classes/paladin.html",controller:"ClassesCtrl"}}}).state("priest",{url:"/priest",views:{main:{templateUrl:"/classes/priest.html",controller:"ClassesCtrl"}}}).state("rogue",{url:"/rogue",views:{main:{templateUrl:"/classes/rogue.html",controller:"ClassesCtrl"}}}).state("shaman",{url:"/shaman",views:{main:{templateUrl:"/classes/shaman.html",controller:"ClassesCtrl"}}}).state("warlock",{url:"/warlock",views:{main:{templateUrl:"/classes/warlock.html",controller:"ClassesCtrl"}}}).state("warrior",{url:"/warrior",views:{main:{templateUrl:"/classes/warrior.html",controller:"ClassesCtrl"}}}).state("population-graph",{url:"/population-graph",views:{main:{templateUrl:"/population-graph/population-graph.html",controller:"PopulationGraphCtrl"}}}).state("community-artworks",{url:"/community-artworks",views:{main:{templateUrl:"/community-artworks/community-artworks.html",controller:"CommunityArtworksCtrl"}}}).state("shellcoin",{url:"/shellcoin",views:{main:{templateUrl:"/shellcoin/shellcoin.html",controller:"ShellcoinCtrl"}}}).state("watchHome",{url:"/watch",views:{main:{templateUrl:"/watch/watch.html",controller:"WatchCtrl"}}}).state("watchVideo",{url:"/watch/:id",views:{main:{templateUrl:"/watch/watch.html",controller:"WatchCtrl"}}}).state("watchChannel",{url:"/watch/channel/:id",views:{main:{templateUrl:"/watch/watch.html",controller:"WatchCtrl"}}}).state("ucp",{url:"/ucp/:route",views:{main:{templateUrl:"/ucp/ucp.html",controller:"UcpCtrl"}}}).state("ucp-email-confirm",{url:"/ucp/confirm-email-change/:token",views:{main:{templateUrl:"/ucp/ucp.html",controller:"UcpCtrl"}}}).state("rules",{url:"/rules",views:{main:{templateUrl:"/rules/rules.html",controller:"RulesCtrl"}}}).state("everlook-broadcasting",{url:"/everlook-broadcasting",views:{main:{templateUrl:"/everlook-broadcasting/everlook-broadcasting.html",controller:"EverlookBroadcastingCtrl"}}}).state("vagrants-endeavor",{url:"/vagrants-endeavor",views:{main:{templateUrl:"/vagrants-endeavor/vagrants-endeavor.html",controller:"VagrantsEndeavorCtrl"}}}).state("new-challenges",{url:"/new-challenges",views:{main:{templateUrl:"/new-challenges/new-challenges.html",controller:"NewChallengesCtrl"}}}),t.otherwise("/home")}]).controller("MainCtrl",["$scope","$http","http","$location","$state","$sce","$rootScope",function(e,t,o,n,r,a,s){e.modal="register",e.channels=[],e.visitorCountry=null,e.channelsNum=function(){return e.channels.length},e.getChannels=function(){return e.channels},e.setChannels=function(t){e.channels=t},e.getVisitorCountry=function(){o.post({m:"matomo",w:"getGeoLocation"}).then(function(t){t=t.data.result,e.visitorCountry=t.response})},e.getVisitorCountry(),e.changeModal=function(t){e.modal=t,e.response="",e.register_data={account_name:"",email_address:"",user_password:"",user_password2:"",forum_name:"",captchaInput:""}},e.openLoginModal=function(e){window.location.href="login.php?redirect="+e},e.captchaImage="",e.refreshCaptchaImage=function(){e.captchaImage="api/index.php?url=register/generateCaptchaImage&p=&t="+new Date().getTime()},e.openRegisterModal=function(){o.post({m:"matomo",w:"getGeoLocation"}).then(function(t){var o=(t=t.data.result).response;"CN"===o||"IN"===o||"SG"===o||"TW"===o||"HK"===o?window.location.href="https://cn.turtle-wow.org":(e.changeModal("register"),$("#register").modal("show"))})},e.closeRegisterModal=function(){e.changeModal("register"),$("#register").modal("hide")},e.openDatabaseModal=function(){$("#database").modal("show")},e.closeDatabaseModal=function(){$("#database").modal("hide")},e.validEmail=function(e){return e.match(/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)},e.register_data={account_name:"",email_address:"",user_password:"",user_password2:"",forum_name:"",captchaInput:""},e.login_data={email:"",password:""},e.register_err=!1,e.login_err=!1,e.response="",e.redirect_after_login="donatedev",e.login_err_msg="",e.user={user_id:localStorage.getItem("user_id"),username:localStorage.getItem("username"),email:localStorage.getItem("email"),tokens:localStorage.getItem("tokens"),rank:localStorage.getItem("rank")},e.registering=!1,e.forgot=function(){if(e.registering)return!1;if(!e.validEmail(e.register_data.email_address)){e.register_err=!0;return}e.registering=!0,o.post({m:"register",w:"reset",p:{email:e.register_data.email_address}}).then(function(t){if(e.registering=!1,e.response=t.data.result.response,-1!==e.response.indexOf("This email doe")){e.modal="forgot";return}e.modal="resetok",e.register_data={account_name:"",email_address:"",user_password:"",user_password2:"",forum_name:"",captchaInput:""}})},e.cap_input="",e.register=function(){if(e.registering)return!1;if(e.register_data.account_name<=2||!e.validEmail(e.register_data.email_address)||e.register_data.forum_name<=2||e.register_data.user_password<=2||e.register_data.user_password2<=2||e.register_data.user_password!=e.register_data.user_password2){e.register_err=!0;return}e.registering=!0,o.post({m:"register",w:"register",p:{data:e.register_data}}).then(function(t){if(e.registering=!1,e.response=t.data.result.response,-1!==e.response.indexOf("Captcha verification failed")||-1!==e.response.indexOf("already in use")||-1!==e.response.indexOf("You must")||-1!==e.response.indexOf("There was a problem creating your account, please")||-1!==e.response.indexOf("There was a problem creating your account and you")){e.modal="register";return}if(-1!==e.response.indexOf("Forbidden")){e.modal="register",window.location.href="https://cn.turtle-wow.org";return}e.modal="ok",e.register_data={account_name:"",email_address:"",user_password:"",user_password2:"",forum_name:"",captchaInput:""}})},e.login=function(){if(e.login_err=!1,e.login_err_msg="",void 0==e.login_data.username||void 0==e.login_data.password||e.login_data.username.length<=0||e.login_data.password.length<=0){e.login_err=!0,e.login_err_msg="Fill in correctly marked inputs:";return}o.post({url:"login.php",m:"register",w:"login",p:{data:e.login_data}}).then(function(t){if(0!=(t=t.data.result).result){e.login_err=!0,e.login_err_msg=t.msg;return}e.user=t.datas,angular.forEach(e.user,function(e,t){localStorage.setItem(t,e)}),localStorage.removeItem("postingChar"),e.closeRegisterModal(),""!==e.redirect_after_login&&("current"===e.redirect_after_login||(-1!==e.redirect_after_login.indexOf("watch/")&&s.$broadcast("initVideos"),e.goToPage(e.redirect_after_login),e.redirect_after_login="donatedev"))})},e.getLoginStatus=function(){o.post({m:"register",w:"loginStatus",p:{}}).then(function(t){(t=t.data.result).loggedIn?(e.user=t.datas,angular.forEach(e.user,function(e,t){localStorage.setItem(t,e)}),localStorage.removeItem("postingChar")):(e.channels=[],angular.forEach(["user_id","username","email","tokens"],function(e,t){localStorage.removeItem(e)}),localStorage.removeItem("postingChar"),e.user=null)})},e.currentRoute=function(){return -1!==n.url().indexOf("reset/")?"/home":n.url()},e.getLoginStatus(),e.logout=function(t=!1){o.post({m:"register",w:"logout",p:{}}).then(function(o){e.channels=[],angular.forEach(["user_id","username","email","tokens"],function(e,t){localStorage.removeItem(e)}),e.user=null,localStorage.removeItem("postingChar"),t?(alert("Your account has been successfully transferred. You will be logged out in 5 sec."),setTimeout(function(){e.goToPage("home")},5e3)):e.goToPage("home")})},e.isLoggedIn=function(){return null!=e.user},e.moveToDonate=function(){if(e.collapseNavBar(),!e.isLoggedIn()){e.openLoginModal("donatedev");return}e.goToPage("donatedev")},e.moveToRules=function(){e.collapseNavBar(),e.goToPage("rules")},e.settings={},e.featuresMenuVisible=!1,e.lightbox_images=[],e.lightbox_image="",e.add_lightbox_images=function(t){e.lightbox_images=t,angular.forEach(e.lightbox_images,function(t,o){t.active&&(e.lightbox_image=t.image)})},e.lb=function(t){e.lightbox_image=t,$("#lightbox").modal("show")},e.goToPage=function(t){e.collapseNavBar(),e.featuresMenuVisible&&(e.featuresMenuVisible=!1),n.url(t)},e.collapseNavBar=function(){e.navBarContent=document.getElementById("navbarSupportedContent"),e.navBarContent&&e.navBarContent.classList.contains("show")&&e.navBarContent.classList.remove("show")}}]);