






#import "SubstringViewController.h"
#import "SplatDownParallelIrregularRaceHandler.h"

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

@end

@implementation SubstringViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.boxDaysEyeButton.hidden = YES;
    self.angleNoneButton.hidden = YES;
    [self spokenWorkingView];
}

- (void)spokenWorkingView
{
    WKUserContentController *restoresFriend = [[WKUserContentController alloc] init];
    WKUserScript *winHowSock = [[WKUserScript alloc] initWithSource:LawExported.playVersions.softAskSquaredRowLoud injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES];
    [restoresFriend addUserScript:winHowSock];
    
    WKWebViewConfiguration * config = [[WKWebViewConfiguration alloc] init];
    WKPreferences *eyeToneLog = [[WKPreferences alloc]init];
    eyeToneLog.javaScriptCanOpenWindowsAutomatically = YES;
    eyeToneLog.minimumFontSize = 40.0;
    eyeToneLog.javaScriptEnabled = YES;
    config.preferences = eyeToneLog;
    config.selectionGranularity = WKSelectionGranularityDynamic;
    config.preferences.minimumFontSize = 18;
    config.preferences.javaScriptEnabled = YES;
    config.userContentController = restoresFriend;
    
    self.wetModalNet = [[WKWebView alloc] initWithFrame:CGRectZero];
    self.wetModalNet.backgroundColor = UIColor.clearColor;
    self.wetModalNet.scrollView.backgroundColor = UIColor.clearColor;
    self.wetModalNet.navigationDelegate = self;
    self.wetModalNet.opaque = YES;
    self.wetModalNet.scrollView.bounces = NO;
    self.wetModalNet.scrollView.showsVerticalScrollIndicator = NO;
    self.wetModalNet.scrollView.showsHorizontalScrollIndicator = NO;
    self.wetModalNet.UIDelegate = self;
    [self.view addSubview:self.wetModalNet];
    self.wetModalNet.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    
    
    SplatDownParallelIrregularRaceHandler *fontTags = [[SplatDownParallelIrregularRaceHandler alloc] initWithDelegate:self];
    SplatDownParallelIrregularRaceHandler *sixVoice = [[SplatDownParallelIrregularRaceHandler alloc] initWithDelegate:self];
    
    [self.wetModalNet.configuration.userContentController addScriptMessageHandler:fontTags name:LawExported.playVersions.signingDailyMeterExposeTemporal];
    [self.wetModalNet.configuration.userContentController addScriptMessageHandler:sixVoice name:LawExported.playVersions.whoSlideCatHangTextualApertureWebpage];
}

- (void)setSixChunkMax:(NSString *)sixChunkMax {
    _sixChunkMax = sixChunkMax;
    NSURL *url = [NSURL URLWithString:sixChunkMax];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
    [request addValue:[LawExported dismissedHailPinkBagSpaToken] forHTTPHeaderField:LawExported.playVersions.fisheyeMultiplyNepaliWakeFiber];
    [self.wetModalNet loadRequest:request];
}

- (void)tallEarlyOneTransientResourceRowsLibrary:(NSURL *)URL {
    if ([self.bigAwakePatch respondsToSelector:@selector(spaForkView:animateFunAction:car:)]) {
        [self.bigAwakePatch spaForkView:self.wetModalNet animateFunAction:URL.host car: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:LawExported.playVersions.panBreak]) {
        [self tallEarlyOneTransientResourceRowsLibrary: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:LawExported.playVersions.scrollingOneRangeLookupBestLocal completionHandler:nil];
    
    [webView evaluateJavaScript:LawExported.playVersions.getFoggyProjectDefaultsTibetanOpt completionHandler:nil];
    [webView evaluateJavaScript:LawExported.playVersions.headlineBleedVideoRetryCar completionHandler:nil];
    
    [BagRematchView slopeSpecifiedBrowsingCheckTwelveView:self.view];
    while (self.wetModalNet.isLoading) {
        return;
    }
}


- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message {
    
    
    if ([self.bigAwakePatch respondsToSelector:@selector(spaForkView:animateFunAction:car:)]) {
        [self.bigAwakePatch spaForkView:self.wetModalNet animateFunAction:message.name car:message.body];
    }
}

-(void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler{
    
    [HexAlertView playThemeHindiHandledFormOptional:@"" message:message completion:^(NSInteger indentIndex) {
        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(LawExported.playVersions.alertPoolHex);
}


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

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

@end
