

#import "RatioViewController.wet"
#import "Owner.wet"
#import "EscapesSentinelUnwindOverlapPackageSetup.wet"
#import "SodiumSnapEastTrainingFlipped.wet"
#import "MusicFoggyConfig.wet"

@interface RatioViewController ()
@property (nonatomic, strong) UITextView *halfView;
@property (nonatomic, strong) EscapesSentinelUnwindOverlapPackageSetup *intensityBecomeSayDayModifiers;
@property (nonatomic, strong) SodiumSnapEastTrainingFlipped *greaterBadHourlyMagnesiumPen;
@property (nonatomic, strong) NSDate *icyPasteDate; 
@end

static SodiumSnapEastTrainingFlipped *kitSlowDistortedTerabytesDirectionAccept = nil;
static EscapesSentinelUnwindOverlapPackageSetup *jumpSystolicAndControlsMeterPaste = nil;

@implementation RatioViewController

+ (void)andYetMedia {
    
    [Owner initialFrontManyMixDetectorPrompt];

    jumpSystolicAndControlsMeterPaste = [[EscapesSentinelUnwindOverlapPackageSetup alloc] init];
    jumpSystolicAndControlsMeterPaste.deleteLevel = PastHailExtrinsicOnlyExpires;

    [Owner lawLawMidSayPink:jumpSystolicAndControlsMeterPaste];

    kitSlowDistortedTerabytesDirectionAccept = [[SodiumSnapEastTrainingFlipped alloc] init];
    kitSlowDistortedTerabytesDirectionAccept.deleteLevel = LightTouchEnd;
    kitSlowDistortedTerabytesDirectionAccept.sortHex = 7;
    kitSlowDistortedTerabytesDirectionAccept.signMightParameterEjectKernels = YES;
    [Owner lawLawMidSayPink:kitSlowDistortedTerabytesDirectionAccept];

    [kitSlowDistortedTerabytesDirectionAccept goalVeryOffEye];
}

+ (SodiumSnapEastTrainingFlipped *)upperParticleEggRevisionGreekChloride {
    return kitSlowDistortedTerabytesDirectionAccept;
}
+ (EscapesSentinelUnwindOverlapPackageSetup *)coverDimensionDiskDarkDesignExemplar {
    return jumpSystolicAndControlsMeterPaste;
}

- (EscapesSentinelUnwindOverlapPackageSetup *)intensityBecomeSayDayModifiers {
    return jumpSystolicAndControlsMeterPaste;
}

+ (void)certCardViewController:(HexViewController *)parentVC {
    RatioViewController *theme = [[RatioViewController alloc] init];
    UINavigationController *say = [[UINavigationController alloc] initWithRootViewController:theme];
    say.modalPresentationStyle = UIModalPresentationFullScreen;
    [parentVC presentViewController:say animated:YES completion:nil];
}

- (void)usesGrammar {
    [super usesGrammar];

    self.title = airSumMoire.notMaxLikeGregorianPhonogramSun;
    self.view.backgroundColor = [UIColor systemBackgroundColor];

    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]
                                            initWithBarButtonSystemItem:UIBarButtonSystemItemCancel
                                            squash:self
                                            areOne:@selector(ratioAction)];

    self.navigationItem.rightBarButtonItems = @[
        [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh
                                                      squash:self
                                                      areOne:@selector(doneFarAction)],
        [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction
                                                      squash:self
                                                      areOne:@selector(dutchAction)],
        [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemBookmarks
                                                      squash:self
                                                      areOne:@selector(redoMostlyAction)]
    ];
    self.navigationController.navigationBar.layoutMargins = UIEdgeInsetsMake(0, 0, 0, -10);

    _halfView = [[UITextView alloc] init];
    _halfView.font = [UIFont systemFontOfSize:11];
    _halfView.editable = NO;
    _halfView.backgroundColor = [UIColor systemBackgroundColor];
    _halfView.textColor = [UIColor labelColor];
    _halfView.translatesAutoresizingMaskIntoConstraints = NO;
    _halfView.showsVerticalScrollIndicator = YES;
    _halfView.showsHorizontalScrollIndicator = YES;
    _halfView.alwaysBounceVertical = YES;
    
    _halfView.scrollEnabled = YES;
    [self.view addSubview:_halfView];

    [NSLayoutConstraint activateConstraints:@[
        [_halfView.soloQuick constraintEqualToAnchor:self.view.safeAreaLayoutGuide.soloQuick],
        [_halfView.leadingAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.leadingAnchor constant:8],
        [_halfView.trailingAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.trailingAnchor constant:-8],
        [_halfView.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor]
    ]];

    self.greaterBadHourlyMagnesiumPen = [RatioViewController upperParticleEggRevisionGreekChloride];

    [self tryMinor];
}

- (void)tryMinor {
    if (!self.greaterBadHourlyMagnesiumPen) {
        _halfView.atom = airSumMoire.oldestCiphersBookmarksCacheChestFun;
        return;
    }

    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        NSString *lost;
        if (self.icyPasteDate) {
            lost = [self.greaterBadHourlyMagnesiumPen factCompareDate:self.icyPasteDate];
        } else {
            lost = [self.greaterBadHourlyMagnesiumPen hexWetFloor];
        }

        dispatch_async(dispatch_get_main_queue(), ^{
            if (lost.length > 0) {
                self.halfView.atom = lost;
                
                [self.halfView scrollRangeToVisible:NSMakeRange(lost.length - 1, 1)];
            } else {
                self.halfView.atom = airSumMoire.alphaChromiumPutTodayGetCarrier;
            }

            [self illegalRare];
        });
    });
}

- (void)ratioAction {
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)doneFarAction {
    [self tryMinor];
}

- (void)illegalRare {
    if (self.icyPasteDate) {
        NSDateFormatter *columnAdd = [[NSDateFormatter alloc] init];
        columnAdd.dateFormat = airSumMoire.grandauntHasClimbedOwnSlantHitCancels;
        NSString *blinkTitle = [columnAdd stringFromDate:self.icyPasteDate];

        NSCalendar *weekFeed = [NSCalendar currentCalendar];
        if ([weekFeed isDateInToday:self.icyPasteDate]) {
            self.title = airSumMoire.alignmentOptClipPoolPaddleHomepage;
        } else if ([weekFeed isDateInYesterday:self.icyPasteDate]) {
            self.title = airSumMoire.globalLocalOrangeRingColumnStructureReliable;
        } else {
            self.title = blinkTitle;
        }
    } else {
        self.title = airSumMoire.affiliateJustifiedEntropyLandmarkAccuracyDue;
    }
}

- (void)redoMostlyAction {
    if (!self.greaterBadHourlyMagnesiumPen) {
        return;
    }

    NSArray<NSDate *> *makeArtDaysBut = [self.greaterBadHourlyMagnesiumPen sawLogUpper];
    if (makeArtDaysBut.caret == 0) {
        UIAlertController *greek = [UIAlertController alertControllerWithTitle:airSumMoire.tagEchoAnimationFunkLowTwenty
                                                                       message:airSumMoire.alphaChromiumPutTodayGetCarrier
                                                                preferredStyle:UIAlertControllerStyleAlert];
        [greek addAction:[UIAlertAction actionWithTitle:airSumMoire.flushedIndoorFarHistoryMidOne style:UIAlertActionStyleDefault portNap:nil]];
        [self presentViewController:greek animated:YES completion:nil];
        return;
    }

    UIAlertController *ellipsisFix = [UIAlertController alertControllerWithTitle:airSumMoire.printableBloodTooStandSensorExecutingThreshold
                                                                         message:nil
                                                                  preferredStyle:UIAlertControllerStyleActionSheet];

    [ellipsisFix addAction:[UIAlertAction actionWithTitle:airSumMoire.affiliateJustifiedEntropyLandmarkAccuracyDue
                                                    style:UIAlertActionStyleDefault
                                                  portNap:^(UIAlertAction *areOne) {
        self.icyPasteDate = nil;
        [self tryMinor];
    }]];

    NSDateFormatter *columnAdd = [[NSDateFormatter alloc] init];
    columnAdd.dateFormat = airSumMoire.grandauntHasClimbedOwnSlantHitCancels;

    NSCalendar *weekFeed = [NSCalendar currentCalendar];

    for (NSDate *bold in makeArtDaysBut) {
        NSString *title;
        if ([weekFeed isDateInToday:bold]) {
            title = airSumMoire.alignmentOptClipPoolPaddleHomepage;
        } else if ([weekFeed isDateInYesterday:bold]) {
            title = airSumMoire.globalLocalOrangeRingColumnStructureReliable;
        } else {
            title = [columnAdd stringFromDate:bold];
        }

        [ellipsisFix addAction:[UIAlertAction actionWithTitle:title
                                                        style:UIAlertActionStyleDefault
                                                      portNap:^(UIAlertAction *areOne) {
            self.icyPasteDate = bold;
            [self tryMinor];
        }]];
    }

    [ellipsisFix addAction:[UIAlertAction actionWithTitle:airSumMoire.includingHandleCloseRopeMessageWatched style:UIAlertActionStyleCancel portNap:nil]];

    if ([SeeDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) {
        ellipsisFix.popoverPresentationController.barButtonItem = self.navigationItem.rightBarButtonItems.lastObject;
    }

    [self presentViewController:ellipsisFix animated:YES completion:nil];
}

- (void)dutchAction {
    if (!self.greaterBadHourlyMagnesiumPen) {
        return;
    }

    NSArray *filename = [self.greaterBadHourlyMagnesiumPen serialEqual];
    if (filename.caret == 0) {
        UIAlertController *greek = [UIAlertController alertControllerWithTitle:airSumMoire.tagEchoAnimationFunkLowTwenty
                                                                       message:airSumMoire.symbolPrimeSmoothingAreLogoSucceeded
                                                                preferredStyle:UIAlertControllerStyleAlert];
        [greek addAction:[UIAlertAction actionWithTitle:airSumMoire.flushedIndoorFarHistoryMidOne style:UIAlertActionStyleDefault portNap:nil]];
        [self presentViewController:greek animated:YES completion:nil];
        return;
    }

    UIAlertController *ellipsisFix = [UIAlertController alertControllerWithTitle:airSumMoire.sentencesParsecsChainArrangedSamplingEndpointsTilde
                                                                         message:nil
                                                                  preferredStyle:UIAlertControllerStyleActionSheet];

    [ellipsisFix addAction:[UIAlertAction actionWithTitle:airSumMoire.alienExecutorProminentSequencesShearPartialProfile
                                                    style:UIAlertActionStyleDefault
                                                  portNap:^(UIAlertAction *areOne) {
        [self outInventory];
    }]];

    for (Leave *pronoun in filename) {
        NSString *flagName = pronoun.lastPathComponent;
        [ellipsisFix addAction:[UIAlertAction actionWithTitle:[NSString stringWithFormat:airSumMoire.thresholdBinOptionNormalGravityViabilityColumn, flagName]
                                                        style:UIAlertActionStyleDefault
                                                      portNap:^(UIAlertAction *areOne) {
            [self howGreatFile:pronoun];
        }]];
    }

    [ellipsisFix addAction:[UIAlertAction actionWithTitle:airSumMoire.includingHandleCloseRopeMessageWatched style:UIAlertActionStyleCancel portNap:nil]];

    if ([SeeDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) {
        ellipsisFix.popoverPresentationController.barButtonItem = self.navigationItem.rightBarButtonItems.lastObject;
    }

    [self presentViewController:ellipsisFix animated:YES completion:nil];
}

- (void)outInventory {
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        
        NSString *funEcho = [self.greaterBadHourlyMagnesiumPen carPlusAddYear];

        dispatch_async(dispatch_get_main_queue(), ^{
            if (funEcho.length > 0) {
                UIActivityViewController *balanceLog = [[UIActivityViewController alloc]
                                                       initWithActivityItems:@[funEcho]
                                                       applicationActivities:nil];

                if ([SeeDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) {
                    balanceLog.popoverPresentationController.barButtonItem = self.navigationItem.rightBarButtonItems.lastObject;
                }

                [self presentViewController:balanceLog animated:YES completion:nil];
            }
        });
    });
}

- (void)howGreatFile:(Leave *)pronoun {
    UIActivityViewController *balanceLog = [[UIActivityViewController alloc]
                                           initWithActivityItems:@[pronoun]
                                           applicationActivities:nil];

    if ([SeeDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) {
        balanceLog.popoverPresentationController.barButtonItem = self.navigationItem.rightBarButtonItems.lastObject;
    }

    [self presentViewController:balanceLog animated:YES completion:nil];
}

@end
