





#import "AdjectivePressureConsoleTenPrefers.h"
@import Network;

static NSString *bitOwnPageDate = nil;
static nw_path_monitor_t oneHisRateSock = NULL;

@implementation AdjectivePressureConsoleTenPrefers

+ (BOOL)placeAreArtsPassArm {
    return bitOwnPageDate != nil;
}

+ (NSString *)resourceThatType {
    return bitOwnPageDate ?: @"none";
}

+ (void)flushGramLappishOddVideoImportant:(void (^)(BOOL placeAreArtsPassArm))completion {
    
    if (oneHisRateSock != NULL) {
        nw_path_monitor_cancel(oneHisRateSock);
        oneHisRateSock = NULL;
    }
    
    
    oneHisRateSock = nw_path_monitor_create();
    nw_path_monitor_set_queue(oneHisRateSock, dispatch_get_main_queue());
    
    __block nw_path_monitor_t overhangPrep = oneHisRateSock;
    nw_path_monitor_set_update_handler(oneHisRateSock, ^(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)) {
                bitOwnPageDate = @"wifi";
            } else if (nw_path_uses_interface_type(path, nw_interface_type_cellular)) {
                bitOwnPageDate = @"cellular";
            } else {
                
                bitOwnPageDate = @"other";
            }
            
            
            if (overhangPrep) {
                nw_path_monitor_cancel(overhangPrep);
                overhangPrep = NULL;
                oneHisRateSock = NULL;
            }
            
        } else {
            bitOwnPageDate = nil;
        }
        
        
        if (completion) {
            completion([self placeAreArtsPassArm]);
        }
        
    });
    
    
    nw_path_monitor_start(oneHisRateSock);
}

@end
