function PanelSwipe(){function d(){v(),setTimeout(function(){m()},0),g()}function v(){e=!1,t=0,n=0,r=0,i=0,s=!0,o=1,u=[0,0,0],c=!1,h=!1,f=0,l=0,a=[funcObj.langCon.getString("General NowPlaying").toUpperCase(),funcObj.langCon.getString("General Explore").toUpperCase()]}function m(){y(),b(u[o],!1,!1,!0)}function g(){$("body").on(vmove,function(s){if(e){s.preventDefault();var a=r;r=funcObj.UIMain.getMouseX(s);var c=r+t;c<u[l]?c=u[l]:c>u[f]&&(c=u[f]),r>n&&c>u[l]&&c<u[f]?a>r?i+=a-r:i=0:r<n&&c>u[l]&&c<u[f]&&(a<r?i+=r-a:i=0),i>0&&(movedDirVal=0);if(c!==u[o]||movedDirVal!==0)funcObj.content.animatePanel(c,!1),o!=0&&c>=u[1]?funcObj.presets.animatePanel(c,!1):o!=0&&funcObj.presets.animatePanel(u[1],!1)}}).on(vup,function(n){if(e){$(n.target).data({type:"swipe",collect:dc.trackSwipes}),o==1?($(n.target).data("origin","main_play"),movedDirVal>0?$(n.target).data("dest","main_content"):$(n.target).data("dest","main_preset")):($(n.target).data("dest","main_play"),o==0?$(n.target).data("origin","main_content"):o==2&&$(n.target).data("origin","main_preset")),e=!1;var a=r+t;a===u[o]&&movedDirVal!==0&&(movedDirVal>0?a-=1:a+=1),a!==u[o]&&(h&&i>=p||!h)&&(a>u[l]&&a<u[f]&&i>=p||orient=="portrait"&&touchDevice&&o==2&&a>u[f]||orient=="landscape"&&o==1&&a>u[f]||!funcObj.devCon.getDeviceSocketObj(funcObj.UIMain.getUID()).getSocketState()&&o==1&&a>u[f]||o==0&&a<u[l])?setTimeout(function(){b(u[o],!0,!1)},0):(i<=p&&a!==u[o]||a===u[o]&&movedDirVal===0)&&(!h||h&&(movedDirVal===0||a>=u[0]&&a<=u[1]||a<u[0]&&(movedDirVal<0||o==1)||a>u[1]&&(movedDirVal>0||o==0)))&&setTimeout(function(){b(a,!0,!0)},0),s=!0}}),$("#main").on(vup,function(t){e&&(movedDirVal>0?$(t.target).data("dest","main_content"):$(t.target).data("dest","main_preset"))})}function y(){u=[Math.floor($(".preset_num").outerWidth(!0)-$("#preset_arc").width()),Math.floor($(window).width()-$("#content_handle").width()),0],u[2]=u[1]+Math.floor($(window).width()-u[0])}function b(e,t,n,r){n&&(o==2||o==0?o=1:touchDevice&&orient=="portrait"&&!h&&(e-i>u[o]||e-i<u[o]&&movedDirVal<0)?o=2:o=0,e=u[o]),t?T(!0):T(!1),touchDevice&&orient=="portrait"&&o!=0?funcObj.presets.animatePanel(e,t):touchDevice&&r!=undefined&&r!=null&&r&&funcObj.presets.animatePanel(u[1],t),o==1}function w(e){if(e==null||e==undefined)e=!0;o!=1&&(o=1,setTimeout(function(){b(u[o],e,!1)},0))}function E(){return o}function S(o,u,a){e||(i=0,n=r=funcObj.UIMain.getMouseX(o),t=u,h=!1,a!=undefined&&a&&(s=!1),x(),e=!0)}function x(e){touchDevice&&orient=="portrait"&&funcObj.devCon.getDeviceSocketObj(funcObj.UIMain.getUID()).getSocketState()&&e==undefined?(f=o+1,f>2&&(f=2)):f=1,l=o-1,l<0&&(l=0)}function T(e){c=e}function N(){return c}function C(){return u}function k(){return e}var e,t,n,r,i,s,o,u,a,f,l,c,h,p=10;this.updateUI=m,this.swipePanel=b,this.getHandleLoc=E,this.showNowPlaying=w,this.extSwipe=S,this.setAnimatingState=T,this.getAnimatingState=N,this.getLimits=C,this.getPMove=k,d()};