( function ( $ ) {
	'use strict';

	// Handle notice dismiss button click
	$( document ).on( 'click', '.notice-info .notice-dismiss', function () {
		var type = $( this ).closest( '.notice-info' ).data( 'notice' );
		if ( ! type ) {
			return;
		}
		$.ajax( {
			type: 'POST',
			url: ngo_charity_donation_localize.ajax_url,
			data: {
				action: 'ngo_charity_donation_dismissed_notice_handler',
				type: type,
				wpnonce: ngo_charity_donation_localize.dismiss_nonce
			}
		} );
	} );

} )( jQuery );