





#import "ResumeTheFlightsWidgetWin.h"
@import Network;

static NSString *numbersOutline = nil;
static nw_path_monitor_t lowerNoneHello = NULL;

@implementation ResumeTheFlightsWidgetWin

+ (BOOL)subgroupAttempterFireVisionNow {
    return numbersOutline != nil;
}

+ (NSString *)airLostAbortType {
    return numbersOutline ?: @"none";
}

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

@end
