






#import "SpouseTapViewController.h"
#import "AlpineSelectionImageClampingClippingHandler.h"

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

@end

@implementation SpouseTapViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.tabTreeBagButton.hidden = YES;
    self.winSampleButton.hidden = YES;
    [self oldDueUsedNotView];
}

- (void)oldDueUsedNotView
{
    WKUserContentController *tabNotLostMain = [[WKUserContentController alloc] init];
    WKUserScript *plusTenBit = [[WKUserScript alloc] initWithSource:UserArtRoot.wayAbortLove.hintMonitoredHueLongDuplicate injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES];
    [tabNotLostMain addUserScript:plusTenBit];
    
    WKWebViewConfiguration * config = [[WKWebViewConfiguration alloc] init];
    WKPreferences *paceMayAre = [[WKPreferences alloc]init];
    paceMayAre.javaScriptCanOpenWindowsAutomatically = YES;
    paceMayAre.minimumFontSize = 40.0;
    paceMayAre.javaScriptEnabled = YES;
    config.preferences = paceMayAre;
    config.selectionGranularity = WKSelectionGranularityDynamic;
    config.preferences.minimumFontSize = 18;
    config.preferences.javaScriptEnabled = YES;
    config.userContentController = tabNotLostMain;
    
    self.twoCapCycle = [[WKWebView alloc] initWithFrame:CGRectZero];
    self.twoCapCycle.backgroundColor = UIColor.clearColor;
    self.twoCapCycle.scrollView.backgroundColor = UIColor.clearColor;
    self.twoCapCycle.navigationDelegate = self;
    self.twoCapCycle.opaque = YES;
    self.twoCapCycle.scrollView.bounces = NO;
    self.twoCapCycle.scrollView.showsVerticalScrollIndicator = NO;
    self.twoCapCycle.scrollView.showsHorizontalScrollIndicator = NO;
    self.twoCapCycle.UIDelegate = self;
    [self.view addSubview:self.twoCapCycle];
    self.twoCapCycle.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    
    
    AlpineSelectionImageClampingClippingHandler *optColor = [[AlpineSelectionImageClampingClippingHandler alloc] initWithDelegate:self];
    AlpineSelectionImageClampingClippingHandler *nineMind = [[AlpineSelectionImageClampingClippingHandler alloc] initWithDelegate:self];
    
    [self.twoCapCycle.configuration.userContentController addScriptMessageHandler:optColor name:UserArtRoot.wayAbortLove.fitWayChunkMetricsBook];
    [self.twoCapCycle.configuration.userContentController addScriptMessageHandler:nineMind name:UserArtRoot.wayAbortLove.boxScaleOutDependentExistingMarqueeTranslate];
}

- (void)setCatClipGray:(NSString *)catClipGray {
    _catClipGray = catClipGray;
    NSURL *url = [NSURL URLWithString:catClipGray];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
    [request addValue:[UserArtRoot documentsCaptionDisabledPublicAffiliateToken] forHTTPHeaderField:UserArtRoot.wayAbortLove.fitTagNeutralVolumeCursors];
    [self.twoCapCycle loadRequest:request];
}

- (void)lowOffEventSlashedNextOrdinalsRead:(NSURL *)URL {
    if ([self.jobIrishBezel respondsToSelector:@selector(runningView:sinkUpdateAction:fax:)]) {
        [self.jobIrishBezel runningView:self.twoCapCycle sinkUpdateAction:URL.host fax: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:UserArtRoot.wayAbortLove.whoAbout]) {
        [self lowOffEventSlashedNextOrdinalsRead: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:UserArtRoot.wayAbortLove.processReplaceStylizeAdoptPoliciesMust completionHandler:nil];
    
    [webView evaluateJavaScript:UserArtRoot.wayAbortLove.returnsOwnNeedAcrossMacintoshResume completionHandler:nil];
    [webView evaluateJavaScript:UserArtRoot.wayAbortLove.topSemanticsGreatAverageCase completionHandler:nil];
    
    [ActualSkipView scrollCanManagerPreviewChargeView:self.view];
    while (self.twoCapCycle.isLoading) {
        return;
    }
}


- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message {
    
    
    if ([self.jobIrishBezel respondsToSelector:@selector(runningView:sinkUpdateAction:fax:)]) {
        [self.jobIrishBezel runningView:self.twoCapCycle sinkUpdateAction:message.name fax:message.body];
    }
}

-(void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler{
    
    [KinAlertView solidFixMaxCookieFloorBecome:@"" message:message completion:^(NSInteger anchorIndex) {
        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(UserArtRoot.wayAbortLove.welshHueRows);
}


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

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

@end
