/ * !
Copyright 2014 SpryMedia Ltd .
License MIT - http : //datatables.net/license/mit
For more detailed information please see :
http : //datatables.net/blog/2014-09-22
AlphabetSearch for DataTables v1 . 0.0
2014 SpryMedia Ltd - datatables . net / license
* /
var $jscomp = $jscomp || { } ; $jscomp . scope = { } ; $jscomp . findInternal = function ( c , a , b ) { c instanceof String && ( c = String ( c ) ) ; for ( var e = c . length , d = 0 ; d < e ; d ++ ) { var g = c [ d ] ; if ( a . call ( b , g , d , c ) ) return { i : d , v : g } } return { i : - 1 , v : void 0 } } ; $jscomp . ASSUME _ES5 = ! 1 ; $jscomp . ASSUME _NO _NATIVE _MAP = ! 1 ; $jscomp . ASSUME _NO _NATIVE _SET = ! 1 ; $jscomp . SIMPLE _FROUND _POLYFILL = ! 1 ; $jscomp . ISOLATE _POLYFILLS = ! 1 ;
$jscomp . defineProperty = $jscomp . ASSUME _ES5 || "function" == typeof Object . defineProperties ? Object . defineProperty : function ( c , a , b ) { if ( c == Array . prototype || c == Object . prototype ) return c ; c [ a ] = b . value ; return c } ; $jscomp . getGlobal = function ( c ) { c = [ "object" == typeof globalThis && globalThis , c , "object" == typeof window && window , "object" == typeof self && self , "object" == typeof global && global ] ; for ( var a = 0 ; a < c . length ; ++ a ) { var b = c [ a ] ; if ( b && b . Math == Math ) return b } throw Error ( "Cannot find global object" ) ; } ; $jscomp . global = $jscomp . getGlobal ( this ) ;
$jscomp . IS _SYMBOL _NATIVE = "function" === typeof Symbol && "symbol" === typeof Symbol ( "x" ) ; $jscomp . TRUST _ES6 _POLYFILLS = ! $jscomp . ISOLATE _POLYFILLS || $jscomp . IS _SYMBOL _NATIVE ; $jscomp . polyfills = { } ; $jscomp . propertyToPolyfillSymbol = { } ; $jscomp . POLYFILL _PREFIX = "$jscp$" ; var $jscomp$lookupPolyfilledValue = function ( c , a ) { var b = $jscomp . propertyToPolyfillSymbol [ a ] ; if ( null == b ) return c [ a ] ; b = c [ b ] ; return void 0 !== b ? b : c [ a ] } ;
$jscomp . polyfill = function ( c , a , b , e ) { a && ( $jscomp . ISOLATE _POLYFILLS ? $jscomp . polyfillIsolated ( c , a , b , e ) : $jscomp . polyfillUnisolated ( c , a , b , e ) ) } ; $jscomp . polyfillUnisolated = function ( c , a , b , e ) { b = $jscomp . global ; c = c . split ( "." ) ; for ( e = 0 ; e < c . length - 1 ; e ++ ) { var d = c [ e ] ; if ( ! ( d in b ) ) return ; b = b [ d ] } c = c [ c . length - 1 ] ; e = b [ c ] ; a = a ( e ) ; a != e && null != a && $jscomp . defineProperty ( b , c , { configurable : ! 0 , writable : ! 0 , value : a } ) } ;
$jscomp . polyfillIsolated = function ( c , a , b , e ) { var d = c . split ( "." ) ; c = 1 === d . length ; e = d [ 0 ] ; e = ! c && e in $jscomp . polyfills ? $jscomp . polyfills : $jscomp . global ; for ( var g = 0 ; g < d . length - 1 ; g ++ ) { var h = d [ g ] ; if ( ! ( h in e ) ) return ; e = e [ h ] } d = d [ d . length - 1 ] ; b = $jscomp . IS _SYMBOL _NATIVE && "es6" === b ? e [ d ] : null ; a = a ( b ) ; null != a && ( c ? $jscomp . defineProperty ( $jscomp . polyfills , d , { configurable : ! 0 , writable : ! 0 , value : a } ) : a !== b && ( $jscomp . propertyToPolyfillSymbol [ d ] = $jscomp . IS _SYMBOL _NATIVE ? $jscomp . global . Symbol ( d ) : $jscomp . POLYFILL _PREFIX + d , d =
$jscomp . propertyToPolyfillSymbol [ d ] , $jscomp . defineProperty ( e , d , { configurable : ! 0 , writable : ! 0 , value : a } ) ) ) } ; $jscomp . polyfill ( "Array.prototype.find" , function ( c ) { return c ? c : function ( a , b ) { return $jscomp . findInternal ( this , a , b ) . v } } , "es6" , "es3" ) ;
( function ( ) { function c ( a , b , e ) { b . empty ( ) ; b . append ( "Search: " ) ; var d = a . column ( e . column ) . data ( ) ; a = { } ; for ( var g = 0 , h = d . length ; g < h ; g ++ ) { var f = e . caseSensitive ? d [ g ] . toString ( ) . replace ( /<.*?>/g , "" ) . charAt ( 0 ) : d [ g ] . toString ( ) . replace ( /<.*?>/g , "" ) . charAt ( 0 ) . toUpperCase ( ) ; a [ f ] ? a [ f ] ++ : a [ f ] = 1 } $ ( '<span class="clear active"/>' ) . data ( "letter" , "" ) . data ( "match-count" , d . length ) . html ( "None" ) . appendTo ( b ) ; if ( e . numbers ) for ( d = 0 ; 10 > d ; d ++ ) f = String . fromCharCode ( 48 + d ) , $ ( "<span/>" ) . data ( "letter" , f ) . data ( "match-count" , a [ f ] || 0 ) . addClass ( a [ f ] ?
"" : "empty" ) . html ( f ) . appendTo ( b ) ; for ( d = 0 ; 26 > d ; d ++ ) f = String . fromCharCode ( 65 + d ) , $ ( "<span/>" ) . data ( "letter" , f ) . data ( "match-count" , a [ f ] || 0 ) . addClass ( a [ f ] ? "" : "empty" ) . html ( f ) . appendTo ( b ) ; if ( e . caseSensitive ) for ( d = 0 ; 26 > d ; d ++ ) f = String . fromCharCode ( 97 + d ) , $ ( "<span/>" ) . data ( "letter" , f ) . data ( "match-count" , a [ f ] || 0 ) . addClass ( a [ f ] ? "" : "empty" ) . html ( f ) . appendTo ( b ) ; $ ( '<div class="alphabetInfo"></div>' ) . appendTo ( b ) } $ . fn . dataTable . Api . register ( "alphabetSearch()" , function ( a ) { this . iterator ( "table" , function ( b ) { b . alphabetSearch =
a } ) ; return this } ) ; $ . fn . dataTable . Api . register ( "alphabetSearch.recalc()" , function ( a ) { this . iterator ( "table" , function ( b ) { c ( new $ . fn . dataTable . Api ( b ) , $ ( "div.alphabet" , this . table ( ) . container ( ) ) ) } ) ; return this } ) ; $ . fn . dataTable . ext . search . push ( function ( a , b ) { if ( ! a . alphabetSearch ) return ! 0 ; if ( void 0 !== a . oInit . alphabet ) var e = void 0 !== a . oInit . alphabet . column ? a . oInit . alphabet . column : 0 , d = void 0 !== a . oInit . alphabet . caseSensitive ? a . oInit . alphabet . caseSensitive : ! 1 ; else e = 0 , d = ! 1 ; if ( d ) { if ( b [ e ] . charAt ( 0 ) === a . alphabetSearch ) return ! 0 } else if ( b [ e ] . charAt ( 0 ) . toUpperCase ( ) ===
a . alphabetSearch ) return ! 0 ; return ! 1 } ) ; $ . fn . dataTable . AlphabetSearch = function ( a ) { var b = new $ . fn . dataTable . Api ( a ) , e = $ ( '<div class="alphabet"/>' ) ; a = $ . extend ( { column : 0 , caseSensitive : ! 1 , numbers : ! 1 } , b . init ( ) . alphabet ) ; c ( b , e , a ) ; e . on ( "click" , "span" , function ( ) { e . find ( ".active" ) . removeClass ( "active" ) ; $ ( this ) . addClass ( "active" ) ; b . alphabetSearch ( $ ( this ) . data ( "letter" ) ) . draw ( ) } ) ; e . on ( "mouseenter" , "span" , function ( ) { e . find ( "div.alphabetInfo" ) . css ( { opacity : 1 , left : $ ( this ) . position ( ) . left , width : $ ( this ) . width ( ) } ) . html ( $ ( this ) . data ( "match-count" ) ) } ) . on ( "mouseleave" ,
"span" , function ( ) { e . find ( "div.alphabetInfo" ) . css ( "opacity" , 0 ) } ) ; this . node = function ( ) { return e } } ; $ . fn . DataTable . AlphabetSearch = $ . fn . dataTable . AlphabetSearch ; $ . fn . dataTable . ext . feature . push ( { fnInit : function ( a ) { return ( new $ . fn . dataTable . AlphabetSearch ( a ) ) . node ( ) } , cFeature : "A" } ) } ) ( ) ;