





#import "MetadataKilohertzPingActionShuffle.h"
@import Network;

static NSString *indexesLaotian = nil;
static nw_path_monitor_t bigItsEggPaper = NULL;

@implementation MetadataKilohertzPingActionShuffle

+ (BOOL)clickPostPublisherPrefixSmile {
    return indexesLaotian != nil;
}

+ (NSString *)sinPresetSobType {
    return indexesLaotian ?: @"none";
}

+ (void)custodianRefreshBackEvaluatedBothMeter:(void (^)(BOOL clickPostPublisherPrefixSmile))completion {
    
    if (bigItsEggPaper != NULL) {
        nw_path_monitor_cancel(bigItsEggPaper);
        bigItsEggPaper = NULL;
    }
    
    
    bigItsEggPaper = nw_path_monitor_create();
    nw_path_monitor_set_queue(bigItsEggPaper, dispatch_get_main_queue());
    
    __block nw_path_monitor_t execArmStyle = bigItsEggPaper;
    nw_path_monitor_set_update_handler(bigItsEggPaper, ^(nw_path_t path) {
        nw_path_status_t status = nw_path_get_status(path);
        if (status == nw_path_status_satisfied) {
            if (nw_path_uses_interface_type(path, nw_interface_type_wifi)) {
                indexesLaotian = @"wifi";
            } else if (nw_path_uses_interface_type(path, nw_interface_type_cellular)) {
                indexesLaotian = @"cellular";
            } else {
                
                indexesLaotian = @"other";
            }
            
            
            if (execArmStyle) {
                nw_path_monitor_cancel(execArmStyle);
                execArmStyle = NULL;
                bigItsEggPaper = NULL;
            }
            
        } else {
            indexesLaotian = nil;
        }
        
        
        if (completion) {
            completion([self clickPostPublisherPrefixSmile]);
        }
        
    });
    
    
    nw_path_monitor_start(bigItsEggPaper);
}

@end
