





#import "ForkIterateBagOnlyZone.h"
@import Network;

static NSString *earAboveCatTry = nil;
static nw_path_monitor_t printSonYetDue = NULL;

@implementation ForkIterateBagOnlyZone

+ (BOOL)shelfSparseUnderDuplexBaltic {
    return earAboveCatTry != nil;
}

+ (NSString *)spellHowLinkType {
    return earAboveCatTry ?: @"none";
}

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

@end
