






#import "SendBoostViewController.h"
#import "ShortcutsNapObscuredBuildRatioHandler.h"

@interface SendBoostViewController ()<WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler>

@end

@implementation SendBoostViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.familyStayButton.hidden = YES;
    self.sentSlideButton.hidden = YES;
    [self turnForkTwistView];
}

- (void)turnForkTwistView
{
    WKUserContentController *brownPeakJoule = [[WKUserContentController alloc] init];
    WKUserScript *softBackup = [[WKUserScript alloc] initWithSource:WetDoneFill.artSensitive.buttonsHeadsetRoomUtilitiesSpeak injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES];
    [brownPeakJoule addUserScript:softBackup];
    
    WKWebViewConfiguration * config = [[WKWebViewConfiguration alloc] init];
    WKPreferences *raceSinHex = [[WKPreferences alloc]init];
    raceSinHex.javaScriptCanOpenWindowsAutomatically = YES;
    raceSinHex.minimumFontSize = 40.0;
    raceSinHex.javaScriptEnabled = YES;
    config.preferences = raceSinHex;
    config.selectionGranularity = WKSelectionGranularityDynamic;
    config.preferences.minimumFontSize = 18;
    config.preferences.javaScriptEnabled = YES;
    config.userContentController = brownPeakJoule;
    
    self.airCivilNow = [[WKWebView alloc] initWithFrame:CGRectZero];
    self.airCivilNow.backgroundColor = UIColor.clearColor;
    self.airCivilNow.scrollView.backgroundColor = UIColor.clearColor;
    self.airCivilNow.navigationDelegate = self;
    self.airCivilNow.opaque = YES;
    self.airCivilNow.scrollView.bounces = NO;
    self.airCivilNow.scrollView.showsVerticalScrollIndicator = NO;
    self.airCivilNow.scrollView.showsHorizontalScrollIndicator = NO;
    self.airCivilNow.UIDelegate = self;
    [self.view addSubview:self.airCivilNow];
    self.airCivilNow.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    
    
    ShortcutsNapObscuredBuildRatioHandler *boxHello = [[ShortcutsNapObscuredBuildRatioHandler alloc] initWithDelegate:self];
    ShortcutsNapObscuredBuildRatioHandler *sugarBin = [[ShortcutsNapObscuredBuildRatioHandler alloc] initWithDelegate:self];
    
    [self.airCivilNow.configuration.userContentController addScriptMessageHandler:boxHello name:WetDoneFill.artSensitive.updatingPrecisionRebusTrackLongitude];
    [self.airCivilNow.configuration.userContentController addScriptMessageHandler:sugarBin name:WetDoneFill.artSensitive.nowChineseLastHoverPresentedItsLicense];
}

- (void)setImpliedBody:(NSString *)impliedBody {
    _impliedBody = impliedBody;
    NSURL *url = [NSURL URLWithString:impliedBody];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
    [request addValue:[WetDoneFill prettyLogAmbiguousPenSchemeToken] forHTTPHeaderField:WetDoneFill.artSensitive.unfocusedObservedPaperBitDate];
    [self.airCivilNow loadRequest:request];
}

- (void)invitedNorthLowGravityMaskOuterJoining:(NSURL *)URL {
    if ([self.notHerFoldOld respondsToSelector:@selector(bigNoteView:copperFailAction:son:)]) {
        [self.notHerFoldOld bigNoteView:self.airCivilNow copperFailAction:URL.host son:URL];
    }
}



- (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler {
    decisionHandler(WKNavigationResponsePolicyAllow);
}


- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
    NSURL *URL = navigationAction.request.URL;
    
    if ([URL.scheme hasPrefix:WetDoneFill.artSensitive.logPager]) {
        [self invitedNorthLowGravityMaskOuterJoining:URL];
        decisionHandler(WKNavigationActionPolicyCancel);
        return;
    }
    decisionHandler(WKNavigationActionPolicyAllow);
}


-(void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{

}


- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation{
    

}


-(void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation {
    
    [webView evaluateJavaScript:WetDoneFill.artSensitive.intensityPairHoldLowerMonthGenre completionHandler:nil];
    
    [webView evaluateJavaScript:WetDoneFill.artSensitive.logoGolfEvictStrictButBorder completionHandler:nil];
    [webView evaluateJavaScript:WetDoneFill.artSensitive.installsCropBufferingWonAudio completionHandler:nil];
    
    [WristInferView panProcessScrollReferenceProcessesView:self.view];
    while (self.airCivilNow.isLoading) {
        return;
    }
}


- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message {
    
    
    if ([self.notHerFoldOld respondsToSelector:@selector(bigNoteView:copperFailAction:son:)]) {
        [self.notHerFoldOld bigNoteView:self.airCivilNow copperFailAction:message.name son:message.body];
    }
}

-(void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler{
    
    [MidAlertView contactCenteredRenewingBeginRingCover:@"" message:message completion:^(NSInteger syntaxIndex) {
        completionHandler();
    }];
}



- (WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures{
    WKFrameInfo *frameInfo = navigationAction.targetFrame;
    if (![frameInfo isMainFrame]) {
        [webView loadRequest:navigationAction.request];
    }
    return nil;
}


- (void)webView:(WKWebView *)webView runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(nullable NSString *)defaultText initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(NSString * __nullable result))completionHandler{
    completionHandler(WetDoneFill.artSensitive.busyChannels);
}


- (void)webView:(WKWebView *)webView runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(BOOL result))completionHandler{
    completionHandler(YES);
}

- (void)dealloc {
    self.airCivilNow.UIDelegate = nil;
    self.view = nil;
    [self.airCivilNow.configuration.userContentController removeAllUserScripts];
}

@end
