jQuery(document).ready((function(a){var e="";function n(a){if(a>=25||a<=-1)var e=numeral(a).format("0,0.00");else if(a>=.5&&a<25)e=numeral(a).format("0,0.000");else if(a>=.01&&a<.5)e=numeral(a).format("0,0.0000");else if(a>=1e-4&&a<.01)e=numeral(a).format("0,0.00000");else e=numeral(a).format("0,0.00000000");return e}a.fn.ccpwDatatable=function(){e=a(this).attr("id");var t=a(this),s=[],r=t.data("rtype"),c=t.data("coin-list"),i=t.data("currency-symbol"),o=t.data("currency-rate"),l=t.data("pagination"),d=t.data("currency-type"),p=t.data("required-currencies"),u=t.data("prev-coins"),m=t.data("next-coins"),f=t.data("zero-records"),v=t.data("currency-slug"),g=t.data("dynamic-link"),h=t.data("loadinglbl"),y=t.data("number-formating");t.find("thead th").each((function(e){var t=a(this),r=(e=t.data("index"),t.data("classes"));s.push({data:e,name:e,render:function(a,t,s,c){if(void 0===c.settings.json)return a;switch(e){case"rank":default:return a;case"name":if(void 0!==g&&""!=g)var o=v+"/"+s.symbol+"/"+s.id,l='
('+s.symbol+')
'+s.name+"
";else l='
('+s.symbol+')
'+a+"
";return l;case"price":if(void 0!==a&&null!=a){var d=n(a);return'
'+i+d+"
"}return'
?
";case"change_percentage_24h":if(void 0!==a&&null!=a){var p="up",u="ccpw-up";if(void 0===Math.sign&&(Math.sign=function(a){return a>0?1:a<0?-1:a}),-1==Math.sign(a))p="down",u="ccpw-down";return l='
'+a+"%
"}return'
?
';case"market_cap":if(void 0!==a&&null!=a){d=n(a);if(y)d=numeral(a).format("(0.00 a)").toUpperCase();return'
'+i+d+"
"}return'
?
";case"total_volume":if(void 0!==a&&null!=a&&"0.00"!=a){d=n(a);if(y)d=numeral(a).format("(0.00 a)").toUpperCase();return'
'+i+d+"
"}return'
?
';case"supply":if(void 0!==a&&null!=a&&"N/A"!=s.supply){d=n(a);if(y)d=numeral(a).format("(0.00 a)").toUpperCase();return'
'+d+" "+s.symbol+"
"}return'
N/A
'}},createdCell:function(e,n,t,s,r){a(e).attr("data-sort",n)}})})),t.DataTable({deferRender:!0,serverSide:!0,ajax:{url:ccpw_js_objects.ajax_url,type:"POST",dataType:"JSON",data:function(a){a.action="ccpw_get_coins_list",a.nonce=ccpw_js_objects.wp_nonce,a.currency=d,a.currencyRate=o,a.requiredCurrencies=p,a.rtype=r,a.coinslist=c},error:function(a,e,n){alert("Something wrong with Server")}},ordering:!1,searching:!1,pageLength:l,columns:s,responsive:!0,lengthChange:!1,pagingType:"simple",processing:!0,dom:'<"top"iflp<"clear">>rt<"bottom"iflp<"clear">>',language:{processing:h,loadingRecords:h,paginate:{next:m,previous:u}},zeroRecords:f,emptyTable:f,renderer:{header:"bootstrap"},initComplete:function(e,n){"nonce_failed"==n.error&&a(this).find(".dataTables_empty").html('Attention: Please exclude this page from your cache plugin, as it is currently causing a nonce failure.
For detailed instructions on how to implement the exclusion, kindly follow this link: Exclusion Guide..
')},drawCallback:function(a){t.tableHeadFixer({head:!0,foot:!1,left:2,right:!1,"z-index":1})}})},a(".ccpw_table_widget").each((function(){a.fn.dataTable.ext.errMode="none",a(this).ccpwDatatable()})),e&&new Tablesort(document.getElementById(e),{descending:!0})}));