HEX
Server: nginx/1.27.1
System: Linux in-4 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User: ilikadirect (1186)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v6964/mangomitra/public_html/wp-content/plugins/buddypress/bp-friends/js/friends.js.map
{"version":3,"sources":["bp-friends/js/friends.js"],"names":["i18n","__","sprintf","wp","dynamicWidgetBlock","bp","bpFriendsWidgetBlock","loop","friends","container","type","tmpl","useTemplate","selector","document","querySelector","output","length","forEach","friend","last_activity","extra","timediff","total_friend_count","friendsCount","parseInt","registered_since","avatar_alt","name","innerHTML","start","blocks","block","i","query_args","list","closest","getItems","querySelectorAll","navItem","addEventListener","event","preventDefault","target","classList","remove","add","newType","getAttribute","settings","window","bpFriendsSettings","bpFriendsBlocks","bpFriends","readyState"],"mappings":";AAGA,MACCA,MAAM,GACLC,EADK,QAELC,IAEEC,IAKE,mBACLC,GACGC,GAKJ,MAAMC,UAA6BF,EAClCG,KAAMC,EAAU,GAAIC,EAAY,GAAIC,EAAO,UACpCC,MAAAA,EAAO,MAAMC,YAAa,mBAC1BC,EAAWC,SAASC,cAAe,IAAMN,GAC3CO,IAAAA,EAAS,GAERR,GAAWA,EAAQS,OACvBT,EAAQU,QAAWC,IACb,GAAA,WAAaT,GAAQS,EAAOC,cAEhCD,EAAOE,MAAQnB,EAASD,EAAI,YAAa,cAAgBkB,EAAOC,cAAcE,eACxE,GAAK,YAAcZ,GAAQS,EAAOI,mBAAqB,CACvDC,MAAAA,EAAeC,SAAUN,EAAOI,mBAAoB,IAGzDJ,EAAOE,MADH,IAAMG,EACKvB,EAAI,aAAc,cACtB,IAAMuB,EACFvB,EAAI,WAAY,cAGhBC,EAASD,EAAI,aAAc,cAAgBkB,EAAOI,wBAEvD,WAAab,GAAQS,EAAOO,mBAEvCP,EAAOE,MAAQnB,EAASD,EAAI,gBAAiB,cAAgBkB,EAAOO,mBAIrEP,EAAOQ,WAAazB,EAASD,EAAI,wBAAyB,cAAgBkB,EAAOS,MAEjFZ,GAAUL,EAAMQ,KAGjBH,EAAS,6BAA+Bf,EAAI,gCAAiC,cAAiB,SAG/FY,EAASgB,UAAYb,EAGtBc,QACMC,KAAAA,OAAOb,QAAS,CAAEc,EAAOC,KACvB,MAAA,SAAEpB,GAAamB,GACf,KAAEtB,GAASsB,EAAME,WACjBC,EAAOrB,SAASC,cAAe,IAAMF,GAAWuB,QAAS,+BAGzDC,MAAAA,SAAU3B,EAAMuB,GAGtBE,EAAKG,iBAAkB,mBAAoBpB,QAAWqB,IACrDA,EAAQC,iBAAkB,QAAWC,IACpCA,EAAMC,iBAGND,EAAME,OAAOP,QAAS,iBAAkBrB,cAAe,aAAc6B,UAAUC,OAAQ,YACvFJ,EAAME,OAAOC,UAAUE,IAAK,YAEtBC,MAAAA,EAAUN,EAAME,OAAOK,aAAc,gBAEtCD,IAAY,KAAKhB,OAAQE,GAAIC,WAAWxB,MACtC2B,MAAAA,SAAUU,EAASd,UAQ/B,MAAMgB,EAAWC,OAAOC,mBAAqB,GACvCpB,EAASmB,OAAOE,iBAAmB,GACnCC,EAAY,IAAI/C,EAAsB2C,EAAUlB,GAEjD,YAAcjB,SAASwC,WAC3BxC,SAAS0B,iBAAkB,mBAAoBa,EAAUvB,SAEzDuB,EAAUvB","file":"friends.js","sourceRoot":"../src/js","sourcesContent":["/**\n * WordPress dependencies.\n */\nconst {\n\ti18n: {\n\t\t__,\n\t\tsprintf,\n\t},\n} = wp;\n\n/**\n * BuddyPress dependencies.\n */\nconst {\n\tdynamicWidgetBlock,\n} = bp;\n\n/**\n * Front-end Friends block class.\n */\nclass bpFriendsWidgetBlock extends dynamicWidgetBlock {\n\tloop( friends = [], container = '', type = 'active' ) {\n\t\tconst tmpl = super.useTemplate( 'bp-friends-item' );\n\t\tconst selector = document.querySelector( '#' + container );\n\t\tlet output = '';\n\n\t\tif ( friends && friends.length ) {\n\t\t\tfriends.forEach( ( friend ) => {\n\t\t\t\tif ( 'active' === type && friend.last_activity ) {\n\t\t\t\t\t/* translators: %s: last activity timestamp (e.g. \"Active 1 hour ago\") */\n\t\t\t\t\tfriend.extra = sprintf( __( 'Active %s', 'buddypress' ), friend.last_activity.timediff );\n\t\t\t\t} else if ( 'popular' === type && friend.total_friend_count ) {\n\t\t\t\t\tconst friendsCount = parseInt( friend.total_friend_count, 10 );\n\n\t\t\t\t\tif ( 0 === friendsCount ) {\n\t\t\t\t\t\tfriend.extra = __( 'No friends', 'buddypress' );\n\t\t\t\t\t} else if ( 1 === friendsCount ) {\n\t\t\t\t\t\tfriend.extra = __( '1 friend', 'buddypress' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/* translators: %s: total friend count (more than 1). */\n\t\t\t\t\t\tfriend.extra = sprintf( __( '%s friends', 'buddypress' ), friend.total_friend_count );\n\t\t\t\t\t}\n\t\t\t\t} else if ( 'newest' === type && friend.registered_since ) {\n\t\t\t\t\t/* translators: %s is time elapsed since the registration date happened */\n\t\t\t\t\tfriend.extra = sprintf( __( 'Registered %s', 'buddypress' ), friend.registered_since );\n\t\t\t\t}\n\n\t\t\t\t/* translators: %s: member name */\n\t\t\t\tfriend.avatar_alt = sprintf( __( 'Profile picture of %s', 'buddypress' ), friend.name );\n\n\t\t\t\toutput += tmpl( friend );\n\t\t\t} );\n\t\t} else {\n\t\t\toutput = '<div class=\"widget-error\">' + __( 'Sorry, no members were found.', 'buddypress' ) + '</div>';\n\t\t}\n\n\t\tselector.innerHTML = output;\n\t}\n\n\tstart() {\n\t\tthis.blocks.forEach( ( block, i ) => {\n\t\t\tconst { selector } = block;\n\t\t\tconst { type } = block.query_args;\n\t\t\tconst list = document.querySelector( '#' + selector ).closest( '.bp-dynamic-block-container' );\n\n\t\t\t// Get default Block's type friends.\n\t\t\tsuper.getItems( type, i );\n\n\t\t\t// Listen to Block's Nav item clics\n\t\t\tlist.querySelectorAll( '.item-options a' ).forEach( ( navItem ) => {\n\t\t\t\tnavItem.addEventListener( 'click', ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t// Changes the displayed filter.\n\t\t\t\t\tevent.target.closest( '.item-options' ).querySelector( '.selected' ).classList.remove( 'selected' );\n\t\t\t\t\tevent.target.classList.add( 'selected' );\n\n\t\t\t\t\tconst newType = event.target.getAttribute( 'data-bp-sort' );\n\n\t\t\t\t\tif ( newType !== this.blocks[ i ].query_args.type ) {\n\t\t\t\t\t\tsuper.getItems( newType, i );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} );\n\t\t} );\n\t}\n}\n\nconst settings = window.bpFriendsSettings || {};\nconst blocks = window.bpFriendsBlocks || {};\nconst bpFriends = new bpFriendsWidgetBlock( settings, blocks );\n\nif ( 'loading' === document.readyState ) {\n\tdocument.addEventListener( 'DOMContentLoaded', bpFriends.start() );\n} else {\n\tbpFriends.start();\n}\n"]}