diff --git a/CHANGES.rst b/CHANGES.rst index 3fd0fcb45..d8128c045 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -9,12 +9,17 @@ Improvements: * Notifications: Added titles to notifications on iOS 10+, thanks to @fridtjof (PR #2347). * iOS 12 Notification: Group them by room (#2337 and PR #2347 thanks to @fridtjof). * Notifications: When navigate to a room, remove associated delivered notifications (#2337). + * Key backup: Adjust wording for untrusted backup to match Riot Web. + * Jitsi integration: Use the matching WebRTC framework (#1483). + * Fastlane: Set iCloud container environment (PR #2385). + * Remove code used for iOS 9 only (PR #2386). Bug fix: * Share extension: Fix a crash when receive a memory warning (PR #2352). * Upgraded rooms show up in the share extension twice (#2293). * +N read receipt text is invisible on dark theme (#2294). * Avoid crashes with tableview reload animation in settings and room settings (PR #2364). + * Media picker: Fix some retain cycles (PR #2382). Changes in 0.8.4 (2019-03-21) =============================================== diff --git a/Podfile b/Podfile index d77789509..79d0d26b9 100644 --- a/Podfile +++ b/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -platform :ios, "9.0" +platform :ios, '10.0' # Use frameforks to allow usage of pod written in Swift (like PiwikTracker) use_frameworks! @@ -43,18 +43,15 @@ def import_MatrixKitAppExtension if $matrixKitVersion == 'local' pod 'MatrixSDK', :path => '../matrix-ios-sdk/MatrixSDK.podspec' pod 'MatrixSDK/SwiftSupport', :path => '../matrix-ios-sdk/MatrixSDK.podspec' - pod 'MatrixSDK/JingleCallStack', :path => '../matrix-ios-sdk/MatrixSDK.podspec' pod 'MatrixKit/AppExtension', :path => '../matrix-ios-kit/MatrixKit.podspec' else if $matrixKitVersion == 'develop' pod 'MatrixSDK', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop' pod 'MatrixSDK/SwiftSupport', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop' - pod 'MatrixSDK/JingleCallStack', :git => 'https://github.com/matrix-org/matrix-ios-sdk.git', :branch => 'develop' pod 'MatrixKit/AppExtension', :git => 'https://github.com/matrix-org/matrix-ios-kit.git', :branch => 'develop' else pod 'MatrixKit/AppExtension', $matrixKitVersion pod 'MatrixSDK/SwiftSupport' - pod 'MatrixSDK/JingleCallStack' end end end diff --git a/Riot.xcodeproj/project.pbxproj b/Riot.xcodeproj/project.pbxproj index 13c95d8fc..c615f41a9 100644 --- a/Riot.xcodeproj/project.pbxproj +++ b/Riot.xcodeproj/project.pbxproj @@ -36,17 +36,56 @@ 3232AB502256558300AD6A5C /* TemplateScreenViewState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232AB452256558300AD6A5C /* TemplateScreenViewState.swift */; }; 3232AB512256558300AD6A5C /* TemplateScreenViewAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232AB462256558300AD6A5C /* TemplateScreenViewAction.swift */; }; 3232AB522256558300AD6A5C /* TemplateScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232AB472256558300AD6A5C /* TemplateScreenViewModel.swift */; }; - 3233F7461F3497E2006ACA81 /* JitsiMeet.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3233F7441F3497DA006ACA81 /* JitsiMeet.framework */; }; - 3233F7471F3497E2006ACA81 /* JitsiMeet.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3233F7441F3497DA006ACA81 /* JitsiMeet.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 3232ABA1225730E100AD6A5C /* DeviceVerificationCoordinatorType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232AB95225730E100AD6A5C /* DeviceVerificationCoordinatorType.swift */; }; + 3232ABA2225730E100AD6A5C /* DeviceVerificationStartViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3232AB97225730E100AD6A5C /* DeviceVerificationStartViewController.storyboard */; }; + 3232ABA3225730E100AD6A5C /* DeviceVerificationStartCoordinatorType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232AB98225730E100AD6A5C /* DeviceVerificationStartCoordinatorType.swift */; }; + 3232ABA4225730E100AD6A5C /* DeviceVerificationStartViewAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232AB99225730E100AD6A5C /* DeviceVerificationStartViewAction.swift */; }; + 3232ABA5225730E100AD6A5C /* DeviceVerificationStartViewModelType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232AB9A225730E100AD6A5C /* DeviceVerificationStartViewModelType.swift */; }; + 3232ABA6225730E100AD6A5C /* DeviceVerificationStartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232AB9B225730E100AD6A5C /* DeviceVerificationStartViewController.swift */; }; + 3232ABA7225730E100AD6A5C /* DeviceVerificationStartCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232AB9C225730E100AD6A5C /* DeviceVerificationStartCoordinator.swift */; }; + 3232ABA8225730E100AD6A5C /* DeviceVerificationStartViewState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232AB9D225730E100AD6A5C /* DeviceVerificationStartViewState.swift */; }; + 3232ABA9225730E100AD6A5C /* DeviceVerificationStartViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232AB9E225730E100AD6A5C /* DeviceVerificationStartViewModel.swift */; }; + 3232ABAA225730E100AD6A5C /* DeviceVerificationCoordinatorBridgePresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232AB9F225730E100AD6A5C /* DeviceVerificationCoordinatorBridgePresenter.swift */; }; + 3232ABAB225730E100AD6A5C /* DeviceVerificationCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232ABA0225730E100AD6A5C /* DeviceVerificationCoordinator.swift */; }; + 3232ABB52257BE6400AD6A5C /* DeviceVerificationVerifyCoordinatorType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232ABAD2257BE6400AD6A5C /* DeviceVerificationVerifyCoordinatorType.swift */; }; + 3232ABB62257BE6400AD6A5C /* DeviceVerificationVerifyViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3232ABAE2257BE6400AD6A5C /* DeviceVerificationVerifyViewController.storyboard */; }; + 3232ABB72257BE6400AD6A5C /* DeviceVerificationVerifyViewModelType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232ABAF2257BE6400AD6A5C /* DeviceVerificationVerifyViewModelType.swift */; }; + 3232ABB82257BE6500AD6A5C /* DeviceVerificationVerifyCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232ABB02257BE6400AD6A5C /* DeviceVerificationVerifyCoordinator.swift */; }; + 3232ABB92257BE6500AD6A5C /* DeviceVerificationVerifyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232ABB12257BE6400AD6A5C /* DeviceVerificationVerifyViewController.swift */; }; + 3232ABBA2257BE6500AD6A5C /* DeviceVerificationVerifyViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232ABB22257BE6400AD6A5C /* DeviceVerificationVerifyViewModel.swift */; }; + 3232ABBB2257BE6500AD6A5C /* DeviceVerificationVerifyViewState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232ABB32257BE6400AD6A5C /* DeviceVerificationVerifyViewState.swift */; }; + 3232ABBC2257BE6500AD6A5C /* DeviceVerificationVerifyViewAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232ABB42257BE6400AD6A5C /* DeviceVerificationVerifyViewAction.swift */; }; + 3232ABC022594C0900AD6A5C /* VerifyEmojiCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232ABBF22594C0900AD6A5C /* VerifyEmojiCollectionViewCell.swift */; }; + 3232ABC2225B996200AD6A5C /* Themable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3232ABC1225B996100AD6A5C /* Themable.swift */; }; + 324A204F225FC571004FE8B0 /* DeviceVerificationIncomingViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 324A2047225FC571004FE8B0 /* DeviceVerificationIncomingViewController.storyboard */; }; + 324A2050225FC571004FE8B0 /* DeviceVerificationIncomingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 324A2048225FC571004FE8B0 /* DeviceVerificationIncomingViewController.swift */; }; + 324A2051225FC571004FE8B0 /* DeviceVerificationIncomingViewState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 324A2049225FC571004FE8B0 /* DeviceVerificationIncomingViewState.swift */; }; + 324A2052225FC571004FE8B0 /* DeviceVerificationIncomingViewAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 324A204A225FC571004FE8B0 /* DeviceVerificationIncomingViewAction.swift */; }; + 324A2053225FC571004FE8B0 /* DeviceVerificationIncomingViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 324A204B225FC571004FE8B0 /* DeviceVerificationIncomingViewModel.swift */; }; + 324A2054225FC571004FE8B0 /* DeviceVerificationIncomingCoordinatorType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 324A204C225FC571004FE8B0 /* DeviceVerificationIncomingCoordinatorType.swift */; }; + 324A2055225FC571004FE8B0 /* DeviceVerificationIncomingViewModelType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 324A204D225FC571004FE8B0 /* DeviceVerificationIncomingViewModelType.swift */; }; + 324A2056225FC571004FE8B0 /* DeviceVerificationIncomingCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 324A204E225FC571004FE8B0 /* DeviceVerificationIncomingCoordinator.swift */; }; 3275FD8C21A5A2C500B9C13D /* TermsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3275FD8B21A5A2C500B9C13D /* TermsView.swift */; }; 3281BCF72201FA4200F4A383 /* UIControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3281BCF62201FA4200F4A383 /* UIControl.swift */; }; 3284A35120A07C210044F922 /* postMessageAPI.js in Resources */ = {isa = PBXBuildFile; fileRef = 3284A35020A07C210044F922 /* postMessageAPI.js */; }; + 32891D6B2264CBA300C82226 /* SimpleScreenTemplateViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32891D692264CBA300C82226 /* SimpleScreenTemplateViewController.swift */; }; + 32891D6C2264CBA300C82226 /* SimpleScreenTemplateViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 32891D6A2264CBA300C82226 /* SimpleScreenTemplateViewController.storyboard */; }; + 32891D702264DF7B00C82226 /* DeviceVerificationVerifiedViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 32891D6E2264DF7B00C82226 /* DeviceVerificationVerifiedViewController.storyboard */; }; + 32891D712264DF7B00C82226 /* DeviceVerificationVerifiedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32891D6F2264DF7B00C82226 /* DeviceVerificationVerifiedViewController.swift */; }; + 32891D75226728EE00C82226 /* DeviceVerificationDataLoadingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32891D73226728EE00C82226 /* DeviceVerificationDataLoadingViewController.swift */; }; + 32891D76226728EF00C82226 /* DeviceVerificationDataLoadingViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 32891D74226728EE00C82226 /* DeviceVerificationDataLoadingViewController.storyboard */; }; 32B1FEDB21A46F2C00637127 /* TermsView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 32B1FEDA21A46F2C00637127 /* TermsView.xib */; }; 32BF994F21FA29A400698084 /* SettingsKeyBackupViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32BF994E21FA29A400698084 /* SettingsKeyBackupViewModel.swift */; }; 32BF995121FA29DC00698084 /* SettingsKeyBackupViewModelType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32BF995021FA29DC00698084 /* SettingsKeyBackupViewModelType.swift */; }; 32BF995321FA2A1300698084 /* SettingsKeyBackupViewState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32BF995221FA2A1300698084 /* SettingsKeyBackupViewState.swift */; }; 32BF995521FA2AB700698084 /* SettingsKeyBackupViewAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32BF995421FA2AB700698084 /* SettingsKeyBackupViewAction.swift */; }; 32BF995721FB07A400698084 /* SettingsKeyBackupTableViewSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32BF995621FB07A400698084 /* SettingsKeyBackupTableViewSection.swift */; }; + 32F6B9692270623100BBA352 /* DeviceVerificationDataLoadingCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32F6B9632270623000BBA352 /* DeviceVerificationDataLoadingCoordinator.swift */; }; + 32F6B96A2270623100BBA352 /* DeviceVerificationDataLoadingViewState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32F6B9642270623100BBA352 /* DeviceVerificationDataLoadingViewState.swift */; }; + 32F6B96B2270623100BBA352 /* DeviceVerificationDataLoadingViewAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32F6B9652270623100BBA352 /* DeviceVerificationDataLoadingViewAction.swift */; }; + 32F6B96C2270623100BBA352 /* DeviceVerificationDataLoadingCoordinatorType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32F6B9662270623100BBA352 /* DeviceVerificationDataLoadingCoordinatorType.swift */; }; + 32F6B96D2270623100BBA352 /* DeviceVerificationDataLoadingViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32F6B9672270623100BBA352 /* DeviceVerificationDataLoadingViewModel.swift */; }; + 32F6B96E2270623100BBA352 /* DeviceVerificationDataLoadingViewModelType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32F6B9682270623100BBA352 /* DeviceVerificationDataLoadingViewModelType.swift */; }; 358DB9429359F97520545D35 /* Pods_RiotPods_RiotShareExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5856BA7A55E53C0AEAFC084 /* Pods_RiotPods_RiotShareExtension.framework */; }; 89C94E649229EA68AE787E9E /* Pods_RiotPods_Riot.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2510A69B4A681C1FEC36E848 /* Pods_RiotPods_Riot.framework */; }; 926FA53F1F4C132000F826C2 /* MXSession+Riot.m in Sources */ = {isa = PBXBuildFile; fileRef = 926FA53E1F4C132000F826C2 /* MXSession+Riot.m */; }; @@ -81,6 +120,7 @@ B109D6F1222D8C400061B6D9 /* UIApplication.swift in Sources */ = {isa = PBXBuildFile; fileRef = B109D6F0222D8C400061B6D9 /* UIApplication.swift */; }; B10B3B5B2201DD740072C76B /* KeyBackupBannerCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B10B3B592201DD740072C76B /* KeyBackupBannerCell.swift */; }; B10B3B5C2201DD740072C76B /* KeyBackupBannerCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = B10B3B5A2201DD740072C76B /* KeyBackupBannerCell.xib */; }; + B10CFBC32268D99D00A5842E /* JitsiService.swift in Sources */ = {isa = PBXBuildFile; fileRef = B10CFBC22268D99D00A5842E /* JitsiService.swift */; }; B1107EC82200B0720038014B /* KeyBackupRecoverSuccessViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1107EC72200B0720038014B /* KeyBackupRecoverSuccessViewController.swift */; }; B1107ECA2200B09F0038014B /* KeyBackupRecoverSuccessViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B1107EC92200B09F0038014B /* KeyBackupRecoverSuccessViewController.storyboard */; }; B110871D21F087F4003554A5 /* KeyBackupSetupPassphraseViewState.swift in Sources */ = {isa = PBXBuildFile; fileRef = B110871C21F087F4003554A5 /* KeyBackupSetupPassphraseViewState.swift */; }; @@ -467,17 +507,6 @@ name = "Embed App Extensions"; runOnlyForDeploymentPostprocessing = 0; }; - 3233F7481F3497E2006ACA81 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 3233F7471F3497E2006ACA81 /* JitsiMeet.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ @@ -505,7 +534,35 @@ 3232AB452256558300AD6A5C /* TemplateScreenViewState.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TemplateScreenViewState.swift; sourceTree = ""; }; 3232AB462256558300AD6A5C /* TemplateScreenViewAction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TemplateScreenViewAction.swift; sourceTree = ""; }; 3232AB472256558300AD6A5C /* TemplateScreenViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TemplateScreenViewModel.swift; sourceTree = ""; }; - 3233F7441F3497DA006ACA81 /* JitsiMeet.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JitsiMeet.framework; sourceTree = ""; }; + 3232AB95225730E100AD6A5C /* DeviceVerificationCoordinatorType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationCoordinatorType.swift; sourceTree = ""; }; + 3232AB97225730E100AD6A5C /* DeviceVerificationStartViewController.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = DeviceVerificationStartViewController.storyboard; sourceTree = ""; }; + 3232AB98225730E100AD6A5C /* DeviceVerificationStartCoordinatorType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationStartCoordinatorType.swift; sourceTree = ""; }; + 3232AB99225730E100AD6A5C /* DeviceVerificationStartViewAction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationStartViewAction.swift; sourceTree = ""; }; + 3232AB9A225730E100AD6A5C /* DeviceVerificationStartViewModelType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationStartViewModelType.swift; sourceTree = ""; }; + 3232AB9B225730E100AD6A5C /* DeviceVerificationStartViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationStartViewController.swift; sourceTree = ""; }; + 3232AB9C225730E100AD6A5C /* DeviceVerificationStartCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationStartCoordinator.swift; sourceTree = ""; }; + 3232AB9D225730E100AD6A5C /* DeviceVerificationStartViewState.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationStartViewState.swift; sourceTree = ""; }; + 3232AB9E225730E100AD6A5C /* DeviceVerificationStartViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationStartViewModel.swift; sourceTree = ""; }; + 3232AB9F225730E100AD6A5C /* DeviceVerificationCoordinatorBridgePresenter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationCoordinatorBridgePresenter.swift; sourceTree = ""; }; + 3232ABA0225730E100AD6A5C /* DeviceVerificationCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationCoordinator.swift; sourceTree = ""; }; + 3232ABAD2257BE6400AD6A5C /* DeviceVerificationVerifyCoordinatorType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationVerifyCoordinatorType.swift; sourceTree = ""; }; + 3232ABAE2257BE6400AD6A5C /* DeviceVerificationVerifyViewController.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = DeviceVerificationVerifyViewController.storyboard; sourceTree = ""; }; + 3232ABAF2257BE6400AD6A5C /* DeviceVerificationVerifyViewModelType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationVerifyViewModelType.swift; sourceTree = ""; }; + 3232ABB02257BE6400AD6A5C /* DeviceVerificationVerifyCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationVerifyCoordinator.swift; sourceTree = ""; }; + 3232ABB12257BE6400AD6A5C /* DeviceVerificationVerifyViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationVerifyViewController.swift; sourceTree = ""; }; + 3232ABB22257BE6400AD6A5C /* DeviceVerificationVerifyViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationVerifyViewModel.swift; sourceTree = ""; }; + 3232ABB32257BE6400AD6A5C /* DeviceVerificationVerifyViewState.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationVerifyViewState.swift; sourceTree = ""; }; + 3232ABB42257BE6400AD6A5C /* DeviceVerificationVerifyViewAction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationVerifyViewAction.swift; sourceTree = ""; }; + 3232ABBF22594C0900AD6A5C /* VerifyEmojiCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VerifyEmojiCollectionViewCell.swift; sourceTree = ""; }; + 3232ABC1225B996100AD6A5C /* Themable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Themable.swift; sourceTree = ""; }; + 324A2047225FC571004FE8B0 /* DeviceVerificationIncomingViewController.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = DeviceVerificationIncomingViewController.storyboard; sourceTree = ""; }; + 324A2048225FC571004FE8B0 /* DeviceVerificationIncomingViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationIncomingViewController.swift; sourceTree = ""; }; + 324A2049225FC571004FE8B0 /* DeviceVerificationIncomingViewState.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationIncomingViewState.swift; sourceTree = ""; }; + 324A204A225FC571004FE8B0 /* DeviceVerificationIncomingViewAction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationIncomingViewAction.swift; sourceTree = ""; }; + 324A204B225FC571004FE8B0 /* DeviceVerificationIncomingViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationIncomingViewModel.swift; sourceTree = ""; }; + 324A204C225FC571004FE8B0 /* DeviceVerificationIncomingCoordinatorType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationIncomingCoordinatorType.swift; sourceTree = ""; }; + 324A204D225FC571004FE8B0 /* DeviceVerificationIncomingViewModelType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationIncomingViewModelType.swift; sourceTree = ""; }; + 324A204E225FC571004FE8B0 /* DeviceVerificationIncomingCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationIncomingCoordinator.swift; sourceTree = ""; }; 3267EFB320E379FD00FF1CAA /* CHANGES.rst */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGES.rst; sourceTree = ""; }; 3267EFB420E379FD00FF1CAA /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; fileEncoding = 4; path = Podfile; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 3267EFB520E379FD00FF1CAA /* AUTHORS.rst */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AUTHORS.rst; sourceTree = ""; }; @@ -513,6 +570,12 @@ 3275FD8B21A5A2C500B9C13D /* TermsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TermsView.swift; sourceTree = ""; }; 3281BCF62201FA4200F4A383 /* UIControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIControl.swift; sourceTree = ""; }; 3284A35020A07C210044F922 /* postMessageAPI.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = postMessageAPI.js; sourceTree = ""; }; + 32891D692264CBA300C82226 /* SimpleScreenTemplateViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SimpleScreenTemplateViewController.swift; sourceTree = ""; }; + 32891D6A2264CBA300C82226 /* SimpleScreenTemplateViewController.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = SimpleScreenTemplateViewController.storyboard; sourceTree = ""; }; + 32891D6E2264DF7B00C82226 /* DeviceVerificationVerifiedViewController.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = DeviceVerificationVerifiedViewController.storyboard; sourceTree = ""; }; + 32891D6F2264DF7B00C82226 /* DeviceVerificationVerifiedViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationVerifiedViewController.swift; sourceTree = ""; }; + 32891D73226728EE00C82226 /* DeviceVerificationDataLoadingViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationDataLoadingViewController.swift; sourceTree = ""; }; + 32891D74226728EE00C82226 /* DeviceVerificationDataLoadingViewController.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = DeviceVerificationDataLoadingViewController.storyboard; sourceTree = ""; }; 32B1FEDA21A46F2C00637127 /* TermsView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TermsView.xib; sourceTree = ""; }; 32BDC9A1211C2C870064AF51 /* zh_Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_Hant; path = zh_Hant.lproj/InfoPlist.strings; sourceTree = ""; }; 32BDC9A2211C2C870064AF51 /* zh_Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_Hant; path = zh_Hant.lproj/Localizable.strings; sourceTree = ""; }; @@ -528,6 +591,12 @@ 32D7159E2146CC6F00DF59C9 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Vector.strings; sourceTree = ""; }; 32D7159F2146CC7F00DF59C9 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = ""; }; 32D715A02146CC8800DF59C9 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = ""; }; + 32F6B9632270623000BBA352 /* DeviceVerificationDataLoadingCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationDataLoadingCoordinator.swift; sourceTree = ""; }; + 32F6B9642270623100BBA352 /* DeviceVerificationDataLoadingViewState.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationDataLoadingViewState.swift; sourceTree = ""; }; + 32F6B9652270623100BBA352 /* DeviceVerificationDataLoadingViewAction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationDataLoadingViewAction.swift; sourceTree = ""; }; + 32F6B9662270623100BBA352 /* DeviceVerificationDataLoadingCoordinatorType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationDataLoadingCoordinatorType.swift; sourceTree = ""; }; + 32F6B9672270623100BBA352 /* DeviceVerificationDataLoadingViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationDataLoadingViewModel.swift; sourceTree = ""; }; + 32F6B9682270623100BBA352 /* DeviceVerificationDataLoadingViewModelType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceVerificationDataLoadingViewModelType.swift; sourceTree = ""; }; 3998C51E0196D42B366E0900 /* Pods-RiotPods-RiotShareExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RiotPods-RiotShareExtension.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RiotPods-RiotShareExtension/Pods-RiotPods-RiotShareExtension.debug.xcconfig"; sourceTree = ""; }; 3D78489021AC9E6400B98A7D /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/InfoPlist.strings; sourceTree = ""; }; 3D78489121AC9E6500B98A7D /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = ""; }; @@ -572,6 +641,7 @@ B109D6F0222D8C400061B6D9 /* UIApplication.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIApplication.swift; sourceTree = ""; }; B10B3B592201DD740072C76B /* KeyBackupBannerCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyBackupBannerCell.swift; sourceTree = ""; }; B10B3B5A2201DD740072C76B /* KeyBackupBannerCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KeyBackupBannerCell.xib; sourceTree = ""; }; + B10CFBC22268D99D00A5842E /* JitsiService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JitsiService.swift; sourceTree = ""; }; B1107EC72200B0720038014B /* KeyBackupRecoverSuccessViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyBackupRecoverSuccessViewController.swift; sourceTree = ""; }; B1107EC92200B09F0038014B /* KeyBackupRecoverSuccessViewController.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = KeyBackupRecoverSuccessViewController.storyboard; sourceTree = ""; }; B110871C21F087F4003554A5 /* KeyBackupSetupPassphraseViewState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyBackupSetupPassphraseViewState.swift; sourceTree = ""; }; @@ -1143,7 +1213,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3233F7461F3497E2006ACA81 /* JitsiMeet.framework in Frameworks */, 89C94E649229EA68AE787E9E /* Pods_RiotPods_Riot.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1175,6 +1244,7 @@ 32242F0D21E8FBA900725742 /* Theme.swift */, 32242F1121E8FBA900725742 /* ThemeService.h */, 32242F0E21E8FBA900725742 /* Themes */, + 3232ABC1225B996100AD6A5C /* Themable.swift */, ); path = Theme; sourceTree = ""; @@ -1237,6 +1307,7 @@ children = ( 3232AB3B2256558300AD6A5C /* FlowCoordinatorTemplate */, 3232AB3F2256558300AD6A5C /* ScreenTemplate */, + 32891D682264C6A000C82226 /* SimpleScreenTemplate */, ); path = buildable; sourceTree = ""; @@ -1266,20 +1337,106 @@ path = ScreenTemplate; sourceTree = ""; }; - 3233F7291F31F3B4006ACA81 /* libs */ = { + 3232AB94225730E100AD6A5C /* DeviceVerification */ = { isa = PBXGroup; children = ( - 3233F7431F3497DA006ACA81 /* jitsi-meet */, + 324A2046225FC571004FE8B0 /* Incoming */, + 32891D72226728EE00C82226 /* Loading */, + 3232AB96225730E100AD6A5C /* Start */, + 32891D6D2264DF7B00C82226 /* Verified */, + 3232ABAC2257BE6400AD6A5C /* Verify */, + 3232AB95225730E100AD6A5C /* DeviceVerificationCoordinatorType.swift */, + 3232AB9F225730E100AD6A5C /* DeviceVerificationCoordinatorBridgePresenter.swift */, + 3232ABA0225730E100AD6A5C /* DeviceVerificationCoordinator.swift */, ); - path = libs; + path = DeviceVerification; sourceTree = ""; }; - 3233F7431F3497DA006ACA81 /* jitsi-meet */ = { + 3232AB96225730E100AD6A5C /* Start */ = { isa = PBXGroup; children = ( - 3233F7441F3497DA006ACA81 /* JitsiMeet.framework */, + 3232AB97225730E100AD6A5C /* DeviceVerificationStartViewController.storyboard */, + 3232AB98225730E100AD6A5C /* DeviceVerificationStartCoordinatorType.swift */, + 3232AB99225730E100AD6A5C /* DeviceVerificationStartViewAction.swift */, + 3232AB9A225730E100AD6A5C /* DeviceVerificationStartViewModelType.swift */, + 3232AB9B225730E100AD6A5C /* DeviceVerificationStartViewController.swift */, + 3232AB9C225730E100AD6A5C /* DeviceVerificationStartCoordinator.swift */, + 3232AB9D225730E100AD6A5C /* DeviceVerificationStartViewState.swift */, + 3232AB9E225730E100AD6A5C /* DeviceVerificationStartViewModel.swift */, ); - path = "jitsi-meet"; + path = Start; + sourceTree = ""; + }; + 3232ABAC2257BE6400AD6A5C /* Verify */ = { + isa = PBXGroup; + children = ( + 3232ABBE22594B5C00AD6A5C /* Views */, + 3232ABAD2257BE6400AD6A5C /* DeviceVerificationVerifyCoordinatorType.swift */, + 3232ABAE2257BE6400AD6A5C /* DeviceVerificationVerifyViewController.storyboard */, + 3232ABAF2257BE6400AD6A5C /* DeviceVerificationVerifyViewModelType.swift */, + 3232ABB02257BE6400AD6A5C /* DeviceVerificationVerifyCoordinator.swift */, + 3232ABB12257BE6400AD6A5C /* DeviceVerificationVerifyViewController.swift */, + 3232ABB22257BE6400AD6A5C /* DeviceVerificationVerifyViewModel.swift */, + 3232ABB32257BE6400AD6A5C /* DeviceVerificationVerifyViewState.swift */, + 3232ABB42257BE6400AD6A5C /* DeviceVerificationVerifyViewAction.swift */, + ); + path = Verify; + sourceTree = ""; + }; + 3232ABBE22594B5C00AD6A5C /* Views */ = { + isa = PBXGroup; + children = ( + 3232ABBF22594C0900AD6A5C /* VerifyEmojiCollectionViewCell.swift */, + ); + path = Views; + sourceTree = ""; + }; + 324A2046225FC571004FE8B0 /* Incoming */ = { + isa = PBXGroup; + children = ( + 324A2047225FC571004FE8B0 /* DeviceVerificationIncomingViewController.storyboard */, + 324A2048225FC571004FE8B0 /* DeviceVerificationIncomingViewController.swift */, + 324A2049225FC571004FE8B0 /* DeviceVerificationIncomingViewState.swift */, + 324A204A225FC571004FE8B0 /* DeviceVerificationIncomingViewAction.swift */, + 324A204B225FC571004FE8B0 /* DeviceVerificationIncomingViewModel.swift */, + 324A204C225FC571004FE8B0 /* DeviceVerificationIncomingCoordinatorType.swift */, + 324A204D225FC571004FE8B0 /* DeviceVerificationIncomingViewModelType.swift */, + 324A204E225FC571004FE8B0 /* DeviceVerificationIncomingCoordinator.swift */, + ); + path = Incoming; + sourceTree = ""; + }; + 32891D682264C6A000C82226 /* SimpleScreenTemplate */ = { + isa = PBXGroup; + children = ( + 32891D6A2264CBA300C82226 /* SimpleScreenTemplateViewController.storyboard */, + 32891D692264CBA300C82226 /* SimpleScreenTemplateViewController.swift */, + ); + path = SimpleScreenTemplate; + sourceTree = ""; + }; + 32891D6D2264DF7B00C82226 /* Verified */ = { + isa = PBXGroup; + children = ( + 32891D6E2264DF7B00C82226 /* DeviceVerificationVerifiedViewController.storyboard */, + 32891D6F2264DF7B00C82226 /* DeviceVerificationVerifiedViewController.swift */, + ); + path = Verified; + sourceTree = ""; + }; + 32891D72226728EE00C82226 /* Loading */ = { + isa = PBXGroup; + children = ( + 32F6B9632270623000BBA352 /* DeviceVerificationDataLoadingCoordinator.swift */, + 32F6B9662270623100BBA352 /* DeviceVerificationDataLoadingCoordinatorType.swift */, + 32F6B9652270623100BBA352 /* DeviceVerificationDataLoadingViewAction.swift */, + 32F6B9672270623100BBA352 /* DeviceVerificationDataLoadingViewModel.swift */, + 32F6B9682270623100BBA352 /* DeviceVerificationDataLoadingViewModelType.swift */, + 32F6B9642270623100BBA352 /* DeviceVerificationDataLoadingViewState.swift */, + 32891D73226728EE00C82226 /* DeviceVerificationDataLoadingViewController.swift */, + 32891D74226728EE00C82226 /* DeviceVerificationDataLoadingViewController.storyboard */, + ); + path = Loading; sourceTree = ""; }; 32935CB21F628B98006888C8 /* js */ = { @@ -1730,6 +1887,7 @@ B1B5567620EE6C4C00210D55 /* Modules */ = { isa = PBXGroup; children = ( + 3232AB94225730E100AD6A5C /* DeviceVerification */, B1B556EA20EE6C4C00210D55 /* Main */, B1B556CA20EE6C4C00210D55 /* TabBar */, B1B556F920EE6C4C00210D55 /* Authentication */, @@ -2252,9 +2410,10 @@ B1B5576920EE702800210D55 /* Jitsi */ = { isa = PBXGroup; children = ( + B10CFBC22268D99D00A5842E /* JitsiService.swift */, B1B5576A20EE702800210D55 /* JitsiViewController.h */, - B1B5576B20EE702800210D55 /* JitsiViewController.xib */, B1B5576C20EE702800210D55 /* JitsiViewController.m */, + B1B5576B20EE702800210D55 /* JitsiViewController.xib */, ); path = Jitsi; sourceTree = ""; @@ -2910,7 +3069,6 @@ B1B5597C20EFC3DF00210D55 /* Managers */, B1B5567620EE6C4C00210D55 /* Modules */, F083BC0F1E7009EC00A9B29C /* Utils */, - 3233F7291F31F3B4006ACA81 /* libs */, F083BB0E1E7009EC00A9B29C /* Assets */, B169329D20F3A21B00746532 /* SupportingFiles */, ); @@ -3091,7 +3249,6 @@ F094A99F1B78D8F000B1FBBF /* Frameworks */, F094A9A01B78D8F000B1FBBF /* Resources */, 24CBEC5D1F0EAD310093EABB /* Embed App Extensions */, - 3233F7481F3497E2006ACA81 /* Embed Frameworks */, 5C50A1C53E6A24258653D624 /* [CP] Embed Pods Frameworks */, ); buildRules = ( @@ -3242,6 +3399,7 @@ files = ( B1B5590220EF768F00210D55 /* RoomOutgoingAttachmentWithPaginationTitleBubbleCell.xib in Resources */, B1B558CA20EF768F00210D55 /* RoomOutgoingEncryptedAttachmentWithoutSenderInfoBubbleCell.xib in Resources */, + 32891D702264DF7B00C82226 /* DeviceVerificationVerifiedViewController.storyboard in Resources */, F083BDE91E7009ED00A9B29C /* ring.mp3 in Resources */, B1B558F720EF768F00210D55 /* RoomIncomingTextMsgWithPaginationTitleWithoutSenderNameBubbleCell.xib in Resources */, B1B5592B20EF7A5D00210D55 /* TableViewCellWithButton.xib in Resources */, @@ -3303,6 +3461,7 @@ 3232AB2122564D9100AD6A5C /* README.md in Resources */, B1B5593920EF7BAC00210D55 /* TableViewCellWithCheckBoxes.xib in Resources */, B1B557C120EF5B4500210D55 /* DisabledRoomInputToolbarView.xib in Resources */, + 32891D6C2264CBA300C82226 /* SimpleScreenTemplateViewController.storyboard in Resources */, B1664DA320F4F96200808783 /* Vector.strings in Resources */, B1B557C720EF5CD400210D55 /* DirectoryServerDetailTableViewCell.xib in Resources */, B1B5582620EF638A00210D55 /* RoomMemberTitleView.xib in Resources */, @@ -3314,6 +3473,7 @@ B1B5573020EE6C4D00210D55 /* BugReportViewController.xib in Resources */, B169329B20F39E6300746532 /* Main.storyboard in Resources */, 3232AB1422564D9100AD6A5C /* swiftgen-config.yml in Resources */, + 324A204F225FC571004FE8B0 /* DeviceVerificationIncomingViewController.storyboard in Resources */, 3232AB4B2256558300AD6A5C /* TemplateScreenViewController.storyboard in Resources */, 32B1FEDB21A46F2C00637127 /* TermsView.xib in Resources */, B1B5578E20EF568D00210D55 /* GroupInviteTableViewCell.xib in Resources */, @@ -3354,15 +3514,18 @@ B1B557B320EF5AEF00210D55 /* EventDetailsView.xib in Resources */, B1B557DD20EF5FBB00210D55 /* FilesSearchTableViewCell.xib in Resources */, B1B5590320EF768F00210D55 /* RoomSelectedStickerBubbleCell.xib in Resources */, + 3232ABB62257BE6400AD6A5C /* DeviceVerificationVerifyViewController.storyboard in Resources */, B1B5573F20EE6C4D00210D55 /* SegmentedViewController.xib in Resources */, B1B5581E20EF625800210D55 /* RoomTitleView.xib in Resources */, B1B558C020EF768F00210D55 /* RoomIncomingEncryptedTextMsgWithoutSenderInfoBubbleCell.xib in Resources */, B1B5572420EE6C4D00210D55 /* RoomViewController.xib in Resources */, B169331520F3CAFC00746532 /* PublicRoomTableViewCell.xib in Resources */, + 3232ABA2225730E100AD6A5C /* DeviceVerificationStartViewController.storyboard in Resources */, 3284A35120A07C210044F922 /* postMessageAPI.js in Resources */, B1B557A220EF58AD00210D55 /* ContactTableViewCell.xib in Resources */, B1B558EB20EF768F00210D55 /* RoomIncomingTextMsgWithPaginationTitleBubbleCell.xib in Resources */, B10B3B5C2201DD740072C76B /* KeyBackupBannerCell.xib in Resources */, + 32891D76226728EF00C82226 /* DeviceVerificationDataLoadingViewController.storyboard in Resources */, B1B5581820EF625800210D55 /* PreviewRoomTitleView.xib in Resources */, B1B5583020EF66BA00210D55 /* RoomIdOrAliasTableViewCell.xib in Resources */, B1B558BF20EF768F00210D55 /* RoomOutgoingEncryptedTextMsgWithoutSenderNameBubbleCell.xib in Resources */, @@ -3415,13 +3578,14 @@ "${BUILT_PRODUCTS_DIR}/GBDeviceInfo/GBDeviceInfo.framework", "${BUILT_PRODUCTS_DIR}/GZIP/GZIP.framework", "${BUILT_PRODUCTS_DIR}/HPGrowingTextView/HPGrowingTextView.framework", + "${PODS_ROOT}/JitsiMeetSDK/Frameworks/JitsiMeet.framework", + "${PODS_ROOT}/JitsiMeetSDK/Frameworks/WebRTC.framework", "${BUILT_PRODUCTS_DIR}/MatrixKit/MatrixKit.framework", - "${BUILT_PRODUCTS_DIR}/MatrixSDK/MatrixSDK.framework", + "${BUILT_PRODUCTS_DIR}/MatrixSDK.common-JingleCallStack/MatrixSDK.framework", "${BUILT_PRODUCTS_DIR}/OLMKit/OLMKit.framework", "${BUILT_PRODUCTS_DIR}/PiwikTracker/PiwikTracker.framework", "${BUILT_PRODUCTS_DIR}/Realm/Realm.framework", "${BUILT_PRODUCTS_DIR}/Reusable/Reusable.framework", - "${PODS_ROOT}/WebRTC/WebRTC.framework", "${BUILT_PRODUCTS_DIR}/cmark/cmark.framework", "${BUILT_PRODUCTS_DIR}/libPhoneNumber-iOS/libPhoneNumber_iOS.framework", "${BUILT_PRODUCTS_DIR}/libbase58/libbase58.framework", @@ -3437,13 +3601,14 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GBDeviceInfo.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GZIP.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/HPGrowingTextView.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/JitsiMeet.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/WebRTC.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MatrixKit.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MatrixSDK.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OLMKit.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PiwikTracker.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Realm.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reusable.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/WebRTC.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/cmark.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libPhoneNumber_iOS.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libbase58.framework", @@ -3571,15 +3736,18 @@ buildActionMask = 2147483647; files = ( B1B557D120EF5E3500210D55 /* MediaAlbumTableCell.m in Sources */, + 324A2053225FC571004FE8B0 /* DeviceVerificationIncomingViewModel.swift in Sources */, B1B557A120EF58AD00210D55 /* ContactTableViewCell.m in Sources */, F083BE021E7009ED00A9B29C /* AvatarGenerator.m in Sources */, B1B5573A20EE6C4D00210D55 /* GroupRoomsViewController.m in Sources */, B1B558F920EF768F00210D55 /* RoomOutgoingTextMsgWithoutSenderNameBubbleCell.m in Sources */, B1FDF56021F5FE5500BA3834 /* KeyBackupSetupPassphraseViewAction.swift in Sources */, B1B5573120EE6C4D00210D55 /* BugReportViewController.m in Sources */, + 324A2051225FC571004FE8B0 /* DeviceVerificationIncomingViewState.swift in Sources */, B16932A520F3A21C00746532 /* empty.mm in Sources */, 3232AB4A2256558300AD6A5C /* FlowTemplateCoordinator.swift in Sources */, B19EFA3B21F8BB4100FC070E /* KeyBackupRecoverCoordinator.swift in Sources */, + 3232ABA9225730E100AD6A5C /* DeviceVerificationStartViewModel.swift in Sources */, B16932FA20F3C51A00746532 /* RecentCellData.m in Sources */, B16932F220F3C49E00746532 /* GroupsDataSource.m in Sources */, B1B5581C20EF625800210D55 /* RoomAvatarTitleView.m in Sources */, @@ -3588,6 +3756,8 @@ B1B5598820EFC3E000210D55 /* WidgetManager.m in Sources */, B1DB4F0E22316FFF0065DBFA /* UserNameColorGenerator.swift in Sources */, B1057789221304EC00334B1E /* KeyBackupSetupSuccessFromPassphraseViewController.swift in Sources */, + 3232ABB72257BE6400AD6A5C /* DeviceVerificationVerifyViewModelType.swift in Sources */, + 32F6B96D2270623100BBA352 /* DeviceVerificationDataLoadingViewModel.swift in Sources */, B16932B120F3AC9200746532 /* RoomSearchDataSource.m in Sources */, B16932A320F3A21C00746532 /* main.m in Sources */, B1B5574520EE6C4D00210D55 /* StartChatViewController.m in Sources */, @@ -3598,6 +3768,7 @@ B1B5598720EFC3E000210D55 /* Widget.m in Sources */, B1B557E320EF60B900210D55 /* MessagesSearchResultAttachmentBubbleCell.m in Sources */, B1CE9F062216FB09000FAE6A /* EncryptionKeysExportPresenter.swift in Sources */, + 3232ABAA225730E100AD6A5C /* DeviceVerificationCoordinatorBridgePresenter.swift in Sources */, B1B5574420EE6C4D00210D55 /* CallViewController.m in Sources */, B1B5572220EE6C4D00210D55 /* RoomSettingsViewController.m in Sources */, B1B5577320EE702800210D55 /* JitsiViewController.m in Sources */, @@ -3612,10 +3783,12 @@ B1B5572320EE6C4D00210D55 /* AttachmentsViewController.m in Sources */, F083BDEE1E7009ED00A9B29C /* MXRoom+Riot.m in Sources */, B1B5598620EFC3E000210D55 /* RiotSettings.swift in Sources */, + 3232ABA3225730E100AD6A5C /* DeviceVerificationStartCoordinatorType.swift in Sources */, 3232AB4D2256558300AD6A5C /* TemplateScreenCoordinatorType.swift in Sources */, B1B5581720EF625800210D55 /* PreviewRoomTitleView.m in Sources */, B1098BDF21ECE09F000DDA48 /* Strings.swift in Sources */, B1B558C420EF768F00210D55 /* RoomIncomingEncryptedTextMsgWithPaginationTitleWithoutSenderNameBubbleCell.m in Sources */, + 3232ABC022594C0900AD6A5C /* VerifyEmojiCollectionViewCell.swift in Sources */, B1B5572F20EE6C4D00210D55 /* ReadReceiptsViewController.m in Sources */, B1B558CB20EF768F00210D55 /* RoomIncomingEncryptedTextMsgWithoutSenderInfoBubbleCell.m in Sources */, B169330B20F3CA3A00746532 /* Contact.m in Sources */, @@ -3631,6 +3804,7 @@ B139C21B21FE5B9200BB68EC /* KeyBackupRecoverFromPassphraseViewModel.swift in Sources */, B1B5574A20EE6C4D00210D55 /* MediaPickerViewController.m in Sources */, B1B5598520EFC3E000210D55 /* RageShakeManager.m in Sources */, + 3232ABA8225730E100AD6A5C /* DeviceVerificationStartViewState.swift in Sources */, B1B558D420EF768F00210D55 /* RoomOutgoingEncryptedTextMsgWithoutSenderInfoBubbleCell.m in Sources */, B169331420F3CAFC00746532 /* PublicRoomTableViewCell.m in Sources */, 32BF995721FB07A400698084 /* SettingsKeyBackupTableViewSection.swift in Sources */, @@ -3638,7 +3812,9 @@ B1B558E120EF768F00210D55 /* RoomMembershipCollapsedBubbleCell.m in Sources */, B1B5571A20EE6C4D00210D55 /* SettingsViewController.m in Sources */, B1CE9EFD22148703000FAE6A /* SignOutAlertPresenter.swift in Sources */, + 32F6B9692270623100BBA352 /* DeviceVerificationDataLoadingCoordinator.swift in Sources */, B1B5594720EF7BD000210D55 /* RoomCollectionViewCell.m in Sources */, + B10CFBC32268D99D00A5842E /* JitsiService.swift in Sources */, B1B558C120EF768F00210D55 /* RoomIncomingEncryptedAttachmentWithPaginationTitleBubbleCell.m in Sources */, B1B5573E20EE6C4D00210D55 /* RiotNavigationController.m in Sources */, B1B5593B20EF7BAC00210D55 /* TableViewCellWithCheckBoxAndLabel.m in Sources */, @@ -3653,8 +3829,11 @@ B1B5573D20EE6C4D00210D55 /* WebViewViewController.m in Sources */, 3209451221F1C1430088CAA2 /* BlackTheme.swift in Sources */, B1B5572720EE6C4D00210D55 /* RoomSearchViewController.m in Sources */, + 3232ABBC2257BE6500AD6A5C /* DeviceVerificationVerifyViewAction.swift in Sources */, F05927C91FDED836009F2A68 /* MXGroup+Riot.m in Sources */, B1B5594520EF7BD000210D55 /* TableViewCellWithCollectionView.m in Sources */, + 32891D75226728EE00C82226 /* DeviceVerificationDataLoadingViewController.swift in Sources */, + 32891D712264DF7B00C82226 /* DeviceVerificationVerifiedViewController.swift in Sources */, F083BDEF1E7009ED00A9B29C /* UINavigationController+Riot.m in Sources */, B1B5581F20EF625800210D55 /* SimpleRoomTitleView.m in Sources */, B169330020F3C97D00746532 /* RoomDataSource.m in Sources */, @@ -3663,11 +3842,15 @@ 3232AB512256558300AD6A5C /* TemplateScreenViewAction.swift in Sources */, 3232AB4E2256558300AD6A5C /* TemplateScreenViewModelType.swift in Sources */, B1B5590520EF768F00210D55 /* RoomIncomingTextMsgWithoutSenderInfoBubbleCell.m in Sources */, + 3232ABA5225730E100AD6A5C /* DeviceVerificationStartViewModelType.swift in Sources */, B1B558DD20EF768F00210D55 /* RoomIncomingEncryptedTextMsgBubbleCell.m in Sources */, B1098BE521ECE1FC000DDA48 /* Storyboards.swift in Sources */, + 3232ABC2225B996200AD6A5C /* Themable.swift in Sources */, + 3232ABA7225730E100AD6A5C /* DeviceVerificationStartCoordinator.swift in Sources */, B1D4752721EE4E630067973F /* KeyboardAvoider.swift in Sources */, B1D4752821EE4E630067973F /* KeyboardNotification.swift in Sources */, B1B5573C20EE6C4D00210D55 /* MasterTabBarController.m in Sources */, + 32F6B96E2270623100BBA352 /* DeviceVerificationDataLoadingViewModelType.swift in Sources */, B1B5592C20EF7A5D00210D55 /* TableViewCellWithButton.m in Sources */, 32242F1421E8FBA900725742 /* DefaultTheme.swift in Sources */, 32242F1321E8FBA900725742 /* Theme.swift in Sources */, @@ -3675,24 +3858,31 @@ B1B5582C20EF666100210D55 /* DirectoryRecentTableViewCell.m in Sources */, B1B558E420EF768F00210D55 /* RoomMembershipWithPaginationTitleBubbleCell.m in Sources */, B1B5573620EE6C4D00210D55 /* GroupsViewController.m in Sources */, + 3232ABB82257BE6500AD6A5C /* DeviceVerificationVerifyCoordinator.swift in Sources */, B1B5572A20EE6C4D00210D55 /* RoomMemberDetailsViewController.m in Sources */, B1B5590120EF768F00210D55 /* RoomMembershipExpandedWithPaginationTitleBubbleCell.m in Sources */, + 32F6B96B2270623100BBA352 /* DeviceVerificationDataLoadingViewAction.swift in Sources */, B1B558C920EF768F00210D55 /* RoomIncomingEncryptedAttachmentWithoutSenderInfoBubbleCell.m in Sources */, B1B5571B20EE6C4D00210D55 /* DeactivateAccountViewController.m in Sources */, B1B5590620EF768F00210D55 /* RoomMembershipCollapsedWithPaginationTitleBubbleCell.m in Sources */, B139C21D21FE5BF500BB68EC /* KeyBackupRecoverFromPassphraseViewModelType.swift in Sources */, F083BE031E7009ED00A9B29C /* EventFormatter.m in Sources */, + 324A2056225FC571004FE8B0 /* DeviceVerificationIncomingCoordinator.swift in Sources */, B16932F720F3C50E00746532 /* RecentsDataSource.m in Sources */, 3232AB4F2256558300AD6A5C /* TemplateScreenViewController.swift in Sources */, B1B558FC20EF768F00210D55 /* RoomIncomingTextMsgWithPaginationTitleBubbleCell.m in Sources */, B1B5572920EE6C4D00210D55 /* RoomFilesViewController.m in Sources */, + 3232ABBA2257BE6500AD6A5C /* DeviceVerificationVerifyViewModel.swift in Sources */, B1098C1021ED07E4000DDA48 /* Presentable.swift in Sources */, B1B558E020EF768F00210D55 /* RoomOutgoingTextMsgBubbleCell.m in Sources */, B1B5593C20EF7BAC00210D55 /* TableViewCellWithCheckBoxes.m in Sources */, + 32891D6B2264CBA300C82226 /* SimpleScreenTemplateViewController.swift in Sources */, B1CA3A2721EF6914000D1D89 /* UIViewController.swift in Sources */, F0D2ADA11F6AA5FD00A7097D /* MXRoomSummary+Riot.m in Sources */, B1B5596F20EFA85D00210D55 /* EncryptionInfoView.m in Sources */, B1B5573820EE6C4D00210D55 /* GroupParticipantsViewController.m in Sources */, + 3232ABBB2257BE6500AD6A5C /* DeviceVerificationVerifyViewState.swift in Sources */, + 3232ABAB225730E100AD6A5C /* DeviceVerificationCoordinator.swift in Sources */, B1B5583E20EF6E7F00210D55 /* GroupRoomTableViewCell.m in Sources */, B14F143522144F6500FA0595 /* KeyBackupRecoverFromRecoveryKeyViewController.swift in Sources */, B1B5574F20EE6C4D00210D55 /* RoomsViewController.m in Sources */, @@ -3702,6 +3892,7 @@ B1B5579A20EF575B00210D55 /* ForgotPasswordInputsView.m in Sources */, B1B558CC20EF768F00210D55 /* RoomOutgoingEncryptedAttachmentWithoutSenderInfoBubbleCell.m in Sources */, B1B5571D20EE6C4D00210D55 /* HomeViewController.m in Sources */, + 3232ABA6225730E100AD6A5C /* DeviceVerificationStartViewController.swift in Sources */, B16932EA20F3C39000746532 /* UnifiedSearchRecentsDataSource.m in Sources */, B1B557DE20EF5FBB00210D55 /* FilesSearchTableViewCell.m in Sources */, B1B5574020EE6C4D00210D55 /* SegmentedViewController.m in Sources */, @@ -3721,6 +3912,7 @@ B1B5578F20EF568D00210D55 /* GroupTableViewCell.m in Sources */, B1B5573220EE6C4D00210D55 /* GroupHomeViewController.m in Sources */, B1B5595220EF9A8700210D55 /* RecentTableViewCell.m in Sources */, + 32F6B96C2270623100BBA352 /* DeviceVerificationDataLoadingCoordinatorType.swift in Sources */, B1B5574120EE6C4D00210D55 /* RecentsViewController.m in Sources */, B1D250D82118AA0A000F4E93 /* RoomPredecessorBubbleCell.m in Sources */, B1B5577120EE702800210D55 /* StickerPickerViewController.m in Sources */, @@ -3742,6 +3934,7 @@ B1B558E620EF768F00210D55 /* RoomIncomingAttachmentWithoutSenderInfoBubbleCell.m in Sources */, B1098BFB21ECFE65000DDA48 /* KeyBackupSetupCoordinatorType.swift in Sources */, B1098BF721ECFE65000DDA48 /* PasswordStrength.swift in Sources */, + 324A2052225FC571004FE8B0 /* DeviceVerificationIncomingViewAction.swift in Sources */, B105778D2213051E00334B1E /* KeyBackupSetupSuccessFromRecoveryKeyViewController.swift in Sources */, B1B557D820EF5EA900210D55 /* RoomActivitiesView.m in Sources */, B1B5596620EF9E9B00210D55 /* RoomTableViewCell.m in Sources */, @@ -3753,6 +3946,7 @@ B1B5571820EE6C4D00210D55 /* CountryPickerViewController.m in Sources */, B17982FF2119FED2001FD722 /* GDPRConsentViewController.swift in Sources */, B1098BE121ECE09F000DDA48 /* Images.swift in Sources */, + 3232ABA4225730E100AD6A5C /* DeviceVerificationStartViewAction.swift in Sources */, B1B5575A20EE6C4D00210D55 /* UnifiedSearchViewController.m in Sources */, 3232AB492256558300AD6A5C /* FlowTemplateCoordinatorBridgePresenter.swift in Sources */, B1B5572820EE6C4D00210D55 /* RoomViewController.m in Sources */, @@ -3764,15 +3958,19 @@ B1B558C820EF768F00210D55 /* RoomIncomingEncryptedAttachmentBubbleCell.m in Sources */, B1B557C620EF5CD400210D55 /* DirectoryServerDetailTableViewCell.m in Sources */, B1B5590920EF768F00210D55 /* RoomEmptyBubbleCell.m in Sources */, + 324A2054225FC571004FE8B0 /* DeviceVerificationIncomingCoordinatorType.swift in Sources */, + 3232ABB92257BE6500AD6A5C /* DeviceVerificationVerifyViewController.swift in Sources */, B139C21F21FE5D6600BB68EC /* KeyBackupRecoverFromPassphraseViewAction.swift in Sources */, B1B5574720EE6C4D00210D55 /* UsersDevicesViewController.m in Sources */, B1098BFF21ECFE65000DDA48 /* PasswordStrengthView.swift in Sources */, B1B558D220EF768F00210D55 /* RoomEncryptedDataBubbleCell.m in Sources */, B1B558FA20EF768F00210D55 /* RoomMembershipBubbleCell.m in Sources */, + 3232ABA1225730E100AD6A5C /* DeviceVerificationCoordinatorType.swift in Sources */, B1B557BF20EF5B4500210D55 /* DisabledRoomInputToolbarView.m in Sources */, B1B5578620EF564900210D55 /* GroupTableViewCellWithSwitch.m in Sources */, B1098BE821ECFE52000DDA48 /* Coordinator.swift in Sources */, B1B557E920EF60F500210D55 /* MessagesSearchResultTextMsgBubbleCell.m in Sources */, + 324A2050225FC571004FE8B0 /* DeviceVerificationIncomingViewController.swift in Sources */, B1098C0D21ED07E4000DDA48 /* NavigationRouter.swift in Sources */, B110872321F098F0003554A5 /* ActivityIndicatorPresenterType.swift in Sources */, B139C22321FF01B200BB68EC /* KeyBackupRecoverFromPassphraseCoordinatorType.swift in Sources */, @@ -3792,12 +3990,15 @@ B16932EE20F3C3C900746532 /* FilesSearchCellData.m in Sources */, B1B558E520EF768F00210D55 /* RoomMembershipExpandedBubbleCell.m in Sources */, 32BF995121FA29DC00698084 /* SettingsKeyBackupViewModelType.swift in Sources */, + 32F6B96A2270623100BBA352 /* DeviceVerificationDataLoadingViewState.swift in Sources */, 32BF995321FA2A1300698084 /* SettingsKeyBackupViewState.swift in Sources */, B1B5599420EFC5E400210D55 /* DecryptionFailureTracker.m in Sources */, F083BDF01E7009ED00A9B29C /* UIViewController+RiotSearch.m in Sources */, F083BDF91E7009ED00A9B29C /* RoomEmailInvitation.m in Sources */, + 324A2055225FC571004FE8B0 /* DeviceVerificationIncomingViewModelType.swift in Sources */, B1B5572C20EE6C4D00210D55 /* RoomParticipantsViewController.m in Sources */, B1B558EE20EF768F00210D55 /* RoomOutgoingAttachmentBubbleCell.m in Sources */, + 3232ABB52257BE6400AD6A5C /* DeviceVerificationVerifyCoordinatorType.swift in Sources */, 32BF994F21FA29A400698084 /* SettingsKeyBackupViewModel.swift in Sources */, B1B5574920EE6C4D00210D55 /* RiotSplitViewController.m in Sources */, B1B5574E20EE6C4D00210D55 /* DirectoryServerPickerViewController.m in Sources */, @@ -4189,7 +4390,7 @@ "\"$(PROJECT_DIR)/Riot/libs/jitsi-meet\"", ); INFOPLIST_FILE = Riot/SupportingFiles/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -4230,7 +4431,7 @@ "\"$(PROJECT_DIR)/Riot/libs/jitsi-meet\"", ); INFOPLIST_FILE = Riot/SupportingFiles/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index e401702c8..872f3bf8a 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -84,7 +84,7 @@ NSString *const kAppDelegateDidTapStatusBarNotification = @"kAppDelegateDidTapStatusBarNotification"; NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateNetworkStatusDidChangeNotification"; -@interface AppDelegate () +@interface AppDelegate () { /** Reachability observer @@ -128,6 +128,16 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN */ RoomKeyRequestViewController *roomKeyRequestViewController; + /** + Incoming device verification requests observers + */ + id incomingDeviceVerificationObserver; + + /** + If any the currently displayed device verification dialog + */ + DeviceVerificationCoordinatorBridgePresenter *deviceVerificationCoordinatorBridgePresenter; + /** Account picker used in case of multiple account. */ @@ -481,6 +491,15 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN // Add matrix observers, and initialize matrix sessions if the app is not launched in background. [self initMatrixSessions]; + + // Setup Jitsi + + NSString *jitsiServerStringURL = [[NSUserDefaults standardUserDefaults] objectForKey:@"jitsiServerURL"]; + NSURL *jitsiServerURL = [NSURL URLWithString:jitsiServerStringURL]; + + [JitsiService.shared configureDefaultConferenceOptionsWith:jitsiServerURL]; + + [JitsiService.shared application:application didFinishLaunchingWithOptions:launchOptions]; NSLog(@"[AppDelegate] didFinishLaunchingWithOptions: Done in %.0fms", [[NSDate date] timeIntervalSinceDate:startDate] * 1000); @@ -698,7 +717,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN NSLog(@"[AppDelegate] applicationDidReceiveMemoryWarning"); } -- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler +- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray> * _Nullable))restorationHandler { BOOL continueUserActivity = NO; @@ -1140,60 +1159,36 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN if (!isPushRegistered) { - if (@available(iOS 10, *)) { - UNTextInputNotificationAction *quickReply = [UNTextInputNotificationAction - actionWithIdentifier:@"inline-reply" - title:NSLocalizedStringFromTable(@"room_message_short_placeholder", @"Vector", nil) - options:UNNotificationActionOptionAuthenticationRequired - ]; - - UNNotificationCategory *quickReplyCategory = [UNNotificationCategory - categoryWithIdentifier:@"QUICK_REPLY" - actions:@[quickReply] - intentIdentifiers:@[] - options:UNNotificationCategoryOptionNone]; - - UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; - [center setNotificationCategories:[[NSSet alloc] initWithArray:@[quickReplyCategory]]]; - [center setDelegate:self]; // commenting this out will fall back to using the same AppDelegate methods as the iOS 9 way of doing this - - UNAuthorizationOptions authorizationOptions = (UNAuthorizationOptionAlert | UNAuthorizationOptionSound | UNAuthorizationOptionBadge); - - [center requestAuthorizationWithOptions:authorizationOptions - completionHandler:^(BOOL granted, NSError *error) - { // code here is equivalent to self:application:didRegisterUserNotificationSettings: - if (granted) { - [self registerForRemoteNotificationsWithCompletion:nil]; - } - else - { - // Clear existing token - [self clearPushNotificationToken]; - } - }]; - } - else // DEPRECATED, for iOS 9 - { - NSMutableSet *notificationCategories = [NSMutableSet set]; - - UIMutableUserNotificationAction *quickReply = [[UIMutableUserNotificationAction alloc] init]; - quickReply.title = NSLocalizedStringFromTable(@"room_message_short_placeholder", @"Vector", nil); - quickReply.identifier = @"inline-reply"; - quickReply.activationMode = UIUserNotificationActivationModeBackground; - quickReply.authenticationRequired = true; - quickReply.behavior = UIUserNotificationActionBehaviorTextInput; - - UIMutableUserNotificationCategory *quickReplyCategory = [[UIMutableUserNotificationCategory alloc] init]; - quickReplyCategory.identifier = @"QUICK_REPLY"; - [quickReplyCategory setActions:@[quickReply] forContext:UIUserNotificationActionContextDefault]; - [notificationCategories addObject:quickReplyCategory]; - - // Registration on iOS 8 and later - UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert) categories:notificationCategories]; - - NSLog(@"[AppDelegate][Push] registerUserNotificationSettings: %@", settings); - [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; - } + UNTextInputNotificationAction *quickReply = [UNTextInputNotificationAction + actionWithIdentifier:@"inline-reply" + title:NSLocalizedStringFromTable(@"room_message_short_placeholder", @"Vector", nil) + options:UNNotificationActionOptionAuthenticationRequired + ]; + + UNNotificationCategory *quickReplyCategory = [UNNotificationCategory + categoryWithIdentifier:@"QUICK_REPLY" + actions:@[quickReply] + intentIdentifiers:@[] + options:UNNotificationCategoryOptionNone]; + + UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; + [center setNotificationCategories:[[NSSet alloc] initWithArray:@[quickReplyCategory]]]; + [center setDelegate:self]; // commenting this out will fall back to using the same AppDelegate methods as the iOS 9 way of doing this + + UNAuthorizationOptions authorizationOptions = (UNAuthorizationOptionAlert | UNAuthorizationOptionSound | UNAuthorizationOptionBadge); + + [center requestAuthorizationWithOptions:authorizationOptions + completionHandler:^(BOOL granted, NSError *error) + { // code here is equivalent to self:application:didRegisterUserNotificationSettings: + if (granted) { + [self registerForRemoteNotificationsWithCompletion:nil]; + } + else + { + // Clear existing token + [self clearPushNotificationToken]; + } + }]; } } @@ -1208,23 +1203,6 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN self.pushRegistry.desiredPushTypes = [NSSet setWithObject:PKPushTypeVoIP]; } -// DEPRECATED, for iOS 9 -- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings -{ - NSLog(@"[AppDelegate][Push] didRegisterUserNotificationSettings: notificationSettings.types: %@", @(notificationSettings.types)); - - // Register for remote notifications only if user provide access to notification feature - if (notificationSettings.types != UIUserNotificationTypeNone) - { - [self registerForRemoteNotificationsWithCompletion:nil]; - } - else - { - // Clear existing token - [self clearPushNotificationToken]; - } -} - // iOS 10+, see application:handleActionWithIdentifier:forLocalNotification:withResponseInfo:completionHandler: - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler { @@ -1278,38 +1256,6 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN } } -// DEPRECATED, for iOS 9 -// "This block is not a prototype" - don't fix this, or it won't match Apple's definition -- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forLocalNotification:(UILocalNotification *)notification withResponseInfo:(NSDictionary *)responseInfo completionHandler:(void (^)())completionHandler -{ - NSLog(@"[AppDelegate][Push] handleActionWithIdentifier: identifier: %@", identifier); - - NSString* roomId = notification.userInfo[@"room_id"]; - - if ([identifier isEqualToString: @"inline-reply"]) - { - NSString* responseText = responseInfo[UIUserNotificationActionResponseTypedTextKey]; - - [self handleNotificationInlineReplyForRoomId:roomId withResponseText:responseText success:^(NSString *eventId) { - completionHandler(); - } failure:^(NSError *error) { - - UILocalNotification* failureNotification = [[UILocalNotification alloc] init]; - failureNotification.alertBody = NSLocalizedStringFromTable(@"room_event_failed_to_send", @"Vector", nil); - failureNotification.userInfo = notification.userInfo; - [[UIApplication sharedApplication] scheduleLocalNotification: failureNotification]; - NSLog(@"[AppDelegate][Push] handleActionWithIdentifier: error sending text message: %@", error); - - completionHandler(); - }]; - } - else - { - NSLog(@"[AppDelegate][Push] handleActionWithIdentifier: unhandled identifier %@", identifier); - completionHandler(); - } -} - // iOS 10+, this is called when a notification is about to display in foreground. - (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler { @@ -1318,15 +1264,6 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN completionHandler(UNNotificationPresentationOptionNone); } -// DEPRECATED, for iOS 9 -- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification -{ - NSLog(@"[AppDelegate][Push] didReceiveLocalNotification: applicationState: %@", @(application.applicationState)); - - NSString* roomId = notification.userInfo[@"room_id"]; - [self navigateToRoomById:roomId]; -} - - (void)navigateToRoomById:(NSString *)roomId { if (roomId.length) @@ -1503,15 +1440,6 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN BOOL checkReadEvent = YES; MXEvent *event; - // Ignore event already notified to the user - // only necessary on iOS 9, iOS 10 will just overwrite notifications with identical IDs - if (@available(iOS 10, *)) {} - else if ([self displayedLocalNotificationForEvent:eventId andUser:userId type:nil]) - { - NSLog(@"[AppDelegate][Push] handleLocalNotificationsForAccount: Skip event already displayed in a notification. Event id: %@", eventId); - continue; - } - if (eventId && roomId) { event = [account.mxSession.store eventWithEventId:eventId inRoom:roomId]; @@ -1521,16 +1449,8 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN { if (event.isRedactedEvent) { - if (@available(iOS 10, *)) - { - // Collect redacted event ids to remove possible delivered redacted notifications - [redactedEventIds addObject:eventId]; - } - else - { - // Ignore redacted event. - NSLog(@"[AppDelegate][Push] handleLocalNotificationsForAccount: Skip redacted event. Event id: %@", eventId); - } + // Collect redacted event ids to remove possible delivered redacted notifications + [redactedEventIds addObject:eventId]; continue; } @@ -1575,81 +1495,43 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN // Prepare the local notification MXPushRule *rule = eventDict[@"push_rule"]; - if (@available(iOS 10, *)) - { - [self notificationContentForEvent:event pushRule:rule inAccount:account onComplete:^(UNNotificationContent * _Nullable notificationContent) { + [self notificationContentForEvent:event pushRule:rule inAccount:account onComplete:^(UNNotificationContent * _Nullable notificationContent) { + + if (notificationContent) + { + UNNotificationRequest *request = [UNNotificationRequest requestWithIdentifier:eventId + content:notificationContent + trigger:nil]; - if (notificationContent) - { - UNNotificationRequest *request = [UNNotificationRequest requestWithIdentifier:eventId - content:notificationContent - trigger:nil]; + [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request withCompletionHandler:^(NSError * _Nullable error) { - [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request withCompletionHandler:^(NSError * _Nullable error) { - - if (error) - { - NSLog(@"[AppDelegate][Push] handleLocalNotificationsForAccount: Fail to display notification for event %@ with error: %@", eventId, error); - } - else - { - NSLog(@"[AppDelegate][Push] handleLocalNotificationsForAccount: Display notification for event %@", eventId); - } - }]; - - scheduledNotifications++; - } - else - { - NSLog(@"[AppDelegate][Push] handleLocalNotificationsForAccount: Skip event with empty generated content. Event id: %@", eventId); - } - }]; - } - else - { - [self notificationBodyForEvent:event pushRule:rule inAccount:account onComplete:^(NSString *_Nullable notificationBody) - { - if (notificationBody) - { - NSLog(@"[AppDelegate][Push] handleLocalNotificationsForAccount: Display notification for event %@", eventId); - - // Printf style escape characters are stripped from the string prior to display; - // to include a percent symbol (%) in the message, use two percent symbols (%%). - NSString *fixedNotificationBody = [notificationBody stringByReplacingOccurrencesOfString:@"%" withString:@"%%"]; - - NSDictionary *notificationUserInfo = [self notificationUserInfoForEvent:event andUserId:userId]; - NSString *categoryIdentifier = [self notificationCategoryIdentifierForEvent:event]; - NSString *soundName = [self notificationSoundNameFromPushRule:rule]; - - UILocalNotification *eventNotification = [[UILocalNotification alloc] init]; - eventNotification.alertBody = fixedNotificationBody; - eventNotification.userInfo = notificationUserInfo; - eventNotification.category = categoryIdentifier; - eventNotification.soundName = soundName; - - [[UIApplication sharedApplication] scheduleLocalNotification:eventNotification]; - - scheduledNotifications++; - } - else - { - NSLog(@"[AppDelegate][Push] handleLocalNotificationsForAccount: Skip event with empty generated notificationBody. Event id: %@", eventId); - } - }]; - } + if (error) + { + NSLog(@"[AppDelegate][Push] handleLocalNotificationsForAccount: Fail to display notification for event %@ with error: %@", eventId, error); + } + else + { + NSLog(@"[AppDelegate][Push] handleLocalNotificationsForAccount: Display notification for event %@", eventId); + } + }]; + + scheduledNotifications++; + } + else + { + NSLog(@"[AppDelegate][Push] handleLocalNotificationsForAccount: Skip event with empty generated content. Event id: %@", eventId); + } + }]; } } - if (@available(iOS 10, *)) + // Remove possible pending and delivered notifications having a redacted event id + if (redactedEventIds.count) { - // Remove possible pending and delivered notifications having a redacted event id - if (redactedEventIds.count) - { - NSLog(@"[AppDelegate][Push] handleLocalNotificationsForAccount: Remove possible notification with redacted event ids: %@", redactedEventIds); - - [[UNUserNotificationCenter currentNotificationCenter] removePendingNotificationRequestsWithIdentifiers:redactedEventIds]; - [[UNUserNotificationCenter currentNotificationCenter] removeDeliveredNotificationsWithIdentifiers:redactedEventIds]; - } + NSLog(@"[AppDelegate][Push] handleLocalNotificationsForAccount: Remove possible notification with redacted event ids: %@", redactedEventIds); + + [[UNUserNotificationCenter currentNotificationCenter] removePendingNotificationRequestsWithIdentifiers:redactedEventIds]; + [[UNUserNotificationCenter currentNotificationCenter] removeDeliveredNotificationsWithIdentifiers:redactedEventIds]; } NSLog(@"[AppDelegate][Push] handleLocalNotificationsForAccount: Sent %tu local notifications for %tu events", scheduledNotifications, eventsArray.count); @@ -2040,15 +1922,6 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN for (NSString *eventId in events) { - // Ignore event already notified to the user - // only necessary on iOS 9, iOS 10 will just overwrite notifications with identical IDs - if (@available(iOS 10, *)) {} - else if ([self displayedLocalNotificationForEvent:eventId andUser:userId type:nil]) - { - NSLog(@"[AppDelegate][Push] handleLocalNotificationsForAccount: Skip event already displayed in a notification. Event id: %@", eventId); - continue; - } - // Build notification user info NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:@{ @"type": @"limited", @@ -2068,27 +1941,15 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN NSLog(@"[AppDelegate][Push] handleLocalNotificationsForFailedSync: room_id is missing for event %@ in payload %@", eventId, payload); } - if (@available(iOS 10, *)) - { - UNMutableNotificationContent *localNotificationContentForFailedSync = [[UNMutableNotificationContent alloc] init]; - localNotificationContentForFailedSync.userInfo = userInfo; - localNotificationContentForFailedSync.body = [self limitedNotificationBodyForEvent:eventId inMatrixSession:mxSession]; - localNotificationContentForFailedSync.threadIdentifier = roomId; - - UNNotificationRequest *request = [UNNotificationRequest requestWithIdentifier:eventId content:localNotificationContentForFailedSync trigger:nil]; - - NSLog(@"[AppDelegate][Push] handleLocalNotificationsForFailedSync: Display notification for event %@", eventId); - [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request withCompletionHandler:nil]; - } - else // DEPRECATED, for iOS 9 - { - UILocalNotification *localNotificationForFailedSync = [[UILocalNotification alloc] init]; - localNotificationForFailedSync.userInfo = userInfo; - localNotificationForFailedSync.alertBody = [self limitedNotificationBodyForEvent:eventId inMatrixSession:mxSession]; - - NSLog(@"[AppDelegate][Push] handleLocalNotificationsForFailedSync: Display notification for event %@", eventId); - [[UIApplication sharedApplication] scheduleLocalNotification:localNotificationForFailedSync]; - } + UNMutableNotificationContent *localNotificationContentForFailedSync = [[UNMutableNotificationContent alloc] init]; + localNotificationContentForFailedSync.userInfo = userInfo; + localNotificationContentForFailedSync.body = [self limitedNotificationBodyForEvent:eventId inMatrixSession:mxSession]; + localNotificationContentForFailedSync.threadIdentifier = roomId; + + UNNotificationRequest *request = [UNNotificationRequest requestWithIdentifier:eventId content:localNotificationContentForFailedSync trigger:nil]; + + NSLog(@"[AppDelegate][Push] handleLocalNotificationsForFailedSync: Display notification for event %@", eventId); + [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request withCompletionHandler:nil]; } } @@ -2128,39 +1989,6 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN return notificationBody; } -/** - Return the already displayed notification for an event. - - @param eventId the id of the event attached to the notification to find. - @param userId the id of the user attached to the notification to find. - @param type the type of notification. @"full" or @"limited". nil for any type. - @return the local notification if any. - */ -// DEPRECATED, for iOS 9 -// TODO: This method does not work: [[UIApplication sharedApplication] scheduledLocalNotifications] is not reliable -- (UILocalNotification*)displayedLocalNotificationForEvent:(NSString*)eventId andUser:(NSString*)userId type:(NSString*)type -{ - NSLog(@"[AppDelegate][Push] displayedLocalNotificationForEvent: %@ andUser: %@. Current scheduledLocalNotifications: %@", eventId, userId, [[UIApplication sharedApplication] scheduledLocalNotifications]); - - UILocalNotification *limitedLocalNotification; - for (UILocalNotification *localNotification in [[UIApplication sharedApplication] scheduledLocalNotifications]) - { - NSLog(@" - %@", localNotification.userInfo); - - if ([localNotification.userInfo[@"event_id"] isEqualToString:eventId] - && [localNotification.userInfo[@"user_id"] isEqualToString:userId] - && (!type || [localNotification.userInfo[@"type"] isEqualToString:type])) - { - limitedLocalNotification = localNotification; - break; - } - } - - NSLog(@"[AppDelegate][Push] displayedLocalNotificationForEvent: found: %@", limitedLocalNotification); - - return limitedLocalNotification; -} - - (void)refreshApplicationIconBadgeNumber { // Consider the total number of missed discussions including the invites. @@ -2774,6 +2602,10 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN options:NSKeyValueObservingOptionNew context:NULL]; } + else + { + [self enableCallKit:NO forCallManager:mxSession.callManager]; + } } else { @@ -2868,6 +2700,7 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN { // Check if we need to display a key share dialog [self checkPendingRoomKeyRequests]; + [self checkPendingIncomingDeviceVerificationsInSession:mxSession]; } } @@ -3037,6 +2870,9 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN // Enable listening of incoming key share requests [self enableRoomKeyRequestObserver:mxSession]; + + // Enable listening of incoming device verification requests + [self enableIncomingDeviceVerificationObserver:mxSession]; } } @@ -3058,6 +2894,9 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN // Disable listening of incoming key share requests [self disableRoomKeyRequestObserver:mxSession]; + + // Disable listening of incoming device verification requests + [self disableIncomingDeviceVerificationObserver:mxSession]; [mxSessionArray removeObject:mxSession]; @@ -3444,11 +3283,20 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN - (void)enableCallKit:(BOOL)enable forCallManager:(MXCallManager *)callManager { + JitsiService.shared.enableCallKit = enable; + if (enable) { // Create adapter for Riot MXCallKitConfiguration *callKitConfiguration = [[MXCallKitConfiguration alloc] init]; callKitConfiguration.iconName = @"riot_icon_callkit"; + + NSData *riotCallKitIconData = UIImagePNGRepresentation([UIImage imageNamed:callKitConfiguration.iconName]); + + [JitsiService.shared configureCallKitProviderWithLocalizedName:callKitConfiguration.name + ringtoneName:callKitConfiguration.ringtoneName + iconTemplateImageData:riotCallKitIconData]; + MXCallKitAdapter *callKitAdapter = [[MXCallKitAdapter alloc] initWithConfiguration:callKitConfiguration]; id audioSessionConfigurator; @@ -4082,15 +3930,8 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN [_callStatusBarButton setTitle:buttonTitle forState:UIControlStateNormal]; [_callStatusBarButton setTitle:buttonTitle forState:UIControlStateHighlighted]; _callStatusBarButton.titleLabel.textColor = ThemeService.shared.theme.backgroundColor; - - if ([UIFont respondsToSelector:@selector(systemFontOfSize:weight:)]) - { - _callStatusBarButton.titleLabel.font = [UIFont systemFontOfSize:17 weight:UIFontWeightMedium]; - } - else - { - _callStatusBarButton.titleLabel.font = [UIFont boldSystemFontOfSize:17]; - } + + _callStatusBarButton.titleLabel.font = [UIFont systemFontOfSize:17 weight:UIFontWeightMedium]; [_callStatusBarButton setBackgroundColor:ThemeService.shared.theme.tintColor]; [_callStatusBarButton addTarget:self action:@selector(onCallStatusBarButtonPressed) forControlEvents:UIControlEventTouchUpInside]; @@ -4541,6 +4382,102 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN } } +#pragma mark - Incoming device verification requests handling + +- (void)enableIncomingDeviceVerificationObserver:(MXSession*)mxSession +{ + incomingDeviceVerificationObserver = + [[NSNotificationCenter defaultCenter] addObserverForName:MXDeviceVerificationManagerNewTransactionNotification + object:mxSession.crypto.deviceVerificationManager + queue:[NSOperationQueue mainQueue] + usingBlock:^(NSNotification *notif) + { + NSObject *object = notif.userInfo[MXDeviceVerificationManagerNotificationTransactionKey]; + if ([object isKindOfClass:MXIncomingSASTransaction.class]) + { + [self checkPendingIncomingDeviceVerificationsInSession:mxSession]; + } + }]; +} + +- (void)disableIncomingDeviceVerificationObserver:(MXSession*)mxSession +{ + if (incomingDeviceVerificationObserver) + { + [[NSNotificationCenter defaultCenter] removeObserver:incomingDeviceVerificationObserver]; + incomingDeviceVerificationObserver = nil; + } +} + +// Check if an incoming device verification dialog must be displayed for the given session +- (void)checkPendingIncomingDeviceVerificationsInSession:(MXSession*)mxSession +{ + if ([UIApplication sharedApplication].applicationState != UIApplicationStateActive) + { + NSLog(@"[AppDelegate][MXKeyVerification] checkPendingIncomingDeviceVerificationsInSession: called while the app is not active. Ignore it."); + return; + } + + [mxSession.crypto.deviceVerificationManager transactions:^(NSArray * _Nonnull transactions) { + + NSLog(@"[AppDelegate][MXKeyVerification] checkPendingIncomingDeviceVerificationsInSession: transactions: %@", transactions); + + for (MXDeviceVerificationTransaction *transaction in transactions) + { + if (transaction.isIncoming) + { + MXIncomingSASTransaction *incomingTransaction = (MXIncomingSASTransaction*)transaction; + if (incomingTransaction.state == MXSASTransactionStateIncomingShowAccept) + { + [self presentIncomingDeviceVerification:incomingTransaction inSession:mxSession]; + break; + } + } + } + }]; +} + +// Check all opened MXSessions for incoming device verification dialog +- (void)checkPendingIncomingDeviceVerifications +{ + for (MXSession *mxSession in mxSessionArray) + { + [self checkPendingIncomingDeviceVerificationsInSession:mxSession]; + } +} + +- (BOOL)presentIncomingDeviceVerification:(MXIncomingSASTransaction*)transaction inSession:(MXSession*)mxSession +{ + NSLog(@"[AppDelegate][MXKeyVerification] presentIncomingDeviceVerification: %@", transaction); + + BOOL presented = NO; + if (!deviceVerificationCoordinatorBridgePresenter) + { + UIViewController *presentingViewController = self.window.rootViewController.presentedViewController ?: self.window.rootViewController; + + deviceVerificationCoordinatorBridgePresenter = [[DeviceVerificationCoordinatorBridgePresenter alloc] initWithSession:mxSession]; + deviceVerificationCoordinatorBridgePresenter.delegate = self; + + [deviceVerificationCoordinatorBridgePresenter presentFrom:presentingViewController incomingTransaction:transaction animated:YES]; + + presented = YES; + } + else + { + NSLog(@"[AppDelegate][MXKeyVerification] presentIncomingDeviceVerification: Controller already presented."); + } + return presented; +} + +- (void)deviceVerificationCoordinatorBridgePresenterDelegateDidComplete:(DeviceVerificationCoordinatorBridgePresenter *)coordinatorBridgePresenter otherUserId:(NSString * _Nonnull)otherUserId otherDeviceId:(NSString * _Nonnull)otherDeviceId +{ + [deviceVerificationCoordinatorBridgePresenter dismissWithAnimated:YES completion:^{ + [self checkPendingIncomingDeviceVerifications]; + }]; + + deviceVerificationCoordinatorBridgePresenter = nil; +} + #pragma mark - GDPR consent // Observe user GDPR consent not given diff --git a/Riot/Assets/Riot-Defaults.plist b/Riot/Assets/Riot-Defaults.plist index fb433da71..78e606c72 100644 --- a/Riot/Assets/Riot-Defaults.plist +++ b/Riot/Assets/Riot-Defaults.plist @@ -28,6 +28,8 @@ https://scalar.vector.im/ integrationsRestUrl https://scalar.vector.im/api + jitsiServerURL + https://jitsi.riot.im integrationsWidgetsUrls https://scalar-staging.riot.im/scalar/api diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index f1bc2ab91..e902b158e 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -431,11 +431,11 @@ "settings_key_backup_info" = "Encrypted messages are secured with end-to-end encryption. Only you and the recipient(s) have the keys to read these messages."; "settings_key_backup_info_checking" = "Checking..."; "settings_key_backup_info_none" = "Your keys are not being backed up from this device."; -"settings_key_backup_info_signout_warning" = "Back up your keys before signing out to avoid losing them."; +"settings_key_backup_info_signout_warning" = "Connect this device to key backup before signing out to avoid losing any keys that may only be on this device."; "settings_key_backup_info_version" = "Key Backup Version: %@"; "settings_key_backup_info_algorithm" = "Algorithm: %@"; "settings_key_backup_info_valid" = "This device is backing up your keys."; -"settings_key_backup_info_not_valid" = "This device is not backing up your keys."; +"settings_key_backup_info_not_valid" = "This device is not backing up your keys, but you do have an existing backup you can restore from and add to going forward."; "settings_key_backup_info_progress" = "Backing up %@ keys..."; "settings_key_backup_info_progress_done" = "All keys backed up"; @@ -449,7 +449,7 @@ "settings_key_backup_button_create" = "Start using Key Backup"; "settings_key_backup_button_restore" = "Restore from Backup"; "settings_key_backup_button_delete" = "Delete Backup"; -"settings_key_backup_button_use" = "Use key backup"; +"settings_key_backup_button_connect" = "Connect this device to Key Backup"; "settings_key_backup_delete_confirmation_prompt_title" = "Delete Backup"; "settings_key_backup_delete_confirmation_prompt_msg" = "Are you sure? You will lose your encrypted messages if your keys are not backed up properly."; @@ -694,7 +694,7 @@ "key_backup_setup_intro_title" = "Never lose encrypted messages"; "key_backup_setup_intro_info" = "Messages in encrypted rooms are secured with end-to-end encryption. Only you and the recipient(s) have the keys to read these messages.\n\nSecurely back up your keys to avoid losing them."; "key_backup_setup_intro_setup_action_without_existing_backup" = "Start using Key Backup"; -"key_backup_setup_intro_setup_action_with_existing_backup" = "Use Key Backup"; +"key_backup_setup_intro_setup_connect_action_with_existing_backup" = "Connect this device to Key Backup"; "key_backup_setup_intro_manual_export_info" = "(Advanced)"; "key_backup_setup_intro_manual_export_action" = "Manually export keys"; @@ -773,7 +773,7 @@ // Recover "key_backup_recover_banner_title" = "Never lose encrypted messages"; -"key_backup_recover_banner_subtitle" = "Use Key Backup"; +"key_backup_recover_connent_banner_subtitle" = "Connect this device to Key Backup"; // MARK: Sign out warning @@ -792,3 +792,99 @@ "sign_out_key_backup_in_progress_alert_title" = "Key backup in progress. If you sign out now you’ll lose access to your encrypted messages."; "sign_out_key_backup_in_progress_alert_discard_key_backup_action" = "I don't want my encrypted messages"; "sign_out_key_backup_in_progress_alert_cancel_action" = "I'll wait"; + +// MARK: - Device Verification +"device_verification_title" = "Verify device"; +"device_verification_security_advice" = "For maximum security, we recommend you do this in person or use another trusted means of communication"; +"device_verification_cancelled" = "The other party cancelled the verification."; +"device_verification_cancelled_by_me" = "The verification has been cancelled. Reason: %@"; +"device_verification_error_cannot_load_device" = "Cannot load device information."; + +// Mark: Incoming +"device_verification_incoming_title" = "Incoming Verification Request"; +"device_verification_incoming_description_1" = "Verify this device to mark it as trusted. Trusting devices of partners gives you extra peace of mind when using end-to-end encrypted messages."; +"device_verification_incoming_description_2" = "Verifying this device will mark it as trusted, and also mark your device as trusted to the partner."; + +// MARK: Start +"device_verification_start_title" = "Verify by comparing a short text string"; +"device_verification_start_wait_partner" = "Waiting for partner to accept..."; +"device_verification_start_use_legacy" = "Nothing appearing? Not all clients supports interactive verification yet. Use legacy verification."; +"device_verification_start_verify_button" = "Begin Verifying"; +"device_verification_start_use_legacy_action" = "Use Legacy Verification"; + +// MARK: Verify +"device_verification_verify_title_emoji" = "Verify this device by confirming the following emoji appear on the screen of the partner"; +"device_verification_verify_title_number" = "Verify this device by confirming the following numbers appear on the screen of the partner"; +"device_verification_verify_wait_partner" = "Waiting for partner to confirm..."; + +// MARK: Verified +"device_verification_verified_title" = "Verified!"; +"device_verification_verified_description_1" = "You've successfully verified this device."; +"device_verification_verified_description_2" = "Secure messages with this user are end-to-end encrypted and not able to be read by third parties."; +"device_verification_verified_got_it_button" = "Got it"; + +// MARK: Emoji +"device_verification_emoji_dog" = "Dog"; +"device_verification_emoji_cat" = "Cat"; +"device_verification_emoji_lion" = "Lion"; +"device_verification_emoji_horse" = "Horse"; +"device_verification_emoji_unicorn" = "Unicorn"; +"device_verification_emoji_pig" = "Pig"; +"device_verification_emoji_elephant" = "Elephant"; +"device_verification_emoji_rabbit" = "Rabbit"; +"device_verification_emoji_panda" = "Panda"; +"device_verification_emoji_rooster" = "Rooster"; +"device_verification_emoji_penguin" = "Penguin"; +"device_verification_emoji_turtle" = "Turtle"; +"device_verification_emoji_fish" = "Fish"; +"device_verification_emoji_octopus" = "Octopus"; +"device_verification_emoji_butterfly" = "Butterfly"; +"device_verification_emoji_flower" = "Flower"; +"device_verification_emoji_tree" = "Tree"; +"device_verification_emoji_cactus" = "Cactus"; +"device_verification_emoji_mushroom" = "Mushroom"; +"device_verification_emoji_globe" = "Globe"; +"device_verification_emoji_moon" = "Moon"; +"device_verification_emoji_cloud" = "Cloud"; +"device_verification_emoji_fire" = "Fire"; +"device_verification_emoji_banana" = "Banana"; +"device_verification_emoji_apple" = "Apple"; +"device_verification_emoji_strawberry" = "Strawberry"; +"device_verification_emoji_corn" = "Corn"; +"device_verification_emoji_pizza" = "Pizza"; +"device_verification_emoji_cake" = "Cake"; +"device_verification_emoji_heart" = "Heart"; +"device_verification_emoji_smiley" = "Smiley"; +"device_verification_emoji_robot" = "Robot"; +"device_verification_emoji_hat" = "Hat"; +"device_verification_emoji_glasses" = "Glasses"; +"device_verification_emoji_spanner" = "Spanner"; +"device_verification_emoji_santa" = "Santa"; +"device_verification_emoji_thumbs up" = "Thumbs up"; +"device_verification_emoji_umbrella" = "Umbrella"; +"device_verification_emoji_hourglass" = "Hourglass"; +"device_verification_emoji_clock" = "Class"; +"device_verification_emoji_gift" = "Gift"; +"device_verification_emoji_light bulb" = "Light Bulb"; +"device_verification_emoji_book" = "Book"; +"device_verification_emoji_pencil" = "Pencil"; +"device_verification_emoji_paperclip" = "Paperclip"; +"device_verification_emoji_scissors" = "Scissors"; +"device_verification_emoji_padlock" = "Padlock"; +"device_verification_emoji_key" = "Key"; +"device_verification_emoji_hammer" = "Hammer"; +"device_verification_emoji_telephone" = "Telephone"; +"device_verification_emoji_flag" = "Flag"; +"device_verification_emoji_train" = "Train"; +"device_verification_emoji_bicycle" = "Bicycle"; +"device_verification_emoji_aeroplane" = "Aeroplane"; +"device_verification_emoji_rocket" = "Rocket"; +"device_verification_emoji_trophy" = "Trophy"; +"device_verification_emoji_ball" = "Ball"; +"device_verification_emoji_guitar" = "Guitar"; +"device_verification_emoji_trumpet" = "Trumpet"; +"device_verification_emoji_bell" = "Ball"; +"device_verification_emoji_anchor" = "Anchor"; +"device_verification_emoji_headphones" = "Headphones"; +"device_verification_emoji_folder" = "Folder"; +"device_verification_emoji_pin" = "Pin"; diff --git a/Riot/Assets/ja.lproj/Localizable.strings b/Riot/Assets/ja.lproj/Localizable.strings index f81b270ee..51a5c3d85 100644 --- a/Riot/Assets/ja.lproj/Localizable.strings +++ b/Riot/Assets/ja.lproj/Localizable.strings @@ -47,6 +47,6 @@ /* Incoming named video conference invite from a specific person */ "VIDEO_CONF_NAMED_FROM_USER" = "映像つき会議通話の着信 from %@: '%@'"; /* A single unread message in a room */ -"SINGLE_UNREAD_IN_ROOM" = "%@にメッセージを受け取りました"; +"SINGLE_UNREAD_IN_ROOM" = "%@にメッセージを受け取りました"; /* A single unread message */ "SINGLE_UNREAD" = "あなたはメッセージを受け取りました"; diff --git a/Riot/Assets/ja.lproj/Vector.strings b/Riot/Assets/ja.lproj/Vector.strings index c526364de..f3312f925 100644 --- a/Riot/Assets/ja.lproj/Vector.strings +++ b/Riot/Assets/ja.lproj/Vector.strings @@ -246,7 +246,7 @@ // Room Preview "room_preview_invitation_format" = "あなたは %@ さんに呼ばれてこの部屋へ参加しました"; "room_preview_subtitle" = "これは部屋の下見です。発言があっても部屋は更新されません。"; -"room_preview_unlinked_email_warning" = "このアカウントに関連付けられていない %@ 宛に招待が送信されました。別のアカウントでログインするか、この電子メールアドレスをこのアカウントに追加することができます。"; +"room_preview_unlinked_email_warning" = "このアカウントに関連付けられていない %@ 宛に招待が送信されました。別のアカウントでログインするか、この電子メールアドレスをこのアカウントに追加することができます。"; "room_preview_try_join_an_unknown_room" = "あなたは %@ へ接続しようとしています。この会議に参加しますか?"; "room_preview_try_join_an_unknown_room_default" = "部屋"; // Settings @@ -435,7 +435,7 @@ "no_voip_title" = "通話着信中"; "no_voip" = "%@ さんから通話の着信がありましたが、 %@ は通話をまだサポートしていません。\nこの通知を無視して、別の端末から着信に応答することも、拒否することもできます。"; // Crash report -"google_analytics_use_prompt" = "匿名の誤動作報告と使用状況データを自動的に報告して%@の改善に役立てますか?"; +"google_analytics_use_prompt" = "匿名の誤動作報告と使用状況データを自動的に報告して%@の改善に役立てますか?"; // Crypto "e2e_enabling_on_app_update" = "Riotはend-to-end暗号化をサポートするようになりましたが、再度有効にするにはログインする必要があります。\n\nアプリの設定から再ログインできます。今すぐ、または後からでも構いません。"; "e2e_need_log_in_again" = "この端末のエンドツーエンド暗号鍵を生成し、接続先サーバに公開鍵を送信するには、再度ログインする必要があります。\n一度回線を切断します。ご不便おかけしてすみません。"; @@ -498,9 +498,9 @@ "settings_labs_room_members_lazy_loading_error_message" = "あなたのホームサーバーはまだルームメンバーの遅延ロードをサポートしていません。 後で試してください。"; "settings_deactivate_my_account" = "アカウントを無効にします"; "room_details_flair_section" = "コミュニティの特色を表示"; -"room_details_new_flair_placeholder" = "新しいコミュニティIDを追加 (例 +foo%@)"; +"room_details_new_flair_placeholder" = "新しいコミュニティIDを追加 (例 +foo%@)"; "room_details_flair_invalid_id_prompt_title" = "無効な形式"; -"room_details_flair_invalid_id_prompt_msg" = "%@はコミュニティの有効な識別子ではありません"; +"room_details_flair_invalid_id_prompt_msg" = "%@はコミュニティの有効な識別子ではありません"; "room_details_fail_to_update_room_communities" = "関連コミュニティを更新できない"; // Group Details "group_details_title" = "コミュニティの詳細"; @@ -512,15 +512,15 @@ "group_home_multi_members_format" = "%tu メンバー"; "group_home_one_room_format" = "1 部屋"; "group_home_multi_rooms_format" = "%tu 部屋"; -"group_invitation_format" = "%@がこのコミュニティにあなたを招待しました"; +"group_invitation_format" = "%@がこのコミュニティにあなたを招待しました"; // Group participants "group_participants_add_participant" = "参加者を追加"; "group_participants_leave_prompt_title" = "グループを退出"; "group_participants_leave_prompt_msg" = "本当にグループを退出しますか?"; "group_participants_remove_prompt_title" = "確認"; -"group_participants_remove_prompt_msg" = "本当にこのグループから%@を削除しますか?"; +"group_participants_remove_prompt_msg" = "本当にこのグループから%@を削除しますか?"; "group_participants_invite_prompt_title" = "確認"; -"group_participants_invite_prompt_msg" = "本当にこのグループに%@を招待しますか?"; +"group_participants_invite_prompt_msg" = "本当にこのグループに%@を招待しますか?"; "group_participants_filter_members" = "コミュニティメンバーをフィルタリング"; "group_participants_invite_another_user" = "ユーザーIDまたは名前による検索/招待"; "group_participants_invite_malformed_id_title" = "招待エラー"; @@ -535,13 +535,13 @@ "widget_sticker_picker_no_stickerpacks_alert_add_now" = "今すぐ追加しますか?"; // Room key request dialog "e2e_room_key_request_title" = "暗号化キー要求"; -"e2e_room_key_request_message_new_device" = "暗号化キーを要求している新しい端末 '%@'を追加しました。"; -"e2e_room_key_request_message" = "検証されていない端末 '%@'が暗号化キーを要求しています。"; +"e2e_room_key_request_message_new_device" = "暗号化キーを要求している新しい端末 '%@'を追加しました。"; +"e2e_room_key_request_message" = "検証されていない端末 '%@'が暗号化キーを要求しています。"; "e2e_room_key_request_start_verification" = "検証開始..."; "e2e_room_key_request_share_without_verifying" = "検証せずに共有"; "e2e_room_key_request_ignore_request" = "要求を無視"; // GDPR -"gdpr_consent_not_given_alert_message" = "%@ホームサーバーを引き続き使用するには、利用規約を確認して同意する必要があります。"; +"gdpr_consent_not_given_alert_message" = "%@ホームサーバーを引き続き使用するには、利用規約を確認して同意する必要があります。"; "gdpr_consent_not_given_alert_review_now_action" = "今レビュー"; "deactivate_account_title" = "無効なアカウント"; "deactivate_account_informations_part1" = "これにより、アカウントは永久に使用できなくなります。 ログインすることはできず、誰も同じユーザーIDを再登録することはできません。 これにより、あなたのアカウントは参加しているすべての部屋から退去し、あなたのIDサーバーからアカウントの詳細が削除されます。 "; diff --git a/Riot/Assets/zh_Hans.lproj/Vector.strings b/Riot/Assets/zh_Hans.lproj/Vector.strings index b0acd371e..e5a98d04f 100644 --- a/Riot/Assets/zh_Hans.lproj/Vector.strings +++ b/Riot/Assets/zh_Hans.lproj/Vector.strings @@ -577,7 +577,7 @@ // Share extension "share_extension_auth_prompt" = "登录主应用程序以共享内容"; "share_extension_failed_to_encrypt" = "发送失败。 请在主应用程序中检查此房间的加密设置"; -"e2e_room_key_request_message_new_device" = "您添加了一个新设备 '%@' ,它正在请求加密密钥。"; +"e2e_room_key_request_message_new_device" = "您添加了一个新设备 '%@' ,它正在请求加密密钥。"; "e2e_room_key_request_message" = "您的未验证设备 '%@' 正在请求加密密钥。"; // GDPR "gdpr_consent_not_given_alert_message" = "要继续使用该 %@ 主服务器,您必须查看并同意其服务条款和条件。"; diff --git a/Riot/Assets/zh_Hant.lproj/Vector.strings b/Riot/Assets/zh_Hant.lproj/Vector.strings index 6c120218e..0f338eb84 100644 --- a/Riot/Assets/zh_Hant.lproj/Vector.strings +++ b/Riot/Assets/zh_Hant.lproj/Vector.strings @@ -213,9 +213,9 @@ "search_in_progress" = "搜尋中……"; // Directory "directory_cell_title" = "瀏覽目錄"; -"directory_cell_description" = "%tu 個聊天室"; +"directory_cell_description" = "%tu 個聊天室"; "directory_search_results_title" = "聊天室目錄搜尋結果"; -"directory_search_results" = "搜尋 %@ 有 %tu 個結果"; +"directory_search_results" = "搜尋 %@ 有 %tu 個結果"; "directory_search_results_more_than" = "搜尋 %@ 有超過 %tu 個結果"; "directory_searching_title" = "搜尋聊天室目錄中……"; "directory_search_fail" = "無法取得資料"; @@ -437,7 +437,7 @@ "group_home_one_member_format" = "1 位成員"; "group_home_multi_members_format" = "%tu 位成員"; "group_home_one_room_format" = "一個聊天室"; -"group_home_multi_rooms_format" = "%tu 個聊天室"; +"group_home_multi_rooms_format" = "%tu 個聊天室"; "group_invitation_format" = "%@ 邀請您加入此社群"; // Group participants "group_participants_add_participant" = "新增成員"; diff --git a/Riot/Generated/RiotDefaults.swift b/Riot/Generated/RiotDefaults.swift index 51897ad61..b760f5619 100644 --- a/Riot/Generated/RiotDefaults.swift +++ b/Riot/Generated/RiotDefaults.swift @@ -22,6 +22,7 @@ internal enum RiotDefaults { internal static let integrationsRestUrl: String = _document["integrationsRestUrl"] internal static let integrationsUiUrl: String = _document["integrationsUiUrl"] internal static let integrationsWidgetsUrls: [String] = _document["integrationsWidgetsUrls"] + internal static let jitsiServerURL: String = _document["jitsiServerURL"] internal static let matrixApps: Bool = _document["matrixApps"] internal static let maxAllowedMediaCacheSize: Int = _document["maxAllowedMediaCacheSize"] internal static let pinRoomsWithMissedNotif: Bool = _document["pinRoomsWithMissedNotif"] diff --git a/Riot/Generated/Storyboards.swift b/Riot/Generated/Storyboards.swift index 80f0725b6..5db46ea18 100644 --- a/Riot/Generated/Storyboards.swift +++ b/Riot/Generated/Storyboards.swift @@ -12,6 +12,31 @@ import UIKit // swiftlint:disable explicit_type_interface identifier_name line_length type_body_length type_name internal enum StoryboardScene { + internal enum DeviceVerificationDataLoadingViewController: StoryboardType { + internal static let storyboardName = "DeviceVerificationDataLoadingViewController" + + internal static let initialScene = InitialSceneType(storyboard: DeviceVerificationDataLoadingViewController.self) + } + internal enum DeviceVerificationIncomingViewController: StoryboardType { + internal static let storyboardName = "DeviceVerificationIncomingViewController" + + internal static let initialScene = InitialSceneType(storyboard: DeviceVerificationIncomingViewController.self) + } + internal enum DeviceVerificationStartViewController: StoryboardType { + internal static let storyboardName = "DeviceVerificationStartViewController" + + internal static let initialScene = InitialSceneType(storyboard: DeviceVerificationStartViewController.self) + } + internal enum DeviceVerificationVerifiedViewController: StoryboardType { + internal static let storyboardName = "DeviceVerificationVerifiedViewController" + + internal static let initialScene = InitialSceneType(storyboard: DeviceVerificationVerifiedViewController.self) + } + internal enum DeviceVerificationVerifyViewController: StoryboardType { + internal static let storyboardName = "DeviceVerificationVerifyViewController" + + internal static let initialScene = InitialSceneType(storyboard: DeviceVerificationVerifyViewController.self) + } internal enum KeyBackupRecoverFromPassphraseViewController: StoryboardType { internal static let storyboardName = "KeyBackupRecoverFromPassphraseViewController" @@ -47,6 +72,11 @@ internal enum StoryboardScene { internal static let initialScene = InitialSceneType(storyboard: KeyBackupSetupSuccessFromRecoveryKeyViewController.self) } + internal enum SimpleScreenTemplateViewController: StoryboardType { + internal static let storyboardName = "SimpleScreenTemplateViewController" + + internal static let initialScene = InitialSceneType(storyboard: SimpleScreenTemplateViewController.self) + } internal enum TemplateScreenViewController: StoryboardType { internal static let storyboardName = "TemplateScreenViewController" diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index cb71c944e..fa1215a23 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -426,6 +426,342 @@ internal enum VectorL10n { internal static var decline: String { return VectorL10n.tr("Vector", "decline") } + /// The other party cancelled the verification. + internal static var deviceVerificationCancelled: String { + return VectorL10n.tr("Vector", "device_verification_cancelled") + } + /// The verification has been cancelled. Reason: %@ + internal static func deviceVerificationCancelledByMe(_ p1: String) -> String { + return VectorL10n.tr("Vector", "device_verification_cancelled_by_me", p1) + } + /// Aeroplane + internal static var deviceVerificationEmojiAeroplane: String { + return VectorL10n.tr("Vector", "device_verification_emoji_aeroplane") + } + /// Anchor + internal static var deviceVerificationEmojiAnchor: String { + return VectorL10n.tr("Vector", "device_verification_emoji_anchor") + } + /// Apple + internal static var deviceVerificationEmojiApple: String { + return VectorL10n.tr("Vector", "device_verification_emoji_apple") + } + /// Ball + internal static var deviceVerificationEmojiBall: String { + return VectorL10n.tr("Vector", "device_verification_emoji_ball") + } + /// Banana + internal static var deviceVerificationEmojiBanana: String { + return VectorL10n.tr("Vector", "device_verification_emoji_banana") + } + /// Ball + internal static var deviceVerificationEmojiBell: String { + return VectorL10n.tr("Vector", "device_verification_emoji_bell") + } + /// Bicycle + internal static var deviceVerificationEmojiBicycle: String { + return VectorL10n.tr("Vector", "device_verification_emoji_bicycle") + } + /// Book + internal static var deviceVerificationEmojiBook: String { + return VectorL10n.tr("Vector", "device_verification_emoji_book") + } + /// Butterfly + internal static var deviceVerificationEmojiButterfly: String { + return VectorL10n.tr("Vector", "device_verification_emoji_butterfly") + } + /// Cactus + internal static var deviceVerificationEmojiCactus: String { + return VectorL10n.tr("Vector", "device_verification_emoji_cactus") + } + /// Cake + internal static var deviceVerificationEmojiCake: String { + return VectorL10n.tr("Vector", "device_verification_emoji_cake") + } + /// Cat + internal static var deviceVerificationEmojiCat: String { + return VectorL10n.tr("Vector", "device_verification_emoji_cat") + } + /// Class + internal static var deviceVerificationEmojiClock: String { + return VectorL10n.tr("Vector", "device_verification_emoji_clock") + } + /// Cloud + internal static var deviceVerificationEmojiCloud: String { + return VectorL10n.tr("Vector", "device_verification_emoji_cloud") + } + /// Corn + internal static var deviceVerificationEmojiCorn: String { + return VectorL10n.tr("Vector", "device_verification_emoji_corn") + } + /// Dog + internal static var deviceVerificationEmojiDog: String { + return VectorL10n.tr("Vector", "device_verification_emoji_dog") + } + /// Elephant + internal static var deviceVerificationEmojiElephant: String { + return VectorL10n.tr("Vector", "device_verification_emoji_elephant") + } + /// Fire + internal static var deviceVerificationEmojiFire: String { + return VectorL10n.tr("Vector", "device_verification_emoji_fire") + } + /// Fish + internal static var deviceVerificationEmojiFish: String { + return VectorL10n.tr("Vector", "device_verification_emoji_fish") + } + /// Flag + internal static var deviceVerificationEmojiFlag: String { + return VectorL10n.tr("Vector", "device_verification_emoji_flag") + } + /// Flower + internal static var deviceVerificationEmojiFlower: String { + return VectorL10n.tr("Vector", "device_verification_emoji_flower") + } + /// Folder + internal static var deviceVerificationEmojiFolder: String { + return VectorL10n.tr("Vector", "device_verification_emoji_folder") + } + /// Gift + internal static var deviceVerificationEmojiGift: String { + return VectorL10n.tr("Vector", "device_verification_emoji_gift") + } + /// Glasses + internal static var deviceVerificationEmojiGlasses: String { + return VectorL10n.tr("Vector", "device_verification_emoji_glasses") + } + /// Globe + internal static var deviceVerificationEmojiGlobe: String { + return VectorL10n.tr("Vector", "device_verification_emoji_globe") + } + /// Guitar + internal static var deviceVerificationEmojiGuitar: String { + return VectorL10n.tr("Vector", "device_verification_emoji_guitar") + } + /// Hammer + internal static var deviceVerificationEmojiHammer: String { + return VectorL10n.tr("Vector", "device_verification_emoji_hammer") + } + /// Hat + internal static var deviceVerificationEmojiHat: String { + return VectorL10n.tr("Vector", "device_verification_emoji_hat") + } + /// Headphones + internal static var deviceVerificationEmojiHeadphones: String { + return VectorL10n.tr("Vector", "device_verification_emoji_headphones") + } + /// Heart + internal static var deviceVerificationEmojiHeart: String { + return VectorL10n.tr("Vector", "device_verification_emoji_heart") + } + /// Horse + internal static var deviceVerificationEmojiHorse: String { + return VectorL10n.tr("Vector", "device_verification_emoji_horse") + } + /// Hourglass + internal static var deviceVerificationEmojiHourglass: String { + return VectorL10n.tr("Vector", "device_verification_emoji_hourglass") + } + /// Key + internal static var deviceVerificationEmojiKey: String { + return VectorL10n.tr("Vector", "device_verification_emoji_key") + } + /// Light Bulb + internal static var deviceVerificationEmojiLightBulb: String { + return VectorL10n.tr("Vector", "device_verification_emoji_light bulb") + } + /// Lion + internal static var deviceVerificationEmojiLion: String { + return VectorL10n.tr("Vector", "device_verification_emoji_lion") + } + /// Moon + internal static var deviceVerificationEmojiMoon: String { + return VectorL10n.tr("Vector", "device_verification_emoji_moon") + } + /// Mushroom + internal static var deviceVerificationEmojiMushroom: String { + return VectorL10n.tr("Vector", "device_verification_emoji_mushroom") + } + /// Octopus + internal static var deviceVerificationEmojiOctopus: String { + return VectorL10n.tr("Vector", "device_verification_emoji_octopus") + } + /// Padlock + internal static var deviceVerificationEmojiPadlock: String { + return VectorL10n.tr("Vector", "device_verification_emoji_padlock") + } + /// Panda + internal static var deviceVerificationEmojiPanda: String { + return VectorL10n.tr("Vector", "device_verification_emoji_panda") + } + /// Paperclip + internal static var deviceVerificationEmojiPaperclip: String { + return VectorL10n.tr("Vector", "device_verification_emoji_paperclip") + } + /// Pencil + internal static var deviceVerificationEmojiPencil: String { + return VectorL10n.tr("Vector", "device_verification_emoji_pencil") + } + /// Penguin + internal static var deviceVerificationEmojiPenguin: String { + return VectorL10n.tr("Vector", "device_verification_emoji_penguin") + } + /// Pig + internal static var deviceVerificationEmojiPig: String { + return VectorL10n.tr("Vector", "device_verification_emoji_pig") + } + /// Pin + internal static var deviceVerificationEmojiPin: String { + return VectorL10n.tr("Vector", "device_verification_emoji_pin") + } + /// Pizza + internal static var deviceVerificationEmojiPizza: String { + return VectorL10n.tr("Vector", "device_verification_emoji_pizza") + } + /// Rabbit + internal static var deviceVerificationEmojiRabbit: String { + return VectorL10n.tr("Vector", "device_verification_emoji_rabbit") + } + /// Robot + internal static var deviceVerificationEmojiRobot: String { + return VectorL10n.tr("Vector", "device_verification_emoji_robot") + } + /// Rocket + internal static var deviceVerificationEmojiRocket: String { + return VectorL10n.tr("Vector", "device_verification_emoji_rocket") + } + /// Rooster + internal static var deviceVerificationEmojiRooster: String { + return VectorL10n.tr("Vector", "device_verification_emoji_rooster") + } + /// Santa + internal static var deviceVerificationEmojiSanta: String { + return VectorL10n.tr("Vector", "device_verification_emoji_santa") + } + /// Scissors + internal static var deviceVerificationEmojiScissors: String { + return VectorL10n.tr("Vector", "device_verification_emoji_scissors") + } + /// Smiley + internal static var deviceVerificationEmojiSmiley: String { + return VectorL10n.tr("Vector", "device_verification_emoji_smiley") + } + /// Spanner + internal static var deviceVerificationEmojiSpanner: String { + return VectorL10n.tr("Vector", "device_verification_emoji_spanner") + } + /// Strawberry + internal static var deviceVerificationEmojiStrawberry: String { + return VectorL10n.tr("Vector", "device_verification_emoji_strawberry") + } + /// Telephone + internal static var deviceVerificationEmojiTelephone: String { + return VectorL10n.tr("Vector", "device_verification_emoji_telephone") + } + /// Thumbs up + internal static var deviceVerificationEmojiThumbsUp: String { + return VectorL10n.tr("Vector", "device_verification_emoji_thumbs up") + } + /// Train + internal static var deviceVerificationEmojiTrain: String { + return VectorL10n.tr("Vector", "device_verification_emoji_train") + } + /// Tree + internal static var deviceVerificationEmojiTree: String { + return VectorL10n.tr("Vector", "device_verification_emoji_tree") + } + /// Trophy + internal static var deviceVerificationEmojiTrophy: String { + return VectorL10n.tr("Vector", "device_verification_emoji_trophy") + } + /// Trumpet + internal static var deviceVerificationEmojiTrumpet: String { + return VectorL10n.tr("Vector", "device_verification_emoji_trumpet") + } + /// Turtle + internal static var deviceVerificationEmojiTurtle: String { + return VectorL10n.tr("Vector", "device_verification_emoji_turtle") + } + /// Umbrella + internal static var deviceVerificationEmojiUmbrella: String { + return VectorL10n.tr("Vector", "device_verification_emoji_umbrella") + } + /// Unicorn + internal static var deviceVerificationEmojiUnicorn: String { + return VectorL10n.tr("Vector", "device_verification_emoji_unicorn") + } + /// Cannot load device information. + internal static var deviceVerificationErrorCannotLoadDevice: String { + return VectorL10n.tr("Vector", "device_verification_error_cannot_load_device") + } + /// Verify this device to mark it as trusted. Trusting devices of partners gives you extra peace of mind when using end-to-end encrypted messages. + internal static var deviceVerificationIncomingDescription1: String { + return VectorL10n.tr("Vector", "device_verification_incoming_description_1") + } + /// Verifying this device will mark it as trusted, and also mark your device as trusted to the partner. + internal static var deviceVerificationIncomingDescription2: String { + return VectorL10n.tr("Vector", "device_verification_incoming_description_2") + } + /// Incoming Verification Request + internal static var deviceVerificationIncomingTitle: String { + return VectorL10n.tr("Vector", "device_verification_incoming_title") + } + /// For maximum security, we recommend you do this in person or use another trusted means of communication + internal static var deviceVerificationSecurityAdvice: String { + return VectorL10n.tr("Vector", "device_verification_security_advice") + } + /// Verify by comparing a short text string + internal static var deviceVerificationStartTitle: String { + return VectorL10n.tr("Vector", "device_verification_start_title") + } + /// Nothing appearing? Not all clients supports interactive verification yet. Use legacy verification. + internal static var deviceVerificationStartUseLegacy: String { + return VectorL10n.tr("Vector", "device_verification_start_use_legacy") + } + /// Use Legacy Verification + internal static var deviceVerificationStartUseLegacyAction: String { + return VectorL10n.tr("Vector", "device_verification_start_use_legacy_action") + } + /// Begin Verifying + internal static var deviceVerificationStartVerifyButton: String { + return VectorL10n.tr("Vector", "device_verification_start_verify_button") + } + /// Waiting for partner to accept... + internal static var deviceVerificationStartWaitPartner: String { + return VectorL10n.tr("Vector", "device_verification_start_wait_partner") + } + /// Verify device + internal static var deviceVerificationTitle: String { + return VectorL10n.tr("Vector", "device_verification_title") + } + /// You've successfully verified this device. + internal static var deviceVerificationVerifiedDescription1: String { + return VectorL10n.tr("Vector", "device_verification_verified_description_1") + } + /// Secure messages with this user are end-to-end encrypted and not able to be read by third parties. + internal static var deviceVerificationVerifiedDescription2: String { + return VectorL10n.tr("Vector", "device_verification_verified_description_2") + } + /// Got it + internal static var deviceVerificationVerifiedGotItButton: String { + return VectorL10n.tr("Vector", "device_verification_verified_got_it_button") + } + /// Verified! + internal static var deviceVerificationVerifiedTitle: String { + return VectorL10n.tr("Vector", "device_verification_verified_title") + } + /// Verify this device by confirming the following emoji appear on the screen of the partner + internal static var deviceVerificationVerifyTitleEmoji: String { + return VectorL10n.tr("Vector", "device_verification_verify_title_emoji") + } + /// Verify this device by confirming the following numbers appear on the screen of the partner + internal static var deviceVerificationVerifyTitleNumber: String { + return VectorL10n.tr("Vector", "device_verification_verify_title_number") + } + /// Waiting for partner to confirm... + internal static var deviceVerificationVerifyWaitPartner: String { + return VectorL10n.tr("Vector", "device_verification_verify_wait_partner") + } /// %tu rooms internal static func directoryCellDescription(_ p1: Int) -> String { return VectorL10n.tr("Vector", "directory_cell_description", p1) @@ -686,14 +1022,14 @@ internal enum VectorL10n { internal static var join: String { return VectorL10n.tr("Vector", "join") } - /// Use Key Backup - internal static var keyBackupRecoverBannerSubtitle: String { - return VectorL10n.tr("Vector", "key_backup_recover_banner_subtitle") - } /// Never lose encrypted messages internal static var keyBackupRecoverBannerTitle: String { return VectorL10n.tr("Vector", "key_backup_recover_banner_title") } + /// Connect this device to Key Backup + internal static var keyBackupRecoverConnentBannerSubtitle: String { + return VectorL10n.tr("Vector", "key_backup_recover_connent_banner_subtitle") + } /// Done internal static var keyBackupRecoverDoneAction: String { return VectorL10n.tr("Vector", "key_backup_recover_done_action") @@ -790,14 +1126,14 @@ internal enum VectorL10n { internal static var keyBackupSetupIntroManualExportInfo: String { return VectorL10n.tr("Vector", "key_backup_setup_intro_manual_export_info") } - /// Use Key Backup - internal static var keyBackupSetupIntroSetupActionWithExistingBackup: String { - return VectorL10n.tr("Vector", "key_backup_setup_intro_setup_action_with_existing_backup") - } /// Start using Key Backup internal static var keyBackupSetupIntroSetupActionWithoutExistingBackup: String { return VectorL10n.tr("Vector", "key_backup_setup_intro_setup_action_without_existing_backup") } + /// Connect this device to Key Backup + internal static var keyBackupSetupIntroSetupConnectActionWithExistingBackup: String { + return VectorL10n.tr("Vector", "key_backup_setup_intro_setup_connect_action_with_existing_backup") + } /// Never lose encrypted messages internal static var keyBackupSetupIntroTitle: String { return VectorL10n.tr("Vector", "key_backup_setup_intro_title") @@ -2006,6 +2342,10 @@ internal enum VectorL10n { internal static var settingsKeyBackup: String { return VectorL10n.tr("Vector", "settings_key_backup") } + /// Connect this device to Key Backup + internal static var settingsKeyBackupButtonConnect: String { + return VectorL10n.tr("Vector", "settings_key_backup_button_connect") + } /// Start using Key Backup internal static var settingsKeyBackupButtonCreate: String { return VectorL10n.tr("Vector", "settings_key_backup_button_create") @@ -2018,10 +2358,6 @@ internal enum VectorL10n { internal static var settingsKeyBackupButtonRestore: String { return VectorL10n.tr("Vector", "settings_key_backup_button_restore") } - /// Use key backup - internal static var settingsKeyBackupButtonUse: String { - return VectorL10n.tr("Vector", "settings_key_backup_button_use") - } /// Are you sure? You will lose your encrypted messages if your keys are not backed up properly. internal static var settingsKeyBackupDeleteConfirmationPromptMsg: String { return VectorL10n.tr("Vector", "settings_key_backup_delete_confirmation_prompt_msg") @@ -2046,7 +2382,7 @@ internal enum VectorL10n { internal static var settingsKeyBackupInfoNone: String { return VectorL10n.tr("Vector", "settings_key_backup_info_none") } - /// This device is not backing up your keys. + /// This device is not backing up your keys, but you do have an existing backup you can restore from and add to going forward. internal static var settingsKeyBackupInfoNotValid: String { return VectorL10n.tr("Vector", "settings_key_backup_info_not_valid") } @@ -2058,7 +2394,7 @@ internal enum VectorL10n { internal static var settingsKeyBackupInfoProgressDone: String { return VectorL10n.tr("Vector", "settings_key_backup_info_progress_done") } - /// Back up your keys before signing out to avoid losing them. + /// Connect this device to key backup before signing out to avoid losing any keys that may only be on this device. internal static var settingsKeyBackupInfoSignoutWarning: String { return VectorL10n.tr("Vector", "settings_key_backup_info_signout_warning") } @@ -2488,7 +2824,7 @@ internal enum VectorL10n { // MARK: - Implementation Details extension VectorL10n { - private static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String { + static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String { let format = NSLocalizedString(key, tableName: table, bundle: Bundle(for: BundleToken.self), comment: "") let locale: Locale if let localeIdentifier = Bundle.mxk_language() { diff --git a/Riot/Managers/Theme/Themable.swift b/Riot/Managers/Theme/Themable.swift new file mode 100644 index 000000000..3764b24b7 --- /dev/null +++ b/Riot/Managers/Theme/Themable.swift @@ -0,0 +1,21 @@ +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +protocol Themable: class { + func update(theme: Theme) +} diff --git a/Riot/Modules/Common/Recents/Views/RecentTableViewCell.m b/Riot/Modules/Common/Recents/Views/RecentTableViewCell.m index 8f993f99b..1f7e1b443 100644 --- a/Riot/Modules/Common/Recents/Views/RecentTableViewCell.m +++ b/Riot/Modules/Common/Recents/Views/RecentTableViewCell.m @@ -125,28 +125,14 @@ static const CGFloat kDirectRoomBorderWidth = 3.0; } // Use bold font for the room title - if ([UIFont respondsToSelector:@selector(systemFontOfSize:weight:)]) - { - self.roomTitle.font = [UIFont systemFontOfSize:17 weight:UIFontWeightBold]; - } - else - { - self.roomTitle.font = [UIFont boldSystemFontOfSize:17]; - } + self.roomTitle.font = [UIFont systemFontOfSize:17 weight:UIFontWeightBold]; } else { self.lastEventDate.textColor = ThemeService.shared.theme.textSecondaryColor; - // The room title is not bold anymore - if ([UIFont respondsToSelector:@selector(systemFontOfSize:weight:)]) - { - self.roomTitle.font = [UIFont systemFontOfSize:17 weight:UIFontWeightMedium]; - } - else - { - self.roomTitle.font = [UIFont systemFontOfSize:17]; - } + // The room title is not bold anymore + self.roomTitle.font = [UIFont systemFontOfSize:17 weight:UIFontWeightMedium]; } self.directRoomBorderView.hidden = !roomCellData.roomSummary.room.isDirect; diff --git a/Riot/Modules/DeviceVerification/DeviceVerificationCoordinator.swift b/Riot/Modules/DeviceVerification/DeviceVerificationCoordinator.swift new file mode 100644 index 000000000..ca8960c14 --- /dev/null +++ b/Riot/Modules/DeviceVerification/DeviceVerificationCoordinator.swift @@ -0,0 +1,186 @@ +// File created from FlowTemplate +// $ createRootCoordinator.sh DeviceVerification DeviceVerification DeviceVerificationStart +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import UIKit + +@objcMembers +final class DeviceVerificationCoordinator: DeviceVerificationCoordinatorType { + + // MARK: - Properties + + // MARK: Private + + private let navigationRouter: NavigationRouterType + private let session: MXSession + private let otherUserId: String + private let otherDeviceId: String + + private var incomingTransaction: MXIncomingSASTransaction? + + // MARK: Public + + // Must be used only internally + var childCoordinators: [Coordinator] = [] + + weak var delegate: DeviceVerificationCoordinatorDelegate? + + // MARK: - Setup + + /// Contrustor to start a verification of another device. + /// + /// - Parameters: + /// - session: the MXSession + /// - otherUserId: the device user id + /// - otherDevice: the device id + init(session: MXSession, otherUserId: String, otherDeviceId: String) { + self.navigationRouter = NavigationRouter(navigationController: RiotNavigationController()) + self.session = session + self.otherUserId = otherUserId + self.otherDeviceId = otherDeviceId + } + + /// Contrustor to manage an incoming SAS device verification transaction + /// + /// - Parameters: + /// - session: the MXSession + /// - transaction: an existing device verification transaction + convenience init(session: MXSession, incomingTransaction: MXIncomingSASTransaction) { + self.init(session: session, + otherUserId: incomingTransaction.otherUserId, + otherDeviceId: incomingTransaction.otherDeviceId) + self.incomingTransaction = incomingTransaction + } + + // MARK: - Public methods + + func start() { + let rootCoordinator = self.createDataLoadingScreenCoordinator() + rootCoordinator.start() + + self.add(childCoordinator: rootCoordinator) + self.navigationRouter.setRootModule(rootCoordinator) + } + + func toPresentable() -> UIViewController { + return self.navigationRouter.toPresentable() + } + + // MARK: - Private methods + + private func createDataLoadingScreenCoordinator() -> DeviceVerificationDataLoadingCoordinator { + let coordinator = DeviceVerificationDataLoadingCoordinator(session: self.session, otherUserId: self.otherUserId, otherDeviceId: self.otherDeviceId) + coordinator.delegate = self + coordinator.start() + + return coordinator + } + + private func showStart(otherUser: MXUser, otherDevice: MXDeviceInfo) { + let coordinator = DeviceVerificationStartCoordinator(session: self.session, otherUser: otherUser, otherDevice: otherDevice) + coordinator.delegate = self + coordinator.start() + + self.add(childCoordinator: coordinator) + self.navigationRouter.setRootModule(coordinator) + } + + private func showIncoming(otherUser: MXUser, transaction: MXIncomingSASTransaction) { + let coordinator = DeviceVerificationIncomingCoordinator(session: self.session, otherUser: otherUser, transaction: transaction) + coordinator.delegate = self + coordinator.start() + + self.add(childCoordinator: coordinator) + self.navigationRouter.setRootModule(coordinator) + } + + private func showVerify(transaction: MXSASTransaction, animated: Bool) { + let coordinator = DeviceVerificationVerifyCoordinator(session: self.session, transaction: transaction) + coordinator.delegate = self + coordinator.start() + + self.add(childCoordinator: coordinator) + self.navigationRouter.push(coordinator, animated: animated) { [weak self] in + self?.remove(childCoordinator: coordinator) + } + } + + private func showVerified(animated: Bool) { + let viewController = DeviceVerificationVerifiedViewController.instantiate() + viewController.delegate = self + self.navigationRouter.setRootModule(viewController) + } +} + +extension DeviceVerificationCoordinator: DeviceVerificationDataLoadingCoordinatorDelegate { + func deviceVerificationDataLoadingCoordinator(_ coordinator: DeviceVerificationDataLoadingCoordinatorType, didLoadUser user: MXUser, device: MXDeviceInfo) { + + if let incomingTransaction = self.incomingTransaction { + self.showIncoming(otherUser: user, transaction: incomingTransaction) + } else { + self.showStart(otherUser: user, otherDevice: device) + } + } + + func deviceVerificationDataLoadingCoordinatorDidCancel(_ coordinator: DeviceVerificationDataLoadingCoordinatorType) { + self.delegate?.deviceVerificationCoordinatorDidComplete(self, otherUserId: self.otherUserId, otherDeviceId: self.otherDeviceId) + } +} + +extension DeviceVerificationCoordinator: DeviceVerificationStartCoordinatorDelegate { + func deviceVerificationStartCoordinator(_ coordinator: DeviceVerificationStartCoordinatorType, didCompleteWithOutgoingTransaction transaction: MXSASTransaction) { + self.showVerify(transaction: transaction, animated: true) + } + + func deviceVerificationStartCoordinator(_ coordinator: DeviceVerificationStartCoordinatorType, didTransactionCancelled transaction: MXSASTransaction) { + self.delegate?.deviceVerificationCoordinatorDidComplete(self, otherUserId: self.otherUserId, otherDeviceId: self.otherDeviceId) + } + + func deviceVerificationStartCoordinatorDidCancel(_ coordinator: DeviceVerificationStartCoordinatorType) { + self.delegate?.deviceVerificationCoordinatorDidComplete(self, otherUserId: self.otherUserId, otherDeviceId: self.otherDeviceId) + } +} + +extension DeviceVerificationCoordinator: DeviceVerificationIncomingCoordinatorDelegate { + func deviceVerificationIncomingCoordinator(_ coordinator: DeviceVerificationIncomingCoordinatorType, didAcceptTransaction transaction: MXSASTransaction) { + self.showVerify(transaction: transaction, animated: true) + } + + func deviceVerificationIncomingCoordinatorDidCancel(_ coordinator: DeviceVerificationIncomingCoordinatorType) { + self.delegate?.deviceVerificationCoordinatorDidComplete(self, otherUserId: self.otherUserId, otherDeviceId: self.otherDeviceId) + } +} + +extension DeviceVerificationCoordinator: DeviceVerificationVerifyCoordinatorDelegate { + func deviceVerificationVerifyCoordinatorDidComplete(_ coordinator: DeviceVerificationVerifyCoordinatorType) { + self.showVerified(animated: true) + } + + func deviceVerificationVerifyCoordinatorDidCancel(_ coordinator: DeviceVerificationVerifyCoordinatorType) { + self.delegate?.deviceVerificationCoordinatorDidComplete(self, otherUserId: self.otherUserId, otherDeviceId: self.otherDeviceId) + } +} + +extension DeviceVerificationCoordinator: DeviceVerificationVerifiedViewControllerDelegate { + func deviceVerificationVerifiedViewControllerDidTapSetupAction(_ viewController: DeviceVerificationVerifiedViewController) { + self.delegate?.deviceVerificationCoordinatorDidComplete(self, otherUserId: self.otherUserId, otherDeviceId: self.otherDeviceId) + } + + func deviceVerificationVerifiedViewControllerDidCancel(_ viewController: DeviceVerificationVerifiedViewController) { + self.delegate?.deviceVerificationCoordinatorDidComplete(self, otherUserId: self.otherUserId, otherDeviceId: self.otherDeviceId) + } +} diff --git a/Riot/Modules/DeviceVerification/DeviceVerificationCoordinatorBridgePresenter.swift b/Riot/Modules/DeviceVerification/DeviceVerificationCoordinatorBridgePresenter.swift new file mode 100644 index 000000000..cc321c09f --- /dev/null +++ b/Riot/Modules/DeviceVerification/DeviceVerificationCoordinatorBridgePresenter.swift @@ -0,0 +1,92 @@ +// File created from FlowTemplate +// $ createRootCoordinator.sh DeviceVerification DeviceVerification DeviceVerificationStart +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +@objc protocol DeviceVerificationCoordinatorBridgePresenterDelegate { + func deviceVerificationCoordinatorBridgePresenterDelegateDidComplete(_ coordinatorBridgePresenter: DeviceVerificationCoordinatorBridgePresenter, otherUserId: String, otherDeviceId: String) +} + +/// DeviceVerificationCoordinatorBridgePresenter enables to start DeviceVerificationCoordinator from a view controller. +/// This bridge is used while waiting for global usage of coordinator pattern. +@objcMembers +final class DeviceVerificationCoordinatorBridgePresenter: NSObject { + + // MARK: - Properties + + // MARK: Private + + private let session: MXSession + private var coordinator: DeviceVerificationCoordinator? + + // MARK: Public + + weak var delegate: DeviceVerificationCoordinatorBridgePresenterDelegate? + + // MARK: - Setup + + init(session: MXSession) { + self.session = session + super.init() + } + + // MARK: - Public + + // NOTE: Default value feature is not compatible with Objective-C. + // func present(from viewController: UIViewController, animated: Bool) { + // self.present(from: viewController, animated: animated) + // } + + func present(from viewController: UIViewController, otherUserId: String, otherDeviceId: String, animated: Bool) { + let deviceVerificationCoordinator = DeviceVerificationCoordinator(session: self.session, otherUserId: otherUserId, otherDeviceId: otherDeviceId) + deviceVerificationCoordinator.delegate = self + viewController.present(deviceVerificationCoordinator.toPresentable(), animated: animated, completion: nil) + deviceVerificationCoordinator.start() + + self.coordinator = deviceVerificationCoordinator + } + + func present(from viewController: UIViewController, incomingTransaction: MXIncomingSASTransaction, animated: Bool) { + let deviceVerificationCoordinator = DeviceVerificationCoordinator(session: self.session, incomingTransaction: incomingTransaction) + deviceVerificationCoordinator.delegate = self + viewController.present(deviceVerificationCoordinator.toPresentable(), animated: animated, completion: nil) + deviceVerificationCoordinator.start() + + self.coordinator = deviceVerificationCoordinator + } + + func dismiss(animated: Bool, completion: (() -> Void)?) { + guard let coordinator = self.coordinator else { + return + } + coordinator.toPresentable().dismiss(animated: animated) { + self.coordinator = nil + + if let completion = completion { + completion() + } + } + } +} + +// MARK: - DeviceVerificationCoordinatorDelegate +extension DeviceVerificationCoordinatorBridgePresenter: DeviceVerificationCoordinatorDelegate { + func deviceVerificationCoordinatorDidComplete(_ coordinator: DeviceVerificationCoordinatorType, otherUserId: String, otherDeviceId: String) { + self.delegate?.deviceVerificationCoordinatorBridgePresenterDelegateDidComplete(self, otherUserId: otherUserId, otherDeviceId: otherDeviceId) + } +} diff --git a/Riot/Modules/DeviceVerification/DeviceVerificationCoordinatorType.swift b/Riot/Modules/DeviceVerification/DeviceVerificationCoordinatorType.swift new file mode 100644 index 000000000..c1f616da8 --- /dev/null +++ b/Riot/Modules/DeviceVerification/DeviceVerificationCoordinatorType.swift @@ -0,0 +1,28 @@ +// File created from FlowTemplate +// $ createRootCoordinator.sh DeviceVerification DeviceVerification DeviceVerificationStart +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +protocol DeviceVerificationCoordinatorDelegate: class { + func deviceVerificationCoordinatorDidComplete(_ coordinator: DeviceVerificationCoordinatorType, otherUserId: String, otherDeviceId: String) +} + +/// `DeviceVerificationCoordinatorType` is a protocol describing a Coordinator that handle keybackup setup navigation flow. +protocol DeviceVerificationCoordinatorType: Coordinator, Presentable { + var delegate: DeviceVerificationCoordinatorDelegate? { get } +} diff --git a/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingCoordinator.swift b/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingCoordinator.swift new file mode 100644 index 000000000..2240255d9 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingCoordinator.swift @@ -0,0 +1,71 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Incoming DeviceVerificationIncoming +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation +import UIKit + +final class DeviceVerificationIncomingCoordinator: DeviceVerificationIncomingCoordinatorType { + + // MARK: - Properties + + // MARK: Private + + private let session: MXSession + private var deviceVerificationIncomingViewModel: DeviceVerificationIncomingViewModelType + private let deviceVerificationIncomingViewController: DeviceVerificationIncomingViewController + + // MARK: Public + + // Must be used only internally + var childCoordinators: [Coordinator] = [] + + weak var delegate: DeviceVerificationIncomingCoordinatorDelegate? + + // MARK: - Setup + + init(session: MXSession, otherUser: MXUser, transaction: MXIncomingSASTransaction) { + self.session = session + + let deviceVerificationIncomingViewModel = DeviceVerificationIncomingViewModel(session: self.session, otherUser: otherUser, transaction: transaction) + let deviceVerificationIncomingViewController = DeviceVerificationIncomingViewController.instantiate(with: deviceVerificationIncomingViewModel) + self.deviceVerificationIncomingViewModel = deviceVerificationIncomingViewModel + self.deviceVerificationIncomingViewController = deviceVerificationIncomingViewController + } + + // MARK: - Public methods + + func start() { + self.deviceVerificationIncomingViewModel.coordinatorDelegate = self + } + + func toPresentable() -> UIViewController { + return self.deviceVerificationIncomingViewController + } +} + +// MARK: - DeviceVerificationIncomingViewModelCoordinatorDelegate +extension DeviceVerificationIncomingCoordinator: DeviceVerificationIncomingViewModelCoordinatorDelegate { + + func deviceVerificationIncomingViewModel(_ viewModel: DeviceVerificationIncomingViewModelType, didAcceptTransaction transaction: MXSASTransaction) { + self.delegate?.deviceVerificationIncomingCoordinator(self, didAcceptTransaction: transaction) + } + + func deviceVerificationIncomingViewModelDidCancel(_ viewModel: DeviceVerificationIncomingViewModelType) { + self.delegate?.deviceVerificationIncomingCoordinatorDidCancel(self) + } +} diff --git a/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingCoordinatorType.swift b/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingCoordinatorType.swift new file mode 100644 index 000000000..46e135212 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingCoordinatorType.swift @@ -0,0 +1,29 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Incoming DeviceVerificationIncoming +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +protocol DeviceVerificationIncomingCoordinatorDelegate: class { + func deviceVerificationIncomingCoordinator(_ coordinator: DeviceVerificationIncomingCoordinatorType, didAcceptTransaction message: MXSASTransaction) + func deviceVerificationIncomingCoordinatorDidCancel(_ coordinator: DeviceVerificationIncomingCoordinatorType) +} + +/// `DeviceVerificationIncomingCoordinatorType` is a protocol describing a Coordinator that handle key backup setup passphrase navigation flow. +protocol DeviceVerificationIncomingCoordinatorType: Coordinator, Presentable { + var delegate: DeviceVerificationIncomingCoordinatorDelegate? { get } +} diff --git a/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingViewAction.swift b/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingViewAction.swift new file mode 100644 index 000000000..faf156e8c --- /dev/null +++ b/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingViewAction.swift @@ -0,0 +1,25 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Incoming DeviceVerificationIncoming +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +/// DeviceVerificationIncomingViewController view actions exposed to view model +enum DeviceVerificationIncomingViewAction { + case accept + case cancel +} diff --git a/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingViewController.storyboard b/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingViewController.storyboard new file mode 100644 index 000000000..8dede16ab --- /dev/null +++ b/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingViewController.storyboard @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingViewController.swift b/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingViewController.swift new file mode 100644 index 000000000..47f5411d1 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingViewController.swift @@ -0,0 +1,219 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Incoming DeviceVerificationIncoming +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import UIKit + +final class DeviceVerificationIncomingViewController: UIViewController { + + // MARK: - Constants + + // MARK: - Properties + + // MARK: Outlets + + @IBOutlet private weak var scrollView: UIScrollView! + + @IBOutlet weak var titleLabel: UILabel! + + @IBOutlet weak var avatarImageView: MXKImageView! + @IBOutlet weak var userDisplaynameLabel: UILabel! + @IBOutlet weak var deviceIdLabel: UILabel! + + @IBOutlet weak var description1Label: UILabel! + @IBOutlet weak var description2Label: UILabel! + @IBOutlet weak var continueButtonBackgroundView: UIView! + @IBOutlet weak var continueButton: UIButton! + + + // MARK: Private + + private var viewModel: DeviceVerificationIncomingViewModelType! + private var theme: Theme! + private var errorPresenter: MXKErrorPresentation! + private var activityPresenter: ActivityIndicatorPresenter! + + // MARK: - Setup + + class func instantiate(with viewModel: DeviceVerificationIncomingViewModelType) -> DeviceVerificationIncomingViewController { + let viewController = StoryboardScene.DeviceVerificationIncomingViewController.initialScene.instantiate() + viewController.viewModel = viewModel + viewController.theme = ThemeService.shared().theme + return viewController + } + + // MARK: - Life cycle + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + + self.title = VectorL10n.deviceVerificationTitle + self.vc_removeBackTitle() + + self.setupViews() + self.activityPresenter = ActivityIndicatorPresenter() + self.errorPresenter = MXKErrorAlertPresentation() + + self.registerThemeServiceDidChangeThemeNotification() + self.update(theme: self.theme) + + self.viewModel.viewDelegate = self + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + } + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + } + + override func viewDidDisappear(_ animated: Bool) { + super.viewDidDisappear(animated) + } + + override func viewDidLayoutSubviews() { + super.viewDidLayoutSubviews() + } + + override var preferredStatusBarStyle: UIStatusBarStyle { + return self.theme.statusBarStyle + } + + // MARK: - Private + + private func update(theme: Theme) { + self.theme = theme + + self.view.backgroundColor = theme.headerBackgroundColor + + if let navigationBar = self.navigationController?.navigationBar { + theme.applyStyle(onNavigationBar: navigationBar) + } + + self.titleLabel.textColor = theme.textPrimaryColor + self.description1Label.textColor = theme.textPrimaryColor + self.description2Label.textColor = theme.textPrimaryColor + + self.continueButton.backgroundColor = theme.backgroundColor + theme.applyStyle(onButton: self.continueButton) + } + + private func registerThemeServiceDidChangeThemeNotification() { + NotificationCenter.default.addObserver(self, selector: #selector(themeDidChange), name: .themeServiceDidChangeTheme, object: nil) + } + + @objc private func themeDidChange() { + self.update(theme: ThemeService.shared().theme) + } + + private func setupViews() { + let cancelBarButtonItem = MXKBarButtonItem(title: VectorL10n.cancel, style: .plain) { [weak self] in + self?.cancelButtonAction() + } + + self.navigationItem.rightBarButtonItem = cancelBarButtonItem + + self.scrollView.keyboardDismissMode = .interactive + + self.titleLabel.text = VectorL10n.deviceVerificationIncomingTitle + self.description1Label.text = VectorL10n.deviceVerificationIncomingDescription1 + self.description2Label.text = VectorL10n.deviceVerificationIncomingDescription2 + self.continueButton.setTitle(VectorL10n.continue, for: .normal) + + if let avatarImageView = self.avatarImageView { + let defaultavatarImage = AvatarGenerator.generateAvatar(forMatrixItem: self.viewModel.userId, withDisplayName: self.viewModel.userDisplayName) + + avatarImageView.enableInMemoryCache = true + avatarImageView.setImageURI(self.viewModel.avatarUrl, withType: nil, andImageOrientation: .up, previewImage: defaultavatarImage, mediaManager: self.viewModel.mediaManager) + + avatarImageView.layer.cornerRadius = avatarImageView.frame.size.width / 2 + avatarImageView.clipsToBounds = true + } + + self.userDisplaynameLabel.text = self.viewModel.userDisplayName ?? self.viewModel.userId + self.deviceIdLabel.text = self.viewModel.deviceId + } + + private func render(viewState: DeviceVerificationIncomingViewState) { + switch viewState { + case .loading: + self.renderLoading() + case .loaded: + self.renderAccepted() + case .cancelled(let reason): + self.renderCancelled(reason: reason) + case .cancelledByMe(let reason): + self.renderCancelledByMe(reason: reason) + case .error(let error): + self.render(error: error) + } + } + + private func renderLoading() { + self.activityPresenter.presentActivityIndicator(on: self.view, animated: true) + } + + private func renderAccepted() { + self.activityPresenter.removeCurrentActivityIndicator(animated: true) + } + + private func renderCancelled(reason: MXTransactionCancelCode) { + self.activityPresenter.removeCurrentActivityIndicator(animated: true) + + self.errorPresenter.presentError(from: self, title: "", message: VectorL10n.deviceVerificationCancelled, animated: true) { + self.viewModel.process(viewAction: .cancel) + } + } + + private func renderCancelledByMe(reason: MXTransactionCancelCode) { + if reason.value != MXTransactionCancelCode.user().value { + self.activityPresenter.removeCurrentActivityIndicator(animated: true) + + self.errorPresenter.presentError(from: self, title: "", message: VectorL10n.deviceVerificationCancelledByMe(reason.humanReadable), animated: true) { + self.viewModel.process(viewAction: .cancel) + } + } + } + + private func render(error: Error) { + self.activityPresenter.removeCurrentActivityIndicator(animated: true) + self.errorPresenter.presentError(from: self, forError: error, animated: true, handler: nil) + } + + + // MARK: - Actions + + @IBAction private func continueButtonAction(_ sender: Any) { + self.viewModel.process(viewAction: .accept) + } + + private func cancelButtonAction() { + self.viewModel.process(viewAction: .cancel) + } +} + + +// MARK: - DeviceVerificationIncomingViewModelViewDelegate +extension DeviceVerificationIncomingViewController: DeviceVerificationIncomingViewModelViewDelegate { + + func deviceVerificationIncomingViewModel(_ viewModel: DeviceVerificationIncomingViewModelType, didUpdateViewState viewSate: DeviceVerificationIncomingViewState) { + self.render(viewState: viewSate) + } +} diff --git a/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingViewModel.swift b/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingViewModel.swift new file mode 100644 index 000000000..41fc87276 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingViewModel.swift @@ -0,0 +1,116 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Incoming DeviceVerificationIncoming +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +final class DeviceVerificationIncomingViewModel: DeviceVerificationIncomingViewModelType { + + // MARK: - Properties + + // MARK: Private + + private let session: MXSession + private let transaction: MXIncomingSASTransaction + + // MARK: Public + + let userId: String + let userDisplayName: String? + let avatarUrl: String? + let deviceId: String + + let mediaManager: MXMediaManager + + weak var viewDelegate: DeviceVerificationIncomingViewModelViewDelegate? + weak var coordinatorDelegate: DeviceVerificationIncomingViewModelCoordinatorDelegate? + + // MARK: - Setup + + init(session: MXSession, otherUser: MXUser, transaction: MXIncomingSASTransaction) { + self.session = session + self.transaction = transaction + self.userId = otherUser.userId + self.userDisplayName = otherUser.displayname + self.avatarUrl = otherUser.avatarUrl + self.deviceId = transaction.otherDeviceId + + self.mediaManager = session.mediaManager + + self.registerTransactionDidStateChangeNotification(transaction: transaction) + } + + deinit { + } + + // MARK: - Public + + func process(viewAction: DeviceVerificationIncomingViewAction) { + switch viewAction { + case .accept: + self.acceptIncomingDeviceVerification() + case .cancel: + self.rejectIncomingDeviceVerification() + self.coordinatorDelegate?.deviceVerificationIncomingViewModelDidCancel(self) + } + } + + // MARK: - Private + + private func acceptIncomingDeviceVerification() { + self.update(viewState: .loading) + self.transaction.accept() + } + + private func rejectIncomingDeviceVerification() { + self.transaction.cancel(with: MXTransactionCancelCode.user()) + } + + private func update(viewState: DeviceVerificationIncomingViewState) { + self.viewDelegate?.deviceVerificationIncomingViewModel(self, didUpdateViewState: viewState) + } + + // MARK: - MXDeviceVerificationTransactionDidChange + + private func registerTransactionDidStateChangeNotification(transaction: MXIncomingSASTransaction) { + NotificationCenter.default.addObserver(self, selector: #selector(transactionDidStateChange(notification:)), name: NSNotification.Name.MXDeviceVerificationTransactionDidChange, object: transaction) + } + + @objc private func transactionDidStateChange(notification: Notification) { + guard let transaction = notification.object as? MXIncomingSASTransaction else { + return + } + + switch transaction.state { + case MXSASTransactionStateShowSAS: + self.update(viewState: .loaded) + self.coordinatorDelegate?.deviceVerificationIncomingViewModel(self, didAcceptTransaction: self.transaction) + case MXSASTransactionStateCancelled: + guard let reason = transaction.reasonCancelCode else { + return + } + self.update(viewState: .cancelled(reason)) + case MXSASTransactionStateCancelledByMe: + guard let reason = transaction.reasonCancelCode else { + return + } + self.update(viewState: .cancelledByMe(reason)) + default: + break + } + } +} diff --git a/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingViewModelType.swift b/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingViewModelType.swift new file mode 100644 index 000000000..465fb4013 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingViewModelType.swift @@ -0,0 +1,44 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Incoming DeviceVerificationIncoming +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +protocol DeviceVerificationIncomingViewModelViewDelegate: class { + func deviceVerificationIncomingViewModel(_ viewModel: DeviceVerificationIncomingViewModelType, didUpdateViewState viewSate: DeviceVerificationIncomingViewState) +} + +protocol DeviceVerificationIncomingViewModelCoordinatorDelegate: class { + func deviceVerificationIncomingViewModel(_ viewModel: DeviceVerificationIncomingViewModelType, didAcceptTransaction transaction: MXSASTransaction) + func deviceVerificationIncomingViewModelDidCancel(_ viewModel: DeviceVerificationIncomingViewModelType) +} + +/// Protocol describing the view model used by `DeviceVerificationIncomingViewController` +protocol DeviceVerificationIncomingViewModelType { + + var userId: String { get } + var userDisplayName: String? { get } + var avatarUrl: String? { get } + var deviceId: String { get } + + var mediaManager: MXMediaManager { get } + + var viewDelegate: DeviceVerificationIncomingViewModelViewDelegate? { get set } + var coordinatorDelegate: DeviceVerificationIncomingViewModelCoordinatorDelegate? { get set } + + func process(viewAction: DeviceVerificationIncomingViewAction) +} diff --git a/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingViewState.swift b/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingViewState.swift new file mode 100644 index 000000000..858a5e5d3 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Incoming/DeviceVerificationIncomingViewState.swift @@ -0,0 +1,28 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Incoming DeviceVerificationIncoming +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +/// DeviceVerificationIncomingViewController view state +enum DeviceVerificationIncomingViewState { + case loading + case loaded // accepted + case cancelled(MXTransactionCancelCode) + case cancelledByMe(MXTransactionCancelCode) + case error(Error) +} diff --git a/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingCoordinator.swift b/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingCoordinator.swift new file mode 100644 index 000000000..ece7185af --- /dev/null +++ b/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingCoordinator.swift @@ -0,0 +1,70 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Loading DeviceVerificationDataLoading +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation +import UIKit + +final class DeviceVerificationDataLoadingCoordinator: DeviceVerificationDataLoadingCoordinatorType { + + // MARK: - Properties + + // MARK: Private + + private let session: MXSession + private var deviceVerificationDataLoadingViewModel: DeviceVerificationDataLoadingViewModelType + private let deviceVerificationDataLoadingViewController: DeviceVerificationDataLoadingViewController + + // MARK: Public + + // Must be used only internally + var childCoordinators: [Coordinator] = [] + + weak var delegate: DeviceVerificationDataLoadingCoordinatorDelegate? + + // MARK: - Setup + + init(session: MXSession, otherUserId: String, otherDeviceId: String) { + self.session = session + + let deviceVerificationDataLoadingViewModel = DeviceVerificationDataLoadingViewModel(session: self.session, otherUserId: otherUserId, otherDeviceId: otherDeviceId) + let deviceVerificationDataLoadingViewController = DeviceVerificationDataLoadingViewController.instantiate(with: deviceVerificationDataLoadingViewModel) + self.deviceVerificationDataLoadingViewModel = deviceVerificationDataLoadingViewModel + self.deviceVerificationDataLoadingViewController = deviceVerificationDataLoadingViewController + } + + // MARK: - Public methods + + func start() { + self.deviceVerificationDataLoadingViewModel.coordinatorDelegate = self + } + + func toPresentable() -> UIViewController { + return self.deviceVerificationDataLoadingViewController + } +} + +// MARK: - DeviceVerificationDataLoadingViewModelCoordinatorDelegate +extension DeviceVerificationDataLoadingCoordinator: DeviceVerificationDataLoadingViewModelCoordinatorDelegate { + func deviceVerificationDataLoadingViewModel(_ viewModel: DeviceVerificationDataLoadingViewModelType, didLoadUser user: MXUser, device: MXDeviceInfo) { + self.delegate?.deviceVerificationDataLoadingCoordinator(self, didLoadUser: user, device: device) + } + + func deviceVerificationDataLoadingViewModelDidCancel(_ viewModel: DeviceVerificationDataLoadingViewModelType) { + self.delegate?.deviceVerificationDataLoadingCoordinatorDidCancel(self) + } +} diff --git a/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingCoordinatorType.swift b/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingCoordinatorType.swift new file mode 100644 index 000000000..c70b8cc50 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingCoordinatorType.swift @@ -0,0 +1,29 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Loading DeviceVerificationDataLoading +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +protocol DeviceVerificationDataLoadingCoordinatorDelegate: class { + func deviceVerificationDataLoadingCoordinator(_ coordinator: DeviceVerificationDataLoadingCoordinatorType, didLoadUser user: MXUser, device: MXDeviceInfo) + func deviceVerificationDataLoadingCoordinatorDidCancel(_ coordinator: DeviceVerificationDataLoadingCoordinatorType) +} + +/// `DeviceVerificationDataLoadingCoordinatorType` is a protocol describing a Coordinator that handle key backup setup passphrase navigation flow. +protocol DeviceVerificationDataLoadingCoordinatorType: Coordinator, Presentable { + var delegate: DeviceVerificationDataLoadingCoordinatorDelegate? { get } +} diff --git a/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingViewAction.swift b/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingViewAction.swift new file mode 100644 index 000000000..7527d2d56 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingViewAction.swift @@ -0,0 +1,24 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Loading DeviceVerificationDataLoading +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +/// DeviceVerificationDataLoadingViewController view actions exposed to view model +enum DeviceVerificationDataLoadingViewAction { + case cancel +} diff --git a/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingViewController.storyboard b/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingViewController.storyboard new file mode 100644 index 000000000..5140d7bfd --- /dev/null +++ b/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingViewController.storyboard @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingViewController.swift b/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingViewController.swift new file mode 100644 index 000000000..402ccfdc5 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingViewController.swift @@ -0,0 +1,143 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Loading DeviceVerificationDataLoading +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import UIKit + +final class DeviceVerificationDataLoadingViewController: UIViewController { + + // MARK: - Properties + + // MARK: Outlets + + // MARK: Private + + private var viewModel: DeviceVerificationDataLoadingViewModelType! + private var theme: Theme! + private var errorPresenter: MXKErrorPresentation! + private var activityPresenter: ActivityIndicatorPresenter! + + // MARK: - Setup + + class func instantiate(with viewModel: DeviceVerificationDataLoadingViewModelType) -> DeviceVerificationDataLoadingViewController { + let viewController = StoryboardScene.DeviceVerificationDataLoadingViewController.initialScene.instantiate() + viewController.viewModel = viewModel + viewController.theme = ThemeService.shared().theme + return viewController + } + + // MARK: - Life cycle + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + + self.title = VectorL10n.deviceVerificationTitle + self.vc_removeBackTitle() + + self.setupViews() + + self.activityPresenter = ActivityIndicatorPresenter() + self.errorPresenter = MXKErrorAlertPresentation() + + self.registerThemeServiceDidChangeThemeNotification() + self.update(theme: self.theme) + + self.viewModel.viewDelegate = self + } + + override var preferredStatusBarStyle: UIStatusBarStyle { + return self.theme.statusBarStyle + } + + // MARK: - Private + + private func update(theme: Theme) { + self.theme = theme + + self.view.backgroundColor = theme.headerBackgroundColor + + if let navigationBar = self.navigationController?.navigationBar { + theme.applyStyle(onNavigationBar: navigationBar) + } + } + + private func registerThemeServiceDidChangeThemeNotification() { + NotificationCenter.default.addObserver(self, selector: #selector(themeDidChange), name: .themeServiceDidChangeTheme, object: nil) + } + + private func setupViews() { + let cancelBarButtonItem = MXKBarButtonItem(title: VectorL10n.cancel, style: .plain) { [weak self] in + self?.cancelButtonAction() + } + + self.navigationItem.rightBarButtonItem = cancelBarButtonItem + } + + private func render(viewState: DeviceVerificationDataLoadingViewState) { + switch viewState { + case .loading: + self.renderLoading() + case .loaded: + self.renderLoaded() + case .error(let error): + self.render(error: error) + case .errorMessage(let message): + self.renderError(message: message) + } + } + + private func renderLoading() { + self.activityPresenter.presentActivityIndicator(on: self.view, animated: true) + } + + private func renderLoaded() { + self.activityPresenter.removeCurrentActivityIndicator(animated: true) + } + + private func render(error: Error) { + self.errorPresenter.presentError(from: self, forError: error, animated: true, handler: { + self.viewModel.process(viewAction: .cancel) + }) + } + + private func renderError(message: String) { + self.errorPresenter.presentError(from: self, title: "", message: message, animated: true, handler: { + self.viewModel.process(viewAction: .cancel) + }) + } + + // MARK: - Actions + + @objc private func themeDidChange() { + self.update(theme: ThemeService.shared().theme) + } + + private func cancelButtonAction() { + self.viewModel.process(viewAction: .cancel) + } +} + + +// MARK: - DeviceVerificationDataLoadingViewModelViewDelegate +extension DeviceVerificationDataLoadingViewController: DeviceVerificationDataLoadingViewModelViewDelegate { + + func deviceVerificationDataLoadingViewModel(_ viewModel: DeviceVerificationDataLoadingViewModelType, didUpdateViewState viewSate: DeviceVerificationDataLoadingViewState) { + self.render(viewState: viewSate) + } +} diff --git a/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingViewModel.swift b/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingViewModel.swift new file mode 100644 index 000000000..c433f8db2 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingViewModel.swift @@ -0,0 +1,93 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Loading DeviceVerificationDataLoading +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +final class DeviceVerificationDataLoadingViewModel: DeviceVerificationDataLoadingViewModelType { + + // MARK: - Properties + + // MARK: Private + + private let session: MXSession + private let otherUserId: String + private let otherDeviceId: String + + // MARK: Public + + weak var viewDelegate: DeviceVerificationDataLoadingViewModelViewDelegate? + weak var coordinatorDelegate: DeviceVerificationDataLoadingViewModelCoordinatorDelegate? + + // MARK: - Setup + + init(session: MXSession, otherUserId: String, otherDeviceId: String) { + self.session = session + self.otherUserId = otherUserId + self.otherDeviceId = otherDeviceId + + self.loadData() + } + + deinit { + } + + // MARK: - Public + + func process(viewAction: DeviceVerificationDataLoadingViewAction) { + switch viewAction { + case .cancel: + self.coordinatorDelegate?.deviceVerificationDataLoadingViewModelDidCancel(self) + } + } + + // MARK: - Private + + private func loadData() { + self.update(viewState: .loading) + + if let otherUser = self.session.user(withUserId: otherUserId) { + self.session.crypto?.downloadKeys([self.otherUserId], forceDownload: false, success: { [weak self] (usersDevicesMap) in + guard let sself = self else { + return + } + + sself.update(viewState: .loaded) + + if let otherDevice = usersDevicesMap?.object(forDevice: sself.otherDeviceId, forUser: sself.otherUserId) { + sself.coordinatorDelegate?.deviceVerificationDataLoadingViewModel(sself, didLoadUser: otherUser, device: otherDevice) + } else { + sself.update(viewState: .errorMessage(VectorL10n.deviceVerificationErrorCannotLoadDevice)) + } + + }, failure: { [weak self] (error) in + guard let sself = self, let error = error else { + return + } + + sself.update(viewState: .error(error)) + }) + + } else { + self.update(viewState: .errorMessage(VectorL10n.deviceVerificationErrorCannotLoadDevice)) + } + } + + private func update(viewState: DeviceVerificationDataLoadingViewState) { + self.viewDelegate?.deviceVerificationDataLoadingViewModel(self, didUpdateViewState: viewState) + } +} diff --git a/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingViewModelType.swift b/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingViewModelType.swift new file mode 100644 index 000000000..0121c0028 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingViewModelType.swift @@ -0,0 +1,37 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Loading DeviceVerificationDataLoading +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +protocol DeviceVerificationDataLoadingViewModelViewDelegate: class { + func deviceVerificationDataLoadingViewModel(_ viewModel: DeviceVerificationDataLoadingViewModelType, didUpdateViewState viewSate: DeviceVerificationDataLoadingViewState) +} + +protocol DeviceVerificationDataLoadingViewModelCoordinatorDelegate: class { + func deviceVerificationDataLoadingViewModel(_ viewModel: DeviceVerificationDataLoadingViewModelType, didLoadUser user: MXUser, device: MXDeviceInfo) + func deviceVerificationDataLoadingViewModelDidCancel(_ viewModel: DeviceVerificationDataLoadingViewModelType) +} + +/// Protocol describing the view model used by `DeviceVerificationDataLoadingViewController` +protocol DeviceVerificationDataLoadingViewModelType { + + var viewDelegate: DeviceVerificationDataLoadingViewModelViewDelegate? { get set } + var coordinatorDelegate: DeviceVerificationDataLoadingViewModelCoordinatorDelegate? { get set } + + func process(viewAction: DeviceVerificationDataLoadingViewAction) +} diff --git a/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingViewState.swift b/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingViewState.swift new file mode 100644 index 000000000..1f457efc6 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Loading/DeviceVerificationDataLoadingViewState.swift @@ -0,0 +1,27 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Loading DeviceVerificationDataLoading +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +/// DeviceVerificationDataLoadingViewController view state +enum DeviceVerificationDataLoadingViewState { + case loading + case loaded + case error(Error) + case errorMessage(String) +} diff --git a/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartCoordinator.swift b/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartCoordinator.swift new file mode 100644 index 000000000..f6ba2bec8 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartCoordinator.swift @@ -0,0 +1,78 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Start DeviceVerificationStart +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation +import UIKit + +final class DeviceVerificationStartCoordinator: DeviceVerificationStartCoordinatorType { + + // MARK: - Properties + + // MARK: Private + + private let session: MXSession + private var deviceVerificationStartViewModel: DeviceVerificationStartViewModelType + private let deviceVerificationStartViewController: DeviceVerificationStartViewController + + // MARK: Public + + // Must be used only internally + var childCoordinators: [Coordinator] = [] + + weak var delegate: DeviceVerificationStartCoordinatorDelegate? + + // MARK: - Setup + + init(session: MXSession, otherUser: MXUser, otherDevice: MXDeviceInfo) { + self.session = session + + let deviceVerificationStartViewModel = DeviceVerificationStartViewModel(session: self.session, otherUser: otherUser, otherDevice: otherDevice) + let deviceVerificationStartViewController = DeviceVerificationStartViewController.instantiate(with: deviceVerificationStartViewModel) + self.deviceVerificationStartViewModel = deviceVerificationStartViewModel + self.deviceVerificationStartViewController = deviceVerificationStartViewController + } + + // MARK: - Public methods + + func start() { + self.deviceVerificationStartViewModel.coordinatorDelegate = self + } + + func toPresentable() -> UIViewController { + return self.deviceVerificationStartViewController + } +} + +// MARK: - DeviceVerificationStartViewModelCoordinatorDelegate +extension DeviceVerificationStartCoordinator: DeviceVerificationStartViewModelCoordinatorDelegate { + func deviceVerificationStartViewModelDidUseLegacyVerification(_ viewModel: DeviceVerificationStartViewModelType) { + self.delegate?.deviceVerificationStartCoordinatorDidCancel(self) + } + + func deviceVerificationStartViewModel(_ viewModel: DeviceVerificationStartViewModelType, didCompleteWithOutgoingTransaction transaction: MXSASTransaction) { + self.delegate?.deviceVerificationStartCoordinator(self, didCompleteWithOutgoingTransaction: transaction) + } + + func deviceVerificationStartViewModel(_ viewModel: DeviceVerificationStartViewModelType, didTransactionCancelled transaction: MXSASTransaction) { + self.delegate?.deviceVerificationStartCoordinator(self, didTransactionCancelled: transaction) + } + + func deviceVerificationStartViewModelDidCancel(_ viewModel: DeviceVerificationStartViewModelType) { + self.delegate?.deviceVerificationStartCoordinatorDidCancel(self) + } +} diff --git a/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartCoordinatorType.swift b/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartCoordinatorType.swift new file mode 100644 index 000000000..72871ee60 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartCoordinatorType.swift @@ -0,0 +1,31 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Start DeviceVerificationStart +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +protocol DeviceVerificationStartCoordinatorDelegate: class { + func deviceVerificationStartCoordinator(_ coordinator: DeviceVerificationStartCoordinatorType, didCompleteWithOutgoingTransaction transaction: MXSASTransaction) + func deviceVerificationStartCoordinator(_ coordinator: DeviceVerificationStartCoordinatorType, didTransactionCancelled transaction: MXSASTransaction) + + func deviceVerificationStartCoordinatorDidCancel(_ coordinator: DeviceVerificationStartCoordinatorType) +} + +/// `DeviceVerificationStartCoordinatorType` is a protocol describing a Coordinator that handle key backup setup passphrase navigation flow. +protocol DeviceVerificationStartCoordinatorType: Coordinator, Presentable { + var delegate: DeviceVerificationStartCoordinatorDelegate? { get } +} diff --git a/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartViewAction.swift b/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartViewAction.swift new file mode 100644 index 000000000..06f811c9a --- /dev/null +++ b/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartViewAction.swift @@ -0,0 +1,27 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Start DeviceVerificationStart +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +/// DeviceVerificationStartViewController view actions exposed to view model +enum DeviceVerificationStartViewAction { + case beginVerifying + case verifyUsingLegacy + case verifiedUsingLegacy + case cancel +} diff --git a/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartViewController.storyboard b/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartViewController.storyboard new file mode 100644 index 000000000..bc2f2fd30 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartViewController.storyboard @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartViewController.swift b/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartViewController.swift new file mode 100644 index 000000000..e4d210a00 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartViewController.swift @@ -0,0 +1,250 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Start DeviceVerificationStart +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import UIKit + +final class DeviceVerificationStartViewController: UIViewController { + + // MARK: - Constants + + // MARK: - Properties + + // MARK: Outlets + + @IBOutlet private weak var scrollView: UIScrollView! + + @IBOutlet private weak var titleLabel: UILabel! + @IBOutlet private weak var informationLabel: UILabel! + @IBOutlet private weak var waitingPartnerLabel: UILabel! + @IBOutlet private weak var useLegacyVerificationLabel: UILabel! + @IBOutlet private weak var verifyButtonBackgroundView: UIView! + @IBOutlet private weak var verifyButton: UIButton! + @IBOutlet private weak var useLegacyVerificationButton: UIButton! + + // MARK: Private + + private var viewModel: DeviceVerificationStartViewModelType! + private var theme: Theme! + private var errorPresenter: MXKErrorPresentation! + private var activityPresenter: ActivityIndicatorPresenter! + + // MARK: - Setup + + class func instantiate(with viewModel: DeviceVerificationStartViewModelType) -> DeviceVerificationStartViewController { + let viewController = StoryboardScene.DeviceVerificationStartViewController.initialScene.instantiate() + viewController.viewModel = viewModel + viewController.theme = ThemeService.shared().theme + return viewController + } + + // MARK: - Life cycle + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + + self.title = VectorL10n.deviceVerificationTitle + self.vc_removeBackTitle() + + self.setupViews() + self.activityPresenter = ActivityIndicatorPresenter() + self.errorPresenter = MXKErrorAlertPresentation() + + self.registerThemeServiceDidChangeThemeNotification() + self.update(theme: self.theme) + + self.viewModel.viewDelegate = self + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + } + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + } + + override func viewDidDisappear(_ animated: Bool) { + super.viewDidDisappear(animated) + } + + override func viewDidLayoutSubviews() { + super.viewDidLayoutSubviews() + } + + override var preferredStatusBarStyle: UIStatusBarStyle { + return self.theme.statusBarStyle + } + + // MARK: - Private + + private func update(theme: Theme) { + self.theme = theme + + self.view.backgroundColor = theme.headerBackgroundColor + + if let navigationBar = self.navigationController?.navigationBar { + theme.applyStyle(onNavigationBar: navigationBar) + } + + self.titleLabel.textColor = theme.textPrimaryColor + self.informationLabel.textColor = theme.textPrimaryColor + self.waitingPartnerLabel.textColor = theme.textPrimaryColor + self.useLegacyVerificationLabel.textColor = theme.textPrimaryColor + + self.verifyButton.backgroundColor = theme.backgroundColor + theme.applyStyle(onButton: self.verifyButton) + + theme.applyStyle(onButton: self.useLegacyVerificationButton) + } + + private func registerThemeServiceDidChangeThemeNotification() { + NotificationCenter.default.addObserver(self, selector: #selector(themeDidChange), name: .themeServiceDidChangeTheme, object: nil) + } + + @objc private func themeDidChange() { + self.update(theme: ThemeService.shared().theme) + } + + private func setupViews() { + let cancelBarButtonItem = MXKBarButtonItem(title: VectorL10n.cancel, style: .plain) { [weak self] in + self?.cancelButtonAction() + } + + self.navigationItem.rightBarButtonItem = cancelBarButtonItem + + self.scrollView.keyboardDismissMode = .interactive + + self.titleLabel.text = VectorL10n.deviceVerificationStartTitle + self.informationLabel.text = VectorL10n.deviceVerificationSecurityAdvice + self.waitingPartnerLabel.text = VectorL10n.deviceVerificationStartWaitPartner + self.useLegacyVerificationLabel.text = VectorL10n.deviceVerificationStartUseLegacy + + self.waitingPartnerLabel.isHidden = true + self.useLegacyVerificationLabel.isHidden = true + + self.verifyButton.setTitle(VectorL10n.deviceVerificationStartVerifyButton, for: .normal) + self.useLegacyVerificationButton.setTitle(VectorL10n.deviceVerificationStartUseLegacyAction, for: .normal) + } + + private func render(viewState: DeviceVerificationStartViewState) { + switch viewState { + case .loading: + self.renderLoading() + case .loaded: + self.renderStarted() + case .verifyUsingLegacy(let session, let deviceInfo): + self.renderVerifyUsingLegacy(session: session, deviceInfo: deviceInfo) + case .cancelled(let reason): + self.renderCancelled(reason: reason) + case .cancelledByMe(let reason): + self.renderCancelledByMe(reason: reason) + case .error(let error): + self.render(error: error) + } + } + + private func renderLoading() { + self.activityPresenter.presentActivityIndicator(on: self.view, animated: true) + } + + private func renderStarted() { + self.activityPresenter.removeCurrentActivityIndicator(animated: true) + + self.verifyButtonBackgroundView.isHidden = true + self.waitingPartnerLabel.isHidden = false + self.useLegacyVerificationLabel.isHidden = false + } + + private func renderVerifyUsingLegacy(session: MXSession, deviceInfo: MXDeviceInfo) { + self.activityPresenter.removeCurrentActivityIndicator(animated: true) + + guard let encryptionInfoView = EncryptionInfoView(deviceInfo: deviceInfo, andMatrixSession: session) else { + return + } + + encryptionInfoView.delegate = self + + // Skip the intro page + encryptionInfoView.displayLegacyVerificationScreen() + + // Display the legacy verification view in full screen + // TODO: Do not reuse the legacy EncryptionInfoView and create a screen from scratch + self.view.vc_addSubViewMatchingParent(encryptionInfoView) + self.navigationController?.isNavigationBarHidden = true + } + + private func renderCancelled(reason: MXTransactionCancelCode) { + self.activityPresenter.removeCurrentActivityIndicator(animated: true) + + self.errorPresenter.presentError(from: self, title: "", message: VectorL10n.deviceVerificationCancelled, animated: true) { + self.viewModel.process(viewAction: .cancel) + } + } + + private func renderCancelledByMe(reason: MXTransactionCancelCode) { + if reason.value != MXTransactionCancelCode.user().value { + self.activityPresenter.removeCurrentActivityIndicator(animated: true) + + self.errorPresenter.presentError(from: self, title: "", message: VectorL10n.deviceVerificationCancelledByMe(reason.humanReadable), animated: true) { + self.viewModel.process(viewAction: .cancel) + } + } + } + + private func render(error: Error) { + self.activityPresenter.removeCurrentActivityIndicator(animated: true) + self.errorPresenter.presentError(from: self, forError: error, animated: true, handler: nil) + } + + + // MARK: - Actions + + @IBAction private func verifyButtonAction(_ sender: Any) { + self.viewModel.process(viewAction: .beginVerifying) + } + + @IBAction private func useLegacyVerificationButtonAction(_ sender: Any) { + self.viewModel.process(viewAction: .verifyUsingLegacy) + } + + private func cancelButtonAction() { + self.viewModel.process(viewAction: .cancel) + } +} + + +// MARK: - DeviceVerificationStartViewModelViewDelegate +extension DeviceVerificationStartViewController: DeviceVerificationStartViewModelViewDelegate { + + func deviceVerificationStartViewModel(_ viewModel: DeviceVerificationStartViewModelType, didUpdateViewState viewSate: DeviceVerificationStartViewState) { + self.render(viewState: viewSate) + } +} + +// MARK: - DeviceVerificationStartViewModelViewDelegate +extension DeviceVerificationStartViewController: MXKEncryptionInfoViewDelegate { + func encryptionInfoView(_ encryptionInfoView: MXKEncryptionInfoView!, didDeviceInfoVerifiedChange deviceInfo: MXDeviceInfo!) { + self.viewModel.process(viewAction: .verifiedUsingLegacy) + } + + func encryptionInfoViewDidClose(_ encryptionInfoView: MXKEncryptionInfoView!) { + self.viewModel.process(viewAction: .cancel) + } +} diff --git a/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartViewModel.swift b/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartViewModel.swift new file mode 100644 index 000000000..d599d7b51 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartViewModel.swift @@ -0,0 +1,132 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Start DeviceVerificationStart +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +final class DeviceVerificationStartViewModel: DeviceVerificationStartViewModelType { + + // MARK: - Properties + + // MARK: Private + + private let session: MXSession + private let verificationManager: MXDeviceVerificationManager + private let otherUser: MXUser + private let otherDevice: MXDeviceInfo + + private var transaction: MXSASTransaction! + + // MARK: Public + + weak var viewDelegate: DeviceVerificationStartViewModelViewDelegate? + weak var coordinatorDelegate: DeviceVerificationStartViewModelCoordinatorDelegate? + + // MARK: - Setup + + init(session: MXSession, otherUser: MXUser, otherDevice: MXDeviceInfo) { + self.session = session + self.verificationManager = session.crypto.deviceVerificationManager + self.otherUser = otherUser + self.otherDevice = otherDevice + } + + deinit { + } + + // MARK: - Public + + func process(viewAction: DeviceVerificationStartViewAction) { + switch viewAction { + case .beginVerifying: + self.beginVerifying() + case .verifyUsingLegacy: + self.cancelTransaction() + self.update(viewState: .verifyUsingLegacy(self.session, self.otherDevice)) + case .verifiedUsingLegacy: + self.coordinatorDelegate?.deviceVerificationStartViewModelDidUseLegacyVerification(self) + case .cancel: + self.cancelTransaction() + self.coordinatorDelegate?.deviceVerificationStartViewModelDidCancel(self) + } + } + + // MARK: - Private + + private func beginVerifying() { + self.update(viewState: .loading) + + self.verificationManager.beginKeyVerification(withUserId: self.otherUser.userId, andDeviceId: self.otherDevice.deviceId, method: MXKeyVerificationMethodSAS, success: { [weak self] (transaction) in + + guard let sself = self else { + return + } + guard let sasTransaction: MXOutgoingSASTransaction = transaction as? MXOutgoingSASTransaction else { + return + } + + sself.transaction = sasTransaction + + sself.registerTransactionDidStateChangeNotification(transaction: sasTransaction) + sself.update(viewState: .loaded) + }, failure: {[weak self] error in + self?.update(viewState: .error(error)) + }) + } + + private func cancelTransaction() { + guard let transaction = self.transaction else { + return + } + + transaction.cancel(with: MXTransactionCancelCode.user()) + } + + private func update(viewState: DeviceVerificationStartViewState) { + self.viewDelegate?.deviceVerificationStartViewModel(self, didUpdateViewState: viewState) + } + + + // MARK: - MXDeviceVerificationTransactionDidChange + + private func registerTransactionDidStateChangeNotification(transaction: MXOutgoingSASTransaction) { + NotificationCenter.default.addObserver(self, selector: #selector(transactionDidStateChange(notification:)), name: NSNotification.Name.MXDeviceVerificationTransactionDidChange, object: transaction) + } + + @objc private func transactionDidStateChange(notification: Notification) { + guard let transaction = notification.object as? MXOutgoingSASTransaction else { + return + } + + switch transaction.state { + case MXSASTransactionStateShowSAS: + self.coordinatorDelegate?.deviceVerificationStartViewModel(self, didCompleteWithOutgoingTransaction: transaction) + case MXSASTransactionStateCancelled: + guard let reason = transaction.reasonCancelCode else { + return + } + self.update(viewState: .cancelled(reason)) + case MXSASTransactionStateCancelledByMe: + guard let reason = transaction.reasonCancelCode else { + return + } + self.update(viewState: .cancelledByMe(reason)) + default: + break + } + } +} diff --git a/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartViewModelType.swift b/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartViewModelType.swift new file mode 100644 index 000000000..07da5a197 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartViewModelType.swift @@ -0,0 +1,40 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Start DeviceVerificationStart +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +protocol DeviceVerificationStartViewModelViewDelegate: class { + func deviceVerificationStartViewModel(_ viewModel: DeviceVerificationStartViewModelType, didUpdateViewState viewSate: DeviceVerificationStartViewState) +} + +protocol DeviceVerificationStartViewModelCoordinatorDelegate: class { + func deviceVerificationStartViewModelDidUseLegacyVerification(_ viewModel: DeviceVerificationStartViewModelType) + + func deviceVerificationStartViewModel(_ viewModel: DeviceVerificationStartViewModelType, didCompleteWithOutgoingTransaction transaction: MXSASTransaction) + func deviceVerificationStartViewModel(_ viewModel: DeviceVerificationStartViewModelType, didTransactionCancelled transaction: MXSASTransaction) + + func deviceVerificationStartViewModelDidCancel(_ viewModel: DeviceVerificationStartViewModelType) +} + +/// Protocol describing the view model used by `DeviceVerificationStartViewController` +protocol DeviceVerificationStartViewModelType { + var viewDelegate: DeviceVerificationStartViewModelViewDelegate? { get set } + var coordinatorDelegate: DeviceVerificationStartViewModelCoordinatorDelegate? { get set } + + func process(viewAction: DeviceVerificationStartViewAction) +} diff --git a/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartViewState.swift b/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartViewState.swift new file mode 100644 index 000000000..9b9ea8adc --- /dev/null +++ b/Riot/Modules/DeviceVerification/Start/DeviceVerificationStartViewState.swift @@ -0,0 +1,29 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Start DeviceVerificationStart +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +/// DeviceVerificationStartViewController view state +enum DeviceVerificationStartViewState { + case loading + case loaded // started + case verifyUsingLegacy(MXSession, MXDeviceInfo) + case cancelled(MXTransactionCancelCode) + case cancelledByMe(MXTransactionCancelCode) + case error(Error) +} diff --git a/Riot/Modules/DeviceVerification/Verified/DeviceVerificationVerifiedViewController.storyboard b/Riot/Modules/DeviceVerification/Verified/DeviceVerificationVerifiedViewController.storyboard new file mode 100644 index 000000000..8e75a5a02 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Verified/DeviceVerificationVerifiedViewController.storyboard @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Riot/Modules/DeviceVerification/Verified/DeviceVerificationVerifiedViewController.swift b/Riot/Modules/DeviceVerification/Verified/DeviceVerificationVerifiedViewController.swift new file mode 100644 index 000000000..b9ebde0b5 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Verified/DeviceVerificationVerifiedViewController.swift @@ -0,0 +1,121 @@ +// File created from simpleScreenTemplate +// $ createSimpleScreen.sh DeviceVerification/Verified DeviceVerificationVerified +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import UIKit + +protocol DeviceVerificationVerifiedViewControllerDelegate: class { + func deviceVerificationVerifiedViewControllerDidTapSetupAction(_ viewController: DeviceVerificationVerifiedViewController) + func deviceVerificationVerifiedViewControllerDidCancel(_ viewController: DeviceVerificationVerifiedViewController) +} + +final class DeviceVerificationVerifiedViewController: UIViewController { + + // MARK: - Properties + + // MARK: Outlets + + @IBOutlet private weak var titleLabel: UILabel! + @IBOutlet private weak var description1Label: UILabel! + @IBOutlet private weak var description2Label: UILabel! + + @IBOutlet private weak var okButtonBackgroundView: UIView! + @IBOutlet private weak var okButton: UIButton! + + // MARK: Private + + private var theme: Theme! + + // MARK: Public + + weak var delegate: DeviceVerificationVerifiedViewControllerDelegate? + + // MARK: - Setup + + class func instantiate() -> DeviceVerificationVerifiedViewController { + let viewController = StoryboardScene.DeviceVerificationVerifiedViewController.initialScene.instantiate() + viewController.theme = ThemeService.shared().theme + return viewController + } + + // MARK: - Life cycle + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + + self.title = VectorL10n.deviceVerificationTitle + self.vc_removeBackTitle() + + self.setupViews() + self.registerThemeServiceDidChangeThemeNotification() + self.update(theme: self.theme) + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + + // Hide back button + self.navigationItem.setHidesBackButton(true, animated: animated) + } + + override var preferredStatusBarStyle: UIStatusBarStyle { + return self.theme.statusBarStyle + } + + // MARK: - Private + + private func setupViews() { + self.titleLabel.text = VectorL10n.deviceVerificationVerifiedTitle + self.description1Label.text = VectorL10n.deviceVerificationVerifiedDescription1 + self.description2Label.text = VectorL10n.deviceVerificationVerifiedDescription2 + + self.okButton.setTitle(VectorL10n.deviceVerificationVerifiedGotItButton, for: .normal) + } + + private func update(theme: Theme) { + self.theme = theme + + self.view.backgroundColor = theme.headerBackgroundColor + + if let navigationBar = self.navigationController?.navigationBar { + theme.applyStyle(onNavigationBar: navigationBar) + } + + self.titleLabel.textColor = theme.textPrimaryColor + self.description1Label.textColor = theme.textPrimaryColor + self.description2Label.textColor = theme.textPrimaryColor + + self.okButtonBackgroundView.backgroundColor = theme.backgroundColor + theme.applyStyle(onButton: self.okButton) + } + + private func registerThemeServiceDidChangeThemeNotification() { + NotificationCenter.default.addObserver(self, selector: #selector(themeDidChange), name: .themeServiceDidChangeTheme, object: nil) + } + + // MARK: - Actions + + @objc private func themeDidChange() { + self.update(theme: ThemeService.shared().theme) + } + + @IBAction private func validateButtonAction(_ sender: Any) { + self.delegate?.deviceVerificationVerifiedViewControllerDidTapSetupAction(self) + } +} diff --git a/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyCoordinator.swift b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyCoordinator.swift new file mode 100644 index 000000000..4b5c83580 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyCoordinator.swift @@ -0,0 +1,71 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Verify DeviceVerificationVerify +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation +import UIKit + +final class DeviceVerificationVerifyCoordinator: DeviceVerificationVerifyCoordinatorType { + + // MARK: - Properties + + // MARK: Private + + private let session: MXSession + private var deviceVerificationVerifyViewModel: DeviceVerificationVerifyViewModelType + private let deviceVerificationVerifyViewController: DeviceVerificationVerifyViewController + + // MARK: Public + + // Must be used only internally + var childCoordinators: [Coordinator] = [] + + weak var delegate: DeviceVerificationVerifyCoordinatorDelegate? + + // MARK: - Setup + + init(session: MXSession, transaction: MXSASTransaction) { + self.session = session + + let deviceVerificationVerifyViewModel = DeviceVerificationVerifyViewModel(session: self.session, transaction: transaction) + let deviceVerificationVerifyViewController = DeviceVerificationVerifyViewController.instantiate(with: deviceVerificationVerifyViewModel) + self.deviceVerificationVerifyViewModel = deviceVerificationVerifyViewModel + self.deviceVerificationVerifyViewController = deviceVerificationVerifyViewController + } + + // MARK: - Public methods + + func start() { + self.deviceVerificationVerifyViewModel.coordinatorDelegate = self + } + + func toPresentable() -> UIViewController { + return self.deviceVerificationVerifyViewController + } +} + +// MARK: - DeviceVerificationVerifyViewModelCoordinatorDelegate +extension DeviceVerificationVerifyCoordinator: DeviceVerificationVerifyViewModelCoordinatorDelegate { + + func deviceVerificationVerifyViewModelDidComplete(_ viewModel: DeviceVerificationVerifyViewModelType) { + self.delegate?.deviceVerificationVerifyCoordinatorDidComplete(self) + } + + func deviceVerificationVerifyViewModelDidCancel(_ viewModel: DeviceVerificationVerifyViewModelType) { + self.delegate?.deviceVerificationVerifyCoordinatorDidCancel(self) + } +} diff --git a/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyCoordinatorType.swift b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyCoordinatorType.swift new file mode 100644 index 000000000..d9816480b --- /dev/null +++ b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyCoordinatorType.swift @@ -0,0 +1,29 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Verify DeviceVerificationVerify +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +protocol DeviceVerificationVerifyCoordinatorDelegate: class { + func deviceVerificationVerifyCoordinatorDidComplete(_ coordinator: DeviceVerificationVerifyCoordinatorType) + func deviceVerificationVerifyCoordinatorDidCancel(_ coordinator: DeviceVerificationVerifyCoordinatorType) +} + +/// `DeviceVerificationVerifyCoordinatorType` is a protocol describing a Coordinator that handle key backup setup passphrase navigation flow. +protocol DeviceVerificationVerifyCoordinatorType: Coordinator, Presentable { + var delegate: DeviceVerificationVerifyCoordinatorDelegate? { get } +} diff --git a/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewAction.swift b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewAction.swift new file mode 100644 index 000000000..5ed5933c6 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewAction.swift @@ -0,0 +1,26 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Verify DeviceVerificationVerify +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +/// DeviceVerificationVerifyViewController view actions exposed to view model +enum DeviceVerificationVerifyViewAction { + case confirm + case complete + case cancel +} diff --git a/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewController.storyboard b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewController.storyboard new file mode 100644 index 000000000..e0ae6c663 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewController.storyboard @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewController.swift b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewController.swift new file mode 100644 index 000000000..a5b2a9292 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewController.swift @@ -0,0 +1,251 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Verify DeviceVerificationVerify +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import UIKit + +final class DeviceVerificationVerifyViewController: UIViewController { + + // MARK: - Constants + + // MARK: - Properties + + // MARK: Outlets + + @IBOutlet private weak var scrollView: UIScrollView! + + @IBOutlet private weak var titleLabel: UILabel! + @IBOutlet private weak var informationLabel: UILabel! + @IBOutlet private weak var decimalLabel: UILabel! + @IBOutlet private weak var emojisCollectionView: UICollectionView! + @IBOutlet private weak var waitingPartnerLabel: UILabel! + @IBOutlet private weak var continueButtonBackgroundView: UIView! + @IBOutlet private weak var continueButton: UIButton! + + // MARK: Private + + private var viewModel: DeviceVerificationVerifyViewModelType! + private var theme: Theme! + private var errorPresenter: MXKErrorPresentation! + private var activityPresenter: ActivityIndicatorPresenter! + + // MARK: - Setup + + class func instantiate(with viewModel: DeviceVerificationVerifyViewModelType) -> DeviceVerificationVerifyViewController { + let viewController = StoryboardScene.DeviceVerificationVerifyViewController.initialScene.instantiate() + viewController.viewModel = viewModel + viewController.theme = ThemeService.shared().theme + return viewController + } + + // MARK: - Life cycle + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + + self.title = VectorL10n.deviceVerificationTitle + self.vc_removeBackTitle() + + self.setupViews() + self.errorPresenter = MXKErrorAlertPresentation() + self.activityPresenter = ActivityIndicatorPresenter() + + self.registerThemeServiceDidChangeThemeNotification() + self.update(theme: self.theme) + + self.viewModel.viewDelegate = self + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + + // Hide back button + self.navigationItem.setHidesBackButton(true, animated: animated) + } + + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + } + + override func viewDidDisappear(_ animated: Bool) { + super.viewDidDisappear(animated) + } + + override func viewDidLayoutSubviews() { + super.viewDidLayoutSubviews() + } + + override var preferredStatusBarStyle: UIStatusBarStyle { + return self.theme.statusBarStyle + } + + // MARK: - Private + + private func update(theme: Theme) { + self.theme = theme + + self.view.backgroundColor = theme.headerBackgroundColor + + if let navigationBar = self.navigationController?.navigationBar { + theme.applyStyle(onNavigationBar: navigationBar) + } + + self.titleLabel.textColor = theme.textPrimaryColor + self.informationLabel.textColor = theme.textPrimaryColor + self.decimalLabel.textColor = theme.textPrimaryColor + self.waitingPartnerLabel.textColor = theme.textPrimaryColor + + self.continueButton.backgroundColor = theme.backgroundColor + theme.applyStyle(onButton: self.continueButton) + + emojisCollectionView.reloadData() + } + + private func registerThemeServiceDidChangeThemeNotification() { + NotificationCenter.default.addObserver(self, selector: #selector(themeDidChange), name: .themeServiceDidChangeTheme, object: nil) + } + + @objc private func themeDidChange() { + self.update(theme: ThemeService.shared().theme) + } + + private func setupViews() { + let cancelBarButtonItem = MXKBarButtonItem(title: VectorL10n.cancel, style: .plain) { [weak self] in + self?.cancelButtonAction() + } + + self.navigationItem.rightBarButtonItem = cancelBarButtonItem + + self.scrollView.keyboardDismissMode = .interactive + + if viewModel.emojis != nil { + self.decimalLabel.isHidden = true + self.titleLabel.text = VectorL10n.deviceVerificationVerifyTitleEmoji + } else { + self.emojisCollectionView.isHidden = true + self.titleLabel.text = VectorL10n.deviceVerificationVerifyTitleNumber + self.decimalLabel.text = self.viewModel.decimal + } + + self.informationLabel.text = VectorL10n.deviceVerificationSecurityAdvice + self.waitingPartnerLabel.text = VectorL10n.deviceVerificationVerifyWaitPartner + + self.waitingPartnerLabel.isHidden = true + + self.continueButton.setTitle(VectorL10n.continue, for: .normal) + } + + private func render(viewState: DeviceVerificationVerifyViewState) { + switch viewState { + case .loading: + self.renderLoading() + case .loaded: + self.renderVerified() + case .cancelled(let reason): + self.renderCancelled(reason: reason) + case .cancelledByMe(let reason): + self.renderCancelledByMe(reason: reason) + case .error(let error): + self.render(error: error) + } + } + + private func renderLoading() { + self.activityPresenter.presentActivityIndicator(on: self.view, animated: true) + } + + private func renderVerified() { + self.activityPresenter.removeCurrentActivityIndicator(animated: true) + + self.continueButtonBackgroundView.isHidden = true + self.waitingPartnerLabel.isHidden = false + } + + private func renderCancelled(reason: MXTransactionCancelCode) { + self.activityPresenter.removeCurrentActivityIndicator(animated: true) + + self.errorPresenter.presentError(from: self, title: "", message: VectorL10n.deviceVerificationCancelled, animated: true) { + self.viewModel.process(viewAction: .cancel) + } + } + + private func renderCancelledByMe(reason: MXTransactionCancelCode) { + if reason.value != MXTransactionCancelCode.user().value { + self.activityPresenter.removeCurrentActivityIndicator(animated: true) + + self.errorPresenter.presentError(from: self, title: "", message: VectorL10n.deviceVerificationCancelledByMe(reason.humanReadable), animated: true) { + self.viewModel.process(viewAction: .cancel) + } + } + } + + private func render(error: Error) { + self.activityPresenter.removeCurrentActivityIndicator(animated: true) + self.errorPresenter.presentError(from: self, forError: error, animated: true, handler: nil) + } + + + // MARK: - Actions + + @IBAction private func continueButtonAction(_ sender: Any) { + self.viewModel.process(viewAction: .confirm) + } + + private func cancelButtonAction() { + self.viewModel.process(viewAction: .cancel) + } +} + + +// MARK: - DeviceVerificationVerifyViewModelViewDelegate +extension DeviceVerificationVerifyViewController: DeviceVerificationVerifyViewModelViewDelegate { + + func deviceVerificationVerifyViewModel(_ viewModel: DeviceVerificationVerifyViewModelType, didUpdateViewState viewSate: DeviceVerificationVerifyViewState) { + self.render(viewState: viewSate) + } +} + + +extension DeviceVerificationVerifyViewController: UICollectionViewDataSource { + + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + guard let emojis = self.viewModel.emojis else { + return 0 + } + return emojis.count + } + + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + + guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "VerifyEmojiCollectionViewCell", for: indexPath) as? VerifyEmojiCollectionViewCell else { + return UICollectionViewCell() + } + + guard let emoji = self.viewModel.emojis?[indexPath.row] else { + return UICollectionViewCell() + } + + cell.emoji.text = emoji.emoji + cell.name.text = VectorL10n.tr("Vector", "device_verification_emoji_\(emoji.name)") + + cell.update(theme: self.theme) + + return cell + } +} diff --git a/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewModel.swift b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewModel.swift new file mode 100644 index 000000000..8ccb9bdb9 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewModel.swift @@ -0,0 +1,120 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Verify DeviceVerificationVerify +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +final class DeviceVerificationVerifyViewModel: DeviceVerificationVerifyViewModelType { + + // MARK: - Properties + + // MARK: Private + + private let session: MXSession + private let transaction: MXSASTransaction + + // MARK: Public + + weak var viewDelegate: DeviceVerificationVerifyViewModelViewDelegate? + weak var coordinatorDelegate: DeviceVerificationVerifyViewModelCoordinatorDelegate? + var emojis: [MXEmojiRepresentation]? + var decimal: String? + + // MARK: - Setup + + init(session: MXSession, transaction: MXSASTransaction) { + self.session = session + self.transaction = transaction + self.emojis = self.transaction.sasEmoji + self.decimal = self.transaction.sasDecimal + + self.registerTransactionDidStateChangeNotification(transaction: transaction) + } + + deinit { + } + + // MARK: - Public + + func process(viewAction: DeviceVerificationVerifyViewAction) { + switch viewAction { + case .confirm: + self.confirmTransaction() + case .complete: + self.coordinatorDelegate?.deviceVerificationVerifyViewModelDidComplete(self) + case .cancel: + self.cancelTransaction() + self.coordinatorDelegate?.deviceVerificationVerifyViewModelDidCancel(self) + } + } + + // MARK: - Private + + private func confirmTransaction() { + self.update(viewState: .loading) + + self.transaction.confirmSASMatch() + } + + private func cancelTransaction() { + self.transaction.cancel(with: MXTransactionCancelCode.user()) + } + + private func update(viewState: DeviceVerificationVerifyViewState) { + self.viewDelegate?.deviceVerificationVerifyViewModel(self, didUpdateViewState: viewState) + } + + // MARK: - MXDeviceVerificationTransactionDidChange + + private func registerTransactionDidStateChangeNotification(transaction: MXSASTransaction) { + NotificationCenter.default.addObserver(self, selector: #selector(transactionDidStateChange(notification:)), name: NSNotification.Name.MXDeviceVerificationTransactionDidChange, object: transaction) + } + + @objc private func transactionDidStateChange(notification: Notification) { + guard let transaction = notification.object as? MXSASTransaction else { + return + } + + switch transaction.state { + case MXSASTransactionStateVerified: + self.update(viewState: .loaded) + self.coordinatorDelegate?.deviceVerificationVerifyViewModelDidComplete(self) + case MXSASTransactionStateCancelled: + guard let reason = transaction.reasonCancelCode else { + return + } + self.update(viewState: .cancelled(reason)) + case MXSASTransactionStateError: + guard let error = transaction.error else { + return + } + self.update(viewState: .error(error)) + case MXSASTransactionStateCancelled: + guard let reason = transaction.reasonCancelCode else { + return + } + self.update(viewState: .cancelled(reason)) + case MXSASTransactionStateCancelledByMe: + guard let reason = transaction.reasonCancelCode else { + return + } + self.update(viewState: .cancelledByMe(reason)) + default: + break + } + } +} diff --git a/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewModelType.swift b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewModelType.swift new file mode 100644 index 000000000..8ea8aa449 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewModelType.swift @@ -0,0 +1,40 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Verify DeviceVerificationVerify +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +protocol DeviceVerificationVerifyViewModelViewDelegate: class { + func deviceVerificationVerifyViewModel(_ viewModel: DeviceVerificationVerifyViewModelType, didUpdateViewState viewSate: DeviceVerificationVerifyViewState) +} + +protocol DeviceVerificationVerifyViewModelCoordinatorDelegate: class { + func deviceVerificationVerifyViewModelDidComplete(_ viewModel: DeviceVerificationVerifyViewModelType) + func deviceVerificationVerifyViewModelDidCancel(_ viewModel: DeviceVerificationVerifyViewModelType) +} + +/// Protocol describing the view model used by `DeviceVerificationVerifyViewController` +protocol DeviceVerificationVerifyViewModelType { + + var viewDelegate: DeviceVerificationVerifyViewModelViewDelegate? { get set } + var coordinatorDelegate: DeviceVerificationVerifyViewModelCoordinatorDelegate? { get set } + + func process(viewAction: DeviceVerificationVerifyViewAction) + + var emojis: [MXEmojiRepresentation]? { get set } + var decimal: String? { get set } +} diff --git a/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewState.swift b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewState.swift new file mode 100644 index 000000000..312db4e64 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Verify/DeviceVerificationVerifyViewState.swift @@ -0,0 +1,28 @@ +// File created from ScreenTemplate +// $ createScreen.sh DeviceVerification/Verify DeviceVerificationVerify +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +/// DeviceVerificationVerifyViewController view state +enum DeviceVerificationVerifyViewState { + case loading + case loaded // verified + case cancelled(MXTransactionCancelCode) + case cancelledByMe(MXTransactionCancelCode) + case error(Error) +} diff --git a/Riot/Modules/DeviceVerification/Verify/Views/VerifyEmojiCollectionViewCell.swift b/Riot/Modules/DeviceVerification/Verify/Views/VerifyEmojiCollectionViewCell.swift new file mode 100644 index 000000000..7d1780062 --- /dev/null +++ b/Riot/Modules/DeviceVerification/Verify/Views/VerifyEmojiCollectionViewCell.swift @@ -0,0 +1,26 @@ +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import UIKit + +class VerifyEmojiCollectionViewCell: UICollectionViewCell, Themable { + @IBOutlet weak var emoji: UILabel! + @IBOutlet weak var name: UILabel! + + func update(theme: Theme) { + name.textColor = theme.textPrimaryColor + } +} diff --git a/Riot/Modules/EncryptionInfo/EncryptionInfoView.h b/Riot/Modules/EncryptionInfo/EncryptionInfoView.h index 7e3a527ab..3c772b423 100644 --- a/Riot/Modules/EncryptionInfo/EncryptionInfoView.h +++ b/Riot/Modules/EncryptionInfo/EncryptionInfoView.h @@ -16,7 +16,16 @@ #import +/** + TODO: This view as it is implemented in this class must disappear. + It should be part of the device verification flow (`DeviceVerificationCoordinator`). + */ @interface EncryptionInfoView : MXKEncryptionInfoView +/** + Open the legacy simple verification screen + */ +- (void)displayLegacyVerificationScreen; + @end diff --git a/Riot/Modules/EncryptionInfo/EncryptionInfoView.m b/Riot/Modules/EncryptionInfo/EncryptionInfoView.m index bcc35656e..4d858639c 100644 --- a/Riot/Modules/EncryptionInfo/EncryptionInfoView.m +++ b/Riot/Modules/EncryptionInfo/EncryptionInfoView.m @@ -20,6 +20,15 @@ #import "ThemeService.h" #import "Riot-Swift.h" +#import "AppDelegate.h" + +@interface EncryptionInfoView() +{ + DeviceVerificationCoordinatorBridgePresenter *deviceVerificationCoordinatorBridgePresenter; +} + +@end + @implementation EncryptionInfoView #pragma mark - Override MXKView @@ -37,4 +46,38 @@ self.confirmVerifyButton.tintColor = ThemeService.shared.theme.tintColor; } +- (void)displayLegacyVerificationScreen +{ + [super onButtonPressed:self.verifyButton]; +} + +- (void)onButtonPressed:(id)sender +{ + UIViewController *rootViewController = [AppDelegate theDelegate].window.rootViewController; + if (sender == self.verifyButton && self.mxDeviceInfo.verified != MXDeviceVerified + && self.mxDeviceInfo + && rootViewController) + { + // Redirect to the interactive device verification flow + deviceVerificationCoordinatorBridgePresenter = [[DeviceVerificationCoordinatorBridgePresenter alloc] initWithSession:self.mxSession]; + deviceVerificationCoordinatorBridgePresenter.delegate = self; + + // Show it on the root view controller + [deviceVerificationCoordinatorBridgePresenter presentFrom:rootViewController otherUserId:self.mxDeviceInfo.userId otherDeviceId:self.mxDeviceInfo.deviceId animated:YES]; + } + else + { + [super onButtonPressed:sender]; + } +} + +- (void)deviceVerificationCoordinatorBridgePresenterDelegateDidComplete:(DeviceVerificationCoordinatorBridgePresenter * _Nonnull)coordinatorBridgePresenter otherUserId:(NSString * _Nonnull)otherUserId otherDeviceId:(NSString * _Nonnull)otherDeviceId { + + [deviceVerificationCoordinatorBridgePresenter dismissWithAnimated:YES completion:nil]; + deviceVerificationCoordinatorBridgePresenter = nil; + + // Eject like MXKEncryptionInfoView does + [self removeFromSuperview]; +} + @end diff --git a/Riot/Modules/Home/Views/RoomCollectionViewCell.m b/Riot/Modules/Home/Views/RoomCollectionViewCell.m index 932ff775e..5c6ed3aa3 100644 --- a/Riot/Modules/Home/Views/RoomCollectionViewCell.m +++ b/Riot/Modules/Home/Views/RoomCollectionViewCell.m @@ -135,14 +135,7 @@ static const CGFloat kDirectRoomBorderWidth = 3.0; } // Use bold font for the room title - if ([UIFont respondsToSelector:@selector(systemFontOfSize:weight:)]) - { - self.roomTitle.font = self.roomTitle1.font = self.roomTitle2.font = [UIFont systemFontOfSize:13 weight:UIFontWeightBold]; - } - else - { - self.roomTitle.font = self.roomTitle1.font = self.roomTitle2.font = [UIFont boldSystemFontOfSize:13]; - } + self.roomTitle.font = self.roomTitle1.font = self.roomTitle2.font = [UIFont systemFontOfSize:13 weight:UIFontWeightBold]; } else if (roomCellData.roomSummary.room.summary.membership == MXMembershipInvite) { @@ -155,26 +148,13 @@ static const CGFloat kDirectRoomBorderWidth = 3.0; self.missedNotifAndUnreadBadgeBgViewWidthConstraint.constant = self.missedNotifAndUnreadBadgeLabel.frame.size.width + 18; // Use bold font for the room title - if ([UIFont respondsToSelector:@selector(systemFontOfSize:weight:)]) - { - self.roomTitle.font = self.roomTitle1.font = self.roomTitle2.font = [UIFont systemFontOfSize:13 weight:UIFontWeightBold]; - } - else - { - self.roomTitle.font = self.roomTitle1.font = self.roomTitle2.font = [UIFont boldSystemFontOfSize:13]; - } + self.roomTitle.font = self.roomTitle1.font = self.roomTitle2.font = [UIFont systemFontOfSize:13 weight:UIFontWeightBold]; } else { - // The room title is not bold anymore - if ([UIFont respondsToSelector:@selector(systemFontOfSize:weight:)]) - { - self.roomTitle.font = self.roomTitle1.font = self.roomTitle2.font = [UIFont systemFontOfSize:13 weight:UIFontWeightMedium]; - } - else - { - self.roomTitle.font = self.roomTitle1.font = self.roomTitle2.font = [UIFont systemFontOfSize:13]; - } + // The room title is not bold anymore + self.roomTitle.font = self.roomTitle1.font = self.roomTitle2.font = [UIFont systemFontOfSize:13 weight:UIFontWeightMedium]; + } self.directRoomBorderView.hidden = !roomCellData.roomSummary.room.isDirect; diff --git a/Riot/Modules/Integrations/Widgets/Jitsi/JitsiService.swift b/Riot/Modules/Integrations/Widgets/Jitsi/JitsiService.swift new file mode 100644 index 000000000..f551fea41 --- /dev/null +++ b/Riot/Modules/Integrations/Widgets/Jitsi/JitsiService.swift @@ -0,0 +1,70 @@ +/* + Copyright 2019 New Vector Ltd + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation +import JitsiMeet + +/// JitsiService enables to abstract and configure Jitsi Meet SDK +@objcMembers +final class JitsiService: NSObject { + + static let shared = JitsiService() + + // MARK: - Properties + + var enableCallKit: Bool = true { + didSet { + JMCallKitProxy.enabled = enableCallKit + } + } + + private let jitsiMeet = JitsiMeet.sharedInstance() + + // MARK: - Setup + + private override init() { + super.init() + } + + // MARK: - Public + + // MARK: Configuration + + func configureDefaultConferenceOptions(with serverURL: URL) { + self.jitsiMeet.defaultConferenceOptions = JitsiMeetConferenceOptions.fromBuilder({ (builder) in + builder.serverURL = serverURL + }) + } + + func configureCallKitProvider(localizedName: String, ringtoneName: String?, iconTemplateImageData: Data?) { + JMCallKitProxy.configureProvider(localizedName: localizedName, ringtoneSound: ringtoneName, iconTemplateImageData: iconTemplateImageData) + } + + // MARK: AppDelegate methods + + @discardableResult + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool { + return self.jitsiMeet.application(application, didFinishLaunchingWithOptions: launchOptions ?? [:]) + } + + func application(_ application: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool { + return self.jitsiMeet.application(application, open: url, options: options) + } + + func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { + return self.jitsiMeet.application(application, continue: userActivity, restorationHandler: restorationHandler) + } +} diff --git a/Riot/Modules/Integrations/Widgets/Jitsi/JitsiViewController.h b/Riot/Modules/Integrations/Widgets/Jitsi/JitsiViewController.h index c376f3e14..93419ebb3 100644 --- a/Riot/Modules/Integrations/Widgets/Jitsi/JitsiViewController.h +++ b/Riot/Modules/Integrations/Widgets/Jitsi/JitsiViewController.h @@ -16,8 +16,6 @@ #import -#import - #import "WidgetManager.h" @protocol JitsiViewControllerDelegate; @@ -28,7 +26,7 @@ https://github.com/jitsi/jitsi-meet/tree/master/ios */ -@interface JitsiViewController : MXKViewController +@interface JitsiViewController : MXKViewController /** Returns the `UINib` object initialized for a `JitsiViewController`. @@ -75,12 +73,6 @@ */ @property (nonatomic) id delegate; -#pragma mark - Xib attributes - -// The jitsi-meet SDK view -@property (weak, nonatomic) IBOutlet JitsiMeetView *jitsiMeetView; -@property (weak, nonatomic) IBOutlet UIButton *backToAppButton; - @end diff --git a/Riot/Modules/Integrations/Widgets/Jitsi/JitsiViewController.m b/Riot/Modules/Integrations/Widgets/Jitsi/JitsiViewController.m index aed880c8e..0208e6db4 100644 --- a/Riot/Modules/Integrations/Widgets/Jitsi/JitsiViewController.m +++ b/Riot/Modules/Integrations/Widgets/Jitsi/JitsiViewController.m @@ -15,15 +15,17 @@ */ #import "JitsiViewController.h" +@import JitsiMeet; -static const NSString *kJitsiServerUrl = @"https://jitsi.riot.im/"; +static const NSString *kJitsiDataErrorKey = @"error"; -@interface JitsiViewController () -{ - NSString *jitsiUrl; +@interface JitsiViewController () - BOOL video; -} +// The jitsi-meet SDK view +@property (nonatomic, weak) IBOutlet JitsiMeetView *jitsiMeetView; + +@property (nonatomic, strong) NSString *conferenceId; +@property (nonatomic) BOOL startWithVideo; @end @@ -44,14 +46,41 @@ static const NSString *kJitsiServerUrl = @"https://jitsi.riot.im/"; return jitsiViewController; } +#pragma mark - Life cycle + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.jitsiMeetView.delegate = self; + + [self joinConference]; +} + +- (BOOL)prefersStatusBarHidden +{ + return YES; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; +} + +#pragma mark - Public + - (void)openWidget:(Widget*)widget withVideo:(BOOL)aVideo success:(void (^)(void))success failure:(void (^)(NSError *error))failure { - video = aVideo; + self.startWithVideo = aVideo; _widget = widget; + + MXWeakify(self); [_widget widgetUrl:^(NSString * _Nonnull widgetUrl) { + + MXStrongifyAndReturnIfNil(self); // Extract the jitsi conference id from the widget url NSString *confId; @@ -69,15 +98,11 @@ static const NSString *kJitsiServerUrl = @"https://jitsi.riot.im/"; break; } } - - // And build from it the url to use in jitsi-meet sdk - if (confId) - { - jitsiUrl = [NSString stringWithFormat:@"%@%@", kJitsiServerUrl, confId]; - } } + + self.conferenceId = confId; - if (jitsiUrl) + if (confId) { if (success) { @@ -107,71 +132,72 @@ static const NSString *kJitsiServerUrl = @"https://jitsi.riot.im/"; - (void)hangup { - jitsiUrl = nil; + [self.jitsiMeetView leave]; +} - // It would have been nicer to ask JitsiMeetView but there is no api. - // Dismissing the view controller and releasing it does the job for the moment - if (_delegate) +#pragma mark - Private + +- (void)joinConference +{ + [self joinConferenceWithId:self.conferenceId]; +} + +- (void)joinConferenceWithId:(NSString*)conferenceId +{ + if (conferenceId) { - [_delegate jitsiViewController:self dismissViewJitsiController:nil]; - } -} - -- (void)viewDidLoad -{ - [super viewDidLoad]; - - self.jitsiMeetView.delegate = self; - - // Pass the URL to jitsi-meet sdk - [self.jitsiMeetView loadURLObject: @{ - @"url": jitsiUrl, - @"configOverwrite": @{ - @"startWithVideoMuted": @(!video) - } - }]; - - // TODO: Set up user info but it is not yet available in the jitsi-meet iOS SDK - // See https://github.com/jitsi/jitsi-meet/issues/1880 -} - -- (void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; -} - -#pragma mark - Actions - -- (IBAction)onBackToAppButtonPressed:(id)sender -{ - if (_delegate) - { - [_delegate jitsiViewController:self goBackToApp:nil]; + // TODO: Set up user info but it is not yet available in the jitsi-meet iOS SDK + // See https://github.com/jitsi/jitsi-meet/issues/1880 + + JitsiMeetConferenceOptions *jitsiMeetConferenceOptions = [JitsiMeetConferenceOptions fromBuilder:^(JitsiMeetConferenceOptionsBuilder * _Nonnull jitsiMeetConferenceOptionsBuilder) { + jitsiMeetConferenceOptionsBuilder.room = conferenceId; + jitsiMeetConferenceOptionsBuilder.videoMuted = !self.startWithVideo; + }]; + + [self.jitsiMeetView join:jitsiMeetConferenceOptions]; } } #pragma mark - JitsiMeetViewDelegate -- (void)conferenceFailed:(NSDictionary *)data +- (void)conferenceWillJoin:(NSDictionary *)data { - NSLog(@"[JitsiViewController] conferenceFailed - data: %@", data); } -- (void)conferenceLeft:(NSDictionary *)data +- (void)conferenceJoined:(NSDictionary *)data { - dispatch_async(dispatch_get_main_queue(), ^{ - - // The conference is over. Let the delegate close this view controller. - if (_delegate) - { - [_delegate jitsiViewController:self dismissViewJitsiController:nil]; - } - else - { - // Do it ourself - [self dismissViewControllerAnimated:YES completion:nil]; - } - }); +} + +- (void)conferenceTerminated:(NSDictionary *)data +{ + if (data[kJitsiDataErrorKey] != nil) + { + NSLog(@"[JitsiViewController] conferenceTerminated - data: %@", data); + } + else + { + dispatch_async(dispatch_get_main_queue(), ^{ + + // The conference is over. Let the delegate close this view controller. + if (self.delegate) + { + [self.delegate jitsiViewController:self dismissViewJitsiController:nil]; + } + else + { + // Do it ourself + [self dismissViewControllerAnimated:YES completion:nil]; + } + }); + } +} + +- (void)enterPictureInPicture:(NSDictionary *)data +{ + if (self.delegate) + { + [self.delegate jitsiViewController:self goBackToApp:nil]; + } } @end diff --git a/Riot/Modules/Integrations/Widgets/Jitsi/JitsiViewController.xib b/Riot/Modules/Integrations/Widgets/Jitsi/JitsiViewController.xib index f6c3965d7..0f3d6b589 100644 --- a/Riot/Modules/Integrations/Widgets/Jitsi/JitsiViewController.xib +++ b/Riot/Modules/Integrations/Widgets/Jitsi/JitsiViewController.xib @@ -1,17 +1,16 @@ - + - + - @@ -25,41 +24,14 @@ - - - - - - diff --git a/Riot/Modules/KeyBackup/Banners/KeyBackupBannerCell.swift b/Riot/Modules/KeyBackup/Banners/KeyBackupBannerCell.swift index c2945d375..df29afb83 100644 --- a/Riot/Modules/KeyBackup/Banners/KeyBackupBannerCell.swift +++ b/Riot/Modules/KeyBackup/Banners/KeyBackupBannerCell.swift @@ -83,7 +83,7 @@ final class KeyBackupBannerCell: MXKTableViewCell { subtitle = VectorL10n.keyBackupSetupBannerSubtitle case .recover: title = VectorL10n.keyBackupRecoverBannerTitle - subtitle = VectorL10n.keyBackupRecoverBannerSubtitle + subtitle = VectorL10n.keyBackupRecoverConnentBannerSubtitle case .none: title = nil subtitle = nil diff --git a/Riot/Modules/KeyBackup/Setup/Intro/KeyBackupSetupIntroViewController.swift b/Riot/Modules/KeyBackup/Setup/Intro/KeyBackupSetupIntroViewController.swift index c38f882a9..c968500ed 100644 --- a/Riot/Modules/KeyBackup/Setup/Intro/KeyBackupSetupIntroViewController.swift +++ b/Riot/Modules/KeyBackup/Setup/Intro/KeyBackupSetupIntroViewController.swift @@ -95,7 +95,7 @@ final class KeyBackupSetupIntroViewController: UIViewController { self.titleLabel.text = VectorL10n.keyBackupSetupIntroTitle self.informationLabel.text = VectorL10n.keyBackupSetupIntroInfo - let setupTitle = self.isABackupAlreadyExists ? VectorL10n.keyBackupSetupIntroSetupActionWithExistingBackup : VectorL10n.keyBackupSetupIntroSetupActionWithoutExistingBackup + let setupTitle = self.isABackupAlreadyExists ? VectorL10n.keyBackupSetupIntroSetupConnectActionWithExistingBackup : VectorL10n.keyBackupSetupIntroSetupActionWithoutExistingBackup self.setUpButton.setTitle(setupTitle, for: .normal) diff --git a/Riot/Modules/MediaPicker/MediaPickerViewController.h b/Riot/Modules/MediaPicker/MediaPickerViewController.h index 48ff9a166..b6251b322 100644 --- a/Riot/Modules/MediaPicker/MediaPickerViewController.h +++ b/Riot/Modules/MediaPicker/MediaPickerViewController.h @@ -75,32 +75,10 @@ */ + (instancetype)mediaPickerViewController; -@property (weak, nonatomic) IBOutlet UIScrollView *mainScrollView; - -@property (weak, nonatomic) IBOutlet UIView *captureViewContainer; -//@property (weak, nonatomic) IBOutlet NSLayoutConstraint *captureViewContainerHeightConstraint; - -@property (weak, nonatomic) IBOutlet UIView *cameraPreviewContainerView; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint *cameraPreviewContainerAspectRatio; -@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *cameraActivityIndicator; -@property (weak, nonatomic) IBOutlet UIButton *closeButton; -@property (weak, nonatomic) IBOutlet UIButton *cameraSwitchButton; -@property (weak, nonatomic) IBOutlet UIButton *cameraCaptureButton; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint *cameraCaptureButtonWidthConstraint; -@property (weak, nonatomic) IBOutlet MXKPieChartView *cameraVideoCaptureProgressView; - -@property (weak, nonatomic) IBOutlet UIView *recentCapturesCollectionContainerView; -@property (weak, nonatomic) IBOutlet UICollectionView *recentCapturesCollectionView; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint *recentCapturesCollectionContainerViewHeightConstraint; - -@property (weak, nonatomic) IBOutlet UIView *libraryViewContainer; -@property (weak, nonatomic) IBOutlet UITableView *userAlbumsTableView; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint *libraryViewContainerViewHeightConstraint; - /** The delegate for the view controller. */ -@property (nonatomic) id delegate; +@property (nonatomic, weak) id delegate; /** The array of the media types supported by the picker (default value is an array containing kUTTypeImage). diff --git a/Riot/Modules/MediaPicker/MediaPickerViewController.m b/Riot/Modules/MediaPicker/MediaPickerViewController.m index 9e3f46144..f8c713dbe 100644 --- a/Riot/Modules/MediaPicker/MediaPickerViewController.m +++ b/Riot/Modules/MediaPicker/MediaPickerViewController.m @@ -94,6 +94,27 @@ static void *RecordingContext = &RecordingContext; BOOL isStatusBarHidden; } +@property (weak, nonatomic) IBOutlet UIScrollView *mainScrollView; + +@property (weak, nonatomic) IBOutlet UIView *captureViewContainer; + +@property (weak, nonatomic) IBOutlet UIView *cameraPreviewContainerView; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint *cameraPreviewContainerAspectRatio; +@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *cameraActivityIndicator; +@property (weak, nonatomic) IBOutlet UIButton *closeButton; +@property (weak, nonatomic) IBOutlet UIButton *cameraSwitchButton; +@property (weak, nonatomic) IBOutlet UIButton *cameraCaptureButton; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint *cameraCaptureButtonWidthConstraint; +@property (weak, nonatomic) IBOutlet MXKPieChartView *cameraVideoCaptureProgressView; + +@property (weak, nonatomic) IBOutlet UIView *recentCapturesCollectionContainerView; +@property (weak, nonatomic) IBOutlet UICollectionView *recentCapturesCollectionView; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint *recentCapturesCollectionContainerViewHeightConstraint; + +@property (weak, nonatomic) IBOutlet UIView *libraryViewContainer; +@property (weak, nonatomic) IBOutlet UITableView *userAlbumsTableView; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint *libraryViewContainerViewHeightConstraint; + @property (nonatomic) UIBackgroundTaskIdentifier backgroundRecordingID; @end @@ -163,19 +184,24 @@ static void *RecordingContext = &RecordingContext; [self setBackgroundRecordingID:UIBackgroundTaskInvalid]; + MXWeakify(self); + // Observe UIApplicationWillEnterForegroundNotification to refresh captures collection when app leaves the background state. UIApplicationWillEnterForegroundNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationWillEnterForegroundNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) { + MXStrongifyAndReturnIfNil(self); + [self reloadRecentCapturesCollection]; [self reloadUserLibraryAlbums]; - + }]; - + // Observe user interface theme change. kThemeServiceDidChangeThemeNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kThemeServiceDidChangeThemeNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) { + MXStrongifyAndReturnIfNil(self); + [self userInterfaceThemeDidChange]; - }]; [self userInterfaceThemeDidChange]; } @@ -292,7 +318,7 @@ static void *RecordingContext = &RecordingContext; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self.cameraActivityIndicator stopAnimating]; - cameraPreviewLayer.hidden = NO; + self->cameraPreviewLayer.hidden = NO; }); }); @@ -318,7 +344,7 @@ static void *RecordingContext = &RecordingContext; if (granted) { // Load recent captures if this is not already done - if (!recentCaptures.count) + if (!self->recentCaptures.count) { dispatch_async(dispatch_get_main_queue(), ^{ @@ -564,9 +590,13 @@ static void *RecordingContext = &RecordingContext; { return; } + + MXWeakify(self); dispatch_async(userAlbumsQueue, ^{ + MXStrongifyAndReturnIfNil(self); + // List user albums which are not empty PHFetchResult *albums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeAlbumRegular options:nil]; @@ -575,9 +605,9 @@ static void *RecordingContext = &RecordingContext; // Set up fetch options. PHFetchOptions *options = [[PHFetchOptions alloc] init]; - if ([_mediaTypes indexOfObject:(NSString *)kUTTypeImage] != NSNotFound) + if ([self->_mediaTypes indexOfObject:(NSString *)kUTTypeImage] != NSNotFound) { - if ([_mediaTypes indexOfObject:(NSString *)kUTTypeMovie] != NSNotFound) + if ([self->_mediaTypes indexOfObject:(NSString *)kUTTypeMovie] != NSNotFound) { options.predicate = [NSPredicate predicateWithFormat:@"(mediaType == %d) || (mediaType == %d)", PHAssetMediaTypeImage, PHAssetMediaTypeVideo]; } @@ -586,7 +616,7 @@ static void *RecordingContext = &RecordingContext; options.predicate = [NSPredicate predicateWithFormat:@"mediaType == %d",PHAssetMediaTypeImage]; } } - else if ([_mediaTypes indexOfObject:(NSString *)kUTTypeMovie] != NSNotFound) + else if ([self->_mediaTypes indexOfObject:(NSString *)kUTTypeMovie] != NSNotFound) { options.predicate = [NSPredicate predicateWithFormat:@"mediaType == %d",PHAssetMediaTypeVideo]; } @@ -626,11 +656,11 @@ static void *RecordingContext = &RecordingContext; dispatch_async(dispatch_get_main_queue(), ^{ - userAlbums = updatedUserAlbums; - if (userAlbums.count) + self->userAlbums = updatedUserAlbums; + if (self->userAlbums.count) { self.userAlbumsTableView.hidden = NO; - self.libraryViewContainerViewHeightConstraint.constant = (userAlbums.count * 74); + self.libraryViewContainerViewHeightConstraint.constant = (self->userAlbums.count * 74); [self.libraryViewContainer needsUpdateConstraints]; [self.userAlbumsTableView reloadData]; @@ -759,13 +789,13 @@ static void *RecordingContext = &RecordingContext; }]; } - isValidationInProgress = NO; + self->isValidationInProgress = NO; }]; } else { NSLog(@"[MediaPickerVC] didSelectAsset: Failed to get image for asset"); - isValidationInProgress = NO; + self->isValidationInProgress = NO; // Alert user NSError *error = info[@"PHImageErrorKey"]; @@ -815,20 +845,20 @@ static void *RecordingContext = &RecordingContext; [self.delegate mediaPickerController:self didSelectVideo:[avURLAsset URL]]; } - isValidationInProgress = NO; + self->isValidationInProgress = NO; }]; } else { NSLog(@"[MediaPickerVC] Selected video asset is not initialized from an URL!"); - isValidationInProgress = NO; + self->isValidationInProgress = NO; } } else { NSLog(@"[MediaPickerVC] didSelectAsset: Failed to get image for asset"); - isValidationInProgress = NO; + self->isValidationInProgress = NO; // Alert user NSError *error = info[@"PHImageErrorKey"]; @@ -1103,8 +1133,12 @@ static void *RecordingContext = &RecordingContext; [self.cameraActivityIndicator startAnimating]; + MXWeakify(self); + dispatch_async(cameraQueue, ^{ + MXStrongifyAndReturnIfNil(self); + // Get the Camera Device AVCaptureDevice *frontCamera = nil; AVCaptureDevice *backCamera = nil; @@ -1151,42 +1185,42 @@ static void *RecordingContext = &RecordingContext; } } - currentCameraInput = nil; + self->currentCameraInput = nil; NSError *error = nil; if (frontCamera) { - frontCameraInput = [[AVCaptureDeviceInput alloc] initWithDevice:frontCamera error:&error]; + self->frontCameraInput = [[AVCaptureDeviceInput alloc] initWithDevice:frontCamera error:&error]; if (error) { NSLog(@"[MediaPickerVC] Error: %@", error); } - if (frontCameraInput == nil) + if (self->frontCameraInput == nil) { NSLog(@"[MediaPickerVC] Error creating front camera capture input"); } else { - currentCameraInput = frontCameraInput; + self->currentCameraInput = self->frontCameraInput; } } if (backCamera) { error = nil; - backCameraInput = [[AVCaptureDeviceInput alloc] initWithDevice:backCamera error:&error]; + self->backCameraInput = [[AVCaptureDeviceInput alloc] initWithDevice:backCamera error:&error]; if (error) { NSLog(@"[MediaPickerVC] Error: %@", error); } - if (backCameraInput == nil) + if (self->backCameraInput == nil) { NSLog(@"[MediaPickerVC] Error creating back camera capture input"); } else { - currentCameraInput = backCameraInput; + self->currentCameraInput = self->backCameraInput; } } @@ -1194,38 +1228,38 @@ static void *RecordingContext = &RecordingContext; self.cameraSwitchButton.hidden = (!frontCamera || !backCamera); }); - if (currentCameraInput) + if (self->currentCameraInput) { // Create the AVCapture Session - captureSession = [[AVCaptureSession alloc] init]; + self->captureSession = [[AVCaptureSession alloc] init]; - if (isPictureCaptureEnabled) + if (self->isPictureCaptureEnabled) { - [captureSession setSessionPreset:AVCaptureSessionPresetPhoto]; + [self->captureSession setSessionPreset:AVCaptureSessionPresetPhoto]; } - else if (isVideoCaptureEnabled) + else if (self->isVideoCaptureEnabled) { - [captureSession setSessionPreset:AVCaptureSessionPresetHigh]; + [self->captureSession setSessionPreset:AVCaptureSessionPresetHigh]; } - cameraPreviewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:captureSession]; - cameraPreviewLayer.masksToBounds = NO; - cameraPreviewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;//AVLayerVideoGravityResizeAspect; - cameraPreviewLayer.backgroundColor = [[UIColor blackColor] CGColor]; + self->cameraPreviewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:self->captureSession]; + self->cameraPreviewLayer.masksToBounds = NO; + self->cameraPreviewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;//AVLayerVideoGravityResizeAspect; + self->cameraPreviewLayer.backgroundColor = [[UIColor blackColor] CGColor]; // cameraPreviewLayer.borderWidth = 2; dispatch_async(dispatch_get_main_queue(), ^{ - [[cameraPreviewLayer connection] setVideoOrientation:(AVCaptureVideoOrientation)[[UIApplication sharedApplication] statusBarOrientation]]; - [cameraPreviewLayer connection].videoScaleAndCropFactor = 1.0; - cameraPreviewLayer.frame = self.cameraPreviewContainerView.bounds; - cameraPreviewLayer.hidden = YES; + [[self->cameraPreviewLayer connection] setVideoOrientation:(AVCaptureVideoOrientation)[[UIApplication sharedApplication] statusBarOrientation]]; + [self->cameraPreviewLayer connection].videoScaleAndCropFactor = 1.0; + self->cameraPreviewLayer.frame = self.cameraPreviewContainerView.bounds; + self->cameraPreviewLayer.hidden = YES; - [self.cameraPreviewContainerView.layer addSublayer:cameraPreviewLayer]; + [self.cameraPreviewContainerView.layer addSublayer:self->cameraPreviewLayer]; }); - [captureSession addInput:currentCameraInput]; + [self->captureSession addInput:self->currentCameraInput]; AVCaptureDevice *audioDevice = [[AVCaptureDevice devicesWithMediaType:AVMediaTypeAudio] firstObject]; AVCaptureDeviceInput *audioDeviceInput = [AVCaptureDeviceInput deviceInputWithDevice:audioDevice error:&error]; @@ -1235,36 +1269,36 @@ static void *RecordingContext = &RecordingContext; NSLog(@"[MediaPickerVC] Error: %@", error); } - if ([captureSession canAddInput:audioDeviceInput]) + if ([self->captureSession canAddInput:audioDeviceInput]) { - [captureSession addInput:audioDeviceInput]; + [self->captureSession addInput:audioDeviceInput]; } [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(caughtAVRuntimeError:) name:AVCaptureSessionRuntimeErrorNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(AVCaptureSessionDidStartRunning:) name:AVCaptureSessionDidStartRunningNotification object:nil]; - [captureSession startRunning]; + [self->captureSession startRunning]; - movieFileOutput = [[AVCaptureMovieFileOutput alloc] init]; - if ([captureSession canAddOutput:movieFileOutput]) + self->movieFileOutput = [[AVCaptureMovieFileOutput alloc] init]; + if ([self->captureSession canAddOutput:self->movieFileOutput]) { - [captureSession addOutput:movieFileOutput]; - AVCaptureConnection *connection = [movieFileOutput connectionWithMediaType:AVMediaTypeVideo]; + [self->captureSession addOutput:self->movieFileOutput]; + AVCaptureConnection *connection = [self->movieFileOutput connectionWithMediaType:AVMediaTypeVideo]; if ([connection isVideoStabilizationSupported]) { // Available on iOS 8 and later [connection setPreferredVideoStabilizationMode:YES]; } } - [movieFileOutput addObserver:self forKeyPath:@"recording" options:(NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew) context:RecordingContext]; + [self->movieFileOutput addObserver:self forKeyPath:@"recording" options:(NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew) context:RecordingContext]; - stillImageOutput = [[AVCaptureStillImageOutput alloc] init]; - if ([captureSession canAddOutput:stillImageOutput]) + self->stillImageOutput = [[AVCaptureStillImageOutput alloc] init]; + if ([self->captureSession canAddOutput:self->stillImageOutput]) { - [stillImageOutput setOutputSettings:@{AVVideoCodecKey : AVVideoCodecJPEG}]; - [captureSession addOutput:stillImageOutput]; + [self->stillImageOutput setOutputSettings:@{AVVideoCodecKey : AVVideoCodecJPEG}]; + [self->captureSession addOutput:self->stillImageOutput]; } - [stillImageOutput addObserver:self forKeyPath:@"capturingStillImage" options:(NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew) context:CapturingStillImageContext]; + [self->stillImageOutput addObserver:self forKeyPath:@"capturingStillImage" options:(NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew) context:CapturingStillImageContext]; } else { @@ -1273,7 +1307,7 @@ static void *RecordingContext = &RecordingContext; }); } - isCaptureSessionSetupInProgress = NO; + self->isCaptureSessionSetupInProgress = NO; }); } @@ -1300,23 +1334,24 @@ static void *RecordingContext = &RecordingContext; } dispatch_sync(cameraQueue, ^{ - frontCameraInput = nil; - backCameraInput = nil; - captureSession = nil; + + self->frontCameraInput = nil; + self->backCameraInput = nil; + self->captureSession = nil; - if (movieFileOutput) + if (self->movieFileOutput) { - [movieFileOutput removeObserver:self forKeyPath:@"recording" context:RecordingContext]; - movieFileOutput = nil; + [self->movieFileOutput removeObserver:self forKeyPath:@"recording" context:RecordingContext]; + self->movieFileOutput = nil; } - if (stillImageOutput) + if (self->stillImageOutput) { - [stillImageOutput removeObserver:self forKeyPath:@"capturingStillImage" context:CapturingStillImageContext]; - stillImageOutput = nil; + [self->stillImageOutput removeObserver:self forKeyPath:@"capturingStillImage" context:CapturingStillImageContext]; + self->stillImageOutput = nil; } - currentCameraInput = nil; + self->currentCameraInput = nil; [[NSNotificationCenter defaultCenter] removeObserver:self name:AVCaptureSessionRuntimeErrorNotification object:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self name:AVCaptureSessionDidStartRunningNotification object:nil]; @@ -1342,7 +1377,7 @@ static void *RecordingContext = &RecordingContext; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.6 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self.cameraActivityIndicator stopAnimating]; - cameraPreviewLayer.hidden = NO; + self->cameraPreviewLayer.hidden = NO; }); } @@ -1357,45 +1392,45 @@ static void *RecordingContext = &RecordingContext; if (frontCameraInput && backCameraInput) { dispatch_async(dispatch_get_main_queue(), ^{ - if (!canToggleCamera) + if (!self->canToggleCamera) { return; } - canToggleCamera = NO; + self->canToggleCamera = NO; AVCaptureDeviceInput *newInput = nil; AVCaptureDeviceInput *oldInput = nil; - if (currentCameraInput == frontCameraInput) + if (self->currentCameraInput == self->frontCameraInput) { - newInput = backCameraInput; - oldInput = frontCameraInput; + newInput = self->backCameraInput; + oldInput = self->frontCameraInput; } else { - newInput = frontCameraInput; - oldInput = backCameraInput; + newInput = self->frontCameraInput; + oldInput = self->backCameraInput; } - dispatch_async(cameraQueue, ^{ + dispatch_async(self->cameraQueue, ^{ - [captureSession beginConfiguration]; - [captureSession removeInput:oldInput]; - if ([captureSession canAddInput:newInput]) { - [captureSession addInput:newInput]; - currentCameraInput = newInput; + [self->captureSession beginConfiguration]; + [self->captureSession removeInput:oldInput]; + if ([self->captureSession canAddInput:newInput]) { + [self->captureSession addInput:newInput]; + self->currentCameraInput = newInput; } - [captureSession commitConfiguration]; + [self->captureSession commitConfiguration]; dispatch_async(dispatch_get_main_queue(), ^{ [self.cameraActivityIndicator stopAnimating]; - cameraPreviewLayer.hidden = NO; - canToggleCamera = YES; + self->cameraPreviewLayer.hidden = NO; + self->canToggleCamera = YES; }); }); [self.cameraActivityIndicator startAnimating]; - cameraPreviewLayer.hidden = YES; + self->cameraPreviewLayer.hidden = YES; }); } } @@ -1404,10 +1439,15 @@ static void *RecordingContext = &RecordingContext; { self.cameraCaptureButton.enabled = NO; + MXWeakify(self); + dispatch_async(cameraQueue, ^{ - if (![movieFileOutput isRecording]) + + MXStrongifyAndReturnIfNil(self); + + if (![self->movieFileOutput isRecording]) { - lockInterfaceRotation = YES; + self->lockInterfaceRotation = YES; if ([[UIDevice currentDevice] isMultitaskingSupported]) { @@ -1425,14 +1465,14 @@ static void *RecordingContext = &RecordingContext; } // Update the orientation on the movie file output video connection before starting recording. - [[movieFileOutput connectionWithMediaType:AVMediaTypeVideo] setVideoOrientation:[[cameraPreviewLayer connection] videoOrientation]]; + [[self->movieFileOutput connectionWithMediaType:AVMediaTypeVideo] setVideoOrientation:[[self->cameraPreviewLayer connection] videoOrientation]]; // Turning OFF flash for video recording - [MediaPickerViewController setFlashMode:AVCaptureFlashModeOff forDevice:[currentCameraInput device]]; + [MediaPickerViewController setFlashMode:AVCaptureFlashModeOff forDevice:[self->currentCameraInput device]]; // Start recording to a temporary file. NSString *outputFilePath = [NSTemporaryDirectory() stringByAppendingPathComponent:[@"movie" stringByAppendingPathExtension:@"mov"]]; - [movieFileOutput startRecordingToOutputFileURL:[NSURL fileURLWithPath:outputFilePath] recordingDelegate:self]; + [self->movieFileOutput startRecordingToOutputFileURL:[NSURL fileURLWithPath:outputFilePath] recordingDelegate:self]; } }); } @@ -1440,9 +1480,10 @@ static void *RecordingContext = &RecordingContext; - (void)stopMovieRecording { dispatch_async(cameraQueue, ^{ - if ([movieFileOutput isRecording]) + + if ([self->movieFileOutput isRecording]) { - [movieFileOutput stopRecording]; + [self->movieFileOutput stopRecording]; } }); } @@ -1451,15 +1492,20 @@ static void *RecordingContext = &RecordingContext; { self.cameraCaptureButton.enabled = NO; + MXWeakify(self); + dispatch_async(cameraQueue, ^{ + + MXStrongifyAndReturnIfNil(self); + // Update the orientation on the still image output video connection before capturing. - [[stillImageOutput connectionWithMediaType:AVMediaTypeVideo] setVideoOrientation:[[cameraPreviewLayer connection] videoOrientation]]; + [[self->stillImageOutput connectionWithMediaType:AVMediaTypeVideo] setVideoOrientation:[[self->cameraPreviewLayer connection] videoOrientation]]; // Flash set to Auto for Still Capture - [MediaPickerViewController setFlashMode:AVCaptureFlashModeAuto forDevice:[currentCameraInput device]]; + [MediaPickerViewController setFlashMode:AVCaptureFlashModeAuto forDevice:[self->currentCameraInput device]]; // Capture a still image. - [stillImageOutput captureStillImageAsynchronouslyFromConnection:[stillImageOutput connectionWithMediaType:AVMediaTypeVideo] completionHandler:^(CMSampleBufferRef imageDataSampleBuffer, NSError *error) { + [self->stillImageOutput captureStillImageAsynchronouslyFromConnection:[self->stillImageOutput connectionWithMediaType:AVMediaTypeVideo] completionHandler:^(CMSampleBufferRef imageDataSampleBuffer, NSError *error) { if (imageDataSampleBuffer) { @@ -1504,10 +1550,10 @@ static void *RecordingContext = &RecordingContext; - (void)runStillImageCaptureAnimation { dispatch_async(dispatch_get_main_queue(), ^{ - [cameraPreviewLayer setOpacity:0.0]; + [self->cameraPreviewLayer setOpacity:0.0]; [UIView animateWithDuration:.25 animations:^{ - [cameraPreviewLayer setOpacity:1.0]; + [self->cameraPreviewLayer setOpacity:1.0]; }]; }); } @@ -1535,18 +1581,18 @@ static void *RecordingContext = &RecordingContext; { self.cameraSwitchButton.enabled = NO; - videoRecordStartDate = [NSDate date]; + self->videoRecordStartDate = [NSDate date]; self.cameraVideoCaptureProgressView.hidden = NO; - updateVideoRecordingTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(updateVideoRecordingDuration) userInfo:nil repeats:YES]; + self->updateVideoRecordingTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(updateVideoRecordingDuration) userInfo:nil repeats:YES]; self.cameraCaptureButton.enabled = YES; } else { self.cameraVideoCaptureProgressView.hidden = YES; - [updateVideoRecordingTimer invalidate]; - updateVideoRecordingTimer = nil; + [self->updateVideoRecordingTimer invalidate]; + self->updateVideoRecordingTimer = nil; self.cameraVideoCaptureProgressView.progress = 0; // The preview will be restored during captureOutput:didFinishRecordingToOutputFileAtURL: callback. diff --git a/Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.m b/Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.m index 1fcb9985c..d84d669ec 100644 --- a/Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.m +++ b/Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.m @@ -29,13 +29,11 @@ #import "TableViewCellWithButton.h" #import "RoomTableViewCell.h" -#import "EncryptionInfoView.h" - #define TABLEVIEW_ROW_CELL_HEIGHT 46 #define TABLEVIEW_SECTION_HEADER_HEIGHT 28 #define TABLEVIEW_SECTION_HEADER_HEIGHT_WHEN_HIDDEN 0.01f -@interface RoomMemberDetailsViewController () +@interface RoomMemberDetailsViewController () { RoomMemberTitleView* memberTitleView; @@ -62,7 +60,8 @@ */ NSArray *devicesArray; NSInteger devicesIndex; - EncryptionInfoView *encryptionInfoView; + DeviceVerificationCoordinatorBridgePresenter *deviceVerificationCoordinatorBridgePresenter; + /** Observe UIApplicationWillChangeStatusBarOrientationNotification to hide/show bubbles bg. @@ -319,19 +318,6 @@ { [super viewDidLayoutSubviews]; - // Check here whether a subview has been added or removed - if (encryptionInfoView) - { - if (!encryptionInfoView.superview) - { - // Reset - encryptionInfoView = nil; - - // Reload the full table to take into account a potential change on a device status. - [self updateMemberInfo]; - } - } - // Check whether the title view has been created and rendered. if (memberTitleView && memberTitleView.superview) { @@ -1154,50 +1140,10 @@ { if (verificationStatus == MXDeviceVerified) { - // Prompt the user before marking as verified the device. - encryptionInfoView = [[EncryptionInfoView alloc] initWithDeviceInfo:deviceTableViewCell.deviceInfo andMatrixSession:self.mxRoom.mxSession]; - [encryptionInfoView onButtonPressed:encryptionInfoView.verifyButton]; - - // Add shadow on added view - encryptionInfoView.layer.cornerRadius = 5; - encryptionInfoView.layer.shadowOffset = CGSizeMake(0, 1); - encryptionInfoView.layer.shadowOpacity = 0.5f; - - // Add the view and define edge constraints - [self.view addSubview:encryptionInfoView]; - - [self.view addConstraint:[NSLayoutConstraint constraintWithItem:encryptionInfoView - attribute:NSLayoutAttributeTop - relatedBy:NSLayoutRelationEqual - toItem:self.tableView - attribute:NSLayoutAttributeTop - multiplier:1.0f - constant:10.0f]]; - - [self.view addConstraint:[NSLayoutConstraint constraintWithItem:encryptionInfoView - attribute:NSLayoutAttributeBottom - relatedBy:NSLayoutRelationEqual - toItem:self.tableView - attribute:NSLayoutAttributeBottom - multiplier:1.0f - constant:-10.0f]]; - - [self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.tableView - attribute:NSLayoutAttributeLeading - relatedBy:NSLayoutRelationEqual - toItem:encryptionInfoView - attribute:NSLayoutAttributeLeading - multiplier:1.0f - constant:-10.0f]]; - - [self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.tableView - attribute:NSLayoutAttributeTrailing - relatedBy:NSLayoutRelationEqual - toItem:encryptionInfoView - attribute:NSLayoutAttributeTrailing - multiplier:1.0f - constant:10.0f]]; - [self.view setNeedsUpdateConstraints]; + deviceVerificationCoordinatorBridgePresenter = [[DeviceVerificationCoordinatorBridgePresenter alloc] initWithSession:self.mainSession]; + deviceVerificationCoordinatorBridgePresenter.delegate = self; + + [deviceVerificationCoordinatorBridgePresenter presentFrom:self otherUserId:deviceTableViewCell.deviceInfo.userId otherDeviceId:deviceTableViewCell.deviceInfo.deviceId animated:YES]; } else { @@ -1217,4 +1163,12 @@ [self viewDidLayoutSubviews]; } +#pragma mark - DeviceVerificationCoordinatorBridgePresenterDelegate + +- (void)deviceVerificationCoordinatorBridgePresenterDelegateDidComplete:(DeviceVerificationCoordinatorBridgePresenter *)coordinatorBridgePresenter otherUserId:(NSString * _Nonnull)otherUserId otherDeviceId:(NSString * _Nonnull)otherDeviceId +{ + [deviceVerificationCoordinatorBridgePresenter dismissWithAnimated:YES completion:nil]; + deviceVerificationCoordinatorBridgePresenter = nil; +} + @end diff --git a/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.m b/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.m index 6db9905ed..0b483bd5c 100644 --- a/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.m +++ b/Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.m @@ -35,12 +35,12 @@ @interface RoomInputToolbarView() { - MediaPickerViewController *mediaPicker; - // The intermediate action sheet UIAlertController *actionSheet; } +@property(nonatomic, weak) MediaPickerViewController *mediaPicker; + @end @implementation RoomInputToolbarView @@ -391,11 +391,13 @@ Class PHAsset_class = NSClassFromString(@"PHAsset"); if (PHAsset_class) { - mediaPicker = [MediaPickerViewController mediaPickerViewController]; + MediaPickerViewController * mediaPicker = [MediaPickerViewController mediaPickerViewController]; mediaPicker.mediaTypes = @[(NSString *)kUTTypeImage, (NSString *)kUTTypeMovie]; mediaPicker.delegate = self; UINavigationController *navigationController = [UINavigationController new]; [navigationController pushViewController:mediaPicker animated:NO]; + + self.mediaPicker = mediaPicker; [self.delegate roomInputToolbarView:self presentViewController:navigationController]; } @@ -448,11 +450,9 @@ - (void)dismissMediaPicker { - if (mediaPicker) + if (self.mediaPicker) { - [mediaPicker withdrawViewControllerAnimated:YES completion:nil]; - [mediaPicker destroy]; - mediaPicker = nil; + [self.mediaPicker withdrawViewControllerAnimated:YES completion:nil]; } } diff --git a/Riot/Modules/RoomKeyRequest/RoomKeyRequestViewController.h b/Riot/Modules/RoomKeyRequest/RoomKeyRequestViewController.h index 945507a83..92358b5a8 100644 --- a/Riot/Modules/RoomKeyRequest/RoomKeyRequestViewController.h +++ b/Riot/Modules/RoomKeyRequest/RoomKeyRequestViewController.h @@ -24,7 +24,7 @@ application asking the user if he wants to share room keys with a user's device. For the moment, the user is himself. */ -@interface RoomKeyRequestViewController : NSObject +@interface RoomKeyRequestViewController : NSObject /** The UIAlertController instance which handles the dialog. diff --git a/Riot/Modules/RoomKeyRequest/RoomKeyRequestViewController.m b/Riot/Modules/RoomKeyRequest/RoomKeyRequestViewController.m index 559fb0435..b73d7c2fe 100644 --- a/Riot/Modules/RoomKeyRequest/RoomKeyRequestViewController.m +++ b/Riot/Modules/RoomKeyRequest/RoomKeyRequestViewController.m @@ -17,13 +17,13 @@ #import "RoomKeyRequestViewController.h" #import "AppDelegate.h" -#import "EncryptionInfoView.h" +#import "Riot-Swift.h" -@interface RoomKeyRequestViewController () +@interface RoomKeyRequestViewController () { void (^onComplete)(void); - EncryptionInfoView *encryptionInfoView; + DeviceVerificationCoordinatorBridgePresenter *deviceVerificationCoordinatorBridgePresenter; BOOL wasNewDevice; } @@ -127,12 +127,6 @@ [_alertController dismissViewControllerAnimated:YES completion:nil]; _alertController = nil; } - - if (encryptionInfoView) - { - [encryptionInfoView removeFromSuperview]; - encryptionInfoView = nil; - } } @@ -142,77 +136,43 @@ UIViewController *rootViewController = [AppDelegate theDelegate].window.rootViewController; if (rootViewController) { - encryptionInfoView = [[EncryptionInfoView alloc] initWithDeviceInfo:_device andMatrixSession:_mxSession]; - [encryptionInfoView onButtonPressed:encryptionInfoView.verifyButton]; + deviceVerificationCoordinatorBridgePresenter = [[DeviceVerificationCoordinatorBridgePresenter alloc] initWithSession:_mxSession]; + deviceVerificationCoordinatorBridgePresenter.delegate = self; - encryptionInfoView.delegate = self; - - // Add shadow on added view - encryptionInfoView.layer.cornerRadius = 5; - encryptionInfoView.layer.shadowOffset = CGSizeMake(0, 1); - encryptionInfoView.layer.shadowOpacity = 0.5f; - - // Add the view and define edge constraints - [rootViewController.view addSubview:encryptionInfoView]; - - [rootViewController.view addConstraint:[NSLayoutConstraint constraintWithItem:encryptionInfoView - attribute:NSLayoutAttributeTop - relatedBy:NSLayoutRelationEqual - toItem:rootViewController.topLayoutGuide - attribute:NSLayoutAttributeBottom - multiplier:1.0f - constant:10.0f]]; - - [rootViewController.view addConstraint:[NSLayoutConstraint constraintWithItem:encryptionInfoView - attribute:NSLayoutAttributeBottom - relatedBy:NSLayoutRelationEqual - toItem:rootViewController.bottomLayoutGuide - attribute:NSLayoutAttributeTop - multiplier:1.0f - constant:-10.0f]]; - - [rootViewController.view addConstraint:[NSLayoutConstraint constraintWithItem:rootViewController.view - attribute:NSLayoutAttributeLeading - relatedBy:NSLayoutRelationEqual - toItem:encryptionInfoView - attribute:NSLayoutAttributeLeading - multiplier:1.0f - constant:-10.0f]]; - - [rootViewController.view addConstraint:[NSLayoutConstraint constraintWithItem:rootViewController.view - attribute:NSLayoutAttributeTrailing - relatedBy:NSLayoutRelationEqual - toItem:encryptionInfoView - attribute:NSLayoutAttributeTrailing - multiplier:1.0f - constant:10.0f]]; - [rootViewController.view setNeedsUpdateConstraints]; + [deviceVerificationCoordinatorBridgePresenter presentFrom:rootViewController otherUserId:_device.userId otherDeviceId:_device.deviceId animated:YES]; } } -#pragma mark - MXKEncryptionInfoViewDelegate +#pragma mark - DeviceVerificationCoordinatorBridgePresenterDelegate -- (void)encryptionInfoView:(MXKEncryptionInfoView *)theEncryptionInfoView didDeviceInfoVerifiedChange:(MXDeviceInfo *)deviceInfo +- (void)deviceVerificationCoordinatorBridgePresenterDelegateDidComplete:(DeviceVerificationCoordinatorBridgePresenter *)coordinatorBridgePresenter otherUserId:(NSString * _Nonnull)otherUserId otherDeviceId:(NSString * _Nonnull)otherDeviceId { - encryptionInfoView = nil; + [deviceVerificationCoordinatorBridgePresenter dismissWithAnimated:YES completion:nil]; + deviceVerificationCoordinatorBridgePresenter = nil; - if (deviceInfo.verified == MXDeviceVerified) - { - // Accept the received requests from this device - // As the device is now verified, all other key requests will be automatically accepted. - [self.mxSession.crypto acceptAllPendingKeyRequestsFromUser:self.device.userId andDevice:self.device.deviceId onComplete:^{ + // Check device new status + [self.mxSession.crypto downloadKeys:@[self.device.userId] forceDownload:NO success:^(MXUsersDevicesMap *usersDevicesInfoMap) { - onComplete(); - }]; - } -} + MXDeviceInfo *deviceInfo = [usersDevicesInfoMap objectForDevice:self.device.deviceId forUser:self.device.userId]; + if (deviceInfo && deviceInfo.verified == MXDeviceVerified) + { + // Accept the received requests from this device + // As the device is now verified, all other key requests will be automatically accepted. + [self.mxSession.crypto acceptAllPendingKeyRequestsFromUser:self.device.userId andDevice:self.device.deviceId onComplete:^{ -- (void)encryptionInfoViewDidClose:(MXKEncryptionInfoView *)theEncryptionInfoView -{ - encryptionInfoView = nil; + onComplete(); + }]; + } + else + { + // Come back to self.alertController - ie, reopen it + [self show]; + } + } failure:^(NSError *error) { - // Come back to self.alertController - ie, reopen it - [self show]; + // Should not happen (the device is in the crypto db) + [self show]; + }]; } @end diff --git a/Riot/Modules/Settings/SettingsViewController.m b/Riot/Modules/Settings/SettingsViewController.m index 284c323fe..cbda06f84 100644 --- a/Riot/Modules/Settings/SettingsViewController.m +++ b/Riot/Modules/Settings/SettingsViewController.m @@ -48,8 +48,6 @@ #import "Riot-Swift.h" -#import "EncryptionInfoView.h" - NSString* const kSettingsViewControllerPhoneBookCountryCellId = @"kSettingsViewControllerPhoneBookCountryCellId"; enum @@ -4351,68 +4349,6 @@ SignOutAlertPresenterDelegate> [[AppDelegate theDelegate] showErrorAsAlert:error]; } -#pragma mark - MXKEncryptionInfoView - -- (void)showDeviceInfo:(MXDeviceInfo*)deviceInfo -{ - // Show it modally on the root view controller - // TODO: Improve it - UIViewController *rootViewController = [AppDelegate theDelegate].window.rootViewController; - if (rootViewController) - { - EncryptionInfoView *encryptionInfoView = [[EncryptionInfoView alloc] initWithDeviceInfo:deviceInfo andMatrixSession:self.mainSession]; - [encryptionInfoView onButtonPressed:encryptionInfoView.verifyButton]; - - encryptionInfoView.delegate = self; - - // Add shadow on added view - encryptionInfoView.layer.cornerRadius = 5; - encryptionInfoView.layer.shadowOffset = CGSizeMake(0, 1); - encryptionInfoView.layer.shadowOpacity = 0.5f; - - // Add the view and define edge constraints - [rootViewController.view addSubview:encryptionInfoView]; - - [rootViewController.view addConstraint:[NSLayoutConstraint constraintWithItem:encryptionInfoView - attribute:NSLayoutAttributeTop - relatedBy:NSLayoutRelationEqual - toItem:rootViewController.topLayoutGuide - attribute:NSLayoutAttributeBottom - multiplier:1.0f - constant:10.0f]]; - - [rootViewController.view addConstraint:[NSLayoutConstraint constraintWithItem:encryptionInfoView - attribute:NSLayoutAttributeBottom - relatedBy:NSLayoutRelationEqual - toItem:rootViewController.bottomLayoutGuide - attribute:NSLayoutAttributeTop - multiplier:1.0f - constant:-10.0f]]; - - [rootViewController.view addConstraint:[NSLayoutConstraint constraintWithItem:rootViewController.view - attribute:NSLayoutAttributeLeading - relatedBy:NSLayoutRelationEqual - toItem:encryptionInfoView - attribute:NSLayoutAttributeLeading - multiplier:1.0f - constant:-10.0f]]; - - [rootViewController.view addConstraint:[NSLayoutConstraint constraintWithItem:rootViewController.view - attribute:NSLayoutAttributeTrailing - relatedBy:NSLayoutRelationEqual - toItem:encryptionInfoView - attribute:NSLayoutAttributeTrailing - multiplier:1.0f - constant:10.0f]]; - [rootViewController.view setNeedsUpdateConstraints]; - } -} - -- (void)encryptionInfoView:(MXKEncryptionInfoView*)encryptionInfoView didDeviceInfoVerifiedChange:(MXDeviceInfo*)deviceInfo -{ - [keyBackupSection reload]; -} - #pragma mark - KeyBackupRecoverCoordinatorBridgePresenter - (void)showKeyBackupSetupFromSignOutFlow:(BOOL)showFromSignOutFlow diff --git a/Riot/Modules/TabBar/MasterTabBarController.m b/Riot/Modules/TabBar/MasterTabBarController.m index 0b18392bf..c85c8b969 100644 --- a/Riot/Modules/TabBar/MasterTabBarController.m +++ b/Riot/Modules/TabBar/MasterTabBarController.m @@ -816,15 +816,12 @@ self.tabBar.items[index].badgeValue = badgeValue; - if (@available(iOS 10, *)) - { - self.tabBar.items[index].badgeColor = badgeColor; - - [self.tabBar.items[index] setBadgeTextAttributes:@{ - NSForegroundColorAttributeName: ThemeService.shared.theme.baseTextPrimaryColor - } - forState:UIControlStateNormal]; - } + self.tabBar.items[index].badgeColor = badgeColor; + + [self.tabBar.items[index] setBadgeTextAttributes:@{ + NSForegroundColorAttributeName: ThemeService.shared.theme.baseTextPrimaryColor + } + forState:UIControlStateNormal]; } else { @@ -837,16 +834,13 @@ if (mark) { self.tabBar.items[index].badgeValue = mark; + + self.tabBar.items[index].badgeColor = badgeColor; - if (@available(iOS 10, *)) - { - self.tabBar.items[index].badgeColor = badgeColor; - - [self.tabBar.items[index] setBadgeTextAttributes:@{ - NSForegroundColorAttributeName: ThemeService.shared.theme.baseTextPrimaryColor - } - forState:UIControlStateNormal]; - } + [self.tabBar.items[index] setBadgeTextAttributes:@{ + NSForegroundColorAttributeName: ThemeService.shared.theme.baseTextPrimaryColor + } + forState:UIControlStateNormal]; } else { diff --git a/Riot/Modules/UserDevices/UsersDevicesViewController.h b/Riot/Modules/UserDevices/UsersDevicesViewController.h index 4020c40fc..8e63d9968 100644 --- a/Riot/Modules/UserDevices/UsersDevicesViewController.h +++ b/Riot/Modules/UserDevices/UsersDevicesViewController.h @@ -17,9 +17,8 @@ #import #import "DeviceTableViewCell.h" -#import "EncryptionInfoView.h" -@interface UsersDevicesViewController : MXKViewController +@interface UsersDevicesViewController : MXKViewController /** Display a map of users/devices. diff --git a/Riot/Modules/UserDevices/UsersDevicesViewController.m b/Riot/Modules/UserDevices/UsersDevicesViewController.m index 886c8a915..224b620b3 100644 --- a/Riot/Modules/UserDevices/UsersDevicesViewController.m +++ b/Riot/Modules/UserDevices/UsersDevicesViewController.m @@ -20,12 +20,14 @@ #import "AppDelegate.h" #import "Riot-Swift.h" -@interface UsersDevicesViewController () +@interface UsersDevicesViewController () { MXUsersDevicesMap *usersDevices; MXSession *mxSession; void (^onCompleteBlock)(BOOL doneButtonPressed); + + DeviceVerificationCoordinatorBridgePresenter *deviceVerificationCoordinatorBridgePresenter; // Observe kThemeServiceDidChangeThemeNotification to handle user interface theme change. id kThemeServiceDidChangeThemeNotificationObserver; @@ -214,51 +216,10 @@ if (verificationStatus == MXDeviceVerified) { // Prompt the user before marking as verified the device. - EncryptionInfoView *encryptionInfoView = [[EncryptionInfoView alloc] initWithDeviceInfo:deviceTableViewCell.deviceInfo andMatrixSession:mxSession]; - [encryptionInfoView onButtonPressed:encryptionInfoView.verifyButton]; + deviceVerificationCoordinatorBridgePresenter = [[DeviceVerificationCoordinatorBridgePresenter alloc] initWithSession:mxSession]; + deviceVerificationCoordinatorBridgePresenter.delegate = self; - encryptionInfoView.delegate = self; - - // Add shadow on added view - encryptionInfoView.layer.cornerRadius = 5; - encryptionInfoView.layer.shadowOffset = CGSizeMake(0, 1); - encryptionInfoView.layer.shadowOpacity = 0.5f; - - // Add the view and define edge constraints - [self.view addSubview:encryptionInfoView]; - - [self.view addConstraint:[NSLayoutConstraint constraintWithItem:encryptionInfoView - attribute:NSLayoutAttributeTop - relatedBy:NSLayoutRelationEqual - toItem:self.topLayoutGuide - attribute:NSLayoutAttributeBottom - multiplier:1.0f - constant:10.0f]]; - - [self.view addConstraint:[NSLayoutConstraint constraintWithItem:encryptionInfoView - attribute:NSLayoutAttributeBottom - relatedBy:NSLayoutRelationEqual - toItem:self.bottomLayoutGuide - attribute:NSLayoutAttributeTop - multiplier:1.0f - constant:-10.0f]]; - - [self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.view - attribute:NSLayoutAttributeLeading - relatedBy:NSLayoutRelationEqual - toItem:encryptionInfoView - attribute:NSLayoutAttributeLeading - multiplier:1.0f - constant:-10.0f]]; - - [self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.view - attribute:NSLayoutAttributeTrailing - relatedBy:NSLayoutRelationEqual - toItem:encryptionInfoView - attribute:NSLayoutAttributeTrailing - multiplier:1.0f - constant:10.0f]]; - [self.view setNeedsUpdateConstraints]; + [deviceVerificationCoordinatorBridgePresenter presentFrom:self otherUserId:deviceTableViewCell.deviceInfo.userId otherDeviceId:deviceTableViewCell.deviceInfo.deviceId animated:YES]; } else { @@ -274,17 +235,31 @@ } } -#pragma mark - MXKEncryptionInfoViewDelegate +#pragma mark - DeviceVerificationCoordinatorBridgePresenterDelegate -- (void)encryptionInfoView:(MXKEncryptionInfoView *)encryptionInfoView didDeviceInfoVerifiedChange:(MXDeviceInfo *)deviceInfo +- (void)deviceVerificationCoordinatorBridgePresenterDelegateDidComplete:(DeviceVerificationCoordinatorBridgePresenter *)coordinatorBridgePresenter otherUserId:(NSString * _Nonnull)otherUserId otherDeviceId:(NSString * _Nonnull)otherDeviceId { - // Update our map - MXDeviceInfo *device = [usersDevices objectForDevice:deviceInfo.deviceId forUser:deviceInfo.userId]; - device.verified = deviceInfo.verified; + [deviceVerificationCoordinatorBridgePresenter dismissWithAnimated:YES completion:nil]; + deviceVerificationCoordinatorBridgePresenter = nil; - [self.tableView reloadData]; + // Update our map + MXWeakify(self); + [mxSession.crypto downloadKeys:@[otherUserId] forceDownload:NO success:^(MXUsersDevicesMap *usersDevicesInfoMap) { + MXStrongifyAndReturnIfNil(self); + + MXDeviceInfo *deviceInfo = [usersDevicesInfoMap objectForDevice:otherDeviceId forUser:otherUserId]; + + MXDeviceInfo *device = [self->usersDevices objectForDevice:otherDeviceId forUser:otherUserId]; + device.verified = deviceInfo.verified; + + [self.tableView reloadData]; + + } failure:^(NSError *error) { + // Should not happen (the device is in the crypto db) + }]; } + #pragma mark - User actions - (IBAction)onDone:(id)sender diff --git a/Riot/SupportingFiles/Riot-Bridging-Header.h b/Riot/SupportingFiles/Riot-Bridging-Header.h index 3d91a54f2..7467821eb 100644 --- a/Riot/SupportingFiles/Riot-Bridging-Header.h +++ b/Riot/SupportingFiles/Riot-Bridging-Header.h @@ -10,3 +10,5 @@ #import "ThemeService.h" #import "TableViewCellWithCheckBoxAndLabel.h" #import "RecentsDataSource.h" +#import "AvatarGenerator.h" +#import "EncryptionInfoView.h" diff --git a/Riot/Utils/EventFormatter.m b/Riot/Utils/EventFormatter.m index 44d3feac1..7926f11cf 100644 --- a/Riot/Utils/EventFormatter.m +++ b/Riot/Utils/EventFormatter.m @@ -227,14 +227,7 @@ NSString *const kEventFormatterOnReRequestKeysLinkActionSeparator = @"/"; self.defaultTextFont = [UIFont systemFontOfSize:15]; self.prefixTextFont = [UIFont boldSystemFontOfSize:15]; - if ([UIFont respondsToSelector:@selector(systemFontOfSize:weight:)]) - { - self.bingTextFont = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium]; - } - else - { - self.bingTextFont = [UIFont systemFontOfSize:15]; - } + self.bingTextFont = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium]; self.stateEventTextFont = [UIFont italicSystemFontOfSize:15]; self.callNoticesTextFont = [UIFont italicSystemFontOfSize:15]; self.encryptedMessagesTextFont = [UIFont italicSystemFontOfSize:15]; diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/CallKitIcon.png b/Riot/libs/jitsi-meet/JitsiMeet.framework/CallKitIcon.png deleted file mode 100644 index 4c2cdfbdc..000000000 Binary files a/Riot/libs/jitsi-meet/JitsiMeet.framework/CallKitIcon.png and /dev/null differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/Entypo.ttf b/Riot/libs/jitsi-meet/JitsiMeet.framework/Entypo.ttf deleted file mode 100644 index 1c8f5e910..000000000 Binary files a/Riot/libs/jitsi-meet/JitsiMeet.framework/Entypo.ttf and /dev/null differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/EvilIcons.ttf b/Riot/libs/jitsi-meet/JitsiMeet.framework/EvilIcons.ttf deleted file mode 100644 index b270f9851..000000000 Binary files a/Riot/libs/jitsi-meet/JitsiMeet.framework/EvilIcons.ttf and /dev/null differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/Feather.ttf b/Riot/libs/jitsi-meet/JitsiMeet.framework/Feather.ttf deleted file mode 100755 index 244854c54..000000000 Binary files a/Riot/libs/jitsi-meet/JitsiMeet.framework/Feather.ttf and /dev/null differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/FontAwesome.ttf b/Riot/libs/jitsi-meet/JitsiMeet.framework/FontAwesome.ttf deleted file mode 100644 index 35acda2fa..000000000 Binary files a/Riot/libs/jitsi-meet/JitsiMeet.framework/FontAwesome.ttf and /dev/null differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/Foundation.ttf b/Riot/libs/jitsi-meet/JitsiMeet.framework/Foundation.ttf deleted file mode 100644 index 6cce217dd..000000000 Binary files a/Riot/libs/jitsi-meet/JitsiMeet.framework/Foundation.ttf and /dev/null differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/Headers/JitsiMeet.h b/Riot/libs/jitsi-meet/JitsiMeet.framework/Headers/JitsiMeet.h deleted file mode 100644 index e1b00906d..000000000 --- a/Riot/libs/jitsi-meet/JitsiMeet.framework/Headers/JitsiMeet.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright @ 2017-present Atlassian Pty Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import -#import diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/Headers/JitsiMeetView.h b/Riot/libs/jitsi-meet/JitsiMeet.framework/Headers/JitsiMeetView.h deleted file mode 100644 index 254600f1a..000000000 --- a/Riot/libs/jitsi-meet/JitsiMeet.framework/Headers/JitsiMeetView.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright @ 2017-present Atlassian Pty Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import -#import - -#import "JitsiMeetViewDelegate.h" - -@interface JitsiMeetView : UIView - -@property (nonatomic, nullable, weak) id delegate; - -@property (copy, nonatomic, nullable) NSURL *defaultURL; - -@property (nonatomic) BOOL welcomePageEnabled; - -+ (BOOL)application:(UIApplication *_Nonnull)application - didFinishLaunchingWithOptions:(NSDictionary *_Nonnull)launchOptions; - -+ (BOOL)application:(UIApplication * _Nonnull)application - continueUserActivity:(NSUserActivity * _Nonnull)userActivity - restorationHandler:(void (^ _Nullable)(NSArray * _Nullable))restorationHandler; - -+ (BOOL)application:(UIApplication * _Nonnull)application - openURL:(NSURL * _Nonnull)URL - sourceApplication:(NSString * _Nullable)sourceApplication - annotation:(id _Nullable)annotation; - -- (void)loadURL:(NSURL * _Nullable)url; - -- (void)loadURLObject:(NSDictionary * _Nullable)urlObject; - -- (void)loadURLString:(NSString * _Nullable)urlString; - -@end diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/Headers/JitsiMeetViewDelegate.h b/Riot/libs/jitsi-meet/JitsiMeet.framework/Headers/JitsiMeetViewDelegate.h deleted file mode 100644 index f0ab68773..000000000 --- a/Riot/libs/jitsi-meet/JitsiMeet.framework/Headers/JitsiMeetViewDelegate.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright @ 2017-present Atlassian Pty Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@protocol JitsiMeetViewDelegate - -@optional - -/** - * Called when a joining a conference was unsuccessful or when there was an - * error while in a conference. - * - * The `data` dictionary contains an `error` key describing the error and a - * `url` key with the conference URL. - */ -- (void)conferenceFailed:(NSDictionary *)data; - -/** - * Called when a conference was joined. - * - * The `data` dictionary contains a `url` key with the conference URL. - */ -- (void)conferenceJoined:(NSDictionary *)data; - -/** - * Called when a conference was left. - * - * The `data` dictionary contains a `url` key with the conference URL. - */ -- (void)conferenceLeft:(NSDictionary *)data; - -/** - * Called before a conference is joined. - * - * The `data` dictionary contains a `url` key with the conference URL. - */ -- (void)conferenceWillJoin:(NSDictionary *)data; - -/** - * Called before a conference is left. - * - * The `data` dictionary contains a `url` key with the conference URL. - */ -- (void)conferenceWillLeave:(NSDictionary *)data; - -/** - * Called when loading the main configuration file from the Jitsi Meet - * deployment file. - * - * The `data` dictionary contains an `error` key with the error and a `url` key - * with the conference URL which necessitated the loading of the configuration - * file. - */ -- (void)loadConfigError:(NSDictionary *)data; - -@end diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/Info.plist b/Riot/libs/jitsi-meet/JitsiMeet.framework/Info.plist deleted file mode 100644 index 7f14178c0..000000000 Binary files a/Riot/libs/jitsi-meet/JitsiMeet.framework/Info.plist and /dev/null differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/Ionicons.ttf b/Riot/libs/jitsi-meet/JitsiMeet.framework/Ionicons.ttf deleted file mode 100644 index 307ad889a..000000000 Binary files a/Riot/libs/jitsi-meet/JitsiMeet.framework/Ionicons.ttf and /dev/null differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/JitsiMeet b/Riot/libs/jitsi-meet/JitsiMeet.framework/JitsiMeet deleted file mode 100755 index cfa4160de..000000000 Binary files a/Riot/libs/jitsi-meet/JitsiMeet.framework/JitsiMeet and /dev/null differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/MaterialCommunityIcons.ttf b/Riot/libs/jitsi-meet/JitsiMeet.framework/MaterialCommunityIcons.ttf deleted file mode 100644 index 69404e3d9..000000000 Binary files a/Riot/libs/jitsi-meet/JitsiMeet.framework/MaterialCommunityIcons.ttf and /dev/null differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/MaterialIcons.ttf b/Riot/libs/jitsi-meet/JitsiMeet.framework/MaterialIcons.ttf deleted file mode 100644 index 7015564ad..000000000 Binary files a/Riot/libs/jitsi-meet/JitsiMeet.framework/MaterialIcons.ttf and /dev/null differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/Modules/module.modulemap b/Riot/libs/jitsi-meet/JitsiMeet.framework/Modules/module.modulemap deleted file mode 100644 index c0d81130d..000000000 --- a/Riot/libs/jitsi-meet/JitsiMeet.framework/Modules/module.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module JitsiMeet { - umbrella header "JitsiMeet.h" - - export * - module * { export * } -} diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/Octicons.ttf b/Riot/libs/jitsi-meet/JitsiMeet.framework/Octicons.ttf deleted file mode 100644 index 09e2b2d79..000000000 Binary files a/Riot/libs/jitsi-meet/JitsiMeet.framework/Octicons.ttf and /dev/null differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/SimpleLineIcons.ttf b/Riot/libs/jitsi-meet/JitsiMeet.framework/SimpleLineIcons.ttf deleted file mode 100644 index 6ecb68683..000000000 Binary files a/Riot/libs/jitsi-meet/JitsiMeet.framework/SimpleLineIcons.ttf and /dev/null differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/Zocial.ttf b/Riot/libs/jitsi-meet/JitsiMeet.framework/Zocial.ttf deleted file mode 100644 index e4ae46c62..000000000 Binary files a/Riot/libs/jitsi-meet/JitsiMeet.framework/Zocial.ttf and /dev/null differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/assets/images/avatar.png b/Riot/libs/jitsi-meet/JitsiMeet.framework/assets/images/avatar.png deleted file mode 100644 index a296ae94b..000000000 Binary files a/Riot/libs/jitsi-meet/JitsiMeet.framework/assets/images/avatar.png and /dev/null differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/jitsi.ttf b/Riot/libs/jitsi-meet/JitsiMeet.framework/jitsi.ttf deleted file mode 100755 index f0e20c48e..000000000 Binary files a/Riot/libs/jitsi-meet/JitsiMeet.framework/jitsi.ttf and /dev/null differ diff --git a/Riot/libs/jitsi-meet/JitsiMeet.framework/main.jsbundle b/Riot/libs/jitsi-meet/JitsiMeet.framework/main.jsbundle deleted file mode 100644 index 2751d3048..000000000 --- a/Riot/libs/jitsi-meet/JitsiMeet.framework/main.jsbundle +++ /dev/null @@ -1,1033 +0,0 @@ -(e='undefined'!=typeof global?global:'undefined'!=typeof self?self:this).__DEV__=!1,e.__BUNDLE_START_TIME__=e.nativePerformanceNow?e.nativePerformanceNow():Date.now();var e; -!(function(r){'use strict';r.require=i,r.__d=function(r,i,t){if(i in e)return;e[i]={dependencyMap:t,exports:void 0,factory:r,hasError:!1,isInitialized:!1}};var e=Object.create(null);function i(i){var n=i,o=e[n];return o&&o.isInitialized?o.exports:(function(e,i){if(!t&&r.ErrorUtils){t=!0;var n=void 0;try{n=a(e,i)}catch(e){r.ErrorUtils.reportFatalError(e)}return t=!1,n}return a(e,i)})(n,o)}i.async=function(r){return Promise.resolve().then(function(){return i(r)})};var t=!1;var n=16,o=-1>>>n;function a(t,a){var u=r.nativeRequire;if(!a&&u){u(t&o,t>>>n),a=e[t]}if(!a)throw Error('Requiring unknown module "'+t+'".');if(a.hasError)throw s=t,c=a.error,Error('Requiring module "'+s+'", which threw an exception: '+c);var s,c;a.isInitialized=!0;var d=a.exports={},f=a,l=f.factory,p=f.dependencyMap;try{var v={exports:d};return l(r,i,v,d,p),a.factory=void 0,a.dependencyMap=void 0,a.exports=v.exports}catch(r){throw a.hasError=!0,a.error=r,a.isInitialized=!1,a.exports=void 0,r}}})('undefined'!=typeof global?global:'undefined'!=typeof self?self:this); -'undefined'!=typeof global?global:'undefined'!=typeof self&&self,Object.assign=function(e,n){for(var f=1;f=0||g.indexOf('description')>=0))return e(r);if(0===g.length){if(f(r)){var v=r.name?': '+r.name:'';return n.stylize('[Function'+v+']','special')}if(a(r))return n.stylize(RegExp.prototype.toString.call(r),'regexp');if(l(r))return n.stylize(Date.prototype.toString.call(r),'date');if(c(r))return e(r)}var h='',d=!1,b=['{','}'];m=r,Array.isArray(m)&&(d=!0,b=['[',']']);var m;if(f(r)){h=' [Function'+(r.name?': '+r.name:'')+']'}if(a(r)&&(h=' '+RegExp.prototype.toString.call(r)),l(r)&&(h=' '+Date.prototype.toUTCString.call(r)),c(r)&&(h=' '+e(r)),0===g.length&&(!d||0==r.length))return b[0]+h+b[1];if(u<0)return a(r)?n.stylize(RegExp.prototype.toString.call(r),'regexp'):n.stylize('[Object]','special');n.seen.push(r);var j;return j=d?(function(n,r,e,i,o){for(var a=[],u=0,l=r.length;u=0&&0,n+r.replace(/\u001b\[\d\d?m/g,'').length+1},0)>60)return e[0]+(''===r?'':r+'\n ')+' '+n.join(',\n ')+' '+e[1];return e[0]+r+' '+n.join(', ')+' '+e[1]})(j,h,b)}function e(n){return'['+Error.prototype.toString.call(n)+']'}function t(n,e,t,a,u,l){var c,f,p;if((p=Object.getOwnPropertyDescriptor(e,u)||{value:e[u]}).get?f=p.set?n.stylize('[Getter/Setter]','special'):n.stylize('[Getter]','special'):p.set&&(f=n.stylize('[Setter]','special')),s(a,u)||(c='['+u+']'),f||(n.seen.indexOf(p.value)<0?(f=i(t)?r(n,p.value,null):r(n,p.value,t-1)).indexOf('\n')>-1&&(f=l?f.split('\n').map(function(n){return' '+n}).join('\n').substr(2):'\n'+f.split('\n').map(function(n){return' '+n}).join('\n')):f=n.stylize('[Circular]','special')),o(c)){if(l&&u.match(/^\d+$/))return f;(c=JSON.stringify(''+u)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(c=c.substr(1,c.length-2),c=n.stylize(c,'name')):(c=c.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),c=n.stylize(c,'string'))}return c+': '+f}function i(n){return null===n}function o(n){return void 0===n}function a(n){return u(n)&&'[object RegExp]'===p(n)}function u(n){return'object'==typeof n&&null!==n}function l(n){return u(n)&&'[object Date]'===p(n)}function c(n){return u(n)&&('[object Error]'===p(n)||n instanceof Error)}function f(n){return'function'==typeof n}function p(n){return Object.prototype.toString.call(n)}function s(n,r){return Object.prototype.hasOwnProperty.call(n,r)}return function(e,t){return r({seen:[],stylize:n},e,t.depth)}})(),e='(index)',t={trace:0,info:1,warn:2,error:3},i=[];i[t.trace]='debug',i[t.info]='log',i[t.warn]='warning',i[t.error]='error';var o=1;if(n.nativeLoggingHook){function a(e){return function(){var a=void 0;a=1===arguments.length&&'string'==typeof arguments[0]?arguments[0]:Array.prototype.map.call(arguments,function(n){return r(n,{depth:10})}).join(', ');var u=e;'Warning: '===a.slice(0,9)&&u>=t.error&&(u=t.warn),n.__inspectorLog&&n.__inspectorLog(i[u],a,[].slice.call(arguments),o),n.nativeLoggingHook(a,u)}}function u(n,r){return Array.apply(null,Array(r)).map(function(){return n})}function l(r){if(!Array.isArray(r)){var i=r;r=[];for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];a[e]=o,r.push(a)}}if(0!==r.length){var l=Object.keys(r[0]).sort(),c=[],f=[];l.forEach(function(n,e){f[e]=n.length;for(var t=0;t';return function(){return u.applyWithGuard(r,t||this,arguments,null,n)}}};r.ErrorUtils=u})('undefined'!=typeof global?global:'undefined'!=typeof self?self:this); -!(function(e){if(void 0===Number.EPSILON&&Object.defineProperty(Number,'EPSILON',{value:Math.pow(2,-52)}),void 0===Number.MAX_SAFE_INTEGER&&Object.defineProperty(Number,'MAX_SAFE_INTEGER',{value:Math.pow(2,53)-1}),void 0===Number.MIN_SAFE_INTEGER&&Object.defineProperty(Number,'MIN_SAFE_INTEGER',{value:-(Math.pow(2,53)-1)}),!Number.isNaN){var r=e.isNaN;Object.defineProperty(Number,'isNaN',{configurable:!0,enumerable:!1,value:function(e){return'number'==typeof e&&r(e)},writable:!0})}})('undefined'!=typeof global?global:'undefined'!=typeof self?self:this); -'undefined'!=typeof global?global:'undefined'!=typeof self&&self,String.prototype.startsWith||(String.prototype.startsWith=function(t){'use strict';if(null==this)throw TypeError();var r=String(this),e=arguments.length>1?Number(arguments[1])||0:0,n=Math.min(Math.max(e,0),r.length);return r.indexOf(String(t),e)===n}),String.prototype.endsWith||(String.prototype.endsWith=function(t){'use strict';if(null==this)throw TypeError();var r=String(this),e=r.length,n=String(t),i=arguments.length>1?Number(arguments[1])||0:e,o=Math.min(Math.max(i,0),e)-n.length;return!(o<0)&&r.lastIndexOf(n,o)===o}),String.prototype.repeat||(String.prototype.repeat=function(t){'use strict';if(null==this)throw TypeError();var r=String(this);if((t=Number(t)||0)<0||t===1/0)throw RangeError();if(1===t)return r;for(var e='';t;)1&t&&(e+=r),(t>>=1)&&(r+=r);return e}),String.prototype.includes||(String.prototype.includes=function(t,r){'use strict';return'number'!=typeof r&&(r=0),!(r+t.length>this.length)&&-1!==this.indexOf(t,r)}),String.prototype.codePointAt||(String.prototype.codePointAt=function(t){if(null==this)throw TypeError();var r=String(this),e=r.length,n=t?Number(t):0;if(Number.isNaN(n)&&(n=0),!(n<0||n>=e)){var i,o=r.charCodeAt(n);return o>=55296&&o<=56319&&e>n+1&&(i=r.charCodeAt(n+1))>=56320&&i<=57343?1024*(o-55296)+i-56320+65536:o}}); -!(function(e){function r(e,r){if(null==this)throw new TypeError('Array.prototype.findIndex called on null or undefined');if('function'!=typeof e)throw new TypeError('predicate must be a function');for(var n=Object(this),t=n.length>>>0,o=0;o=0?t=o:(t=n+o)<0&&(t=0);for(var i;t=0||Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},r.possibleConstructorReturn=function(e,r){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!r||"object"!=typeof r&&"function"!=typeof r?e:r},r.slicedToArray=(function(){return function(e,r){if(Array.isArray(e))return e;if(("function"==typeof Symbol?Symbol.iterator:"@@iterator")in Object(e))return(function(e,r){var t=[],n=!0,o=!1,i=void 0;try{for(var f,u=e["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(n=(f=u.next()).done)&&(t.push(f.value),!r||t.length!==r);n=!0);}catch(e){o=!0,i=e}finally{try{!n&&u.return&&u.return()}finally{if(o)throw i}}return t})(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),r.taggedTemplateLiteral=function(e,r){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(r)}}))},r.toArray=function(e){return Array.isArray(e)?e:Array.from(e)},r.toConsumableArray=function(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);rj.length&&j.push(e)}function E(e,t,n,r){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var u=!1;if(null===e)u=!0;else switch(o){case"string":case"number":u=!0;break;case"object":switch(e.$$typeof){case c:case f:case a:case p:u=!0}}if(u)return n(r,e,""===t?"."+C(e,0):t),1;if(u=0,t=""===t?".":t+":",Array.isArray(e))for(var l=0;l0?r[r.length-1]:null,l=r.length>1?r[r.length-2]:null,f='function'==typeof u,s='function'==typeof l;s&&a(f,'Cannot have a non-function arg after a function arg.');var c=f?u:null,v=s?l:null,d=f+s;r=r.slice(0,r.length-d),o.enqueueNativeCall(n,t,r,v,c)};return i.type=r,i})(t,r,f)}),babelHelpers.extends(v,l),{name:i,module:v}}e.__fbGenNativeModule=i;function u(e,n){return-1!==e.indexOf(n)}var l={};if(e.nativeModuleProxy)l=e.nativeModuleProxy;else{var f=e.__fbBatchedBridgeConfig;a(f,'__fbBatchedBridgeConfig is not set, cannot invoke native modules');var s=n(39);(f.remoteModuleConfig||[]).forEach(function(n,t){var r=i(n,t);r&&(r.module?l[r.name]=r.module:s(l,r.name,{get:function(){return(function(n,t){a(e.nativeRequireModuleConfig,'Can\'t lazily create module without nativeRequireModuleConfig');var r=i(e.nativeRequireModuleConfig(n),t);return r&&r.module})(r.name,t)}}))})}t.exports=l},26); -__d(function(e,r,t,c){'use strict';var i=new(r(28));Object.defineProperty(e,'__fbBatchedBridge',{configurable:!0,value:i}),t.exports=i},27); -__d(function(e,l,t,u){'use strict';var s=l(29),i=l(30),a=(l(31),l(22)),n=(l(32),null),h=(function(){function t(){babelHelpers.classCallCheck(this,t),this._lazyCallableModules={},this._queue=[[],[],[],0],this._successCallbacks=[],this._failureCallbacks=[],this._callID=0,this._lastFlush=0,this._eventLoopStartTime=(new Date).getTime(),this.callFunctionReturnFlushedQueue=this.callFunctionReturnFlushedQueue.bind(this),this.callFunctionReturnResultAndFlushedQueue=this.callFunctionReturnResultAndFlushedQueue.bind(this),this.flushedQueue=this.flushedQueue.bind(this),this.invokeCallbackAndReturnFlushedQueue=this.invokeCallbackAndReturnFlushedQueue.bind(this)}return babelHelpers.createClass(t,[{key:"callFunctionReturnFlushedQueue",value:function(e,l,t){var u=this;return this.__guard(function(){u.__callFunction(e,l,t)}),this.flushedQueue()}},{key:"callFunctionReturnResultAndFlushedQueue",value:function(e,l,t){var u=this,s=void 0;return this.__guard(function(){s=u.__callFunction(e,l,t)}),[s,this.flushedQueue()]}},{key:"invokeCallbackAndReturnFlushedQueue",value:function(e,l){var t=this;return this.__guard(function(){t.__invokeCallback(e,l)}),this.flushedQueue()}},{key:"flushedQueue",value:function(){var e=this;this.__guard(function(){e.__callImmediates()});var l=this._queue;return this._queue=[[],[],[],this._callID],l[0].length?l:null}},{key:"getEventLoopRunningTime",value:function(){return(new Date).getTime()-this._eventLoopStartTime}},{key:"registerCallableModule",value:function(e,l){this._lazyCallableModules[e]=function(){return l}}},{key:"registerLazyCallableModule",value:function(e,l){var t=void 0,u=l;this._lazyCallableModules[e]=function(){return u&&(t=u(),u=null),t}}},{key:"getCallableModule",value:function(e){var l=this._lazyCallableModules[e];return l?l():null}},{key:"enqueueNativeCall",value:function(l,t,u,s,a){(s||a)&&(s&&u.push(this._callID<<1),a&&u.push(this._callID<<1|1),this._successCallbacks[this._callID]=a,this._failureCallbacks[this._callID]=s),this._callID++,this._queue[0].push(l),this._queue[1].push(t),this._queue[2].push(u);var n=(new Date).getTime();if(e.nativeFlushQueueImmediate&&(n-this._lastFlush>=5||0===this._inCall)){var h=this._queue;this._queue=[[],[],[],this._callID],this._lastFlush=n,e.nativeFlushQueueImmediate(h)}i.counterEvent('pending_js_to_native_queue',this._queue[0].length),this.__spy&&this.__spy({type:1,module:l+'',method:t,args:u})}},{key:"createDebugLookup",value:function(e,l,t){}},{key:"__guard",value:function(e){this._inCall++;try{e()}catch(e){s.reportFatalError(e)}finally{this._inCall--}}},{key:"__callImmediates",value:function(){i.beginEvent('JSTimers.callImmediates()'),n||(n=l(33)),n.callImmediates(),i.endEvent()}},{key:"__callFunction",value:function(e,l,t){this._lastFlush=(new Date).getTime(),this._eventLoopStartTime=this._lastFlush,i.beginEvent(e+"."+l+"()"),this.__spy&&this.__spy({type:0,module:e,method:l,args:t});var u=this.getCallableModule(e);a(!!u,'Module %s is not a registered callable module (calling %s)',e,l),a(!!u[l],'Method %s does not exist on module %s',l,e);var s=u[l].apply(u,t);return i.endEvent(),s}},{key:"__invokeCallback",value:function(e,l){this._lastFlush=(new Date).getTime(),this._eventLoopStartTime=this._lastFlush;var t=e>>>1,u=1&e?this._successCallbacks[t]:this._failureCallbacks[t];u&&(this._successCallbacks[t]=this._failureCallbacks[t]=null,u.apply(void 0,babelHelpers.toConsumableArray(l)))}}],[{key:"spy",value:function(e){t.prototype.__spy=!0===e?function(e){console.log((0===e.type?'N->JS':'JS->N')+" : "+(e.module?e.module+'.':'')+e.method+"("+JSON.stringify(e.args)+")")}:!1===e?null:e}}]),t})();t.exports=h},28); -__d(function(r,o,t,i){t.exports=r.ErrorUtils},29); -__d(function(n,e,t,i){'use strict';e(22);var c=!1,o=0,a={installReactHook:function(n){n,!0},setEnabled:function(n){c!==n&&(c=n)},isEnabled:function(){return c},beginEvent:function(e,t){c&&(e='function'==typeof e?e():e,n.nativeTraceBeginSection(131072,e,t))},endEvent:function(){c&&n.nativeTraceEndSection(131072)},beginAsyncEvent:function(e){var t=o;return c&&(o++,e='function'==typeof e?e():e,n.nativeTraceBeginAsyncSection(131072,e,t,0)),t},endAsyncEvent:function(e,t){c&&(e='function'==typeof e?e():e,n.nativeTraceEndAsyncSection(131072,e,t,0))},counterEvent:function(e,t){c&&(e='function'==typeof e?e():e,n.nativeTraceCounter&&n.nativeTraceCounter(131072,e,t))},attachToRelayProfiler:function(n){n.attachProfileHandler('*',function(n){var e=a.beginAsyncEvent(n);return function(){a.endAsyncEvent(n,e)}}),n.attachAggregateHandler('*',function(n,e){a.beginEvent(n),e(),a.endEvent()})},swizzleJSON:function(){a.measureMethods(JSON,'JSON',['parse','stringify'])},measureMethods:function(n,e,t){},measure:function(n,e,t){return t}};t.exports=a},30); -__d(function(t,n,c,i){'use strict';c.exports=function(t){}},31); -__d(function(t,n,i,e){'use strict';i.exports=function(t){var n,i=typeof t;if(void 0===t)n='undefined';else if(null===t)n='null';else if('string'===i)n='"'+t+'"';else if('function'===i)try{n=t.toString()}catch(t){n='[function unknown]'}else try{n=JSON.stringify(t)}catch(i){if('function'==typeof t.toString)try{n=t.toString()}catch(t){}}return n||'["'+i+'" failed to stringify]'}},32); -__d(function(e,t,n,r){'use strict';t(34),t(30);var i=t(22),l=t(26).Timing,a=null;function o(){return a||(a=t(35)),a()}var u=16.666666666666668,c=[],s=[],m=[],f=[],d=[],v={},h=[],I=1,T=null,g=!1;function p(e,t){var n=I++,r=(function(){var e=m.indexOf(null);return-1===e&&(e=m.length),e})();return m[r]=n,c[r]=e,s[r]=t,n}function b(e,n,r){t(38)(e<=I,'Tried to call timer with ID %s but no such timer exists.',e);var i=m.indexOf(e);if(-1!==i){var l=s[i],a=c[i];if(a&&l){'setTimeout'!==l&&'setImmediate'!==l&&'requestAnimationFrame'!==l&&'requestIdleCallback'!==l||x(i);try{'setTimeout'===l||'setInterval'===l||'setImmediate'===l?a():'requestAnimationFrame'===l?a(o()):'requestIdleCallback'===l?a({timeRemaining:function(){return Math.max(0,u-(o()-n))},didTimeout:!!r}):console.error('Tried to call a callback with invalid type: '+l)}catch(e){T?T.push(e):T=[e]}}else console.error('No callback found for timerID '+e)}}function w(){if(f.length>0){var e=f.slice();f=[];for(var t=0;t0}function x(e){m[e]=null,c[e]=null,s[e]=null,h[e]=null}function k(e){if(null!=e){var t=m.indexOf(e);if(-1!==t){x(t);var n=s[t];'setImmediate'!==n&&'requestIdleCallback'!==n&&l.deleteTimer(e)}}}var q={setTimeout:function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i2?n-2:0),i=2;i1?t-1:0),r=1;r-1&&(d.splice(e,1),b(r,o(),!0)),delete v[r],0===d.length&&l.setSendIdleEvents(!1)},n);v[r]=i}return r},cancelIdleCallback:function(e){k(e);var t=d.indexOf(e);-1!==t&&d.splice(t,1);var n=v[e];n&&(q.clearTimeout(n),delete v[e]),0===d.length&&l.setSendIdleEvents(!1)},clearTimeout:function(e){k(e)},clearInterval:function(e){k(e)},clearImmediate:function(e){k(e);var t=f.indexOf(e);-1!==t&&f.splice(t,1)},cancelAnimationFrame:function(e){k(e)},callTimers:function(e){i(0!==e.length,'Cannot call `callTimers` with an empty list of IDs.'),T=null;for(var t=0;t1)for(var r=1;r0){var t=d.slice();d=[];for(var n=0;n1&&(a-=1),a<.16666666666666666?e+6*(r-e)*a:a<.5?r:a<.6666666666666666?e+(r-e)*(.6666666666666666-a)*6:e}function t(e,r,a){var l=a<.5?a*(1+r):a+r-a*r,t=2*a-l,i=n(t,l,e+.3333333333333333),o=n(t,l,e),u=n(t,l,e-.3333333333333333);return Math.round(255*i)<<24|Math.round(255*o)<<16|Math.round(255*u)<<8}var i='[-+]?\\d*\\.?\\d+',o=i+'%';function u(){for(var e=arguments.length,r=Array(e),a=0;a255?255:r}function s(e){return(parseFloat(e)%360+360)%360/360}function h(e){var r=parseFloat(e);return r<0?0:r>1?255:Math.round(255*r)}function c(e){var r=parseFloat(e);return r<0?0:r>100?1:r/100}var b={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199};a.exports=function(e){var r;return'number'==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(r=d.hex6.exec(e))?parseInt(r[1]+'ff',16)>>>0:b.hasOwnProperty(e)?b[e]:(r=d.rgb.exec(e))?(g(r[1])<<24|g(r[2])<<16|g(r[3])<<8|255)>>>0:(r=d.rgba.exec(e))?(g(r[1])<<24|g(r[2])<<16|g(r[3])<<8|h(r[4]))>>>0:(r=d.hex3.exec(e))?parseInt(r[1]+r[1]+r[2]+r[2]+r[3]+r[3]+'ff',16)>>>0:(r=d.hex8.exec(e))?parseInt(r[1],16)>>>0:(r=d.hex4.exec(e))?parseInt(r[1]+r[1]+r[2]+r[2]+r[3]+r[3]+r[4]+r[4],16)>>>0:(r=d.hsl.exec(e))?(255|t(s(r[1]),c(r[2]),c(r[3])))>>>0:(r=d.hsla.exec(e))?(t(s(r[1]),c(r[2]),c(r[3]))|h(r[4]))>>>0:null}},52); -__d(function(_,t,E,i){'use strict';var e=t(54).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.NativeMethodsMixin;E.exports=e},53); -__d(function(t,i,o,r){'use strict';var s=void 0;s=i(55),o.exports=s},54); -__d(function(e,t,n,r){"use strict";var i=t(22),o=t(56),a=t(18),u=t(15),l=t(60),s=t(61),c=t(62),f=t(64),d=t(65);t(31),t(66);var p=t(108),h=t(19),v=function(e){return!0},g=v;var y,m={injection:{injectDialog:function(e){i(g===v,"The custom dialog was already injected."),i("function"==typeof e,"Injected showDialog() must be a function."),g=e}},logCapturedError:function(e){if(!1!==g(e)){var t=e.error;console.error(t)}}},b={_caughtError:null,_hasCaughtError:!1,_rethrowError:null,_hasRethrowError:!1,injection:{injectErrorUtils:function(e){i("function"==typeof e.invokeGuardedCallback,"Injected invokeGuardedCallback() must be a function."),C=e.invokeGuardedCallback}},invokeGuardedCallback:function(e,t,n,r,i,o,a,u,l){C.apply(b,arguments)},invokeGuardedCallbackAndCatchFirstError:function(e,t,n,r,i,o,a,u,l){if(b.invokeGuardedCallback.apply(this,arguments),b.hasCaughtError()){var s=b.clearCaughtError();b._hasRethrowError||(b._hasRethrowError=!0,b._rethrowError=s)}},rethrowCaughtError:function(){return T.apply(b,arguments)},hasCaughtError:function(){return b._hasCaughtError},clearCaughtError:function(){if(b._hasCaughtError){var e=b._caughtError;return b._caughtError=null,b._hasCaughtError=!1,e}i(!1,"clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.")}},C=function(e,t,n,r,i,o,a,u,l){b._hasCaughtError=!1,b._caughtError=null;var s=Array.prototype.slice.call(arguments,3);try{t.apply(n,s)}catch(e){b._caughtError=e,b._hasCaughtError=!0}},T=function(){if(b._hasRethrowError){var e=b._rethrowError;throw b._rethrowError=null,b._hasRethrowError=!1,e}},P=b;function k(e,t,n,r){var i=e.type||"unknown-event";e.currentTarget=x.getNodeFromInstance(r),P.invokeGuardedCallbackAndCatchFirstError(i,n,void 0,e),e.currentTarget=null}var x={isEndish:function(e){return"topMouseUp"===e||"topTouchEnd"===e||"topTouchCancel"===e},isMoveish:function(e){return"topMouseMove"===e||"topTouchMove"===e},isStartish:function(e){return"topMouseDown"===e||"topTouchStart"===e},executeDirectDispatch:function(e){var t=e._dispatchListeners,n=e._dispatchInstances;i(!Array.isArray(t),"executeDirectDispatch(...): Invalid `event`."),e.currentTarget=t?x.getNodeFromInstance(n):null;var r=t?t(e):null;return e.currentTarget=null,e._dispatchListeners=null,e._dispatchInstances=null,r},executeDispatchesInOrder:function(e,t){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var i=0;i3&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:F,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}},isPortal:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===F},REACT_PORTAL_TYPE:F},L={},O={};function z(e){return L[e]||null}var W={getClosestInstanceFromNode:z,getInstanceFromNode:z,getNodeFromInstance:function(e){var t=e.stateNode._nativeTag;return i(t,"All native instances should have a tag."),t},precacheFiberNode:function(e,t){L[t]=e},uncacheFiberNode:function(e){delete L[e],delete O[e]},getFiberCurrentPropsFromNode:function(e){return O[e._nativeTag]||null},updateFiberProps:function(e,t){O[e]=t}},M="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},Y={enableAsyncSubtreeAPI:!0},B=0,Q=1,X=2,G=4,V=6,$=8,q=16,J=32,K=64,Z=128,ee=0,te=1,ne=2,re=3,ie=4,oe=5,ae=0,ue=1,le=2,se=3,ce=4,fe=5,de=6,pe=7,he=8,ve=9,ge=10,ye=J,me=ee,be=te,Ce=ne,Te=le,Pe=se,ke=void 0,xe=void 0;function Re(e,t){return e!==Ce&&e!==be||t!==Ce&&t!==be?e===me&&t!==me?-255:e!==me&&t===me?255:e-t:0}function Se(e,t,n,r){null!==n?n.next=t:(t.next=e.first,e.first=t),null!==r?t.next=r:e.last=t}function Ne(e,t){var n=t.priorityLevel,r=null,i=null;if(null!==e.last&&Re(e.last.priorityLevel,n)<=0)r=e.last;else for(i=e.first;null!==i&&Re(i.priorityLevel,n)<=0;)r=i,i=i.next;return r}function Ee(e,t){!(function(e){var t=e.alternate,n=e.updateQueue;null===n&&(n=e.updateQueue={first:null,last:null,hasForceUpdate:!1,callbackList:null});var r=void 0;null!==t?null===(r=t.updateQueue)&&(r=t.updateQueue={first:null,last:null,hasForceUpdate:!1,callbackList:null}):r=null,ke=n,xe=r!==n?r:null})(e);var n=ke,r=xe,i=Ne(n,t),o=null!==i?i.next:n.first;if(null===r)return Se(n,t,i,o),null;var a=Ne(r,t),u=null!==a?a.next:r.first;if(Se(n,t,i,o),o===u&&null!==o||i===a&&null!==i)return null===a&&(r.first=t),null===u&&(r.last=null),null;var l,s=(l=t,{priorityLevel:l.priorityLevel,partialState:l.partialState,callback:l.callback,isReplace:l.isReplace,isForced:l.isForced,isTopLevelUnmount:l.isTopLevelUnmount,next:null});return Se(r,s,a,u),s}function we(e,t,n,r){var i=e.partialState;return"function"==typeof i?i.call(t,n,r):i}var Ie={addUpdate:function(e,t,n,r){Ee(e,{priorityLevel:r,partialState:t,callback:n,isReplace:!1,isForced:!1,isTopLevelUnmount:!1,next:null})},addReplaceUpdate:function(e,t,n,r){Ee(e,{priorityLevel:r,partialState:t,callback:n,isReplace:!0,isForced:!1,isTopLevelUnmount:!1,next:null})},addForceUpdate:function(e,t,n){Ee(e,{priorityLevel:n,partialState:null,callback:t,isReplace:!1,isForced:!0,isTopLevelUnmount:!1,next:null})},getUpdatePriority:function(e){var t=e.updateQueue;return null===t?me:e.tag!==Te&&e.tag!==Pe?me:null!==t.first?t.first.priorityLevel:me},addTopLevelUpdate:function(e,t,n,r){var i=null===t.element,o={priorityLevel:r,partialState:t,callback:n,isReplace:!1,isForced:!1,isTopLevelUnmount:i,next:null},a=Ee(e,o);if(i){var u=ke,l=xe;null!==u&&null!==o.next&&(o.next=null,u.last=o),null!==l&&null!==a&&null!==a.next&&(a.next=null,l.last=o)}},beginUpdateQueue:function(e,t,n,r,i,o,a){if(null!==e&&e.updateQueue===n){var u=n;n=t.updateQueue={first:u.first,last:u.last,callbackList:null,hasForceUpdate:!1}}for(var l=n.callbackList,s=n.hasForceUpdate,c=i,f=!0,d=n.first;null!==d&&Re(d.priorityLevel,a)<=0;){n.first=d.next,null===n.first&&(n.last=null);var p=void 0;d.isReplace?(c=we(d,r,c,o),f=!0):(p=we(d,r,c,o))&&(c=f?babelHelpers.extends({},c,p):babelHelpers.extends(c,p),f=!1),d.isForced&&(s=!0),null===d.callback||d.isTopLevelUnmount&&null!==d.next||(l=null!==l?l:[],l.push(d.callback),t.effectTag|=ye),d=d.next}return n.callbackList=l,n.hasForceUpdate=s,null!==n.first||null!==l||s||(t.updateQueue=null),c},commitCallbacks:function(e,t,n){var r=t.callbackList;if(null!==r){t.callbackList=null;for(var o=0;o-1;)$e[qe]=null,qe--},tt=function(e){return Ye(e)===We},nt=le,rt=se,it=Je,ot=Ke,at=Ze,ut=it(a),lt=it(!1),st=a;function ct(e,t,n){var r=e.stateNode;r.__reactInternalMemoizedUnmaskedChildContext=t,r.__reactInternalMemoizedMaskedChildContext=n}function ft(e){return e.tag===nt&&null!=e.type.childContextTypes}function dt(e,t){var n=e.stateNode,r=e.type.childContextTypes;if("function"!=typeof n.getChildContext)return t;var o=void 0;o=n.getChildContext();for(var a in o)i(a in r,'%s.getChildContext(): key "%s" is not defined in childContextTypes.',_e(e)||"Unknown",a);return babelHelpers.extends({},t,o)}var pt={getUnmaskedContext:function(e){return ft(e)?st:ut.current},cacheContext:ct,getMaskedContext:function(e,t){var n=e.type.contextTypes;if(!n)return a;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={};for(var o in n)i[o]=t[o];return r&&ct(e,t,i),i},hasContextChanged:function(){return lt.current},isContextConsumer:function(e){return e.tag===nt&&null!=e.type.contextTypes},isContextProvider:ft,popContextProvider:function(e){ft(e)&&(ot(lt,e),ot(ut,e))},popTopLevelContextObject:function(e){ot(lt,e),ot(ut,e)},pushTopLevelContextObject:function(e,t,n){i(null==ut.cursor,"Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue."),at(ut,t,e),at(lt,n,e)},processChildContext:dt,pushContextProvider:function(e){if(!ft(e))return!1;var t=e.stateNode,n=t&&t.__reactInternalMemoizedMergedChildContext||a;return st=ut.current,at(ut,n,e),at(lt,lt.current,e),!0},invalidateContextProvider:function(e,t){var n=e.stateNode;if(i(n,"Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue."),t){var r=dt(e,st);n.__reactInternalMemoizedMergedChildContext=r,ot(lt,e),ot(ut,e),at(ut,r,e),at(lt,t,e)}else ot(lt,e),at(lt,t,e)},resetContext:function(){st=a,ut.current=a,lt.current=!1},findCurrentUnmaskedContext:function(e){i(tt(e)&&e.tag===nt,"Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");for(var t=e;t.tag!==rt;){if(ft(t))return t.stateNode.__reactInternalMemoizedMergedChildContext;var n=t.return;i(n,"Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue."),t=n}return t.stateNode.context}},ht=1,vt=ae,gt=le,yt=se,mt=fe,bt=de,Ct=ce,Tt=pe,Pt=ve,kt=ge,xt=ee,Rt=0,St=B;var Nt=function(e,t,n){return new(function(e,t,n){this.tag=e,this.key=t,this.type=null,this.stateNode=null,this.return=null,this.child=null,this.sibling=null,this.index=0,this.ref=null,this.pendingProps=null,this.memoizedProps=null,this.updateQueue=null,this.memoizedState=null,this.internalContextTag=n,this.effectTag=St,this.nextEffect=null,this.firstEffect=null,this.lastEffect=null,this.pendingWorkPriority=xt,this.alternate=null})(e,t,n)};function Et(e,t,n,r){var o=void 0;if("function"==typeof e)a=e,o=a.prototype&&a.prototype.isReactComponent?Nt(gt,t,n):Nt(vt,t,n),o.type=e;else if("string"==typeof e)o=Nt(mt,t,n),o.type=e;else if("object"==typeof e&&null!==e&&"number"==typeof e.tag)o=e;else{i(!1,"Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",null==e?e:typeof e,"")}var a;return o}var wt=function(e,t){var n=e.alternate;return null===n?((n=Nt(e.tag,e.key,e.internalContextTag)).type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.effectTag=St,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.pendingWorkPriority=t,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n},It=function(e,t,n){var r=Et(e.type,e.key,t);return r.pendingProps=e.props,r.pendingWorkPriority=n,r},_t=function(e,t,n){var r=Nt(kt,null,t);return r.pendingProps=e,r.pendingWorkPriority=n,r},At=function(e,t,n){var r=Nt(bt,null,t);return r.pendingProps=e,r.pendingWorkPriority=n,r},Ht=function(){var e=Nt(mt,null,Rt);return e.type="DELETED",e},Dt=function(e,t,n){var r=Nt(Tt,e.key,t);return r.type=e.handler,r.pendingProps=e,r.pendingWorkPriority=n,r},Ut=function(e,t,n){return Nt(Pt,null,t)},Ft=function(e,t,n){var r=Nt(Ct,e.key,t);return r.pendingProps=e.children||[],r.pendingWorkPriority=n,r.stateNode={containerInfo:e.containerInfo,implementation:e.implementation},r},jt=function(e,t){return e!==xt&&(t===xt||t>e)?e:t},Lt=function(){return Nt(yt,null,Rt)},Ot=function(e){var t=Lt(),n={current:t,containerInfo:e,isScheduled:!1,nextScheduledRoot:null,context:null,pendingContext:null};return t.stateNode=n,n},zt=function(e,t,n){return"\n in "+(e||"Unknown")+(t?" (at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+")":n?" (created by "+n+")":"")},Wt=ae,Mt=ue,Yt=le,Bt=fe;function Qt(e){switch(e.tag){case Wt:case Mt:case Yt:case Bt:var t=e._debugOwner,n=e._debugSource,r=_e(e),i=null;return t&&(i=_e(t)),zt(r,n,i);default:return""}}var Xt,Gt,Vt=function(e){var t="",n=e;do{t+=Qt(n),n=n.return}while(n);return t};"function"!=typeof Symbol||"function"==typeof Symbol&&!Symbol.for?(Xt=60104,Gt=60105):(Xt=("function"==typeof Symbol?Symbol.for:"@@for")("react.coroutine"),Gt=("function"==typeof Symbol?Symbol.for:"@@for")("react.yield"));var $t={createCoroutine:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:Xt,key:null==r?null:""+r,children:e,handler:t,props:n}},createYield:function(e){return{$$typeof:Gt,value:e}},isCoroutine:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Xt},isYield:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Gt},REACT_YIELD_TYPE:Gt,REACT_COROUTINE_TYPE:Xt},qt=$t.REACT_COROUTINE_TYPE,Jt=$t.REACT_YIELD_TYPE,Kt=j.REACT_PORTAL_TYPE,Zt=wt,en=It,tn=_t,nn=At,rn=Dt,on=Ut,an=Ft,un=Array.isArray,ln=ue,sn=le,cn=de,fn=ce,dn=pe,pn=ve,hn=ge,vn=B,gn=X,yn=$,mn="function"==typeof Symbol&&("function"==typeof Symbol?Symbol.iterator:"@@iterator"),bn="@@iterator",Cn="function"==typeof Symbol&&("function"==typeof Symbol?Symbol.for:"@@for")&&("function"==typeof Symbol?Symbol.for:"@@for")("react.element")||60103;function Tn(e){if(null===e||void 0===e)return null;var t=mn&&e[mn]||e[bn];return"function"==typeof t?t:null}function Pn(e,t){var n=t.ref;if(null!==n&&"function"!=typeof n){if(t._owner){var r=t._owner,o=void 0;if(r){var u=r;i(u.tag===sn,"Stateless function components cannot have refs."),o=u.stateNode}i(o,"Missing owner for string ref %s. This error is likely caused by a bug in React. Please file an issue.",n);var l=""+n;if(null!==e&&null!==e.ref&&e.ref._stringRef===l)return e.ref;var s=function(e){var t=o.refs===a?o.refs={}:o.refs;null===e?delete t[l]:t[l]=e};return s._stringRef=l,s}i("string"==typeof n,"Expected ref to be a function or a string."),i(t._owner,"Element ref was specified as a string (%s) but no owner was set. You may have multiple copies of React loaded. (details: https://fb.me/react-refs-must-have-owner).",n)}return n}function kn(e,t){"textarea"!==e.type&&i(!1,"Objects are not valid as a React child (found: %s).%s","[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,"")}function xn(e,t){function n(n,r){if(t){if(!e){if(null===r.alternate)return;r=r.alternate}var i=n.lastEffect;null!==i?(i.nextEffect=r,n.lastEffect=r):n.firstEffect=n.lastEffect=r,r.nextEffect=null,r.effectTag=yn}}function r(e,r){if(!t)return null;for(var i=r;null!==i;)n(e,i),i=i.sibling;return null}function o(e,t){for(var n=new Map,r=t;null!==r;)null!==r.key?n.set(r.key,r):n.set(r.index,r),r=r.sibling;return n}function a(t,n){if(e){var r=Zt(t,n);return r.index=0,r.sibling=null,r}return t.pendingWorkPriority=n,t.effectTag=vn,t.index=0,t.sibling=null,t}function u(e,n,r){if(e.index=r,!t)return n;var i=e.alternate;if(null!==i){var o=i.index;return op?(h=f,f=null):h=f.sibling;var m=g(e,f,a[p],l);if(null===m){null===f&&(f=h);break}t&&f&&null===m.alternate&&n(e,f),d=u(m,d,p),null===c?s=m:c.sibling=m,c=m,f=h}if(p===a.length)return r(e,f),s;if(null===f){for(;pb?(C=h,h=null):C=h.sibling;var P=g(e,h,T.value,s);if(null===P){h||(h=C);break}t&&h&&null===P.alternate&&n(e,h),m=u(P,m,b),null===p?d=P:p.sibling=P,p=P,h=C}if(T.done)return r(e,h),d;if(null===h){for(;!T.done;b++,T=f.next()){var k=v(e,T.value,s);null!==k&&(m=u(k,m,b),null===p?d=k:p.sibling=k,p=k)}return d}for(var x=o(0,h);!T.done;b++,T=f.next()){var R=y(x,e,b,T.value,s);null!==R&&(t&&null!==R.alternate&&x.delete(null===R.key?b:R.key),m=u(R,m,b),null===p?d=R:p.sibling=R,p=R)}return t&&x.forEach(function(t){return n(e,t)}),d})(e,s,c,f);if(d&&kn(e,c),void 0===c)switch(e.tag){case sn:case ln:var p=e.type;i(!1,"%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.",p.displayName||p.name||"Component")}return r(e,s)}}var Rn={reconcileChildFibers:xn(!0,!0),reconcileChildFibersInPlace:xn(!1,!0),mountChildFibersInPlace:xn(!1,!1),cloneChildFibers:function(e,t){if(i(null===e||t.child===e.child,"Resuming work not yet implemented."),null!==t.child){var n=t.child,r=Zt(n,n.pendingWorkPriority);for(r.pendingProps=n.pendingProps,t.child=r,r.return=t;null!==n.sibling;)n=n.sibling,(r=r.sibling=Zt(n,n.pendingWorkPriority)).pendingProps=n.pendingProps,r.return=t;r.sibling=null}}},Sn=G,Nn=ht,En=pt.cacheContext,wn=pt.getMaskedContext,In=pt.getUnmaskedContext,_n=pt.isContextConsumer,An=Ie.addUpdate,Hn=Ie.addReplaceUpdate,Dn=Ie.addForceUpdate,Un=Ie.beginUpdateQueue,Fn=pt.hasContextChanged,jn=Xe,Ln=function(e,t,n,r){var o={isMounted:jn,enqueueSetState:function(n,r,i){var o=Ae.get(n),a=t(o,!1);An(o,r,i=void 0===i?null:i,a),e(o,a)},enqueueReplaceState:function(n,r,i){var o=Ae.get(n),a=t(o,!1);Hn(o,r,i=void 0===i?null:i,a),e(o,a)},enqueueForceUpdate:function(n,r){var i=Ae.get(n),o=t(i,!1);Dn(i,r=void 0===r?null:r,o),e(i,o)}};function u(e,t){t.updater=o,e.stateNode=t,Ae.set(t,e)}return{adoptClassInstance:u,constructClassInstance:function(e,t){var n=e.type,r=In(e),i=_n(e),o=i?wn(e,r):a,l=new n(t,o);return u(e,l),i&&En(e,r,o),l},mountClassInstance:function(e,t){var n=e.alternate,r=e.stateNode,u=r.state||null,l=e.pendingProps;i(l,"There must be pending props for an initial mount. This error is likely caused by a bug in React. Please file an issue.");var s=In(e);if(r.props=l,r.state=u,r.refs=a,r.context=wn(e,s),Y.enableAsyncSubtreeAPI&&null!=e.type&&null!=e.type.prototype&&!0===e.type.prototype.unstable_isAsyncReactComponent&&(e.internalContextTag|=Nn),"function"==typeof r.componentWillMount){!(function(e,t){var n=t.state;t.componentWillMount(),n!==t.state&&o.enqueueReplaceState(t,t.state,null)})(0,r);var c=e.updateQueue;null!==c&&(r.state=Un(n,e,c,r,u,l,t))}"function"==typeof r.componentDidMount&&(e.effectTag|=Sn)},updateClassInstance:function(e,t,a){var u=t.stateNode;s=t,(c=u).props=s.memoizedProps,c.state=s.memoizedState;var s,c,f=t.memoizedProps,d=t.pendingProps;d||(d=f,i(null!=d,"There should always be pending or memoized props. This error is likely caused by a bug in React. Please file an issue."));var p=u.context,h=In(t),v=wn(t,h);"function"!=typeof u.componentWillReceiveProps||f===d&&p===v||(function(e,t,n,r){var i=t.state;t.componentWillReceiveProps(n,r),t.state!==i&&o.enqueueReplaceState(t,t.state,null)})(0,u,d,v);var g=t.memoizedState,y=void 0;if(y=null!==t.updateQueue?Un(e,t,t.updateQueue,u,g,d,a):g,!(f!==d||g!==y||Fn()||null!==t.updateQueue&&t.updateQueue.hasForceUpdate))return"function"==typeof u.componentDidUpdate&&(f===e.memoizedProps&&g===e.memoizedState||(t.effectTag|=Sn)),!1;var m=(function(e,t,n,r,i,o){if(null===t||null!==e.updateQueue&&e.updateQueue.hasForceUpdate)return!0;var a=e.stateNode,u=e.type;return"function"==typeof a.shouldComponentUpdate?a.shouldComponentUpdate(n,i,o):!(u.prototype&&u.prototype.isPureReactComponent&&l(t,n)&&l(r,i))})(t,f,d,g,y,v);return m?("function"==typeof u.componentWillUpdate&&u.componentWillUpdate(d,y,v),"function"==typeof u.componentDidUpdate&&(t.effectTag|=Sn)):("function"==typeof u.componentDidUpdate&&(f===e.memoizedProps&&g===e.memoizedState||(t.effectTag|=Sn)),n(t,d),r(t,y)),u.props=d,u.state=y,u.context=v,m}}},On=Rn.mountChildFibersInPlace,zn=Rn.reconcileChildFibers,Wn=Rn.reconcileChildFibersInPlace,Mn=Rn.cloneChildFibers,Yn=Ie.beginUpdateQueue,Bn=pt.getMaskedContext,Qn=pt.getUnmaskedContext,Xn=pt.hasContextChanged,Gn=pt.pushContextProvider,Vn=pt.pushTopLevelContextObject,$n=pt.invalidateContextProvider,qn=ae,Jn=ue,Kn=le,Zn=se,er=fe,tr=de,nr=ce,rr=pe,ir=he,or=ve,ar=ge,ur=ee,lr=oe,sr=Q,cr=X,fr=q,dr=K,pr=Z,hr=He.ReactCurrentOwner,vr=function(e,t,n,r,o){var a=e.shouldSetTextContent,u=e.useSyncScheduling,l=e.shouldDeprioritizeSubtree,s=t.pushHostContext,c=t.pushHostContainer,f=n.enterHydrationState,d=n.resetHydrationState,p=n.tryToClaimNextHydratableInstance,h=Ln(r,o,S,N),v=h.adoptClassInstance,g=h.constructClassInstance,y=h.mountClassInstance,m=h.updateClassInstance;function b(e,t,n){C(e,t,n,t.pendingWorkPriority)}function C(e,t,n,r){null===e?t.child=On(t,t.child,n,r):e.child===t.child?t.child=zn(t,t.child,n,r):t.child=Wn(t,t.child,n,r)}function T(e,t){var n=t.ref;null===n||e&&e.ref===n||(t.effectTag|=pr)}function P(e,t,n,r){if(T(e,t),!n)return r&&$n(t,!1),x(e,t);var i=t.stateNode;hr.current=t;var o=void 0;return o=i.render(),t.effectTag|=sr,b(e,t,o),N(t,i.state),S(t,i.props),r&&$n(t,!0),t.child}function k(e){var t=e.stateNode;t.pendingContext?Vn(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Vn(e,t.context,!1),c(e,t.containerInfo)}function x(e,t){return Mn(e,t),t.child}function R(e,t){switch(t.tag){case Zn:k(t);break;case Kn:Gn(t);break;case nr:c(t,t.stateNode.containerInfo)}return null}function S(e,t){e.memoizedProps=t}function N(e,t){e.memoizedState=t}return{beginWork:function(e,t,n){if(t.pendingWorkPriority===ur||t.pendingWorkPriority>n)return R(0,t);switch(t.tag){case qn:return(function(e,t,n){i(null===e,"An indeterminate component should never have mounted. This error is likely caused by a bug in React. Please file an issue.");var r,o=t.type,a=t.pendingProps,u=Qn(t);if(r=o(a,Bn(t,u)),t.effectTag|=sr,"object"==typeof r&&null!==r&&"function"==typeof r.render){t.tag=Kn;var l=Gn(t);return v(t,r),y(t,n),P(e,t,!0,l)}return t.tag=Jn,b(e,t,r),S(t,a),t.child})(e,t,n);case Jn:return(function(e,t){var n=t.type,r=t.pendingProps,i=t.memoizedProps;if(Xn())null===r&&(r=i);else if(null===r||i===r)return x(e,t);var o,a=Qn(t);return o=n(r,Bn(t,a)),t.effectTag|=sr,b(e,t,o),S(t,r),t.child})(e,t);case Kn:return(function(e,t,n){var r=Gn(t),o=void 0;return null===e?t.stateNode?i(!1,"Resuming work not yet implemented."):(g(t,t.pendingProps),y(t,n),o=!0):o=m(e,t,n),P(e,t,o,r)})(e,t,n);case Zn:return(function(e,t,n){k(t);var r=t.updateQueue;if(null!==r){var i=t.memoizedState,o=Yn(e,t,r,null,i,null,n);if(i===o)return d(),x(e,t);var a=o.element;return null!==e&&null!==e.child||!f(t)?(d(),b(e,t,a)):(t.effectTag|=cr,t.child=On(t,t.child,a,n)),N(t,o),t.child}return d(),x(e,t)})(e,t,n);case er:return(function(e,t,n){s(t),null===e&&p(t);var r=t.type,o=t.memoizedProps,c=t.pendingProps;null===c&&(c=o,i(null!==c,"We should always have pending or current props. This error is likely caused by a bug in React. Please file an issue."));var f=null!==e?e.memoizedProps:null;if(Xn());else if(null===c||o===c)return x(e,t);var d=c.children;return a(r,c)?d=null:f&&a(r,f)&&(t.effectTag|=fr),T(e,t),n!==lr&&!u&&l(r,c)?(t.pendingWorkPriority=lr,null):(b(e,t,d),S(t,c),t.child)})(e,t,n);case tr:return(function(e,t){null===e&&p(t);var n=t.pendingProps;return null===n&&(n=t.memoizedProps),S(t,n),null})(e,t);case ir:t.tag=rr;case rr:return(function(e,t){var n=t.pendingProps;Xn()?null===n&&(n=e&&e.memoizedProps,i(null!==n,"We should always have pending or current props. This error is likely caused by a bug in React. Please file an issue.")):null!==n&&t.memoizedProps!==n||(n=t.memoizedProps);var r=n.children,o=t.pendingWorkPriority;return null===e?t.stateNode=On(t,t.stateNode,r,o):e.child===t.child?t.stateNode=zn(t,t.stateNode,r,o):t.stateNode=Wn(t,t.stateNode,r,o),S(t,n),t.stateNode})(e,t);case or:return null;case nr:return(function(e,t){c(t,t.stateNode.containerInfo);var n=t.pendingWorkPriority,r=t.pendingProps;if(Xn())null===r&&(r=e&&e.memoizedProps,i(null!=r,"We should always have pending or current props. This error is likely caused by a bug in React. Please file an issue."));else if(null===r||t.memoizedProps===r)return x(e,t);return null===e?(t.child=Wn(t,t.child,r,n),S(t,r)):(b(e,t,r),S(t,r)),t.child})(e,t);case ar:return(function(e,t){var n=t.pendingProps;if(Xn())null===n&&(n=t.memoizedProps);else if(null===n||t.memoizedProps===n)return x(e,t);return b(e,t,n),S(t,n),t.child})(e,t);default:i(!1,"Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.")}},beginFailedWork:function(e,t,n){switch(t.tag){case Kn:Gn(t);break;case Zn:k(t);break;default:i(!1,"Invalid type of work. This error is likely caused by a bug in React. Please file an issue.")}if(t.effectTag|=dr,null===e?t.child=null:t.child!==e.child&&(t.child=e.child),t.pendingWorkPriority===ur||t.pendingWorkPriority>n)return R(0,t);if(t.firstEffect=null,t.lastEffect=null,C(e,t,null,n),t.tag===Kn){var r=t.stateNode;t.memoizedProps=r.props,t.memoizedState=r.state}return t.child}}},gr=Rn.reconcileChildFibers,yr=pt.popContextProvider,mr=pt.popTopLevelContextObject,br=ae,Cr=ue,Tr=le,Pr=se,kr=fe,xr=de,Rr=ce,Sr=pe,Nr=he,Er=ve,wr=ge,Ir=X,_r=Z,Ar=G,Hr=oe,Dr=function(e,t,n){var r=e.createInstance,o=e.createTextInstance,a=e.appendInitialChild,u=e.finalizeInitialChildren,l=e.prepareUpdate,s=t.getRootHostContainer,c=t.popHostContext,f=t.getHostContext,d=t.popHostContainer,p=n.prepareToHydrateHostInstance,h=n.prepareToHydrateHostTextInstance,v=n.popHydrationState;function g(e){e.effectTag|=Ar}function y(e){e.effectTag|=_r}function m(e,t){var n=t.memoizedProps;i(n,"Should be resolved by now. This error is likely caused by a bug in React. Please file an issue."),t.tag=Nr;var r=[];!(function(e,t){var n=t.stateNode;for(n&&(n.return=t);null!==n;){if(n.tag===kr||n.tag===xr||n.tag===Rr)i(!1,"A coroutine cannot have host component children.");else if(n.tag===Er)e.push(n.type);else if(null!==n.child){n.child.return=n,n=n.child;continue}for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}})(r,t);var o=(0,n.handler)(n.props,r),a=null!==e?e.child:null,u=t.pendingWorkPriority;return t.child=gr(t,a,o,u),t.child}return{completeWork:function(e,t,n){var b=t.pendingProps;switch(null===b?b=t.memoizedProps:t.pendingWorkPriority===Hr&&n!==Hr||(t.pendingProps=null),t.tag){case Cr:return null;case Tr:return yr(t),null;case Pr:d(t),mr(t);var C=t.stateNode;return C.pendingContext&&(C.context=C.pendingContext,C.pendingContext=null),null!==e&&null!==e.child||(v(t),t.effectTag&=~Ir),null;case kr:c(t);var T=s(),P=t.type;if(null!==e&&null!=t.stateNode){var k=e.memoizedProps,x=t.stateNode,R=f(),S=l(x,P,k,b,T,R);t.updateQueue=S,S&&g(t),e.ref!==t.ref&&y(t)}else{if(!b)return i(null!==t.stateNode,"We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."),null;var N=f();if(v(t))p(t,T,N)&&g(t);else{var E=r(P,b,T,N,t);(function(e,t){for(var n=t.child;null!==n;){if(n.tag===kr||n.tag===xr)a(e,n.stateNode);else if(n.tag===Rr);else if(null!==n.child){n=n.child;continue}if(n===t)return;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n=n.sibling}})(E,t),u(E,P,b,T)&&g(t),t.stateNode=E}null!==t.ref&&y(t)}return null;case xr:var w=b;if(e&&null!=t.stateNode)e.memoizedProps!==w&&g(t);else{if("string"!=typeof w)return i(null!==t.stateNode,"We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."),null;var I=s(),_=f();v(t)?h(t)&&g(t):t.stateNode=o(w,I,_,t)}return null;case Sr:return m(e,t);case Nr:return t.tag=Sr,null;case Er:case wr:return null;case Rr:return g(t),d(t),null;case br:i(!1,"An indeterminate component should have become determinate before completing. This error is likely caused by a bug in React. Please file an issue.");default:i(!1,"Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.")}}}},Ur=null,Fr=null;function jr(e){return function(t){try{return e(t)}catch(e){}}}var Lr={injectInternals:function(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t.supportsFiber)return!0;try{var n=t.inject(e);Ur=jr(function(e){return t.onCommitFiberRoot(n,e)}),Fr=jr(function(e){return t.onCommitFiberUnmount(n,e)})}catch(e){}return!0},onCommitRoot:function(e){"function"==typeof Ur&&Ur(e)},onCommitUnmount:function(e){"function"==typeof Fr&&Fr(e)}},Or=le,zr=se,Wr=fe,Mr=de,Yr=ce,Br=pe,Qr=Ie.commitCallbacks,Xr=Lr.onCommitUnmount,Gr=X,Vr=G,$r=J,qr=q,Jr=function(e,t){var n=e.commitMount,r=e.commitUpdate,o=e.resetTextContent,a=e.commitTextUpdate,u=e.appendChild,l=e.appendChildToContainer,s=e.insertBefore,c=e.insertInContainerBefore,f=e.removeChild,d=e.removeChildFromContainer,p=e.getPublicInstance;function h(e){var n=e.ref;if(null!==n)try{n(null)}catch(n){t(e,n)}}function v(e){return e.tag===Wr||e.tag===zr||e.tag===Yr}function g(e){for(var t=e;;)if(m(t),null===t.child||t.tag===Yr){if(t===e)return;for(;null===t.sibling;){if(null===t.return||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}else t.child.return=t,t=t.child}function y(e){for(var t=e,n=!1,r=void 0,o=void 0;;){if(!n){var a=t.return;e:for(;;){switch(i(null!==a,"Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue."),a.tag){case Wr:r=a.stateNode,o=!1;break e;case zr:case Yr:r=a.stateNode.containerInfo,o=!0;break e}a=a.return}n=!0}if(t.tag===Wr||t.tag===Mr)g(t),o?d(r,t.stateNode):f(r,t.stateNode);else if(t.tag===Yr){if(r=t.stateNode.containerInfo,null!==t.child){t.child.return=t,t=t.child;continue}}else if(m(t),null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)return;for(;null===t.sibling;){if(null===t.return||t.return===e)return;(t=t.return).tag===Yr&&(n=!1)}t.sibling.return=t.return,t=t.sibling}}function m(e){switch("function"==typeof Xr&&Xr(e),e.tag){case Or:h(e);var n=e.stateNode;return void("function"==typeof n.componentWillUnmount&&(function(e,n){try{n.props=e.memoizedProps,n.state=e.memoizedState,n.componentWillUnmount()}catch(n){t(e,n)}})(e,n));case Wr:return void h(e);case Br:return void g(e.stateNode);case Yr:return void y(e)}}return{commitPlacement:function(e){var t=(function(e){for(var t=e.return;null!==t;){if(v(t))return t;t=t.return}i(!1,"Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.")})(e),n=void 0,r=void 0;switch(t.tag){case Wr:n=t.stateNode,r=!1;break;case zr:case Yr:n=t.stateNode.containerInfo,r=!0;break;default:i(!1,"Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}t.effectTag&qr&&(o(n),t.effectTag&=~qr);for(var a=(function(e){var t=e;e:for(;;){for(;null===t.sibling;){if(null===t.return||v(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==Wr&&t.tag!==Mr;){if(t.effectTag&Gr)continue e;if(null===t.child||t.tag===Yr)continue e;t.child.return=t,t=t.child}if(!(t.effectTag&Gr))return t.stateNode}})(e),f=e;;){if(f.tag===Wr||f.tag===Mr)a?r?c(n,f.stateNode,a):s(n,f.stateNode,a):r?l(n,f.stateNode):u(n,f.stateNode);else if(f.tag===Yr);else if(null!==f.child){f.child.return=f,f=f.child;continue}if(f===e)return;for(;null===f.sibling;){if(null===f.return||f.return===e)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},commitDeletion:function(e){y(e),e.return=null,e.child=null,e.alternate&&(e.alternate.child=null,e.alternate.return=null)},commitWork:function(e,t){switch(t.tag){case Or:return;case Wr:var n=t.stateNode;if(null!=n){var o=t.memoizedProps,u=null!==e?e.memoizedProps:o,l=t.type,s=t.updateQueue;t.updateQueue=null,null!==s&&r(n,s,l,u,o,t)}return;case Mr:i(null!==t.stateNode,"This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");var c=t.stateNode,f=t.memoizedProps,d=null!==e?e.memoizedProps:f;return void a(c,d,f);case zr:case Yr:return;default:i(!1,"This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}},commitLifeCycles:function(e,t){switch(t.tag){case Or:var r=t.stateNode;if(t.effectTag&Vr)if(null===e)r.props=t.memoizedProps,r.state=t.memoizedState,r.componentDidMount();else{var o=e.memoizedProps,a=e.memoizedState;r.props=t.memoizedProps,r.state=t.memoizedState,r.componentDidUpdate(o,a)}return void(t.effectTag&$r&&null!==t.updateQueue&&Qr(t,t.updateQueue,r));case zr:var u=t.updateQueue;if(null!==u){var l=t.child&&t.child.stateNode;Qr(t,u,l)}return;case Wr:var s=t.stateNode;if(null===e&&t.effectTag&Vr){var c=t.type,f=t.memoizedProps;n(s,c,f,t)}return;case Mr:case Yr:return;default:i(!1,"This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}},commitAttachRef:function(e){var t=e.ref;if(null!==t){var n=e.stateNode;switch(e.tag){case Wr:t(p(n));break;default:t(n)}}},commitDetachRef:function(e){var t=e.ref;null!==t&&t(null)}}},Kr=Je,Zr=Ke,ei=Ze,ti={},ni=fe,ri=de,ii=se,oi=$,ai=X,ui=Ht,li=pt.popContextProvider,si=et,ci=Vt,fi=m.logCapturedError,di=He.ReactCurrentOwner,pi=wt,hi=jt,vi=Lr.onCommitRoot,gi=ee,yi=te,mi=ne,bi=re,Ci=ie,Ti=oe,Pi=ht,ki=Q,xi=X,Ri=G,Si=V,Ni=$,Ei=q,wi=J,Ii=K,_i=Z,Ai=se,Hi=fe,Di=ce,Ui=le,Fi=Ie.getUpdatePriority,ji=pt.resetContext,Li=1,Oi=function(e){var t=(function(e){var t=e.getChildHostContext,n=e.getRootHostContext,r=Kr(ti),o=Kr(ti),a=Kr(ti);function u(e){return i(e!==ti,"Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),e}return{getHostContext:function(){return u(r.current)},getRootHostContainer:function(){return u(a.current)},popHostContainer:function(e){Zr(r,e),Zr(o,e),Zr(a,e)},popHostContext:function(e){o.current===e&&(Zr(r,e),Zr(o,e))},pushHostContainer:function(e,t){ei(a,t,e);var i=n(t);ei(o,e,e),ei(r,i,e)},pushHostContext:function(e){var n=u(a.current),i=u(r.current),l=t(i,e.type,n);i!==l&&(ei(o,e,e),ei(r,l,e))},resetHostContainer:function(){r.current=ti,a.current=ti}}})(e),n=(function(e){var t=e.shouldSetTextContent,n=e.canHydrateInstance,r=e.canHydrateTextInstance,o=e.getNextHydratableSibling,a=e.getFirstHydratableChild,u=e.hydrateInstance,l=e.hydrateTextInstance,s=e.didNotHydrateInstance,c=e.didNotFindHydratableInstance,f=e.didNotFindHydratableTextInstance;if(!(n&&r&&o&&a&&u&&l&&s&&c&&f))return{enterHydrationState:function(){return!1},resetHydrationState:function(){},tryToClaimNextHydratableInstance:function(){},prepareToHydrateHostInstance:function(){i(!1,"Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.")},prepareToHydrateHostTextInstance:function(){i(!1,"Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.")},popHydrationState:function(e){return!1}};var d=null,p=null,h=!1;function v(e,t){var n=ui();n.stateNode=t,n.return=e,n.effectTag=oi,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function g(e,t){t.effectTag|=ai}function y(e,t){switch(e.tag){case ni:var i=e.type,o=e.pendingProps;return n(t,i,o);case ri:var a=e.pendingProps;return r(t,a);default:return!1}}function m(e){for(var t=e.return;null!==t&&t.tag!==ni&&t.tag!==ii;)t=t.return;d=t}return{enterHydrationState:function(e){var t=e.stateNode.containerInfo;return p=a(t),d=e,h=!0,!0},resetHydrationState:function(){d=null,p=null,h=!1},tryToClaimNextHydratableInstance:function(e){if(h){var t=p;if(!t)return g(0,e),h=!1,void(d=e);if(!y(e,t)){if(!(t=o(t))||!y(e,t))return g(0,e),h=!1,void(d=e);v(d,p)}e.stateNode=t,d=e,p=a(t)}},prepareToHydrateHostInstance:function(e,t,n){var r=e.stateNode,i=u(r,e.type,e.memoizedProps,t,n,e);return e.updateQueue=i,null!==i},prepareToHydrateHostTextInstance:function(e){var t=e.stateNode;return l(t,e.memoizedProps,e)},popHydrationState:function(e){if(e!==d)return!1;if(!h)return m(e),h=!0,!1;var n=e.type;if(e.tag!==ni||"head"!==n&&"body"!==n&&!t(n,e.memoizedProps))for(var r=p;r;)v(e,r),r=o(r);return m(e),p=d?o(e.stateNode):null,!0}}})(e),r=t.popHostContainer,o=t.popHostContext,a=t.resetHostContainer,u=vr(e,t,n,ae,le),l=u.beginWork,s=u.beginFailedWork,c=Dr(e,t,n).completeWork,f=Jr(e,re),d=f.commitPlacement,p=f.commitDeletion,h=f.commitWork,v=f.commitLifeCycles,g=f.commitAttachRef,y=f.commitDetachRef,m=e.scheduleDeferredCallback,b=e.useSyncScheduling,C=e.prepareForCommit,T=e.resetAfterCommit,P=gi,k=!1,x=!1,R=!1,S=!1,N=null,E=gi,w=null,I=null,_=null,A=null,H=!1,D=null,U=null,F=null,j=null,L=!1,O=!1,z=!1,W=1e3,M=0,Y=null;function B(){for(;null!==_&&_.current.pendingWorkPriority===gi;){_.isScheduled=!1;var e=_.nextScheduledRoot;if(_.nextScheduledRoot=null,_===A)return _=null,A=null,E=gi,null;_=e}for(var t=_,n=null,r=gi;null!==t;)t.current.pendingWorkPriority!==gi&&(r===gi||r>t.current.pendingWorkPriority)&&(r=t.current.pendingWorkPriority,n=t),t=t.nextScheduledRoot;if(null!==n)return E=r,si(),ji(),a(),N=pi(n.current,r),void(n!==Y&&(M=0,Y=n));E=gi,N=null,Y=null}function Q(){for(;null!==w;){var t=w.effectTag;if(t&Ei&&e.resetTextContent(w.stateNode),t&_i){var n=w.alternate;null!==n&&y(n)}switch(t&~(wi|Ii|Ei|_i|ki)){case xi:d(w),w.effectTag&=~xi;break;case Si:d(w),w.effectTag&=~xi;var r=w.alternate;h(r,w);break;case Ri:var i=w.alternate;h(i,w);break;case Ni:z=!0,p(w),z=!1}w=w.nextEffect}}function X(){for(;null!==w;){var e=w.effectTag;if(e&(Ri|wi)){var t=w.alternate;v(t,w)}e&_i&&g(w),e&Ii&&oe(w);var n=w.nextEffect;w.nextEffect=null,w=n}}function G(e){O=!0,I=null;var t=e.stateNode;i(t.current!==e,"Cannot commit the same tree as before. This is probably a bug related to the return field. This error is likely caused by a bug in React. Please file an issue."),E!==yi&&E!==mi||M++,di.current=null;var n=void 0;for(e.effectTag>ki?null!==e.lastEffect?(e.lastEffect.nextEffect=e,n=e.firstEffect):n=e:n=e.firstEffect,C(),w=n;null!==w;){var r=!1,o=void 0;try{Q()}catch(e){r=!0,o=e}r&&(i(null!==w,"Should have next effect. This error is likely caused by a bug in React. Please file an issue."),re(w,o),null!==w&&(w=w.nextEffect))}for(T(),t.current=e,w=n;null!==w;){var a=!1,u=void 0;try{X()}catch(e){a=!0,u=e}a&&(i(null!==w,"Should have next effect. This error is likely caused by a bug in React. Please file an issue."),re(w,u),null!==w&&(w=w.nextEffect))}O=!1,"function"==typeof vi&&vi(e.stateNode),F&&(F.forEach(se),F=null),B()}function V(e,t){if(!(e.pendingWorkPriority!==gi&&e.pendingWorkPriority>t)){for(var n=Fi(e),r=e.child;null!==r;)n=hi(n,r.pendingWorkPriority),r=r.sibling;e.pendingWorkPriority=n}}function $(e){for(;;){var t=e.alternate,n=c(t,e,E),r=e.return,i=e.sibling;if(V(e,E),null!==n)return n;if(null!==r&&(null===r.firstEffect&&(r.firstEffect=e.firstEffect),null!==e.lastEffect&&(null!==r.lastEffect&&(r.lastEffect.nextEffect=e.firstEffect),r.lastEffect=e.lastEffect),e.effectTag>ki&&(null!==r.lastEffect?r.lastEffect.nextEffect=e:r.firstEffect=e,r.lastEffect=e)),null!==i)return i;if(null===r)return I=e,null;e=r}return null}function q(e){var t=e.alternate,n=l(t,e,E);return null===n&&(n=$(e)),di.current=null,n}function J(e){var t=e.alternate,n=s(t,e,E);return null===n&&(n=$(e)),di.current=null,n}function K(e){ne(Ti,e)}function Z(){if(null!==D&&D.size>0&&E===mi)for(;null!==N&&(null!==(e=N,N=null!==D&&(D.has(e)||null!==e.alternate&&D.has(e.alternate))?J(N):q(N))||(i(null!==I,"Should have a pending commit. This error is likely caused by a bug in React. Please file an issue."),P=mi,G(I),P=E,null!==D&&0!==D.size&&E===mi)););var e}function ee(e,t){if(null!==I?(P=mi,G(I),Z()):null===N&&B(),!(E===gi||E>e)){P=E;e:for(;;){if(E<=mi)for(;null!==N&&!(null===(N=q(N))&&(i(null!==I,"Should have a pending commit. This error is likely caused by a bug in React. Please file an issue."),P=mi,G(I),P=E,Z(),E===gi||E>e||E>mi)););else if(null!==t)for(;null!==N&&!x;)if(t.timeRemaining()>Li){if(null===(N=q(N)))if(i(null!==I,"Should have a pending commit. This error is likely caused by a bug in React. Please file an issue."),t.timeRemaining()>Li){if(P=mi,G(I),P=E,Z(),E===gi||E>e||Emi&&!H&&(m(K),H=!0);var l=j;if(k=!1,x=!1,L=!1,j=null,D=null,U=null,Y=null,M=0,null!==l)throw l}function re(e,t){di.current=null;var n=null,r=!1,i=!1,o=null;if(e.tag===Ai)n=e,ie(e)&&(L=!0);else for(var a=e.return;null!==a&&null===n;){if(a.tag===Ui){"function"==typeof a.stateNode.componentDidCatch&&(r=!0,o=_e(a),n=a,i=!0)}else a.tag===Ai&&(n=a);if(ie(a)){if(z)return null;if(null!==F&&(F.has(a)||null!==a.alternate&&F.has(a.alternate)))return null;n=null,i=!1}a=a.return}if(null!==n){null===U&&(U=new Set),U.add(n);var u=ci(e),l=_e(e);null===D&&(D=new Map);var s={componentName:l,componentStack:u,error:t,errorBoundary:r?n.stateNode:null,errorBoundaryFound:r,errorBoundaryName:o,willRetry:i};D.set(n,s);try{fi(s)}catch(e){console.error(e)}return O?(null===F&&(F=new Set),F.add(n)):se(n),n}return null===j&&(j=t),null}function ie(e){return null!==U&&(U.has(e)||null!==e.alternate&&U.has(e.alternate))}function oe(e){var t=void 0;switch(null!==D&&(t=D.get(e),D.delete(e),null==t&&null!==e.alternate&&(e=e.alternate,t=D.get(e),D.delete(e))),i(null!=t,"No error for given unit of work. This error is likely caused by a bug in React. Please file an issue."),e.tag){case Ui:var n=e.stateNode,r={componentStack:t.componentStack};return void n.componentDidCatch(t.error,r);case Ai:return void(null===j&&(j=t.error));default:i(!1,"Invalid type of work. This error is likely caused by a bug in React. Please file an issue.")}}function ae(e,t){return ue(e,t,!1)}function ue(e,t,n){M>W&&(L=!0,i(!1,"Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.")),!k&&t<=E&&(N=null);for(var r=e,o=!0;null!==r&&o;){if(o=!1,(r.pendingWorkPriority===gi||r.pendingWorkPriority>t)&&(o=!0,r.pendingWorkPriority=t),null!==r.alternate&&(r.alternate.pendingWorkPriority===gi||r.alternate.pendingWorkPriority>t)&&(o=!0,r.alternate.pendingWorkPriority=t),null===r.return){if(r.tag!==Ai)return;if(a=r.stateNode,t!==gi&&(a.isScheduled||(a.isScheduled=!0,A?(A.nextScheduledRoot=a,A=a):(_=a,A=a))),!k)switch(t){case yi:ne(S?yi:mi,null);break;case mi:i(R,"Task updates can only be scheduled as a nested update or inside batchedUpdates.");break;default:H||(m(K),H=!0)}}r=r.return}var a}function le(e,t){var n=P;return n===gi&&(n=!b||e.internalContextTag&Pi||t?Ci:yi),n===yi&&(k||R)?mi:n}function se(e){ue(e,mi)}return{scheduleUpdate:ae,getPriorityContext:le,batchedUpdates:function(e,t){var n=R;R=!0;try{return e(t)}finally{R=n,k||R||ne(mi,null)}},unbatchedUpdates:function(e){var t=S,n=R;S=R,R=!1;try{return e()}finally{R=n,S=t}},flushSync:function(e){var t=R,n=P;R=!0,P=yi;try{return e()}finally{R=t,P=n,i(!k,"flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering."),ne(mi,null)}},deferredUpdates:function(e){var t=P;P=Ci;try{return e()}finally{P=t}}}},zi=Ie.addTopLevelUpdate,Wi=pt.findCurrentUnmaskedContext,Mi=pt.isContextProvider,Yi=pt.processChildContext,Bi=Ot,Qi=fe,Xi=Ge,Gi=Ve;var Vi={},$i=1,qi={},Ji=(function(){function e(){!(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e)}return e.register=function(e){var t=++$i;return Vi[t]=e,t},e.getByID=function(e){if(!e)return qi;return Vi[e]||(console.warn("Invalid style with id `"+e+"`. Skipping ..."),qi)},e})(),Ki={},Zi=null,eo=0;function to(e,t){return"object"!=typeof t||null===t||s(e,t)}function no(e){return"number"==typeof e?Ji.getByID(e):e}function ro(e,t,n){if(Array.isArray(t))for(var r=t.length;r--&&eo>0;)ro(e,t[r],n);else if(t&&eo>0){var i=no(t);for(var o in Zi)if(Zi[o]){var a=i[o];if(void 0!==a){var u=n[o];if(u){if("function"==typeof a&&(a=!0),void 0===a&&(a=null),"object"!=typeof u)e[o]=a;else if("function"==typeof u.diff||"function"==typeof u.process){var l="function"==typeof u.process?u.process(a):a;e[o]=l}Zi[o]=!1,eo--}}}}}function io(e,t,n,r){return e||t!==n?t&&n?Array.isArray(t)||Array.isArray(n)?Array.isArray(t)&&Array.isArray(n)?(function(e,t,n,r){var i,o=t.length0&&e&&(ro(e,o,i),Zi=null);for(u in t)void 0===n[u]&&(i=r[u])&&(e&&void 0!==e[u]||void 0!==(a=t[u])&&("object"!=typeof i||"function"==typeof i.diff||"function"==typeof i.process?((e||(e={}))[u]=null,Zi||(Zi={}),Zi[u]||(Zi[u]=!0,eo++)):e=ao(e,a,i)));return e}function lo(e,t,n){return uo(e,Ki,t,n)}var so={create:function(e,t){return lo(null,e,t)},diff:function(e,t,n){return uo(null,e,t,n)}};var co=function(e,t){return function(){if(t){if("boolean"==typeof e.__isMounted){if(!e.__isMounted)return}else if("function"==typeof e.isMounted&&!e.isMounted())return;return t.apply(e,arguments)}}};var fo=co,po=(function(){function e(t,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this._nativeTag=t,this._children=[],this.viewConfig=n}return e.prototype.blur=function(){f.blurTextInput(this._nativeTag)},e.prototype.focus=function(){f.focusTextInput(this._nativeTag)},e.prototype.measure=function(e){d.measure(this._nativeTag,fo(this,e))},e.prototype.measureInWindow=function(e){d.measureInWindow(this._nativeTag,fo(this,e))},e.prototype.measureLayout=function(e,t,n){d.measureLayout(this._nativeTag,e,fo(this,n),fo(this,t))},e.prototype.setNativeProps=function(e){var t=so.create(e,this.viewConfig.validAttributes);null!=t&&d.updateView(this._nativeTag,this.viewConfig.uiViewClassName,t)},e})(),ho={tagsStartAt:1,tagCount:1,allocateTag:function(){for(;this.reactTagIsNativeTopRootID(ho.tagCount);)ho.tagCount++;var e=ho.tagCount;return ho.tagCount++,e},assertRootTag:function(e){i(this.reactTagIsNativeTopRootID(e),"Expect a native root tag, instead got %s",e)},reactTagIsNativeTopRootID:function(e){return e%10==1}},vo=ho,go=new Map,yo=new Map,mo={register:function(e,t){return i(!go.has(e),"Tried to register two views with the same name %s",e),go.set(e,t),e},get:function(e){var t=void 0;if(yo.has(e))t=yo.get(e);else{var n=go.get(e);i("function"==typeof n,"View config not found for name %s",e),go.set(e,null),t=n(),yo.set(e,t)}return i(t,"View config not found for name %s",e),t}},bo=W.precacheFiberNode,Co=W.uncacheFiberNode,To=W.updateFiberProps;function Po(e){"number"==typeof e?Co(e):(Co(e._nativeTag),e._children.forEach(Po))}var ko=(function(e){var t=e.getPublicInstance,n=Oi(e),r=n.scheduleUpdate,i=n.getPriorityContext,o=n.batchedUpdates,u=n.unbatchedUpdates,l=n.flushSync;return{createContainer:function(e){return Bi(e)},updateContainer:function(e,t,n,o){var u=t.current,l=(function(e){if(!e)return a;var t=Ae.get(e),n=Wi(t);return Mi(t)?Yi(t,n):n})(n);null===t.context?t.context=l:t.pendingContext=l,(function(e,t,n){var o=Y.enableAsyncSubtreeAPI&&null!=t&&null!=t.type&&null!=t.type.prototype&&!0===t.type.prototype.unstable_isAsyncReactComponent,a=i(e,o);zi(e,{element:t},n=void 0===n?null:n,a),r(e,a)})(u,e,o)},batchedUpdates:o,unbatchedUpdates:u,deferredUpdates:n.deferredUpdates,flushSync:l,getPublicRootInstance:function(e){var n=e.current;if(!n.child)return null;switch(n.child.tag){case Qi:return t(n.child.stateNode);default:return n.child.stateNode}},findHostInstance:function(e){var t=Xi(e);return null===t?null:t.stateNode},findHostInstanceWithNoPortals:function(e){var t=Gi(e);return null===t?null:t.stateNode}}})({appendChild:function(e,t){var n="number"==typeof t?t:t._nativeTag,r=e._children,i=r.indexOf(t);i>=0?(r.splice(i,1),r.push(t),d.manageChildren(e._nativeTag,[i],[r.length-1],[],[],[])):(r.push(t),d.manageChildren(e._nativeTag,[],[],[n],[r.length-1],[]))},appendChildToContainer:function(e,t){var n="number"==typeof t?t:t._nativeTag;d.setChildren(e,[n])},appendInitialChild:function(e,t){e._children.push(t)},commitTextUpdate:function(e,t,n){d.updateView(e,"RCTRawText",{text:n})},commitMount:function(e,t,n,r){},commitUpdate:function(e,t,n,r,i,o){var a=e.viewConfig;To(e._nativeTag,i);var u=so.diff(r,i,a.validAttributes);null!=u&&d.updateView(e._nativeTag,a.uiViewClassName,u)},createInstance:function(e,t,n,r,i){var o=vo.allocateTag(),a=mo.get(e),u=so.create(t,a.validAttributes);d.createView(o,a.uiViewClassName,n,u);var l=new po(o,a);return bo(i,o),To(o,t),l},createTextInstance:function(e,t,n,r){var i=vo.allocateTag();return d.createView(i,"RCTRawText",t,{text:e}),bo(r,i),i},finalizeInitialChildren:function(e,t,n,r){if(0===e._children.length)return!1;var i=e._children.map(function(e){return"number"==typeof e?e:e._nativeTag});return d.setChildren(e._nativeTag,i),!1},getRootHostContext:function(){return a},getChildHostContext:function(){return a},getPublicInstance:function(e){return e},insertBefore:function(e,t,n){var r=e._children,i=r.indexOf(t);if(i>=0){r.splice(i,1);var o=r.indexOf(n);r.splice(o,0,t),d.manageChildren(e._nativeTag,[i],[o],[],[],[])}else{var a=r.indexOf(n);r.splice(a,0,t);var u="number"==typeof t?t:t._nativeTag;d.manageChildren(e._nativeTag,[],[],[u],[a],[])}},insertInContainerBefore:function(e,t,n){i("number"!=typeof e,"Container does not support insertBefore operation")},prepareForCommit:function(){},prepareUpdate:function(e,t,n,r,i,o){return a},removeChild:function(e,t){Po(t);var n=e._children,r=n.indexOf(t);n.splice(r,1),d.manageChildren(e._nativeTag,[],[],[],[],[r])},removeChildFromContainer:function(e,t){Po(t),d.manageChildren(e,[],[],[],[],[0])},resetAfterCommit:function(){},resetTextContent:function(e){},shouldDeprioritizeSubtree:function(e,t){return!1},scheduleDeferredCallback:M.requestIdleCallback,shouldSetTextContent:function(e,t){return!1},useSyncScheduling:!0}),xo={getInspectorDataForViewTag:function(){i(!1,"getInspectorDataForViewTag() is not available in production")}};var Ro=function(e){if(null==e)return null;if("number"==typeof e)return e;var t=e,n=Ae.get(t);return n?ko.findHostInstance(n):t||(i("object"==typeof t&&"_nativeTag"in t||null!=t.render&&"function"==typeof t.render,"findNodeHandle(...): Argument is not a component (type: %s, keys: %s)",typeof t,Object.keys(t)),void i(!1,"findNodeHandle(...): Unable to find node handle for unmounted component."))},So=function(e){var t=Ro(e);return null==t||"number"==typeof t?t:t._nativeTag},No=null,Eo={};function wo(){if(No)for(var e in Eo){var t=Eo[e],n=No.indexOf(e);if(i(n>-1,"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.",e),!Ao.plugins[n]){i(t.extractEvents,"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.",e),Ao.plugins[n]=t;var r=t.eventTypes;for(var o in r)i(Io(r[o],t,o),"EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.",o,e)}}}function Io(e,t,n){i(!Ao.eventNameDispatchConfigs.hasOwnProperty(n),"EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.",n),Ao.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var o in r)if(r.hasOwnProperty(o)){_o(r[o],t,n)}return!0}return!!e.registrationName&&(_o(e.registrationName,t,n),!0)}function _o(e,t,n){i(!Ao.registrationNameModules[e],"EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.",e),Ao.registrationNameModules[e]=t,Ao.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var Ao={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},possibleRegistrationNames:null,injectEventPluginOrder:function(e){i(!No,"EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React."),No=Array.prototype.slice.call(e),wo()},injectEventPluginsByName:function(e){var t=!1;for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];Eo.hasOwnProperty(n)&&Eo[n]===r||(i(!Eo[n],"EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.",n),Eo[n]=r,t=!0)}t&&wo()}},Ho=Ao;var Do=function(e,t){return i(null!=t,"accumulateInto(...): Accumulated items must not be null or undefined."),null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]};var Uo=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)},Fo=null,jo=function(e,t){e&&(R.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e))},Lo=function(e){return jo(e,!0)},Oo=function(e){return jo(e,!1)};var zo={injection:{injectEventPluginOrder:Ho.injectEventPluginOrder,injectEventPluginsByName:Ho.injectEventPluginsByName},getListener:function(e,t){var n,r=e.stateNode;if(!r)return null;var o=R.getFiberCurrentPropsFromNode(r);return o?(n=o[t],(function(e,t,n){switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":return!(!n.disabled||(r=t,"button"!==r&&"input"!==r&&"select"!==r&&"textarea"!==r));default:return!1}var r})(t,e.type,o)?null:(i(!n||"function"==typeof n,"Expected `%s` listener to be a function, instead got a value of `%s` type.",t,typeof n),n)):null},extractEvents:function(e,t,n,r){for(var i,o=Ho.plugins,a=0;a0;)e=Mo(e),n--;for(;i-n>0;)t=Mo(t),i--;for(var a=n;a--;){if(e===t||e===t.alternate)return e;e=Mo(e),t=Mo(t)}return null}var Bo={isAncestor:function(e,t){for(;t;){if(e===t||e===t.alternate)return!0;t=Mo(t)}return!1},getLowestCommonAncestor:Yo,getParentInstance:function(e){return Mo(e)},traverseTwoPhase:function(e,t,n){for(var r=[];e;)r.push(e),e=Mo(e);var i;for(i=r.length;i-- >0;)t(r[i],"captured",n);for(i=0;i0;)n(u[l],"captured",i)}},Qo=zo.getListener;function Xo(e,t,n){var r=(function(e,t,n){var r=t.dispatchConfig.phasedRegistrationNames[n];return Qo(e,r)})(e,n,t);r&&(n._dispatchListeners=Do(n._dispatchListeners,r),n._dispatchInstances=Do(n._dispatchInstances,e))}function Go(e){e&&e.dispatchConfig.phasedRegistrationNames&&Bo.traverseTwoPhase(e._targetInst,Xo,e)}function Vo(e){if(e&&e.dispatchConfig.phasedRegistrationNames){var t=e._targetInst,n=t?Bo.getParentInstance(t):null;Bo.traverseTwoPhase(n,Xo,e)}}function $o(e,t,n){if(e&&n&&n.dispatchConfig.registrationName){var r=n.dispatchConfig.registrationName,i=Qo(e,r);i&&(n._dispatchListeners=Do(n._dispatchListeners,i),n._dispatchInstances=Do(n._dispatchInstances,e))}}function qo(e){e&&e.dispatchConfig.registrationName&&$o(e._targetInst,0,e)}var Jo={accumulateTwoPhaseDispatches:function(e){Uo(e,Go)},accumulateTwoPhaseDispatchesSkipTarget:function(e){Uo(e,Vo)},accumulateDirectDispatches:function(e){Uo(e,qo)},accumulateEnterLeaveDispatches:function(e,t,n,r){Bo.traverseEnterLeave(n,r,$o,e,t)}},Ko=10,Zo=["dispatchConfig","_targetInst","nativeEvent","isDefaultPrevented","isPropagationStopped","_dispatchListeners","_dispatchInstances"],ea={type:null,target:null,currentTarget:h.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};function ta(e,t,n,r){this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n;var i=this.constructor.Interface;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];a?this[o]=a(n):"target"===o?this.target=r:this[o]=n[o]}var u=null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue;return this.isDefaultPrevented=u?h.thatReturnsTrue:h.thatReturnsFalse,this.isPropagationStopped=h.thatReturnsFalse,this}babelHelpers.extends(ta.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=h.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=h.thatReturnsTrue)},persist:function(){this.isPersistent=h.thatReturnsTrue},isPersistent:h.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;for(var n=0;nTa&&(e+=" (original size: "+Pa.length+")"),e}var _a={recordTouchTrack:function(e,t){if(ba(e))t.changedTouches.forEach(Na);else if(Ca(e))t.changedTouches.forEach(Sa),ka.numberActiveTouches=t.touches.length,1===ka.numberActiveTouches&&(ka.indexOfSingleActiveTouch=t.touches[0].identifier);else if(ma(e)&&(t.changedTouches.forEach(Ea),ka.numberActiveTouches=t.touches.length,1===ka.numberActiveTouches))for(var n=0;n=0))return console.error("Ended a touch event which was not counted in `trackedTouchCount`."),null;za-=1}_a.recordTouchTrack(e,n);var i,o,a,u=(i=e,o=t,a=n,o&&("topScroll"===i&&!a.responderIgnoreScroll||za>0&&"topSelectionChange"===i||Ha(i)||Da(i))?(function(e,t,n,r){var i=Ha(e)?Ya.startShouldSetResponder:Da(e)?Ya.moveShouldSetResponder:"topSelectionChange"===e?Ya.selectionChangeShouldSetResponder:Ya.scrollShouldSetResponder,o=Oa?Bo.getLowestCommonAncestor(Oa,t):t,a=o===Oa,u=ya.getPooled(i,o,n,r);u.touchHistory=_a.touchHistory,a?Jo.accumulateTwoPhaseDispatchesSkipTarget(u):Jo.accumulateTwoPhaseDispatches(u);var l=La(u);if(u.isPersistent()||u.constructor.release(u),!l||l===Oa)return null;var s,c=ya.getPooled(Ya.responderGrant,l,n,r);c.touchHistory=_a.touchHistory,Jo.accumulateDirectDispatches(c);var f=!0===Fa(c);if(Oa){var d=ya.getPooled(Ya.responderTerminationRequest,Oa,n,r);d.touchHistory=_a.touchHistory,Jo.accumulateDirectDispatches(d);var p=!ja(d)||Fa(d);if(d.isPersistent()||d.constructor.release(d),p){var h=ya.getPooled(Ya.responderTerminate,Oa,n,r);h.touchHistory=_a.touchHistory,Jo.accumulateDirectDispatches(h),s=Aa(s,[c,h]),Ma(l,f)}else{var v=ya.getPooled(Ya.responderReject,l,n,r);v.touchHistory=_a.touchHistory,Jo.accumulateDirectDispatches(v),s=Aa(s,v)}}else s=Aa(s,c),Ma(l,f);return s})(e,t,n,r):null),l=Oa&&Ha(e),s=Oa&&Da(e),c=Oa&&Ua(e),f=l?Ya.responderStart:s?Ya.responderMove:c?Ya.responderEnd:null;if(f){var d=ya.getPooled(f,Oa,n,r);d.touchHistory=_a.touchHistory,Jo.accumulateDirectDispatches(d),u=Aa(u,d)}var p=Oa&&"topTouchCancel"===e,h=Oa&&!p&&Ua(e)&&(function(e){var t=e.touches;if(!t||0===t.length)return!0;for(var n=0;nt&&(o+=r&&n?u.currentPageX:r&&!n?u.currentPageY:!r&&n?u.previousPageX:u.previousPageY,a=1);else for(var l=0;l=t){o+=r&&n?s.currentPageX:r&&!n?s.currentPageY:!r&&n?s.previousPageX:s.previousPageY,a++}}return a>0?o/a:qa.noCentroid},currentCentroidXOfTouchesChangedAfter:function(e,t){return qa.centroidDimension(e,t,!0,!0)},currentCentroidYOfTouchesChangedAfter:function(e,t){return qa.centroidDimension(e,t,!1,!0)},previousCentroidXOfTouchesChangedAfter:function(e,t){return qa.centroidDimension(e,t,!0,!1)},previousCentroidYOfTouchesChangedAfter:function(e,t){return qa.centroidDimension(e,t,!1,!1)},currentCentroidX:function(e){return qa.centroidDimension(e,0,!0,!0)},currentCentroidY:function(e){return qa.centroidDimension(e,0,!1,!0)},noCentroid:-1},Ja=qa,Ka=function(e,t){return mo.register(e,t)};var Za=function(e,t){return"number"!=typeof e&&"window"!==e&&(e=So(e)||"window"),d.__takeSnapshot(e,t)},eu=Lr.injectInternals;D.injection.injectFiberBatchedUpdates(ko.batchedUpdates);var tu=new Map;m.injection.injectDialog(U.showDialog);var nu={NativeComponent:Ga,findNodeHandle:So,render:function(e,t,n){var r=tu.get(t);return r||(r=ko.createContainer(t),tu.set(t,r)),ko.updateContainer(e,r,null,n),ko.getPublicRootInstance(r)},unmountComponentAtNode:function(e){var t=tu.get(e);t&&ko.updateContainer(null,t,null,function(){tu.delete(e)})},unmountComponentAtNodeAndRemoveContainer:function(e){nu.unmountComponentAtNode(e),d.removeRootView(e)},createPortal:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return j.createPortal(e,t,null,n)},unstable_batchedUpdates:D.batchedUpdates,flushSync:ko.flushSync,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{NativeMethodsMixin:$a,ReactNativeBridgeEventPlugin:sa,ReactGlobalSharedState:He,ReactNativeComponentTree:W,ReactNativePropRegistry:Ji,TouchHistoryMath:Ja,createReactNativeComponentClass:Ka,takeSnapshot:Za}};eu({findFiberByHostInstance:W.getClosestInstanceFromNode,findHostInstanceByFiber:ko.findHostInstance,getInspectorDataForViewTag:xo.getInspectorDataForViewTag,bundleType:0,version:"16.0.0",rendererPackageName:"react-native"});var ru=nu;n.exports=ru},55); -__d(function(r,o,e,n){'use strict';var s=0;function i(r,e){var n=o(26).ExceptionsManager;if(n){var i=o(57)(r),c=++s;e?n.reportFatalException(r.message,i,c):n.reportSoftException(r.message,i,c)}}function c(){if(console._errorOriginal.apply(console,arguments),console.reportErrorsAsExceptions)if(arguments[0]&&arguments[0].stack)i(arguments[0],!1);else{var r=o(32),e=Array.prototype.map.call(arguments,r).join(', ');if('"Warning: '===e.slice(0,10))return;var n=new Error('console.error: '+e);n.framesToPop=1,i(n,!1)}}e.exports={handleException:function(r,o){r.message||(r=new Error(r)),console._errorOriginal?console._errorOriginal(r.message):console.error(r.message),i(r,o)},installConsoleErrorReporter:function(){console._errorOriginal||(console._errorOriginal=console.error.bind(console),console.error=c,void 0===console.reportErrorsAsExceptions&&(console.reportErrorsAsExceptions=!0))}}},56); -__d(function(r,t,s,a){'use strict';s.exports=function(r){if(!r||!r.stack)return[];for(var s=t(58),a=Array.isArray(r.stack)?r.stack:s.parse(r.stack),e='number'==typeof r.framesToPop?r.framesToPop:0;e--;)a.shift();return a}},57); -__d(function(n,o,t,_){t.exports=o(59)},58); -__d(function(e,n,o,t){var l={parse:function(e){for(var n,o,t=/^\s*at (?:(?:(?:Anonymous function)?|((?:\[object object\])?\S+(?: \[as \S+\])?)) )?\(?((?:file|http|https):.*?):(\d+)(?::(\d+))?\)?\s*$/i,l=/^(?:\s*([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i,u=/^\s*at (?:((?:\[object object\])?\S+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i,i=e.split('\n'),s=[],c=0,m=i.length;c",lineNumber:+n[4],column:n[5]?+n[5]:null};else if(n=t.exec(i[c]))o={file:n[2],methodName:n[1]||"",lineNumber:+n[3],column:n[4]?+n[4]:null};else{if(!(n=u.exec(i[c])))continue;o={file:n[2],methodName:n[1]||"",lineNumber:+n[3],column:n[4]?+n[4]:null}}s.push(o)}return s}};o.exports=l},59); -__d(function(t,e,r,n){'use strict';var o=Object.prototype.hasOwnProperty;function u(t,e){return t===e?0!==t||0!==e||1/t==1/e:t!=t&&e!=e}r.exports=function(t,e){if(u(t,e))return!0;if('object'!=typeof t||null===t||'object'!=typeof e||null===e)return!1;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(var c=0;c=n?(this._iteratedObject=void 0,r(void 0,!0)):(this._nextIndex=i+1,"key"===a?r(i,!1):"value"===a?r(e[i],!1):"key+value"===a?r([i,e[i]],!1):void 0)}},{key:'@@iterator',value:function(){return this}}]),t})(),e=(function(){function t(e){if(babelHelpers.classCallCheck(this,t),'string'!=typeof e)throw new TypeError('Object is not a string');this._iteratedString=e,this._nextIndex=0}return babelHelpers.createClass(t,[{key:"next",value:function(){if(!this instanceof t)throw new TypeError('Object is not a StringIterator');if(null==this._iteratedString)return r(void 0,!0);var e=this._nextIndex,n=this._iteratedString,i=n.length;if(e>=i)return this._iteratedString=void 0,r(void 0,!0);var a,o=n.charCodeAt(e);if(o<55296||o>56319||e+1===i)a=n[e];else{var s=n.charCodeAt(e+1);a=s<56320||s>57343?n[e]:n[e]+n[e+1]}return this._nextIndex=e+a.length,r(a,!1)}},{key:'@@iterator',value:function(){return this}}]),t})();function r(t,e){return{value:t,done:e}}return function(r,n){return'string'==typeof r?new e(r):Array.isArray(r)?new t(r,n||"value"):r[i]()}})();babelHelpers.extends(a,{KIND_KEY:"key",KIND_VALUE:"value",KIND_KEY_VAL:"key+value",ITERATOR_SYMBOL:i}),r.exports=a},71); -__d(function(e,t,n,s){'use strict';var i=t(68),r=t(67),a=t(71);n.exports=(function(e){if(!r('Set'))return e.Set;var t=(function(){function e(t){if(babelHelpers.classCallCheck(this,e),null==this||'object'!=typeof this&&'function'!=typeof this)throw new TypeError('Wrong set object type.');if(n(this),null!=t)for(var s,i=a(t);!(s=i.next()).done;)this.add(s.value)}return babelHelpers.createClass(e,[{key:"add",value:function(e){return this._map.set(e,e),this.size=this._map.size,this}},{key:"clear",value:function(){n(this)}},{key:"delete",value:function(e){var t=this._map.delete(e);return this.size=this._map.size,t}},{key:"entries",value:function(){return this._map.entries()}},{key:"forEach",value:function(e){for(var t,n=arguments[1],s=this._map.keys();!(t=s.next()).done;)e.call(n,t.value,t.value,this)}},{key:"has",value:function(e){return this._map.has(e)}},{key:"values",value:function(){return this._map.values()}}]),e})();t.prototype[a.ITERATOR_SYMBOL]=t.prototype.values,t.prototype.keys=t.prototype.values;function n(e){e._map=new i,e.size=e._map.size}return t})(Function('return this')())},72); -__d(function(t,r,e,n){!(function(t){"use strict";var r,n=Object.prototype,o=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag",h="object"==typeof e,f=t.regeneratorRuntime;if(f)h&&(e.exports=f);else{(f=t.regeneratorRuntime=h?e.exports:{}).wrap=L;var s="suspendedStart",l="suspendedYield",p="executing",y="completed",v={},d={};d[a]=function(){return this};var g=Object.getPrototypeOf,m=g&&g(g(F([])));m&&m!==n&&o.call(m,a)&&(d=m);var w=_.prototype=E.prototype=Object.create(d);b.prototype=w.constructor=_,_.constructor=b,_[u]=b.displayName="GeneratorFunction",f.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===b||"GeneratorFunction"===(r.displayName||r.name))},f.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,u in t||(t[u]="GeneratorFunction")),t.prototype=Object.create(w),t},f.awrap=function(t){return{__await:t}},j(O.prototype),O.prototype[c]=function(){return this},f.AsyncIterator=O,f.async=function(t,r,e,n){var o=new O(L(t,r,e,n));return f.isGeneratorFunction(r)?o:o.next().then(function(t){return t.done?t.value:o.next()})},j(w),w[u]="Generator",w[a]=function(){return this},w.toString=function(){return"[object Generator]"},f.keys=function(t){var r=[];for(var e in t)r.push(e);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},f.values=F,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(N),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,o){return c.type="throw",c.arg=t,e.next=n,o&&(e.method="next",e.arg=r),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),h=o.call(a,"finallyLoc");if(u&&h){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),N(e),v}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;N(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:F(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),v}}}function L(t,r,e,n){var o=r&&r.prototype instanceof E?r:E,i=Object.create(o.prototype),a=new P(n||[]);return i._invoke=(function(t,r,e){var n=s;return function(o,i){if(n===p)throw new Error("Generator is already running");if(n===y){if("throw"===o)throw i;return S()}for(e.method=o,e.arg=i;;){var a=e.delegate;if(a){var c=k(a,e);if(c){if(c===v)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if(n===s)throw n=y,e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n=p;var u=x(t,r,e);if("normal"===u.type){if(n=e.done?y:l,u.arg===v)continue;return{value:u.arg,done:e.done}}"throw"===u.type&&(n=y,e.method="throw",e.arg=u.arg)}}})(t,e,a),i}function x(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}function E(){}function b(){}function _(){}function j(t){["next","throw","return"].forEach(function(r){t[r]=function(t){return this._invoke(r,t)}})}function O(t){var r;this._invoke=function(e,n){function i(){return new Promise(function(r,i){!(function r(e,n,i,a){var c=x(t[e],t,n);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==typeof h&&o.call(h,"__await")?Promise.resolve(h.__await).then(function(t){r("next",t,i,a)},function(t){r("throw",t,i,a)}):Promise.resolve(h).then(function(t){u.value=t,i(u)},a)}a(c.arg)})(e,n,r,i)})}return r=r?r.then(i,i):i()}}function k(t,e){var n=t.iterator[e.method];if(n===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=r,k(t,e),"throw"===e.method))return v;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=x(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,v;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,v):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,v)}function G(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function N(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(G,this),this.reset(!0)}function F(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n=0,loaded:t,total:s})}},{key:"__didCompleteResponse",value:function(e,t,r){e===this._requestId&&(t&&(''!==this._responseType&&'text'!==this._responseType||(this._response=t),this._hasError=!0,r&&(this._timedOut=!0)),this._clearSubscriptions(),this._requestId=null,this.setReadyState(this.DONE),t?s._interceptor&&s._interceptor.loadingFailed(e,t):s._interceptor&&s._interceptor.loadingFinished(e,this._response.length))}},{key:"_clearSubscriptions",value:function(){(this._subscriptions||[]).forEach(function(e){e&&e.remove()}),this._subscriptions=[]}},{key:"getAllResponseHeaders",value:function(){if(!this.responseHeaders)return null;var e=this.responseHeaders||{};return Object.keys(e).map(function(t){return t+': '+e[t]}).join('\r\n')}},{key:"getResponseHeader",value:function(e){var t=this._lowerCaseResponseHeaders[e.toLowerCase()];return void 0!==t?t:null}},{key:"setRequestHeader",value:function(e,t){if(this.readyState!==this.OPENED)throw new Error('Request has not been opened');this._headers[e.toLowerCase()]=String(t)}},{key:"setTrackingName",value:function(e){return this._trackingName=e,this}},{key:"open",value:function(e,t,s){if(this.readyState!==this.UNSENT)throw new Error('Cannot open, already sending');if(void 0!==s&&!s)throw new Error('Synchronous http requests are not supported');if(!t)throw new Error('Cannot load an empty url');this._method=e.toUpperCase(),this._url=t,this._aborted=!1,this.setReadyState(this.OPENED)}},{key:"send",value:function(e){var t=this;if(this.readyState!==this.OPENED)throw new Error('Request has not been opened');if(this._sent)throw new Error('Request has already been sent');this._sent=!0;var s=this._incrementalEvents||!!this.onreadystatechange||!!this.onprogress;this._subscriptions.push(n.addListener('didSendNetworkData',function(e){return t.__didUploadProgress.apply(t,babelHelpers.toConsumableArray(e))})),this._subscriptions.push(n.addListener('didReceiveNetworkResponse',function(e){return t.__didReceiveResponse.apply(t,babelHelpers.toConsumableArray(e))})),this._subscriptions.push(n.addListener('didReceiveNetworkData',function(e){return t.__didReceiveData.apply(t,babelHelpers.toConsumableArray(e))})),this._subscriptions.push(n.addListener('didReceiveNetworkIncrementalData',function(e){return t.__didReceiveIncrementalData.apply(t,babelHelpers.toConsumableArray(e))})),this._subscriptions.push(n.addListener('didReceiveNetworkDataProgress',function(e){return t.__didReceiveDataProgress.apply(t,babelHelpers.toConsumableArray(e))})),this._subscriptions.push(n.addListener('didCompleteNetworkResponse',function(e){return t.__didCompleteResponse.apply(t,babelHelpers.toConsumableArray(e))}));var r='text';'arraybuffer'!==this._responseType&&'blob'!==this._responseType||(r='base64'),a(this._method,'Request method needs to be defined.'),a(this._url,'Request URL needs to be defined.'),n.sendRequest(this._method,this._trackingName,this._url,this._headers,e,r,s,this.timeout,this.__didCreateRequest.bind(this),this.withCredentials)}},{key:"abort",value:function(){this._aborted=!0,this._requestId&&n.abortRequest(this._requestId),this.readyState===this.UNSENT||this.readyState===this.OPENED&&!this._sent||this.readyState===this.DONE||(this._reset(),this.setReadyState(this.DONE)),this._reset()}},{key:"setResponseHeaders",value:function(e){this.responseHeaders=e||null;var t=e||{};this._lowerCaseResponseHeaders=Object.keys(t).reduce(function(e,s){return e[s.toLowerCase()]=t[s],e},{})}},{key:"setReadyState",value:function(e){this.readyState=e,this.dispatchEvent({type:'readystatechange'}),e===this.DONE&&(this._aborted?this.dispatchEvent({type:'abort'}):this._hasError?this._timedOut?this.dispatchEvent({type:'timeout'}):this.dispatchEvent({type:'error'}):this.dispatchEvent({type:'load'}),this.dispatchEvent({type:'loadend'}))}},{key:"addEventListener",value:function(e,t){'readystatechange'!==e&&'progress'!==e||(this._incrementalEvents=!0),babelHelpers.get(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"addEventListener",this).call(this,e,t)}},{key:"responseType",get:function(){return this._responseType},set:function(e){if(this._sent)throw new Error("Failed to set the 'responseType' property on 'XMLHttpRequest': The response type cannot be set after the request has been sent.");c.hasOwnProperty(e)?(a(c[e]||'document'===e,"The provided value '"+e+"' is unsupported in this environment."),this._responseType=e):h(!1,"The provided value '"+e+"' is not a valid 'responseType'.")}},{key:"responseText",get:function(){if(''!==this._responseType&&'text'!==this._responseType)throw new Error("The 'responseText' property is only available if 'responseType' is set to '' or 'text', but it is '"+this._responseType+"'.");return this.readyState0){for(var t=Array(arguments.length),n=0;n0?u-4:u;var A=0;for(t=0;t>16&255,c[A++]=n>>8&255,c[A++]=255&n;2===o?(n=a[r.charCodeAt(t)]<<2|a[r.charCodeAt(t+1)]>>4,c[A++]=255&n):1===o&&(n=a[r.charCodeAt(t)]<<10|a[r.charCodeAt(t+1)]<<4|a[r.charCodeAt(t+2)]>>2,c[A++]=n>>8&255,c[A++]=255&n);return c},n.fromByteArray=function(r){for(var t,e=r.length,n=e%3,a='',h=[],c=0,u=e-n;cu?u:c+16383));1===n?(t=r[e-1],a+=o[t>>2],a+=o[t<<4&63],a+='=='):2===n&&(t=(r[e-2]<<8)+r[e-1],a+=o[t>>10],a+=o[t>>4&63],a+=o[t<<2&63],a+='=');return h.push(a),h.join('')};for(var o=[],a=[],h='undefined'!=typeof Uint8Array?Uint8Array:Array,c='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',u=0,A=c.length;u0)throw new Error('Invalid string. Length must be a multiple of 4');return'='===r[t-2]?2:'='===r[t-1]?1:0}function i(r,t,e){for(var n,a=[],h=t;h>18&63]+o[c>>12&63]+o[c>>6&63]+o[63&c]);var c;return a.join('')}},84); -__d(function(e,t,n,s){'use strict';var a=(function(){function e(){babelHelpers.classCallCheck(this,e),this._parts=[]}return babelHelpers.createClass(e,[{key:"append",value:function(e,t){this._parts.push([e,t])}},{key:"getParts",value:function(){return this._parts.map(function(e){var t=babelHelpers.slicedToArray(e,2),n=t[0],s=t[1],a={'content-disposition':'form-data; name="'+n+'"'};return'object'==typeof s&&s?('string'==typeof s.name&&(a['content-disposition']+='; filename="'+s.name+'"'),'string'==typeof s.type&&(a['content-type']=s.type),babelHelpers.extends({},s,{headers:a,fieldName:n})):{string:String(s),headers:a,fieldName:n}})}}]),e})();n.exports=a},85); -__d(function(e,t,s,r){'use strict';var u=t(87),a=babelHelpers.interopRequireDefault(u);a.default&&a.default.fetch?s.exports=a.default:s.exports={fetch:fetch,Headers:Headers,Request:Request,Response:Response}},86); -__d(function(t,e,r,o){!(function(t){'use strict';if(!t.fetch){var e={searchParams:'URLSearchParams'in t,iterable:'Symbol'in t&&'iterator'in Symbol,blob:'FileReader'in t&&'Blob'in t&&(function(){try{return new Blob,!0}catch(t){return!1}})(),formData:'FormData'in t,arrayBuffer:'ArrayBuffer'in t};if(e.arrayBuffer)var r=['[object Int8Array]','[object Uint8Array]','[object Uint8ClampedArray]','[object Int16Array]','[object Uint16Array]','[object Int32Array]','[object Uint32Array]','[object Float32Array]','[object Float64Array]'],o=function(t){return t&&DataView.prototype.isPrototypeOf(t)},n=ArrayBuffer.isView||function(t){return t&&r.indexOf(Object.prototype.toString.call(t))>-1};h.prototype.append=function(t,e){t=a(t),e=u(e);var r=this.map[t];r||(r=[],this.map[t]=r),r.push(e)},h.prototype.delete=function(t){delete this.map[a(t)]},h.prototype.get=function(t){var e=this.map[a(t)];return e?e[0]:null},h.prototype.getAll=function(t){return this.map[a(t)]||[]},h.prototype.has=function(t){return this.map.hasOwnProperty(a(t))},h.prototype.set=function(t,e){this.map[a(t)]=[u(e)]},h.prototype.forEach=function(t,e){Object.getOwnPropertyNames(this.map).forEach(function(r){this.map[r].forEach(function(o){t.call(e,o,r,this)},this)},this)},h.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),f(t)},h.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),f(t)},h.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),f(t)},e.iterable&&(h.prototype["function"==typeof Symbol?Symbol.iterator:"@@iterator"]=h.prototype.entries);var i=['DELETE','GET','HEAD','OPTIONS','POST','PUT'];b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},p.call(b.prototype),p.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},w.error=function(){var t=new w(null,{status:0,statusText:''});return t.type='error',t};var s=[301,302,303,307,308];w.redirect=function(t,e){if(-1===s.indexOf(e))throw new RangeError('Invalid status code');return new w(null,{status:e,headers:{location:t}})},t.Headers=h,t.Request=b,t.Response=w,t.fetch=function(t,r){return new Promise(function(o,n){var i=new b(t,r),s=new XMLHttpRequest;s.onload=function(){var t={status:s.status,statusText:s.statusText,headers:(function(t){var e=new h;return t.split('\r\n').forEach(function(t){var r=t.split(':'),o=r.shift().trim();if(o){var n=r.join(':').trim();e.append(o,n)}}),e})(s.getAllResponseHeaders()||'')};t.url='responseURL'in s?s.responseURL:t.headers.get('X-Request-URL');var e='response'in s?s.response:s.responseText;o(new w(e,t))},s.onerror=function(){n(new TypeError('Network request failed'))},s.ontimeout=function(){n(new TypeError('Network request failed'))},s.open(i.method,i.url,!0),'include'===i.credentials&&(s.withCredentials=!0),'responseType'in s&&e.blob&&(s.responseType='blob'),i.headers.forEach(function(t,e){s.setRequestHeader(e,t)}),s.send(void 0===i._bodyInit?null:i._bodyInit)})},t.fetch.polyfill=!0}function a(t){if('string'!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError('Invalid character in header field name');return t.toLowerCase()}function u(t){return'string'!=typeof t&&(t=String(t)),t}function f(t){var r={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return e.iterable&&(r["function"==typeof Symbol?Symbol.iterator:"@@iterator"]=function(){return r}),r}function h(t){this.map={},t instanceof h?t.forEach(function(t,e){this.append(e,t)},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function y(t){if(t.bodyUsed)return Promise.reject(new TypeError('Already read'));t.bodyUsed=!0}function d(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function c(t){var e=new FileReader,r=d(e);return e.readAsArrayBuffer(t),r}function l(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,t)if('string'==typeof t)this._bodyText=t;else if(e.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(e.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=t.toString();else if(e.arrayBuffer&&e.blob&&o(t))this._bodyArrayBuffer=l(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!e.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t)&&!n(t))throw new Error('unsupported BodyInit type');this._bodyArrayBuffer=l(t)}else this._bodyText='';this.headers.get('content-type')||('string'==typeof t?this.headers.set('content-type','text/plain;charset=UTF-8'):this._bodyBlob&&this._bodyBlob.type?this.headers.set('content-type',this._bodyBlob.type):e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set('content-type','application/x-www-form-urlencoded;charset=UTF-8'))},e.blob&&(this.blob=function(){var t=y(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error('could not read FormData body as blob');return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?y(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(c)}),this.text=function(){var t=y(this);if(t)return t;if(this._bodyBlob)return(function(t){var e=new FileReader,r=d(e);return e.readAsText(t),r})(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve((function(t){for(var e=new Uint8Array(t),r=new Array(e.length),o=0;o-1?e:t})(e.method||this.method||'GET'),this.mode=e.mode||this.mode||null,this.referrer=null,('GET'===this.method||'HEAD'===this.method)&&r)throw new TypeError('Body not allowed for GET or HEAD requests');this._initBody(r)}function m(t){var e=new FormData;return t.trim().split('&').forEach(function(t){if(t){var r=t.split('='),o=r.shift().replace(/\+/g,' '),n=r.join('=').replace(/\+/g,' ');e.append(decodeURIComponent(o),decodeURIComponent(n))}}),e}function w(t,e){e||(e={}),this.type='default',this.status='status'in e?e.status:200,this.ok=this.status>=200&&this.status<300,this.statusText='statusText'in e?e.statusText:'OK',this.headers=new h(e.headers),this.url=e.url||'',this._initBody(t)}})('undefined'!=typeof self?self:this)},87); -__d(function(e,t,s,i){'use strict';var r=t(89),o=t(75),n=t(81),a=t(26),c=(t(34),t(95)),d=t(84),l=t(83),u=t(22),b=a.WebSocketModule,h=0,p=1,y=2,f=3,_=0,v=(function(e){babelHelpers.inherits(t,e);function t(e,s,i){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));r.CONNECTING=h,r.OPEN=p,r.CLOSING=y,r.CLOSED=f,r.readyState=h,'string'==typeof s&&(s=[s]);var o=i||{},a=o.headers,c=void 0===a?{}:a,d=babelHelpers.objectWithoutProperties(o,["headers"]);if(d&&'string'==typeof d.origin&&(console.warn('Specifying `origin` as a WebSocket connection option is deprecated. Include it under `headers` instead.'),c.origin=d.origin,delete d.origin),Object.keys(d).length>0&&console.warn('Unrecognized WebSocket connection option(s) `'+Object.keys(d).join('`, `')+"`. Did you mean to put these under `headers`?"),Array.isArray(s)||(s=null),!t.isAvailable)throw new Error("Cannot initialize WebSocket module. Native module WebSocketModule is missing.");return r._eventEmitter=new n(b),r._socketId=_++,r._registerEvents(),b.connect(e,s,{headers:c},r._socketId),r}return babelHelpers.createClass(t,[{key:"close",value:function(e,t){this.readyState!==this.CLOSING&&this.readyState!==this.CLOSED&&(this.readyState=this.CLOSING,this._close(e,t))}},{key:"send",value:function(e){if(this.readyState===this.CONNECTING)throw new Error('INVALID_STATE_ERR');if(e instanceof r){var t=a.BlobModule;return u(t,'Native module BlobModule is required for blob support'),void t.sendBlob(e,this._socketId)}if('string'!=typeof e){if(!(e instanceof ArrayBuffer||ArrayBuffer.isView(e)))throw new Error('Unsupported data type');b.sendBinary(l(e),this._socketId)}else b.send(e,this._socketId)}},{key:"ping",value:function(){if(this.readyState===this.CONNECTING)throw new Error('INVALID_STATE_ERR');b.ping(this._socketId)}},{key:"_close",value:function(e,t){b.close(this._socketId)}},{key:"_unregisterEvents",value:function(){this._subscriptions.forEach(function(e){return e.remove()}),this._subscriptions=[]}},{key:"_registerEvents",value:function(){var e=this;this._subscriptions=[this._eventEmitter.addListener('websocketMessage',function(t){if(t.id===e._socketId){var s=t.data;switch(t.type){case'binary':s=d.toByteArray(t.data).buffer;break;case'blob':s=r.create(t.data)}e.dispatchEvent(new c('message',{data:s}))}}),this._eventEmitter.addListener('websocketOpen',function(t){t.id===e._socketId&&(e.readyState=e.OPEN,e.dispatchEvent(new c('open')))}),this._eventEmitter.addListener('websocketClosed',function(t){t.id===e._socketId&&(e.readyState=e.CLOSED,e.dispatchEvent(new c('close',{code:t.code,reason:t.reason})),e._unregisterEvents(),e.close())}),this._eventEmitter.addListener('websocketFailed',function(t){t.id===e._socketId&&(e.readyState=e.CLOSED,e.dispatchEvent(new c('error',{message:t.message})),e.dispatchEvent(new c('close',{message:t.message})),e._unregisterEvents(),e.close())})]}},{key:"binaryType",get:function(){return this._binaryType},set:function(e){if('blob'!==e&&'arraybuffer'!==e)throw new Error('binaryType must be either \'blob\' or \'arraybuffer\'');if('blob'===this._binaryType||'blob'===e){var t=a.BlobModule;u(t,'Native module BlobModule is required for blob support'),t&&('blob'===e?t.enableBlobSupport(this._socketId):t.disableBlobSupport(this._socketId))}this._binaryType=e}}]),t})(o.apply(void 0,['close','error','message','open']));v.CONNECTING=h,v.OPEN=p,v.CLOSING=y,v.CLOSED=f,v.isAvailable=!!b,s.exports=v},88); -__d(function(e,t,r,s){'use strict';var l=t(22),o=t(90),a=t(26).BlobModule,n=(function(){babelHelpers.createClass(e,null,[{key:"create",value:function(t){return babelHelpers.extends(Object.create(e.prototype),t)}}]);function e(t,r){babelHelpers.classCallCheck(this,e);var s=o(),n=0;return t.forEach(function(t){l(t instanceof e,'Can currently only create a Blob from other Blobs'),n+=t.size}),a.createFromParts(t,s),e.create({blobId:s,offset:0,size:n})}return babelHelpers.createClass(e,[{key:"slice",value:function(t,r){var s=this.offset,l=this.size;return'number'==typeof t&&(t>l&&(t=l),s+=t,l-=t,'number'==typeof r&&(r<0&&(r=this.size+r),l=r-t)),e.create({blobId:this.blobId,offset:s,size:l})}},{key:"close",value:function(){a.release(this.blobId)}}]),e})();r.exports=n},89); -__d(function(v,n,o,r){var t=n(91),_=n(94),a=_;a.v1=t,a.v4=_,o.exports=a},90); -__d(function(e,o,s,c){var r=o(92),n=o(93),i=r(),v=[1|i[0],i[1],i[2],i[3],i[4],i[5]],t=16383&(i[6]<<8|i[7]),a=0,d=0;s.exports=function(e,o,s){var c=o&&s||0,r=o||[],i=void 0!==(e=e||{}).clockseq?e.clockseq:t,u=void 0!==e.msecs?e.msecs:(new Date).getTime(),f=void 0!==e.nsecs?e.nsecs:d+1,m=u-a+(f-d)/1e4;if(m<0&&void 0===e.clockseq&&(i=i+1&16383),(m<0||u>a)&&void 0===e.nsecs&&(f=0),f>=1e4)throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');a=u,d=f,t=i;var k=(1e4*(268435455&(u+=122192928e5))+f)%4294967296;r[c++]=k>>>24&255,r[c++]=k>>>16&255,r[c++]=k>>>8&255,r[c++]=255&k;var l=u/4294967296*1e4&268435455;r[c++]=l>>>8&255,r[c++]=255&l,r[c++]=l>>>24&15|16,r[c++]=l>>>16&255,r[c++]=i>>>8|128,r[c++]=255&i;for(var q=e.node||v,w=0;w<6;++w)r[c+w]=q[w];return o||n(r)}},91); -__d(function(r,n,a,t){var o,e=r.crypto||r.msCrypto;if(e&&e.getRandomValues){var u=new Uint8Array(16);o=function(){return e.getRandomValues(u),u}}if(!o){var f=new Array(16);o=function(){for(var r,n=0;n<16;n++)0==(3&n)&&(r=4294967296*Math.random()),f[n]=r>>>((3&n)<<3)&255;return f}}a.exports=o},92); -__d(function(r,t,n,o){for(var u=[],f=0;f<256;++f)u[f]=(f+256).toString(16).substr(1);n.exports=function(r,t){var n=t||0,o=u;return o[r[n++]]+o[r[n++]]+o[r[n++]]+o[r[n++]]+'-'+o[r[n++]]+o[r[n++]]+'-'+o[r[n++]]+o[r[n++]]+'-'+o[r[n++]]+o[r[n++]]+'-'+o[r[n++]]+o[r[n++]]+o[r[n++]]+o[r[n++]]+o[r[n++]]+o[r[n++]]}},93); -__d(function(r,n,a,o){var t=n(92),f=n(93);a.exports=function(r,n,a){var o=n&&a||0;'string'==typeof r&&(n='binary'==r?new Array(16):null,r=null);var i=(r=r||{}).random||(r.rng||t)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,n)for(var u=0;u<16;++u)n[o+u]=i[u];return n||f(i)}},94); -__d(function(e,t,s,i){'use strict';s.exports=function e(t,s){babelHelpers.classCallCheck(this,e),this.type=t.toString(),babelHelpers.extends(this,s)}},95); -__d(function(e,t,r,o){'use strict';t(89);var n=t(26).BlobModule,l=null;n&&'string'==typeof n.BLOB_URI_SCHEME&&(l=n.BLOB_URI_SCHEME+':','string'==typeof n.BLOB_URI_HOST&&(l+="//"+n.BLOB_URI_HOST+"/"));var s=(function(){function e(){throw babelHelpers.classCallCheck(this,e),new Error('Creating BlobURL objects is not supported yet.')}return babelHelpers.createClass(e,null,[{key:"createObjectURL",value:function(e){if(null===l)throw new Error('Cannot create URL for blob!');return""+l+e.blobId+"?offset="+e.offset+"&size="+e.size}},{key:"revokeObjectURL",value:function(e){}}]),e})();r.exports=s},96); -__d(function(e,t,n,a){'use strict';var l=t(98),s=t(26),r=(t(34),(function(){function e(){babelHelpers.classCallCheck(this,e)}return babelHelpers.createClass(e,null,[{key:"alert",value:function(e,t,n,a,s){if(void 0!==s)return console.warn('Alert.alert() with a 5th "type" parameter is deprecated and will be removed. Use AlertIOS.prompt() instead.'),void l.alert(e,t,n,s);l.alert(e,t,n)}}]),e})());!(function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"alert",value:function(e,t,n,a){var l={title:e||'',message:t||''};a&&(l=babelHelpers.extends({},l,{cancelable:a.cancelable}));var r=n?n.slice(0,3):[{text:'OK'}],o=r.pop(),i=r.pop(),d=r.pop();d&&(l=babelHelpers.extends({},l,{buttonNeutral:d.text||''})),i&&(l=babelHelpers.extends({},l,{buttonNegative:i.text||''})),o&&(l=babelHelpers.extends({},l,{buttonPositive:o.text||''})),s.DialogManagerAndroid.showAlert(l,function(e){return console.warn(e)},function(e,t){e===s.DialogManagerAndroid.buttonClicked?t===s.DialogManagerAndroid.buttonNeutral?d.onPress&&d.onPress():t===s.DialogManagerAndroid.buttonNegative?i.onPress&&i.onPress():t===s.DialogManagerAndroid.buttonPositive&&o.onPress&&o.onPress():e===s.DialogManagerAndroid.dismissed&&a&&a.onDismiss&&a.onDismiss()})}}])})();n.exports=r},97); -__d(function(e,t,a,r){'use strict';var n=t(26).AlertManager,l=(function(){function e(){babelHelpers.classCallCheck(this,e)}return babelHelpers.createClass(e,null,[{key:"alert",value:function(e,t,a,r){if(void 0!==r)return console.warn('AlertIOS.alert() with a 4th "type" parameter is deprecated and will be removed. Use AlertIOS.prompt() instead.'),void this.prompt(e,t,a,r);this.prompt(e,t,a,'default')}},{key:"prompt",value:function(e,t,a){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:'plain-text',l=arguments[4],i=arguments[5];if('function'!=typeof r){var o,s,u=[],c=[];'function'==typeof a?u=[a]:a instanceof Array&&a.forEach(function(e,t){if(u[t]=e.onPress,'cancel'===e.style?o=String(t):'destructive'===e.style&&(s=String(t)),e.text||t<(a||[]).length-1){var r={};r[t]=e.text||'',c.push(r)}}),n.alertWithArgs({title:e||'',message:t||void 0,buttons:c,type:r||void 0,defaultValue:l,cancelButtonKey:o,destructiveButtonKey:s,keyboardType:i},function(e,t){var a=u[e];a&&a(t)})}else{console.warn("You passed a callback function as the \"type\" argument to AlertIOS.prompt(). React Native is assuming you want to use the deprecated AlertIOS.prompt(title, defaultValue, buttons, callback) signature. The current signature is AlertIOS.prompt(title, message, callbackOrButtons, type, defaultValue, keyboardType) and the old syntax will be removed in a future version.");var p=r;l=t;n.alertWithArgs({title:e||'',type:'plain-text',defaultValue:l},function(e,t){p(t)})}}}]),e})();a.exports=l},98); -__d(function(e,t,n,r){'use strict';var o=t(81),i=t(26).LocationObserver,s=t(22),a=t(100),u=t(38),c=new o(i),v=(t(34),t(101)),f=[],g=!1,l={setRNConfiguration:function(e){i.setConfiguration&&i.setConfiguration(e)},requestAuthorization:function(){i.requestAuthorization()},getCurrentPosition:function(e,t,n){var r,o;return regeneratorRuntime.async(function(u){for(;;)switch(u.prev=u.next){case 0:s('function'==typeof e,'Must provide a valid geo_success callback.'),r=!0,u.next=11;break;case 5:if(r=u.sent){u.next=11;break}return u.next=9,regeneratorRuntime.awrap(v.request(v.PERMISSIONS.ACCESS_FINE_LOCATION));case 9:o=u.sent,r=o===v.RESULTS.GRANTED;case 11:r&&i.getCurrentPosition(n||{},e,t||a);case 12:case"end":return u.stop()}},null,this)},watchPosition:function(e,t,n){g||(i.startObserving(n||{}),g=!0);var r=f.length;return f.push([c.addListener('geolocationDidChange',e),t?c.addListener('geolocationError',t):null]),r},clearWatch:function(e){var t=f[e];if(t){t[0].remove();var n=t[1];n&&n.remove(),f[e]=void 0;for(var r=!0,o=0;o1?e-1:0),a=1;a1?n-1:0),i=1;i3?c-3:0),u=3;u>>8)>>>0}},126); -__d(function(t,n,r,u){'use strict';n(128),n(34),n(22),n(32);r.exports=function(t){return t}},127); -__d(function(t,e,n,a){'use strict';var r=e(22),o={createIdentityMatrix:function(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},createCopy:function(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},createOrthographic:function(t,e,n,a,r,o){return[2/(e-t),0,0,0,0,2/(a-n),0,0,0,0,-2/(o-r),0,-(e+t)/(e-t),-(a+n)/(a-n),-(o+r)/(o-r),1]},createFrustum:function(t,e,n,a,r,o){var i=1/(e-t),u=1/(a-n),s=1/(r-o);return[r*i*2,0,0,0,0,r*u*2,0,0,(e+t)*i,(a+n)*u,(o+r)*s,-1,0,0,o*r*s*2,0]},createPerspective:function(t,e,n,a){var r=1/Math.tan(t/2),o=1/(n-a);return[r/e,0,0,0,0,r,0,0,0,0,(a+n)*o,-1,0,0,a*n*o*2,0]},createTranslate2d:function(t,e){var n=o.createIdentityMatrix();return o.reuseTranslate2dCommand(n,t,e),n},reuseTranslate2dCommand:function(t,e,n){t[12]=e,t[13]=n},reuseTranslate3dCommand:function(t,e,n,a){t[12]=e,t[13]=n,t[14]=a},createScale:function(t){var e=o.createIdentityMatrix();return o.reuseScaleCommand(e,t),e},reuseScaleCommand:function(t,e){t[0]=e,t[5]=e},reuseScale3dCommand:function(t,e,n,a){t[0]=e,t[5]=n,t[10]=a},reusePerspectiveCommand:function(t,e){t[11]=-1/e},reuseScaleXCommand:function(t,e){t[0]=e},reuseScaleYCommand:function(t,e){t[5]=e},reuseScaleZCommand:function(t,e){t[10]=e},reuseRotateXCommand:function(t,e){t[5]=Math.cos(e),t[6]=Math.sin(e),t[9]=-Math.sin(e),t[10]=Math.cos(e)},reuseRotateYCommand:function(t,e){t[0]=Math.cos(e),t[2]=-Math.sin(e),t[8]=Math.sin(e),t[10]=Math.cos(e)},reuseRotateZCommand:function(t,e){t[0]=Math.cos(e),t[1]=Math.sin(e),t[4]=-Math.sin(e),t[5]=Math.cos(e)},createRotateZ:function(t){var e=o.createIdentityMatrix();return o.reuseRotateZCommand(e,t),e},reuseSkewXCommand:function(t,e){t[4]=Math.tan(e)},reuseSkewYCommand:function(t,e){t[1]=Math.tan(e)},multiplyInto:function(t,e,n){var a=e[0],r=e[1],o=e[2],i=e[3],u=e[4],s=e[5],c=e[6],m=e[7],v=e[8],l=e[9],f=e[10],d=e[11],h=e[12],M=e[13],C=e[14],p=e[15],T=n[0],x=n[1],y=n[2],b=n[3];t[0]=T*a+x*u+y*v+b*h,t[1]=T*r+x*s+y*l+b*M,t[2]=T*o+x*c+y*f+b*C,t[3]=T*i+x*m+y*d+b*p,T=n[4],x=n[5],y=n[6],b=n[7],t[4]=T*a+x*u+y*v+b*h,t[5]=T*r+x*s+y*l+b*M,t[6]=T*o+x*c+y*f+b*C,t[7]=T*i+x*m+y*d+b*p,T=n[8],x=n[9],y=n[10],b=n[11],t[8]=T*a+x*u+y*v+b*h,t[9]=T*r+x*s+y*l+b*M,t[10]=T*o+x*c+y*f+b*C,t[11]=T*i+x*m+y*d+b*p,T=n[12],x=n[13],y=n[14],b=n[15],t[12]=T*a+x*u+y*v+b*h,t[13]=T*r+x*s+y*l+b*M,t[14]=T*o+x*c+y*f+b*C,t[15]=T*i+x*m+y*d+b*p},determinant:function(t){var e=babelHelpers.slicedToArray(t,16),n=e[0],a=e[1],r=e[2],o=e[3],i=e[4],u=e[5],s=e[6],c=e[7],m=e[8],v=e[9],l=e[10],f=e[11],d=e[12],h=e[13],M=e[14],C=e[15];return o*s*v*d-r*c*v*d-o*u*l*d+a*c*l*d+r*u*f*d-a*s*f*d-o*s*m*h+r*c*m*h+o*i*l*h-n*c*l*h-r*i*f*h+n*s*f*h+o*u*m*M-a*c*m*M-o*i*v*M+n*c*v*M+a*i*f*M-n*u*f*M-r*u*m*C+a*s*m*C+r*i*v*C-n*s*v*C-a*i*l*C+n*u*l*C},inverse:function(t){var e=o.determinant(t);if(!e)return t;var n=babelHelpers.slicedToArray(t,16),a=n[0],r=n[1],i=n[2],u=n[3],s=n[4],c=n[5],m=n[6],v=n[7],l=n[8],f=n[9],d=n[10],h=n[11],M=n[12],C=n[13],p=n[14],T=n[15];return[(m*h*C-v*d*C+v*f*p-c*h*p-m*f*T+c*d*T)/e,(u*d*C-i*h*C-u*f*p+r*h*p+i*f*T-r*d*T)/e,(i*v*C-u*m*C+u*c*p-r*v*p-i*c*T+r*m*T)/e,(u*m*f-i*v*f-u*c*d+r*v*d+i*c*h-r*m*h)/e,(v*d*M-m*h*M-v*l*p+s*h*p+m*l*T-s*d*T)/e,(i*h*M-u*d*M+u*l*p-a*h*p-i*l*T+a*d*T)/e,(u*m*M-i*v*M-u*s*p+a*v*p+i*s*T-a*m*T)/e,(i*v*l-u*m*l+u*s*d-a*v*d-i*s*h+a*m*h)/e,(c*h*M-v*f*M+v*l*C-s*h*C-c*l*T+s*f*T)/e,(u*f*M-r*h*M-u*l*C+a*h*C+r*l*T-a*f*T)/e,(r*v*M-u*c*M+u*s*C-a*v*C-r*s*T+a*c*T)/e,(u*c*l-r*v*l-u*s*f+a*v*f+r*s*h-a*c*h)/e,(m*f*M-c*d*M-m*l*C+s*d*C+c*l*p-s*f*p)/e,(r*d*M-i*f*M+i*l*C-a*d*C-r*l*p+a*f*p)/e,(i*c*M-r*m*M-i*s*C+a*m*C+r*s*p-a*c*p)/e,(r*m*l-i*c*l+i*s*f-a*m*f-r*s*d+a*c*d)/e]},transpose:function(t){return[t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15]]},multiplyVectorByMatrix:function(t,e){var n=babelHelpers.slicedToArray(t,4),a=n[0],r=n[1],o=n[2],i=n[3];return[a*e[0]+r*e[4]+o*e[8]+i*e[12],a*e[1]+r*e[5]+o*e[9]+i*e[13],a*e[2]+r*e[6]+o*e[10]+i*e[14],a*e[3]+r*e[7]+o*e[11]+i*e[15]]},v3Length:function(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])},v3Normalize:function(t,e){var n=1/(e||o.v3Length(t));return[t[0]*n,t[1]*n,t[2]*n]},v3Dot:function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},v3Combine:function(t,e,n,a){return[n*t[0]+a*e[0],n*t[1]+a*e[1],n*t[2]+a*e[2]]},v3Cross:function(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]},quaternionToDegreesXYZ:function(t,e,n){var a=babelHelpers.slicedToArray(t,4),r=a[0],i=a[1],u=a[2],s=a[3],c=r*r,m=i*i,v=u*u,l=r*i+u*s,f=s*s+c+m+v,d=180/Math.PI;return l>.49999*f?[0,2*Math.atan2(r,s)*d,90]:l<-.49999*f?[0,-2*Math.atan2(r,s)*d,-90]:[o.roundTo3Places(Math.atan2(2*r*s-2*i*u,1-2*c-2*v)*d),o.roundTo3Places(Math.atan2(2*i*s-2*r*u,1-2*m-2*v)*d),o.roundTo3Places(Math.asin(2*r*i+2*u*s)*d)]},roundTo3Places:function(t){var e=t.toString().split('e');return.001*Math.round(e[0]+'e'+(e[1]?+e[1]-3:3))},decomposeMatrix:function(t){r(16===t.length,'Matrix decomposition needs a list of 3d matrix values, received %s',t);var e=[],n=[],a=[],i=[],u=[];if(t[15]){for(var s=[],c=[],m=0;m<4;m++){s.push([]);for(var v=0;v<4;v++){var l=t[4*m+v]/t[15];s[m].push(l),c.push(3===v?0:l)}}if(c[15]=1,o.determinant(c)){if(0!==s[0][3]||0!==s[1][3]||0!==s[2][3]){var f=[s[0][3],s[1][3],s[2][3],s[3][3]],d=o.inverse(c),h=o.transpose(d);e=o.multiplyVectorByMatrix(f,h)}else e[0]=e[1]=e[2]=0,e[3]=1;for(m=0;m<3;m++)u[m]=s[3][m];var M=[];for(m=0;m<3;m++)M[m]=[s[m][0],s[m][1],s[m][2]];a[0]=o.v3Length(M[0]),M[0]=o.v3Normalize(M[0],a[0]),i[0]=o.v3Dot(M[0],M[1]),M[1]=o.v3Combine(M[1],M[0],1,-i[0]),i[0]=o.v3Dot(M[0],M[1]),M[1]=o.v3Combine(M[1],M[0],1,-i[0]),a[1]=o.v3Length(M[1]),M[1]=o.v3Normalize(M[1],a[1]),i[0]/=a[1],i[1]=o.v3Dot(M[0],M[2]),M[2]=o.v3Combine(M[2],M[0],1,-i[1]),i[2]=o.v3Dot(M[1],M[2]),M[2]=o.v3Combine(M[2],M[1],1,-i[2]),a[2]=o.v3Length(M[2]),M[2]=o.v3Normalize(M[2],a[2]),i[1]/=a[2],i[2]/=a[2];var C=o.v3Cross(M[1],M[2]);if(o.v3Dot(M[0],C)<0)for(m=0;m<3;m++)a[m]*=-1,M[m][0]*=-1,M[m][1]*=-1,M[m][2]*=-1;n[0]=.5*Math.sqrt(Math.max(1+M[0][0]-M[1][1]-M[2][2],0)),n[1]=.5*Math.sqrt(Math.max(1-M[0][0]+M[1][1]-M[2][2],0)),n[2]=.5*Math.sqrt(Math.max(1-M[0][0]-M[1][1]+M[2][2],0)),n[3]=.5*Math.sqrt(Math.max(1+M[0][0]+M[1][1]+M[2][2],0)),M[2][1]>M[1][2]&&(n[0]=-n[0]),M[0][2]>M[2][0]&&(n[1]=-n[1]),M[1][0]>M[0][1]&&(n[2]=-n[2]);var p;return{rotationDegrees:p=n[0]<.001&&n[0]>=0&&n[1]<.001&&n[1]>=0?[0,0,o.roundTo3Places(180*Math.atan2(M[0][1],M[0][0])/Math.PI)]:o.quaternionToDegreesXYZ(n,s,M),perspective:e,quaternion:n,scale:a,skew:i,translation:u,rotate:p[2],rotateX:p[0],rotateY:p[1],scaleX:a[0],scaleY:a[1],translateX:u[0],translateY:u[1]}}}}};n.exports=o},128); -__d(function(t,i,h,d){'use strict';var e={width:void 0,height:void 0};h.exports=function(t,i){return(t=t||e)!==(i=i||e)&&(t.width!==i.width||t.height!==i.height)}},129); -__d(function(e,l,a,t){'use strict';var r=l(117),n=l(124),d=l(125),i=(l(22),(function(){function e(){babelHelpers.classCallCheck(this,e)}return babelHelpers.createClass(e,null,[{key:"validateStyleProp",value:function(e,l,a){return}},{key:"validateStyle",value:function(e,l){return}},{key:"addValidStylePropTypes",value:function(e){for(var l in e)s[l]=e[l]}}]),e})()),s={};i.addValidStylePropTypes(r),i.addValidStylePropTypes(n),i.addValidStylePropTypes(d),a.exports=i},130); -__d(function(e,i,t,n){'use strict';var o=i(53),r=(i(34),i(20)),s=i(111),a=(i(116),i(132)),d=i(133),p=i(143),u=i(22),w=i(145)('RCTView',p({displayName:'View',mixins:[o],propTypes:d,viewConfig:{uiViewClassName:'RCTView',validAttributes:a.RCTView},contextTypes:{isInAParentText:r.bool},render:function(){return u((this.context.isInAParentText,!0),'Nesting of within is not supported on Android.'),s.createElement(w,this.props)}}),{nativeOnly:{nativeBackgroundAndroid:!0,nativeForegroundAndroid:!0}}),T=w;t.exports=T},131); -__d(function(e,i,s,t){'use strict';var a=i(116),c={};c.UIView={pointerEvents:!0,accessible:!0,accessibilityLabel:!0,accessibilityComponentType:!0,accessibilityLiveRegion:!0,accessibilityTraits:!0,importantForAccessibility:!0,nativeID:!0,testID:!0,renderToHardwareTextureAndroid:!0,shouldRasterizeIOS:!0,onLayout:!0,onAccessibilityTap:!0,onMagicTap:!0,collapsable:!0,needsOffscreenAlphaCompositing:!0,style:a},c.RCTView=babelHelpers.extends({},c.UIView,{removeClippedSubviews:!0}),s.exports=c},132); -__d(function(e,o,n,s){'use strict';var i=o(134),t=o(139),c=o(20),r=o(141),a=o(125),l=o(142),p=l.AccessibilityComponentTypes,d=l.AccessibilityTraits,u=r(a);n.exports=babelHelpers.extends({},t,{accessible:c.bool,accessibilityLabel:c.node,accessibilityComponentType:c.oneOf(p),accessibilityLiveRegion:c.oneOf(['none','polite','assertive']),importantForAccessibility:c.oneOf(['auto','yes','no','no-hide-descendants']),accessibilityTraits:c.oneOfType([c.oneOf(d),c.arrayOf(c.oneOf(d))]),accessibilityViewIsModal:c.bool,onAccessibilityTap:c.func,onMagicTap:c.func,testID:c.string,nativeID:c.string,onResponderGrant:c.func,onResponderMove:c.func,onResponderReject:c.func,onResponderRelease:c.func,onResponderTerminate:c.func,onResponderTerminationRequest:c.func,onStartShouldSetResponder:c.func,onStartShouldSetResponderCapture:c.func,onMoveShouldSetResponder:c.func,onMoveShouldSetResponderCapture:c.func,hitSlop:i,onLayout:c.func,pointerEvents:c.oneOf(['box-none','none','box-only','auto']),style:u,removeClippedSubviews:c.bool,renderToHardwareTextureAndroid:c.bool,shouldRasterizeIOS:c.bool,collapsable:c.bool,needsOffscreenAlphaCompositing:c.bool})},133); -__d(function(t,r,e,n){'use strict';var u=r(20),b=r(135)({top:u.number,left:u.number,bottom:u.number,right:u.number});e.exports=b},134); -__d(function(n,e,t,i){'use strict';var r=e(22),o=e(136);t.exports=function(n){function e(e,t,i,a,l){if(t[i]){var c=t[i],s=typeof c;'object'!==s&&r(!1,"Invalid "+(l||'(unknown)')+" `"+i+"` of type `"+s+"` supplied to `"+a+"`, expected `object`.");for(var u=o(t[i],n),d=arguments.length,p=Array(d>5?d-5:0),f=5;f4?o-4:0),l=4;l4?e-4:0),v=4;v=r)return e[t];return e[e.length-1]||1}}]),e})();t.exports=l},153); -__d(function(e,r,t,n){'use strict';function s(e){switch(e){case.75:return'ldpi';case 1:return'mdpi';case 1.5:return'hdpi';case 2:return'xhdpi';case 3:return'xxhdpi';case 4:return'xxxhdpi'}throw new Error('no such scale')}var a=new Set(['gif','jpeg','jpg','png','svg','webp','xml']);function i(e){var r=e.httpServerLocation;return'/'===r[0]&&(r=r.substr(1)),r}t.exports={getAndroidAssetSuffix:s,getAndroidResourceFolderName:function(e,r){if(!a.has(e.type))return'raw';var t=s(r);if(!t)throw new Error('Don\'t know which android drawable suffix to use for asset: '+JSON.stringify(e));return'drawable-'+t},getAndroidResourceIdentifier:function(e){return(i(e)+'/'+e.name).toLowerCase().replace(/\//g,'_').replace(/([^a-z0-9_])/g,'').replace(/^assets_/,'')},getBasePath:i}},154); -__d(function(e,o,r,a){'use strict';var n=o(116);r.exports=function(e,o,r){if(o){var a=e.displayName||e.name||'unknown',t=e.__propTypesSecretDontUseThesePlease||e.propTypes;if(!t)throw new Error('`'+a+'` has no propTypes defined`');var p=o.NativeProps;for(var s in p)if(!(t[s]||n[s]||r&&r[s])){var i;throw i=t.hasOwnProperty(s)?'`'+a+'` has incorrectly defined propType for native prop `'+o.uiViewClassName+'.'+s+'` of native type `'+p[s]:'`'+a+'` has no propType for native prop `'+o.uiViewClassName+'.'+s+'` of native type `'+p[s]+'`',i+="\nIf you haven't changed this prop yourself, this usually means that your versions of the native code and JavaScript code are out of sync. Updating both should make this error go away.",new Error(i)}}}},155); -__d(function(e,t,r,n){'use strict';var i=t(157),l=t(158),o=t(161),s=t(111),a=t(20),u=t(132),f=t(147),c=t(136),h=t(22);function p(e,t){if(null==e||null==t)return!0;if(e.length!==t.length)return!0;for(var r=0;r must be a child of a '),s.createElement(k,{opacity:A(e),transform:T(e)},this.props.children)}}]),t})(s.Component);O.contextTypes={isInSurface:a.bool.isRequired};var W=(function(e){babelHelpers.inherits(t,e);function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.createClass(t,[{key:"render",value:function(){var e=this.props,t=[H(e.x,0),H(e.y,0),H(e.width,0),H(e.height,0)],r=c(e);return delete r.x,delete r.y,s.createElement(k,{clipping:t,opacity:A(e),transform:T(r)},this.props.children)}}]),t})(s.Component),P=0,J=1,V=2,j=3;function G(e,t,r){var n=new i(e);t[r+0]=n.red/255,t[r+1]=n.green/255,t[r+2]=n.blue/255,t[r+3]=n.alpha}function I(e,t,r){var n=0;if('length'in e)for(;nY?(p-=v,c-=X):l>0&&0!=Y&&(p-=l/Y*v,c-=l/Y*X),a=p*p+c*c,(l=(p=s-t)*v+(c=h-i)*X)>Y?(p-=v,c-=X):l>0&&0!=Y&&(p-=l/Y*v,c-=l/Y*X),u=p*p+c*c,a<.01&&u<.01)this.onLine(t,i,o,r);else{if(isNaN(a)||isNaN(u))throw new Error('Bad input');var f=.5*(n+s),M=.5*(e+h),b=.5*(n+t),T=.5*(e+i),k=.5*(b+f),w=.5*(T+M),_=.5*(o+s),D=.5*(r+h),z=.5*(_+f),C=.5*(D+M),m=.5*(k+z),B=.5*(w+C);this.onBezierCurve(t,i,b,T,k,w,m,B),this.onBezierCurve(m,B,z,C,_,D,o,r)}},onArc:function(t,i,n,e,s,h,o,r,a,u,p,c){var l=c?c*Math.PI/180:0,v=Math.cos(l),X=Math.sin(l),Y=v*o,f=-X*r,M=X*o,b=v*r,T=u-a;T<0&&!p?T+=2*Math.PI:T>0&&p&&(T-=2*Math.PI);for(var k=Math.ceil(Math.abs(T/(Math.PI/2))),w=T/k,_=1.3333333333333333*Math.tan(w/4),D=Math.cos(a),z=Math.sin(a),C=0;Cthis.yy/this.xy?-1:1;return(this.xx<0?this.xy>=0:this.xy<0)&&(h=-h),this.rotate(t-180*Math.atan2(h*this.yx,h*this.xx)/Math.PI,i,s)},scaleTo:function(t,i){var s=Math.sqrt(this.xx*this.xx+this.yx*this.yx);return this.xx/=s,this.yx/=s,s=Math.sqrt(this.yy*this.yy+this.xy*this.xy),this.yy/=s,this.xy/=s,this.scale(t,i)},resizeTo:function(t,i){var s=this.width,h=this.height;return s&&h?this.scaleTo(t/s,i/h):this},inversePoint:function(t,i){var s=this.xx,h=this.yx,x=this.xy,y=this.yy,n=this.x,r=this.y,o=h*x-s*y;return 0==o?null:{x:(y*(n-t)+x*(i-r))/o,y:(s*(r-i)+h*(t-n))/o}},point:function(t,i){return{x:this.xx*t+this.xy*i+this.x,y:this.yx*t+this.yy*i+this.y}}})},161); -__d(function(e,t,s,r){'use strict';var i=t(51),o=(t(34),t(111)),l=t(20),a=t(112),n=t(163),c=(t(171),t(172)),b=t(131),u=t(22),d=(function(e){babelHelpers.inherits(t,e);function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.createClass(t,[{key:"render",value:function(){var e=this.props,t=e.accessibilityLabel,s=e.color,r=e.onPress,i=e.title,l=e.hasTVPreferredFocus,a=e.disabled,d=e.testID,h=[p.button],y=[p.text];s&&y.push({color:s});var f=['button'];a&&(h.push(p.buttonDisabled),y.push(p.textDisabled),f.push('disabled')),u('string'==typeof i,'The title prop of a Button must be a string');var g=i,D=c;return o.createElement(D,{accessibilityComponentType:"button",accessibilityLabel:t,accessibilityTraits:f,hasTVPreferredFocus:l,testID:d,disabled:a,onPress:r},o.createElement(b,{style:h},o.createElement(n,{style:y,disabled:a},g)))}}]),t})(o.Component);d.propTypes={title:l.string.isRequired,accessibilityLabel:l.string,color:i,disabled:l.bool,onPress:l.func.isRequired,testID:l.string,hasTVPreferredFocus:l.bool};var p=a.create({button:{},text:{color:'#007AFF',textAlign:'center',padding:8,fontSize:18},buttonDisabled:{},textDisabled:{color:'#cdcdcd'}});s.exports=d},162); -__d(function(e,t,s,n){'use strict';var o=t(51),i=t(134),r=t(53),l=(t(34),t(111)),a=t(20),p=t(132),h=t(141),d=t(124),u=t(164),c=t(143),b=t(147),g=t(170),f=t(126),R=h(d),H={validAttributes:g(p.UIView,{isHighlighted:!0,numberOfLines:!0,ellipsizeMode:!0,allowFontScaling:!0,disabled:!0,selectable:!0,selectionColor:!0,adjustsFontSizeToFit:!0,minimumFontScale:!0,textBreakStrategy:!0}),uiViewClassName:'RCTText'},P=c({displayName:'Text',propTypes:{ellipsizeMode:a.oneOf(['head','middle','tail','clip']),numberOfLines:a.number,textBreakStrategy:a.oneOf(['simple','highQuality','balanced']),onLayout:a.func,onPress:a.func,onLongPress:a.func,pressRetentionOffset:i,selectable:a.bool,selectionColor:o,suppressHighlighting:a.bool,style:R,testID:a.string,nativeID:a.string,allowFontScaling:a.bool,accessible:a.bool,adjustsFontSizeToFit:a.bool,minimumFontScale:a.number,disabled:a.bool},getDefaultProps:function(){return{accessible:!0,allowFontScaling:!0,ellipsizeMode:'tail'}},getInitialState:function(){return g(u.Mixin.touchableGetInitialState(),{isHighlighted:!1})},mixins:[r],viewConfig:H,getChildContext:function(){return{isInAParentText:!0}},childContextTypes:{isInAParentText:a.bool},contextTypes:{isInAParentText:a.bool},_handlers:null,_hasPressHandler:function(){return!!this.props.onPress||!!this.props.onLongPress},touchableHandleActivePressIn:null,touchableHandleActivePressOut:null,touchableHandlePress:null,touchableHandleLongPress:null,touchableGetPressRectOffset:null,render:function(){var e=this,t=this.props;return(this.props.onStartShouldSetResponder||this._hasPressHandler())&&(this._handlers||(this._handlers={onStartShouldSetResponder:function(){var t=e.props.onStartShouldSetResponder&&e.props.onStartShouldSetResponder()||e._hasPressHandler();if(t&&!e.touchableHandleActivePressIn){for(var s in u.Mixin)'function'==typeof u.Mixin[s]&&(e[s]=u.Mixin[s].bind(e));e.touchableHandleActivePressIn=function(){!e.props.suppressHighlighting&&e._hasPressHandler()&&e.setState({isHighlighted:!0})},e.touchableHandleActivePressOut=function(){!e.props.suppressHighlighting&&e._hasPressHandler()&&e.setState({isHighlighted:!1})},e.touchableHandlePress=function(t){e.props.onPress&&e.props.onPress(t)},e.touchableHandleLongPress=function(t){e.props.onLongPress&&e.props.onLongPress(t)},e.touchableGetPressRectOffset=function(){return this.props.pressRetentionOffset||m}}return t},onResponderGrant:function(e,t){this.touchableHandleResponderGrant(e,t),this.props.onResponderGrant&&this.props.onResponderGrant.apply(this,arguments)}.bind(this),onResponderMove:function(e){this.touchableHandleResponderMove(e),this.props.onResponderMove&&this.props.onResponderMove.apply(this,arguments)}.bind(this),onResponderRelease:function(e){this.touchableHandleResponderRelease(e),this.props.onResponderRelease&&this.props.onResponderRelease.apply(this,arguments)}.bind(this),onResponderTerminate:function(e){this.touchableHandleResponderTerminate(e),this.props.onResponderTerminate&&this.props.onResponderTerminate.apply(this,arguments)}.bind(this),onResponderTerminationRequest:function(){var e=this.touchableHandleResponderTerminationRequest();return e&&this.props.onResponderTerminationRequest&&(e=this.props.onResponderTerminationRequest.apply(this,arguments)),e}.bind(this)}),t=babelHelpers.extends({},this.props,this._handlers,{isHighlighted:this.state.isHighlighted})),null!=t.selectionColor&&(t=babelHelpers.extends({},t,{selectionColor:f(t.selectionColor)})),u.TOUCH_TARGET_DEBUG&&t.onPress&&(t=babelHelpers.extends({},t,{style:[this.props.style,{color:'magenta'}]})),this.context.isInAParentText?l.createElement(T,t):l.createElement(S,t)}}),m={top:20,left:20,right:20,bottom:30},S=b(H.uiViewClassName,function(){return H}),T=S;s.exports=P},163); -__d(function(E,t,e,R){'use strict';var i=t(165),_=t(34),s=t(167),S=(t(111),t(54)),o=t(168),n=t(169),a=t(65),l=(t(131),t(119)),N=(t(52),l({NOT_RESPONDER:null,RESPONDER_INACTIVE_PRESS_IN:null,RESPONDER_INACTIVE_PRESS_OUT:null,RESPONDER_ACTIVE_PRESS_IN:null,RESPONDER_ACTIVE_PRESS_OUT:null,RESPONDER_ACTIVE_LONG_PRESS_IN:null,RESPONDER_ACTIVE_LONG_PRESS_OUT:null,ERROR:null})),T={RESPONDER_ACTIVE_PRESS_OUT:!0,RESPONDER_ACTIVE_PRESS_IN:!0},h={RESPONDER_INACTIVE_PRESS_IN:!0,RESPONDER_ACTIVE_PRESS_IN:!0,RESPONDER_ACTIVE_LONG_PRESS_IN:!0},P={RESPONDER_ACTIVE_LONG_PRESS_IN:!0},O=l({DELAY:null,RESPONDER_GRANT:null,RESPONDER_RELEASE:null,RESPONDER_TERMINATED:null,ENTER_PRESS_RECT:null,LEAVE_PRESS_RECT:null,LONG_PRESS_DETECTED:null}),u={NOT_RESPONDER:{DELAY:N.ERROR,RESPONDER_GRANT:N.RESPONDER_INACTIVE_PRESS_IN,RESPONDER_RELEASE:N.ERROR,RESPONDER_TERMINATED:N.ERROR,ENTER_PRESS_RECT:N.ERROR,LEAVE_PRESS_RECT:N.ERROR,LONG_PRESS_DETECTED:N.ERROR},RESPONDER_INACTIVE_PRESS_IN:{DELAY:N.RESPONDER_ACTIVE_PRESS_IN,RESPONDER_GRANT:N.ERROR,RESPONDER_RELEASE:N.NOT_RESPONDER,RESPONDER_TERMINATED:N.NOT_RESPONDER,ENTER_PRESS_RECT:N.RESPONDER_INACTIVE_PRESS_IN,LEAVE_PRESS_RECT:N.RESPONDER_INACTIVE_PRESS_OUT,LONG_PRESS_DETECTED:N.ERROR},RESPONDER_INACTIVE_PRESS_OUT:{DELAY:N.RESPONDER_ACTIVE_PRESS_OUT,RESPONDER_GRANT:N.ERROR,RESPONDER_RELEASE:N.NOT_RESPONDER,RESPONDER_TERMINATED:N.NOT_RESPONDER,ENTER_PRESS_RECT:N.RESPONDER_INACTIVE_PRESS_IN,LEAVE_PRESS_RECT:N.RESPONDER_INACTIVE_PRESS_OUT,LONG_PRESS_DETECTED:N.ERROR},RESPONDER_ACTIVE_PRESS_IN:{DELAY:N.ERROR,RESPONDER_GRANT:N.ERROR,RESPONDER_RELEASE:N.NOT_RESPONDER,RESPONDER_TERMINATED:N.NOT_RESPONDER,ENTER_PRESS_RECT:N.RESPONDER_ACTIVE_PRESS_IN,LEAVE_PRESS_RECT:N.RESPONDER_ACTIVE_PRESS_OUT,LONG_PRESS_DETECTED:N.RESPONDER_ACTIVE_LONG_PRESS_IN},RESPONDER_ACTIVE_PRESS_OUT:{DELAY:N.ERROR,RESPONDER_GRANT:N.ERROR,RESPONDER_RELEASE:N.NOT_RESPONDER,RESPONDER_TERMINATED:N.NOT_RESPONDER,ENTER_PRESS_RECT:N.RESPONDER_ACTIVE_PRESS_IN,LEAVE_PRESS_RECT:N.RESPONDER_ACTIVE_PRESS_OUT,LONG_PRESS_DETECTED:N.ERROR},RESPONDER_ACTIVE_LONG_PRESS_IN:{DELAY:N.ERROR,RESPONDER_GRANT:N.ERROR,RESPONDER_RELEASE:N.NOT_RESPONDER,RESPONDER_TERMINATED:N.NOT_RESPONDER,ENTER_PRESS_RECT:N.RESPONDER_ACTIVE_LONG_PRESS_IN,LEAVE_PRESS_RECT:N.RESPONDER_ACTIVE_LONG_PRESS_OUT,LONG_PRESS_DETECTED:N.RESPONDER_ACTIVE_LONG_PRESS_IN},RESPONDER_ACTIVE_LONG_PRESS_OUT:{DELAY:N.ERROR,RESPONDER_GRANT:N.ERROR,RESPONDER_RELEASE:N.NOT_RESPONDER,RESPONDER_TERMINATED:N.NOT_RESPONDER,ENTER_PRESS_RECT:N.RESPONDER_ACTIVE_LONG_PRESS_IN,LEAVE_PRESS_RECT:N.RESPONDER_ACTIVE_LONG_PRESS_OUT,LONG_PRESS_DETECTED:N.ERROR},error:{DELAY:N.NOT_RESPONDER,RESPONDER_GRANT:N.RESPONDER_INACTIVE_PRESS_IN,RESPONDER_RELEASE:N.NOT_RESPONDER,RESPONDER_TERMINATED:N.NOT_RESPONDER,ENTER_PRESS_RECT:N.NOT_RESPONDER,LEAVE_PRESS_RECT:N.NOT_RESPONDER,LONG_PRESS_DETECTED:N.NOT_RESPONDER}},r={Mixin:{componentDidMount:function(){_.isTVOS&&(this._tvEventHandler=new o,this._tvEventHandler.enable(this,function(E,t){var e=S.findNodeHandle(E);t.dispatchConfig={},e===t.tag&&('focus'===t.eventType?E.touchableHandleActivePressIn&&E.touchableHandleActivePressIn(t):'blur'===t.eventType?E.touchableHandleActivePressOut&&E.touchableHandleActivePressOut(t):'select'===t.eventType&&E.touchableHandlePress&&E.touchableHandlePress(t))}))},componentWillUnmount:function(){this._tvEventHandler&&(this._tvEventHandler.disable(),delete this._tvEventHandler),this.touchableDelayTimeout&&clearTimeout(this.touchableDelayTimeout),this.longPressDelayTimeout&&clearTimeout(this.longPressDelayTimeout),this.pressOutDelayTimeout&&clearTimeout(this.pressOutDelayTimeout)},touchableGetInitialState:function(){return{touchable:{touchState:void 0,responderID:null}}},touchableHandleResponderTerminationRequest:function(){return!this.props.rejectResponderTermination},touchableHandleStartShouldSetResponder:function(){return!this.props.disabled},touchableLongPressCancelsPress:function(){return!0},touchableHandleResponderGrant:function(E){var t=E.currentTarget;E.persist(),this.pressOutDelayTimeout&&clearTimeout(this.pressOutDelayTimeout),this.pressOutDelayTimeout=null,this.state.touchable.touchState=N.NOT_RESPONDER,this.state.touchable.responderID=t,this._receiveSignal(O.RESPONDER_GRANT,E);var e=void 0!==this.touchableGetHighlightDelayMS?Math.max(this.touchableGetHighlightDelayMS(),0):130;0!==(e=isNaN(e)?130:e)?this.touchableDelayTimeout=setTimeout(this._handleDelay.bind(this,E),e):this._handleDelay(E);var R=void 0!==this.touchableGetLongPressDelayMS?Math.max(this.touchableGetLongPressDelayMS(),10):370;R=isNaN(R)?370:R,this.longPressDelayTimeout=setTimeout(this._handleLongDelay.bind(this,E),R+e)},touchableHandleResponderRelease:function(E){this._receiveSignal(O.RESPONDER_RELEASE,E)},touchableHandleResponderTerminate:function(E){this._receiveSignal(O.RESPONDER_TERMINATED,E)},touchableHandleResponderMove:function(E){if(this.state.touchable.touchState!==N.RESPONDER_INACTIVE_PRESS_IN&&this.state.touchable.positionOnActivate){var t=this.state.touchable.positionOnActivate,e=this.state.touchable.dimensionsOnActivate,R=this.touchableGetPressRectOffset?this.touchableGetPressRectOffset():{left:20,right:20,top:20,bottom:20},i=R.left,_=R.top,s=R.right,S=R.bottom,o=this.touchableGetHitSlop?this.touchableGetHitSlop():null;o&&(i+=o.left,_+=o.top,s+=o.right,S+=o.bottom);var a=n.extractSingleTouch(E.nativeEvent),l=a&&a.pageX,T=a&&a.pageY;if(this.pressInLocation){this._getDistanceBetweenPoints(l,T,this.pressInLocation.pageX,this.pressInLocation.pageY)>10&&this._cancelLongPressDelayTimeout()}if(l>t.left-i&&T>t.top-_&&l0,u=n&&n.length>0;return!c&&u?n[0]:c?e[0]:t}}},169); -__d(function(r,n,t,i){'use strict';t.exports=function(r,n){var t={};for(var i in r)t[i]=r[i];for(var o in n)t[o]=n[o];return t}},170); -__d(function(e,t,r,n){'use strict';var o=t(111),s=t(112),i=t(163),l=t(131),a=(function(e){babelHelpers.inherits(t,e);function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.createClass(t,[{key:"render",value:function(){return o.createElement(l,{style:[c.container,this.props.style]},o.createElement(i,{style:c.info},"TouchableNativeFeedback is not supported on this platform!"))}}]),t})(o.Component),c=s.create({container:{height:100,width:300,backgroundColor:'#ffbcbc',borderWidth:1,borderColor:'red',alignItems:'center',justifyContent:'center',margin:10},info:{color:'#333333',margin:20}});r.exports=a},171); -__d(function(t,e,s,i){'use strict';var o=e(173),n=e(198),r=e(53),a=e(111),p=e(20),c=e(214),l=e(164),h=e(215),u=e(143),d=e(216),y=e(62),b={top:20,left:20,right:20,bottom:30},f=u({displayName:'TouchableOpacity',mixins:[c,l.Mixin,r],propTypes:babelHelpers.extends({},h.propTypes,{activeOpacity:p.number,hasTVPreferredFocus:p.bool,tvParallaxProperties:p.object}),getDefaultProps:function(){return{activeOpacity:.2}},getInitialState:function(){return babelHelpers.extends({},this.touchableGetInitialState(),{anim:new o.Value(this._getChildStyleOpacityWithDefault())})},componentDidMount:function(){d(this.props)},componentWillReceiveProps:function(t){d(t)},setOpacityTo:function(t,e){o.timing(this.state.anim,{toValue:t,duration:e,easing:n.inOut(n.quad),useNativeDriver:!0}).start()},touchableHandleActivePressIn:function(t){'onResponderGrant'===t.dispatchConfig.registrationName?this._opacityActive(0):this._opacityActive(150),this.props.onPressIn&&this.props.onPressIn(t)},touchableHandleActivePressOut:function(t){this._opacityInactive(250),this.props.onPressOut&&this.props.onPressOut(t)},touchableHandlePress:function(t){this.props.onPress&&this.props.onPress(t)},touchableHandleLongPress:function(t){this.props.onLongPress&&this.props.onLongPress(t)},touchableGetPressRectOffset:function(){return this.props.pressRetentionOffset||b},touchableGetHitSlop:function(){return this.props.hitSlop},touchableGetHighlightDelayMS:function(){return this.props.delayPressIn||0},touchableGetLongPressDelayMS:function(){return 0===this.props.delayLongPress?0:this.props.delayLongPress||500},touchableGetPressOutDelayMS:function(){return this.props.delayPressOut},_opacityActive:function(t){this.setOpacityTo(this.props.activeOpacity,t)},_opacityInactive:function(t){this.setOpacityTo(this._getChildStyleOpacityWithDefault(),t)},_getChildStyleOpacityWithDefault:function(){var t=y(this.props.style)||{};return void 0==t.opacity?1:t.opacity},render:function(){return a.createElement(o.View,{accessible:!1!==this.props.accessible,accessibilityLabel:this.props.accessibilityLabel,accessibilityComponentType:this.props.accessibilityComponentType,accessibilityTraits:this.props.accessibilityTraits,style:[this.props.style,{opacity:this.state.anim}],nativeID:this.props.nativeID,testID:this.props.testID,onLayout:this.props.onLayout,isTVSelectable:!0,hasTVPreferredFocus:this.props.hasTVPreferredFocus,tvParallaxProperties:this.props.tvParallaxProperties,hitSlop:this.props.hitSlop,onStartShouldSetResponder:this.touchableHandleStartShouldSetResponder,onResponderTerminationRequest:this.touchableHandleResponderTerminationRequest,onResponderGrant:this.touchableHandleResponderGrant,onResponderMove:this.touchableHandleResponderMove,onResponderRelease:this.touchableHandleResponderRelease,onResponderTerminate:this.touchableHandleResponderTerminate},this.props.children,l.renderDebugView({color:'cyan',hitSlop:this.props.hitSlop}))}});s.exports=f},172); -__d(function(e,t,n,o){'use strict';var a=t(174),r=t(201),i=t(163),m=t(131),c=void 0,d={View:a.createAnimatedComponent(m),Text:a.createAnimatedComponent(i),Image:a.createAnimatedComponent(r),get ScrollView(){return c||(c=a.createAnimatedComponent(t(203))),c}};babelHelpers.extends(d,a),n.exports=d},173); -__d(function(n,t,e,i){'use strict';var r=t(175),o=r.AnimatedEvent,a=r.attachNativeEvent,u=t(183),s=t(184),c=t(185),f=t(177),v=t(186),p=t(187),l=t(178),d=t(188),g=t(191),h=t(176),m=t(192),_=t(193),N=t(195),w=t(197),y=t(200),E=function(n,t){return n&&t.onComplete?function(){t.onComplete&&t.onComplete.apply(t,arguments),n&&n.apply(void 0,arguments)}:n||t.onComplete},L=function(n,t,e){if(n instanceof m){var i=babelHelpers.extends({},t),r=babelHelpers.extends({},t);for(var o in t){var a=t[o],u=a.x,s=a.y;void 0!==u&&void 0!==s&&(i[o]=u,r[o]=s)}var c=e(n.x,i),f=e(n.y,r);return b([c,f],{stopTogether:!1})}return null},A=function n(t,e){var i=function(n,t,e){e=E(e,t);var i=n,r=t;i.stopTracking(),t.toValue instanceof l?i.track(new g(i,t.toValue,w,r,e)):i.animate(new w(r),e)};return L(t,e,n)||{start:(function(n){function t(t){return n.apply(this,arguments)}return t.toString=function(){return n.toString()},t})(function(n){i(t,e,n)}),stop:function(){t.stopAnimation()},reset:function(){t.resetAnimation()},_startNativeLoop:function(n){var r=babelHelpers.extends({},e,{iterations:n});i(t,r)},_isUsingNativeDriver:function(){return e.useNativeDriver||!1}}},D=function(n){var t=0;return{start:function(e){var i=function i(r){r.finished&&++t!==n.length?n[t].start(i):e&&e(r)};0===n.length?e&&e({finished:!0}):n[t].start(i)},stop:function(){t1&&void 0!==arguments[1]?arguments[1]:{}).iterations,e=void 0===t?-1:t,i=!1,r=0;return{start:function(t){n&&0!==e?n._isUsingNativeDriver()?n._startNativeLoop(e):(function o(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{finished:!0};i||r===e||!1===a.finished?t&&t(a):(r++,n.reset(),n.start(o))})():t&&t({finished:!0})},stop:function(){i=!0,n.stop()},reset:function(){r=0,i=!1,n.reset()},_startNativeLoop:function(){throw new Error('Loops run using the native driver cannot contain Animated.loop animations')},_isUsingNativeDriver:function(){return n._isUsingNativeDriver()}}},event:function(n,t){var e=new o(n,t);return e.__isNative?e:e.__getHandler()},createAnimatedComponent:y,attachNativeEvent:a,forkEvent:function(n,t){return n?n instanceof o?(n.__addListener(t),n):function(){'function'==typeof n&&n.apply(void 0,arguments),t.apply(void 0,arguments)}:t},unforkEvent:function(n,t){n&&n instanceof o&&n.__removeListener(t)},__PropsOnlyForTests:d}},174); -__d(function(e,t,n,i){'use strict';var a=t(176),s=t(179),r=t(54),v=t(22),l=t(179).shouldUseNativeDriver;function o(e,t,n){var i=[];v(n[0]&&n[0].nativeEvent,'Native driven events only support animated values contained inside `nativeEvent`.'),(function e(t,n){if(t instanceof a)t.__makeNative(),i.push({nativeEventPath:n,animatedValueTag:t.__getNativeTag()});else if('object'==typeof t)for(var s in t)e(t[s],n.concat(s))})(n[0].nativeEvent,[]);var l=r.findNodeHandle(e);return i.forEach(function(e){s.API.addAnimatedEventToView(l,t,e)}),{detach:function(){i.forEach(function(e){s.API.removeAnimatedEventFromView(l,t,e.animatedValueTag)})}}}var c=(function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};babelHelpers.classCallCheck(this,e),this._listeners=[],this._argMapping=t,n.listener&&this.__addListener(n.listener),this._callListeners=this._callListeners.bind(this),this._attachedEvent=null,this.__isNative=l(n)}return babelHelpers.createClass(e,[{key:"__addListener",value:function(e){this._listeners.push(e)}},{key:"__removeListener",value:function(e){this._listeners=this._listeners.filter(function(t){return t!==e})}},{key:"__attach",value:function(e,t){v(this.__isNative,'Only native driven events need to be attached.'),this._attachedEvent=o(e,t,this._argMapping)}},{key:"__detach",value:function(e,t){v(this.__isNative,'Only native driven events need to be detached.'),this._attachedEvent&&this._attachedEvent.detach()}},{key:"__getHandler",value:function(){var e=this;return this.__isNative?this._callListeners:function(){for(var t=arguments.length,n=Array(t),i=0;i=2,'Bad output range'),(function(t){for(var e=t[0].replace(f,''),n=1;n=2,'inputRange must have at least 2 elements');for(var e=1;e=t[e-1],'inputRange must be monotonically increasing '+t)})(n),i(n.length===e.length,'inputRange ('+n.length+') and outputRange ('+e.length+') must have the same length');var a=t.easing||u,r='extend';void 0!==t.extrapolateLeft?r=t.extrapolateLeft:void 0!==t.extrapolate&&(r=t.extrapolate);var o='extend';return void 0!==t.extrapolateRight?o=t.extrapolateRight:void 0!==t.extrapolate&&(o=t.extrapolate),function(t){i('number'==typeof t,'Cannot interpolation an input which is not a number');var u=(function(t,e){var n=void 0;for(n=1;n=t);++n);return n-1})(t,n);return(function(t,e,n,a,r,i,o,u){var p=t;if(pn){if('identity'===u)return p;'clamp'===u&&(p=n)}if(a===r)return a;if(e===n)return t<=e?a:r;e===-1/0?p=-p:n===1/0?p-=e:p=(p-e)/(n-e);p=i(p),a===-1/0?p=-p:r===1/0?p+=a:p=p*(r-a)+a;return p})(t,n[u],n[u+1],e[u],e[u+1],a,r,o)}}function l(t){var e=o(t);if(null===e)return t;return"rgba("+((4278190080&(e=e||0))>>>24)+", "+((16711680&e)>>>16)+", "+((65280&e)>>>8)+", "+(255&e)/255+")"}var f=/[0-9\.-]+/g;function s(t,e){i(e.length>=2,t+' must have at least 2 elements'),i(2!==e.length||e[0]!==-1/0||e[1]!==1/0,t+'cannot be ]-infinity;+infinity[ '+e)}var c=(function(t){babelHelpers.inherits(e,t);function e(t,n){babelHelpers.classCallCheck(this,e);var a=babelHelpers.possibleConstructorReturn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return a._parent=t,a._config=n,a._interpolation=p(n),a}return babelHelpers.createClass(e,[{key:"__makeNative",value:function(){this._parent.__makeNative(),babelHelpers.get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"__makeNative",this).call(this)}},{key:"__getValue",value:function(){var t=this._parent.__getValue();return i('number'==typeof t,'Cannot interpolate an input which is not a number.'),this._interpolation(t)}},{key:"interpolate",value:function(t){return new e(this,t)}},{key:"__attach",value:function(){this._parent.__addChild(this)}},{key:"__detach",value:function(){this._parent.__removeChild(this),babelHelpers.get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"__detach",this).call(this)}},{key:"__transformDataType",value:function(t){return t.map(function(t){if('string'!=typeof t)return t;if(/deg$/.test(t)){return(parseFloat(t)||0)*Math.PI/180}return parseFloat(t)||0})}},{key:"__getNativeConfig",value:function(){return{inputRange:this._config.inputRange,outputRange:this.__transformDataType(this._config.outputRange),extrapolateLeft:this._config.extrapolateLeft||this._config.extrapolate||'extend',extrapolateRight:this._config.extrapolateRight||this._config.extrapolate||'extend',type:'interpolation'}}}]),e})(r);c.__createInterpolation=p,n.exports=c},177); -__d(function(e,t,a,n){'use strict';var i=t(179),_=t(22),o=(function(){function e(){babelHelpers.classCallCheck(this,e)}return babelHelpers.createClass(e,[{key:"__attach",value:function(){}},{key:"__detach",value:function(){this.__isNative&&null!=this.__nativeTag&&(i.API.dropAnimatedNode(this.__nativeTag),this.__nativeTag=void 0)}},{key:"__getValue",value:function(){}},{key:"__getAnimatedValue",value:function(){return this.__getValue()}},{key:"__addChild",value:function(e){}},{key:"__removeChild",value:function(e){}},{key:"__getChildren",value:function(){return[]}},{key:"__makeNative",value:function(){if(!this.__isNative)throw new Error('This node cannot be made a "native" animated node')}},{key:"__getNativeTag",value:function(){if(i.assertNativeAnimatedModule(),_(this.__isNative,'Attempt to get native tag from node not marked as "native"'),null==this.__nativeTag){var e=i.generateNewNodeTag();i.API.createAnimatedNode(e,this.__getNativeConfig()),this.__nativeTag=e}return this.__nativeTag}},{key:"__getNativeConfig",value:function(){throw new Error('This JS animated node type cannot be used as native animated node')}},{key:"toJSON",value:function(){return this.__getValue()}}]),e})();a.exports=o},178); -__d(function(e,t,n,o){'use strict';var i=t(26).NativeAnimatedModule,a=t(81),r=t(22),d=1,s=1,m=void 0,c={createAnimatedNode:function(e,t){l(),i.createAnimatedNode(e,t)},startListeningToAnimatedNodeValue:function(e){l(),i.startListeningToAnimatedNodeValue(e)},stopListeningToAnimatedNodeValue:function(e){l(),i.stopListeningToAnimatedNodeValue(e)},connectAnimatedNodes:function(e,t){l(),i.connectAnimatedNodes(e,t)},disconnectAnimatedNodes:function(e,t){l(),i.disconnectAnimatedNodes(e,t)},startAnimatingNode:function(e,t,n,o){l(),i.startAnimatingNode(e,t,n,o)},stopAnimation:function(e){l(),i.stopAnimation(e)},setAnimatedNodeValue:function(e,t){l(),i.setAnimatedNodeValue(e,t)},setAnimatedNodeOffset:function(e,t){l(),i.setAnimatedNodeOffset(e,t)},flattenAnimatedNodeOffset:function(e){l(),i.flattenAnimatedNodeOffset(e)},extractAnimatedNodeOffset:function(e){l(),i.extractAnimatedNodeOffset(e)},connectAnimatedNodeToView:function(e,t){l(),i.connectAnimatedNodeToView(e,t)},disconnectAnimatedNodeFromView:function(e,t){l(),i.disconnectAnimatedNodeFromView(e,t)},dropAnimatedNode:function(e){l(),i.dropAnimatedNode(e)},addAnimatedEventToView:function(e,t,n){l(),i.addAnimatedEventToView(e,t,n)},removeAnimatedEventFromView:function(e,t,n){l(),i.removeAnimatedEventFromView(e,t,n)}},u={opacity:!0,transform:!0,scaleX:!0,scaleY:!0,translateX:!0,translateY:!0},f={translateX:!0,translateY:!0,scale:!0,scaleX:!0,scaleY:!0,rotate:!0,rotateX:!0,rotateY:!0,perspective:!0};function l(){r(i,'Native animated module is not available')}var p=!1;n.exports={API:c,validateStyles:function(e){for(var t in e)if(!u.hasOwnProperty(t))throw new Error("Style property '"+t+"' is not supported by native animated module")},validateTransform:function(e){e.forEach(function(e){if(!f.hasOwnProperty(e.property))throw new Error("Property '"+e.property+"' is not supported by native animated module")})},validateInterpolation:function(e){var t={inputRange:!0,outputRange:!0,extrapolate:!0,extrapolateRight:!0,extrapolateLeft:!0};for(var n in e)if(!t.hasOwnProperty(n))throw new Error("Interpolation property '"+n+"' is not supported by native animated module")},generateNewNodeTag:function(){return d++},generateNewAnimationId:function(){return s++},assertNativeAnimatedModule:l,shouldUseNativeDriver:function(e){return e.useNativeDriver&&!i?(p||(console.warn("Animated: `useNativeDriver` is not supported because the native animated module is missing. Falling back to JS-based animation. To resolve this, add `RCTAnimation` module to this app, or remove `useNativeDriver`. More info: https://github.com/facebook/react-native/issues/11094#issuecomment-263240420"),p=!0),!1):e.useNativeDriver||!1},get nativeEventEmitter(){return m||(m=new a(i)),m}}},179); -__d(function(e,t,i,a){'use strict';var _=t(178),n=t(179),s=(function(e){babelHelpers.inherits(t,e);function t(){babelHelpers.classCallCheck(this,t);var e=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e._children=[],e}return babelHelpers.createClass(t,[{key:"__makeNative",value:function(){if(!this.__isNative){this.__isNative=!0;var e=this._children,t=Array.isArray(e),i=0;for(e=t?e:e["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();;){var a;if(t){if(i>=e.length)break;a=e[i++]}else{if((i=e.next()).done)break;a=i.value}var _=a;_.__makeNative(),n.API.connectAnimatedNodes(this.__getNativeTag(),_.__getNativeTag())}}}},{key:"__addChild",value:function(e){0===this._children.length&&this.__attach(),this._children.push(e),this.__isNative&&(e.__makeNative(),n.API.connectAnimatedNodes(this.__getNativeTag(),e.__getNativeTag()))}},{key:"__removeChild",value:function(e){var t=this._children.indexOf(e);-1!==t?(this.__isNative&&e.__isNative&&n.API.disconnectAnimatedNodes(this.__getNativeTag(),e.__getNativeTag()),this._children.splice(t,1),0===this._children.length&&this.__detach()):console.warn("Trying to remove a child that doesn't exist")}},{key:"__getChildren",value:function(){return this._children}}]),t})(_);i.exports=s},180); -__d(function(e,n,t,r){'use strict';var o=n(27),a=n(46),i=n(72),c=n(182),s=(n(107),n(22)),u=n(119),d=new a,l=0,f={Events:u({interactionStart:!0,interactionComplete:!0}),runAfterInteractions:function(e){var n=[],t=new Promise(function(t){k(),e&&n.push(e),n.push({run:t,name:'resolve '+(e&&e.name||'?')}),h.enqueueTasks(n)});return{then:t.then.bind(t),done:function(){if(t.done)return t.done.apply(t,arguments);console.warn('Tried to call done when not supported by current Promise implementation.')},cancel:function(){h.cancelTasks(n)}}},createInteractionHandle:function(){k();var e=++T;return p.add(e),e},clearInteractionHandle:function(e){s(!!e,'Must provide a handle to clear.'),k(),p.delete(e),v.add(e)},addListener:d.addListener.bind(d),setDeadline:function(e){E=e}},m=new i,p=new i,v=new i,h=new c({onMoreTasks:k}),w=0,T=0,E=-1;function k(){w||(w=E>0?setTimeout(b,0+l):setImmediate(b))}function b(){w=0;var e=m.size;p.forEach(function(e){return m.add(e)}),v.forEach(function(e){return m.delete(e)});var n=m.size;if(0!==e&&0===n?d.emit(f.Events.interactionComplete):0===e&&0!==n&&d.emit(f.Events.interactionStart),0===n)for(;h.hasTasksToProcess();)if(h.processNext(),E>0&&o.getEventLoopRunningTime()>=E){k();break}p.clear(),v.clear()}t.exports=f},181); -__d(function(e,t,s,u){'use strict';t(107);var n=t(22),a=(function(){function e(t){var s=t.onMoreTasks;babelHelpers.classCallCheck(this,e),this._onMoreTasks=s,this._queueStack=[{tasks:[],popable:!1}]}return babelHelpers.createClass(e,[{key:"enqueue",value:function(e){this._getCurrentQueue().push(e)}},{key:"enqueueTasks",value:function(e){var t=this;e.forEach(function(e){return t.enqueue(e)})}},{key:"cancelTasks",value:function(e){this._queueStack=this._queueStack.map(function(t){return babelHelpers.extends({},t,{tasks:t.tasks.filter(function(t){return-1===e.indexOf(t)})})}).filter(function(e,t){return e.tasks.length>0||0===t})}},{key:"hasTasksToProcess",value:function(){return this._getCurrentQueue().length>0}},{key:"processNext",value:function(){var e=this._getCurrentQueue();if(e.length){var t=e.shift();try{t.gen?this._genPromise(t):t.run?t.run():(n('function'==typeof t,'Expected Function, SimpleTask, or PromiseTask, but got:\n'+JSON.stringify(t,null,2)),t())}catch(e){throw e.message='TaskQueue: Error with task '+(t.name||'')+': '+e.message,e}}}},{key:"_getCurrentQueue",value:function(){var e=this._queueStack.length-1,t=this._queueStack[e];return t.popable&&0===t.tasks.length&&this._queueStack.length>1?(this._queueStack.pop(),this._getCurrentQueue()):t.tasks}},{key:"_genPromise",value:function(e){var t=this;this._queueStack.push({tasks:[],popable:!1});var s=this._queueStack.length-1;e.gen().then(function(){t._queueStack[s].popable=!0,t.hasTasksToProcess()&&t._onMoreTasks()}).catch(function(t){throw t.message="TaskQueue: Error resolving Promise in task "+e.name+": "+t.message,t}).done()}}]),e})();s.exports=a},182); -__d(function(e,t,_,a){'use strict';var i=t(177),o=(t(178),t(176)),r=(function(e){babelHelpers.inherits(t,e);function t(e,_){babelHelpers.classCallCheck(this,t);var a=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return a._a='number'==typeof e?new o(e):e,a._b='number'==typeof _?new o(_):_,a}return babelHelpers.createClass(t,[{key:"__makeNative",value:function(){this._a.__makeNative(),this._b.__makeNative(),babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"__makeNative",this).call(this)}},{key:"__getValue",value:function(){return this._a.__getValue()+this._b.__getValue()}},{key:"interpolate",value:function(e){return new i(this,e)}},{key:"__attach",value:function(){this._a.__addChild(this),this._b.__addChild(this)}},{key:"__detach",value:function(){this._a.__removeChild(this),this._b.__removeChild(this),babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"__detach",this).call(this)}},{key:"__getNativeConfig",value:function(){return{type:'addition',input:[this._a.__getNativeTag(),this._b.__getNativeTag()]}}}]),t})(t(180));_.exports=r},183); -__d(function(t,e,a,_){'use strict';var i=e(177),l=(e(178),(function(t){babelHelpers.inherits(e,t);function e(t,a,_){babelHelpers.classCallCheck(this,e);var i=babelHelpers.possibleConstructorReturn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return i._a=t,i._min=a,i._max=_,i._value=i._lastValue=i._a.__getValue(),i}return babelHelpers.createClass(e,[{key:"__makeNative",value:function(){this._a.__makeNative(),babelHelpers.get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"__makeNative",this).call(this)}},{key:"interpolate",value:function(t){return new i(this,t)}},{key:"__getValue",value:function(){var t=this._a.__getValue(),e=t-this._lastValue;return this._lastValue=t,this._value=Math.min(Math.max(this._value+e,this._min),this._max),this._value}},{key:"__attach",value:function(){this._a.__addChild(this)}},{key:"__detach",value:function(){this._a.__removeChild(this),babelHelpers.get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"__detach",this).call(this)}},{key:"__getNativeConfig",value:function(){return{type:'diffclamp',input:this._a.__getNativeTag(),min:this._min,max:this._max}}}]),e})(e(180)));a.exports=l},184); -__d(function(e,t,i,_){'use strict';var a=t(177),o=(t(178),t(176)),r=(function(e){babelHelpers.inherits(t,e);function t(e,i){babelHelpers.classCallCheck(this,t);var _=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return _._a='number'==typeof e?new o(e):e,_._b='number'==typeof i?new o(i):i,_}return babelHelpers.createClass(t,[{key:"__makeNative",value:function(){this._a.__makeNative(),this._b.__makeNative(),babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"__makeNative",this).call(this)}},{key:"__getValue",value:function(){var e=this._a.__getValue(),t=this._b.__getValue();return 0===t&&console.error('Detected division by zero in AnimatedDivision'),e/t}},{key:"interpolate",value:function(e){return new a(this,e)}},{key:"__attach",value:function(){this._a.__addChild(this),this._b.__addChild(this)}},{key:"__detach",value:function(){this._a.__removeChild(this),this._b.__removeChild(this),babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"__detach",this).call(this)}},{key:"__getNativeConfig",value:function(){return{type:'division',input:[this._a.__getNativeTag(),this._b.__getNativeTag()]}}}]),t})(t(180));i.exports=r},185); -__d(function(t,e,_,a){'use strict';var o=e(177),s=(e(178),(function(t){babelHelpers.inherits(e,t);function e(t,_){babelHelpers.classCallCheck(this,e);var a=babelHelpers.possibleConstructorReturn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return a._a=t,a._modulus=_,a}return babelHelpers.createClass(e,[{key:"__makeNative",value:function(){this._a.__makeNative(),babelHelpers.get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"__makeNative",this).call(this)}},{key:"__getValue",value:function(){return(this._a.__getValue()%this._modulus+this._modulus)%this._modulus}},{key:"interpolate",value:function(t){return new o(this,t)}},{key:"__attach",value:function(){this._a.__addChild(this)}},{key:"__detach",value:function(){this._a.__removeChild(this),babelHelpers.get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"__detach",this).call(this)}},{key:"__getNativeConfig",value:function(){return{type:'modulus',input:this._a.__getNativeTag(),modulus:this._modulus}}}]),e})(e(180)));_.exports=s},186); -__d(function(e,t,_,i){'use strict';var a=t(177),o=(t(178),t(176)),r=(function(e){babelHelpers.inherits(t,e);function t(e,_){babelHelpers.classCallCheck(this,t);var i=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return i._a='number'==typeof e?new o(e):e,i._b='number'==typeof _?new o(_):_,i}return babelHelpers.createClass(t,[{key:"__makeNative",value:function(){this._a.__makeNative(),this._b.__makeNative(),babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"__makeNative",this).call(this)}},{key:"__getValue",value:function(){return this._a.__getValue()*this._b.__getValue()}},{key:"interpolate",value:function(e){return new a(this,e)}},{key:"__attach",value:function(){this._a.__addChild(this),this._b.__addChild(this)}},{key:"__detach",value:function(){this._a.__removeChild(this),this._b.__removeChild(this),babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"__detach",this).call(this)}},{key:"__getNativeConfig",value:function(){return{type:'multiplication',input:[this._a.__getNativeTag(),this._b.__getNativeTag()]}}}]),t})(t(180));_.exports=r},187); -__d(function(e,t,i,a){'use strict';var n=t(175).AnimatedEvent,s=t(178),_=t(189),o=t(179),r=t(54),c=t(22),l=(function(e){babelHelpers.inherits(t,e);function t(e,i){babelHelpers.classCallCheck(this,t);var a=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.style&&(e=babelHelpers.extends({},e,{style:new _(e.style)})),a._props=e,a._callback=i,a.__attach(),a}return babelHelpers.createClass(t,[{key:"__getValue",value:function(){var e={};for(var t in this._props){var i=this._props[t];i instanceof s?(!i.__isNative||i instanceof _)&&(e[t]=i.__getValue()):e[t]=i instanceof n?i.__getHandler():i}return e}},{key:"__getAnimatedValue",value:function(){var e={};for(var t in this._props){var i=this._props[t];i instanceof s&&(e[t]=i.__getAnimatedValue())}return e}},{key:"__attach",value:function(){for(var e in this._props){var t=this._props[e];t instanceof s&&t.__addChild(this)}}},{key:"__detach",value:function(){this.__isNative&&this._animatedView&&this.__disconnectAnimatedView();for(var e in this._props){var i=this._props[e];i instanceof s&&i.__removeChild(this)}babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"__detach",this).call(this)}},{key:"update",value:function(){this._callback()}},{key:"__makeNative",value:function(){if(!this.__isNative){this.__isNative=!0;for(var e in this._props){var t=this._props[e];t instanceof s&&t.__makeNative()}this._animatedView&&this.__connectAnimatedView()}}},{key:"setNativeView",value:function(e){this._animatedView!==e&&(this._animatedView=e,this.__isNative&&this.__connectAnimatedView())}},{key:"__connectAnimatedView",value:function(){c(this.__isNative,'Expected node to be marked as "native"');var e=r.findNodeHandle(this._animatedView);c(null!=e,'Unable to locate attached view in the native tree'),o.API.connectAnimatedNodeToView(this.__getNativeTag(),e)}},{key:"__disconnectAnimatedView",value:function(){c(this.__isNative,'Expected node to be marked as "native"');var e=r.findNodeHandle(this._animatedView);c(null!=e,'Unable to locate attached view in the native tree'),o.API.disconnectAnimatedNodeFromView(this.__getNativeTag(),e)}},{key:"__getNativeConfig",value:function(){var e={};for(var t in this._props){var i=this._props[t];i instanceof s&&(e[t]=i.__getNativeTag())}return{type:'props',props:e}}}]),t})(s);i.exports=l},188); -__d(function(e,t,a,s){'use strict';var r=t(178),l=t(190),i=t(180),n=t(179),_=t(62),o=(function(e){babelHelpers.inherits(t,e);function t(e){babelHelpers.classCallCheck(this,t);var a=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return(e=_(e)||{}).transform&&(e=babelHelpers.extends({},e,{transform:new l(e.transform)})),a._style=e,a}return babelHelpers.createClass(t,[{key:"_walkStyleAndGetValues",value:function(e){var t={};for(var a in e){var s=e[a];s instanceof r?s.__isNative||(t[a]=s.__getValue()):s&&!Array.isArray(s)&&'object'==typeof s?t[a]=this._walkStyleAndGetValues(s):t[a]=s}return t}},{key:"__getValue",value:function(){return this._walkStyleAndGetValues(this._style)}},{key:"_walkStyleAndGetAnimatedValues",value:function(e){var t={};for(var a in e){var s=e[a];s instanceof r?t[a]=s.__getAnimatedValue():s&&!Array.isArray(s)&&'object'==typeof s&&(t[a]=this._walkStyleAndGetAnimatedValues(s))}return t}},{key:"__getAnimatedValue",value:function(){return this._walkStyleAndGetAnimatedValues(this._style)}},{key:"__attach",value:function(){for(var e in this._style){var t=this._style[e];t instanceof r&&t.__addChild(this)}}},{key:"__detach",value:function(){for(var e in this._style){var a=this._style[e];a instanceof r&&a.__removeChild(this)}babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"__detach",this).call(this)}},{key:"__makeNative",value:function(){babelHelpers.get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"__makeNative",this).call(this);for(var e in this._style){var a=this._style[e];a instanceof r&&a.__makeNative()}}},{key:"__getNativeConfig",value:function(){var e={};for(var t in this._style)this._style[t]instanceof r&&(e[t]=this._style[t].__getNativeTag());return n.validateStyles(e),{type:'style',style:e}}}]),t})(i);a.exports=o},189); -__d(function(t,e,r,a){'use strict';var n=e(178),o=e(180),i=e(179),s=(function(t){babelHelpers.inherits(e,t);function e(t){babelHelpers.classCallCheck(this,e);var r=babelHelpers.possibleConstructorReturn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r._transforms=t,r}return babelHelpers.createClass(e,[{key:"__makeNative",value:function(){babelHelpers.get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"__makeNative",this).call(this),this._transforms.forEach(function(t){for(var e in t){var r=t[e];r instanceof n&&r.__makeNative()}})}},{key:"__getValue",value:function(){return this._transforms.map(function(t){var e={};for(var r in t){var a=t[r];e[r]=a instanceof n?a.__getValue():a}return e})}},{key:"__getAnimatedValue",value:function(){return this._transforms.map(function(t){var e={};for(var r in t){var a=t[r];e[r]=a instanceof n?a.__getAnimatedValue():a}return e})}},{key:"__attach",value:function(){var t=this;this._transforms.forEach(function(e){for(var r in e){var a=e[r];a instanceof n&&a.__addChild(t)}})}},{key:"__detach",value:function(){var t=this;this._transforms.forEach(function(e){for(var r in e){var a=e[r];a instanceof n&&a.__removeChild(t)}}),babelHelpers.get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"__detach",this).call(this)}},{key:"__getNativeConfig",value:function(){var t=[];return this._transforms.forEach(function(e){for(var r in e){var a=e[r];a instanceof n?t.push({type:'animated',property:r,nodeTag:a.__getNativeTag()}):t.push({type:'static',property:r,value:a})}}),i.validateTransform(t),{type:'transform',transforms:t}}}]),e})(o);r.exports=s},190); -__d(function(t,e,a,i){'use strict';e(176);var _=(function(t){babelHelpers.inherits(e,t);function e(t,a,i,_,l){babelHelpers.classCallCheck(this,e);var n=babelHelpers.possibleConstructorReturn(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n._value=t,n._parent=a,n._animationClass=i,n._animationConfig=_,n._callback=l,n.__attach(),n}return babelHelpers.createClass(e,[{key:"__getValue",value:function(){return this._parent.__getValue()}},{key:"__attach",value:function(){this._parent.__addChild(this)}},{key:"__detach",value:function(){this._parent.__removeChild(this),babelHelpers.get(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"__detach",this).call(this)}},{key:"update",value:function(){this._value.animate(new this._animationClass(babelHelpers.extends({},this._animationConfig,{toValue:this._animationConfig.toValue.__getValue()})),this._callback)}}]),e})(e(178));a.exports=_},191); -__d(function(e,t,s,i){'use strict';var n=t(176),a=t(180),r=t(22),l=1,u=(function(e){babelHelpers.inherits(t,e);function t(e){babelHelpers.classCallCheck(this,t);var s=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),i=e||{x:0,y:0};return'number'==typeof i.x&&'number'==typeof i.y?(s.x=new n(i.x),s.y=new n(i.y)):(r(i.x instanceof n&&i.y instanceof n,"AnimatedValueXY must be initalized with an object of numbers or AnimatedValues."),s.x=i.x,s.y=i.y),s._listeners={},s}return babelHelpers.createClass(t,[{key:"setValue",value:function(e){this.x.setValue(e.x),this.y.setValue(e.y)}},{key:"setOffset",value:function(e){this.x.setOffset(e.x),this.y.setOffset(e.y)}},{key:"flattenOffset",value:function(){this.x.flattenOffset(),this.y.flattenOffset()}},{key:"extractOffset",value:function(){this.x.extractOffset(),this.y.extractOffset()}},{key:"__getValue",value:function(){return{x:this.x.__getValue(),y:this.y.__getValue()}}},{key:"resetAnimation",value:function(e){this.x.resetAnimation(),this.y.resetAnimation(),e&&e(this.__getValue())}},{key:"stopAnimation",value:function(e){this.x.stopAnimation(),this.y.stopAnimation(),e&&e(this.__getValue())}},{key:"addListener",value:function(e){var t=this,s=String(l++),i=function(s){s.value;e(t.__getValue())};return this._listeners[s]={x:this.x.addListener(i),y:this.y.addListener(i)},s}},{key:"removeListener",value:function(e){this.x.removeListener(this._listeners[e].x),this.y.removeListener(this._listeners[e].y),delete this._listeners[e]}},{key:"removeAllListeners",value:function(){this.x.removeAllListeners(),this.y.removeAllListeners(),this._listeners={}}},{key:"getLayout",value:function(){return{left:this.x,top:this.y}}},{key:"getTranslateTransform",value:function(){return[{translateX:this.x},{translateY:this.y}]}}]),t})(a);s.exports=u},192); -__d(function(t,e,i,a){'use strict';var s=e(194),n=e(179).shouldUseNativeDriver,o=(function(e){babelHelpers.inherits(i,e);function i(t){babelHelpers.classCallCheck(this,i);var e=babelHelpers.possibleConstructorReturn(this,(i.__proto__||Object.getPrototypeOf(i)).call(this));return e._deceleration=void 0!==t.deceleration?t.deceleration:.998,e._velocity=t.velocity,e._useNativeDriver=n(t),e.__isInteraction=void 0===t.isInteraction||t.isInteraction,e.__iterations=void 0!==t.iterations?t.iterations:1,e}return babelHelpers.createClass(i,[{key:"__getNativeAnimationConfig",value:function(){return{type:'decay',deceleration:this._deceleration,velocity:this._velocity,iterations:this.__iterations}}},{key:"start",value:function(t,e,i,a,s){this.__active=!0,this._lastValue=t,this._fromValue=t,this._onUpdate=e,this.__onEnd=i,this._startTime=Date.now(),this._useNativeDriver?this.__startNativeAnimation(s):this._animationFrame=requestAnimationFrame(this.onUpdate.bind(this))}},{key:"onUpdate",value:function(){var t=Date.now(),e=this._fromValue+this._velocity/(1-this._deceleration)*(1-Math.exp(-(1-this._deceleration)*(t-this._startTime)));this._onUpdate(e),Math.abs(this._lastValue-e)<.1?this.__debouncedOnEnd({finished:!0}):(this._lastValue=e,this.__active&&(this._animationFrame=requestAnimationFrame(this.onUpdate.bind(this))))}},{key:"stop",value:function(){babelHelpers.get(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"stop",this).call(this),this.__active=!1,t.cancelAnimationFrame(this._animationFrame),this.__debouncedOnEnd({finished:!1})}}]),i})(s);i.exports=o},193); -__d(function(t,n,e,i){'use strict';var a=n(179),o=(function(){function t(){babelHelpers.classCallCheck(this,t)}return babelHelpers.createClass(t,[{key:"start",value:function(t,n,e,i,a){}},{key:"stop",value:function(){this.__nativeId&&a.API.stopAnimation(this.__nativeId)}},{key:"__getNativeAnimationConfig",value:function(){throw new Error('This animation type cannot be offloaded to native')}},{key:"__debouncedOnEnd",value:function(t){var n=this.__onEnd;this.__onEnd=null,n&&n(t)}},{key:"__startNativeAnimation",value:function(t){t.__makeNative(),this.__nativeId=a.generateNewAnimationId(),a.API.startAnimatingNode(this.__nativeId,t.__getNativeTag(),this.__getNativeAnimationConfig(),this.__debouncedOnEnd.bind(this))}}]),t})();e.exports=o},194); -__d(function(t,i,s,e){'use strict';i(176),i(192);var a=i(194),o=i(196),n=i(22),h=i(179).shouldUseNativeDriver;function r(t,i){return void 0===t||null===t?i:t}var l=(function(i){babelHelpers.inherits(s,i);function s(t){babelHelpers.classCallCheck(this,s);var i=babelHelpers.possibleConstructorReturn(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));if(i._overshootClamping=r(t.overshootClamping,!1),i._restDisplacementThreshold=r(t.restDisplacementThreshold,.001),i._restSpeedThreshold=r(t.restSpeedThreshold,.001),i._initialVelocity=r(t.velocity,0),i._lastVelocity=r(t.velocity,0),i._toValue=t.toValue,i._delay=r(t.delay,0),i._useNativeDriver=h(t),i.__isInteraction=void 0===t.isInteraction||t.isInteraction,i.__iterations=void 0!==t.iterations?t.iterations:1,void 0!==t.stiffness||void 0!==t.damping||void 0!==t.mass)n(void 0===t.bounciness&&void 0===t.speed&&void 0===t.tension&&void 0===t.friction,'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one'),i._stiffness=r(t.stiffness,100),i._damping=r(t.damping,10),i._mass=r(t.mass,1);else if(void 0!==t.bounciness||void 0!==t.speed){n(void 0===t.tension&&void 0===t.friction&&void 0===t.stiffness&&void 0===t.damping&&void 0===t.mass,'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one');var e=o.fromBouncinessAndSpeed(r(t.bounciness,8),r(t.speed,12));i._stiffness=e.stiffness,i._damping=e.damping,i._mass=1}else{var a=o.fromOrigamiTensionAndFriction(r(t.tension,40),r(t.friction,7));i._stiffness=a.stiffness,i._damping=a.damping,i._mass=1}return n(i._stiffness>0,'Stiffness value must be greater than 0'),n(i._damping>0,'Damping value must be greater than 0'),n(i._mass>0,'Mass value must be greater than 0'),i}return babelHelpers.createClass(s,[{key:"__getNativeAnimationConfig",value:function(){return{type:'spring',overshootClamping:this._overshootClamping,restDisplacementThreshold:this._restDisplacementThreshold,restSpeedThreshold:this._restSpeedThreshold,stiffness:this._stiffness,damping:this._damping,mass:this._mass,initialVelocity:r(this._initialVelocity,this._lastVelocity),toValue:this._toValue,iterations:this.__iterations}}},{key:"start",value:function(t,i,e,a,o){var n=this;if(this.__active=!0,this._startPosition=t,this._lastPosition=this._startPosition,this._onUpdate=i,this.__onEnd=e,this._lastTime=Date.now(),this._frameTime=0,a instanceof s){var h=a.getInternalState();this._lastPosition=h.lastPosition,this._lastVelocity=h.lastVelocity,this._initialVelocity=this._lastVelocity,this._lastTime=h.lastTime}var r=function(){n._useNativeDriver?n.__startNativeAnimation(o):n.onUpdate()};this._delay?this._timeout=setTimeout(r,this._delay):r()}},{key:"getInternalState",value:function(){return{lastPosition:this._lastPosition,lastVelocity:this._lastVelocity,lastTime:this._lastTime}}},{key:"onUpdate",value:function(){var t=Date.now();t>this._lastTime+64&&(t=this._lastTime+64);var i=(t-this._lastTime)/1e3;this._frameTime+=i;var s=this._damping,e=this._mass,a=this._stiffness,o=-this._initialVelocity,n=s/(2*Math.sqrt(a*e)),h=Math.sqrt(a/e),r=h*Math.sqrt(1-n*n),l=this._toValue-this._startPosition,_=0,d=0,m=this._frameTime;if(n<1){var f=Math.exp(-n*h*m);_=this._toValue-f*((o+n*h*l)/r*Math.sin(r*m)+l*Math.cos(r*m)),d=n*h*f*(Math.sin(r*m)*(o+n*h*l)/r+l*Math.cos(r*m))-f*(Math.cos(r*m)*(o+n*h*l)-r*l*Math.sin(r*m))}else{var c=Math.exp(-h*m);_=this._toValue-c*(l+(o+h*l)*m),d=c*(o*(m*h-1)+m*l*(h*h))}if(this._lastTime=t,this._lastPosition=_,this._lastVelocity=d,this._onUpdate(_),this.__active){var u=!1;this._overshootClamping&&0!==this._stiffness&&(u=this._startPositionthis._toValue:_18&&n<=44?(r=n,44e-6*Math.pow(r,3)-.006*Math.pow(r,2)+.36*r+2):(t=n,4.5e-7*Math.pow(t,3)-332e-6*Math.pow(t,2)+.1078*t+5.84);var t,r,o})(f),.01);return{stiffness:e(f),damping:i(a)}}}},196); -__d(function(t,i,e,a){'use strict';i(176),i(192);var s=i(194),n=i(179).shouldUseNativeDriver,o=void 0;var r=(function(e){babelHelpers.inherits(a,e);function a(t){babelHelpers.classCallCheck(this,a);var e=babelHelpers.possibleConstructorReturn(this,(a.__proto__||Object.getPrototypeOf(a)).call(this));return e._toValue=t.toValue,e._easing=void 0!==t.easing?t.easing:(function(){if(!o){var t=i(198);o=t.inOut(t.ease)}return o})(),e._duration=void 0!==t.duration?t.duration:500,e._delay=void 0!==t.delay?t.delay:0,e.__iterations=void 0!==t.iterations?t.iterations:1,e.__isInteraction=void 0===t.isInteraction||t.isInteraction,e._useNativeDriver=n(t),e}return babelHelpers.createClass(a,[{key:"__getNativeAnimationConfig",value:function(){for(var t=[],i=0;i=this._startTime+this._duration)return 0===this._duration?this._onUpdate(this._toValue):this._onUpdate(this._fromValue+this._easing(1)*(this._toValue-this._fromValue)),void this.__debouncedOnEnd({finished:!0});this._onUpdate(this._fromValue+this._easing((t-this._startTime)/this._duration)*(this._toValue-this._fromValue)),this.__active&&(this._animationFrame=requestAnimationFrame(this.onUpdate.bind(this)))}},{key:"stop",value:function(){babelHelpers.get(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"stop",this).call(this),this.__active=!1,clearTimeout(this._timeout),t.cancelAnimationFrame(this._animationFrame),this.__debouncedOnEnd({finished:!1})}}]),a})(s);e.exports=r},197); -__d(function(e,n,u,t){'use strict';var r=void 0,a=(function(){function e(){babelHelpers.classCallCheck(this,e)}return babelHelpers.createClass(e,null,[{key:"step0",value:function(e){return e>0?1:0}},{key:"step1",value:function(e){return e>=1?1:0}},{key:"linear",value:function(e){return e}},{key:"ease",value:function(n){return r||(r=e.bezier(.42,0,1,1)),r(n)}},{key:"quad",value:function(e){return e*e}},{key:"cubic",value:function(e){return e*e*e}},{key:"poly",value:function(e){return function(n){return Math.pow(n,e)}}},{key:"sin",value:function(e){return 1-Math.cos(e*Math.PI/2)}},{key:"circle",value:function(e){return 1-Math.sqrt(1-e*e)}},{key:"exp",value:function(e){return Math.pow(2,10*(e-1))}},{key:"elastic",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1)*Math.PI;return function(n){return 1-Math.pow(Math.cos(n*Math.PI/2),3)*Math.cos(n*e)}}},{key:"back",value:function(e){return void 0===e&&(e=1.70158),function(n){return n*n*((e+1)*n-e)}}},{key:"bounce",value:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375}},{key:"bezier",value:function(e,u,t,r){return n(199)(e,u,t,r)}},{key:"in",value:function(e){return e}},{key:"out",value:function(e){return function(n){return 1-e(1-n)}}},{key:"inOut",value:function(e){return function(n){return n<.5?e(2*n)/2:1-e(2*(1-n))/2}}}]),e})();u.exports=a},198); -__d(function(r,n,t,u){'use strict';var e=4,o=.001,f=1e-7,i=10,a=11,c=1/(a-1),v='function'==typeof Float32Array;function s(r,n){return 1-3*n+3*r}function w(r,n){return 3*n-6*r}function l(r){return 3*r}function y(r,n,t){return((s(n,t)*r+w(n,t))*r+l(n))*r}function b(r,n,t){return 3*s(n,t)*r*r+2*w(n,t)*r+l(n)}t.exports=function(r,n,t,u){if(!(0<=r&&r<=1&&0<=t&&t<=1))throw new Error('bezier x values must be in [0, 1] range');var s=v?new Float32Array(a):new Array(a);if(r!==n||t!==u)for(var w=0;w=o?(function(r,n,t,u){for(var o=0;o0?t=a:n=a}while(Math.abs(o)>f&&++c component requires a `source` property rather than `src`.'),this.props.children)throw new Error('The component cannot contain children. If you want to render content on top of the image, consider using aboslute positioning.');return d.createElement(z,babelHelpers.extends({},this.props,{style:o,resizeMode:s,tintColor:a,source:r}))}}),I=l.create({base:{overflow:'hidden'}}),z=b('RCTImageView',y);o.exports=y},201); -__d(function(e,r,n,t){'use strict';var a=r(20),c=a.shape({uri:a.string,bundle:a.string,method:a.string,headers:a.objectOf(a.string),body:a.string,cache:a.oneOf(['default','reload','force-cache','only-if-cached']),width:a.number,height:a.number,scale:a.number}),i=a.oneOfType([c,a.number,a.arrayOf(c)]);n.exports=i},202); -__d(function(e,o,n,t){'use strict';var l=o(173),r=o(51),s=o(134),i=o(34),a=o(204),c=o(20),d=o(111),h=o(54),p=o(205),u=o(212),m=o(112),f=o(141),S=o(131),R=o(133),y=o(125),v=o(143),b=(o(208),o(62),o(22)),_=o(213),w=o(145),H=o(38),g=v({displayName:'ScrollView',propTypes:babelHelpers.extends({},R,{automaticallyAdjustContentInsets:c.bool,contentInset:s,contentOffset:a,bounces:c.bool,bouncesZoom:c.bool,alwaysBounceHorizontal:c.bool,alwaysBounceVertical:c.bool,centerContent:c.bool,contentContainerStyle:f(y),decelerationRate:c.oneOfType([c.oneOf(['fast','normal']),c.number]),horizontal:c.bool,indicatorStyle:c.oneOf(['default','black','white']),directionalLockEnabled:c.bool,canCancelContentTouches:c.bool,keyboardDismissMode:c.oneOf(['none','on-drag','interactive']),keyboardShouldPersistTaps:c.oneOf(['always','never','handled',!1,!0]),maximumZoomScale:c.number,minimumZoomScale:c.number,onMomentumScrollBegin:c.func,onMomentumScrollEnd:c.func,onScroll:c.func,onContentSizeChange:c.func,pagingEnabled:c.bool,pinchGestureEnabled:c.bool,scrollEnabled:c.bool,scrollEventThrottle:c.number,scrollIndicatorInsets:s,scrollsToTop:c.bool,showsHorizontalScrollIndicator:c.bool,showsVerticalScrollIndicator:c.bool,stickyHeaderIndices:c.arrayOf(c.number),snapToInterval:c.number,snapToAlignment:c.oneOf(['start','center','end']),removeClippedSubviews:c.bool,zoomScale:c.number,contentInsetAdjustmentBehavior:c.oneOf(['automatic','scrollableAxes','never','always']),refreshControl:c.element,endFillColor:r,scrollPerfTag:c.string,overScrollMode:c.oneOf(['auto','always','never']),DEPRECATED_sendUpdatedChildFrames:c.bool}),mixins:[p.Mixin],_scrollAnimatedValue:new l.Value(0),_scrollAnimatedValueAttachment:null,_stickyHeaderRefs:new Map,_headerLayoutYs:new Map,getInitialState:function(){return this.scrollResponderMixinGetInitialState()},componentWillMount:function(){this._scrollAnimatedValue=new l.Value(this.props.contentOffset?this.props.contentOffset.y:0),this._scrollAnimatedValue.setOffset(this.props.contentInset?this.props.contentInset.top:0),this._stickyHeaderRefs=new Map,this._headerLayoutYs=new Map},componentDidMount:function(){this._updateAnimatedNodeAttachment()},componentDidUpdate:function(){this._updateAnimatedNodeAttachment()},componentWillUnmount:function(){this._scrollAnimatedValueAttachment&&this._scrollAnimatedValueAttachment.detach()},setNativeProps:function(e){this._scrollViewRef&&this._scrollViewRef.setNativeProps(e)},getScrollResponder:function(){return this},getScrollableNode:function(){return h.findNodeHandle(this._scrollViewRef)},getInnerViewNode:function(){return h.findNodeHandle(this._innerViewRef)},scrollTo:function(e,o,n){if('number'==typeof e)console.warn("`scrollTo(y, x, animated)` is deprecated. Use `scrollTo({x: 5, y: 5, animated: true})` instead.");else{var t=e||{};o=t.x,e=t.y,n=t.animated}this.getScrollResponder().scrollResponderScrollTo({x:o||0,y:e||0,animated:!1!==n})},scrollToEnd:function(e){var o=!1!==(e&&e.animated);this.getScrollResponder().scrollResponderScrollToEnd({animated:o})},scrollWithoutAnimationTo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;console.warn('`scrollWithoutAnimationTo` is deprecated. Use `scrollTo` instead'),this.scrollTo({x:o,y:e,animated:!1})},flashScrollIndicators:function(){this.getScrollResponder().scrollResponderFlashScrollIndicators()},_getKeyForIndex:function(e,o){var n=o[e];return n&&n.key},_updateAnimatedNodeAttachment:function(){this._scrollAnimatedValueAttachment&&this._scrollAnimatedValueAttachment.detach(),this.props.stickyHeaderIndices&&this.props.stickyHeaderIndices.length>0&&(this._scrollAnimatedValueAttachment=l.attachNativeEvent(this._scrollViewRef,'onScroll',[{nativeEvent:{contentOffset:{y:this._scrollAnimatedValue}}}]))},_setStickyHeaderRef:function(e,o){o?this._stickyHeaderRefs.set(e,o):this._stickyHeaderRefs.delete(e)},_onStickyHeaderLayout:function(e,o,n){if(this.props.stickyHeaderIndices){var t=d.Children.toArray(this.props.children);if(n===this._getKeyForIndex(e,t)){var l=o.nativeEvent.layout.y;this._headerLayoutYs.set(n,l);var r=this.props.stickyHeaderIndices.indexOf(e),s=this.props.stickyHeaderIndices[r-1];if(null!=s){var i=this._stickyHeaderRefs.get(this._getKeyForIndex(s,t));i&&i.setNextHeaderY(l)}}}},_handleScroll:function(e){this.scrollResponderHandleScroll(e)},_handleContentOnLayout:function(e){var o=e.nativeEvent.layout,n=o.width,t=o.height;this.props.onContentSizeChange&&this.props.onContentSizeChange(n,t)},_scrollViewRef:null,_setScrollViewRef:function(e){this._scrollViewRef=e},_innerViewRef:null,_setInnerViewRef:function(e){this._innerViewRef=e},render:function(){var e=this,o=void 0,n=void 0;o=T,n=V,H(!this.props.snapToInterval||!this.props.pagingEnabled,'snapToInterval is currently ignored when pagingEnabled is true.'),b(void 0!==o,'ScrollViewClass must not be undefined'),b(void 0!==n,'ScrollContentContainerViewClass must not be undefined');var t=[this.props.horizontal&&C.contentContainerHorizontal,this.props.contentContainerStyle],l={};this.props.onContentSizeChange&&(l={onLayout:this._handleContentOnLayout});var r=this.props.stickyHeaderIndices,s=r&&r.length>0,a=s&&d.Children.toArray(this.props.children),c=s?a.map(function(o,n){var t=o?r.indexOf(n):-1;if(t>-1){var l=o.key,s=r[t+1];return d.createElement(u,{key:l,ref:function(o){return e._setStickyHeaderRef(l,o)},nextHeaderLayoutY:e._headerLayoutYs.get(e._getKeyForIndex(s,a)),onLayout:function(o){return e._onStickyHeaderLayout(n,o,l)},scrollAnimatedValue:e._scrollAnimatedValue},o)}return o}):this.props.children,h=d.createElement(n,babelHelpers.extends({},l,{ref:this._setInnerViewRef,style:t,removeClippedSubviews:this.props.removeClippedSubviews,collapsable:!1}),c),p=void 0!==this.props.alwaysBounceHorizontal?this.props.alwaysBounceHorizontal:this.props.horizontal,m=void 0!==this.props.alwaysBounceVertical?this.props.alwaysBounceVertical:!this.props.horizontal,f=!!this.props.DEPRECATED_sendUpdatedChildFrames,S=this.props.horizontal?C.baseHorizontal:C.baseVertical,R=babelHelpers.extends({},this.props,{alwaysBounceHorizontal:p,alwaysBounceVertical:m,style:[S,this.props.style],onContentSizeChange:null,onMomentumScrollBegin:this.scrollResponderHandleMomentumScrollBegin,onMomentumScrollEnd:this.scrollResponderHandleMomentumScrollEnd,onResponderGrant:this.scrollResponderHandleResponderGrant,onResponderReject:this.scrollResponderHandleResponderReject,onResponderRelease:this.scrollResponderHandleResponderRelease,onResponderTerminate:this.scrollResponderHandleTerminate,onResponderTerminationRequest:this.scrollResponderHandleTerminationRequest,onScroll:this._handleScroll,onScrollBeginDrag:this.scrollResponderHandleScrollBeginDrag,onScrollEndDrag:this.scrollResponderHandleScrollEndDrag,onScrollShouldSetResponder:this.scrollResponderHandleScrollShouldSetResponder,onStartShouldSetResponder:this.scrollResponderHandleStartShouldSetResponder,onStartShouldSetResponderCapture:this.scrollResponderHandleStartShouldSetResponderCapture,onTouchEnd:this.scrollResponderHandleTouchEnd,onTouchMove:this.scrollResponderHandleTouchMove,onTouchStart:this.scrollResponderHandleTouchStart,onTouchCancel:this.scrollResponderHandleTouchCancel,scrollEventThrottle:s?1:this.props.scrollEventThrottle,sendMomentumEvents:!(!this.props.onMomentumScrollBegin&&!this.props.onMomentumScrollEnd),DEPRECATED_sendUpdatedChildFrames:f}),y=this.props.decelerationRate;y&&(R.decelerationRate=_(y));var v=this.props.refreshControl;return v?d.createElement(o,babelHelpers.extends({},R,{ref:this._setScrollViewRef}),i.isTVOS?null:v,h):d.createElement(o,babelHelpers.extends({},R,{ref:this._setScrollViewRef}),h)}}),C=m.create({baseVertical:{flexGrow:1,flexShrink:1,flexDirection:'column',overflow:'scroll'},baseHorizontal:{flexGrow:1,flexShrink:1,flexDirection:'row',overflow:'scroll'},contentContainerHorizontal:{flexDirection:'row'}}),T=void 0,V=void 0;T=w('RCTScrollView',g,{nativeOnly:{onMomentumScrollBegin:!0,onMomentumScrollEnd:!0,onScrollBeginDrag:!0,onScrollEndDrag:!0}}),V=w('RCTScrollContentView',S),n.exports=g},203); -__d(function(r,e,n,t){'use strict';var u=e(20),s=e(135)({x:u.number,y:u.number});n.exports=s},204); -__d(function(e,o,n,s){'use strict';var r=o(114),l=o(206),t=o(207),i=o(54),d=o(209),a=o(64),c=o(65),p=o(22),h=o(210),u=o(35),S=o(38),m=o(26).ScrollViewManager,R=o(211).getInstanceFromNode;var T={Mixin:{mixins:[d.Mixin],scrollResponderMixinGetInitialState:function(){return{isTouching:!1,lastMomentumScrollBeginTime:0,lastMomentumScrollEndTime:0,observedScrollSinceBecomingResponder:!1,becameResponderWhileAnimating:!1}},scrollResponderHandleScrollShouldSetResponder:function(){return this.state.isTouching},scrollResponderHandleStartShouldSetResponder:function(e){var o=a.currentlyFocusedField();return'handled'===this.props.keyboardShouldPersistTaps&&null!=o&&e.target!==o},scrollResponderHandleStartShouldSetResponderCapture:function(e){var o=a.currentlyFocusedField(),n=this.props.keyboardShouldPersistTaps;return!(n&&'never'!==n||null==o||(function(e){var o=R(e);return o&&o.viewConfig&&('AndroidTextInput'===o.viewConfig.uiViewClassName||'RCTTextView'===o.viewConfig.uiViewClassName||'RCTTextField'===o.viewConfig.uiViewClassName)})(e.target))||this.scrollResponderIsAnimating()},scrollResponderHandleResponderReject:function(){},scrollResponderHandleTerminationRequest:function(){return!this.state.observedScrollSinceBecomingResponder},scrollResponderHandleTouchEnd:function(e){var o=e.nativeEvent;this.state.isTouching=0!==o.touches.length,this.props.onTouchEnd&&this.props.onTouchEnd(e)},scrollResponderHandleTouchCancel:function(e){this.state.isTouching=!1,this.props.onTouchCancel&&this.props.onTouchCancel(e)},scrollResponderHandleResponderRelease:function(e){this.props.onResponderRelease&&this.props.onResponderRelease(e);var o=a.currentlyFocusedField();!0===this.props.keyboardShouldPersistTaps||'always'===this.props.keyboardShouldPersistTaps||null==o||e.target===o||this.state.observedScrollSinceBecomingResponder||this.state.becameResponderWhileAnimating||(this.props.onScrollResponderKeyboardDismissed&&this.props.onScrollResponderKeyboardDismissed(e),a.blurTextInput(o))},scrollResponderHandleScroll:function(e){this.state.observedScrollSinceBecomingResponder=!0,this.props.onScroll&&this.props.onScroll(e)},scrollResponderHandleResponderGrant:function(e){this.state.observedScrollSinceBecomingResponder=!1,this.props.onResponderGrant&&this.props.onResponderGrant(e),this.state.becameResponderWhileAnimating=this.scrollResponderIsAnimating()},scrollResponderHandleScrollBeginDrag:function(e){l.beginScroll(),this.props.onScrollBeginDrag&&this.props.onScrollBeginDrag(e)},scrollResponderHandleScrollEndDrag:function(e){var o=e.nativeEvent.velocity;this.scrollResponderIsAnimating()||o&&(0!==o.x||0!==o.y)||l.endScroll(),this.props.onScrollEndDrag&&this.props.onScrollEndDrag(e)},scrollResponderHandleMomentumScrollBegin:function(e){this.state.lastMomentumScrollBeginTime=u(),this.props.onMomentumScrollBegin&&this.props.onMomentumScrollBegin(e)},scrollResponderHandleMomentumScrollEnd:function(e){l.endScroll(),this.state.lastMomentumScrollEndTime=u(),this.props.onMomentumScrollEnd&&this.props.onMomentumScrollEnd(e)},scrollResponderHandleTouchStart:function(e){this.state.isTouching=!0,this.props.onTouchStart&&this.props.onTouchStart(e)},scrollResponderHandleTouchMove:function(e){this.props.onTouchMove&&this.props.onTouchMove(e)},scrollResponderIsAnimating:function(){return u()-this.state.lastMomentumScrollEndTime<16||this.state.lastMomentumScrollEndTime=o?(l.push(p,p+1),i.push(p-o,p-o)):(l.push(o+1),i.push(1))}var y=this.props.scrollAnimatedValue.interpolate({inputRange:l,outputRange:i}),h=n.Children.only(this.props.children);return n.createElement(r.View,{collapsable:!1,onLayout:this._onLayout,style:[h.props.style,u.header,{transform:[{translateY:y}]}]},n.cloneElement(h,{style:u.fill,onLayout:void 0}))}}]),t})(n.Component),u=s.create({header:{zIndex:10},fill:{flex:1}});a.exports=l},212); -__d(function(t,n,r,o){'use strict';r.exports=function(t){return'normal'===t?t=.998:'fast'===t&&(t=.99),t}},213); -__d(function(i,t,e,n){'use strict';var a='undefined'==typeof window?i:window,r=function(i,t,e){return function(n,a){var r=i(function(){t.call(this,r),n.apply(this,arguments)}.bind(this),a);return this[e]?this[e].push(r):this[e]=[r],r}},s=function(i,t){return function(e){if(this[t]){var n=this[t].indexOf(e);-1!==n&&this[t].splice(n,1)}i(e)}},c='TimerMixin_timeouts',m=s(a.clearTimeout,c),o=r(a.setTimeout,m,c),l='TimerMixin_intervals',u=s(a.clearInterval,l),h=r(a.setInterval,function(){},l),f='TimerMixin_immediates',d=s(a.clearImmediate,f),I=r(a.setImmediate,d,f),v='TimerMixin_rafs',T=s(a.cancelAnimationFrame,v),p={componentWillUnmount:function(){this[c]&&this[c].forEach(function(i){a.clearTimeout(i)}),this[c]=null,this[l]&&this[l].forEach(function(i){a.clearInterval(i)}),this[l]=null,this[f]&&this[f].forEach(function(i){a.clearImmediate(i)}),this[f]=null,this[v]&&this[v].forEach(function(i){a.cancelAnimationFrame(i)}),this[v]=null},setTimeout:o,clearTimeout:m,setInterval:h,clearInterval:u,setImmediate:I,clearImmediate:d,requestAnimationFrame:r(a.requestAnimationFrame,T,v),cancelAnimationFrame:T};e.exports=p},214); -__d(function(e,s,t,o){'use strict';var n=s(134),i=s(111),r=s(20),p=s(214),a=s(164),l=s(143),c=s(216),h=s(38),u=s(142),d=u.AccessibilityComponentTypes,y=u.AccessibilityTraits,b={top:20,left:20,right:20,bottom:30},f=l({displayName:'TouchableWithoutFeedback',mixins:[p,a.Mixin],propTypes:{accessible:r.bool,accessibilityComponentType:r.oneOf(d),accessibilityTraits:r.oneOfType([r.oneOf(y),r.arrayOf(r.oneOf(y))]),disabled:r.bool,onPress:r.func,onPressIn:r.func,onPressOut:r.func,onLayout:r.func,onLongPress:r.func,delayPressIn:r.number,delayPressOut:r.number,delayLongPress:r.number,pressRetentionOffset:n,hitSlop:n},getInitialState:function(){return this.touchableGetInitialState()},componentDidMount:function(){c(this.props)},componentWillReceiveProps:function(e){c(e)},touchableHandlePress:function(e){this.props.onPress&&this.props.onPress(e)},touchableHandleActivePressIn:function(e){this.props.onPressIn&&this.props.onPressIn(e)},touchableHandleActivePressOut:function(e){this.props.onPressOut&&this.props.onPressOut(e)},touchableHandleLongPress:function(e){this.props.onLongPress&&this.props.onLongPress(e)},touchableGetPressRectOffset:function(){return this.props.pressRetentionOffset||b},touchableGetHitSlop:function(){return this.props.hitSlop},touchableGetHighlightDelayMS:function(){return this.props.delayPressIn||0},touchableGetLongPressDelayMS:function(){return 0===this.props.delayLongPress?0:this.props.delayLongPress||500},touchableGetPressOutDelayMS:function(){return this.props.delayPressOut||0},render:function(){var e=i.Children.only(this.props.children),s=e.props.children;h(!e.type||'Text'!==e.type.displayName,'TouchableWithoutFeedback does not work well with Text children. Wrap children in a View instead. See '+(e._owner&&e._owner.getName&&e._owner.getName()||'')),a.TOUCH_TARGET_DEBUG&&e.type&&'View'===e.type.displayName&&(s=i.Children.toArray(s)).push(a.renderDebugView({color:'red',hitSlop:this.props.hitSlop}));var t=a.TOUCH_TARGET_DEBUG&&e.type&&'Text'===e.type.displayName?[e.props.style,{color:'red'}]:e.props.style;return i.cloneElement(e,{accessible:!1!==this.props.accessible,accessibilityLabel:this.props.accessibilityLabel,accessibilityComponentType:this.props.accessibilityComponentType,accessibilityTraits:this.props.accessibilityTraits,nativeID:this.props.nativeID,testID:this.props.testID,onLayout:this.props.onLayout,hitSlop:this.props.hitSlop,onStartShouldSetResponder:this.touchableHandleStartShouldSetResponder,onResponderTerminationRequest:this.touchableHandleResponderTerminationRequest,onResponderGrant:this.touchableHandleResponderGrant,onResponderMove:this.touchableHandleResponderMove,onResponderRelease:this.touchableHandleResponderRelease,onResponderTerminate:this.touchableHandleResponderTerminate,style:t,children:s})}});t.exports=f},215); -__d(function(e,n,s,t){'use strict';var a=n(22);s.exports=function(e){a(!(e.delayPressIn<0||e.delayPressOut<0||e.delayLongPress<0),'Touchable components cannot have negative delay properties')}},216); -__d(function(t,s,c,e){'use strict';c.exports=s(110)},217); -__d(function(e,t,n,i){'use strict';var a=t(53),m=t(111),r=t(20),s=t(112),o=t(131),u=t(133),p=t(143),d=t(145),c=p({displayName:'DatePickerIOS',_picker:void 0,mixins:[a],propTypes:babelHelpers.extends({},u,{date:r.instanceOf(Date).isRequired,onDateChange:r.func.isRequired,maximumDate:r.instanceOf(Date),minimumDate:r.instanceOf(Date),mode:r.oneOf(['date','time','datetime']),minuteInterval:r.oneOf([1,2,3,4,5,6,10,12,15,20,30]),timeZoneOffsetInMinutes:r.number}),getDefaultProps:function(){return{mode:'datetime'}},_onChange:function(e){var t=e.nativeEvent.timestamp;this.props.onDateChange&&this.props.onDateChange(new Date(t)),this.props.onChange&&this.props.onChange(e);var n=this.props.date.getTime();this._picker&&t!==n&&this._picker.setNativeProps({date:n})},render:function(){var e=this,t=this.props;return m.createElement(o,{style:t.style},m.createElement(h,{ref:function(t){e._picker=t},style:f.datePickerIOS,date:t.date.getTime(),maximumDate:t.maximumDate?t.maximumDate.getTime():void 0,minimumDate:t.minimumDate?t.minimumDate.getTime():void 0,mode:t.mode,minuteInterval:t.minuteInterval,timeZoneOffsetInMinutes:t.timeZoneOffsetInMinutes,onChange:this._onChange,onStartShouldSetResponder:function(){return!0},onResponderTerminationRequest:function(){return!1}}))}}),f=s.create({datePickerIOS:{height:216}}),h=d('RCTDatePicker',{propTypes:babelHelpers.extends({},c.propTypes,{date:r.number,minimumDate:r.number,maximumDate:r.number,onDateChange:function(){return null},onChange:r.func})});n.exports=c},218); -__d(function(t,s,c,e){'use strict';c.exports=s(110)},219); -__d(function(e,t,n,i){'use strict';var s=t(221),o=t(111),r=t(131),a=t(228),l=t(22),u=babelHelpers.extends({},a.defaultProps,{numColumns:1}),c=(function(e){babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"scrollToEnd",value:function(e){this._listRef.scrollToEnd(e)}},{key:"scrollToIndex",value:function(e){this._listRef.scrollToIndex(e)}},{key:"scrollToItem",value:function(e){this._listRef.scrollToItem(e)}},{key:"scrollToOffset",value:function(e){this._listRef.scrollToOffset(e)}},{key:"recordInteraction",value:function(){this._listRef.recordInteraction()}},{key:"flashScrollIndicators",value:function(){this._listRef.flashScrollIndicators()}},{key:"getScrollResponder",value:function(){if(this._listRef)return this._listRef.getScrollResponder()}},{key:"getScrollableNode",value:function(){if(this._listRef)return this._listRef.getScrollableNode()}},{key:"setNativeProps",value:function(e){this._listRef&&this._listRef.setNativeProps(e)}},{key:"componentWillMount",value:function(){this._checkProps(this.props)}},{key:"componentWillReceiveProps",value:function(e){l(e.numColumns===this.props.numColumns,"Changing numColumns on the fly is not supported. Change the key prop on FlatList when changing the number of columns to force a fresh render of the component."),l(e.onViewableItemsChanged===this.props.onViewableItemsChanged,'Changing onViewableItemsChanged on the fly is not supported'),l(e.viewabilityConfig===this.props.viewabilityConfig,'Changing viewabilityConfig on the fly is not supported'),l(e.viewabilityConfigCallbackPairs===this.props.viewabilityConfigCallbackPairs,'Changing viewabilityConfigCallbackPairs on the fly is not supported'),this._checkProps(e)}}]);function t(e){babelHelpers.classCallCheck(this,t);var n=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._hasWarnedLegacy=!1,n._virtualizedListPairs=[],n._captureRef=function(e){n._listRef=e},n._getItem=function(e,t){var i=n.props.numColumns;if(i>1){for(var s=[],o=0;o1?(l(Array.isArray(e),"FlatList: Encountered internal consistency error, expected each item to consist of an array with 1-%s columns; instead, received a single item.",o),e.map(function(e,n){return s(e,t*o+n)}).join(':')):s(e,t)},n._renderItem=function(e){var t=n.props,i=t.renderItem,s=t.numColumns,a=t.columnWrapperStyle;if(s>1){var u=e.item,c=e.index;return l(Array.isArray(u),'Expected array of items with numColumns > 1'),o.createElement(r,{style:[{flexDirection:'row'},a]},u.map(function(t,n){var r=i({item:t,index:c*s+n,separators:e.separators});return r&&o.cloneElement(r,{key:n})}))}return i(e)},n.props.viewabilityConfigCallbackPairs?n._virtualizedListPairs=n.props.viewabilityConfigCallbackPairs.map(function(e){return{viewabilityConfig:e.viewabilityConfig,onViewableItemsChanged:n._createOnViewableItemsChanged(e.onViewableItemsChanged)}}):n.props.onViewableItemsChanged&&n._virtualizedListPairs.push({viewabilityConfig:n.props.viewabilityConfig,onViewableItemsChanged:n._createOnViewableItemsChanged(n.props.onViewableItemsChanged)}),n}return babelHelpers.createClass(t,[{key:"_checkProps",value:function(e){var t=e.getItem,n=e.getItemCount,i=e.horizontal,s=e.legacyImplementation,o=e.numColumns,r=e.columnWrapperStyle,a=e.onViewableItemsChanged,u=e.viewabilityConfigCallbackPairs;l(!t&&!n,'FlatList does not support custom data formats.'),o>1?l(!i,'numColumns does not support horizontal.'):l(!r,'columnWrapperStyle not supported for single column lists'),s&&(l(1===o,'Legacy list does not support multiple columns.'),this._hasWarnedLegacy||(console.warn("FlatList: Using legacyImplementation - some features not supported and performance may suffer"),this._hasWarnedLegacy=!0)),l(!(a&&u),"FlatList does not support setting both onViewableItemsChanged and viewabilityConfigCallbackPairs.")}},{key:"_pushMultiColumnViewable",value:function(e,t){var n=this.props,i=n.numColumns,s=n.keyExtractor;t.item.forEach(function(n,o){l(null!=t.index,'Missing index!');var r=t.index*i+o;e.push(babelHelpers.extends({},t,{item:n,key:s(n,r),index:r}))})}},{key:"_createOnViewableItemsChanged",value:function(e){var t=this;return function(n){var i=t.props.numColumns;if(e)if(i>1){var s=[],o=[];n.viewableItems.forEach(function(e){return t._pushMultiColumnViewable(o,e)}),n.changed.forEach(function(e){return t._pushMultiColumnViewable(s,e)}),e({viewableItems:o,changed:s})}else e(n)}}},{key:"render",value:function(){return this.props.legacyImplementation?o.createElement(s,babelHelpers.extends({},this.props,{items:this.props.data,ref:this._captureRef})):o.createElement(a,babelHelpers.extends({},this.props,{renderItem:this._renderItem,getItem:this._getItem,getItemCount:this._getItemCount,keyExtractor:this._keyExtractor,ref:this._captureRef,viewabilityConfigCallbackPairs:this._virtualizedListPairs}))}}]),t})(o.PureComponent);c.defaultProps=u,n.exports=c},220); -__d(function(e,t,r,o){'use strict';var n=t(222),s=t(111),a=t(227),i=t(203),c=t(22),l=(function(e){babelHelpers.inherits(t,e);function t(){var e,r,o,a,i=this;babelHelpers.classCallCheck(this,t);for(var l=arguments.length,p=Array(l),u=0;u=this._prevRenderedRowsCount&&o.rowShouldUpdate(p,f),b=r.createElement(c,{key:'r_'+C,shouldUpdate:!!_,render:this.props.renderRow.bind(null,o.getRowData(p,f),g,m,this._onRowHighlighted)});if(e.push(b),h++,this.props.renderSeparator&&(f!==w.length-1||p===n.length-1)){var v=this.state.highlightedRow.sectionID===g&&(this.state.highlightedRow.rowID===m||this.state.highlightedRow.rowID===w[f+1]),y=this.props.renderSeparator(g,m,v);y&&(e.push(r.createElement(u,{key:'s_'+C},y)),h++)}if(++s===this.state.curRenderedRowsCount)break}if(s>=this.state.curRenderedRowsCount)break}var E=this.props,L=E.renderScrollComponent,I=babelHelpers.objectWithoutProperties(E,["renderScrollComponent"]);return I.scrollEventThrottle||(I.scrollEventThrottle=50),void 0===I.removeClippedSubviews&&(I.removeClippedSubviews=!0),babelHelpers.extends(I,{onScroll:this._onScroll,stickyHeaderIndices:this.props.stickyHeaderIndices.concat(i),onKeyboardWillShow:void 0,onKeyboardWillHide:void 0,onKeyboardDidShow:void 0,onKeyboardDidHide:void 0}),R(L(I),{ref:this._setScrollComponentRef,onContentSizeChange:this._onContentSizeChange,onLayout:this._onLayout,DEPRECATED_sendUpdatedChildFrames:void 0!==typeof I.onChangeVisibleRows},d,e,a)},_measureAndUpdateScrollProps:function(){var e=this.getScrollResponder();e&&e.getInnerViewNode&&d&&d.calculateChildFrames&&d.calculateChildFrames(l.findNodeHandle(e),this._updateVisibleRows)},_setScrollComponentRef:function(e){this._scrollComponent=e},_onContentSizeChange:function(e,t){var o=this.props.horizontal?e:t;o!==this.scrollProperties.contentLength&&(this.scrollProperties.contentLength=o,this._updateVisibleRows(),this._renderMoreRowsIfNeeded()),this.props.onContentSizeChange&&this.props.onContentSizeChange(e,t)},_onLayout:function(e){var t=e.nativeEvent.layout,o=t.width,n=t.height,s=this.props.horizontal?o:n;s!==this.scrollProperties.visibleLength&&(this.scrollProperties.visibleLength=s,this._updateVisibleRows(),this._renderMoreRowsIfNeeded()),this.props.onLayout&&this.props.onLayout(e)},_maybeCallOnEndReached:function(e){return!!(this.props.onEndReached&&this.scrollProperties.contentLength!==this._sentEndForContentLength&&this._getDistanceFromEnd(this.scrollProperties)r||_this.props.onEndReachedThreshold&&(this._sentEndForContentLength=null),this.props.onScroll&&this.props.onScroll(e)}});o.exports=f},222); -__d(function(t,e,i,n){'use strict';var s=e(22),a=e(224),o=e(38);function r(t,e,i){return t[e][i]}function h(t,e){return t[e]}var d=(function(){function t(e){babelHelpers.classCallCheck(this,t),s(e&&'function'==typeof e.rowHasChanged,'Must provide a rowHasChanged function.'),this._rowHasChanged=e.rowHasChanged,this._getRowData=e.getRowData||r,this._sectionHeaderHasChanged=e.sectionHeaderHasChanged,this._getSectionHeaderData=e.getSectionHeaderData||h,this._dataBlob=null,this._dirtyRows=[],this._dirtySections=[],this._cachedRowCount=0,this.rowIdentities=[],this.sectionIdentities=[]}return babelHelpers.createClass(t,[{key:"cloneWithRows",value:function(t,e){var i=e?[[].concat(babelHelpers.toConsumableArray(e))]:null;return this._sectionHeaderHasChanged||(this._sectionHeaderHasChanged=function(){return!1}),this.cloneWithRowsAndSections({s1:t},['s1'],i)}},{key:"cloneWithRowsAndSections",value:function(e,i,n){s('function'==typeof this._sectionHeaderHasChanged,'Must provide a sectionHeaderHasChanged function with section data.'),s(!i||!n||i.length===n.length,'row and section ids lengths must be the same');var a=new t({getRowData:this._getRowData,getSectionHeaderData:this._getSectionHeaderData,rowHasChanged:this._rowHasChanged,sectionHeaderHasChanged:this._sectionHeaderHasChanged});return a._dataBlob=e,a.sectionIdentities=i||Object.keys(e),n?a.rowIdentities=n:(a.rowIdentities=[],a.sectionIdentities.forEach(function(t){a.rowIdentities.push(Object.keys(e[t]))})),a._cachedRowCount=(function(t){for(var e=0,i=0;i=this.rowIdentities[i].length))return this.rowIdentities[i][e];e-=this.rowIdentities[i].length}return null}},{key:"getSectionIDForFlatIndex",value:function(t){for(var e=t,i=0;i=this.rowIdentities[i].length))return this.sectionIdentities[i];e-=this.rowIdentities[i].length}return null}},{key:"getSectionLengths",value:function(){for(var t=[],e=0;e2?o-2:0),a=2;a=0&&athis._highestMeasuredFrameIndex)return m(!!i,"scrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed, otherwise there is no way to know the location of offscreen indices or handle failures."),void i({averageItemLength:this._averageCellLength,highestMeasuredFrameIndex:this._highestMeasuredFrameIndex,index:a});var c=this._getFrameMetricsApprox(a),d=Math.max(0,c.offset-(p||0)*(this._scrollMetrics.visibleLength-c.length))-(h||0);this._scrollRef.scrollTo(s?{x:d,animated:l}:{y:d,animated:l})}},{key:"scrollToItem",value:function(e){for(var t=e.item,r=this.props,s=r.data,o=r.getItem,n=(0,r.getItemCount)(s),i=0;i0){g=!1;var _=i?'width':'height',v=this.props.initialScrollIndex?-1:this.props.initialNumToRender-1,y=this.state,b=y.first,x=y.last;this._pushCells(p,u,c,0,v,h);var L=Math.max(v+1,b);if(!a&&b>v+1){var S=!1;if(c.size>0)for(var E=s?1:0,I=L-1;I>v;I--)if(c.has(I+E)){var M=this._getFrameMetricsApprox(v),R=this._getFrameMetricsApprox(I),k=R.offset-(M.offset+M.length);p.push(l.createElement(d,{key:"$sticky_lead",style:babelHelpers.defineProperty({},_,k)})),this._pushCells(p,u,c,I,I,h);var w=this._getFrameMetricsApprox(b).offset-(R.offset+R.length);p.push(l.createElement(d,{key:"$sticky_trail",style:babelHelpers.defineProperty({},_,w)})),S=!0;break}if(!S){var T=this._getFrameMetricsApprox(v),H=this._getFrameMetricsApprox(b).offset-(T.offset+T.length);p.push(l.createElement(d,{key:"$lead_spacer",style:babelHelpers.defineProperty({},_,H)}))}}if(this._pushCells(p,u,c,L,x,h),!this._hasWarned.keys&&g&&(console.warn("VirtualizedList: missing keys for items, make sure to specify a key property on each item or provide a custom keyExtractor."),this._hasWarned.keys=!0),!a&&x0||r2&&p500&&e._scrollMetrics.dt>500&&o>5*s&&!e._hasWarned.perf&&(f("VirtualizedList: You have a large list that is slow to update - make sure your renderItem function renders components that follow React performance best practices like PureComponent, shouldComponentUpdate, etc.",{dt:i,prevDt:e._scrollMetrics.dt,contentLength:o}),e._hasWarned.perf=!0);var l=n-e._scrollMetrics.offset,a=l/i;e._scrollMetrics={contentLength:o,dt:i,dOffset:l,offset:n,timestamp:r,velocity:a,visibleLength:s},e._updateViewableItems(e.props.data),e.props&&(e._maybeCallOnEndReached(),0!==a&&e._fillRateHelper.activate(),e._computeBlankness(),e._scheduleCellsToRenderUpdate())},this._onScrollBeginDrag=function(t){e._viewabilityTuples.forEach(function(e){e.viewabilityHelper.recordInteraction()}),e.props.onScrollBeginDrag&&e.props.onScrollBeginDrag(t)},this._onScrollEndDrag=function(t){var r=t.nativeEvent.velocity;r&&(e._scrollMetrics.velocity=e._selectOffset(r)),e._computeBlankness(),e.props.onScrollEndDrag&&e.props.onScrollEndDrag(t)},this._onMomentumScrollEnd=function(t){e._scrollMetrics.velocity=0,e._computeBlankness(),e.props.onMomentumScrollEnd&&e.props.onMomentumScrollEnd(t)},this._updateCellsToRender=function(){var t=e.props,r=t.data,s=t.getItemCount,o=t.onEndReachedThreshold,n=e._isVirtualizationDisabled();e._updateViewableItems(r),r&&e.setState(function(t){var i=void 0;if(n){var l=e._scrollMetrics,a=l.contentLength,h=l.offset,p=l.visibleLength,c=a-p-ht,'Tried to get frame for out of range index '+t);var a=o(s,t),h=a&&e._frames[l(a,t)];return h&&h.index===t||i&&(h=i(s,t)),h}},b=(function(e){babelHelpers.inherits(t,e);function t(){var e,r,s,o;babelHelpers.classCallCheck(this,t);for(var n=arguments.length,i=Array(n),l=0;l0&&void 0!==arguments[0]?arguments[0]:{abort:!1};this._taskHandle&&(this._taskHandle.cancel(),t.abort||this._callback(),this._taskHandle=null)}},{key:"schedule",value:function(){var t=this;if(!this._taskHandle){var a=setTimeout(function(){t._taskHandle=n.runAfterInteractions(function(){t._taskHandle=null,t._callback()})},this._delay);this._taskHandle={cancel:function(){return clearTimeout(a)}}}}}]),t})();e.exports=s},229); -__d(function(t,e,a,s){'use strict';var n=e(35),i=e(38),l=function t(){babelHelpers.classCallCheck(this,t),this.any_blank_count=0,this.any_blank_ms=0,this.any_blank_speed_sum=0,this.mostly_blank_count=0,this.mostly_blank_ms=0,this.pixels_blank=0,this.pixels_sampled=0,this.pixels_scrolled=0,this.total_time_spent=0,this.sample_count=0},_=[],r=10,h=null,o=(function(){babelHelpers.createClass(t,null,[{key:"addListener",value:function(t){return i(null!==h,'Call `FillRateHelper.setSampleRate` before `addListener`.'),_.push(t),{remove:function(){_=_.filter(function(e){return t!==e})}}}},{key:"setSampleRate",value:function(t){h=t}},{key:"setMinSampleCount",value:function(t){r=t}}]);function t(e){babelHelpers.classCallCheck(this,t),this._anyBlankStartTime=null,this._enabled=!1,this._info=new l,this._mostlyBlankStartTime=null,this._samplesStartTime=null,this._getFrameMetrics=e,this._enabled=(h||0)>Math.random(),this._resetData()}return babelHelpers.createClass(t,[{key:"activate",value:function(){this._enabled&&null==this._samplesStartTime&&(this._samplesStartTime=n())}},{key:"deactivateAndFlush",value:function(){if(this._enabled){var t=this._samplesStartTime;if(null!=t)if(this._info.sample_count0&&(o=Math.min(_,Math.max(0,m.offset-i)));for(var f=0,c=e.last,k=this._getFrameMetrics(c);c>=e.first&&(!k||!k.inLayout);)k=this._getFrameMetrics(c),c--;if(k&&c0?(this._anyBlankStartTime=h,this._info.any_blank_speed_sum+=r,this._info.any_blank_count++,this._info.pixels_blank+=p,y>.5&&(this._mostlyBlankStartTime=h,this._info.mostly_blank_count++)):(r<.01||Math.abs(s)<1)&&this.deactivateAndFlush(),y}},{key:"enabled",value:function(){return this._enabled}},{key:"_resetData",value:function(){this._anyBlankStartTime=null,this._info=new l,this._mostlyBlankStartTime=null,this._samplesStartTime=null}}]),t})();a.exports=o},230); -__d(function(e,i,t,a){'use strict';var r=i(22),n=(function(){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{viewAreaCoveragePercentThreshold:0};babelHelpers.classCallCheck(this,e),this._hasInteracted=!1,this._lastUpdateTime=0,this._timers=new Set,this._viewableIndices=[],this._viewableItems=new Map,this._config=i}return babelHelpers.createClass(e,[{key:"dispose",value:function(){this._timers.forEach(clearTimeout)}},{key:"computeViewableItems",value:function(e,i,t,a,n){var l=this._config,o=l.itemVisiblePercentThreshold,h=l.viewAreaCoveragePercentThreshold,c=null!=h,f=c?h:o;r(null!=f&&null!=o!=(null!=h),'Must set exactly one of itemVisiblePercentThreshold or viewAreaCoveragePercentThreshold');var u=[];if(0===e)return u;var v=-1,m=n||{first:0,last:e-1},d=m.first,b=m.last;r(b0)v=_,s(c,f,y,w,t,p.length)&&u.push(_);else if(v>=0)break}}return u}},{key:"onUpdate",value:function(e,i,t,a,r,n,s){var l=this,o=Date.now();0===this._lastUpdateTime&&e>0&&a(0)&&(this._lastUpdateTime=o);var h=this._lastUpdateTime?o-this._lastUpdateTime:0;if(!this._config.waitForInteraction||this._hasInteracted){var c=[];if(e&&(c=this.computeViewableItems(e,i,t,a,s)),this._viewableIndices.length!==c.length||!this._viewableIndices.every(function(e,i){return e===c[i]}))if(this._viewableIndices=c,this._lastUpdateTime=o,this._config.minimumViewTime&&h=l.length)break;c=l[h++]}else{if((h=l.next()).done)break;c=h.value}var f=c,u=babelHelpers.slicedToArray(f,2),v=u[0],m=u[1];r.has(v)||s.push(m)}var d=r,b=Array.isArray(d),_=0;for(d=b?d:d["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();;){var p;if(b){if(_>=d.length)break;p=d[_++]}else{if((_=d.next()).done)break;p=_.value}var y=p,w=babelHelpers.slicedToArray(y,2),g=w[0],I=w[1];n.has(g)||s.push(babelHelpers.extends({},I,{isViewable:!1}))}s.length>0&&(this._viewableItems=n,i({viewableItems:Array.from(n.values()),changed:s,viewabilityConfig:this._config}))}}]),e})();function s(e,i,t,a,r,n){if(o=a,(l=t)>=0&&o<=r&&o>l)return!0;var s=(function(e,i,t){var a=Math.min(i,t)-Math.max(e,0);return Math.max(0,a)})(t,a,r);return 100*(e?s/r:s/n)>=i;var l,o}t.exports=n},231); -__d(function(t,e,r,a){'use strict';var n=e(22);function i(t,e,r){for(var a=[],i=0;i=t[f]&&(a[f]=i,f===t.length-1))return n(a.length===t.length,'bad offsets input, should be in increasing order '+JSON.stringify(t)),a;return a}function s(t,e){return e.last-e.first+1-Math.max(0,1+Math.min(e.last,t.last)-Math.max(e.first,t.first))}var l={computeWindowedRenderLimits:function(t,e,r,a){var n=t.data,l=t.getItemCount,f=t.maxToRenderPerBatch,o=t.windowSize,u=l(n);if(0===u)return e;var h=a.offset,m=a.velocity,c=a.visibleLength,d=Math.max(0,h),v=d+c,g=(o-1)*c,b=m>1?'after':m<-1?'before':'none',w=i([Math.max(0,d-.5*g),d,v,Math.max(0,v+.5*g)],t.getItemCount(t.data),r),x=babelHelpers.slicedToArray(w,4),M=x[0],p=x[1],y=x[2],C=x[3];M=null==M?0:M,p=null==p?Math.max(0,M):p,C=null==C?u-1:C;for(var O={first:p,last:y=null==y?Math.min(C,p+f-1):y},L=s(e,O);!(p<=M&&y>=C);){var R=L>=f,S=p<=e.first||p>e.last,T=p>M&&(!R||!S),B=y>=e.last||y=p&&p>=0&&y=M&&y<=C&&p<=O.first&&y>=O.last))throw new Error('Bad window calculation '+JSON.stringify({first:p,last:y,itemCount:u,overscanFirst:M,overscanLast:C,visible:O}));return{first:p,last:y}},elementsThatOverlapOffsets:i,newRangeCount:s};r.exports=l},232); -__d(function(e,t,r,l){'use strict';var s=t(201),i=t(111),a=t(112),n=t(131),o=t(234),c=(function(e){babelHelpers.inherits(t,e);function t(){var e,r,l,s;babelHelpers.classCallCheck(this,t);for(var i=arguments.length,a=Array(i),n=0;nthis.state.observedTopOfStack+1?this.state.observedTopOfStack+1:null;this.setState({idStack:this.state.idStack.slice(0,this.state.observedTopOfStack+1),routeStack:this.state.routeStack.slice(0,this.state.observedTopOfStack+1),requestedTopOfStack:this.state.observedTopOfStack,makingNavigatorRequest:!0,updatingAllIndicesAtOrBeyond:t})},push:function(t){var e=this;g(!!t,'Must supply route to push'),this.state.requestedTopOfStack===this.state.observedTopOfStack&&this._tryLockNavigator(function(){var o=e.state.routeStack.concat([t]),a=e.state.idStack.concat([b()]);e.setState({idStack:a,routeStack:o,requestedTopOfStack:o.length-1,makingNavigatorRequest:!0,updatingAllIndicesAtOrBeyond:o.length-1})})},popN:function(t){var e=this;0!==t&&this.state.requestedTopOfStack===this.state.observedTopOfStack&&this.state.requestedTopOfStack>0&&this._tryLockNavigator(function(){var o=e.state.requestedTopOfStack-t;g(o>=0,'Cannot pop below 0'),e.setState({requestedTopOfStack:o,makingNavigatorRequest:!0,updatingAllIndicesAtOrBeyond:e.state.requestedTopOfStack-t})})},pop:function(){this.popN(1)},replaceAtIndex:function(t,e){if(g(!!t,'Must supply route to replace'),e<0&&(e+=this.state.routeStack.length),!(this.state.routeStack.length<=e)){var o=this.state.idStack.slice(),a=this.state.routeStack.slice();o[e]=b(),a[e]=t,this.setState({idStack:o,routeStack:a,makingNavigatorRequest:!1,updatingAllIndicesAtOrBeyond:e})}},replace:function(t){this.replaceAtIndex(t,-1)},replacePrevious:function(t){this.replaceAtIndex(t,-2)},popToTop:function(){this.popToRoute(this.state.routeStack[0])},popToRoute:function(t){var e=this.state.routeStack.indexOf(t);g(-1!==e,'Calling pop to route for a route that doesn\'t exist!');var o=this.state.routeStack.length-e-1;this.popN(o)},replacePreviousAndPop:function(t){var e=this;this.state.requestedTopOfStack===this.state.observedTopOfStack&&(this.state.routeStack.length<2||this._tryLockNavigator(function(){e.replacePrevious(t),e.setState({requestedTopOfStack:e.state.requestedTopOfStack-1,makingNavigatorRequest:!0})}))},resetTo:function(t){g(!!t,'Must supply route to push'),this.state.requestedTopOfStack===this.state.observedTopOfStack&&(this.replaceAtIndex(t,0),this.popToRoute(t))},_handleNavigationComplete:function(t){t.stopPropagation(),this._toFocusOnNavigationComplete&&(this._getFocusEmitter().emit('focus',this._toFocusOnNavigationComplete),this._toFocusOnNavigationComplete=null),this._handleNavigatorStackChanged(t)},_routeToStackItem:function(t,e){var o=t.component,a=t.wrapperStyle,s=t.passProps,i=babelHelpers.objectWithoutProperties(t,["component","wrapperStyle","passProps"]),n=this.props,c=n.itemWrapperStyle,u=babelHelpers.objectWithoutProperties(n,["itemWrapperStyle"]),l=null!=this.state.updatingAllIndicesAtOrBeyond&&this.state.updatingAllIndicesAtOrBeyond>=e,d=o;return r.createElement(p,{key:'nav'+e,shouldUpdate:l},r.createElement(N,babelHelpers.extends({},u,i,{style:[_.stackItem,c,a]}),r.createElement(d,babelHelpers.extends({navigator:this.navigator,route:i},s))))},_renderNavigationStackItems:function(){var t=this.state.makingNavigatorRequest||null!==this.state.updatingAllIndicesAtOrBeyond,e=t?this.state.routeStack.map(this._routeToStackItem):null;return r.createElement(p,{shouldUpdate:t},r.createElement(m,{ref:"transitionerRef",style:_.transitioner,vertical:this.props.vertical,requestedTopOfStack:this.state.requestedTopOfStack,onNavigationComplete:this._handleNavigationComplete,interactivePopGestureEnabled:this.props.interactivePopGestureEnabled},e))},_tvEventHandler:void 0,_enableTVEventHandler:function(){this._tvEventHandler=new d,this._tvEventHandler.enable(this,function(t,e){e&&'menu'===e.eventType&&t.pop()})},_disableTVEventHandler:function(){this._tvEventHandler&&(this._tvEventHandler.disable(),delete this._tvEventHandler)},render:function(){return r.createElement(h,{style:this.props.style},this._renderNavigationStackItems())}}),_=l.create({stackItem:{backgroundColor:'white',overflow:'hidden',position:'absolute',top:0,left:0,right:0,bottom:0},transitioner:{flex:1}}),q=k('RCTNavigator'),N=k('RCTNavItem');o.exports=y},243); -__d(function(e,t,r,n){'use strict';var l=t(111),s=(function(e){babelHelpers.inherits(t,e);function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.createClass(t,[{key:"shouldComponentUpdate",value:function(e){return!!e.shouldUpdate}},{key:"render",value:function(){var e=this.props.children;return null===e||!1===e?null:l.Children.only(e)}}]),t})(l.Component);r.exports=s},244); -__d(function(e,t,r,l){'use strict';var s=t(51),o=t(246),n=(t(247),t(34),t(111)),p=t(20),a=t(141),i=t(124),b=(t(110),t(133)),u=t(125),c=a(i),d=a(babelHelpers.extends({},u,{color:s})),h=(function(e){babelHelpers.inherits(t,e);function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.createClass(t,[{key:"render",value:function(){throw null}}]),t})(n.Component);h.propTypes={label:p.string.isRequired,value:p.any,color:s,testID:p.string};var f=(function(e){babelHelpers.inherits(t,e);function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.createClass(t,[{key:"render",value:function(){return n.createElement(o,this.props,this.props.children)}}]),t})(n.Component);f.MODE_DIALOG="dialog",f.MODE_DROPDOWN='dropdown',f.Item=h,f.defaultProps={mode:"dialog"},f.propTypes=babelHelpers.extends({},b,{style:d,selectedValue:p.any,onValueChange:p.func,enabled:p.bool,mode:p.oneOf(['dialog','dropdown']),itemStyle:c,prompt:p.string,testID:p.string}),r.exports=f},245); -__d(function(e,t,n,s){'use strict';var r,i,o=t(53),a=t(111),l=t(20),p=t(112),c=t(141),u=t(124),h=t(131),d=t(133),v=t(126),f=t(143),m=c(u),y=t(145),C=f({displayName:'PickerIOS',mixins:[o],propTypes:babelHelpers.extends({},d,{itemStyle:m,onValueChange:l.func,selectedValue:l.any}),getInitialState:function(){return this._stateFromProps(this.props)},componentWillReceiveProps:function(e){this.setState(this._stateFromProps(e))},_stateFromProps:function(e){var t=0,n=[];return a.Children.toArray(e.children).forEach(function(s,r){s.props.value===e.selectedValue&&(t=r),n.push({value:s.props.value,label:s.props.label,textColor:v(s.props.color)})}),{selectedIndex:t,items:n}},render:function(){var e=this;return a.createElement(h,{style:this.props.style},a.createElement(g,{ref:function(t){return e._picker=t},style:[b.pickerIOS,this.props.itemStyle],items:this.state.items,selectedIndex:this.state.selectedIndex,onChange:this._onChange,onStartShouldSetResponder:function(){return!0},onResponderTerminationRequest:function(){return!1}}))},_onChange:function(e){this.props.onChange&&this.props.onChange(e),this.props.onValueChange&&this.props.onValueChange(e.nativeEvent.newValue,e.nativeEvent.newIndex),this._picker&&this.state.selectedIndex!==e.nativeEvent.newIndex&&this._picker.setNativeProps({selectedIndex:this.state.selectedIndex})}});C.Item=(i=r=(function(e){babelHelpers.inherits(t,e);function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.createClass(t,[{key:"render",value:function(){return null}}]),t})(a.Component),r.propTypes={value:l.any,label:l.string,color:l.string},i);var b=p.create({pickerIOS:{height:216}}),g=y('RCTPicker',{propTypes:{style:m}},{nativeOnly:{items:!0,onChange:!0,selectedIndex:!0}});n.exports=C},246); -__d(function(t,s,c,e){'use strict';c.exports=s(110)},247); -__d(function(e,r,s,t){'use strict';var o=r(201),p=r(53),i=r(111),n=r(20),a=r(112),g=r(133),l=r(143),c=r(145),u=l({displayName:'ProgressViewIOS',mixins:[p],propTypes:babelHelpers.extends({},g,{progressViewStyle:n.oneOf(['default','bar']),progress:n.number,progressTintColor:n.string,trackTintColor:n.string,progressImage:o.propTypes.source,trackImage:o.propTypes.source}),render:function(){return i.createElement(b,babelHelpers.extends({},this.props,{style:[y.progressView,this.props.style]}))}}),y=a.create({progressView:{height:2}}),b=c('RCTProgressView',u);s.exports=u},248); -__d(function(e,r,t,s){var a=r(111),p=r(133),l=r(145),n=(function(e){babelHelpers.inherits(r,e);function r(){return babelHelpers.classCallCheck(this,r),babelHelpers.possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return babelHelpers.createClass(r,[{key:"render",value:function(){return a.createElement(o,this.props)}}]),r})(a.Component);n.propTypes=babelHelpers.extends({},p);var o=l('RCTSafeAreaView',{name:'RCTSafeAreaView',displayName:'RCTSafeAreaView',propTypes:babelHelpers.extends({},p)});t.exports=n},249); -__d(function(e,t,r,s){'use strict';var a=t(221),i=(t(34),t(111)),o=(t(203),t(251)),l=babelHelpers.extends({},o.defaultProps,{stickySectionHeadersEnabled:!0}),n=(function(e){babelHelpers.inherits(t,e);function t(){var e,r,s,a;babelHelpers.classCallCheck(this,t);for(var i=arguments.length,o=Array(i),l=0;l=a.data.length+1)){if(-1===t)return{section:a,key:i+':header',index:null,header:!0,trailingSection:this.props.sections[n+1]};if(t===a.data.length)return{section:a,key:i+':footer',index:null,header:!1,trailingSection:this.props.sections[n+1]};return{section:a,key:i+':'+(a.keyExtractor||r)(a.data[t],t),index:t,leadingItem:a.data[t-1],leadingSection:this.props.sections[n-1],trailingItem:a.data[t+1],trailingSection:this.props.sections[n+1]}}t-=a.data.length+1}}},{key:"_getSeparatorComponent",value:function(e,t){if(!(t=t||this._subExtractor(e)))return null;var r=t.section.ItemSeparatorComponent||this.props.ItemSeparatorComponent,n=this.props.SectionSeparatorComponent,a=e===this.state.childProps.getItemCount()-1,i=t.index===t.section.data.length-1;return n&&i?n:!r||i||a?null:r}},{key:"_computeState",value:function(e){var t=e.ListHeaderComponent?1:0,r=[],n=e.sections.reduce(function(e,n){return r.push(e+t),e+n.data.length+2},0);return{childProps:babelHelpers.extends({},e,{renderItem:this._renderItem,ItemSeparatorComponent:void 0,data:e.sections,getItemCount:function(){return n},getItem:c,keyExtractor:this._keyExtractor,onViewableItemsChanged:e.onViewableItemsChanged?this._onViewableItemsChanged:void 0,stickyHeaderIndices:e.stickySectionHeadersEnabled?r:void 0})}}}]);function t(e,r){babelHelpers.classCallCheck(this,t);var n=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return n._keyExtractor=function(e,t){var r=n._subExtractor(t);return r&&r.key||String(t)},n._convertViewable=function(e){s(null!=e.index,'Received a broken ViewToken');var t=n._subExtractor(e.index);if(!t)return null;var r=t.section.keyExtractor||n.props.keyExtractor;return babelHelpers.extends({},e,{index:t.index,key:r(e.item,t.index),section:t.section})},n._onViewableItemsChanged=function(e){var t=e.viewableItems,r=e.changed;n.props.onViewableItemsChanged&&n.props.onViewableItemsChanged({viewableItems:t.map(n._convertViewable,n).filter(Boolean),changed:r.map(n._convertViewable,n).filter(Boolean)})},n._renderItem=function(e){var t=e.item,r=e.index,i=n._subExtractor(r);if(!i)return null;var o=i.index;if(null==o){var l=i.section;if(!0===i.header){var c=n.props.renderSectionHeader;return c?c({section:l}):null}var d=n.props.renderSectionFooter;return d?d({section:l}):null}var u=i.section.renderItem||n.props.renderItem,g=n._getSeparatorComponent(r,i);return s(u,'no renderItem!'),a.createElement(p,{SeparatorComponent:g,LeadingSeparatorComponent:0===o?n.props.SectionSeparatorComponent:void 0,cellKey:i.key,index:o,item:t,leadingItem:i.leadingItem,leadingSection:i.leadingSection,onUpdateSeparator:n._onUpdateSeparator,prevCellKey:(n._subExtractor(r-1)||{}).key,ref:function(e){n._cellRefs[i.key]=e},renderItem:u,section:i.section,trailingItem:i.trailingItem,trailingSection:i.trailingSection})},n._onUpdateSeparator=function(e,t){var r=n._cellRefs[e];r&&r.updateSeparatorProps(t)},n._cellRefs={},n._captureRef=function(e){n._listRef=e},n.state=n._computeState(e),n}return babelHelpers.createClass(t,[{key:"componentWillReceiveProps",value:function(e){this.setState(this._computeState(e))}},{key:"render",value:function(){return a.createElement(o,babelHelpers.extends({},this.state.childProps,{ref:this._captureRef}))}}]),t})(a.PureComponent);l.defaultProps=babelHelpers.extends({},o.defaultProps,{data:[]});var p=(function(e){babelHelpers.inherits(t,e);function t(){var e,r,n,a;babelHelpers.classCallCheck(this,t);for(var i=arguments.length,o=Array(i),s=0;s0},_swipeFullSpeed:function(e){this.state.currentLeft.setValue(this._previousLeft+e.dx)},_swipeSlowSpeed:function(e){this.state.currentLeft.setValue(this._previousLeft+e.dx/4)},_isSwipingExcessivelyRightFromClosedPosition:function(e){var i=_?-e.dx:e.dx;return this._isSwipingRightFromClosed(e)&&i>120},_onPanResponderTerminationRequest:function(e,i){return!1},_animateTo:function(e){var i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c;o.timing(this.state.currentLeft,{duration:n,toValue:e,useNativeDriver:!0}).start(function(){i._previousLeft=e,t()})},_animateToOpenPosition:function(){var e=_?-this.props.maxSwipeDistance:this.props.maxSwipeDistance;this._animateTo(-e)},_animateToOpenPositionWith:function(e,i){e=e>.3?e:.3;var n=Math.abs((this.props.maxSwipeDistance-Math.abs(i))/e),t=_?-this.props.maxSwipeDistance:this.props.maxSwipeDistance;this._animateTo(-t,n)},_animateToClosedPosition:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:300;this._animateTo(0,e)},_animateToClosedPositionDuringBounce:function(){this._animateToClosedPosition(300)},_animateBounceBack:function(e){var i=_?-30:30;this._animateTo(-i,e,this._animateToClosedPositionDuringBounce)},_isValidSwipe:function(e){return!(this.props.preventSwipeRight&&0===this._previousLeft&&e.dx>0)&&Math.abs(e.dx)>10},_shouldAnimateRemainder:function(e){return Math.abs(e.dx)>this.props.swipeThreshold||e.vx>.3},_handlePanResponderEnd:function(e,i){var n=_?-i.dx:i.dx;this._isSwipingRightFromClosed(i)?(this.props.onOpen(),this._animateBounceBack(300)):this._shouldAnimateRemainder(i)?n<0?(this.props.onOpen(),this._animateToOpenPositionWith(i.vx,n)):(this.props.onClose(),this._animateToClosedPosition()):0===this._previousLeft?this._animateToClosedPosition():this._animateToOpenPosition(),this.props.onSwipeEnd()}}),w=u.create({slideOutContainer:{bottom:0,left:0,position:'absolute',right:0,top:0}});n.exports=m},258); -__d(function(e,n,o,t){'use strict';var r=n(181),a=n(260),u=a.currentCentroidXOfTouchesChangedAfter,s=a.currentCentroidYOfTouchesChangedAfter,d=a.previousCentroidXOfTouchesChangedAfter,i=a.previousCentroidYOfTouchesChangedAfter,c=a.currentCentroidX,p=a.currentCentroidY,v={_initializeGestureState:function(e){e.moveX=0,e.moveY=0,e.x0=0,e.y0=0,e.dx=0,e.dy=0,e.vx=0,e.vy=0,e.numberActiveTouches=0,e._accountsForMovesUpTo=0},_updateGestureStateOnMove:function(e,n){e.numberActiveTouches=n.numberActiveTouches,e.moveX=u(n,e._accountsForMovesUpTo),e.moveY=s(n,e._accountsForMovesUpTo);var o=e._accountsForMovesUpTo,t=d(n,o),r=u(n,o),a=i(n,o),c=s(n,o),p=e.dx+(r-t),v=e.dy+(c-a),h=n.mostRecentTimeStamp-e._accountsForMovesUpTo;e.vx=(p-e.dx)/h,e.vy=(v-e.dy)/h,e.dx=p,e.dy=v,e._accountsForMovesUpTo=n.mostRecentTimeStamp},create:function(e){var n={handle:null},o={stateID:Math.random()};v._initializeGestureState(o);return{panHandlers:{onStartShouldSetResponder:function(n){return void 0!==e.onStartShouldSetPanResponder&&e.onStartShouldSetPanResponder(n,o)},onMoveShouldSetResponder:function(n){return void 0!==e.onMoveShouldSetPanResponder&&e.onMoveShouldSetPanResponder(n,o)},onStartShouldSetResponderCapture:function(n){return 1===n.nativeEvent.touches.length&&v._initializeGestureState(o),o.numberActiveTouches=n.touchHistory.numberActiveTouches,void 0!==e.onStartShouldSetPanResponderCapture&&e.onStartShouldSetPanResponderCapture(n,o)},onMoveShouldSetResponderCapture:function(n){var t=n.touchHistory;return o._accountsForMovesUpTo!==t.mostRecentTimeStamp&&(v._updateGestureStateOnMove(o,t),!!e.onMoveShouldSetPanResponderCapture&&e.onMoveShouldSetPanResponderCapture(n,o))},onResponderGrant:function(t){return n.handle||(n.handle=r.createInteractionHandle()),o.x0=c(t.touchHistory),o.y0=p(t.touchHistory),o.dx=0,o.dy=0,e.onPanResponderGrant&&e.onPanResponderGrant(t,o),void 0===e.onShouldBlockNativeResponder||e.onShouldBlockNativeResponder()},onResponderReject:function(t){h(n,e.onPanResponderReject,t,o)},onResponderRelease:function(t){h(n,e.onPanResponderRelease,t,o),v._initializeGestureState(o)},onResponderStart:function(n){var t=n.touchHistory;o.numberActiveTouches=t.numberActiveTouches,e.onPanResponderStart&&e.onPanResponderStart(n,o)},onResponderMove:function(n){var t=n.touchHistory;o._accountsForMovesUpTo!==t.mostRecentTimeStamp&&(v._updateGestureStateOnMove(o,t),e.onPanResponderMove&&e.onPanResponderMove(n,o))},onResponderEnd:function(t){var r=t.touchHistory;o.numberActiveTouches=r.numberActiveTouches,h(n,e.onPanResponderEnd,t,o)},onResponderTerminate:function(t){h(n,e.onPanResponderTerminate,t,o),v._initializeGestureState(o)},onResponderTerminationRequest:function(n){return void 0===e.onPanResponderTerminationRequest||e.onPanResponderTerminationRequest(n,o)}},getInteractionHandle:function(){return n.handle}}}};function h(e,n,o,t){e.handle&&(r.clearInteractionHandle(e.handle),e.handle=null),n&&n(o,t)}o.exports=v},259); -__d(function(_,t,E,o){'use strict';var r=t(54).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;E.exports=r.TouchHistoryMath},260); -__d(function(e,t,n,o){'use strict';var r=t(222),s=t(20),i=t(111),u=t(262),a=t(258),c=(function(e){babelHelpers.inherits(t,e),babelHelpers.createClass(t,null,[{key:"getNewDataSource",value:function(){return new u({getRowData:function(e,t,n){return e[t][n]},getSectionHeaderData:function(e,t){return e[t]},rowHasChanged:function(e,t){return e!==t},sectionHeaderHasChanged:function(e,t){return e!==t}})}}]);function t(e,n){babelHelpers.classCallCheck(this,t);var o=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return o._listViewRef=null,o._shouldBounceFirstRowOnMount=!1,o._onScroll=function(e){o.props.dataSource.getOpenRowID()&&o.setState({dataSource:o.state.dataSource.setOpenRowID(null)}),o.props.onScroll&&o.props.onScroll(e)},o._renderRow=function(e,t,n){var r=o.props.renderQuickActions(e,t,n);if(!r)return o.props.renderRow(e,t,n);var s=!1;return o._shouldBounceFirstRowOnMount&&(o._shouldBounceFirstRowOnMount=!1,s=n===o.props.dataSource.getFirstRowID()),i.createElement(a,{slideoutView:r,isOpen:e.id===o.props.dataSource.getOpenRowID(),maxSwipeDistance:o._getMaxSwipeDistance(e,t,n),key:n,onOpen:function(){return o._onOpen(e.id)},onClose:function(){return o._onClose(e.id)},onSwipeEnd:function(){return o._setListViewScrollable(!0)},onSwipeStart:function(){return o._setListViewScrollable(!1)},shouldBounceOnMount:s},o.props.renderRow(e,t,n))},o._shouldBounceFirstRowOnMount=o.props.bounceFirstRowOnMount,o.state={dataSource:o.props.dataSource},o}return babelHelpers.createClass(t,[{key:"componentWillReceiveProps",value:function(e){this.state.dataSource.getDataSource()!==e.dataSource.getDataSource()&&this.setState({dataSource:e.dataSource})}},{key:"render",value:function(){var e=this;return i.createElement(r,babelHelpers.extends({},this.props,{ref:function(t){e._listViewRef=t},dataSource:this.state.dataSource.getDataSource(),onScroll:this._onScroll,renderRow:this._renderRow}))}},{key:"_setListViewScrollable",value:function(e){this._listViewRef&&'function'==typeof this._listViewRef.setNativeProps&&this._listViewRef.setNativeProps({scrollEnabled:e})}},{key:"getScrollResponder",value:function(){if(this._listViewRef&&'function'==typeof this._listViewRef.getScrollResponder)return this._listViewRef.getScrollResponder()}},{key:"_getMaxSwipeDistance",value:function(e,t,n){return'function'==typeof this.props.maxSwipeDistance?this.props.maxSwipeDistance(e,t,n):this.props.maxSwipeDistance}},{key:"_onOpen",value:function(e){this.setState({dataSource:this.state.dataSource.setOpenRowID(e)})}},{key:"_onClose",value:function(e){this.setState({dataSource:this.state.dataSource.setOpenRowID(null)})}}]),t})(i.Component);c.propTypes={bounceFirstRowOnMount:s.bool.isRequired,dataSource:s.instanceOf(u).isRequired,maxSwipeDistance:s.oneOfType([s.number,s.func]).isRequired,renderRow:s.func.isRequired,renderQuickActions:s.func.isRequired},c.defaultProps={bounceFirstRowOnMount:!1,renderQuickActions:function(){return null}},n.exports=c},261); -__d(function(e,t,i,o){'use strict';var n=t(223),s=(function(){function e(t){var i=this;babelHelpers.classCallCheck(this,e),this._dataSource=new n({getRowData:t.getRowData,getSectionHeaderData:t.getSectionHeaderData,rowHasChanged:function(e,o){return e.id!==i._previousOpenRowID&&o.id===i._openRowID||e.id===i._previousOpenRowID&&o.id!==i._openRowID||t.rowHasChanged(e,o)},sectionHeaderHasChanged:t.sectionHeaderHasChanged})}return babelHelpers.createClass(e,[{key:"cloneWithRowsAndSections",value:function(e,t,i){return this._dataSource=this._dataSource.cloneWithRowsAndSections(e,t,i),this._dataBlob=e,this.rowIdentities=this._dataSource.rowIdentities,this.sectionIdentities=this._dataSource.sectionIdentities,this}},{key:"getDataSource",value:function(){return this._dataSource}},{key:"getOpenRowID",value:function(){return this._openRowID}},{key:"getFirstRowID",value:function(){return this.rowIdentities?this.rowIdentities[0]&&this.rowIdentities[0][0]:Object.keys(this._dataBlob)[0]}},{key:"setOpenRowID",value:function(e){return this._previousOpenRowID=this._openRowID,this._openRowID=e,this._dataSource=this._dataSource.cloneWithRowsAndSections(this._dataBlob,this.sectionIdentities,this.rowIdentities),this}}]),e})();i.exports=s},262); -__d(function(t,e,r,o){'use strict';var s=e(51),l=e(111),n=e(20),i=e(112),p=e(264),a=e(133),c=e(145),u=(function(t){babelHelpers.inherits(e,t);function e(){return babelHelpers.classCallCheck(this,e),babelHelpers.possibleConstructorReturn(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return babelHelpers.createClass(e,[{key:"render",value:function(){return l.createElement(C,{style:[b.tabGroup,this.props.style],unselectedTintColor:this.props.unselectedTintColor,unselectedItemTintColor:this.props.unselectedItemTintColor,tintColor:this.props.tintColor,barTintColor:this.props.barTintColor,barStyle:this.props.barStyle,itemPositioning:this.props.itemPositioning,translucent:!1!==this.props.translucent},this.props.children)}}]),e})(l.Component);u.Item=p,u.propTypes=babelHelpers.extends({},a,{style:a.style,unselectedTintColor:s,tintColor:s,unselectedItemTintColor:s,barTintColor:s,barStyle:n.oneOf(['default','black']),translucent:n.bool,itemPositioning:n.oneOf(['fill','center','auto'])});var b=i.create({tabGroup:{flex:1}}),C=c('RCTTabBar',u);r.exports=u},263); -__d(function(e,t,s,r){'use strict';var o=t(51),l=t(201),n=t(111),a=t(20),c=t(244),i=t(112),p=t(131),b=t(133),u=t(145),d=(function(e){babelHelpers.inherits(t,e);function t(){var e,s,r,o;babelHelpers.classCallCheck(this,t);for(var l=arguments.length,n=Array(l),a=0;a=1&&(n=r.createElement(d,{style:t.style,allowFontScaling:t.allowFontScaling},n)),t.inputView&&(n=[n,t.inputView]),t.style.unshift(I.multilineInput),e=r.createElement(x,babelHelpers.extends({ref:this._setNativeRef},t,{children:n,onFocus:this._onFocus,onBlur:this._onBlur,onChange:this._onChange,onContentSizeChange:this.props.onContentSizeChange,onSelectionChange:this._onSelectionChange,onTextInput:this._onTextInput,onSelectionChangeShouldSetResponder:v.thatReturnsTrue,text:this._getText(),dataDetectorTypes:this.props.dataDetectorTypes,onScroll:this._onScroll}))}else e=r.createElement(m,babelHelpers.extends({ref:this._setNativeRef},t,{onFocus:this._onFocus,onBlur:this._onBlur,onChange:this._onChange,onSelectionChange:this._onSelectionChange,onSelectionChangeShouldSetResponder:v.thatReturnsTrue,text:this._getText()}));return r.createElement(b,{onLayout:t.onLayout,onPress:this._onPress,rejectResponderTermination:!0,accessible:t.accessible,accessibilityLabel:t.accessibilityLabel,accessibilityTraits:t.accessibilityTraits,nativeID:this.props.nativeID,testID:t.testID},e)},_renderAndroid:function(){var e=babelHelpers.extends({},this.props);e.style=this.props.style,this.state.layoutHeight>=0&&(e.style=[e.style,{height:this.state.layoutHeight}]),e.autoCapitalize=y.AndroidTextInput.Constants.AutoCapitalizationType[e.autoCapitalize||'sentences'];var t=this.props.children,n=0;r.Children.forEach(t,function(){return++n}),C(!(this.props.value&&n),'Cannot specify both value and children.'),n>1&&(t=r.createElement(d,null,t)),e.selection&&null==e.selection.end&&(e.selection={start:e.selection.start,end:e.selection.start});var o=r.createElement(AndroidTextInput,babelHelpers.extends({ref:this._setNativeRef},e,{mostRecentEventCount:0,onFocus:this._onFocus,onBlur:this._onBlur,onChange:this._onChange,onContentSizeChange:this._onContentSizeChange,onSelectionChange:this._onSelectionChange,onTextInput:this._onTextInput,text:this._getText(),children:t,disableFullscreenUI:this.props.disableFullscreenUI,textBreakStrategy:this.props.textBreakStrategy,onScroll:this._onScroll}));return r.createElement(b,{onLayout:this._onLayout,onPress:this._onPress,accessible:this.props.accessible,accessibilityLabel:this.props.accessibilityLabel,accessibilityComponentType:this.props.accessibilityComponentType,nativeID:this.props.nativeID,testID:this.props.testID},o)},_onFocus:function(e){this.props.onFocus&&this.props.onFocus(e),this.props.selectionState&&this.props.selectionState.focus()},_onPress:function(e){(this.props.editable||void 0===this.props.editable)&&this.focus()},_onChange:function(e){this._inputRef&&this._inputRef.setNativeProps({mostRecentEventCount:e.nativeEvent.eventCount});var t=e.nativeEvent.text;this.props.onChange&&this.props.onChange(e),this.props.onChangeText&&this.props.onChangeText(t),this._inputRef&&(this._lastNativeText=t,this.forceUpdate())},_onContentSizeChange:function(e){var t=e.nativeEvent.contentSize.height;this.props.autoGrow&&(this.props.maxHeight&&(t=Math.min(this.props.maxHeight,t)),this.setState({layoutHeight:Math.max(this._layoutHeight,t)})),this.props.onContentSizeChange&&this.props.onContentSizeChange(e)},_onLayout:function(e){e.nativeEvent.layout.height&&(this._layoutHeight=e.nativeEvent.layout.height),this.props.onLayout&&this.props.onLayout(e)},_onSelectionChange:function(e){this.props.onSelectionChange&&this.props.onSelectionChange(e),this._inputRef&&(this._lastNativeSelection=e.nativeEvent.selection,(this.props.selection||this.props.selectionState)&&this.forceUpdate())},componentDidUpdate:function(){var e={};this._lastNativeText!==this.props.value&&'string'==typeof this.props.value&&(e.text=this.props.value);var t=this.props.selection;this._lastNativeSelection&&t&&(this._lastNativeSelection.start!==t.start||this._lastNativeSelection.end!==t.end)&&(e.selection=this.props.selection),Object.keys(e).length>0&&this._inputRef&&this._inputRef.setNativeProps(e),this.props.selectionState&&t&&this.props.selectionState.update(t.start,t.end)},_onBlur:function(e){this.blur(),this.props.onBlur&&this.props.onBlur(e),this.props.selectionState&&this.props.selectionState.blur()},_onTextInput:function(e){this.props.onTextInput&&this.props.onTextInput(e)},_onScroll:function(e){this.props.onScroll&&this.props.onScroll(e)}}),I=h.create({multilineInput:{paddingTop:5}});n.exports=F},265); -__d(function(s,t,e,f){'use strict';var u=t(267),h=(function(){function s(t,e){babelHelpers.classCallCheck(this,s),this._anchorOffset=t,this._focusOffset=e,this._hasFocus=!1}return babelHelpers.createClass(s,[{key:"update",value:function(s,t){this._anchorOffset===s&&this._focusOffset===t||(this._anchorOffset=s,this._focusOffset=t,this.emit('update'))}},{key:"constrainLength",value:function(s){this.update(Math.min(this._anchorOffset,s),Math.min(this._focusOffset,s))}},{key:"focus",value:function(){this._hasFocus||(this._hasFocus=!0,this.emit('focus'))}},{key:"blur",value:function(){this._hasFocus&&(this._hasFocus=!1,this.emit('blur'))}},{key:"hasFocus",value:function(){return this._hasFocus}},{key:"isCollapsed",value:function(){return this._anchorOffset===this._focusOffset}},{key:"isBackward",value:function(){return this._anchorOffset>this._focusOffset}},{key:"getAnchorOffset",value:function(){return this._hasFocus?this._anchorOffset:null}},{key:"getFocusOffset",value:function(){return this._hasFocus?this._focusOffset:null}},{key:"getStartOffset",value:function(){return this._hasFocus?Math.min(this._anchorOffset,this._focusOffset):null}},{key:"getEndOffset",value:function(){return this._hasFocus?Math.max(this._anchorOffset,this._focusOffset):null}},{key:"overlaps",value:function(s,t){return this.hasFocus()&&this.getStartOffset()<=t&&s<=this.getEndOffset()}}]),s})();u(h,{blur:!0,focus:!0,update:!0}),e.exports=h},266); -__d(function(e,t,n,r){'use strict';var i=t(46),s=t(268),_=t(269),a=t(22),o=t(270)({__types:!0});var v={emit:function(e,t,n,r,i,s,_){return this.__getEventEmitter().emit(e,t,n,r,i,s,_)},emitAndHold:function(e,t,n,r,i,s,_){return this.__getEventEmitter().emitAndHold(e,t,n,r,i,s,_)},addListener:function(e,t,n){return this.__getEventEmitter().addListener(e,t,n)},once:function(e,t,n){return this.__getEventEmitter().once(e,t,n)},addRetroactiveListener:function(e,t,n){return this.__getEventEmitter().addRetroactiveListener(e,t,n)},addListenerMap:function(e,t){return this.__getEventEmitter().addListenerMap(e,t)},addRetroactiveListenerMap:function(e,t){return this.__getEventEmitter().addListenerMap(e,t)},removeAllListeners:function(){this.__getEventEmitter().removeAllListeners()},removeCurrentListener:function(){this.__getEventEmitter().removeCurrentListener()},releaseHeldEventType:function(e){this.__getEventEmitter().releaseHeldEventType(e)},__getEventEmitter:function(){if(!this.__eventEmitter){var e=new i,t=new _;this.__eventEmitter=new s(e,t)}return this.__eventEmitter}};n.exports=function(e,t){a(t,'Must supply set of valid event types');var n=e.prototype||e;a(!n.__eventEmitter,'An active emitter is already mixed in');var r=e.constructor;r&&a(r===Object||r===Function,'Mix EventEmitter into a class, not an instance'),n.hasOwnProperty(o)?babelHelpers.extends(n.__types,t):n.__types?n.__types=babelHelpers.extends({},n.__types,t):n.__types=t,babelHelpers.extends(n,v)}},267); -__d(function(e,t,n,r){'use strict';var i=(function(){function e(t,n){babelHelpers.classCallCheck(this,e),this._emitter=t,this._eventHolder=n,this._currentEventToken=null,this._emittingHeldEvents=!1}return babelHelpers.createClass(e,[{key:"addListener",value:function(e,t,n){return this._emitter.addListener(e,t,n)}},{key:"once",value:function(e,t,n){return this._emitter.once(e,t,n)}},{key:"addRetroactiveListener",value:function(e,t,n){var r=this._emitter.addListener(e,t,n);return this._emittingHeldEvents=!0,this._eventHolder.emitToListener(e,t,n),this._emittingHeldEvents=!1,r}},{key:"removeAllListeners",value:function(e){this._emitter.removeAllListeners(e)}},{key:"removeCurrentListener",value:function(){this._emitter.removeCurrentListener()}},{key:"listeners",value:function(e){return this._emitter.listeners(e)}},{key:"emit",value:function(e){for(var t,n=arguments.length,r=Array(n>1?n-1:0),i=1;i1?r-1:0),s=1;s1?r-1:0),i=1;i=t.length)break;i=t[l++]}else{if((l=t.next()).done)break;i=l.value}var u=i,c=babelHelpers.slicedToArray(u,2),s=c[0],f=c[1];a[s]=f()}var d={},b=e._fileSources,y=Array.isArray(b),v=0;for(b=y?b:b["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();;){var _;if(y){if(v>=b.length)break;_=b[v++]}else{if((v=b.next()).done)break;_=v.value}var S=_,p=babelHelpers.slicedToArray(S,2),x=p[0],k=p[1];d[x]=k()}n('BugReporting extraData:',a);var m=r(26).BugReporting;return m&&m.setExtraData&&m.setExtraData(a,d),{extras:a,files:d}}}]),e})();i._extraSources=new l,i._fileSources=new l,i._subscription=null,a.exports=i},278); -__d(function(e,t,r,a){'use strict';r.exports=function(){try{return"React tree dumps have been temporarily disabled while React is upgraded to Fiber."}catch(e){return'Failed to dump react tree: '+e}}},279); -__d(function(e,n,t,c){'use strict';var r=[],u={name:'default'},i={setActiveScene:function(e){u=e,r.forEach(function(e){return e(u)})},getActiveScene:function(){return u},addActiveSceneChangedListener:function(e){return r.push(e),{remove:function(){r=r.filter(function(n){return e!==n})}}}};t.exports=i},280); -__d(function(e,t,o,r){'use strict';var a=t(241),n=t(111),c=t(54),p=t(22);t(282);o.exports=function(e,t,o,r){p(o,'Expect to have a valid rootTag, instead got ',o),c.render(n.createElement(a,{rootTag:o,WrapperComponent:r},n.createElement(e,babelHelpers.extends({},t,{rootTag:o}))),o)}},281); -__d(function(e,n,t,r){'use strict';var i=n(34),v=n(168);function o(){}var s=void 0;if(i.isTVOS){var u=new v,f=new Set;u.enable(this,function(e,n){if(n&&'menu'===n.eventType){for(var t=!0,r=Array.from(f.values()).reverse(),i=0;i=0&&(s='video'),a.saveToCameraRoll(e,s)}},{key:"getPhotos",value:function(e){if(arguments.length>1){console.warn('CameraRoll.getPhotos(tag, success, error) is deprecated. Use the returned Promise instead');var r=arguments[1],s=arguments[2]||function(){};a.getPhotos(e).then(r,s)}return a.getPhotos(e)}}]),e})());d.GroupTypesOptions=l,d.AssetTypeOptions=u,s.exports=d},286); -__d(function(t,n,r,i){'use strict';var e=n(26).Clipboard;r.exports={getString:function(){return e.getString()},setString:function(t){e.setString(t)}}},287); -__d(function(e,r,t,n){'use strict';var s={open:function(e){return regeneratorRuntime.async(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.reject({message:'DatePickerAndroid is not supported on this platform.'}));case 1:case"end":return e.stop()}},null,this)}};t.exports=s},288); -__d(function(e,n,o,a){'use strict';var r=n(26).ImagePickerIOS,t={canRecordVideos:function(e){return r.canRecordVideos(e)},canUseCamera:function(e){return r.canUseCamera(e)},openCameraDialog:function(e,n,o){return e=babelHelpers.extends({videoMode:!1},e),r.openCameraDialog(e,n,o)},openSelectDialog:function(e,n,o){return e=babelHelpers.extends({showImages:!0,showVideos:!1},e),r.openSelectDialog(e,n,o)}};o.exports=t},289); -__d(function(e,t,n,i){'use strict';var a=t(81),r=t(26),s=(t(34),t(22)),l=r.LinkingManager,o=(function(e){babelHelpers.inherits(t,e);function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,l))}return babelHelpers.createClass(t,[{key:"addEventListener",value:function(e,t){this.addListener(e,t)}},{key:"removeEventListener",value:function(e,t){this.removeListener(e,t)}},{key:"openURL",value:function(e){return this._validateURL(e),l.openURL(e)}},{key:"canOpenURL",value:function(e){return this._validateURL(e),l.canOpenURL(e)}},{key:"getInitialURL",value:function(){return l.getInitialURL()}},{key:"_validateURL",value:function(e){s('string'==typeof e,'Invalid URL: should be a string. Was: '+e),s(e,'Invalid URL: cannot be empty')}}]),t})(a);n.exports=new o},290); -__d(function(e,n,t,o){'use strict';var r=n(68),i=n(81),c=n(26),u=(n(34),c.NetInfo),f=new i(u),s='networkStatusDidChange',v=new r,a=void 0;a=function(e){return'none'!==e&&'unknown'!==e};function d(e){return'none'!==e.type&&'unknown'!==e.type}var C=new r,p={addEventListener:function(e,n){var t=void 0;if('connectionChange'===e)t=f.addListener(s,function(e){n({type:e.connectionType,effectiveType:e.effectiveConnectionType})});else{if('change'!==e)return console.warn('Trying to subscribe to unknown event: "'+e+'"'),{remove:function(){}};console.warn('NetInfo\'s "change" event is deprecated. Listen to the "connectionChange" event instead.'),t=f.addListener(s,function(e){n(e.network_info)})}return v.set(n,t),{remove:function(){return p.removeEventListener(e,n)}}},removeEventListener:function(e,n){var t=v.get(n);t&&(t.remove(),v.delete(n))},fetch:function(){return console.warn('NetInfo.fetch() is deprecated. Use NetInfo.getConnectionInfo() instead.'),u.getCurrentConnectivity().then(function(e){return e.network_info})},getConnectionInfo:function(){return u.getCurrentConnectivity().then(function(e){return{type:e.connectionType,effectiveType:e.effectiveConnectionType}})},isConnected:{addEventListener:function(e,n){var t=function(t){'change'===e?n(a(t)):'connectionChange'===e&&n(d(t))};return C.set(n,t),p.addEventListener(e,t),{remove:function(){return p.isConnected.removeEventListener(e,n)}}},removeEventListener:function(e,n){var t=C.get(n);p.removeEventListener(e,t),C.delete(n)},fetch:function(){return p.getConnectionInfo().then(d)}},isConnectionExpensive:function(){return Promise.reject(new Error('Currently not supported on iOS'))}};t.exports=p},291); -__d(function(e,t,i,o){'use strict';var n=t(81),a=t(26).PushNotificationManager,c=t(22),r=new n(a),l=new Map,s=(function(){babelHelpers.createClass(e,null,[{key:"presentLocalNotification",value:function(e){a.presentLocalNotification(e)}},{key:"scheduleLocalNotification",value:function(e){a.scheduleLocalNotification(e)}},{key:"cancelAllLocalNotifications",value:function(){a.cancelAllLocalNotifications()}},{key:"removeAllDeliveredNotifications",value:function(){a.removeAllDeliveredNotifications()}},{key:"getDeliveredNotifications",value:function(e){a.getDeliveredNotifications(e)}},{key:"removeDeliveredNotifications",value:function(e){a.removeDeliveredNotifications(e)}},{key:"setApplicationIconBadgeNumber",value:function(e){a.setApplicationIconBadgeNumber(e)}},{key:"getApplicationIconBadgeNumber",value:function(e){a.getApplicationIconBadgeNumber(e)}},{key:"cancelLocalNotifications",value:function(e){a.cancelLocalNotifications(e)}},{key:"getScheduledLocalNotifications",value:function(e){a.getScheduledLocalNotifications(e)}},{key:"addEventListener",value:function(t,i){c('notification'===t||'register'===t||'registrationError'===t||'localNotification'===t,'PushNotificationIOS only supports `notification`, `register`, `registrationError`, and `localNotification` events');var o;'notification'===t?o=r.addListener("remoteNotificationReceived",function(t){i(new e(t))}):'localNotification'===t?o=r.addListener("localNotificationReceived",function(t){i(new e(t))}):'register'===t?o=r.addListener("remoteNotificationsRegistered",function(e){i(e.deviceToken)}):'registrationError'===t&&(o=r.addListener("remoteNotificationRegistrationError",function(e){i(e)})),l.set(t,o)}},{key:"removeEventListener",value:function(e,t){c('notification'===e||'register'===e||'registrationError'===e||'localNotification'===e,'PushNotificationIOS only supports `notification`, `register`, `registrationError`, and `localNotification` events');var i=l.get(e);i&&(i.remove(),l.delete(e))}},{key:"requestPermissions",value:function(e){var t={};return t=e?{alert:!!e.alert,badge:!!e.badge,sound:!!e.sound}:{alert:!0,badge:!0,sound:!0},a.requestPermissions(t)}},{key:"abandonPermissions",value:function(){a.abandonPermissions()}},{key:"checkPermissions",value:function(e){c('function'==typeof e,'Must provide a valid callback'),a.checkPermissions(e)}},{key:"getInitialNotification",value:function(){return a.getInitialNotification().then(function(t){return t&&new e(t)})}}]);function e(t){var i=this;babelHelpers.classCallCheck(this,e),this._data={},this._remoteNotificationCompleteCallbackCalled=!1,this._isRemote=t.remote,this._isRemote&&(this._notificationId=t.notificationId),t.remote?Object.keys(t).forEach(function(e){var o=t[e];'aps'===e?(i._alert=o.alert,i._sound=o.sound,i._badgeCount=o.badge,i._category=o.category,i._contentAvailable=o['content-available']):i._data[e]=o}):(this._badgeCount=t.applicationIconBadgeNumber,this._sound=t.soundName,this._alert=t.alertBody,this._data=t.userInfo,this._category=t.category)}return babelHelpers.createClass(e,[{key:"finish",value:function(e){this._isRemote&&this._notificationId&&!this._remoteNotificationCompleteCallbackCalled&&(this._remoteNotificationCompleteCallbackCalled=!0,a.onFinishRemoteNotification(this._notificationId,e))}},{key:"getMessage",value:function(){return this._alert}},{key:"getSound",value:function(){return this._sound}},{key:"getCategory",value:function(){return this._category}},{key:"getAlert",value:function(){return this._alert}},{key:"getContentAvailable",value:function(){return this._contentAvailable}},{key:"getBadgeCount",value:function(){return this._badgeCount}},{key:"getData",value:function(){return this._data}}]),e})();s.FetchResult={NewData:'UIBackgroundFetchResultNewData',NoData:'UIBackgroundFetchResultNoData',ResultFailed:'UIBackgroundFetchResultFailed'},i.exports=s},292); -__d(function(t,s,e,n){'use strict';var i=s(45),a=s(26).SettingsManager,r=s(22),c=[],l={_settings:a&&a.settings,get:function(t){return this._settings[t]},set:function(t){this._settings=babelHelpers.extends(this._settings,t),a.setValues(t)},watchKeys:function(t,s){'string'==typeof t&&(t=[t]),r(Array.isArray(t),'keys should be a string or array of strings');var e=c.length;return c.push({keys:t,callback:s}),e},clearWatch:function(t){t1&&void 0!==arguments[1]?arguments[1]:{};return o('object'==typeof e&&null!==e,'Content to share must be a valid object'),o('string'==typeof e.url||'string'==typeof e.message,'At least one of URL and message is required'),o('object'==typeof t&&null!==t,'Options must be a valid object'),new Promise(function(n,i){a.showShareActionSheetWithOptions(babelHelpers.extends({},e,t,{tintColor:s(t.tintColor)}),function(e){return i(e)},function(e,t){n(e?{action:'sharedAction',activityType:t}:{action:'dismissedAction'})})})}},{key:"sharedAction",get:function(){return'sharedAction'}},{key:"dismissedAction",get:function(){return'dismissedAction'}}]),e})());n.exports=c},294); -__d(function(e,t,r,s){'use strict';var n=t(81),a=t(26).StatusBarManager,l=(function(e){babelHelpers.inherits(t,e);function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return t})(n);r.exports=new l(a)},295); -__d(function(e,r,t,n){'use strict';var s={open:function(e){return regeneratorRuntime.async(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.reject({message:'TimePickerAndroid is not supported on this platform.'}));case 1:case"end":return e.stop()}},null,this)}};t.exports=s},296); -__d(function(r,t,i,n){'use strict';var e=t(26).Vibration,o=(t(34),!1),a=0;function u(r){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];o||(o=!0,0===r[0]&&(e.vibrate(),r=r.slice(1)),0!==r.length?setTimeout(function(){return(function r(t,i,n,u){if(!o||t!==a)return;e.vibrate();if(u>=i.length){if(!n)return void(o=!1);u=0}setTimeout(function(){return r(t,i,n,u+1)},i[u])})(++a,r,t,1)},r[0]):o=!1)}var f={vibrate:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:400,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!o)if('number'==typeof r)e.vibrate();else{if(!Array.isArray(r))throw new Error('Vibration pattern should be a number or array');u(r,t)}},cancel:function(){o=!1}};i.exports=f},297); -__d(function(t,i,r,n){'use strict';var o=i(26).Vibration,a=i(22),e={vibrate:function(){a(void 0===arguments[0],'Vibration patterns not supported.'),o.vibrate()}};r.exports=e},298); -__d(function(_,t,E,s){'use strict';var O=t(54).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;E.exports=O.takeSnapshot},299); -__d(function(e,t,n,r){Object.defineProperty(r,"__esModule",{value:!0});var u=t(301);Object.keys(u).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return u[e]}})});var o=t(827);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return o[e]}})});var c=t(828);Object.keys(c).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return c[e]}})});var f=t(955);Object.keys(f).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return f[e]}})}),t(1029),t(1030)},300); -__d(function(t,o,n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.appNavigate=function(t){return function(o,n){return(function(t,o,n){if(!n||!n.host){var r=(0,c.parseURIString)(o()['features/app'].app._getDefaultURL());n?(n.host=r.host,n.hostname=r.hostname,n.port=r.port,n.protocol=r.protocol):n=r}return n.protocol||(n.protocol='https:'),(function(t,o,n){var r=n.room;return t((0,i.configWillLoad)(n)),(function(t){var o=t.contextRoot,n=t.host,r=t.protocol,e=t.room;if(!e&&'undefined'==typeof APP)return Promise.resolve();'http:'!==(r=r.toLowerCase())&&'https:'!==r&&(r='https:');var i=r+"//"+n+(o||'/'),u=i+"config.js";e&&(u+="?room="+e.toLowerCase());var f="config.js/"+i;return(0,a.loadConfig)(u).then(function(t){try{void 0!==window.config&&window.config===t||window.localStorage.setItem(f,JSON.stringify(t))}catch(t){}return t},function(t){var o=void 0;try{var n=(o=window.localStorage).getItem(f);if(n)return JSON.parse(n)}catch(t){o&&o.removeItem(f)}throw t})})(n).then(function(t){return c(void 0,t)},function(t){return c(t,void 0)}).then(function(){return t((0,e.setRoom)(r))});function c(r,e){var a=t((0,u.setLocationURL)(new URL(n.toString())));if(r)return a.then(function(){throw t((0,i.loadConfigError)(r,n)),r});var c=(0,f.getProfile)(o());return a.then(function(){return t((0,i.setConfig)((function(t,o){if(t)return babelHelpers.extends({},t,o)})(e,c)))})}})(t,o,n)})(o,n,(0,c.parseURIString)(t))}},r.appWillMount=function(t){return function(o){o({type:p.APP_WILL_MOUNT,app:t}),'object'==typeof APP&&APP.API.init()}},r.appWillUnmount=function(t){return{type:p.APP_WILL_UNMOUNT,app:t}};var e=o(302),i=o(447),u=o(636),a=o(308),f=o(821),c=o(437),p=o(827)},301); -__d(function(e,t,n,r){Object.defineProperty(r,"__esModule",{value:!0});var u=t(303);Object.keys(u).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return u[e]}})});var o=t(632);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return o[e]}})});var c=t(633);Object.keys(c).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return c[e]}})});var f=t(634);Object.keys(f).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return f[e]}})}),t(635),t(641)},302); -__d(function(e,n,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.conferenceFailed=A,r.conferenceJoined=v,r.conferenceLeft=N,r.conferenceWillJoin=L,r.conferenceWillLeave=function(e){return{type:p.CONFERENCE_WILL_LEAVE,conference:e}},r.createConference=function(){return function(e,n){var t=n(),r=t['features/base/connection'],o=r.connection,a=r.locationURL;if(!o)throw new Error('Cannot create a conference without a connection!');var p=t['features/base/conference'],S=p.password,O=p.room;if(!O)throw new Error('Cannot join a conference without a room name!');var T=o.initJitsiConference(O.toLowerCase(),babelHelpers.extends({},t['features/base/config'],{applicationName:(0,c.getName)(),getWiFiStatsMethod:(0,E.getJitsiMeetGlobalNS)().getWiFiStats}));T[l.JITSI_CONFERENCE_URL_KEY]=a,e((R=T,function(e,n){var t=(0,d.getLocalTracks)(n()['features/base/tracks']).map(function(e){return e.jitsiTrack});t.length&&(0,C._addLocalTracksToConference)(R,t),e(L(R))}));var R;M=e,(D=T).on(u.JitsiConferenceEvents.CONFERENCE_FAILED,function(){for(var e=arguments.length,n=Array(e),t=0;t1&&void 0!==arguments[1]?arguments[1]:{},source:'jitsi-meet-api'}},i.createAudioOnlyDisableEvent=function(){return{action:'audio.only.disabled'}},i.createDeviceChangedEvent=function(t,e){return{action:'device.changed',attributes:{device_type:e,media_type:t}}},i.createFeedbackOpenEvent=function(){return{action:'feedback.opened'}},i.createInviteDialogClosedEvent=function(){return{action:'invite.dialog.closed'}},i.createPageReloadScheduledEvent=function(t,e,n){return{action:'page.reload.scheduled',attributes:babelHelpers.extends({reason:t,timeout:e},n)}},i.createPinnedEvent=function(t,e,n){return{type:"track",action:t,actionSubject:'participant',objectType:'participant',objectId:e,attributes:n}},i.createProfilePanelButtonEvent=function(t){return{action:'clicked',actionSubject:t,attributes:arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},source:'profile.panel',type:"ui"}},i.createRecordingDialogEvent=function(t,e){return{action:'clicked',actionSubject:e,source:t+".recording.dialog",type:"ui"}},i.createRemoteMuteConfirmedEvent=function(t){return{action:'clicked',actionSubject:'remote.mute.dialog.confirm.button',attributes:{participant_id:t},source:'remote.mute.dialog',type:"ui"}},i.createRemoteVideoMenuButtonEvent=function(t,e){return{action:'clicked',actionSubject:t,attributes:e,source:'remote.video.menu',type:"ui"}},i.createScreenSharingEvent=function(t){return{action:t,actionSubject:'screen.sharing'}},i.createSelectParticipantFailedEvent=function(t){var e={action:'select.participant.failed'};return t&&(e.error=t.toString()),e},i.createSharedVideoEvent=function(t){return{action:t,attributes:arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},actionSubject:'shared.video'}},i.createShortcutEvent=function(t){return{action:arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,actionSubject:'keyboard.shortcut',actionSubjectId:t,attributes:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},source:'keyboard.shortcut',type:"ui"}},i.createStartAudioOnlyEvent=function(t){return{action:'start.audio.only',attributes:{enabled:t}}},i.createStartMutedConfigurationEvent=function(t,e,n){return{action:'start.muted.configuration',attributes:{source:t,audio_mute:e,video_mute:n}}},i.createStreamSwitchDelayEvent=function(t){return{action:'stream.switch.delay',attributes:t}},i.createSyncTrackStateEvent=function(t,e){return{action:'sync.track.state',attributes:{media_type:t,muted:e}}},i.createToolbarEvent=function(t){return{action:'clicked',actionSubject:t,attributes:arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},source:'toolbar.button',type:"ui"}},i.createTrackMutedEvent=function(t,e){return{action:'track.muted',attributes:{media_type:t,muted:!(arguments.length>2&&void 0!==arguments[2])||arguments[2],reason:e}}}},306); -__d(function(e,r,a,n){Object.defineProperty(n,"__esModule",{value:!0}),n.sendAnalytics=function(e){try{t.analytics.sendEvent(e)}catch(e){l.warn("Error sending analytics event: "+e)}},n.initAnalytics=function(e){var r=e.getState;if((0,i.getJitsiMeetGlobalNS)().analyticsHandlers=[],window.analyticsHandlers=[],!t.analytics||!(0,t.isAnalyticsEnabled)(r))return;var a=r(),n=a['features/base/config'],s=n.analyticsScriptUrls,c=n.deploymentInfo,u=a['features/base/jwt'],y=u.group,f=u.server,d=u.user,b={envType:c&&c.envType||'dev',group:y,product:c&&c.product,subproduct:c&&c.environment,user:d&&d.id,version:o.default.version};(function(e,r){for(var a=[],n=function(e){a.push((0,i.loadScript)(e).then(function(){return{type:'success'}},function(r){return{type:'error',error:r,url:e}}))},t=e,o=Array.isArray(t),s=0,t=o?t:t["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();;){var c;if(o){if(s>=t.length)break;c=t[s++]}else{if((s=t.next()).done)break;c=s.value}var u=c;n(u)}return Promise.all(a).then(function(e){for(var a=e,n=Array.isArray(a),t=0,a=n?a:a["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();;){var o;if(n){if(t>=a.length)break;o=a[t++]}else{if((t=a.next()).done)break;o=t.value}var s=o;'error'===s.type&&l.warn("Failed to load "+s.url+": "+s.error)}var c=[].concat(babelHelpers.toConsumableArray((0,i.getJitsiMeetGlobalNS)().analyticsHandlers),babelHelpers.toConsumableArray(window.analyticsHandlers));if(0===c.length)throw new Error('No analytics handlers available');for(var u=[],y=c,f=Array.isArray(y),d=0,y=f?y:y["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();;){var b;if(f){if(d>=y.length)break;b=y[d++]}else{if((d=y.next()).done)break;b=d.value}var v=b;try{u.push(new v(r))}catch(e){l.warn("Error creating analytics handler: "+e)}}return l.debug("Loaded "+u.length+" analytics handlers"),u})})(s,b).then(function(e){var r=a['features/base/conference'].room,n={};if(f&&(n.server=f),y&&(n.group=y),c)for(var o in c)c.hasOwnProperty(o)&&(n[o]=c[o]);t.analytics.addPermanentProperties(n),t.analytics.setConferenceName(r),t.analytics.setAnalyticsHandlers(e)},function(e){return t.analytics.dispose()&&l.error(e)})};var t=r(308),o=babelHelpers.interopRequireDefault(t),i=r(437),l=r(380).getLogger(__filename)},307); -__d(function(e,t,n,i){Object.defineProperty(i,"__esModule",{value:!0}),i.JitsiTrackEvents=i.JitsiTrackErrors=i.JitsiSIPVideoGWStatus=i.JitsiRecordingStatus=i.JitsiParticipantConnectionStatus=i.JitsiMediaDevicesEvents=i.JitsiConnectionQualityEvents=i.JitsiConnectionEvents=i.JitsiConnectionErrors=i.JitsiConferenceEvents=i.JitsiConferenceErrors=i.browser=i.analytics=i.default=void 0;var r=t(309);Object.keys(r).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(i,e,{enumerable:!0,get:function(){return r[e]}})});var s=t(445);Object.keys(s).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(i,e,{enumerable:!0,get:function(){return s[e]}})});var o=t(454);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(i,e,{enumerable:!0,get:function(){return o[e]}})});var a=t(446);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(i,e,{enumerable:!0,get:function(){return a[e]}})});var c=t(310),u=babelHelpers.interopRequireDefault(c);t(455),t(630),i.default=u.default;i.analytics=u.default.analytics,i.browser=u.default.util.browser,i.JitsiConferenceErrors=u.default.errors.conference,i.JitsiConferenceEvents=u.default.events.conference,i.JitsiConnectionErrors=u.default.errors.connection,i.JitsiConnectionEvents=u.default.events.connection,i.JitsiConnectionQualityEvents=u.default.events.connectionQuality,i.JitsiMediaDevicesEvents=u.default.events.mediaDevices,i.JitsiParticipantConnectionStatus=u.default.constants.participantConnectionStatus,i.JitsiRecordingStatus=u.default.constants.recordingStatus,i.JitsiSIPVideoGWStatus=u.default.constants.sipVideoGW,i.JitsiTrackErrors=u.default.errors.track,i.JitsiTrackEvents=u.default.events.track},308); -__d(function(e,t,n,i){Object.defineProperty(i,"__esModule",{value:!0}),i.disposeLib=function(){return function(e){e({type:u.LIB_WILL_DISPOSE}),e({type:u.LIB_DID_DISPOSE})}},i.initLib=function(){return function(e,t){var n=t()['features/base/config'];if(!n)throw new Error('Cannot init lib-jitsi-meet without config');return'undefined'!=typeof APP?Promise.resolve():(e({type:u.LIB_WILL_INIT}),o.default.init(babelHelpers.extends({enableAnalyticsLogging:(0,f.isAnalyticsEnabled)(t)},n)).then(function(){return e({type:u.LIB_DID_INIT})}).catch(function(t){throw e(a(t)),console.error('lib-jitsi-meet failed to init:',t),t}))}},i.libInitError=a,i.setWebRTCReady=function e(t){return function(n,i){if(i()['features/base/lib-jitsi-meet'].webRTCReady!==t)switch(n({type:u.SET_WEBRTC_READY,webRTCReady:t}),typeof t){case'function':case'object':var r=t.then;if('function'==typeof r){var o=function(r){i()['features/base/lib-jitsi-meet'].webRTCReady===t&&n(e(r))};r.call(t,function(){return o(!0)},function(){return o(!1)})}}}};var r=t(310),o=babelHelpers.interopRequireDefault(r),u=t(445),f=t(446);function a(e){return{type:u.LIB_INIT_ERROR,error:e}}},309); -__d(function(e,i,t,d){Object.defineProperty(d,"__esModule",{value:!0}),d.default=void 0,i(311);var u=i(443),a=babelHelpers.interopRequireDefault(u);!(function(e){if(void 0===e.$){var t=i(444);t(e),e.$=t}})(e||window||this),d.default=a.default},310); -__d(function(n,_,c,d){_(312),_(436)},311); -__d(function(e,t,r,n){var o=t(313),i=babelHelpers.interopRequireDefault(o),a=t(352),f=babelHelpers.interopRequireDefault(a);t(353);var l=t(354);t(374);function d(e,t){var r=null;return e&&(function e(t,r){if(r(t))return!0;if(t=t.firstChild)do{if(e(t,r))return!0}while(t=t.nextSibling);return!1})(e,function(e){return 1===e.nodeType&&e.nodeName===t&&(r=e,!0)}),r}!(function(e){var r=t(410).DOMParser;void 0===e.addEventListener&&(e.addEventListener=function(){});var n=Array.prototype;if(void 0===n['@@iterator']&&(n['@@iterator']=function(){return new i.default(this)}),void 0===e.document){var o=(new r).parseFromString('','text/xml');void 0===o.addEventListener&&(o.addEventListener=function(){}),void 0===o.cookie&&(o.cookie='');var a=Object.getPrototypeOf(o.documentElement);a&&(void 0===a.querySelector&&(a.querySelector=function(e){return d(this,e)}),a.hasOwnProperty('innerHTML')||Object.defineProperty(a,'innerHTML',{get:function(){return this.childNodes.toString()},set:function(e){this.textContent='';for(var t=(new r).parseFromString("
"+e+"
",'text/xml').documentElement,n=void 0;n=t.firstChild;)this.appendChild(n)}}));var u=(function e(t,r){if(t===r)return t;var n=void 0;return(n=Object.getPrototypeOf(t))&&(n=e(r,n))||(n=Object.getPrototypeOf(r))&&(n=e(t,n))?n:void 0})(Object.getPrototypeOf(o),a);if(u&&u!==Object.getPrototypeOf({})){var s=e.console;if(s){var v=t(380).levels;Object.keys(v).forEach(function(e){var t=v[e],r=s[t];'function'==typeof r&&(s[t]=function(){for(var e=arguments.length,n=Array(e),o=0;o=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach(function(t,e){t>=_&&(this.__redo__[e]=++t)},this),this.__redo__.push(_)):f(this,"__redo__",d("c",[_])))}),_onDelete:d(function(_){var t;_>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(t=this.__redo__.indexOf(_))&&this.__redo__.splice(t,1),this.__redo__.forEach(function(t,e){t>_&&(this.__redo__[e]=--t)},this)))}),_onClear:d(function(){this.__redo__&&o.call(this.__redo__),this.__nextIndex__=0})}))),f(i.prototype,"function"==typeof u?u.iterator:"@@iterator",d(function(){return this}))},313); -__d(function(t,n,i,r){"use strict";var s=n(315);i.exports=function(){return s(this).length=0,this}},314); -__d(function(n,r,e,t){"use strict";var o=r(316);e.exports=function(n){if(!o(n))throw new TypeError("Cannot use null or undefined");return n}},315); -__d(function(n,t,r,u){"use strict";var c=t(317)();r.exports=function(n){return n!==c&&null!==n}},316); -__d(function(t,n,c,i){"use strict";c.exports=function(){}},317); -__d(function(s,t,c,e){"use strict";c.exports=t(319)()?Object.assign:t(320)},318); -__d(function(r,t,o,a){"use strict";o.exports=function(){var r,t=Object.assign;return"function"==typeof t&&(t(r={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),r.foo+r.bar+r.trzy==="razdwatrzy")}},319); -__d(function(t,r,c,n){"use strict";var o=r(321),a=r(315),f=Math.max;c.exports=function(t,r){var c,n,i,e=f(arguments.length,2);for(t=Object(a(t)),i=function(n){try{t[n]=r[n]}catch(t){c||(c=t)}},n=1;n-1}},330); -__d(function(e,t,n,r){'use strict';var o,i=t(332),l=t(326),u=t(324),s=t(349),c=t(324),v=t(315),a=Function.prototype.bind,f=Object.defineProperty,p=Object.prototype.hasOwnProperty;o=function(e,t,n){var r,o=v(t)&&c(t.value);return delete(r=i(t)).writable,delete r.value,r.get=function(){return!n.overwriteDefinition&&p.call(this,e)?o:(t.value=a.call(o,n.resolveContext?n.resolveContext(this):this),f(this,e,t),this[e])},r},n.exports=function(e){var t=l(arguments[1]);return null!=t.resolveContext&&u(t.resolveContext),s(e,function(e,n){return o(n,e,t)})}},331); -__d(function(n,r,t,e){"use strict";var u=r(333),c=r(318),i=r(315);t.exports=function(n){var r=Object(i(n)),t=arguments[1],e=Object(arguments[2]);if(r!==n&&!t)return r;var f={};return t?u(t,function(r){(e.ensure||r in n)&&(f[r]=n[r])}):c(f,n),f}},332); -__d(function(r,t,o,s){"use strict";o.exports=t(334)()?Array.from:t(335)},333); -__d(function(r,n,o,t){"use strict";o.exports=function(){var r,n,o=Array.from;return"function"==typeof o&&(n=o(r=["raz","dwa"]),Boolean(n&&n!==r&&"dwa"===n[1]))}},334); -__d(function(e,r,l,t){"use strict";var n=r(336).iterator,a=r(341),i=r(342),u=r(343),o=r(324),f=r(315),c=r(316),v=r(348),h=Array.isArray,s=Function.prototype.call,y={configurable:!0,enumerable:!0,writable:!0,value:null},A=Object.defineProperty;l.exports=function(e){var r,l,t,d,g,p,w,b,x,j,O=arguments[1],_=arguments[2];if(e=Object(f(e)),c(O)&&o(O),this&&this!==Array&&i(this))r=this;else{if(!O){if(a(e))return 1!==(g=e.length)?Array.apply(null,e):((d=new Array(1))[0]=e[0],d);if(h(e)){for(d=new Array(g=e.length),l=0;l=55296&&p<=56319&&(j+=e[++l]),j=O?s.call(O,_,j,t):j,r?(y.value=j,A(d,t,y)):d[t]=j,++t;g=t}if(void 0===g)for(g=u(e.length),r&&(d=new r(g)),l=0;l0?1:-1}},347); -__d(function(t,n,o,e){"use strict";var r=Object.prototype.toString,c=r.call("");o.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||r.call(t)===c)||!1}},348); -__d(function(t,n,c,o){"use strict";var r=n(324),u=n(350),i=Function.prototype.call;c.exports=function(t,n){var c={},o=arguments[2];return r(n),u(t,function(t,r,u,a){c[r]=i.call(n,o,t,r,u,a)}),c}},349); -__d(function(t,c,o,r){"use strict";o.exports=c(351)("forEach")},350); -__d(function(t,n,o,c){"use strict";var e=n(324),r=n(315),u=Function.prototype.bind,i=Function.prototype.call,l=Object.keys,p=Object.prototype.propertyIsEnumerable;o.exports=function(t,n){return function(o,c){var a,f=arguments[2],y=arguments[3];return o=Object(r(o)),e(c),a=l(o),y&&a.sort("function"==typeof y?u.call(y,o):void 0),"function"!=typeof t&&(t=a[t]),i.call(t,a,function(t,e){return p.call(o,t)?i.call(c,f,o[t],t,o,e):n})}}},351); -__d(function(e,t,a,n){Object.defineProperty(n,"__esModule",{value:!0});var i=t(24),c=i.NativeModules.RNBackgroundTimer,r=new i.NativeEventEmitter(c),l=(function(){function e(){var t=this;babelHelpers.classCallCheck(this,e),this.runBackgroundTimer=function(e,a){var n=i.Platform.select({ios:function(){return i.NativeAppEventEmitter},android:function(){return i.DeviceEventEmitter}})();t.start(0),t.backgroundListener=n.addListener('backgroundTimer',function(){t.backgroundListener.remove(),t.backgroundClockMethod(e,a)})},this.stopBackgroundTimer=function(){t.stop(),clearTimeout(t.backgroundTimer)},this.uniqueId=0,this.callbacks={},r.addListener('backgroundTimer.timeout',function(e){if(t.callbacks[e]){var a=t.callbacks[e].callback;t.callbacks[e].interval?c.setTimeout(e,t.callbacks[e].timeout):delete t.callbacks[e],a()}})}return babelHelpers.createClass(e,[{key:"start",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return c.start(e)}},{key:"stop",value:function(){return c.stop()}},{key:"backgroundClockMethod",value:function(e,t){var a=this;this.backgroundTimer=setTimeout(function(){e(),a.backgroundClockMethod(e,t)},t)}},{key:"setTimeout",value:function(e,t){var a=++this.uniqueId;return this.callbacks[a]={callback:e,interval:!1,timeout:t},c.setTimeout(a,t),a}},{key:"clearTimeout",value:function(e){this.callbacks[e]&&delete this.callbacks[e]}},{key:"setInterval",value:function(e,t){var a=++this.uniqueId;return this.callbacks[a]={callback:e,interval:!0,timeout:t},c.setTimeout(a,t),a}},{key:"clearInterval",value:function(e){this.callbacks[e]&&delete this.callbacks[e]}}]),e})();n.default=new l},352); -__d(function(t,e,s,i){!(function(t){'use strict';var e=!1;if(!t.forceJURL)try{var s=new URL('b','http://a');s.pathname='c%20d',e='http://a/c%20d'===s.href}catch(t){}if(!e){var i=Object.create(null);i.ftp=21,i.file=0,i.gopher=70,i.http=80,i.https=443,i.ws=80,i.wss=443;var a=Object.create(null);a['%2e']='.',a['.%2e']='..',a['%2e.']='..',a['%2e%2e']='..';var h=void 0,r=/[a-zA-Z]/,n=/[a-zA-Z0-9\+\-\.]/;m.prototype={toString:function(){return this.href},get href(){if(this._isInvalid)return this._url;var t='';return''==this._username&&null==this._password||(t=this._username+(null!=this._password?':'+this._password:'')+'@'),this.protocol+(this._isRelative?'//'+t+this.host:'')+this.pathname+this._query+this._fragment},set href(t){v.call(this),f.call(this,t)},get protocol(){return this._scheme+':'},set protocol(t){this._isInvalid||f.call(this,t+':','scheme start')},get host(){return this._isInvalid?'':this._port?this._host+':'+this._port:this._host},set host(t){!this._isInvalid&&this._isRelative&&f.call(this,t,'host')},get hostname(){return this._host},set hostname(t){!this._isInvalid&&this._isRelative&&f.call(this,t,'hostname')},get port(){return this._port},set port(t){!this._isInvalid&&this._isRelative&&f.call(this,t,'port')},get pathname(){return this._isInvalid?'':this._isRelative?'/'+this._path.join('/'):this._schemeData},set pathname(t){!this._isInvalid&&this._isRelative&&(this._path=[],f.call(this,t,'relative path start'))},get search(){return this._isInvalid||!this._query||'?'==this._query?'':this._query},set search(t){!this._isInvalid&&this._isRelative&&(this._query='?','?'==t[0]&&(t=t.slice(1)),f.call(this,t,'query'))},get hash(){return this._isInvalid||!this._fragment||'#'==this._fragment?'':this._fragment},set hash(t){this._isInvalid||(this._fragment='#','#'==t[0]&&(t=t.slice(1)),f.call(this,t,'fragment'))},get origin(){var t;if(this._isInvalid||!this._scheme)return'';switch(this._scheme){case'data':case'file':case'javascript':case'mailto':return'null'}return(t=this.host)?this._scheme+'://'+t:''}};var o=t.URL;o&&(m.createObjectURL=function(t){return o.createObjectURL.apply(o,arguments)},m.revokeObjectURL=function(t){o.revokeObjectURL(t)}),t.URL=m}function l(t){return void 0!==i[t]}function _(){v.call(this),this._isInvalid=!0}function c(t){return''==t&&_.call(this),t.toLowerCase()}function p(t){var e=t.charCodeAt(0);return e>32&&e<127&&-1==[34,35,60,62,63,96].indexOf(e)?t:encodeURIComponent(t)}function u(t){var e=t.charCodeAt(0);return e>32&&e<127&&-1==[34,35,60,62,96].indexOf(e)?t:encodeURIComponent(t)}function f(t,e,s){function o(t){y.push(t)}var f=e||'scheme start',v=0,m='',d=!1,g=!1,y=[];t:for(;(t[v-1]!=h||0==v)&&!this._isInvalid;){var w=t[v];switch(f){case'scheme start':if(!w||!r.test(w)){if(e){o('Invalid scheme.');break t}m='',f='no scheme';continue}m+=w.toLowerCase(),f='scheme';break;case'scheme':if(w&&n.test(w))m+=w.toLowerCase();else{if(':'!=w){if(e){if(h==w)break t;o('Code point not allowed in scheme: '+w);break t}m='',v=0,f='no scheme';continue}if(this._scheme=m,m='',e)break t;l(this._scheme)&&(this._isRelative=!0),f='file'==this._scheme?'relative':this._isRelative&&s&&s._scheme==this._scheme?'relative or authority':this._isRelative?'authority first slash':'scheme data'}break;case'scheme data':'?'==w?(query='?',f='query'):'#'==w?(this._fragment='#',f='fragment'):h!=w&&'\t'!=w&&'\n'!=w&&'\r'!=w&&(this._schemeData+=p(w));break;case'no scheme':if(s&&l(s._scheme)){f='relative';continue}o('Missing scheme.'),_.call(this);break;case'relative or authority':if('/'!=w||'/'!=t[v+1]){o('Expected /, got: '+w),f='relative';continue}f='authority ignore slashes';break;case'relative':if(this._isRelative=!0,'file'!=this._scheme&&(this._scheme=s._scheme),h==w){this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query=s._query,this._username=s._username,this._password=s._password;break t}if('/'==w||'\\'==w)'\\'==w&&o('\\ is an invalid code point.'),f='relative slash';else if('?'==w)this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query='?',this._username=s._username,this._password=s._password,f='query';else{if('#'!=w){var b=t[v+1],k=t[v+2];('file'!=this._scheme||!r.test(w)||':'!=b&&'|'!=b||h!=k&&'/'!=k&&'\\'!=k&&'?'!=k&&'#'!=k)&&(this._host=s._host,this._port=s._port,this._username=s._username,this._password=s._password,this._path=s._path.slice(),this._path.pop()),f='relative path';continue}this._host=s._host,this._port=s._port,this._path=s._path.slice(),this._query=s._query,this._fragment='#',this._username=s._username,this._password=s._password,f='fragment'}break;case'relative slash':if('/'!=w&&'\\'!=w){'file'!=this._scheme&&(this._host=s._host,this._port=s._port,this._username=s._username,this._password=s._password),f='relative path';continue}'\\'==w&&o('\\ is an invalid code point.'),f='file'==this._scheme?'file host':'authority ignore slashes';break;case'authority first slash':if('/'!=w){o("Expected '/', got: "+w),f='authority ignore slashes';continue}f='authority second slash';break;case'authority second slash':if(f='authority ignore slashes','/'!=w){o("Expected '/', got: "+w);continue}break;case'authority ignore slashes':if('/'!=w&&'\\'!=w){f='authority';continue}o('Expected authority, got: '+w);break;case'authority':if('@'==w){d&&(o('@ already seen.'),m+='%40'),d=!0;for(var I=0;I1&&void 0!==arguments[1]?arguments[1]:{},t={},o=Object.keys(e),i=Array.isArray(o),a=0,o=i?o:o["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();;){var n;if(i){if(a>=o.length)break;n=o[a++]}else{if((a=o.next()).done)break;n=a.value}var l=n;t[l]=f(babelHelpers.extends({},e[l],r[l]))}return t},o.fixAndroidViewClipping=function(e){'android'===i.Platform.OS&&(e.borderColor=a.ColorPalette.appBackground,e.borderWidth=1);return e};var i=r(354),a=r(364),n=['height','width'];function f(e){var r=n,t=Array.isArray(r),o=0;for(r=t?r:r["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();;){var i;if(t){if(o>=r.length)break;i=r[o++]}else{if((o=r.next()).done)break;i=o.value}var a=i,f=e[a],l=typeof f;if('undefined'!==l&&'number'!==l){var d=Number(f);Number.isNaN(d)?delete e[a]:e[a]=d}}return e}},368); -__d(function(e,t,s,l){Object.defineProperty(l,"__esModule",{value:!0});var o=t(15),r=babelHelpers.interopRequireDefault(o),i=t(24),a=t(363),p={alignItems:'center',bottom:0,justifyContent:'center',left:0,position:'absolute',right:0,top:0},n=(function(e){babelHelpers.inherits(t,e);function t(e){babelHelpers.classCallCheck(this,t);var s=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return s.componentWillReceiveProps(e),s}return babelHelpers.createClass(t,[{key:"componentWillReceiveProps",value:function(e){var t=this.props&&this.props.color,s=this.props&&this.props.opacity,l=this.props&&this.props.style,o=e&&e.color,r=e&&e.opacity,i=e&&e.style,a=!this.state;if(a||t!==o||s!==r||l!==i){var n={style:babelHelpers.extends({},p,i,{backgroundColor:o,opacity:r})};a?this.state=n:this.setState(n)}}},{key:"render",value:function(){return r.default.createElement(i.View,{style:p},r.default.createElement(i.View,{style:this.state.style}),r.default.createElement(i.View,{style:p},this.props.children))}}]),t})(o.Component);n.defaultProps={color:a.ColorPalette.appBackground,opacity:.8,style:{}},l.default=n},369); -__d(function(e,t,r,l){Object.defineProperty(l,"__esModule",{value:!0});var n=(function(e){babelHelpers.inherits(t,e);function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.createClass(t,[{key:"render",value:function(){return this.props.children}}]),t})(t(15).Component);l.default=n},370); -__d(function(e,t,i,n){Object.defineProperty(n,"__esModule",{value:!0}),n.getSafetyOffset=function(){if('android'===o.default.OS)return 0;return h()?s:f},n.isIPad=function(){var e=r.Dimensions.get('window'),t=e.height,i=e.width;return'ios'===o.default.OS&&Math.max(t,i)/Math.min(t,i)<1.6},n.isIPhoneX=h;var r=t(24),a=t(372),o=babelHelpers.interopRequireDefault(a),u=812,d=375,f=20,s=44;function h(){var e=r.Dimensions.get('window'),t=e.height,i=e.width;return'ios'===o.default.OS&&(t===u&&i===d||t===d&&i===u)}},371); -__d(function(e,t,a,d){Object.defineProperty(d,"__esModule",{value:!0});var f=t(24);d.default=f.Platform},372); -__d(function(e,t,n,r){Object.defineProperty(r,"__esModule",{value:!0});t(15);var u=(function(){function e(){babelHelpers.classCallCheck(this,e),this._elements=[]}return babelHelpers.createClass(e,[{key:"areRoutesEqual",value:function(e,t){if(e===t)return!0;if(!e)return!t;if(!t)return!e;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(n){return e[n]===t[n]})}},{key:"getRoutes",value:function(){return this._elements.map(function(e){return babelHelpers.extends({},e)})}},{key:"getRouteByComponent",value:function(e){var t=this._elements.find(function(t){return t.component===e});return t?babelHelpers.extends({},t):null}},{key:"register",value:function(e){if(this._elements.includes(e))throw new Error("Route "+String(e.component)+" is registered already!");this._elements.push(e)}}]),e})();r.default=new u},373); -__d(function(e,t,r,n){Object.defineProperty(n,"__esModule",{value:!0}),n.PersistenceRegistry=void 0;var u=t(375);Object.keys(u).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(n,e,{enumerable:!0,get:function(){return u[e]}})});var i=t(379);Object.defineProperty(n,"PersistenceRegistry",{enumerable:!0,get:function(){return babelHelpers.interopRequireDefault(i).default}}),t(384)},374); -__d(function(e,t,n,r){Object.defineProperty(r,"__esModule",{value:!0});var u=t(376);Object.keys(u).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return u[e]}})})},375); -__d(function(n,_,c,d){_(377)},376); -__d(function(e,o,a,t){var i=o(378),l=babelHelpers.interopRequireDefault(i);void 0===(r=e||window||this).localStorage&&(r.localStorage=new l.default('@jitsi-meet/')),void 0===r.sessionStorage&&(r.sessionStorage=new l.default);var r},377); -__d(function(e,t,i,n){Object.defineProperty(n,"__esModule",{value:!0});var r=t(24),a=(function(){function e(t){var i=this;babelHelpers.classCallCheck(this,e),this._keyPrefix=t;var n=this._initializeAsync();n&&(this._initializing=n,n.finally(function(){i._initializing===n&&(i._initializing=void 0)}))}return babelHelpers.createClass(e,[{key:"clear",value:function(){var e=Object.keys(this),t=Array.isArray(e),i=0;for(e=t?e:e["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();;){var n;if(t){if(i>=e.length)break;n=e[i++]}else{if((i=e.next()).done)break;n=i.value}var r=n;this.removeItem(r)}}},{key:"getItem",value:function(e){return this.hasOwnProperty(e)?this[e]:null}},{key:"_getItemAsync",value:function(e){var t=this;return(this._initializing||Promise.resolve()).catch(function(){}).then(function(){return t.getItem(e)})}},{key:"_initializeAsync",value:function(){var e=this;if(void 0!==this._keyPrefix)return new Promise(function(t){r.AsyncStorage.getAllKeys().then(function(){for(var i=arguments.length,n=Array(i),a=0;a=a.length)break;o=a[s++]}else{if((s=a.next()).done)break;o=s.value}var f=o,y=babelHelpers.slicedToArray(f,2),u=y[0],h=y[1];u=u.substring(r),e.hasOwnProperty(u)||(e[u]=h)}t()})})})}},{key:"key",value:function(e){var t=Object.keys(this);return e "+r),this._checksum=r}catch(e){u.error('Error persisting redux state',e)}}},{key:"register",value:function(e,t){this._elements[e]=t}},{key:"_calculateChecksum",value:function(e){try{return n.default.hex(JSON.stringify(e)||'')}catch(t){return u.error('Error calculating checksum for state',e,t),''}}},{key:"_getFilteredState",value:function(e){var t={},r=Object.keys(this._elements),a=Array.isArray(r),i=0;for(r=a?r:r["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();;){var s;if(a){if(i>=r.length)break;s=r[i++]}else{if((i=r.next()).done)break;s=i.value}var l=s;e[l]&&(t[l]=this._getFilteredSubtree(e[l],this._elements[l]))}return t}},{key:"_getFilteredSubtree",value:function(e,t){var r={},a=Object.keys(e),i=Array.isArray(a),s=0;for(a=i?a:a["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();;){var l;if(i){if(s>=a.length)break;l=a[s++]}else{if((s=a.next()).done)break;l=s.value}var n=l;t[n]&&(r[n]=e[n])}return r}}]),e})();a.default=new c},379); -__d(function(e,o,r,l){var n=o(381),t=o(382),a={},v=[],s=n.levels.TRACE;r.exports={addGlobalTransport:function(e){n.addGlobalTransport(e)},removeGlobalTransport:function(e){n.removeGlobalTransport(e)},getLogger:function(e,o,r){var l=new n(s,e,o,r);return e?(a[e]=a[e]||[],a[e].push(l)):v.push(l),l},setLogLevelById:function(e,o){for(var r=o?a[o]||[]:v,l=0;l: ").apply(i,e)}}function a(t,n,e,o){this.id=n,this.format=o,this.transports=e,this.transports||(this.transports=[]),this.level=r[t];for(var l=Object.keys(r),a=0;a=this.maxEntryLength&&this._flush(!0,!0)},h.prototype.start=function(){this._reschedulePublishInterval()},h.prototype._reschedulePublishInterval=function(){this.storeLogsIntervalID&&(window.clearTimeout(this.storeLogsIntervalID),this.storeLogsIntervalID=null),this.storeLogsIntervalID=window.setTimeout(this._flush.bind(this,!1,!0),this.storeInterval)},h.prototype.flush=function(){this._flush(!1,!0)},h.prototype._flush=function(t,e){this.totalLen>0&&(this.logStorage.isReady()||t)&&(this.logStorage.isReady()?(this.outputCache.length&&(this.outputCache.forEach(function(t){this.logStorage.storeLogs(t)}.bind(this)),this.outputCache=[]),this.logStorage.storeLogs(this.queue)):this.outputCache.push(this.queue),this.queue=[],this.totalLen=0),e&&this._reschedulePublishInterval()},h.prototype.stop=function(){this._flush(!1,!1)},s.exports=h},382); -__d(function(global,require,module,exports){!(function(){'use strict';var ERROR='input is invalid type',WINDOW='object'==typeof window,root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&'object'==typeof self,NODE_JS=!root.JS_MD5_NO_NODE_JS&&'object'==typeof process&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&'object'==typeof module&&module.exports,AMD='function'==typeof define&&define.amd,ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&'undefined'!=typeof ArrayBuffer,HEX_CHARS='0123456789abcdef'.split(''),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=['hex','array','digest','buffer','arrayBuffer','base64'],BASE64_ENCODE_CHAR='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}!root.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return'[object Array]'===Object.prototype.toString.call(t)}),!ARRAY_BUFFER||!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return'object'==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t){return function(r){return new Md5(!0).update(r)[t]()}},createMethod=function(){var t=createOutputMethod('hex');NODE_JS&&(t=nodeWrap(t)),t.create=function(){return new Md5},t.update=function(r){return t.create().update(r)};for(var r=0;r>2]|=t[o]<>6,a[i++]=128|63&s):s<55296||s>=57344?(a[i++]=224|s>>12,a[i++]=128|s>>6&63,a[i++]=128|63&s):(s=65536+((1023&s)<<10|1023&t.charCodeAt(++o)),a[i++]=240|s>>18,a[i++]=128|s>>12&63,a[i++]=128|s>>6&63,a[i++]=128|63&s);else for(i=this.start;o>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(f[i>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=64?(this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,r=this.lastByteIndex;t[r>>2]|=EXTRA[3&r],r>=56&&(this.hashed||this.hash(),t[0]=t[16],t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.bytes<<3,this.hash()}},Md5.prototype.hash=function(){var t,r,e,s,i,o,h=this.blocks;this.first?r=((r=((t=((t=h[0]-680876937)<<7|t>>>25)-271733879<<0)^(e=((e=(-271733879^(s=((s=(-1732584194^2004318071&t)+h[1]-117830708)<<12|s>>>20)+t<<0)&(-271733879^t))+h[2]-1126478375)<<17|e>>>15)+s<<0)&(s^t))+h[3]-1316259209)<<22|r>>>10)+e<<0:(t=this.h0,r=this.h1,e=this.h2,r=((r+=((t=((t+=((s=this.h3)^r&(e^s))+h[0]-680876936)<<7|t>>>25)+r<<0)^(e=((e+=(r^(s=((s+=(e^t&(r^e))+h[1]-389564586)<<12|s>>>20)+t<<0)&(t^r))+h[2]+606105819)<<17|e>>>15)+s<<0)&(s^t))+h[3]-1044525330)<<22|r>>>10)+e<<0),r=((r+=((t=((t+=(s^r&(e^s))+h[4]-176418897)<<7|t>>>25)+r<<0)^(e=((e+=(r^(s=((s+=(e^t&(r^e))+h[5]+1200080426)<<12|s>>>20)+t<<0)&(t^r))+h[6]-1473231341)<<17|e>>>15)+s<<0)&(s^t))+h[7]-45705983)<<22|r>>>10)+e<<0,r=((r+=((t=((t+=(s^r&(e^s))+h[8]+1770035416)<<7|t>>>25)+r<<0)^(e=((e+=(r^(s=((s+=(e^t&(r^e))+h[9]-1958414417)<<12|s>>>20)+t<<0)&(t^r))+h[10]-42063)<<17|e>>>15)+s<<0)&(s^t))+h[11]-1990404162)<<22|r>>>10)+e<<0,r=((r+=((t=((t+=(s^r&(e^s))+h[12]+1804603682)<<7|t>>>25)+r<<0)^(e=((e+=(r^(s=((s+=(e^t&(r^e))+h[13]-40341101)<<12|s>>>20)+t<<0)&(t^r))+h[14]-1502002290)<<17|e>>>15)+s<<0)&(s^t))+h[15]+1236535329)<<22|r>>>10)+e<<0,r=((r+=((s=((s+=(r^e&((t=((t+=(e^s&(r^e))+h[1]-165796510)<<5|t>>>27)+r<<0)^r))+h[6]-1069501632)<<9|s>>>23)+t<<0)^t&((e=((e+=(t^r&(s^t))+h[11]+643717713)<<14|e>>>18)+s<<0)^s))+h[0]-373897302)<<20|r>>>12)+e<<0,r=((r+=((s=((s+=(r^e&((t=((t+=(e^s&(r^e))+h[5]-701558691)<<5|t>>>27)+r<<0)^r))+h[10]+38016083)<<9|s>>>23)+t<<0)^t&((e=((e+=(t^r&(s^t))+h[15]-660478335)<<14|e>>>18)+s<<0)^s))+h[4]-405537848)<<20|r>>>12)+e<<0,r=((r+=((s=((s+=(r^e&((t=((t+=(e^s&(r^e))+h[9]+568446438)<<5|t>>>27)+r<<0)^r))+h[14]-1019803690)<<9|s>>>23)+t<<0)^t&((e=((e+=(t^r&(s^t))+h[3]-187363961)<<14|e>>>18)+s<<0)^s))+h[8]+1163531501)<<20|r>>>12)+e<<0,r=((r+=((s=((s+=(r^e&((t=((t+=(e^s&(r^e))+h[13]-1444681467)<<5|t>>>27)+r<<0)^r))+h[2]-51403784)<<9|s>>>23)+t<<0)^t&((e=((e+=(t^r&(s^t))+h[7]+1735328473)<<14|e>>>18)+s<<0)^s))+h[12]-1926607734)<<20|r>>>12)+e<<0,r=((r+=((o=(s=((s+=((i=r^e)^(t=((t+=(i^s)+h[5]-378558)<<4|t>>>28)+r<<0))+h[8]-2022574463)<<11|s>>>21)+t<<0)^t)^(e=((e+=(o^r)+h[11]+1839030562)<<16|e>>>16)+s<<0))+h[14]-35309556)<<23|r>>>9)+e<<0,r=((r+=((o=(s=((s+=((i=r^e)^(t=((t+=(i^s)+h[1]-1530992060)<<4|t>>>28)+r<<0))+h[4]+1272893353)<<11|s>>>21)+t<<0)^t)^(e=((e+=(o^r)+h[7]-155497632)<<16|e>>>16)+s<<0))+h[10]-1094730640)<<23|r>>>9)+e<<0,r=((r+=((o=(s=((s+=((i=r^e)^(t=((t+=(i^s)+h[13]+681279174)<<4|t>>>28)+r<<0))+h[0]-358537222)<<11|s>>>21)+t<<0)^t)^(e=((e+=(o^r)+h[3]-722521979)<<16|e>>>16)+s<<0))+h[6]+76029189)<<23|r>>>9)+e<<0,r=((r+=((o=(s=((s+=((i=r^e)^(t=((t+=(i^s)+h[9]-640364487)<<4|t>>>28)+r<<0))+h[12]-421815835)<<11|s>>>21)+t<<0)^t)^(e=((e+=(o^r)+h[15]+530742520)<<16|e>>>16)+s<<0))+h[2]-995338651)<<23|r>>>9)+e<<0,r=((r+=((s=((s+=(r^((t=((t+=(e^(r|~s))+h[0]-198630844)<<6|t>>>26)+r<<0)|~e))+h[7]+1126891415)<<10|s>>>22)+t<<0)^((e=((e+=(t^(s|~r))+h[14]-1416354905)<<15|e>>>17)+s<<0)|~t))+h[5]-57434055)<<21|r>>>11)+e<<0,r=((r+=((s=((s+=(r^((t=((t+=(e^(r|~s))+h[12]+1700485571)<<6|t>>>26)+r<<0)|~e))+h[3]-1894986606)<<10|s>>>22)+t<<0)^((e=((e+=(t^(s|~r))+h[10]-1051523)<<15|e>>>17)+s<<0)|~t))+h[1]-2054922799)<<21|r>>>11)+e<<0,r=((r+=((s=((s+=(r^((t=((t+=(e^(r|~s))+h[8]+1873313359)<<6|t>>>26)+r<<0)|~e))+h[15]-30611744)<<10|s>>>22)+t<<0)^((e=((e+=(t^(s|~r))+h[6]-1560198380)<<15|e>>>17)+s<<0)|~t))+h[13]+1309151649)<<21|r>>>11)+e<<0,r=((r+=((s=((s+=(r^((t=((t+=(e^(r|~s))+h[4]-145523070)<<6|t>>>26)+r<<0)|~e))+h[11]-1120210379)<<10|s>>>22)+t<<0)^((e=((e+=(t^(s|~r))+h[2]+718787259)<<15|e>>>17)+s<<0)|~t))+h[9]-343485551)<<21|r>>>11)+e<<0,this.first?(this.h0=t+1732584193<<0,this.h1=r-271733879<<0,this.h2=e-1732584194<<0,this.h3=s+271733878<<0,this.first=!1):(this.h0=this.h0+t<<0,this.h1=this.h1+r<<0,this.h2=this.h2+e<<0,this.h3=this.h3+s<<0)},Md5.prototype.hex=function(){this.finalize();var t=this.h0,r=this.h1,e=this.h2,s=this.h3;return HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var t=this.h0,r=this.h1,e=this.h2,s=this.h3;return[255&t,t>>8&255,t>>16&255,t>>24&255,255&r,r>>8&255,r>>16&255,r>>24&255,255&e,e>>8&255,e>>16&255,e>>24&255,255&s,s>>8&255,s>>16&255,s>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(16),r=new Uint32Array(t);return r[0]=this.h0,r[1]=this.h1,r[2]=this.h2,r[3]=this.h3,t},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var t,r,e,s='',i=this.array(),o=0;o<15;)t=i[o++],r=i[o++],e=i[o++],s+=BASE64_ENCODE_CHAR[t>>>2]+BASE64_ENCODE_CHAR[63&(t<<4|r>>>4)]+BASE64_ENCODE_CHAR[63&(r<<2|e>>>6)]+BASE64_ENCODE_CHAR[63&e];return t=i[o],s+=BASE64_ENCODE_CHAR[t>>>2]+BASE64_ENCODE_CHAR[t<<4&63]+'=='};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&define(function(){return exports}))})()},383); -__d(function(e,t,r,n){var u=t(385),i=babelHelpers.interopRequireDefault(u),a=t(386),l=t(379),o=babelHelpers.interopRequireDefault(l),f=i.default.throttle(function(e){return o.default.persistState(e)},2e3);a.MiddlewareRegistry.register(function(e){return function(t){return function(r){var n=(0,a.toState)(e),u=t(r),i=(0,a.toState)(e);return n===i||f(i),u}}})},384); -__d(function(n,t,r,e){(function(){var t,u=200,i='Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',o='Expected a function',f='__lodash_hash_undefined__',a=500,c='__lodash_placeholder__',l=1,s=2,h=4,p=1,v=2,_=1,g=2,y=4,d=8,b=16,w=32,m=64,x=128,j=256,A=512,k=30,O='...',I=800,R=16,z=1,E=2,S=1/0,W=9007199254740991,L=1.7976931348623157e308,C=NaN,U=4294967295,B=U-1,T=U>>>1,$=[['ary',x],['bind',_],['bindKey',g],['curry',d],['curryRight',b],['flip',A],['partial',w],['partialRight',m],['rearg',j]],D='[object Arguments]',M='[object Array]',F='[object AsyncFunction]',N='[object Boolean]',P='[object Date]',q='[object DOMException]',Z='[object Error]',K='[object Function]',V='[object GeneratorFunction]',G='[object Map]',H='[object Number]',J='[object Null]',Y='[object Object]',Q='[object Promise]',X='[object Proxy]',nn='[object RegExp]',tn='[object Set]',rn='[object String]',en='[object Symbol]',un='[object Undefined]',on='[object WeakMap]',fn='[object WeakSet]',an='[object ArrayBuffer]',cn='[object DataView]',ln='[object Float32Array]',sn='[object Float64Array]',hn='[object Int8Array]',pn='[object Int16Array]',vn='[object Int32Array]',_n='[object Uint8Array]',gn='[object Uint8ClampedArray]',yn='[object Uint16Array]',dn='[object Uint32Array]',bn=/\b__p \+= '';/g,wn=/\b(__p \+=) '' \+/g,mn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xn=/&(?:amp|lt|gt|quot|#39);/g,jn=/[&<>"']/g,An=RegExp(xn.source),kn=RegExp(jn.source),On=/<%-([\s\S]+?)%>/g,In=/<%([\s\S]+?)%>/g,Rn=/<%=([\s\S]+?)%>/g,zn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,En=/^\w*$/,Sn=/^\./,Wn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ln=/[\\^$.*+?()[\]{}|]/g,Cn=RegExp(Ln.source),Un=/^\s+|\s+$/g,Bn=/^\s+/,Tn=/\s+$/,$n=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Dn=/\{\n\/\* \[wrapped with (.+)\] \*/,Mn=/,? & /,Fn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Nn=/\\(\\)?/g,Pn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,qn=/\w*$/,Zn=/^[-+]0x[0-9a-f]+$/i,Kn=/^0b[01]+$/i,Vn=/^\[object .+?Constructor\]$/,Gn=/^0o[0-7]+$/i,Hn=/^(?:0|[1-9]\d*)$/,Jn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Yn=/($^)/,Qn=/['\n\r\u2028\u2029\\]/g,Xn="\\ud800-\\udfff",nt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",tt='a-z\\xdf-\\xf6\\xf8-\\xff',rt='A-Z\\xc0-\\xd6\\xd8-\\xde',et="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ut='['+Xn+']',it='['+et+']',ot='['+nt+']',ft='\\d+',at="[\\u2700-\\u27bf]",ct='['+tt+']',lt='[^'+Xn+et+ft+"\\u2700-\\u27bf"+tt+rt+']',st="\\ud83c[\\udffb-\\udfff]",ht='[^'+Xn+']',pt="(?:\\ud83c[\\udde6-\\uddff]){2}",vt="[\\ud800-\\udbff][\\udc00-\\udfff]",_t='['+rt+']',gt='(?:'+ct+'|'+lt+')',yt='(?:'+_t+'|'+lt+')',dt="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",bt="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",wt='(?:'+ot+'|'+st+')'+'?',mt="[\\ufe0e\\ufe0f]?",xt=mt+wt+("(?:\\u200d(?:"+[ht,pt,vt].join('|')+')'+mt+wt+')*'),jt='(?:'+[at,pt,vt].join('|')+')'+xt,At='(?:'+[ht+ot+'?',ot,pt,vt,ut].join('|')+')',kt=RegExp("['\u2019]",'g'),Ot=RegExp(ot,'g'),It=RegExp(st+'(?='+st+')|'+At+xt,'g'),Rt=RegExp([_t+'?'+ct+'+'+dt+'(?='+[it,_t,'$'].join('|')+')',yt+'+'+bt+'(?='+[it,_t+gt,'$'].join('|')+')',_t+'?'+gt+'+'+dt,_t+'+'+bt,'\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)','\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)',ft,jt].join('|'),'g'),zt=RegExp("[\\u200d"+Xn+nt+"\\ufe0e\\ufe0f]"),Et=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,St=['Array','Buffer','DataView','Date','Error','Float32Array','Float64Array','Function','Int8Array','Int16Array','Int32Array','Map','Math','Object','Promise','RegExp','Set','String','Symbol','TypeError','Uint8Array','Uint8ClampedArray','Uint16Array','Uint32Array','WeakMap','_','clearTimeout','isFinite','parseInt','setTimeout'],Wt=-1,Lt={};Lt[ln]=Lt[sn]=Lt[hn]=Lt[pn]=Lt[vn]=Lt[_n]=Lt[gn]=Lt[yn]=Lt[dn]=!0,Lt[D]=Lt[M]=Lt[an]=Lt[N]=Lt[cn]=Lt[P]=Lt[Z]=Lt[K]=Lt[G]=Lt[H]=Lt[Y]=Lt[nn]=Lt[tn]=Lt[rn]=Lt[on]=!1;var Ct={};Ct[D]=Ct[M]=Ct[an]=Ct[cn]=Ct[N]=Ct[P]=Ct[ln]=Ct[sn]=Ct[hn]=Ct[pn]=Ct[vn]=Ct[G]=Ct[H]=Ct[Y]=Ct[nn]=Ct[tn]=Ct[rn]=Ct[en]=Ct[_n]=Ct[gn]=Ct[yn]=Ct[dn]=!0,Ct[Z]=Ct[K]=Ct[on]=!1;var Ut={'\\':'\\',"'":"'",'\n':'n','\r':'r',"\u2028":'u2028',"\u2029":'u2029'},Bt=parseFloat,Tt=parseInt,$t='object'==typeof n&&n&&n.Object===Object&&n,Dt='object'==typeof self&&self&&self.Object===Object&&self,Mt=$t||Dt||Function('return this')(),Ft='object'==typeof e&&e&&!e.nodeType&&e,Nt=Ft&&'object'==typeof r&&r&&!r.nodeType&&r,Pt=Nt&&Nt.exports===Ft,qt=Pt&&$t.process,Zt=(function(){try{return qt&&qt.binding&&qt.binding('util')}catch(n){}})(),Kt=Zt&&Zt.isArrayBuffer,Vt=Zt&&Zt.isDate,Gt=Zt&&Zt.isMap,Ht=Zt&&Zt.isRegExp,Jt=Zt&&Zt.isSet,Yt=Zt&&Zt.isTypedArray;function Qt(n,t){return n.set(t[0],t[1]),n}function Xt(n,t){return n.add(t),n}function nr(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function tr(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u-1}function fr(n,t,r){for(var e=-1,u=null==n?0:n.length;++e-1;);return r}function zr(n,t){for(var r=n.length;r--&&gr(t,n[r],0)>-1;);return r}var Er=mr({'\xc0':'A','\xc1':'A','\xc2':'A','\xc3':'A','\xc4':'A','\xc5':'A','\xe0':'a','\xe1':'a','\xe2':'a','\xe3':'a','\xe4':'a','\xe5':'a','\xc7':'C','\xe7':'c','\xd0':'D','\xf0':'d','\xc8':'E','\xc9':'E','\xca':'E','\xcb':'E','\xe8':'e','\xe9':'e','\xea':'e','\xeb':'e','\xcc':'I','\xcd':'I','\xce':'I','\xcf':'I','\xec':'i','\xed':'i','\xee':'i','\xef':'i','\xd1':'N','\xf1':'n','\xd2':'O','\xd3':'O','\xd4':'O','\xd5':'O','\xd6':'O','\xd8':'O','\xf2':'o','\xf3':'o','\xf4':'o','\xf5':'o','\xf6':'o','\xf8':'o','\xd9':'U','\xda':'U','\xdb':'U','\xdc':'U','\xf9':'u','\xfa':'u','\xfb':'u','\xfc':'u','\xdd':'Y','\xfd':'y','\xff':'y','\xc6':'Ae','\xe6':'ae','\xde':'Th','\xfe':'th','\xdf':'ss',"\u0100":'A',"\u0102":'A',"\u0104":'A',"\u0101":'a',"\u0103":'a',"\u0105":'a',"\u0106":'C',"\u0108":'C',"\u010a":'C',"\u010c":'C',"\u0107":'c',"\u0109":'c',"\u010b":'c',"\u010d":'c',"\u010e":'D',"\u0110":'D',"\u010f":'d',"\u0111":'d',"\u0112":'E',"\u0114":'E',"\u0116":'E',"\u0118":'E',"\u011a":'E',"\u0113":'e',"\u0115":'e',"\u0117":'e',"\u0119":'e',"\u011b":'e',"\u011c":'G',"\u011e":'G',"\u0120":'G',"\u0122":'G',"\u011d":'g',"\u011f":'g',"\u0121":'g',"\u0123":'g',"\u0124":'H',"\u0126":'H',"\u0125":'h',"\u0127":'h',"\u0128":'I',"\u012a":'I',"\u012c":'I',"\u012e":'I',"\u0130":'I',"\u0129":'i',"\u012b":'i',"\u012d":'i',"\u012f":'i',"\u0131":'i',"\u0134":'J',"\u0135":'j',"\u0136":'K',"\u0137":'k',"\u0138":'k',"\u0139":'L',"\u013b":'L',"\u013d":'L',"\u013f":'L',"\u0141":'L',"\u013a":'l',"\u013c":'l',"\u013e":'l',"\u0140":'l',"\u0142":'l',"\u0143":'N',"\u0145":'N',"\u0147":'N',"\u014a":'N',"\u0144":'n',"\u0146":'n',"\u0148":'n',"\u014b":'n',"\u014c":'O',"\u014e":'O',"\u0150":'O',"\u014d":'o',"\u014f":'o',"\u0151":'o',"\u0154":'R',"\u0156":'R',"\u0158":'R',"\u0155":'r',"\u0157":'r',"\u0159":'r',"\u015a":'S',"\u015c":'S',"\u015e":'S',"\u0160":'S',"\u015b":'s',"\u015d":'s',"\u015f":'s',"\u0161":'s',"\u0162":'T',"\u0164":'T',"\u0166":'T',"\u0163":'t',"\u0165":'t',"\u0167":'t',"\u0168":'U',"\u016a":'U',"\u016c":'U',"\u016e":'U',"\u0170":'U',"\u0172":'U',"\u0169":'u',"\u016b":'u',"\u016d":'u',"\u016f":'u',"\u0171":'u',"\u0173":'u',"\u0174":'W',"\u0175":'w',"\u0176":'Y',"\u0177":'y',"\u0178":'Y',"\u0179":'Z',"\u017b":'Z',"\u017d":'Z',"\u017a":'z',"\u017c":'z',"\u017e":'z',"\u0132":'IJ',"\u0133":'ij',"\u0152":'Oe',"\u0153":'oe',"\u0149":"'n","\u017f":'s'}),Sr=mr({'&':'&','<':'<','>':'>','"':'"',"'":'''});function Wr(n){return'\\'+Ut[n]}function Lr(n){return zt.test(n)}function Cr(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r}function Ur(n,t){return function(r){return n(t(r))}}function Br(n,t){for(var r=-1,e=n.length,u=0,i=[];++r','"':'"',''':"'"});var Fr=(function n(r){var e=(r=null==r?Mt:Fr.defaults(Mt.Object(),r,Fr.pick(Mt,St))).Array,Xn=r.Date,nt=r.Error,tt=r.Function,rt=r.Math,et=r.Object,ut=r.RegExp,it=r.String,ot=r.TypeError,ft=e.prototype,at=tt.prototype,ct=et.prototype,lt=r['__core-js_shared__'],st=at.toString,ht=ct.hasOwnProperty,pt=0,vt=(function(){var n=/[^.]+$/.exec(lt&<.keys&<.keys.IE_PROTO||'');return n?'Symbol(src)_1.'+n:''})(),_t=ct.toString,gt=st.call(et),yt=Mt._,dt=ut('^'+st.call(ht).replace(Ln,'\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,'$1.*?')+'$'),bt=Pt?r.Buffer:t,wt=r.Symbol,mt=r.Uint8Array,xt=bt?bt.allocUnsafe:t,jt=Ur(et.getPrototypeOf,et),At=et.create,It=ct.propertyIsEnumerable,zt=ft.splice,Ut=wt?"function"==typeof wt?wt.isConcatSpreadable:"@@isConcatSpreadable":t,$t=wt?"function"==typeof wt?wt.iterator:"@@iterator":t,Dt=wt?"function"==typeof wt?wt.toStringTag:"@@toStringTag":t,Ft=(function(){try{var n=Mi(et,'defineProperty');return n({},'',{}),n}catch(n){}})(),Nt=r.clearTimeout!==Mt.clearTimeout&&r.clearTimeout,qt=Xn&&Xn.now!==Mt.Date.now&&Xn.now,Zt=r.setTimeout!==Mt.setTimeout&&r.setTimeout,pr=rt.ceil,mr=rt.floor,Nr=et.getOwnPropertySymbols,Pr=bt?bt.isBuffer:t,qr=r.isFinite,Zr=ft.join,Kr=Ur(et.keys,et),Vr=rt.max,Gr=rt.min,Hr=Xn.now,Jr=r.parseInt,Yr=rt.random,Qr=ft.reverse,Xr=Mi(r,'DataView'),ne=Mi(r,'Map'),te=Mi(r,'Promise'),re=Mi(r,'Set'),ee=Mi(r,'WeakMap'),ue=Mi(et,'create'),ie=ee&&new ee,oe={},fe=so(Xr),ae=so(ne),ce=so(te),le=so(re),se=so(ee),he=wt?"function"==typeof wt?wt.prototype:"@@prototype":t,pe=he?he.valueOf:t,ve=he?he.toString:t;function _e(n){if(Sf(n)&&!wf(n)&&!(n instanceof be)){if(n instanceof de)return n;if(ht.call(n,'__wrapped__'))return ho(n)}return new de(n)}var ge=(function(){function n(){}return function(r){if(!Ef(r))return{};if(At)return At(r);n.prototype=r;var e=new n;return n.prototype=t,e}})();function ye(){}function de(n,r){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=t}_e.templateSettings={escape:On,evaluate:In,interpolate:Rn,variable:'',imports:{_:_e}},_e.prototype=ye.prototype,_e.prototype.constructor=_e,de.prototype=ge(ye.prototype),de.prototype.constructor=de;function be(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=U,this.__views__=[]}be.prototype=ge(ye.prototype),be.prototype.constructor=be;function we(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t-1},me.prototype.set=function(n,t){var r=this.__data__,e=Se(r,n);return e<0?(++this.size,r.push([n,t])):r[e][1]=t,this};function xe(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t=r?n:r)),n}function Te(n,r,e,u,i,o){var f,a=r&l,c=r&s,p=r&h;if(e&&(f=i?e(n,u,i,o):e(n)),f!==t)return f;if(!Ef(n))return n;var v=wf(n);if(v){if(f=(function(n){var t=n.length,r=n.constructor(t);return t&&'string'==typeof n[0]&&ht.call(n,'index')&&(r.index=n.index,r.input=n.input),r})(n),!a)return ui(n,f)}else{var _=Pi(n),g=_==K||_==V;if(Af(n))return Qu(n,a);if(_==Y||_==D||g&&!i){if(f=c||g?{}:Zi(n),!a)return c?(b=n,x=n,w=(m=f)&&ii(x,aa(x),m),ii(b,Ni(b),w)):(y=n,d=Le(f,n),ii(y,Fi(y),d))}else{if(!Ct[_])return i?n:{};f=(function(n,t,r,e){var u=n.constructor;switch(t){case an:return Xu(n);case N:case P:return new u(+n);case cn:return(function(n,t){var r=t?Xu(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.byteLength)})(n,e);case ln:case sn:case hn:case pn:case vn:case _n:case gn:case yn:case dn:return ni(n,e);case G:return f=n,lr(e?r(Cr(f),l):Cr(f),Qt,new f.constructor);case H:case rn:return new u(n);case nn:return(function(n){var t=new n.constructor(n.source,qn.exec(n));return t.lastIndex=n.lastIndex,t})(n);case tn:return o=n,lr(e?r(Tr(o),l):Tr(o),Xt,new o.constructor);case en:return i=n,pe?et(pe.call(i)):{}}var i,o,f})(n,_,Te,a)}}var y,d,b,w,m,x;o||(o=new Ae);var j=o.get(n);if(j)return j;o.set(n,f);var A=v?t:(p?c?Li:Wi:c?aa:fa)(n);return rr(A||n,function(t,u){A&&(t=n[u=t]),Ee(f,u,Te(t,r,e,u,n,o))}),f}function $e(n,r,e){var u=e.length;if(null==n)return!u;for(n=et(n);u--;){var i=e[u],o=r[i],f=n[i];if(f===t&&!(i in n)||!o(f))return!1}return!0}function De(n,r,e){if('function'!=typeof n)throw new ot(o);return uo(function(){n.apply(t,e)},r)}function Me(n,t,r,e){var i=-1,o=or,f=!0,a=n.length,c=[],l=t.length;if(!a)return c;r&&(t=ar(t,kr(r))),e?(o=fr,f=!1):t.length>=u&&(o=Ir,f=!1,t=new je(t));n:for(;++i0&&r(f)?t>1?Ke(f,t-1,r,e,u):cr(u,f):e||(u[u.length]=f)}return u}var Ve=ci(),Ge=ci(!0);function He(n,t){return n&&Ve(n,t,fa)}function Je(n,t){return n&&Ge(n,t,fa)}function Ye(n,t){return ir(t,function(t){return If(n[t])})}function Qe(n,r){for(var e=0,u=(r=Gu(r,n)).length;null!=n&&et}function ru(n,t){return null!=n&&ht.call(n,t)}function eu(n,t){return null!=n&&t in et(n)}function uu(n,r,u){for(var i=u?fr:or,o=n[0].length,f=n.length,a=f,c=e(f),l=1/0,s=[];a--;){var h=n[a];a&&r&&(h=ar(h,kr(r))),l=Gr(h.length,l),c[a]=!u&&(r||o>=120&&h.length>=120)?new je(a&&h):t}h=n[0];var p=-1,v=c[0];n:for(;++p=f)return a;var c=r[e];return a*('desc'==c?-1:1)}}return n.index-t.index})(n,t,r)})}function wu(n,t,r){for(var e=-1,u=t.length,i={};++e-1;)f!==n&&zt.call(f,a,1),zt.call(n,a,1);return n}function xu(n,t){for(var r=n?t.length:0,e=r-1;r--;){var u=t[r];if(r==e||u!==i){var i=u;Vi(u)?zt.call(n,u,1):Mu(n,u)}}return n}function ju(n,t){return n+mr(Yr()*(t-n+1))}function Au(n,t){var r='';if(!n||t<1||t>W)return r;do{t%2&&(r+=n),(t=mr(t/2))&&(n+=n)}while(t);return r}function ku(n,t){return io(to(n,t,La),n+'')}function Ou(n){return Oe(ga(n))}function Iu(n,t){var r=ga(n);return ao(r,Be(t,0,r.length))}function Ru(n,r,e,u){if(!Ef(n))return n;for(var i=-1,o=(r=Gu(r,n)).length,f=o-1,a=n;null!=a&&++ii?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=e(i);++u>>1,o=n[i];null!==o&&!$f(o)&&(r?o<=t:o=u){var l=t?null:Ai(n);if(l)return Tr(l);f=!1,i=Ir,c=new je}else c=t?[]:a;n:for(;++e=u?n:Wu(n,r,e)}var Yu=Nt||function(n){return Mt.clearTimeout(n)};function Qu(n,t){if(t)return n.slice();var r=n.length,e=xt?xt(r):new n.constructor(r);return n.copy(e),e}function Xu(n){var t=new n.constructor(n.byteLength);return new mt(t).set(new mt(n)),t}function ni(n,t){var r=t?Xu(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.length)}function ti(n,r){if(n!==r){var e=n!==t,u=null===n,i=n==n,o=$f(n),f=r!==t,a=null===r,c=r==r,l=$f(r);if(!a&&!l&&!o&&n>r||o&&f&&c&&!a&&!l||u&&f&&c||!e&&c||!i)return 1;if(!u&&!o&&!l&&n1?e[i-1]:t,f=i>2?e[2]:t;for(o=n.length>3&&'function'==typeof o?(i--,o):t,f&&Gi(e[0],e[1],f)&&(o=i<3?t:o,i=1),r=et(r);++u-1?i[o?r[f]:f]:t}}function vi(n){return Si(function(r){var e=r.length,u=e,i=de.prototype.thru;for(n&&r.reverse();u--;){var f=r[u];if('function'!=typeof f)throw new ot(o);if(i&&!a&&'wrapper'==Ui(f))var a=new de([],!0)}for(u=a?u:e;++u1&&d.reverse(),h&&la))return!1;var l=o.get(n);if(l&&o.get(r))return l==r;var s=-1,h=!0,_=e&v?new je:t;for(o.set(n,r),o.set(r,n);++s-1&&n%1==0&&n1?'& ':'')+t[e],t=t.join(r>2?', ':' '),n.replace($n,'{\n/* [wrapped with '+t+'] */\n')})(e,(u=(function(n){var t=n.match(Dn);return t?t[1].split(Mn):[]})(e),i=r,rr($,function(n){var t='_.'+n[0];i&n[1]&&!or(u,t)&&u.push(t)}),u.sort())));var u,i}function fo(n){var r=0,e=0;return function(){var u=Hr(),i=R-(u-e);if(e=u,i>0){if(++r>=I)return arguments[0]}else r=0;return n.apply(t,arguments)}}function ao(n,r){var e=-1,u=n.length,i=u-1;for(r=r===t?u:r;++e1?n[r-1]:t;return Lo(n,e='function'==typeof e?(n.pop(),e):t)});function Mo(n){var t=_e(n);return t.__chain__=!0,t}function Fo(n,t){return t(n)}var No=Si(function(n){var r=n.length,e=r?n[0]:0,u=this.__wrapped__,i=function(t){return Ue(t,n)};return!(r>1||this.__actions__.length)&&u instanceof be&&Vi(e)?((u=u.slice(e,+e+(r?1:0))).__actions__.push({func:Fo,args:[i],thisArg:t}),new de(u,this.__chain__).thru(function(n){return r&&!n.length&&n.push(t),n})):this.thru(i)});function Po(){return this}var qo=oi(function(n,t,r){ht.call(n,r)?++n[r]:Ce(n,r,1)});var Zo=pi(go),Ko=pi(yo);function Vo(n,t){return(wf(n)?rr:Fe)(n,Ti(t,3))}function Go(n,t){return(wf(n)?er:Ne)(n,Ti(t,3))}var Ho=oi(function(n,t,r){ht.call(n,r)?n[r].push(t):Ce(n,r,[t])});var Jo=ku(function(n,t,r){var u=-1,i='function'==typeof t,o=xf(n)?e(n.length):[];return Fe(n,function(n){o[++u]=i?nr(t,n,r):iu(n,t,r)}),o}),Yo=oi(function(n,t,r){Ce(n,r,t)});function Qo(n,t){return(wf(n)?ar:vu)(n,Ti(t,3))}var Xo=oi(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]});var nf=ku(function(n,t){if(null==n)return[];var r=t.length;return r>1&&Gi(n,t[0],t[1])?t=[]:r>2&&Gi(t[0],t[1],t[2])&&(t=[t[0]]),bu(n,Ke(t,1),[])}),tf=qt||function(){return Mt.Date.now()};function rf(n,r,e){return r=e?t:r,r=n&&null==r?n.length:r,Oi(n,x,t,t,t,t,r)}function ef(n,r){var e;if('function'!=typeof r)throw new ot(o);return n=qf(n),function(){return--n>0&&(e=r.apply(this,arguments)),n<=1&&(r=t),e}}var uf=ku(function(n,t,r){var e=_;if(r.length){var u=Br(r,Bi(uf));e|=w}return Oi(n,e,t,r,u)}),of=ku(function(n,t,r){var e=_|g;if(r.length){var u=Br(r,Bi(of));e|=w}return Oi(t,e,n,r,u)});function ff(n,r,e){var u,i,f,a,c,l,s=0,h=!1,p=!1,v=!0;if('function'!=typeof n)throw new ot(o);r=Kf(r)||0,Ef(e)&&(h=!!e.leading,f=(p='maxWait'in e)?Vr(Kf(e.maxWait)||0,r):f,v='trailing'in e?!!e.trailing:v);function _(r){var e=u,o=i;return u=i=t,s=r,a=n.apply(o,e)}function g(n){var e=n-l;return l===t||e>=r||e<0||p&&n-s>=f}function y(){var n=tf();if(g(n))return d(n);c=uo(y,(function(n){var t=r-(n-l);return p?Gr(t,f-(n-s)):t})(n))}function d(n){return c=t,v&&u?_(n):(u=i=t,a)}function b(){var n=tf(),e=g(n);if(u=arguments,i=this,l=n,e){if(c===t)return s=o=l,c=uo(y,r),h?_(o):a;if(p)return c=uo(y,r),_(l)}var o;return c===t&&(c=uo(y,r)),a}return b.cancel=function(){c!==t&&Yu(c),s=0,u=l=i=c=t},b.flush=function(){return c===t?a:d(tf())},b}var af=ku(function(n,t){return De(n,1,t)}),cf=ku(function(n,t,r){return De(n,Kf(t)||0,r)});function lf(n,t){if('function'!=typeof n||null!=t&&'function'!=typeof t)throw new ot(o);var r=function r(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;if(i.has(u))return i.get(u);var o=n.apply(this,e);return r.cache=i.set(u,o)||i,o};return r.cache=new(lf.Cache||xe),r}lf.Cache=xe;function sf(n){if('function'!=typeof n)throw new ot(o);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}var hf=Hu(function(n,t){var r=(t=1==t.length&&wf(t[0])?ar(t[0],kr(Ti())):ar(Ke(t,1),kr(Ti()))).length;return ku(function(e){for(var u=-1,i=Gr(e.length,r);++u=t}),bf=ou((function(){return arguments})())?ou:function(n){return Sf(n)&&ht.call(n,'callee')&&!It.call(n,'callee')},wf=e.isArray,mf=Kt?kr(Kt):function(n){return Sf(n)&&nu(n)==an};function xf(n){return null!=n&&zf(n.length)&&!If(n)}function jf(n){return Sf(n)&&xf(n)}var Af=Pr||Ka,kf=Vt?kr(Vt):function(n){return Sf(n)&&nu(n)==P};function Of(n){if(!Sf(n))return!1;var t=nu(n);return t==Z||t==q||'string'==typeof n.message&&'string'==typeof n.name&&!Cf(n)}function If(n){if(!Ef(n))return!1;var t=nu(n);return t==K||t==V||t==F||t==X}function Rf(n){return'number'==typeof n&&n==qf(n)}function zf(n){return'number'==typeof n&&n>-1&&n%1==0&&n<=W}function Ef(n){var t=typeof n;return null!=n&&('object'==t||'function'==t)}function Sf(n){return null!=n&&'object'==typeof n}var Wf=Gt?kr(Gt):function(n){return Sf(n)&&Pi(n)==G};function Lf(n){return'number'==typeof n||Sf(n)&&nu(n)==H}function Cf(n){if(!Sf(n)||nu(n)!=Y)return!1;var t=jt(n);if(null===t)return!0;var r=ht.call(t,'constructor')&&t.constructor;return'function'==typeof r&&r instanceof r&&st.call(r)==gt}var Uf=Ht?kr(Ht):function(n){return Sf(n)&&nu(n)==nn};var Bf=Jt?kr(Jt):function(n){return Sf(n)&&Pi(n)==tn};function Tf(n){return'string'==typeof n||!wf(n)&&Sf(n)&&nu(n)==rn}function $f(n){return'symbol'==typeof n||Sf(n)&&nu(n)==en}var Df=Yt?kr(Yt):function(n){return Sf(n)&&zf(n.length)&&!!Lt[nu(n)]};var Mf=mi(pu),Ff=mi(function(n,t){return n<=t});function Nf(n){if(!n)return[];if(xf(n))return Tf(n)?Dr(n):ui(n);if($t&&n[$t])return(function(n){for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r})(n[$t]());var t=Pi(n);return(t==G?Cr:t==tn?Tr:ga)(n)}function Pf(n){return n?(n=Kf(n))===S||n===-S?(n<0?-1:1)*L:n==n?n:0:0===n?n:0}function qf(n){var t=Pf(n),r=t%1;return t==t?r?t-r:t:0}function Zf(n){return n?Be(qf(n),0,U):0}function Kf(n){if('number'==typeof n)return n;if($f(n))return C;if(Ef(n)){var t='function'==typeof n.valueOf?n.valueOf():n;n=Ef(t)?t+'':t}if('string'!=typeof n)return 0===n?n:+n;n=n.replace(Un,'');var r=Kn.test(n);return r||Gn.test(n)?Tt(n.slice(2),r?2:8):Zn.test(n)?C:+n}function Vf(n){return ii(n,aa(n))}function Gf(n){return null==n?'':$u(n)}var Hf=fi(function(n,t){if(Qi(t)||xf(t))ii(t,fa(t),n);else for(var r in t)ht.call(t,r)&&Ee(n,r,t[r])}),Jf=fi(function(n,t){ii(t,aa(t),n)}),Yf=fi(function(n,t,r,e){ii(t,aa(t),n,e)}),Qf=fi(function(n,t,r,e){ii(t,fa(t),n,e)}),Xf=Si(Ue);var na=ku(function(n){return n.push(t,Ii),nr(Yf,t,n)}),ta=ku(function(n){return n.push(t,Ri),nr(la,t,n)});function ra(n,r,e){var u=null==n?t:Qe(n,r);return u===t?e:u}function ea(n,t){return null!=n&&qi(n,t,eu)}var ua=gi(function(n,t,r){n[t]=r},Ea(La)),ia=gi(function(n,t,r){ht.call(n,t)?n[t].push(r):n[t]=[r]},Ti),oa=ku(iu);function fa(n){return xf(n)?ke(n):su(n)}function aa(n){return xf(n)?ke(n,!0):hu(n)}var ca=fi(function(n,t,r){yu(n,t,r)}),la=fi(function(n,t,r,e){yu(n,t,r,e)}),sa=Si(function(n,t){var r={};if(null==n)return r;var e=!1;t=ar(t,function(t){return t=Gu(t,n),e||(e=t.length>1),t}),ii(n,Li(n),r),e&&(r=Te(r,l|s|h,zi));for(var u=t.length;u--;)Mu(r,t[u]);return r});var ha=Si(function(n,t){return null==n?{}:wu(r=n,t,function(n,t){return ea(r,t)});var r});function pa(n,t){if(null==n)return{};var r=ar(Li(n),function(n){return[n]});return t=Ti(t),wu(n,r,function(n,r){return t(n,r[0])})}var va=ki(fa),_a=ki(aa);function ga(n){return null==n?[]:Or(n,fa(n))}var ya=si(function(n,t,r){return t=t.toLowerCase(),n+(r?da(t):t)});function da(n){return Oa(Gf(n).toLowerCase())}function ba(n){return(n=Gf(n))&&n.replace(Jn,Er).replace(Ot,'')}var wa=si(function(n,t,r){return n+(r?'-':'')+t.toLowerCase()}),ma=si(function(n,t,r){return n+(r?' ':'')+t.toLowerCase()}),xa=li('toLowerCase');var ja=si(function(n,t,r){return n+(r?'_':'')+t.toLowerCase()});var Aa=si(function(n,t,r){return n+(r?' ':'')+Oa(t)});var ka=si(function(n,t,r){return n+(r?' ':'')+t.toUpperCase()}),Oa=li('toUpperCase');function Ia(n,r,e){if(n=Gf(n),(r=e?t:r)===t)return u=n,Et.test(u)?n.match(Rt)||[]:n.match(Fn)||[];var u;return n.match(r)||[]}var Ra=ku(function(n,r){try{return nr(n,t,r)}catch(n){return Of(n)?n:new nt(n)}}),za=Si(function(n,t){return rr(t,function(t){t=lo(t),Ce(n,t,uf(n[t],n))}),n});function Ea(n){return function(){return n}}var Sa=vi(),Wa=vi(!0);function La(n){return n}function Ca(n){return lu('function'==typeof n?n:Te(n,l))}var Ua=ku(function(n,t){return function(r){return iu(r,n,t)}}),Ba=ku(function(n,t){return function(r){return iu(n,r,t)}});function Ta(n,t,r){var e=fa(t),u=Ye(t,e);null!=r||Ef(t)&&(u.length||!e.length)||(r=t,t=n,n=this,u=Ye(t,fa(t)));var i=!(Ef(r)&&'chain'in r&&!r.chain),o=If(n);return rr(u,function(r){var e=t[r];n[r]=e,o&&(n.prototype[r]=function(){var t=this.__chain__;if(i||t){var r=n(this.__wrapped__);return(r.__actions__=ui(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,cr([this.value()],arguments))})}),n}function $a(){}var Da=di(ar),Ma=di(ur),Fa=di(hr);function Na(n){return Hi(n)?wr(lo(n)):(t=n,function(n){return Qe(n,t)});var t}var Pa=wi(),qa=wi(!0);function Za(){return[]}function Ka(){return!1}var Va=yi(function(n,t){return n+t},0),Ga=ji('ceil'),Ha=yi(function(n,t){return n/t},1),Ja=ji('floor');var Ya=yi(function(n,t){return n*t},1),Qa=ji('round'),Xa=yi(function(n,t){return n-t},0);return _e.after=function(n,t){if('function'!=typeof t)throw new ot(o);return n=qf(n),function(){if(--n<1)return t.apply(this,arguments)}},_e.ary=rf,_e.assign=Hf,_e.assignIn=Jf,_e.assignInWith=Yf,_e.assignWith=Qf,_e.at=Xf,_e.before=ef,_e.bind=uf,_e.bindAll=za,_e.bindKey=of,_e.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return wf(n)?n:[n]},_e.chain=Mo,_e.chunk=function(n,r,u){r=(u?Gi(n,r,u):r===t)?1:Vr(qf(r),0);var i=null==n?0:n.length;if(!i||r<1)return[];for(var o=0,f=0,a=e(pr(i/r));oi?0:i+e),(u=u===t||u>i?i:qf(u))<0&&(u+=i),u=e>u?0:Zf(u);e>>0)?(n=Gf(n))&&('string'==typeof r||null!=r&&!Uf(r))&&!(r=$u(r))&&Lr(n)?Ju(Dr(n),0,e):n.split(r,e):[]},_e.spread=function(n,t){if('function'!=typeof n)throw new ot(o);return t=null==t?0:Vr(qf(t),0),ku(function(r){var e=r[t],u=Ju(r,0,t);return e&&cr(u,e),nr(n,this,u)})},_e.tail=function(n){var t=null==n?0:n.length;return t?Wu(n,1,t):[]},_e.take=function(n,r,e){return n&&n.length?Wu(n,0,(r=e||r===t?1:qf(r))<0?0:r):[]},_e.takeRight=function(n,r,e){var u=null==n?0:n.length;return u?Wu(n,(r=u-(r=e||r===t?1:qf(r)))<0?0:r,u):[]},_e.takeRightWhile=function(n,t){return n&&n.length?Nu(n,Ti(t,3),!1,!0):[]},_e.takeWhile=function(n,t){return n&&n.length?Nu(n,Ti(t,3)):[]},_e.tap=function(n,t){return t(n),n},_e.throttle=function(n,t,r){var e=!0,u=!0;if('function'!=typeof n)throw new ot(o);return Ef(r)&&(e='leading'in r?!!r.leading:e,u='trailing'in r?!!r.trailing:u),ff(n,t,{leading:e,maxWait:t,trailing:u})},_e.thru=Fo,_e.toArray=Nf,_e.toPairs=va,_e.toPairsIn=_a,_e.toPath=function(n){return wf(n)?ar(n,lo):$f(n)?[n]:ui(co(Gf(n)))},_e.toPlainObject=Vf,_e.transform=function(n,t,r){var e=wf(n),u=e||Af(n)||Df(n);if(t=Ti(t,4),null==r){var i=n&&n.constructor;r=u?e?new i:[]:Ef(n)&&If(i)?ge(jt(n)):{}}return(u?rr:He)(n,function(n,e,u){return t(r,n,e,u)}),r},_e.unary=function(n){return rf(n,1)},_e.union=zo,_e.unionBy=Eo,_e.unionWith=So,_e.uniq=function(n){return n&&n.length?Du(n):[]},_e.uniqBy=function(n,t){return n&&n.length?Du(n,Ti(t,2)):[]},_e.uniqWith=function(n,r){return r='function'==typeof r?r:t,n&&n.length?Du(n,t,r):[]},_e.unset=function(n,t){return null==n||Mu(n,t)},_e.unzip=Wo,_e.unzipWith=Lo,_e.update=function(n,t,r){return null==n?n:Fu(n,t,Vu(r))},_e.updateWith=function(n,r,e,u){return u='function'==typeof u?u:t,null==n?n:Fu(n,r,Vu(e),u)},_e.values=ga,_e.valuesIn=function(n){return null==n?[]:Or(n,aa(n))},_e.without=Co,_e.words=Ia,_e.wrap=function(n,t){return pf(Vu(t),n)},_e.xor=Uo,_e.xorBy=Bo,_e.xorWith=To,_e.zip=$o,_e.zipObject=function(n,t){return Zu(n||[],t||[],Ee)},_e.zipObjectDeep=function(n,t){return Zu(n||[],t||[],Ru)},_e.zipWith=Do,_e.entries=va,_e.entriesIn=_a,_e.extend=Jf,_e.extendWith=Yf,Ta(_e,_e),_e.add=Va,_e.attempt=Ra,_e.camelCase=ya,_e.capitalize=da,_e.ceil=Ga,_e.clamp=function(n,r,e){return e===t&&(e=r,r=t),e!==t&&(e=(e=Kf(e))==e?e:0),r!==t&&(r=(r=Kf(r))==r?r:0),Be(Kf(n),r,e)},_e.clone=function(n){return Te(n,h)},_e.cloneDeep=function(n){return Te(n,l|h)},_e.cloneDeepWith=function(n,r){return Te(n,l|h,r='function'==typeof r?r:t)},_e.cloneWith=function(n,r){return Te(n,h,r='function'==typeof r?r:t)},_e.conformsTo=function(n,t){return null==t||$e(n,t,fa(t))},_e.deburr=ba,_e.defaultTo=function(n,t){return null==n||n!=n?t:n},_e.divide=Ha,_e.endsWith=function(n,r,e){n=Gf(n),r=$u(r);var u=n.length,i=e=e===t?u:Be(qf(e),0,u);return(e-=r.length)>=0&&n.slice(e,i)==r},_e.eq=gf,_e.escape=function(n){return(n=Gf(n))&&kn.test(n)?n.replace(jn,Sr):n},_e.escapeRegExp=function(n){return(n=Gf(n))&&Cn.test(n)?n.replace(Ln,'\\$&'):n},_e.every=function(n,r,e){var u=wf(n)?ur:Pe;return e&&Gi(n,r,e)&&(r=t),u(n,Ti(r,3))},_e.find=Zo,_e.findIndex=go,_e.findKey=function(n,t){return vr(n,Ti(t,3),He)},_e.findLast=Ko,_e.findLastIndex=yo,_e.findLastKey=function(n,t){return vr(n,Ti(t,3),Je)},_e.floor=Ja,_e.forEach=Vo,_e.forEachRight=Go,_e.forIn=function(n,t){return null==n?n:Ve(n,Ti(t,3),aa)},_e.forInRight=function(n,t){return null==n?n:Ge(n,Ti(t,3),aa)},_e.forOwn=function(n,t){return n&&He(n,Ti(t,3))},_e.forOwnRight=function(n,t){return n&&Je(n,Ti(t,3))},_e.get=ra,_e.gt=yf,_e.gte=df,_e.has=function(n,t){return null!=n&&qi(n,t,ru)},_e.hasIn=ea,_e.head=wo,_e.identity=La,_e.includes=function(n,t,r,e){n=xf(n)?n:ga(n),r=r&&!e?qf(r):0;var u=n.length;return r<0&&(r=Vr(u+r,0)),Tf(n)?r<=u&&n.indexOf(t,r)>-1:!!u&&gr(n,t,r)>-1},_e.indexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:qf(r);return u<0&&(u=Vr(e+u,0)),gr(n,t,u)},_e.inRange=function(n,r,e){return r=Pf(r),e===t?(e=r,r=0):e=Pf(e),n=Kf(n),(u=n)>=Gr(i=r,o=e)&&u=-W&&n<=W},_e.isSet=Bf,_e.isString=Tf,_e.isSymbol=$f,_e.isTypedArray=Df,_e.isUndefined=function(n){return n===t},_e.isWeakMap=function(n){return Sf(n)&&Pi(n)==on},_e.isWeakSet=function(n){return Sf(n)&&nu(n)==fn},_e.join=function(n,t){return null==n?'':Zr.call(n,t)},_e.kebabCase=wa,_e.last=Ao,_e.lastIndexOf=function(n,r,e){var u=null==n?0:n.length;if(!u)return-1;var i=u;return e!==t&&(i=(i=qf(e))<0?Vr(u+i,0):Gr(i,u-1)),r==r?(function(n,t,r){for(var e=r+1;e--;)if(n[e]===t)return e;return e})(n,r,i):_r(n,dr,i,!0)},_e.lowerCase=ma,_e.lowerFirst=xa,_e.lt=Mf,_e.lte=Ff,_e.max=function(n){return n&&n.length?qe(n,La,tu):t},_e.maxBy=function(n,r){return n&&n.length?qe(n,Ti(r,2),tu):t},_e.mean=function(n){return br(n,La)},_e.meanBy=function(n,t){return br(n,Ti(t,2))},_e.min=function(n){return n&&n.length?qe(n,La,pu):t},_e.minBy=function(n,r){return n&&n.length?qe(n,Ti(r,2),pu):t},_e.stubArray=Za,_e.stubFalse=Ka,_e.stubObject=function(){return{}},_e.stubString=function(){return''},_e.stubTrue=function(){return!0},_e.multiply=Ya,_e.nth=function(n,r){return n&&n.length?du(n,qf(r)):t},_e.noConflict=function(){return Mt._===this&&(Mt._=yt),this},_e.noop=$a,_e.now=tf,_e.pad=function(n,t,r){n=Gf(n);var e=(t=qf(t))?$r(n):0;if(!t||e>=t)return n;var u=(t-e)/2;return bi(mr(u),r)+n+bi(pr(u),r)},_e.padEnd=function(n,t,r){n=Gf(n);var e=(t=qf(t))?$r(n):0;return t&&er){var u=n;n=r,r=u}if(e||n%1||r%1){var i=Yr();return Gr(n+i*(r-n+Bt('1e-'+((i+'').length-1))),r)}return ju(n,r)},_e.reduce=function(n,t,r){var e=wf(n)?lr:xr,u=arguments.length<3;return e(n,Ti(t,4),r,u,Fe)},_e.reduceRight=function(n,t,r){var e=wf(n)?sr:xr,u=arguments.length<3;return e(n,Ti(t,4),r,u,Ne)},_e.repeat=function(n,r,e){return r=(e?Gi(n,r,e):r===t)?1:qf(r),Au(Gf(n),r)},_e.replace=function(){var n=arguments,t=Gf(n[0]);return n.length<3?t:t.replace(n[1],n[2])},_e.result=function(n,r,e){var u=-1,i=(r=Gu(r,n)).length;for(i||(i=1,n=t);++uW)return[];var r=U,e=Gr(n,U);t=Ti(t),n-=U;for(var u=Ar(e,t);++r=o)return n;var a=e-$r(u);if(a<1)return u;var c=f?Ju(f,0,a).join(''):n.slice(0,a);if(i===t)return c+u;if(f&&(a+=c.length-a),Uf(i)){if(n.slice(a).search(i)){var l,s=c;for(i.global||(i=ut(i.source,Gf(qn.exec(i))+'g')),i.lastIndex=0;l=i.exec(s);)var h=l.index;c=c.slice(0,h===t?a:h)}}else if(n.indexOf($u(i),a)!=a){var p=c.lastIndexOf(i);p>-1&&(c=c.slice(0,p))}return c+u},_e.unescape=function(n){return(n=Gf(n))&&An.test(n)?n.replace(xn,Mr):n},_e.uniqueId=function(n){var t=++pt;return Gf(n)+t},_e.upperCase=ka,_e.upperFirst=Oa,_e.each=Vo,_e.eachRight=Go,_e.first=wo,Ta(_e,(function(){var n={};return He(_e,function(t,r){ht.call(_e.prototype,r)||(n[r]=t)}),n})(),{chain:!1}),_e.VERSION="4.17.4",rr(['bind','bindKey','curry','curryRight','partial','partialRight'],function(n){_e[n].placeholder=_e}),rr(['drop','take'],function(n,r){be.prototype[n]=function(e){e=e===t?1:Vr(qf(e),0);var u=this.__filtered__&&!r?new be(this):this.clone();return u.__filtered__?u.__takeCount__=Gr(e,u.__takeCount__):u.__views__.push({size:Gr(e,U),type:n+(u.__dir__<0?'Right':'')}),u},be.prototype[n+'Right']=function(t){return this.reverse()[n](t).reverse()}}),rr(['filter','map','takeWhile'],function(n,t){var r=t+1,e=r==z||3==r;be.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:Ti(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),rr(['head','last'],function(n,t){var r='take'+(t?'Right':'');be.prototype[n]=function(){return this[r](1).value()[0]}}),rr(['initial','tail'],function(n,t){var r='drop'+(t?'':'Right');be.prototype[n]=function(){return this.__filtered__?new be(this):this[r](1)}}),be.prototype.compact=function(){return this.filter(La)},be.prototype.find=function(n){return this.filter(n).head()},be.prototype.findLast=function(n){return this.reverse().find(n)},be.prototype.invokeMap=ku(function(n,t){return'function'==typeof n?new be(this):this.map(function(r){return iu(r,n,t)})}),be.prototype.reject=function(n){return this.filter(sf(Ti(n)))},be.prototype.slice=function(n,r){n=qf(n);var e=this;return e.__filtered__&&(n>0||r<0)?new be(e):(n<0?e=e.takeRight(-n):n&&(e=e.drop(n)),r!==t&&(e=(r=qf(r))<0?e.dropRight(-r):e.take(r-n)),e)},be.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},be.prototype.toArray=function(){return this.take(U)},He(be.prototype,function(n,r){var e=/^(?:filter|find|map|reject)|While$/.test(r),u=/^(?:head|last)$/.test(r),i=_e[u?'take'+('last'==r?'Right':''):r],o=u||/^find/.test(r);i&&(_e.prototype[r]=function(){var r=this.__wrapped__,f=u?[1]:arguments,a=r instanceof be,c=f[0],l=a||wf(r),s=function(n){var t=i.apply(_e,cr([n],f));return u&&h?t[0]:t};l&&e&&'function'==typeof c&&1!=c.length&&(a=l=!1);var h=this.__chain__,p=!!this.__actions__.length,v=o&&!h,_=a&&!p;if(!o&&l){r=_?r:new be(this);var g=n.apply(r,f);return g.__actions__.push({func:Fo,args:[s],thisArg:t}),new de(g,h)}return v&&_?n.apply(this,f):(g=this.thru(s),v?u?g.value()[0]:g.value():g)})}),rr(['pop','push','shift','sort','splice','unshift'],function(n){var t=ft[n],r=/^(?:push|sort|unshift)$/.test(n)?'tap':'thru',e=/^(?:pop|shift)$/.test(n);_e.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(wf(u)?u:[],n)}return this[r](function(r){return t.apply(wf(r)?r:[],n)})}}),He(be.prototype,function(n,t){var r=_e[t];if(r){var e=r.name+'';(oe[e]||(oe[e]=[])).push({name:t,func:r})}}),oe[_i(t,g).name]=[{name:'wrapper',func:t}],be.prototype.clone=function(){var n=new be(this.__wrapped__);return n.__actions__=ui(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=ui(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=ui(this.__views__),n},be.prototype.reverse=function(){if(this.__filtered__){var n=new be(this);n.__dir__=-1,n.__filtered__=!0}else(n=this.clone()).__dir__*=-1;return n},be.prototype.value=function(){var n=this.__wrapped__.value(),t=this.__dir__,r=wf(n),e=t<0,u=r?n.length:0,i=(function(n,t,r){for(var e=-1,u=r.length;++e=this.__values__.length;return{done:n,value:n?t:this.__values__[this.__index__++]}},_e.prototype.plant=function(n){for(var r,e=this;e instanceof ye;){var u=ho(e);u.__index__=0,u.__values__=t,r?i.__wrapped__=u:r=u;var i=u;e=e.__wrapped__}return i.__wrapped__=n,r},_e.prototype.reverse=function(){var n=this.__wrapped__;if(n instanceof be){var r=n;return this.__actions__.length&&(r=new be(this)),(r=r.reverse()).__actions__.push({func:Fo,args:[Ro],thisArg:t}),new de(r,this.__chain__)}return this.thru(Ro)},_e.prototype.toJSON=_e.prototype.valueOf=_e.prototype.value=function(){return Pu(this.__wrapped__,this.__actions__)},_e.prototype.first=_e.prototype.head,$t&&(_e.prototype[$t]=Po),_e})();'function'==typeof define&&'object'==typeof define.amd&&define.amd?(Mt._=Fr,define(function(){return Fr})):Nt?((Nt.exports=Fr)._=Fr,Ft._=Fr):Mt._=Fr}).call(this)},385); -__d(function(e,r,t,n){Object.defineProperty(n,"__esModule",{value:!0});var u=r(387);Object.keys(u).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(n,e,{enumerable:!0,get:function(){return u[e]}})});var a=r(388);Object.defineProperty(n,"MiddlewareRegistry",{enumerable:!0,get:function(){return babelHelpers.interopRequireDefault(a).default}});var i=r(409);Object.defineProperty(n,"ReducerRegistry",{enumerable:!0,get:function(){return babelHelpers.interopRequireDefault(i).default}})},386); -__d(function(e,t,r,n){Object.defineProperty(n,"__esModule",{value:!0}),n.assign=function(e,t){var r=e;for(var n in t)r=f(r,n,t[n],r===e);return r},n.equals=function(e,t){return i.default.isEqual(e,t)},n.set=function(e,t,r){return f(e,t,r,!0)},n.toState=function(e){if(e){if('function'==typeof e)return e();var t=e.getState;if('function'==typeof t)return t()}return e};var u=t(385),i=babelHelpers.interopRequireDefault(u);function f(e,t,r,n){if(void 0===r&&Object.prototype.hasOwnProperty.call(e,t)){var u=n?babelHelpers.extends({},e):e;if(delete u[t])return u}if(e[t]!==r){if(n)return babelHelpers.extends({},e,babelHelpers.defineProperty({},t,r));e[t]=r}return e}},387); -__d(function(e,l,a,r){Object.defineProperty(r,"__esModule",{value:!0});var t=l(389),n=(function(){function e(){babelHelpers.classCallCheck(this,e),this._elements=[]}return babelHelpers.createClass(e,[{key:"applyMiddleware",value:function(){for(var e=arguments.length,l=Array(e),a=0;a0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(d)throw d;for(var r=!1,i={},o=0;o0&&void 0!==arguments[0]?arguments[0]:{};return(0,s.combineReducers)(babelHelpers.extends({},this._elements,e))}},{key:"register",value:function(e,n){this._elements[e]=n}}]),e})();l.default=new r},409); -__d(function(t,e,n,r){function o(t){this.options=t||{locator:{}}}o.prototype.parseFromString=function(t,e){var n=this.options,r=new u,o=n.domBuilder||new i,c=n.errorHandler,l=n.locator,s=n.xmlns||{},m={lt:'<',gt:'>',amp:'&',quot:'"',apos:"'"};return l&&o.setDocumentLocator(l),r.errorHandler=(function(t,e,n){if(!t){if(e instanceof i)return e;t=e}var r={},o=t instanceof Function;n=n||{};function c(e){var i=t[e];!i&&o&&(i=2==t.length?function(n){t(e,n)}:t),r[e]=i&&function(t){i('[xmldom '+e+']\t'+t+a(n))}||function(){}}return c('warning'),c('error'),c('fatalError'),r})(c,o,l),r.domBuilder=n.domBuilder||o,/\/x?html?$/.test(e)&&(m.nbsp='\xa0',m.copy='\xa9',s['']='http://www.w3.org/1999/xhtml'),s.xml=s.xml||'http://www.w3.org/XML/1998/namespace',t?r.parse(t,s,m):r.errorHandler.error("invalid doc source"),o.doc};function i(){this.cdata=!1}function c(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}i.prototype={startDocument:function(){this.doc=(new m).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(t,e,n,r){var o=this.doc,i=o.createElementNS(t,n||e),a=r.length;s(this,i),this.currentElement=i,this.locator&&c(this.locator,i);for(var l=0;l=e+n||e?new java.lang.String(t,e,n)+'':t}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(t){i.prototype[t]=function(){return null}});function s(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}var u=e(411).XMLReader,m=r.DOMImplementation=e(412).DOMImplementation;r.XMLSerializer=e(412).XMLSerializer,r.DOMParser=o},410); -__d(function(e,t,r,a){var n=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,s=new RegExp("[\\-\\.0-9"+n.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),c=new RegExp('^'+n.source+s.source+'*(?::'+n.source+s.source+'*)?$'),i=0,u=1,o=2,l=3,f=4,d=5,m=6,h=7;function g(){}g.prototype={parse:function(e,t,r){var a=this.domBuilder;a.startDocument(),N(t,t={}),(function(e,t,r,a,n){function s(e){var t=e.slice(1,-1);return t in r?r[t]:'#'===t.charAt(0)?(function(e){if(e>65535){var t=55296+((e-=65536)>>10),r=56320+(1023&e);return String.fromCharCode(t,r)}return String.fromCharCode(e)})(parseInt(t.substr(1).replace('x','0x'))):(n.error('entity not found:'+e),e)}function c(t){if(t>h){var r=e.substring(h,t).replace(/&#?\w+;/g,s);f&&i(h),a.characters(r,0,t-h),h=t}}function i(t,r){for(;t>=o&&(r=l.exec(e));)u=r.index,o=u+r[0].length,f.lineNumber++;f.columnNumber=t-u+1}var u=0,o=0,l=/.*(?:\r\n?|\n)|.*$/g,f=a.locator,d=[{currentNSMap:t}],m={},h=0;for(;;){try{var g=e.indexOf('<',h);if(g<0){if(!e.substr(h).match(/^\s*$/)){var N=a.doc,E=N.createTextNode(e.substr(h));N.appendChild(E),a.currentElement=E}return}switch(g>h&&c(g),e.charAt(g+1)){case'/':var C=e.indexOf('>',g+3),$=e.substring(g+2,C),A=d.pop();C<0?($=e.substring(g+2).replace(/[\s<].*/,''),n.error("end tag name: "+$+' is not complete:'+A.tagName),C=g+1+$.length):$.match(/\sh?h=C:c(Math.max(g,h)+1)}})(e,t,r,a,this.errorHandler),a.endDocument()}};function p(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function w(e,t,r,a,n,s){for(var c,g=++t,p=i;;){var w=e.charAt(g);switch(w){case'=':if(p===u)c=e.slice(t,g),p=l;else{if(p!==o)throw new Error('attribute equal must after attrName');p=l}break;case'\'':case'"':if(p===l||p===u){if(p===u&&(s.warning('attribute value must after "="'),c=e.slice(t,g)),t=g+1,!((g=e.indexOf(w,t))>0))throw new Error('attribute value no end \''+w+'\' match');b=e.slice(t,g).replace(/&#?\w+;/g,n),r.add(c,b,t-1),p=d}else{if(p!=f)throw new Error('attribute value must after "="');b=e.slice(t,g).replace(/&#?\w+;/g,n),r.add(c,b,t),s.warning('attribute "'+c+'" missed start quot('+w+')!!'),t=g+1,p=d}break;case'/':switch(p){case i:r.setTagName(e.slice(t,g));case d:case m:case h:p=h,r.closed=!0;case f:case u:case o:break;default:throw new Error("attribute invalid close char('/')")}break;case'':return s.error('unexpected end of input'),p==i&&r.setTagName(e.slice(t,g)),g;case'>':switch(p){case i:r.setTagName(e.slice(t,g));case d:case m:case h:break;case f:case u:'/'===(b=e.slice(t,g)).slice(-1)&&(r.closed=!0,b=b.slice(0,-1));case o:p===o&&(b=c),p==f?(s.warning('attribute "'+b+'" missed quot(")!!'),r.add(c,b.replace(/&#?\w+;/g,n),t)):('http://www.w3.org/1999/xhtml'===a['']&&b.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+b+'" missed value!! "'+b+'" instead!!'),r.add(b,b,t));break;case l:throw new Error('attribute value missed!!')}return g;case"\x80":w=' ';default:if(w<=' ')switch(p){case i:r.setTagName(e.slice(t,g)),p=m;break;case u:c=e.slice(t,g),p=o;break;case f:var b=e.slice(t,g).replace(/&#?\w+;/g,n);s.warning('attribute "'+b+'" missed quot(")!!'),r.add(c,b,t);case d:p=m}else switch(p){case o:r.tagName;'http://www.w3.org/1999/xhtml'===a['']&&c.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+c+'" missed value!! "'+c+'" instead2!!'),r.add(c,c,t),t=g,p=u;break;case d:s.warning('attribute space is required"'+c+'"!!');case m:p=u,t=g;break;case l:p=f,t=g;break;case h:throw new Error("elements closed character '/' and '>' must be connected to")}}g++}}function b(e,t,r){for(var a=e.tagName,n=null,s=e.length;s--;){var c=e[s],i=c.qName,u=c.value;if((d=i.indexOf(':'))>0)var o=c.prefix=i.slice(0,d),l=i.slice(d+1),f='xmlns'===o&&l;else l=i,o=null,f='xmlns'===i&&'';c.localName=l,!1!==f&&(null==n&&(n={},N(r,r={})),r[f]=n[f]=u,c.uri='http://www.w3.org/2000/xmlns/',t.startPrefixMapping(f,u))}for(s=e.length;s--;){(o=(c=e[s]).prefix)&&('xml'===o&&(c.uri='http://www.w3.org/XML/1998/namespace'),'xmlns'!==o&&(c.uri=r[o||'']))}var d;(d=a.indexOf(':'))>0?(o=e.prefix=a.slice(0,d),l=e.localName=a.slice(d+1)):(o=null,l=e.localName=a);var m=e.uri=r[o||''];if(t.startElement(m,l,a,e),!e.closed)return e.currentNSMap=r,e.localNSMap=n,!0;if(t.endElement(m,l,a),n)for(o in n)t.endPrefixMapping(o)}function x(e,t,r,a,n){if(/^(?:script|textarea)$/i.test(r)){var s=e.indexOf('',t),c=e.substring(t+1,s);if(/[&<]/.test(c))return/^script$/i.test(r)?(n.characters(c,0,c.length),s):(c=c.replace(/&#?\w+;/g,a),n.characters(c,0,c.length),s)}return t+1}function v(e,t,r,a){var n=a[r];return null==n&&((n=e.lastIndexOf(''))t?(r.comment(e,t+4,n-t-4),n+3):(a.error("Unclosed comment"),-1)}return-1;default:if('CDATA['==e.substr(t+3,6)){var n=e.indexOf(']]>',t+9);return r.startCDATA(),r.characters(e,t+9,n-t-9),r.endCDATA(),n+3}var s=(function(e,t){var r,a=[],n=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;n.lastIndex=t,n.exec(e);for(;r=n.exec(e);)if(a.push(r),r[1])return a})(e,t),c=s.length;if(c>1&&/!doctype/i.test(s[0][0])){var i=s[1][0],u=c>3&&/^public$/i.test(s[2][0])&&s[3][0],o=c>4&&s[4][0],l=s[c-1];return r.startDTD(i,u&&u.replace(/^(['"])(.*?)\1$/,'$2'),o&&o.replace(/^(['"])(.*?)\1$/,'$2')),r.endDTD(),l.index+l[0].length}}return-1}function D(e,t,r){var a=e.indexOf('?>',t);if(a){var n=e.substring(t,a).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(n){n[0].length;return r.processingInstruction(n[1],n[2]),a+2}return-1}return-1}function k(e){}k.prototype={setTagName:function(e){if(!c.test(e))throw new Error('invalid tagName:'+e);this.tagName=e},add:function(e,t,r){if(!c.test(e))throw new Error('invalid attribute:'+e);this[this.length++]={qName:e,value:t,offset:r}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};function E(e,t){return e.__proto__=t,e}E({},E.prototype)instanceof E||(E=function(e,t){function r(){}r.prototype=t,r=new r;for(t in e)r[t]=e[t];return r});a.XMLReader=g},411); -__d(function(e,t,n,r){function i(e,t){for(var n in e)t[n]=e[n]}function o(e,t){var n=e.prototype;if(Object.create){var r=Object.create(t.prototype);n.__proto__=r}if(!(n instanceof t)){function o(){}o.prototype=t.prototype,i(n,o=new o),e.prototype=n=o}n.constructor!=e&&('function'!=typeof e&&console.error("unknow Class:"+e),n.constructor=e)}var a='http://www.w3.org/1999/xhtml',u={},s=u.ELEMENT_NODE=1,l=u.ATTRIBUTE_NODE=2,c=u.TEXT_NODE=3,h=u.CDATA_SECTION_NODE=4,p=u.ENTITY_REFERENCE_NODE=5,d=u.ENTITY_NODE=6,f=u.PROCESSING_INSTRUCTION_NODE=7,m=u.COMMENT_NODE=8,N=u.DOCUMENT_NODE=9,g=u.DOCUMENT_TYPE_NODE=10,v=u.DOCUMENT_FRAGMENT_NODE=11,w=u.NOTATION_NODE=12,E={},y={},b=(E.INDEX_SIZE_ERR=(y[1]="Index size error",1),E.DOMSTRING_SIZE_ERR=(y[2]="DOMString size error",2),E.HIERARCHY_REQUEST_ERR=(y[3]="Hierarchy request error",3)),T=(E.WRONG_DOCUMENT_ERR=(y[4]="Wrong document",4),E.INVALID_CHARACTER_ERR=(y[5]="Invalid character",5),E.NO_DATA_ALLOWED_ERR=(y[6]="No data allowed",6),E.NO_MODIFICATION_ALLOWED_ERR=(y[7]="No modification allowed",7),E.NOT_FOUND_ERR=(y[8]="Not found",8)),_=(E.NOT_SUPPORTED_ERR=(y[9]="Not supported",9),E.INUSE_ATTRIBUTE_ERR=(y[10]="Attribute in use",10));E.INVALID_STATE_ERR=(y[11]="Invalid state",11),E.SYNTAX_ERR=(y[12]="Syntax error",12),E.INVALID_MODIFICATION_ERR=(y[13]="Invalid modification",13),E.NAMESPACE_ERR=(y[14]="Invalid namespace",14),E.INVALID_ACCESS_ERR=(y[15]="Invalid access",15);function D(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,y[e]),this.message=y[e],Error.captureStackTrace&&Error.captureStackTrace(this,D);return n.code=e,t&&(this.message=this.message+": "+t),n}D.prototype=Error.prototype,i(E,D);function S(){}S.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var n=[],r=0;r=0))throw D(T,new Error(e.tagName+'@'+n));for(var i=t.length-1;r0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var r in n)if(n[r]==e)return r;t=t.nodeType==l?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&e in n)return n[e];t=t.nodeType==l?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}};function B(e){return('<'==e?'<':'>'==e&&'>')||'&'==e&&'&'||'"'==e&&'"'||'&#'+e.charCodeAt()+';'}i(u,M),i(u,M.prototype);function P(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(P(e,t))return!0}while(e=e.nextSibling)}function L(){}function V(e,t,n,r){e&&e._inc++;'http://www.w3.org/2000/xmlns/'==n.namespaceURI&&delete t._nsMap[n.prefix?n.localName:'']}function k(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var i=t.firstChild,o=0;i;)r[o++]=i,i=i.nextSibling;r.length=o}}}function j(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,k(e.ownerDocument,e),t}function F(e,t,n){var r=t.parentNode;if(r&&r.removeChild(t),t.nodeType===v){var i=t.firstChild;if(null==i)return t;var o=t.lastChild}else i=o=t;var a=n?n.previousSibling:e.lastChild;i.previousSibling=a,o.nextSibling=n,a?a.nextSibling=i:e.firstChild=i,null==n?e.lastChild=o:n.previousSibling=o;do{i.parentNode=e}while(i!==o&&(i=i.nextSibling));return k(e.ownerDocument||e,e),t.nodeType==v&&(t.firstChild=t.lastChild=null),t}L.prototype={nodeName:'#document',nodeType:N,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==v){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return null==this.documentElement&&e.nodeType==s&&(this.documentElement=e),F(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),j(this,e)},importNode:function(e,t){return(function e(t,n,r){var i;switch(n.nodeType){case s:(i=n.cloneNode(!1)).ownerDocument=t;case v:break;case l:r=!0}i||(i=n.cloneNode(!1));i.ownerDocument=t;i.parentNode=null;if(r)for(var o=n.firstChild;o;)i.appendChild(e(t,o,r)),o=o.nextSibling;return i})(this,e,t)},getElementById:function(e){var t=null;return P(this.documentElement,function(n){if(n.nodeType==s&&n.getAttribute('id')==e)return t=n,!0}),t},createElement:function(e){var t=new Y;t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new S;return(t.attributes=new A)._ownerElement=t,t},createDocumentFragment:function(){var e=new J;return e.ownerDocument=this,e.childNodes=new S,e},createTextNode:function(e){var t=new X;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new G;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new H;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new K;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new z;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new Q;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new Y,r=t.split(':'),i=n.attributes=new A;return n.childNodes=new S,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,i._ownerElement=n,n},createAttributeNS:function(e,t){var n=new z,r=t.split(':');return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}},o(L,M);function Y(){this._nsMap={}}Y.prototype={nodeType:s,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||''},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===v?this.insertBefore(e,null):(function(e,t){var n=t.parentNode;if(n){var r=e.lastChild;n.removeChild(t),r=e.lastChild}return r=e.lastChild,t.parentNode=e,t.previousSibling=r,t.nextSibling=null,r?r.nextSibling=t:e.firstChild=t,e.lastChild=t,k(e.ownerDocument,e,t),t})(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||''},setAttributeNS:function(e,t,n){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new C(this,function(t){var n=[];return P(t,function(r){r===t||r.nodeType!=s||'*'!==e&&r.tagName!=e||n.push(r)}),n})},getElementsByTagNameNS:function(e,t){return new C(this,function(n){var r=[];return P(n,function(i){i===n||i.nodeType!==s||'*'!==e&&i.namespaceURI!==e||'*'!==t&&i.localName!=t||r.push(i)}),r})}},L.prototype.getElementsByTagName=Y.prototype.getElementsByTagName,L.prototype.getElementsByTagNameNS=Y.prototype.getElementsByTagNameNS,o(Y,M);function z(){}z.prototype.nodeType=l,o(z,M);function $(){}$.prototype={data:'',substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(y[b])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},o($,M);function X(){}X.prototype={nodeName:"#text",nodeType:c,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},o(X,$);function G(){}G.prototype={nodeName:"#comment",nodeType:m},o(G,$);function H(){}H.prototype={nodeName:"#cdata-section",nodeType:h},o(H,$);function W(){}W.prototype.nodeType=g,o(W,M);function q(){}q.prototype.nodeType=w,o(q,M);function Z(){}Z.prototype.nodeType=d,o(Z,M);function Q(){}Q.prototype.nodeType=p,o(Q,M);function J(){}J.prototype.nodeName="#document-fragment",J.prototype.nodeType=v,o(J,M);function K(){}K.prototype.nodeType=f,o(K,M);function ee(){}ee.prototype.serializeToString=function(e,t,n){return te.call(e,t,n)},M.prototype.toString=te;function te(e,t){var n=[],r=9==this.nodeType?this.documentElement:this,i=r.prefix,o=r.namespaceURI;if(o&&null==i){if(null==(i=r.lookupPrefix(o)))var a=[{namespace:o,prefix:null}]}return re(this,n,e,t,a),n.join('')}function ne(e,t,n){var r=e.prefix||'',i=e.namespaceURI;if(!r&&!i)return!1;if("xml"===r&&"http://www.w3.org/XML/1998/namespace"===i||'http://www.w3.org/2000/xmlns/'==i)return!1;for(var o=n.length;o--;){var a=n[o];if(a.prefix==r)return a.namespace!=i}return!0}function re(e,t,n,r,i){if(r){if(!(e=r(e)))return;if('string'==typeof e)return void t.push(e)}switch(e.nodeType){case s:i||(i=[]);i.length;var o=e.attributes,u=o.length,d=e.firstChild,w=e.tagName;n=a===e.namespaceURI||n,t.push('<',w);for(var E=0;E'),n&&/^script$/i.test(w))for(;d;)d.data?t.push(d.data):re(d,t,n,r,i),d=d.nextSibling;else for(;d;)re(d,t,n,r,i),d=d.nextSibling;t.push('')}else t.push('/>');return;case N:case v:for(d=e.firstChild;d;)re(d,t,n,r,i),d=d.nextSibling;return;case l:return t.push(' ',e.name,'="',e.value.replace(/[<&"]/g,B),'"');case c:return t.push(e.data.replace(/[<&]/g,B));case h:return t.push('');case m:return t.push("\x3c!--",e.data,"--\x3e");case g:var D=e.publicId,S=e.systemId;if(t.push('');else if(S&&'.'!=S)t.push(' SYSTEM "',S,'">');else{var C=e.internalSubset;C&&t.push(" [",C,"]"),t.push(">")}return;case f:return t.push("");case p:return t.push('&',e.nodeName,';');default:t.push('??',e.nodeName)}}function ie(e,t,n){e[t]=n}try{if(Object.defineProperty){Object.defineProperty(C.prototype,'length',{get:function(){return I(this),this.$$length}}),Object.defineProperty(M.prototype,'textContent',{get:function(){return(function e(t){switch(t.nodeType){case s:case v:var n=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&n.push(e(t)),t=t.nextSibling;return n.join('');default:return t.nodeValue}})(this)},set:function(e){switch(this.nodeType){case s:case v:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}});ie=function(e,t,n){e['$$'+t]=n}}}catch(e){}r.DOMImplementation=U,r.XMLSerializer=ee},412); -__d(function(e,t,s,r){s.exports={_args:[["react-native@0.51.0","/Users/manu/UC/matrix/github/release/jitsi-meet"]],_from:"react-native@0.51.0",_id:"react-native@0.51.0",_inBundle:!1,_integrity:"sha512-XpLmz3C7DOds5TUwIOpQBEXqoFDtU2/HmMBzVItGlHtowXpcHoQxJYSxL4Z9u8B4EeDfSvGfU2TFHq0sV3xd3Q==",_location:"/react-native",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"react-native@0.51.0",name:"react-native",escapedName:"react-native",rawSpec:"0.51.0",saveSpec:null,fetchSpec:"0.51.0"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/react-native/-/react-native-0.51.0.tgz",_spec:"0.51.0",_where:"/Users/manu/UC/matrix/github/release/jitsi-meet",bin:{"react-native":"local-cli/wrong-react-native.js"},bugs:{url:"https://github.com/facebook/react-native/issues"},dependencies:{"absolute-path":"^0.0.0",art:"^0.10.0","babel-core":"^6.24.1","babel-plugin-syntax-trailing-function-commas":"^6.20.0","babel-plugin-transform-async-to-generator":"6.16.0","babel-plugin-transform-class-properties":"^6.18.0","babel-plugin-transform-exponentiation-operator":"^6.5.0","babel-plugin-transform-flow-strip-types":"^6.21.0","babel-plugin-transform-object-rest-spread":"^6.20.2","babel-register":"^6.24.1","babel-runtime":"^6.23.0","base64-js":"^1.1.2",chalk:"^1.1.1",commander:"^2.9.0",connect:"^2.8.3","create-react-class":"^15.5.2",debug:"^2.2.0",denodeify:"^1.2.1",envinfo:"^3.0.0","event-target-shim":"^1.0.5",fbjs:"^0.8.14","fbjs-scripts":"^0.8.1","fs-extra":"^1.0.0",glob:"^7.1.1","graceful-fs":"^4.1.3",inquirer:"^3.0.6",lodash:"^4.16.6","metro-bundler":"^0.20.0",mime:"^1.3.4",minimist:"^1.2.0",mkdirp:"^0.5.1","node-fetch":"^1.3.3","node-notifier":"^5.1.2",npmlog:"^2.0.4",opn:"^3.0.2",optimist:"^0.6.1",plist:"^1.2.0","pretty-format":"^4.2.1",promise:"^7.1.1","prop-types":"^15.5.8","react-clone-referenced-element":"^1.0.1","react-devtools-core":"^2.5.0","react-timer-mixin":"^0.13.2","regenerator-runtime":"^0.11.0",rimraf:"^2.5.4",semver:"^5.0.3","shell-quote":"1.6.1","stacktrace-parser":"^0.1.3","whatwg-fetch":"^1.0.0",ws:"^1.1.0",xcode:"^0.9.1",xmldoc:"^0.4.0",yargs:"^9.0.0"},description:"A framework for building native apps using React",devDependencies:{"babel-eslint":"^7.2.3",eslint:"^3.19.0","eslint-config-fb-strict":"^20.0.3","eslint-config-fbjs":"^1.1.1","eslint-plugin-babel":"^4.1.1","eslint-plugin-flowtype":"^2.33.0","eslint-plugin-prettier":"2.1.1","eslint-plugin-react":"^7.2.1","flow-bin":"^0.57.0",jest:"^21",prettier:"1.7.0",react:"16.0.0","react-test-renderer":"16.0.0",shelljs:"^0.7.8",sinon:"^2.2.0"},engines:{node:">=4"},files:[".flowconfig","android","cli.js","flow","init.sh","scripts/ios-configure-glog.sh","scripts/ios-install-third-party.sh","scripts/launchPackager.bat","scripts/launchPackager.command","scripts/packager.sh","scripts/react-native-xcode.sh","jest-preset.json","jest","lib","rn-get-polyfills.js","setupBabel.js","Libraries","LICENSE","local-cli","packager","PATENTS","react.gradle","React.podspec","React","ReactAndroid","ReactCommon","README.md","third-party-podspecs"],homepage:"https://github.com/facebook/react-native#readme",jest:{transform:{"^[./a-zA-Z0-9$_-]+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$":"/jest/assetFileTransformer.js",".*":"./jest/preprocessor.js"},setupFiles:["./jest/setup.js"],timers:"fake",moduleNameMapper:{"^React$":"/Libraries/react-native/React.js"},testPathIgnorePatterns:["Libraries/Renderer","/node_modules/","/website/","local-cli/templates/"],haste:{defaultPlatform:"ios",providesModuleNodeModules:["react-native"],platforms:["ios","android"]},modulePathIgnorePatterns:["/node_modules/(?!react|fbjs|react-native|react-transform-hmr|core-js|promise)/","node_modules/react/node_modules/fbjs/","node_modules/react/lib/ReactDOM.js","node_modules/fbjs/lib/Map.js","node_modules/fbjs/lib/Promise.js","node_modules/fbjs/lib/fetch.js","node_modules/fbjs/lib/ErrorUtils.js","node_modules/fbjs/lib/URI.js","node_modules/fbjs/lib/Deferred.js","node_modules/fbjs/lib/PromiseMap.js","node_modules/fbjs/lib/UserAgent.js","node_modules/fbjs/lib/areEqual.js","node_modules/fbjs/lib/base62.js","node_modules/fbjs/lib/crc32.js","node_modules/fbjs/lib/everyObject.js","node_modules/fbjs/lib/fetchWithRetries.js","node_modules/fbjs/lib/filterObject.js","node_modules/fbjs/lib/flattenArray.js","node_modules/fbjs/lib/forEachObject.js","node_modules/fbjs/lib/isEmpty.js","node_modules/fbjs/lib/nullthrows.js","node_modules/fbjs/lib/removeFromArray.js","node_modules/fbjs/lib/resolveImmediate.js","node_modules/fbjs/lib/someObject.js","node_modules/fbjs/lib/sprintf.js","node_modules/fbjs/lib/xhrSimpleDataSerializer.js","node_modules/jest-cli","node_modules/react/dist","node_modules/fbjs/.*/__mocks__/","node_modules/fbjs/node_modules/","/website/"],unmockedModulePathPatterns:["node_modules/react/","Libraries/Renderer","promise","source-map","fastpath","denodeify","fbjs","sinon"],testEnvironment:"node"},license:"BSD-3-Clause",main:"Libraries/react-native/react-native-implementation.js",name:"react-native",peerDependencies:{react:"16.0.0"},repository:{type:"git",url:"git+ssh://git@github.com/facebook/react-native.git"},scripts:{flow:"flow",lint:"eslint .",start:"/usr/bin/env bash -c './scripts/packager.sh \"$@\" || true' --",test:"jest","test-android-all":"npm run test-android-build && npm run test-android-run-unit && npm run test-android-run-instrumentation && npm run test-android-run-e2e","test-android-build":"docker build -t react/android -f ContainerShip/Dockerfile.android .","test-android-e2e":"npm run test-android-build && npm run test-android-run-e2e","test-android-instrumentation":"npm run test-android-build && npm run test-android-run-instrumentation","test-android-run-e2e":"docker run --privileged -it react/android bash ContainerShip/scripts/run-ci-e2e-tests.sh --android --js","test-android-run-instrumentation":"docker run --cap-add=SYS_ADMIN -it react/android bash ContainerShip/scripts/run-android-docker-instrumentation-tests.sh","test-android-run-unit":"docker run --cap-add=SYS_ADMIN -it react/android bash ContainerShip/scripts/run-android-docker-unit-tests.sh","test-android-setup":"docker pull containership/android-base:latest","test-android-unit":"npm run test-android-build && npm run test-android-run-unit"},version:"0.51.0"}},413); -__d(function(e,i,a,t){var d=i(415),r=i(432),n=babelHelpers.interopRequireDefault(r);!(function(e){void 0===e.webkitMediaStream&&(e.webkitMediaStream=d.MediaStream),void 0===e.MediaStreamTrack&&(e.MediaStreamTrack=d.MediaStreamTrack),void 0===e.webkitRTCPeerConnection&&(e.webkitRTCPeerConnection=n.default),void 0===e.RTCSessionDescription&&(e.RTCSessionDescription=d.RTCSessionDescription),void 0===e.RTCIceCandidate&&(e.RTCIceCandidate=d.RTCIceCandidate);var i=e.navigator;i&&void 0===i.webkitGetUserMedia&&(i.webkitGetUserMedia=d.getUserMedia)})(e||window||this)},414); -__d(function(e,t,a,r){'use strict';var l=t(416),i=babelHelpers.interopRequireDefault(l),u=t(426),p=babelHelpers.interopRequireDefault(u),f=t(425),n=babelHelpers.interopRequireDefault(f),b=t(429),s=babelHelpers.interopRequireDefault(b),d=t(417),o=babelHelpers.interopRequireDefault(d),R=t(420),D=babelHelpers.interopRequireDefault(R),q=t(430),H=babelHelpers.interopRequireDefault(q);a.exports={RTCPeerConnection:i.default,RTCIceCandidate:p.default,RTCSessionDescription:n.default,RTCView:s.default,MediaStream:o.default,MediaStreamTrack:D.default,getUserMedia:H.default}},415); -__d(function(e,n,t,i){'use strict';Object.defineProperty(i,"__esModule",{value:!0});var a=n(75),r=babelHelpers.interopRequireDefault(a),o=n(24),c=n(417),d=babelHelpers.interopRequireDefault(c),s=n(419),l=babelHelpers.interopRequireDefault(s),u=n(420),p=babelHelpers.interopRequireDefault(u),f=n(422),C=babelHelpers.interopRequireDefault(f),h=n(424),v=babelHelpers.interopRequireDefault(h),m=n(425),g=babelHelpers.interopRequireDefault(m),_=n(426),b=babelHelpers.interopRequireDefault(_),S=n(427),I=babelHelpers.interopRequireDefault(S),E=n(428),y=babelHelpers.interopRequireDefault(E),D=o.NativeModules.WebRTCModule,w={mandatory:{OfferToReceiveAudio:!0,OfferToReceiveVideo:!0},optional:[]},R={mandatory:{},optional:[{DtlsSrtpKeyAgreement:!0}]},k=0,H=(function(e){babelHelpers.inherits(n,e);function n(e){babelHelpers.classCallCheck(this,n);var t=babelHelpers.possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));return t.signalingState='stable',t.iceGatheringState='new',t.iceConnectionState='new',t._remoteStreams=[],t._dataChannelIds=new Set,t._peerConnectionId=k++,D.peerConnectionInit(e,R,t._peerConnectionId),t._registerEvents(),t}return babelHelpers.createClass(n,[{key:"addStream",value:function(e){D.peerConnectionAddStream(e.reactTag,this._peerConnectionId)}},{key:"removeStream",value:function(e){D.peerConnectionRemoveStream(e.reactTag,this._peerConnectionId)}},{key:"_mergeMediaConstraints",value:function(e){var n=babelHelpers.extends({},w);return e&&(e.mandatory&&(n.mandatory=babelHelpers.extends({},n.mandatory,e.mandatory)),e.optional&&Array.isArray(e.optional)&&(n.optional=e.optional.concat(n.optional))),n}},{key:"createOffer",value:function(e,n,t){D.peerConnectionCreateOffer(this._peerConnectionId,this._mergeMediaConstraints(t),function(t,i){t?e(new g.default(i)):n(i)})}},{key:"createAnswer",value:function(e,n,t){D.peerConnectionCreateAnswer(this._peerConnectionId,this._mergeMediaConstraints(t),function(t,i){t?e(new g.default(i)):n(i)})}},{key:"setConfiguration",value:function(e){D.peerConnectionSetConfiguration(e,this._peerConnectionId)}},{key:"setLocalDescription",value:function(e,n,t,i){var a=this;D.peerConnectionSetLocalDescription(e.toJSON(),this._peerConnectionId,function(i,r){i?(a.localDescription=e,n()):t(r)})}},{key:"setRemoteDescription",value:function(e,n,t){var i=this;D.peerConnectionSetRemoteDescription(e.toJSON(),this._peerConnectionId,function(a,r){a?(i.remoteDescription=e,n()):t(r)})}},{key:"addIceCandidate",value:function(e,n,t){D.peerConnectionAddICECandidate(e.toJSON(),this._peerConnectionId,function(e){e?n&&n():t&&t()})}},{key:"getStats",value:function(e,n,t){D.peerConnectionGetStats?D.peerConnectionGetStats(e&&e.id||'',this._peerConnectionId,function(e){if(n){if('string'==typeof e)try{e=JSON.parse(e)}catch(e){return void t(e)}n(e)}}):console.warn('RTCPeerConnection getStats not supported')}},{key:"getRemoteStreams",value:function(){return this._remoteStreams.slice()}},{key:"close",value:function(){D.peerConnectionClose(this._peerConnectionId)}},{key:"_unregisterEvents",value:function(){this._subscriptions.forEach(function(e){return e.remove()}),this._subscriptions=[]}},{key:"_registerEvents",value:function(){var e=this;this._subscriptions=[o.DeviceEventEmitter.addListener('peerConnectionOnRenegotiationNeeded',function(n){n.id===e._peerConnectionId&&e.dispatchEvent(new y.default('negotiationneeded'))}),o.DeviceEventEmitter.addListener('peerConnectionIceConnectionChanged',function(n){n.id===e._peerConnectionId&&(e.iceConnectionState=n.iceConnectionState,e.dispatchEvent(new y.default('iceconnectionstatechange')),'closed'===n.iceConnectionState&&e._unregisterEvents())}),o.DeviceEventEmitter.addListener('peerConnectionSignalingStateChanged',function(n){n.id===e._peerConnectionId&&(e.signalingState=n.signalingState,e.dispatchEvent(new y.default('signalingstatechange')))}),o.DeviceEventEmitter.addListener('peerConnectionAddedStream',function(n){if(n.id===e._peerConnectionId){for(var t=new d.default(n.streamId,n.streamReactTag),i=n.tracks,a=0;a-1&&e._remoteStreams.splice(i,1)}e.dispatchEvent(new l.default('removestream',{stream:t}))}}),o.DeviceEventEmitter.addListener('peerConnectionGotICECandidate',function(n){if(n.id===e._peerConnectionId){var t=new b.default(n.candidate),i=new I.default('icecandidate',{candidate:t});e.dispatchEvent(i)}}),o.DeviceEventEmitter.addListener('peerConnectionIceGatheringChanged',function(n){n.id===e._peerConnectionId&&(e.iceGatheringState=n.iceGatheringState,'complete'===e.iceGatheringState&&e.dispatchEvent(new I.default('icecandidate',null)),e.dispatchEvent(new y.default('icegatheringstatechange')))}),o.DeviceEventEmitter.addListener('peerConnectionDidOpenDataChannel',function(n){if(n.id===e._peerConnectionId){var t=n.dataChannel,i=t.id;if('number'==typeof i&&-1!==i){var a=new C.default(e._peerConnectionId,t.label,t);e._dataChannelIds.add(i),e.dispatchEvent(new v.default('datachannel',{channel:a}))}}})]}},{key:"createDataChannel",value:function(e,n){var t=void 0,i=this._dataChannelIds;if(n&&'id'in n){if('number'!=typeof(t=n.id))throw new TypeError('DataChannel id must be a number: '+t);if(i.has(t))throw new ResourceInUse('DataChannel id already in use: '+t)}else{for(t=0;t<65535&&i.has(t);++t);n=babelHelpers.extends({id:t},n)}return D.createDataChannel(this._peerConnectionId,e,n),i.add(t),new C.default(this._peerConnectionId,e,n)}}]),n})((0,r.default)(['connectionstatechange','icecandidate','icecandidateerror','iceconnectionstatechange','icegatheringstatechange','negotiationneeded','signalingstatechange','datachannel','addstream','removestream']));i.default=H},416); -__d(function(e,t,r,a){'use strict';Object.defineProperty(a,"__esModule",{value:!0});var i=t(24),n=t(75),c=babelHelpers.interopRequireDefault(n),s=t(418),u=babelHelpers.interopRequireDefault(s),l=i.NativeModules.WebRTCModule,o=(function(e){babelHelpers.inherits(t,e);function t(e,r){babelHelpers.classCallCheck(this,t);var a=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return a.active=!0,a._tracks=[],a.id=e,a.reactTag=void 0===r?e:r,a}return babelHelpers.createClass(t,[{key:"addTrack",value:function(e){this._tracks.push(e),this.dispatchEvent(new u.default('addtrack',{track:e}))}},{key:"removeTrack",value:function(e){var t=this._tracks.indexOf(e);-1!==t&&(l.mediaStreamTrackRelease(this.reactTag,e.id),this._tracks.splice(t,1),this.dispatchEvent(new u.default('removetrack',{track:e})))}},{key:"getTracks",value:function(){return this._tracks.slice()}},{key:"getTrackById",value:function(e){return this._tracks.find(function(t){return t.id===e})}},{key:"getAudioTracks",value:function(){return this._tracks.filter(function(e){return'audio'===e.kind})}},{key:"getVideoTracks",value:function(){return this._tracks.filter(function(e){return'video'===e.kind})}},{key:"clone",value:function(){throw new Error('Not implemented.')}},{key:"toURL",value:function(){return this.reactTag}},{key:"release",value:function(){l.mediaStreamRelease(this.reactTag)}}]),t})((0,c.default)(['active','inactive','addtrack','removetrack']));a.default=o},417); -__d(function(e,t,s,l){'use strict';Object.defineProperty(l,"__esModule",{value:!0});l.default=function e(t,s){babelHelpers.classCallCheck(this,e),this.type=t.toString(),babelHelpers.extends(this,s)}},418); -__d(function(e,t,s,l){'use strict';Object.defineProperty(l,"__esModule",{value:!0});l.default=function e(t,s){babelHelpers.classCallCheck(this,e),this.type=t.toString(),babelHelpers.extends(this,s)}},419); -__d(function(e,t,r,i){'use strict';Object.defineProperty(i,"__esModule",{value:!0});var n=t(24),a=t(75),l=babelHelpers.interopRequireDefault(a),o=t(421),s=(babelHelpers.interopRequireDefault(o),n.NativeModules.WebRTCModule),d=(function(e){babelHelpers.inherits(t,e),babelHelpers.createClass(t,null,[{key:"getSources",value:function(e){s.mediaStreamTrackGetSources(e)}}]);function t(e){babelHelpers.classCallCheck(this,t);var r=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),i=e.readyState.toLowerCase();return r._enabled=e.enabled,r.id=e.id,r.kind=e.kind,r.label=e.label,r.muted=!1,r.readonly=!0,r.remote=e.remote,r.readyState="initializing"===i||"live"===i?"live":"ended",r}return babelHelpers.createClass(t,[{key:"stop",value:function(){this.remote||(s.mediaStreamTrackStop(this.id),this._enabled=!1,this.readyState='ended',this.muted=!this._enabled)}},{key:"_switchCamera",value:function(){if(this.remote)throw new Error('Not implemented for remote tracks');if('video'!==this.kind)throw new Error('Only implemented for video tracks');s.mediaStreamTrackSwitchCamera(this.id)}},{key:"applyConstraints",value:function(){throw new Error('Not implemented.')}},{key:"clone",value:function(){throw new Error('Not implemented.')}},{key:"getCapabilities",value:function(){throw new Error('Not implemented.')}},{key:"getConstraints",value:function(){throw new Error('Not implemented.')}},{key:"getSettings",value:function(){throw new Error('Not implemented.')}},{key:"enabled",get:function(){return this._enabled},set:function(e){e!==this._enabled&&(s.mediaStreamTrackSetEnabled(this.id,!this._enabled),this._enabled=!this._enabled,this.muted=!this._enabled)}}]),t})((0,l.default)(['ended','mute','unmute','overconstrained']));i.default=d},420); -__d(function(e,t,s,l){'use strict';Object.defineProperty(l,"__esModule",{value:!0});l.default=function e(t,s){babelHelpers.classCallCheck(this,e),this.type=t.toString(),babelHelpers.extends(this,s)}},421); -__d(function(e,t,r,n){'use strict';Object.defineProperty(n,"__esModule",{value:!0});var a=t(24),i=t(84),s=babelHelpers.interopRequireDefault(i),o=t(75),l=babelHelpers.interopRequireDefault(o),d=t(423),u=babelHelpers.interopRequireDefault(d),c=t(424),f=babelHelpers.interopRequireDefault(c),p=a.NativeModules.WebRTCModule,b=((function(e){babelHelpers.inherits(t,e);function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}})(Error),(function(e){babelHelpers.inherits(t,e);function t(e,r,n){babelHelpers.classCallCheck(this,t);var a=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return a.binaryType='arraybuffer',a.bufferedAmount=0,a.bufferedAmountLowThreshold=0,a.maxPacketLifeTime=null,a.maxRetransmits=null,a.negotiated=!1,a.ordered=!0,a.protocol='',a.readyState='connecting',a._peerConnectionId=e,a.label=r,a.id='id'in n?n.id:-1,a.ordered=!!n.ordered,a.maxPacketLifeTime=n.maxPacketLifeTime,a.maxRetransmits=n.maxRetransmits,a.protocol=n.protocol||'',a.negotiated=!!n.negotiated,a._registerEvents(),a}return babelHelpers.createClass(t,[{key:"send",value:function(e){if('string'!=typeof e){if(ArrayBuffer.isView(e)&&(e=e.buffer),!(e instanceof ArrayBuffer))throw new TypeError('Data must be either string, ArrayBuffer, or ArrayBufferView');p.dataChannelSend(this._peerConnectionId,this.id,s.default.fromByteArray(new Uint8Array(e)),'binary')}else p.dataChannelSend(this._peerConnectionId,this.id,e,'text')}},{key:"close",value:function(){'closing'!==this.readyState&&'closed'!==this.readyState&&(this.readyState='closing',p.dataChannelClose(this._peerConnectionId,this.id))}},{key:"_unregisterEvents",value:function(){this._subscriptions.forEach(function(e){return e.remove()}),this._subscriptions=[]}},{key:"_registerEvents",value:function(){var e=this;this._subscriptions=[a.DeviceEventEmitter.addListener('dataChannelStateChanged',function(t){t.peerConnectionId===e._peerConnectionId&&t.id===e.id&&(e.readyState=t.state,'open'===e.readyState?e.dispatchEvent(new f.default('open',{channel:e})):'close'===e.readyState&&(e.dispatchEvent(new f.default('close',{channel:e})),e._unregisterEvents()))}),a.DeviceEventEmitter.addListener('dataChannelReceiveMessage',function(t){if(t.peerConnectionId===e._peerConnectionId&&t.id===e.id){var r=t.data;'binary'===t.type&&(r=s.default.toByteArray(t.data).buffer),e.dispatchEvent(new u.default('message',{data:r}))}})]}}]),t})((0,l.default)(['open','message','bufferedamountlow','close','error'])));n.default=b},422); -__d(function(e,t,s,l){'use strict';Object.defineProperty(l,"__esModule",{value:!0});l.default=function e(t,s){babelHelpers.classCallCheck(this,e),this.type=t.toString(),babelHelpers.extends(this,s)}},423); -__d(function(e,t,s,l){'use strict';Object.defineProperty(l,"__esModule",{value:!0});l.default=function e(t,s){babelHelpers.classCallCheck(this,e),this.type=t.toString(),babelHelpers.extends(this,s)}},424); -__d(function(e,t,s,l){'use strict';Object.defineProperty(l,"__esModule",{value:!0});var i=(function(){function e(t){babelHelpers.classCallCheck(this,e),this.sdp=t.sdp,this.type=t.type}return babelHelpers.createClass(e,[{key:"toJSON",value:function(){return{sdp:this.sdp,type:this.type}}}]),e})();l.default=i},425); -__d(function(e,d,i,s){'use strict';Object.defineProperty(s,"__esModule",{value:!0});var t=(function(){function e(d){babelHelpers.classCallCheck(this,e),this.candidate=d.candidate,this.sdpMLineIndex=d.sdpMLineIndex,this.sdpMid=d.sdpMid}return babelHelpers.createClass(e,[{key:"toJSON",value:function(){return{candidate:this.candidate,sdpMLineIndex:this.sdpMLineIndex,sdpMid:this.sdpMid}}}]),e})();s.default=t},426); -__d(function(e,t,a,i){'use strict';Object.defineProperty(i,"__esModule",{value:!0});i.default=function e(t,a){babelHelpers.classCallCheck(this,e),this.type=t.toString(),this.candidate=null,a&&a.candidate&&(this.candidate=a.candidate)}},427); -__d(function(e,t,s,l){'use strict';Object.defineProperty(l,"__esModule",{value:!0});l.default=function e(t,s){babelHelpers.classCallCheck(this,e),this.type=t.toString(),babelHelpers.extends(this,s)}},428); -__d(function(e,i,t,o){'use strict';Object.defineProperty(o,"__esModule",{value:!0});var r=i(24),a=i(20),n=babelHelpers.interopRequireDefault(a),l=(r.NativeModules.WebRTCModule,{name:'RTCVideoView',propTypes:{mirror:n.default.bool,objectFit:n.default.oneOf(['contain','cover']),streamURL:n.default.string,zOrder:n.default.number}}),d=(0,r.requireNativeComponent)('RTCVideoView',l,{nativeOnly:{testID:!0,accessibilityComponentType:!0,renderToHardwareTextureAndroid:!0,accessibilityLabel:!0,accessibilityLiveRegion:!0,importantForAccessibility:!0,onLayout:!0,nativeID:!0}});o.default=d},429); -__d(function(e,r,n,o){'use strict';Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(e,r,n){if('function'!=typeof r)throw new TypeError('successCallback is non-nullable and required');if('function'!=typeof n)throw new TypeError('errorCallback is non-nullable and required');if('object'!=typeof e)return void n(new TypeError('constraints is not a dictionary'));for(var o=0,t=['audio','video'],i=0;i=t.length)break;l=t[f++]}else{if((f=t.next()).done)break;l=f.value}var s=l;o.addTrack(new u.default(s))}r(o)},function(e,r){var o=void 0;switch(e){case'DOMException':'function'==typeof DOMException&&(o=new DOMException(void 0,r));break;case'OverconstrainedError':'function'==typeof OverconstrainedError&&(o=new OverconstrainedError(void 0,r));break;case'TypeError':o=new TypeError(r)}o||(o=new l.default({message:r,name:e})),n(o)})};var t=r(24),i=r(417),a=babelHelpers.interopRequireDefault(i),f=r(431),l=babelHelpers.interopRequireDefault(f),s=r(420),u=babelHelpers.interopRequireDefault(s),c=t.NativeModules.WebRTCModule},430); -__d(function(e,s,t,a){'use strict';Object.defineProperty(a,"__esModule",{value:!0});a.default=function e(s){babelHelpers.classCallCheck(this,e),this.name=s.name,this.message=s.message,this.constraintName=s.constraintName}},431); -__d(function(e,r,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=i;var o=r(24),a=r(415);function i(){for(var e=this,r=arguments.length,t=Array(r),n=0;n=10&&'typ'===d[6]){for(var f=[d[4]],p=!1,c=8;c=v.length)break;m=v[h++]}else{if((h=v.next()).done)break;m=h.value}var b=m,_=l(b);if("break"===_)break}if(p){a.clear();break}u=d}}n.push(u)}while(t);return{ips:a,lines:n}})(e))}).then(function(r){var t=r.ips,n=r.lines;return Promise.all(Array.from(t.values())).then(function(){return(function(e,r,t){if(0===r.size)return e;for(var n=0;n>18&63)+d.charAt(o>>12&63)+d.charAt(o>>6&63)+d.charAt(63&o);return 2==a?(t=e.charCodeAt(i)<<8,r=e.charCodeAt(++i),c+=d.charAt((o=t+r)>>10)+d.charAt(o>>4&63)+d.charAt(o<<2&63)+'='):1==a&&(o=e.charCodeAt(i),c+=d.charAt(o>>2)+d.charAt(o<<4&63)+'=='),c},decode:function(e){var t=(e=String(e).replace(f,'')).length;t%4==0&&(t=(e=e.replace(/==?$/,'')).length),(t%4==1||/[^+a-zA-Z0-9/]/.test(e))&&h('Invalid character: the string to be decoded is not correctly encoded.');for(var r,n,o=0,a='',c=-1;++c>(-2*o&6)));return a},version:'0.1.0'};if('function'==typeof define&&'object'==typeof define.amd&&define.amd)define(function(){return s});else if(o&&!o.nodeType)if(a)a.exports=s;else for(var A in s)s.hasOwnProperty(A)&&(o[A]=s[A]);else t.base64=s})(this)},434); -__d(function(n,e,r,t){'use strict';!(function(n){function e(n,e,r){var t,a,c,b,h,l,A,p,E,H=0,v=[],d=0,S=!1,g=[],U=[],k=!1,F=!1,m=-1;if(t=(r=r||{}).encoding||"UTF8",(E=r.numRounds||1)!==parseInt(E,10)||1>E)throw Error("numRounds must a integer >= 1");if("SHA-1"===n)h=512,l=O,A=X,b=160,p=function(n){return n.slice()};else if(0===n.lastIndexOf("SHA-",0))if(l=function(e,r){return P(e,r,n)},A=function(e,r,t,a){var o,i;if("SHA-224"===n||"SHA-256"===n)o=15+(r+65>>>9<<4),i=16;else{if("SHA-384"!==n&&"SHA-512"!==n)throw Error("Unexpected error in SHA-2 implementation");o=31+(r+129>>>10<<5),i=32}for(;e.length<=o;)e.push(0);for(e[r>>>5]|=128<<24-r%32,r+=t,e[o]=4294967295&r,e[o-1]=r/4294967296|0,t=e.length,r=0;re;e+=1)r[e]=n[e].slice();return r},m=1,"SHA3-224"===n)h=1152,b=224;else if("SHA3-256"===n)h=1088,b=256;else if("SHA3-384"===n)h=832,b=384;else if("SHA3-512"===n)h=576,b=512;else if("SHAKE128"===n)h=1344,b=-1,R=31,F=!0;else{if("SHAKE256"!==n)throw Error("Chosen SHA variant is not supported");h=1088,b=-1,R=31,F=!0}A=function(n,e,r,t,a){var o,i=R,u=[],f=(r=h)>>>5,w=0,s=e>>>5;for(o=0;o=r;o+=f)t=M(n.slice(o,o+f),t),e-=r;for(n=n.slice(o),e%=r;n.length>>3)>>2]^=i<=a));)u.push(n.a),0==64*(w+=1)%r&&M(null,t);return u}}c=s(e,t,m),a=I(n),this.setHMACKey=function(e,r,o){var i;if(!0===S)throw Error("HMAC key already set");if(!0===k)throw Error("Cannot set HMAC key after calling update");if(!0===F)throw Error("SHAKE is not supported for HMAC");if(e=(r=s(r,t=(o||{}).encoding||"UTF8",m)(e)).binLen,r=r.value,o=(i=h>>>3)/4-1,ie/8){for(;r.length<=o;)r.push(0);r[o]&=4294967040}for(e=0;e<=o;e+=1)g[e]=909522486^r[e],U[e]=1549556828^r[e];a=l(g,a),H=h,S=!0},this.update=function(n){var e,r,t,o=0,i=h>>>5;for(n=(e=c(n,v,d)).binLen,r=e.value,e=n>>>5,t=0;t>>5),d=n%h,k=!0},this.getHash=function(e,r){var t,s,c,h;if(!0===S)throw Error("Cannot call getHash after setting HMAC key");if(c=w(r),!0===F){if(-1===c.shakeLen)throw Error("shakeLen must be specified in options");b=c.shakeLen}switch(e){case"HEX":t=function(n){return o(n,b,m,c)};break;case"B64":t=function(n){return i(n,b,m,c)};break;case"BYTES":t=function(n){return u(n,b,m)};break;case"ARRAYBUFFER":try{s=new ArrayBuffer(0)}catch(n){throw Error("ARRAYBUFFER not supported by this environment")}t=function(n){return f(n,b,m)};break;default:throw Error("format must be HEX, B64, BYTES, or ARRAYBUFFER")}for(h=A(v.slice(),d,H,p(a),b),s=1;s>>24-b%32),h=A(h,b,0,I(n),b);return t(h)},this.getHMAC=function(e,r){var t,s,c,E;if(!1===S)throw Error("Cannot call getHMAC without first setting HMAC key");switch(c=w(r),e){case"HEX":t=function(n){return o(n,b,m,c)};break;case"B64":t=function(n){return i(n,b,m,c)};break;case"BYTES":t=function(n){return u(n,b,m)};break;case"ARRAYBUFFER":try{t=new ArrayBuffer(0)}catch(n){throw Error("ARRAYBUFFER not supported by this environment")}t=function(n){return f(n,b,m)};break;default:throw Error("outputFormat must be HEX, B64, BYTES, or ARRAYBUFFER")}return s=A(v.slice(),d,H,p(a),b),E=l(U,I(n)),t(E=A(s,b,h,E,b))}}function a(n,e){this.a=n,this.b=e}function o(n,e,r,t){var a="";e/=8;var o,i,u;for(u=-1===r?3:0,o=0;o>>2]>>>8*(u+o%4*r),a+="0123456789abcdef".charAt(i>>>4&15)+"0123456789abcdef".charAt(15&i);return t.outputUpper?a.toUpperCase():a}function i(n,e,r,t){var a,o,i,u,f="",w=e/8;for(u=-1===r?3:0,a=0;a>>2]:0,i=a+2>>2]:0,i=(n[a>>>2]>>>8*(u+a%4*r)&255)<<16|(o>>>8*(u+(a+1)%4*r)&255)<<8|i>>>8*(u+(a+2)%4*r)&255,o=0;4>o;o+=1)f+=8*a+6*o<=e?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i>>>6*(3-o)&63):t.b64Pad;return f}function u(n,e,r){var t="";e/=8;var a,o,i;for(i=-1===r?3:0,a=0;a>>2]>>>8*(i+a%4*r)&255,t+=String.fromCharCode(o);return t}function f(n,e,r){e/=8;var t,a,o,i=new ArrayBuffer(e);for(o=new Uint8Array(i),a=-1===r?3:0,t=0;t>>2]>>>8*(a+t%4*r)&255;return i}function w(n){var e={outputUpper:!1,b64Pad:"=",shakeLen:-1};if(n=n||{},e.outputUpper=n.outputUpper||!1,!0===n.hasOwnProperty("b64Pad")&&(e.b64Pad=n.b64Pad),!0===n.hasOwnProperty("shakeLen")){if(0!=n.shakeLen%8)throw Error("shakeLen must be a multiple of 8");e.shakeLen=n.shakeLen}if("boolean"!=typeof e.outputUpper)throw Error("Invalid outputUpper formatting option");if("string"!=typeof e.b64Pad)throw Error("Invalid b64Pad formatting option");return e}function s(n,e,r){switch(e){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(n){case"HEX":n=function(n,e,t){var a,o,i,u,f,w,s=n.length;if(0!=s%2)throw Error("String of HEX type must be in byte increments");for(e=e||[0],f=(t=t||0)>>>3,w=-1===r?3:0,a=0;a>>1)+f)>>>2;e.length<=i;)e.push(0);e[i]|=o<<8*(w+u%4*r)}return{value:e,binLen:4*s+t}};break;case"TEXT":n=function(n,t,a){var o,i,u,f,w,s,c,b,h=0;if(t=t||[0],w=(a=a||0)>>>3,"UTF8"===e)for(b=-1===r?3:0,u=0;u(o=n.charCodeAt(u))?i.push(o):2048>o?(i.push(192|o>>>6),i.push(128|63&o)):55296>o||57344<=o?i.push(224|o>>>12,128|o>>>6&63,128|63&o):(u+=1,o=65536+((1023&o)<<10|1023&n.charCodeAt(u)),i.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),f=0;f>>2;t.length<=s;)t.push(0);t[s]|=i[f]<<8*(b+c%4*r),h+=1}else if("UTF16BE"===e||"UTF16LE"===e)for(b=-1===r?2:0,i="UTF16LE"===e&&1!==r||"UTF16LE"!==e&&1===r,u=0;u>>8),s=(c=h+w)>>>2;t.length<=s;)t.push(0);t[s]|=o<<8*(b+c%4*r),h+=2}return{value:t,binLen:8*h+a}};break;case"B64":n=function(n,e,t){var a,o,i,u,f,w,s,c,b=0;if(-1===n.search(/^[a-zA-Z0-9=+\/]+$/))throw Error("Invalid character in base-64 string");if(o=n.indexOf("="),n=n.replace(/\=/g,""),-1!==o&&o0&&void 0!==arguments[0]?arguments[0]:{},e=[];for(var n in t)try{e.push(n+"="+encodeURIComponent(JSON.stringify(t[n])))}catch(t){console.warn("Error encoding "+n+": "+t)}return e}function g(t){var e={toString:v},n=void 0,r=void 0;if(t=t.replace(/\s/g,''),(r=(n=new RegExp("^"+s,'gi')).exec(t))&&(e.protocol=r[1].toLowerCase(),t=t.substring(n.lastIndex)),r=(n=new RegExp("^"+a,'gi')).exec(t)){var i=r[1].substring(2);t=t.substring(n.lastIndex);var h=i.indexOf('@');-1!==h&&(i=i.substring(h+1)),e.host=i;var c=i.lastIndexOf(':');-1!==c&&(e.port=i.substring(c+1),i=i.substring(0,c)),e.hostname=i}var g=void 0;if((r=(n=new RegExp("^"+o,'gi')).exec(t))&&(g=r[1],t=t.substring(n.lastIndex)),g?g.startsWith('/')||(g="/"+g):g='/',e.pathname=g,t.startsWith('?')){var u=t.indexOf('#',1);-1===u&&(u=t.length),e.search=t.substring(0,u),t=t.substring(u)}else e.search='';return e.hash=t.startsWith('#')?t:'',e}function v(t){var e=t||this,n=e.hash,r=e.host,a=e.pathname,o=e.protocol,s=e.search,i='';return o&&(i+=o),r&&(i+="//"+r),i+=a||'/',s&&(i+=s),n&&(i+=n),i}function u(t){var e=g(i(t.url||''));if(!e.protocol){var n=t.protocol||t.scheme;n&&(n.endsWith(':')||(n+=':'),e.protocol=n)}var r=e.pathname;if(!e.host){var a=t.domain||t.host||t.hostname;if(a){var o=g(i("org.jitsi.meet://"+a)),s=o.host,h=o.hostname,v=o.pathname,u=o.port;s&&(e.host=s,e.hostname=h,e.port=u),'/'===r&&'/'!==v&&(r=v)}}var f=t.roomName||t.room;!f||!e.pathname.endsWith('/')&&e.pathname.endsWith("/"+f)||(r.endsWith('/')||(r+='/'),r+=f),e.pathname=r;var p=t.jwt;if(p){var d=e.search;-1===d.indexOf('?jwt=')&&-1===d.indexOf('&jwt=')&&(d.startsWith('?')||(d="?"+d),1===d.length||(d+='&'),d+="jwt="+p,e.search=d)}for(var l=e.hash,x=['config','interfaceConfig'],m=0;m0&&void 0!==arguments[0]&&arguments[0],n=arguments[1];!(function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this);for(var r=(function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t})(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n)),i=o.a[r.getName()]||[],c=void 0,u=0;u0&&(e.splice(l-1,2),l-=2)}e=e.join("/")}if((h||m)&&f){for(l=(n=e.split("/")).length;l>0;l-=1){if(r=n.slice(0,l).join("/"),h)for(d=h.length;d>0;d-=1)if((i=f[h.slice(0,d).join("/")])&&(i=i[r])){o=i,s=l;break}if(o)break;!c&&m&&m[r]&&(c=m[r],u=l)}!o&&c&&(o=c,s=u),o&&(n.splice(0,s,o),e=n.join("/"))}return e}function s(t,n){return function(){var r=_.call(arguments,0);return"string"!=typeof r[0]&&1===r.length&&r.push(null),h.apply(e,r.concat([t,n]))}}function c(e){return function(t){v[e]=t}}function u(n){if(t(g,n)){var r=g[n];delete g[n],b[n]=!0,p.apply(e,r)}if(!t(v,n)&&!t(b,n))throw new Error("No "+n);return v[n]}function l(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function d(e){return e?l(e):[]}var p,h,f,m,v={},g={},y={},b={},S=Object.prototype.hasOwnProperty,_=[].slice,T=/\.js$/;f=function(e,t){var n,r=l(e),i=r[0],o=t[1];e=r[1],i&&(n=u(i=a(i,o))),i?e=n&&n.normalize?n.normalize(e,(s=o,function(e){return a(e,s)})):a(e,o):(i=(r=l(e=a(e,o)))[0],e=r[1],i&&(n=u(i)));var s;return{f:i?i+"!"+e:e,n:e,pr:i,p:n}},m={require:function(e){return s(e)},exports:function(e){var t=v[e];return void 0!==t?t:v[e]={}},module:function(e){return{id:e,uri:"",exports:v[e],config:(t=e,function(){return y&&y.config&&y.config[t]||{}})};var t}},p=function(n,r,i,a){var l,p,h,y,S,_,T,C=[],E=void 0===i?"undefined":o(i);if(_=d(a=a||n),"undefined"===E||"function"===E){for(r=!r.length&&i.length?["require","exports","module"]:r,S=0;S>>0;if("function"!=typeof e)throw new TypeError(e+" is not a function");for(arguments.length>1&&(n=t),r=0;r>2,a=(3&n)<<4|(r=e.charCodeAt(l++))>>4,s=(15&r)<<2|(i=e.charCodeAt(l++))>>6,c=63&i,isNaN(r)?(a=(3&n)<<4,s=c=64):isNaN(i)&&(c=64),u=u+t.charAt(o)+t.charAt(a)+t.charAt(s)+t.charAt(c)}while(l>4,r=(15&o)<<4|(a=t.indexOf(e.charAt(u++)))>>2,i=(3&a)<<6|(s=t.indexOf(e.charAt(u++))),c+=String.fromCharCode(n),64!==a&&(c+=String.fromCharCode(r)),64!==s&&(c+=String.fromCharCode(i))}while(u>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;var i,o,a,s,c,u,l,d,p=new Array(80),h=1732584193,f=-271733879,m=-1732584194,v=271733878,g=-1009589776;for(i=0;i16&&(r=e(r,8*t.length));for(var o=new Array(16),a=new Array(16),s=0;s<16;s++)o[s]=909522486^r[s],a[s]=1549556828^r[s];var c=e(o.concat(i(n)),512+8*n.length);return e(a.concat(c),672)}function n(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function r(e,t){return e<>>32-t}function i(e){for(var t=[],n=0;n<8*e.length;n+=8)t[n>>5]|=(255&e.charCodeAt(n/8))<<24-n%32;return t}function o(e){for(var t="",n=0;n<32*e.length;n+=8)t+=String.fromCharCode(e[n>>5]>>>24-n%32&255);return t}function a(e){for(var t,n,r="",i=0;i<4*e.length;i+=3)for(t=(e[i>>2]>>8*(3-i%4)&255)<<16|(e[i+1>>2]>>8*(3-(i+1)%4)&255)<<8|e[i+2>>2]>>8*(3-(i+2)%4)&255,n=0;n<4;n++)8*i+6*n>32*e.length?r+="=":r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t>>6*(3-n)&63);return r}return{b64_hmac_sha1:function(e,n){return a(t(e,n))},b64_sha1:function(t){return a(e(i(t),8*t.length))},binb2str:o,core_hmac_sha1:t,str_hmac_sha1:function(e,n){return o(t(e,n))},str_sha1:function(t){return o(e(i(t),8*t.length))}}},"function"==typeof i&&i.amd?i("strophe-sha1",[],function(){return a()}):"object"===o(t)?e.exports=a():this.SHA1=a();var a;s=function(){var e=function(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n},t=function(e){for(var t=[],n=0;n<8*e.length;n+=8)t[n>>5]|=(255&e.charCodeAt(n/8))<>>32-c,r);var s,c},r=function(e,t,r,i,o,a,s){return n(t&r|~t&i,e,t,o,a,s)},i=(function(e){function t(t,n,r,i,o,a,s){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t})(function(e,t,r,i,o,a,s){return n(t&i|r&~i,e,t,o,a,s)}),o=function(e,t,r,i,o,a,s){return n(t^r^i,e,t,o,a,s)},a=function(e,t,r,i,o,a,s){return n(r^(t|~i),e,t,o,a,s)},s=function(t,n){t[n>>5]|=128<>>9<<4)]=n;for(var s,c,u,l,d=1732584193,p=-271733879,h=-1732584194,f=271733878,m=0;m>2]>>n%4*8+4&15)+"0123456789abcdef".charAt(e[n>>2]>>n%4*8&15);return t})(s(t(e),8*e.length))},hash:function(e){return(function(e){for(var t="",n=0;n<32*e.length;n+=8)t+=String.fromCharCode(e[n>>5]>>>n%32&255);return t})(s(t(e),8*e.length))}}},"function"==typeof i&&i.amd?i("strophe-md5",[],function(){return s()}):"object"===o(t)?e.exports=s():this.MD5=s();var s;c=function(){return{utf16to8:function(e){var t,n,r="",i=e.length;for(t=0;t=0&&n<=127?r+=e.charAt(t):n>2047?(r+=String.fromCharCode(224|n>>12&15),r+=String.fromCharCode(128|n>>6&63),r+=String.fromCharCode(128|n>>0&63)):(r+=String.fromCharCode(192|n>>6&31),r+=String.fromCharCode(128|n>>0&63));return r},addCookies:function(e){var t,n,r,i,a,s,c;for(t in e||{})a="",s="",c="",r="object"===(void 0===(n=e[t])?"undefined":o(n)),i=escape(unescape(r?n.value:n)),r&&(a=n.expires?";expires="+n.expires:"",s=n.domain?";domain="+n.domain:"",c=n.path?";path="+n.path:""),document.cookie=t+"="+i+a+s+c}}},"function"==typeof i&&i.amd?i("strophe-utils",[],function(){return c()}):"object"===o(t)?e.exports=c():this.stropheUtils=c();var c;return(function(n,a){if("function"==typeof i&&i.amd)i("strophe-core",["strophe-sha1","strophe-md5","strophe-utils"],function(){return a.apply(this,arguments)});else if("object"===o(t))e.exports=a(r("./sha1"),r("./md5"),r("./utils"));else{var s=a(n.SHA1,n.MD5,n.stropheUtils);n.Strophe=s.Strophe,n.$build=s.$build,n.$iq=s.$iq,n.$msg=s.$msg,n.$pres=s.$pres,n.SHA1=s.SHA1,n.MD5=s.MD5,n.b64_hmac_sha1=s.SHA1.b64_hmac_sha1,n.b64_sha1=s.SHA1.b64_sha1,n.str_hmac_sha1=s.SHA1.str_hmac_sha1,n.str_sha1=s.SHA1.str_sha1}})(this,function(e,t,n){function r(e,t){return new s.Builder(e,t)}function i(e){return new s.Builder("iq",e)}function a(e){return new s.Builder("presence",e)}var s;return(s={VERSION:"1.2.14-1",NS:{HTTPBIND:"http://jabber.org/protocol/httpbind",BOSH:"urn:xmpp:xbosh",CLIENT:"jabber:client",AUTH:"jabber:iq:auth",ROSTER:"jabber:iq:roster",PROFILE:"jabber:iq:profile",DISCO_INFO:"http://jabber.org/protocol/disco#info",DISCO_ITEMS:"http://jabber.org/protocol/disco#items",MUC:"http://jabber.org/protocol/muc",SASL:"urn:ietf:params:xml:ns:xmpp-sasl",STREAM:"http://etherx.jabber.org/streams",FRAMING:"urn:ietf:params:xml:ns:xmpp-framing",BIND:"urn:ietf:params:xml:ns:xmpp-bind",SESSION:"urn:ietf:params:xml:ns:xmpp-session",VERSION:"jabber:iq:version",STANZAS:"urn:ietf:params:xml:ns:xmpp-stanzas",XHTML_IM:"http://jabber.org/protocol/xhtml-im",XHTML:"http://www.w3.org/1999/xhtml"},XHTML:{tags:["a","blockquote","br","cite","em","img","li","ol","p","span","strong","ul","body"],attributes:{a:["href"],blockquote:["style"],br:[],cite:["style"],em:[],img:["src","alt","style","height","width"],li:["style"],ol:["style"],p:["style"],span:["style"],strong:[],ul:["style"],body:[]},css:["background-color","color","font-family","font-size","font-style","font-weight","margin-left","margin-right","text-align","text-decoration"],validTag:function(e){for(var t=0;t0)for(var n=0;n/g,">")).replace(/'/g,"'")).replace(/"/g,""")},xmlunescape:function(e){return(e=(e=(e=(e=e.replace(/\&/g,"&")).replace(/</g,"<")).replace(/>/g,">")).replace(/'/g,"'")).replace(/"/g,'"')},xmlTextNode:function(e){return s.xmlGenerator().createTextNode(e)},xmlHtmlNode:function(e){var t;return DOMParser?t=(new DOMParser).parseFromString(e,"text/xml"):((t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e)),t},getText:function(e){if(!e)return null;var t="";0===e.childNodes.length&&e.nodeType===s.ElementType.TEXT&&(t+=e.nodeValue);for(var n=0;n0&&(c=u.join("; "),n.setAttribute(a,c))}else n.setAttribute(a,c);for(t=0;t/g,"\\3e").replace(/@/g,"\\40")},unescapeNode:function(e){return"string"!=typeof e?e:e.replace(/\\20/g," ").replace(/\\22/g,'"').replace(/\\26/g,"&").replace(/\\27/g,"'").replace(/\\2f/g,"/").replace(/\\3a/g,":").replace(/\\3c/g,"<").replace(/\\3e/g,">").replace(/\\40/g,"@").replace(/\\5c/g,"\\")},getNodeFromJid:function(e){return e.indexOf("@")<0?null:e.split("@")[0]},getDomainFromJid:function(e){var t=s.getBareJidFromJid(e);if(t.indexOf("@")<0)return t;var n=t.split("@");return n.splice(0,1),n.join("@")},getResourceFromJid:function(e){var t=e.split("/");return t.length<2?null:(t.splice(0,1),t.join("/"))},getBareJidFromJid:function(e){return e?e.split("/")[0]:null},_handleError:function(e){void 0!==e.stack&&s.fatal(e.stack),e.sourceURL?s.fatal("error: "+this.handler+" "+e.sourceURL+":"+e.line+" - "+e.name+": "+e.message):e.fileName?s.fatal("error: "+this.handler+" "+e.fileName+":"+e.lineNumber+" - "+e.name+": "+e.message):s.fatal("error: "+e.message)},log:function(e,t){},debug:function(e){this.log(this.LogLevel.DEBUG,e)},info:function(e){this.log(this.LogLevel.INFO,e)},warn:function(e){this.log(this.LogLevel.WARN,e)},error:function(e){this.log(this.LogLevel.ERROR,e)},fatal:function(e){this.log(this.LogLevel.FATAL,e)},serialize:function(e){var t;if(!e)return null;"function"==typeof e.tree&&(e=e.tree());var n,r,i=e.nodeName;for(e.getAttribute("_realname")&&(i=e.getAttribute("_realname")),t="<"+i,n=0;n0){for(t+=">",n=0;n"}t+=""}else t+="/>";return t},_requestId:0,_connectionPlugins:{},addConnectionPlugin:function(e,t){s._connectionPlugins[e]=t}}).Builder=function(e,t){"presence"!==e&&"message"!==e&&"iq"!==e||(t&&!t.xmlns?t.xmlns=s.NS.CLIENT:t||(t={xmlns:s.NS.CLIENT})),this.nodeTree=s.xmlElement(e,t),this.node=this.nodeTree},s.Builder.prototype={tree:function(){return this.nodeTree},toString:function(){return s.serialize(this.nodeTree)},up:function(){return this.node=this.node.parentNode,this},root:function(){return this.node=this.nodeTree,this},attrs:function(e){for(var t in e)e.hasOwnProperty(t)&&(void 0===e[t]?this.node.removeAttribute(t):this.node.setAttribute(t,e[t]));return this},c:function(e,t,n){var r=s.xmlElement(e,t,n);return this.node.appendChild(r),"string"!=typeof n&&"number"!=typeof n&&(this.node=r),this},cnode:function(e){var t,n=s.xmlGenerator();try{t=void 0!==n.importNode}catch(e){t=!1}var r=t?n.importNode(e,!0):s.copyElement(e);return this.node.appendChild(r),this.node=r,this},t:function(e){var t=s.xmlTextNode(e);return this.node.appendChild(t),this},h:function(e){var t=document.createElement("body");t.innerHTML=e;for(var n=s.createHtml(t);n.childNodes.length>0;)this.node.appendChild(n.childNodes[0]);return this}},s.Handler=function(e,t,n,r,i,o,a){this.handler=e,this.ns=t,this.name=n,this.type=r,this.id=i,this.options=a||{matchBareFromJid:!1,ignoreNamespaceFragment:!1},this.options.matchBare&&(s.warn('The "matchBare" option is deprecated, use "matchBareFromJid" instead.'),this.options.matchBareFromJid=this.options.matchBare,delete this.options.matchBare),this.options.matchBareFromJid?this.from=o?s.getBareJidFromJid(o):null:this.from=o,this.user=!0},s.Handler.prototype={getNamespace:function(e){var t=e.getAttribute("xmlns");return t&&this.options.ignoreNamespaceFragment&&(t=t.split("#")[0]),t},namespaceMatch:function(e){var t=!1;if(!this.ns)return!0;var n=this;return s.forEachChild(e,null,function(e){n.getNamespace(e)===n.ns&&(t=!0)}),t=t||this.getNamespace(e)===this.ns},isMatch:function(e){var t=e.getAttribute("from");this.options.matchBareFromJid&&(t=s.getBareJidFromJid(t));var n=e.getAttribute("type");return!(!this.namespaceMatch(e)||this.name&&!s.isTagEqual(e,this.name)||this.type&&(Array.isArray(this.type)?-1===this.type.indexOf(n):n!==this.type)||this.id&&e.getAttribute("id")!==this.id||this.from&&t!==this.from)},run:function(e){var t=null;try{t=this.handler(e)}catch(e){throw s._handleError(e),e}return t},toString:function(){return"{Handler: "+this.handler+"("+this.name+","+this.id+","+this.ns+")}"}},s.TimedHandler=function(e,t){this.period=e,this.handler=t,this.lastCalled=(new Date).getTime(),this.user=!0},s.TimedHandler.prototype={run:function(){return this.lastCalled=(new Date).getTime(),this.handler()},reset:function(){this.lastCalled=(new Date).getTime()},toString:function(){return"{TimedHandler: "+this.handler+"("+this.period+")}"}},s.Connection=function(e,t){this.service=e,this.options=t||{};var r=this.options.protocol||"";0===e.indexOf("ws:")||0===e.indexOf("wss:")||0===r.indexOf("ws")?this._proto=new s.Websocket(this):this._proto=new s.Bosh(this),this.jid="",this.domain=null,this.features=null,this._sasl_data={},this.do_session=!1,this.do_bind=!1,this.timedHandlers=[],this.handlers=[],this.removeTimeds=[],this.removeHandlers=[],this.addTimeds=[],this.addHandlers=[],this.protocolErrorHandlers={HTTP:{},websocket:{}},this._idleTimeout=null,this._disconnectTimeout=null,this.authenticated=!1,this.connected=!1,this.disconnecting=!1,this.do_authentication=!0,this.paused=!1,this.restored=!1,this._data=[],this._uniqueId=0,this._sasl_success_handler=null,this._sasl_failure_handler=null,this._sasl_challenge_handler=null,this.maxRetries=5,this._idleTimeout=setTimeout(function(){this._onIdle()}.bind(this),100),n.addCookies(this.options.cookies),this.registerSASLMechanisms(this.options.mechanisms);for(var i in s._connectionPlugins)if(s._connectionPlugins.hasOwnProperty(i)){var o=s._connectionPlugins[i],a=function(){};a.prototype=o,this[i]=new a,this[i].init(this)}},s.Connection.prototype={reset:function(){this._proto._reset(),this.do_session=!1,this.do_bind=!1,this.timedHandlers=[],this.handlers=[],this.removeTimeds=[],this.removeHandlers=[],this.addTimeds=[],this.addHandlers=[],this.authenticated=!1,this.connected=!1,this.disconnecting=!1,this.restored=!1,this._data=[],this._requests=[],this._uniqueId=0},pause:function(){this.paused=!0},resume:function(){this.paused=!1},getUniqueId:function(e){var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)});return"string"==typeof e||"number"==typeof e?t+":"+e:t+""},addProtocolErrorHandler:function(e,t,n){this.protocolErrorHandlers[e][t]=n},connect:function(e,t,n,r,i,o,a){this.jid=e,this.authzid=s.getBareJidFromJid(this.jid),this.authcid=a||s.getNodeFromJid(this.jid),this.pass=t,this.servtype="xmpp",this.connect_callback=n,this.disconnecting=!1,this.connected=!1,this.authenticated=!1,this.restored=!1,this.domain=s.getDomainFromJid(this.jid),this._changeConnectStatus(s.Status.CONNECTING,null),this._proto._connect(r,i,o)},attach:function(e,t,n,r,i,o,a){if(!(this._proto instanceof s.Bosh))throw{name:"StropheSessionError",message:'The "attach" method can only be used with a BOSH connection.'};this._proto._attach(e,t,n,r,i,o,a)},restore:function(e,t,n,r,i){if(!this._sessionCachingSupported())throw{name:"StropheSessionError",message:'The "restore" method can only be used with a BOSH connection.'};this._proto._restore(e,t,n,r,i)},_sessionCachingSupported:function(){if(this._proto instanceof s.Bosh){if(!JSON)return!1;try{sessionStorage.setItem("_strophe_","_strophe_"),sessionStorage.removeItem("_strophe_")}catch(e){return!1}return!0}return!1},xmlInput:function(e){},xmlOutput:function(e){},rawInput:function(e){},rawOutput:function(e){},nextValidRid:function(e){},send:function(e){if(null!==e){if("function"==typeof e.sort)for(var t=0;t=0&&this.addHandlers.splice(t,1)},registerSASLMechanisms:function(e){this.mechanisms={},(e=e||[s.SASLAnonymous,s.SASLExternal,s.SASLMD5,s.SASLOAuthBearer,s.SASLXOAuth2,s.SASLPlain,s.SASLSHA1]).forEach(this.registerSASLMechanism.bind(this))},registerSASLMechanism:function(e){this.mechanisms[e.prototype.name]=e},disconnect:function(e){if(this._changeConnectStatus(s.Status.DISCONNECTING,e),s.info("Disconnect was called because: "+e),this.connected){var t=!1;this.disconnecting=!0,this.authenticated&&(t=a({xmlns:s.NS.CLIENT,type:"unavailable"})),this._disconnectTimeout=this._addSysTimedHandler(3e3,this._onDisconnectTimeout.bind(this)),this._proto._disconnect(t)}else s.info("Disconnect was called before Strophe connected to the server"),this._proto._abortAllRequests(),this._doDisconnect()},_changeConnectStatus:function(e,t,n){for(var r in s._connectionPlugins)if(s._connectionPlugins.hasOwnProperty(r)){var i=this[r];if(i.statusChanged)try{i.statusChanged(e,t)}catch(e){s.error(r+" plugin caused an exception changing status: "+e)}}if(this.connect_callback)try{this.connect_callback(e,t,n)}catch(e){s._handleError(e),s.error("User connection callback caused an exception: "+e)}},_doDisconnect:function(e){"number"==typeof this._idleTimeout&&clearTimeout(this._idleTimeout),null!==this._disconnectTimeout&&(this.deleteTimedHandler(this._disconnectTimeout),this._disconnectTimeout=null),s.info("_doDisconnect was called"),this._proto._doDisconnect(),this.authenticated=!1,this.disconnecting=!1,this.restored=!1,this.handlers=[],this.timedHandlers=[],this.removeTimeds=[],this.removeHandlers=[],this.addTimeds=[],this.addHandlers=[],this._changeConnectStatus(s.Status.DISCONNECTED,e),this.connected=!1},_dataRecv:function(e,t){s.info("_dataRecv called");var n=this._proto._reqToData(e);if(null!==n){this.xmlInput!==s.Connection.prototype.xmlInput&&(n.nodeName===this._proto.strip&&n.childNodes.length?this.xmlInput(n.childNodes[0]):this.xmlInput(n)),this.rawInput!==s.Connection.prototype.rawInput&&(t?this.rawInput(t):this.rawInput(s.serialize(n)));for(var r,i;this.removeHandlers.length>0;)i=this.removeHandlers.pop(),(r=this.handlers.indexOf(i))>=0&&this.handlers.splice(r,1);for(;this.addHandlers.length>0;)this.handlers.push(this.addHandlers.pop());if(this.disconnecting&&this._proto._emptyQueue())this._doDisconnect();else{var o,a,c=n.getAttribute("type");if(null!==c&&"terminate"===c){if(this.disconnecting)return;return o=n.getAttribute("condition"),a=n.getElementsByTagName("conflict"),null!==o?("remote-stream-error"===o&&a.length>0&&(o="conflict"),this._changeConnectStatus(s.Status.CONNFAIL,o)):this._changeConnectStatus(s.Status.CONNFAIL,s.ErrorCondition.UNKOWN_REASON),void this._doDisconnect(o)}var u=this;s.forEachChild(n,null,function(e){var t,n;for(n=u.handlers,u.handlers=[],t=0;t0:r.getElementsByTagName("stream:features").length>0||r.getElementsByTagName("features").length>0){var i,o,a=[],c=r.getElementsByTagName("mechanism");if(c.length>0)for(i=0;ie[r].prototype.priority&&(r=n);r!==t&&(i=e[t],e[t]=e[r],e[r]=i)}return e},_attemptSASLAuth:function(e){e=this.sortMechanismsByPriority(e||[]);var t=0,n=!1;for(t=0;t0&&(t=s.ErrorCondition.CONFLICT),this._changeConnectStatus(s.Status.AUTHFAIL,t,e),!1}var n,r=e.getElementsByTagName("bind");if(!(r.length>0))return s.info("SASL binding failed."),this._changeConnectStatus(s.Status.AUTHFAIL,null,e),!1;(n=r[0].getElementsByTagName("jid")).length>0&&(this.jid=s.getText(n[0]),this.do_session?(this._addSysHandler(this._sasl_session_cb.bind(this),null,null,null,"_session_auth_2"),this.send(i({type:"set",id:"_session_auth_2"}).c("session",{xmlns:s.NS.SESSION}).tree())):(this.authenticated=!0,this._changeConnectStatus(s.Status.CONNECTED,null)))},_sasl_session_cb:function(e){if("result"===e.getAttribute("type"))this.authenticated=!0,this._changeConnectStatus(s.Status.CONNECTED,null);else if("error"===e.getAttribute("type"))return s.info("Session creation failed."),this._changeConnectStatus(s.Status.AUTHFAIL,null,e),!1;return!1},_sasl_failure_cb:function(e){return this._sasl_success_handler&&(this.deleteHandler(this._sasl_success_handler),this._sasl_success_handler=null),this._sasl_challenge_handler&&(this.deleteHandler(this._sasl_challenge_handler),this._sasl_challenge_handler=null),this._sasl_mechanism&&this._sasl_mechanism.onFailure(),this._changeConnectStatus(s.Status.AUTHFAIL,null,e),!1},_auth2_cb:function(e){return"result"===e.getAttribute("type")?(this.authenticated=!0,this._changeConnectStatus(s.Status.CONNECTED,null)):"error"===e.getAttribute("type")&&(this._changeConnectStatus(s.Status.AUTHFAIL,null,e),this.disconnect("authentication failed")),!1},_addSysTimedHandler:function(e,t){var n=new s.TimedHandler(e,t);return n.user=!1,this.addTimeds.push(n),n},_addSysHandler:function(e,t,n,r,i){var o=new s.Handler(e,t,n,r,i);return o.user=!1,this.addHandlers.push(o),o},_onDisconnectTimeout:function(){return s.info("_onDisconnectTimeout was called"),this._changeConnectStatus(s.Status.CONNTIMEOUT,null),this._proto._onDisconnectTimeout(),this._doDisconnect(),!1},_onIdle:function(){for(var e,t,n;this.addTimeds.length>0;)this.timedHandlers.push(this.addTimeds.pop());for(;this.removeTimeds.length>0;)t=this.removeTimeds.pop(),(e=this.timedHandlers.indexOf(t))>=0&&this.timedHandlers.splice(e,1);var r=(new Date).getTime();for(n=[],e=0;e0&&(n="conflict"),this._conn._changeConnectStatus(e.Status.CONNFAIL,n)):this._conn._changeConnectStatus(e.Status.CONNFAIL,"unknown"),this._conn._doDisconnect(n),e.Status.CONNFAIL;this.sid||(this.sid=t.getAttribute("sid"));var o=t.getAttribute("requests");o&&(this.window=parseInt(o,10));var a=t.getAttribute("hold");a&&(this.hold=parseInt(a,10));var s=t.getAttribute("wait");s&&(this.wait=parseInt(s,10));var c=t.getAttribute("inactivity");c&&(this.inactivity=parseInt(c,10))},_disconnect:function(e){this._sendTerminate(e)},_doDisconnect:function(){this.sid=null,this.rid=Math.floor(4294967295*Math.random()),this._conn._sessionCachingSupported()&&window.sessionStorage.removeItem("strophe-bosh-session"),this._conn.nextValidRid(this.rid)},_emptyQueue:function(){return 0===this._requests.length},_callProtocolErrorHandlers:function(e){var t,n=this._getRequestStatus(e);(t=this._conn.protocolErrorHandlers.HTTP[n])&&t.call(this,n)},_hitError:function(t){this.errors++,e.warn("request errored, status: "+t+", number of errors: "+this.errors),this.errors>4&&this._conn._onDisconnectTimeout()},_onDisconnectTimeout:function(){this._abortAllRequests()},_abortAllRequests:function(){for(var e;this._requests.length>0;)(e=this._requests.pop()).abort=!0,e.xhr.abort(),e.xhr.onreadystatechange=function(){}},_onIdle:function(){var t=this._conn._data;if(this._conn.authenticated&&0===this._requests.length&&0===t.length&&!this._conn.disconnecting&&(e.info("no requests during idle cycle, sending blank request"),t.push(null)),!this._conn.paused){if(this._requests.length<2&&t.length>0){for(var n=this._buildBody(),r=0;r0){var i=this._requests[0].age();null!==this._requests[0].dead&&this._requests[0].timeDead()>Math.floor(e.SECONDARY_TIMEOUT*this.wait)&&this._throttledRequestHandler(),i>Math.floor(e.TIMEOUT*this.wait)&&(e.warn("Request "+this._requests[0].id+" timed out, over "+Math.floor(e.TIMEOUT*this.wait)+" seconds since last activity"),this._throttledRequestHandler())}}},_getRequestStatus:function(t,n){var r;if(4===t.xhr.readyState)try{r=t.xhr.status}catch(t){e.error("Caught an error while retrieving a request's status, reqStatus: "+r)}return void 0===r&&(r="number"==typeof n?n:0),r},_onRequestStateChange:function(t,n){if(e.debug("request id "+n.id+"."+n.sends+" state changed to "+n.xhr.readyState),n.abort)n.abort=!1;else if(4===n.xhr.readyState){var r=this._getRequestStatus(n);if(this.lastResponseHeaders=n.xhr.getAllResponseHeaders(),this.disconnecting&&r>=400)return this._hitError(r),void this._callProtocolErrorHandlers(n);var i=r>0&&r<500,o=n.sends>this._conn.maxRetries;if((i||o)&&(this._removeRequest(n),e.debug("request id "+n.id+" should now be removed")),200===r){var a=this._requests[0]===n;(this._requests[1]===n||a&&this._requests.length>0&&this._requests[0].age()>Math.floor(e.SECONDARY_TIMEOUT*this.wait))&&this._restartRequest(0),this._conn.nextValidRid(Number(n.rid)+1),e.debug("request id "+n.id+"."+n.sends+" got 200"),t(n),this.errors=0}else 0===r||r>=400&&r<600||r>=12e3?(e.error("request id "+n.id+"."+n.sends+" error "+r+" happened"),this._hitError(r),this._callProtocolErrorHandlers(n),r>=400&&r<500&&(this._conn._changeConnectStatus(e.Status.DISCONNECTING,null),this._conn._doDisconnect())):e.error("request id "+n.id+"."+n.sends+" error "+r+" happened");i||o?o&&!this._conn.connected&&this._conn._changeConnectStatus(e.Status.CONNFAIL,"giving-up"):this._throttledRequestHandler()}},_processRequest:function(t){var n=this,r=this._requests[t],i=this._getRequestStatus(r,-1);if(r.sends>this._conn.maxRetries)this._conn._onDisconnectTimeout();else{var o=r.age(),a=!isNaN(o)&&o>Math.floor(e.TIMEOUT*this.wait),s=null!==r.dead&&r.timeDead()>Math.floor(e.SECONDARY_TIMEOUT*this.wait),c=4===r.xhr.readyState&&(i<1||i>=500);if((a||s||c)&&(s&&e.error("Request "+this._requests[t].id+" timed out (secondary), restarting"),r.abort=!0,r.xhr.abort(),r.xhr.onreadystatechange=function(){},this._requests[t]=new e.Request(r.xmlData,r.origFunc,r.rid,r.sends),r=this._requests[t]),0===r.xhr.readyState){e.debug("request id "+r.id+"."+r.sends+" posting");try{var u=this._conn.options.contentType||"text/xml; charset=utf-8";r.xhr.open("POST",this._conn.service,!this._conn.options.sync),void 0!==r.xhr.setRequestHeader&&r.xhr.setRequestHeader("Content-Type",u),this._conn.options.withCredentials&&(r.xhr.withCredentials=!0)}catch(t){return e.error("XHR open failed: "+t.toString()),this._conn.connected||this._conn._changeConnectStatus(e.Status.CONNFAIL,"bad-service"),void this._conn.disconnect()}var l=function(){if(r.date=new Date,n._conn.options.customHeaders){var e=n._conn.options.customHeaders;for(var t in e)e.hasOwnProperty(t)&&r.xhr.setRequestHeader(t,e[t])}r.xhr.send(r.data)};if(r.sends>1){var d=1e3*Math.min(Math.floor(e.TIMEOUT*this.wait),Math.pow(r.sends,3));setTimeout(function(){l()},d)}else l();r.sends++,this._conn.xmlOutput!==e.Connection.prototype.xmlOutput&&(r.xmlData.nodeName===this.strip&&r.xmlData.childNodes.length?this._conn.xmlOutput(r.xmlData.childNodes[0]):this._conn.xmlOutput(r.xmlData)),this._conn.rawOutput!==e.Connection.prototype.rawOutput&&this._conn.rawOutput(r.data)}else e.debug("_processRequest: "+(0===t?"first":"second")+" request has readyState of "+r.xhr.readyState)}},_removeRequest:function(t){e.debug("removing request");var n;for(n=this._requests.length-1;n>=0;n--)t===this._requests[n]&&this._requests.splice(n,1);t.xhr.onreadystatechange=function(){},this._throttledRequestHandler()},_restartRequest:function(e){var t=this._requests[e];null===t.dead&&(t.dead=new Date),this._processRequest(e)},_reqToData:function(e){try{return e.getResponse()}catch(e){if("parsererror"!==e)throw e;this._conn.disconnect("strophe-parsererror")}},_sendTerminate:function(t){e.info("_sendTerminate was called");var n=this._buildBody().attrs({type:"terminate"});t&&n.cnode(t.tree());var r=new e.Request(n.tree(),this._onRequestStateChange.bind(this,this._conn._dataRecv.bind(this._conn)),n.tree().getAttribute("rid"));this._requests.push(r),this._throttledRequestHandler()},_send:function(){clearTimeout(this._conn._idleTimeout),this._throttledRequestHandler(),this._conn._idleTimeout=setTimeout(function(){this._onIdle()}.bind(this._conn),100)},_sendRestart:function(){this._throttledRequestHandler(),clearTimeout(this._conn._idleTimeout)},_throttledRequestHandler:function(){this._requests?e.debug("_throttledRequestHandler called with "+this._requests.length+" requests"):e.debug("_throttledRequestHandler called with undefined requests"),this._requests&&0!==this._requests.length&&(this._requests.length>0&&this._processRequest(0),this._requests.length>1&&Math.abs(this._requests[0].rid-this._requests[1].rid): "+r);var i=t.getAttribute("version");return"string"!=typeof i?n="Missing version in ":"1.0"!==i&&(n="Wrong version in : "+i),!n||(this._conn._changeConnectStatus(e.Status.CONNFAIL,n),this._conn._doDisconnect(),!1)},_connect_cb_wrapper:function(t){if(0===t.data.indexOf("\s*)*/,"");if(""===n)return;var r=(new DOMParser).parseFromString(n,"text/xml").documentElement;this._conn.xmlInput(r),this._conn.rawInput(t.data),this._handleStreamStart(r)&&this._connect_cb(r)}else if(0===t.data.indexOf(" tag.")}}this._conn._doDisconnect()},_doDisconnect:function(){e.info("WebSockets _doDisconnect was called"),this._closeSocket()},_streamWrap:function(e){return""+e+""},_closeSocket:function(){if(this.socket)try{this.socket.onerror=null,this.socket.close()}catch(e){}this.socket=null},_emptyQueue:function(){return!0},_onClose:function(t){this._conn.connected&&!this._conn.disconnecting?(e.error("Websocket closed unexpectedly"),this._conn._doDisconnect()):t&&1006===t.code&&!this._conn.connected&&this.socket?(e.error("Websocket closed unexcectedly"),this._conn._changeConnectStatus(e.Status.CONNFAIL,"The WebSocket connection could not be established or was disconnected."),this._conn._doDisconnect()):e.info("Websocket closed")},_onDisconnectTimeout:function(){},_abortAllRequests:function(){},_onError:function(t){e.error("Websocket error "+t),this._conn._changeConnectStatus(e.Status.CONNFAIL,"The WebSocket connection could not be established or was disconnected."),this._disconnect()},_onIdle:function(){var t=this._conn._data;if(t.length>0&&!this._conn.paused){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(e){var n=void 0;n="object"===(void 0===e?"undefined":y(e))?e:{name:e,properties:t},b.log(JSON.stringify(n)),this.analytics.sendEvent(e,t)}else b.warn("No event or event name given.")},i.sendAnalytics=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.analytics.sendEvent(e,t)}}).call(t,"modules/statistics/statistics.js")},function(e,t,n){"use strict";n.d(t,"q",function(){return i}),n.d(t,"r",function(){return o}),n.d(t,"s",function(){return a}),n.d(t,"t",function(){return s}),n.d(t,"a",function(){return c}),n.d(t,"b",function(){return u}),n.d(t,"c",function(){return l}),n.d(t,"d",function(){return d}),n.d(t,"e",function(){return p}),n.d(t,"f",function(){return h}),n.d(t,"g",function(){return f}),n.d(t,"h",function(){return m}),n.d(t,"i",function(){return v}),n.d(t,"j",function(){return g}),n.d(t,"k",function(){return y}),n.d(t,"l",function(){return b}),n.d(t,"m",function(){return S}),n.d(t,"n",function(){return _}),n.d(t,"o",function(){return T}),n.d(t,"p",function(){return C}),n.d(t,"u",function(){return E}),n.d(t,"v",function(){return w}),n.d(t,"w",function(){return R}),n.d(t,"x",function(){return k}),n.d(t,"y",function(){return I}),n.d(t,"z",function(){return P}),n.d(t,"A",function(){return A}),n.d(t,"B",function(){return O}),n.d(t,"C",function(){return D}),n.d(t,"D",function(){return x}),n.d(t,"E",function(){return N});var r=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return{type:i,source:"get.user.media",action:e,attributes:t}},P=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:i,action:e,source:"jingle",attributes:t}},A=function(e){return{attributes:{media_type:e},action:"track.no.data.from.source",type:i}},O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:i,action:e,source:"p2p",attributes:t}},D=function(){return{type:i,action:"remotely.muted"}},x=function(e){return{type:i,action:"rtp.stats",attributes:e}},N=function(e){return R("ttfm",e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"AUTH_STATUS_CHANGED",function(){return r}),n.d(t,"AVAILABLE_DEVICES_CHANGED",function(){return i}),n.d(t,"AVATAR_CHANGED",function(){return o}),n.d(t,"BEFORE_STATISTICS_DISPOSED",function(){return a}),n.d(t,"CONFERENCE_ERROR",function(){return s}),n.d(t,"CONFERENCE_FAILED",function(){return c}),n.d(t,"CONFERENCE_JOINED",function(){return u}),n.d(t,"CONFERENCE_LEFT",function(){return l}),n.d(t,"CONNECTION_INTERRUPTED",function(){return d}),n.d(t,"CONNECTION_RESTORED",function(){return p}),n.d(t,"DATA_CHANNEL_OPENED",function(){return h}),n.d(t,"DISPLAY_NAME_CHANGED",function(){return f}),n.d(t,"DOMINANT_SPEAKER_CHANGED",function(){return m}),n.d(t,"DTMF_SUPPORT_CHANGED",function(){return v}),n.d(t,"ENDPOINT_MESSAGE_RECEIVED",function(){return g}),n.d(t,"JVB121_STATUS",function(){return y}),n.d(t,"KICKED",function(){return b}),n.d(t,"LAST_N_ENDPOINTS_CHANGED",function(){return S}),n.d(t,"LOCK_STATE_CHANGED",function(){return _}),n.d(t,"MESSAGE_RECEIVED",function(){return T}),n.d(t,"PRIVATE_MESSAGE_RECEIVED",function(){return C}),n.d(t,"PARTICIPANT_CONN_STATUS_CHANGED",function(){return E}),n.d(t,"PARTCIPANT_FEATURES_CHANGED",function(){return w}),n.d(t,"PARTICIPANT_PROPERTY_CHANGED",function(){return R}),n.d(t,"P2P_STATUS",function(){return k}),n.d(t,"PHONE_NUMBER_CHANGED",function(){return I}),n.d(t,"RECORDER_STATE_CHANGED",function(){return P}),n.d(t,"VIDEO_SIP_GW_AVAILABILITY_CHANGED",function(){return A}),n.d(t,"VIDEO_SIP_GW_SESSION_STATE_CHANGED",function(){return O}),n.d(t,"START_MUTED_POLICY_CHANGED",function(){return D}),n.d(t,"STARTED_MUTED",function(){return x}),n.d(t,"SUBJECT_CHANGED",function(){return N}),n.d(t,"SUSPEND_DETECTED",function(){return L}),n.d(t,"TALK_WHILE_MUTED",function(){return M}),n.d(t,"TRACK_ADDED",function(){return j}),n.d(t,"TRACK_AUDIO_LEVEL_CHANGED",function(){return F}),n.d(t,"TRACK_MUTE_CHANGED",function(){return U}),n.d(t,"TRACK_REMOVED",function(){return H}),n.d(t,"TRANSCRIPTION_STATUS_CHANGED",function(){return B}),n.d(t,"USER_JOINED",function(){return G}),n.d(t,"USER_LEFT",function(){return J}),n.d(t,"USER_ROLE_CHANGED",function(){return V}),n.d(t,"USER_STATUS_CHANGED",function(){return W});var r="conference.auth_status_changed",i="conference.availableDevicesChanged",o="conference.avatarChanged",a="conference.beforeStatisticsDisposed",s="conference.error",c="conference.failed",u="conference.joined",l="conference.left",d="conference.connectionInterrupted",p="conference.connectionRestored",h="conference.dataChannelOpened",f="conference.displayNameChanged",m="conference.dominantSpeaker",v="conference.dtmfSupportChanged",g="conference.endpoint_message_received",y="conference.jvb121Status",b="conferenece.kicked",S="conference.lastNEndpointsChanged",_="conference.lock_state_changed",T="conference.messageReceived",C="conference.privateMessageReceived",E="conference.participant_conn_status_changed",w="conference.partcipant_features_changed",R="conference.participant_property_changed",k="conference.p2pStatus",I="conference.phoneNumberChanged",P="conference.recorderStateChanged",A="conference.videoSIPGWAvailabilityChanged",O="conference.videoSIPGWSessionStateChanged",D="conference.start_muted_policy_changed",x="conference.started_muted",N="conference.subjectChanged",L="conference.suspendDetected",M="conference.talk_while_muted",j="conference.trackAdded",F="conference.audioLevelsChanged",U="conference.trackMuteChanged",H="conference.trackRemoved",B="conference.transcriptionStatusChanged",G="conference.userJoined",J="conference.userLeft",V="conference.roleChanged",W="conference.statusChanged"},function(e,t){e.exports={ADD_ICE_CANDIDATE_FAILED:"xmpp.add_ice_candidate_failed",AUDIO_MUTED_BY_FOCUS:"xmpp.audio_muted_by_focus",AUTHENTICATION_REQUIRED:"xmpp.authentication_required",BRIDGE_DOWN:"xmpp.bridge_down",CALL_ACCEPTED:"xmpp.callaccepted.jingle",CALL_INCOMING:"xmpp.callincoming.jingle",CALL_ENDED:"xmpp.callended.jingle",CHAT_ERROR_RECEIVED:"xmpp.chat_error_received",CONFERENCE_SETUP_FAILED:"xmpp.conference_setup_failed",CONNECTION_ESTABLISHED:"xmpp.connection.connected",CONNECTION_FAILED:"xmpp.connection.failed",CONNECTION_INTERRUPTED:"xmpp.connection.interrupted",CONNECTION_RESTORED:"xmpp.connection.restored",CONNECTION_ICE_FAILED:"xmpp.connection.ice.failed",DISPLAY_NAME_CHANGED:"xmpp.display_name_changed",EMUC_ROOM_ADDED:"xmpp.emuc_room_added",EMUC_ROOM_REMOVED:"xmpp.emuc_room_removed",ETHERPAD:"xmpp.etherpad",FOCUS_DISCONNECTED:"xmpp.focus_disconnected",FOCUS_LEFT:"xmpp.focus_left",GRACEFUL_SHUTDOWN:"xmpp.graceful_shutdown",ICE_RESTARTING:"rtc.ice_restarting",JINGLE_ERROR:"xmpp.jingle_error",JINGLE_FATAL_ERROR:"xmpp.jingle_fatal_error",KICKED:"xmpp.kicked",LOCAL_ROLE_CHANGED:"xmpp.localrole_changed",MESSAGE_RECEIVED:"xmpp.message_received",PRIVATE_MESSAGE_RECEIVED:"xmpp.private_message_received",MUC_DESTROYED:"xmpp.muc_destroyed",MUC_JOINED:"xmpp.muc_joined",MUC_MEMBER_JOINED:"xmpp.muc_member_joined",MUC_MEMBER_LEFT:"xmpp.muc_member_left",MUC_LEFT:"xmpp.muc_left",MUC_ROLE_CHANGED:"xmpp.muc_role_changed",MUC_LOCK_CHANGED:"xmpp.muc_lock_changed",PARTICIPANT_AUDIO_MUTED:"xmpp.audio_muted",PARTICIPANT_VIDEO_MUTED:"xmpp.video_muted",PARTICIPANT_VIDEO_TYPE_CHANGED:"xmpp.video_type",PARTCIPANT_FEATURES_CHANGED:"xmpp.partcipant_features_changed",PASSWORD_REQUIRED:"xmpp.password_required",PEERCONNECTION_READY:"xmpp.peerconnection_ready",PHONE_NUMBER_CHANGED:"conference.phoneNumberChanged",PRESENCE_STATUS:"xmpp.presence_status",PROMPT_FOR_LOGIN:"xmpp.prompt_for_login",READY_TO_JOIN:"xmpp.ready_to_join",RECORDER_STATE_CHANGED:"xmpp.recorderStateChanged",REMOTE_STATS:"xmpp.remote_stats",RESERVATION_ERROR:"xmpp.room_reservation_error",ROOM_CONNECT_ERROR:"xmpp.room_connect_error",ROOM_CONNECT_NOT_ALLOWED_ERROR:"xmpp.room_connect_error.not_allowed",ROOM_JOIN_ERROR:"xmpp.room_join_error",ROOM_MAX_USERS_ERROR:"xmpp.room_max_users_error",SENDING_CHAT_MESSAGE:"xmpp.sending_chat_message",SENDING_PRIVATE_CHAT_MESSAGE:"xmpp.sending_private_chat_message",SESSION_ACCEPT_TIMEOUT:"xmpp.session_accept_timeout",START_MUTED_FROM_FOCUS:"xmpp.start_muted_from_focus",SUBJECT_CHANGED:"xmpp.subject_changed",SUSPEND_DETECTED:"xmpp.suspend_detected",TRANSCRIPTION_STATUS_CHANGED:"xmpp.transcription_status_changed",TRANSPORT_INFO:"xmpp.transportinfo.jingle",VIDEO_SIP_GW_AVAILABILITY_CHANGED:"xmpp.videoSIPGWAvailabilityChanged",VIDEO_SIP_GW_SESSION_STATE_CHANGED:"xmpp.videoSIPGWSessionStateChanged",ICE_CONNECTION_STATE_CHANGED:"xmpp.ice_connection_state_changed",JSON_MESSAGE_RECEIVED:"xmmp.json_message_received"}},function(e,t){e.exports={CREATE_ANSWER_FAILED:"rtc.create_answer_failed",CREATE_OFFER_FAILED:"rtc.create_offer_failed",RTC_READY:"rtc.ready",DATA_CHANNEL_OPEN:"rtc.data_channel_open",ENDPOINT_CONN_STATUS_CHANGED:"rtc.endpoint_conn_status_changed",DOMINANT_SPEAKER_CHANGED:"rtc.dominant_speaker_changed",LASTN_ENDPOINT_CHANGED:"rtc.lastn_endpoint_changed",LASTN_VALUE_CHANGED:"rtc.lastn_value_changed",LOCAL_TRACK_SSRC_UPDATED:"rtc.local_track_ssrc_updated",AVAILABLE_DEVICES_CHANGED:"rtc.available_devices_changed",TRACK_ATTACHED:"rtc.track_attached",REMOTE_TRACK_ADDED:"rtc.remote_track_added",REMOTE_TRACK_MUTE:"rtc.remote_track_mute",REMOTE_TRACK_REMOVED:"rtc.remote_track_removed",REMOTE_TRACK_UNMUTE:"rtc.remote_track_unmute",SET_LOCAL_DESCRIPTION_FAILED:"rtc.set_local_description_failed",SET_REMOTE_DESCRIPTION_FAILED:"rtc.set_remote_description_failed",AUDIO_OUTPUT_DEVICE_CHANGED:"rtc.audio_output_device_changed",DEVICE_LIST_CHANGED:"rtc.device_list_changed",DEVICE_LIST_AVAILABLE:"rtc.device_list_available",ENDPOINT_MESSAGE_RECEIVED:"rtc.endpoint_message_received",LOCAL_UFRAG_CHANGED:"rtc.local_ufrag_changed",REMOTE_UFRAG_CHANGED:"rtc.remote_ufrag_changed"}},function(e,t,n){"use strict";var r=n(16),i=n.n(r),o=(function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:new i.a;!(function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this),this.eventEmitter=t,this.addEventListener=this.on=this.addListener,this.removeEventListener=this.off=this.removeListener}return o(e,[{key:"addListener",value:function(e,t){this.eventEmitter.addListener(e,t)}},{key:"removeListener",value:function(e,t){this.eventEmitter.removeListener(e,t)}}]),e})();t.a=a},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof("function"==typeof Symbol?Symbol.iterator:"@@iterator")?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==("function"==typeof Symbol?Symbol.prototype:"@@prototype")?"symbol":typeof e},i=!0,o=!0,a={disableLog:function(e){return"boolean"!=typeof e?new Error("Argument type: "+(void 0===e?"undefined":r(e))+". Please use a boolean."):(i=e,e?"adapter.js logging disabled":"adapter.js logging enabled")},disableWarnings:function(e){return"boolean"!=typeof e?new Error("Argument type: "+(void 0===e?"undefined":r(e))+". Please use a boolean."):(o=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))},log:function(){if("object"===("undefined"==typeof window?"undefined":r(window))){if(i)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}},deprecated:function(e,t){o&&console.warn(e+" is deprecated, please use "+t+" instead.")},extractVersion:function(e,t,n){var r=e.match(t);return r&&r.length>=n&&parseInt(r[n],10)},detectBrowser:function(e){var t=e&&e.navigator,n={};if(n.browser=null,n.version=null,void 0===e||!e.navigator)return n.browser="Not a browser.",n;if(t.mozGetUserMedia)n.browser="firefox",n.version=this.extractVersion(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia)if(e.webkitRTCPeerConnection)n.browser="chrome",n.version=this.extractVersion(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!t.userAgent.match(/Version\/(\d+).(\d+)/))return n.browser="Unsupported webkit-based browser with GUM support but no WebRTC support.",n;n.browser="safari",n.version=this.extractVersion(t.userAgent,/AppleWebKit\/(\d+)\./,1)}else if(t.mediaDevices&&t.userAgent.match(/Edge\/(\d+).(\d+)$/))n.browser="edge",n.version=this.extractVersion(t.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!t.mediaDevices||!t.userAgent.match(/AppleWebKit\/(\d+)\./))return n.browser="Not a supported browser.",n;n.browser="safari",n.version=this.extractVersion(t.userAgent,/AppleWebKit\/(\d+)\./,1)}return n}};e.exports={log:a.log,deprecated:a.deprecated,disableLog:a.disableLog,disableWarnings:a.disableWarnings,extractVersion:a.extractVersion,shimCreateObjectURL:a.shimCreateObjectURL,detectBrowser:a.detectBrowser.bind(a)}},function(e,t,n){"use strict";function r(e,t,n){if("object"===(void 0===e?"undefined":o(e))&&void 0!==e.name)switch(this.gum={error:e,constraints:t,devices:n&&Array.isArray(n)?n.slice(0):void 0},e.name){case"NotAllowedError":case"PermissionDeniedError":case"SecurityError":this.name=i.PERMISSION_DENIED,this.message=a[this.name]+(this.gum.devices||[]).join(", ");break;case"DevicesNotFoundError":case"NotFoundError":this.name=i.NOT_FOUND,this.message=a[this.name]+(this.gum.devices||[]).join(", ");break;case"ConstraintNotSatisfiedError":case"OverconstrainedError":var r=e.constraintName||e.constraint;t&&t.video&&(!n||n.indexOf("video")>-1)&&("minWidth"===r||"maxWidth"===r||"minHeight"===r||"maxHeight"===r||"width"===r||"height"===r)?(this.name=i.UNSUPPORTED_RESOLUTION,this.message=a[this.name]+(function(e,t){if(t&&t.video&&t.video.mandatory)switch(e){case"width":return t.video.mandatory.minWidth;case"height":return t.video.mandatory.minHeight;default:return t.video.mandatory[e]||""}return""})(r,t)):(this.name=i.CONSTRAINT_FAILED,this.message=a[this.name]+e.constraintName);break;default:this.name=i.GENERAL,this.message=e.message||a[this.name]}else{if("string"!=typeof e)throw new Error("Invalid arguments");a[e]?(this.name=e,this.message=t||a[e]):this.message=e}this.stack=e.stack||(new Error).stack}var i=n(17),o="function"==typeof Symbol&&"symbol"==typeof("function"==typeof Symbol?Symbol.iterator:"@@iterator")?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==("function"==typeof Symbol?Symbol.prototype:"@@prototype")?"symbol":typeof e},a={};a[i.UNSUPPORTED_RESOLUTION]="Video resolution is not supported: ",a[i.FIREFOX_EXTENSION_NEEDED]="Firefox extension is not installed",a[i.CHROME_EXTENSION_INSTALLATION_ERROR]="Failed to install Chrome extension",a[i.CHROME_EXTENSION_USER_GESTURE_REQUIRED]="Failed to install Chrome extension - installations can only be initiated by a user gesture.",a[i.CHROME_EXTENSION_USER_CANCELED]="User canceled Chrome's screen sharing prompt",a[i.CHROME_EXTENSION_GENERIC_ERROR]="Unknown error from Chrome extension",a[i.ELECTRON_DESKTOP_PICKER_ERROR]="Unkown error from desktop picker",a[i.ELECTRON_DESKTOP_PICKER_NOT_FOUND]="Failed to detect desktop picker",a[i.GENERAL]="Generic getUserMedia error",a[i.PERMISSION_DENIED]="User denied permission to use device(s): ",a[i.NOT_FOUND]="Requested device(s) was/were not found: ",a[i.CONSTRAINT_FAILED]="Constraint could not be satisfied: ",a[i.TRACK_IS_DISPOSED]="Track has been already disposed",a[i.TRACK_NO_STREAM_FOUND]="Track does not have an associated Media Stream",a[i.NO_DATA_FROM_SOURCE]="The track has stopped receiving data from it's source",r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,t.a=r},function(e,t){e.exports={CAMERA:"camera",DESKTOP:"desktop"}},function(e,t,n){"use strict";(function(e){var r=n(0),i=(n.n(r),n(19)),o=n.n(i),a=n(1),s=Object(r.getLogger)(e),c={filterSpecialChars:function(e){return e?e.replace(/[\\\/\{,\}\+]/g,""):e},iceparams:function(e,t){var n=null,r=void 0,i=void 0;return(i=c.findLine(e,"a=ice-ufrag:",t))&&(r=c.findLine(e,"a=ice-pwd:",t))&&(n={ufrag:c.parseICEUfrag(i),pwd:c.parseICEPwd(r)}),n},parseICEUfrag:function(e){return e.substring(12)},buildICEUfrag:function(e){return"a=ice-ufrag:"+e},parseICEPwd:function(e){return e.substring(10)},buildICEPwd:function(e){return"a=ice-pwd:"+e},parseMID:function(e){return e.substring(6)},parseMLine:function(e){var t={},n=e.substring(2).split(" ");return t.media=n.shift(),t.port=n.shift(),t.proto=n.shift(),""===n[n.length-1]&&n.pop(),t.fmt=n,t},buildMLine:function(e){return"m="+e.media+" "+e.port+" "+e.proto+" "+e.fmt.join(" ")},parseRTPMap:function(e){var t={},n=e.substring(9).split(" ");return t.id=n.shift(),n=n[0].split("/"),t.name=n.shift(),t.clockrate=n.shift(),t.channels=n.length?n.shift():"1",t},parseSCTPMap:function(e){var t=e.substring(10).split(" ");return[t[0],t[1],t.length>2?t[2]:null]},buildRTPMap:function(e){var t="a=rtpmap:"+e.getAttribute("id")+" "+e.getAttribute("name")+"/"+e.getAttribute("clockrate");return e.getAttribute("channels")&&"1"!==e.getAttribute("channels")&&(t+="/"+e.getAttribute("channels")),t},parseCrypto:function(e){var t={},n=e.substring(9).split(" ");return t.tag=n.shift(),t["crypto-suite"]=n.shift(),t["key-params"]=n.shift(),n.length&&(t["session-params"]=n.join(" ")),t},parseFingerprint:function(e){var t={},n=e.substring(14).split(" ");return t.hash=n.shift(),t.fingerprint=n.shift(),t},parseFmtp:function(e){var t=[],n=e.split(" ");n.shift(),n=n.join(" ").split(";");for(var r=0;r1&&0===n)){var r=null;if(1===t)r=e.ssrcs[0].id;else if(2===t){var i=e.ssrcGroups.find(function(e){return"FID"===e.semantics});i&&(r=i.ssrcs.split(" ")[0])}else if(t>=3){var o=e.ssrcGroups.find(function(e){return"SIM"===e.semantics});o&&(r=o.ssrcs.split(" ")[0])}return r}},generateSsrc:function(){return o.a.randomInt(1,4294967295)},getSsrcAttribute:function(e,t,n){for(var r=0;r0)return t[0].substr("a=ice-ufrag:".length)},preferVideoCodec:function(e,t){var n=null;if(e&&t){for(var r=0;r0){var u=n.map(function(e){return"apt="+e}),l=e.fmtp.filter(function(e){return-1!==u.indexOf(e.config)});n.push.apply(n,(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&this._events[e].length>a&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),i||(i=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var i=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,o,a,s;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(a=(n=this._events[e]).length,o=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(n)){for(s=a;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){o=s;break}if(o<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"CHROME_EXTENSION_GENERIC_ERROR",function(){return r}),n.d(t,"CHROME_EXTENSION_INSTALLATION_ERROR",function(){return i}),n.d(t,"CHROME_EXTENSION_USER_GESTURE_REQUIRED",function(){return o}),n.d(t,"CHROME_EXTENSION_USER_CANCELED",function(){return a}),n.d(t,"CONSTRAINT_FAILED",function(){return s}),n.d(t,"ELECTRON_DESKTOP_PICKER_ERROR",function(){return c}),n.d(t,"ELECTRON_DESKTOP_PICKER_NOT_FOUND",function(){return u}),n.d(t,"FIREFOX_EXTENSION_NEEDED",function(){return l}),n.d(t,"GENERAL",function(){return d}),n.d(t,"NOT_FOUND",function(){return p}),n.d(t,"PERMISSION_DENIED",function(){return h}),n.d(t,"TRACK_IS_DISPOSED",function(){return f}),n.d(t,"TRACK_NO_STREAM_FOUND",function(){return m}),n.d(t,"UNSUPPORTED_RESOLUTION",function(){return v}),n.d(t,"NO_DATA_FROM_SOURCE",function(){return g});var r="gum.chrome_extension_generic_error",i="gum.chrome_extension_installation_error",o="gum.chrome_extension_user_gesture_required",a="gum.chrome_extension_user_canceled",s="gum.constraint_failed",c="gum.electron_desktop_picker_error",u="gum.electron_desktop_picker_not_found",l="gum.firefox_extension_needed",d="gum.general",p="gum.not_found",h="gum.permission_denied",f="track.track_is_disposed",m="track.no_stream_found",v="gum.unsupported_resolution",g="track.no_data_from_source"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"LOCAL_TRACK_STOPPED",function(){return r}),n.d(t,"TRACK_AUDIO_LEVEL_CHANGED",function(){return i}),n.d(t,"TRACK_AUDIO_OUTPUT_CHANGED",function(){return o}),n.d(t,"TRACK_MUTE_CHANGED",function(){return a}),n.d(t,"TRACK_VIDEOTYPE_CHANGED",function(){return s}),n.d(t,"NO_DATA_FROM_SOURCE",function(){return c});var r="track.stopped",i="track.audioLevelsChanged",o="track.audioOutputChanged",a="track.trackMuteChanged",s="track.videoTypeChanged",c="track.no_data_from_source"},function(e,t){function n(e,t){return Math.floor(Math.random()*(t-e+1))+e}function r(e){return e[n(0,e.length-1)]}var i={randomHexDigit:function(){return r("0123456789abcdef")},randomHexString:function(e){for(var t="";e--;)t+=this.randomHexDigit();return t},randomElement:r,randomAlphanumStr:function(e){for(var t="",n=0;n0&&void 0!==arguments[0]?arguments[0]:function e(){r(this,e)};return(function(t){function n(){var e;r(this,n);for(var t=arguments.length,i=Array(t),o=0;o0;){var t=e.shift();if("function"==typeof t){var n=e.shift(),r=e.shift();t.call(n,r)}else t._settlePromises()}},i.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},i.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},i.prototype._reset=function(){this._isTickUsed=!1},t.exports=i,t.exports.firstLineError=c},{"./queue":26,"./schedule":29,"./util":36}],3:[function(e,t,n){"use strict";t.exports=function(e,t,n,r){var i=!1,o=function(e,t){this._reject(t)},a=function(e,t){t.promiseRejectionQueued=!0,t.bindingPromise._then(o,o,null,this,e)},s=function(e,t){0==(50397184&this._bitField)&&this._resolveCallback(t.target)},c=function(e,t){t.promiseRejectionQueued||this._reject(e)};e.prototype.bind=function(o){i||(i=!0,e.prototype._propagateFrom=r.propagateFromFunction(),e.prototype._boundValue=r.boundValueFunction());var u=n(o),l=new e(t);l._propagateFrom(this,1);var d=this._target();if(l._setBoundTo(u),u instanceof e){var p={promiseRejectionQueued:!1,promise:l,target:d,bindingPromise:u};d._then(t,a,void 0,l,p),u._then(s,c,void 0,l,p),l._setOnCancel(u)}else l._resolveCallback(d);return l},e.prototype._setBoundTo=function(e){void 0!==e?(this._bitField=2097152|this._bitField,this._boundTo=e):this._bitField=-2097153&this._bitField},e.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},e.bind=function(t,n){return e.resolve(n).bind(t)}}},{}],4:[function(e,t,n){"use strict";var r;"undefined"!=typeof Promise&&(r=Promise);var i=e("./promise")();i.noConflict=function(){try{Promise===i&&(Promise=r)}catch(e){}return i},t.exports=i},{"./promise":22}],5:[function(e,t,n){"use strict";var r=Object.create;if(r){var i=r(null),o=r(null);i[" size"]=o[" size"]=0}t.exports=function(t){function n(e){return(function(e,n){var r;if(null!=e&&(r=e[n]),"function"!=typeof r){var i="Object "+o.classString(e)+" has no method '"+o.toString(n)+"'";throw new t.TypeError(i)}return r})(e,this.pop()).apply(e,this)}function r(e){return e[this]}function i(e){var t=+this;return t<0&&(t=Math.max(0,t+e.length)),e[t]}var o=e("./util"),a=o.canEvaluate;o.isIdentifier,t.prototype.call=function(e){var t=[].slice.call(arguments,1);return t.push(e),this._then(n,void 0,void 0,t,void 0)},t.prototype.get=function(e){var t;if("number"==typeof e)t=i;else if(a){var n=(void 0)(e);t=null!==n?n:r}else t=r;return this._then(t,void 0,void 0,e,void 0)}}},{"./util":36}],6:[function(e,t,n){"use strict";t.exports=function(t,n,r,i){var o=e("./util"),a=o.tryCatch,s=o.errorObj,c=t._async;t.prototype.break=t.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var e=this,t=e;e._isCancellable();){if(!e._cancelBy(t)){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}var n=e._cancellationParent;if(null==n||!n._isCancellable()){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}e._isFollowing()&&e._followee().cancel(),e._setWillBeCancelled(),t=e,e=n}},t.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},t.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},t.prototype._cancelBy=function(e){return e===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},t.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},t.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},t.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},t.prototype._unsetOnCancel=function(){this._onCancelField=void 0},t.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},t.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},t.prototype._doInvokeOnCancel=function(e,t){if(o.isArray(e))for(var n=0;n=0)return i[e]}var r=!1,i=[];return e.prototype._promiseCreated=function(){},e.prototype._pushContext=function(){},e.prototype._popContext=function(){return null},e._peekContext=e.prototype._peekContext=function(){},t.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,i.push(this._trace))},t.prototype._popContext=function(){if(void 0!==this._trace){var e=i.pop(),t=e._promiseCreated;return e._promiseCreated=null,t}return null},t.CapturedTrace=null,t.create=function(){if(r)return new t},t.deactivateLongStackTraces=function(){},t.activateLongStackTraces=function(){var i=e.prototype._pushContext,o=e.prototype._popContext,a=e._peekContext,s=e.prototype._peekContext,c=e.prototype._promiseCreated;t.deactivateLongStackTraces=function(){e.prototype._pushContext=i,e.prototype._popContext=o,e._peekContext=a,e.prototype._peekContext=s,e.prototype._promiseCreated=c,r=!1},r=!0,e.prototype._pushContext=t.prototype._pushContext,e.prototype._popContext=t.prototype._popContext,e._peekContext=e.prototype._peekContext=n,e.prototype._promiseCreated=function(){var e=this._peekContext();e&&null==e._promiseCreated&&(e._promiseCreated=this)}},t}},{}],9:[function(e,t,r){"use strict";t.exports=function(t,r){function i(e,t){return{promise:t}}function o(){return!1}function a(e,t,n){var r=this;try{e(t,n,function(e){if("function"!=typeof e)throw new TypeError("onCancel must be a function, got: "+O.toString(e));r._attachCancellationCallback(e)})}catch(e){return e}}function s(e){if(!this._isCancellable())return this;var t=this._onCancel();void 0!==t?O.isArray(t)?t.push(e):this._setOnCancel([t,e]):this._setOnCancel(e)}function u(){return this._onCancelField}function l(e){this._onCancelField=e}function d(){this._cancellationParent=void 0,this._onCancelField=void 0}function p(e,t){if(0!=(1&t)){this._cancellationParent=e;var n=e._branchesRemainingToCancel;void 0===n&&(n=0),e._branchesRemainingToCancel=n+1}0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)}function h(){var e=this._boundTo;return void 0!==e&&e instanceof t?e.isFulfilled()?e.value():void 0:e}function f(){this._trace=new E(this._peekContext())}function m(e,t){if(D(e)){var n=this._trace;if(void 0!==n&&t&&(n=n._parent),void 0!==n)n.attachExtraTrace(e);else if(!e.__stackCleaned__){var r=y(e);O.notEnumerableProp(e,"stack",r.message+"\n"+r.stack.join("\n")),O.notEnumerableProp(e,"__stackCleaned__",!0)}}}function v(e,n,r){if(Y.warnings){var i,o=new A(e);if(n)r._attachExtraTrace(o);else if(Y.longStackTraces&&(i=t._peekContext()))i.attachExtraTrace(o);else{var a=y(o);o.stack=a.message+"\n"+a.stack.join("\n")}K("warning",o)||b(o,"",!0)}}function g(e){for(var t=[],n=0;n0?(function(e){for(var t=e.stack.replace(/\s+$/g,"").split("\n"),n=0;n0&&"SyntaxError"!=e.name&&(t=t.slice(n)),t})(e):[" (No stack trace)"],{message:n,stack:"SyntaxError"==e.name?t:g(t)}}function b(e,t,n){if("undefined"!=typeof console){var r;if(O.isObject(e)){var i=e.stack;r=t+j(i,e)}else r=t+String(e);"function"==typeof k?k(r,n):"function"!=typeof console.log&&"object"!==c(console.log)||console.log(r)}}function S(e,t,n,r){var i=!1;try{"function"==typeof t&&(i=!0,"rejectionHandled"===e?t(r):t(n,r))}catch(e){P.throwLater(e)}"unhandledRejection"===e?K(e,n,r)||i||b(n,"Unhandled rejection "):K(e,r)}function _(e){var t;if("function"==typeof e)t="[function "+(e.name||"anonymous")+"]";else{if(t=e&&"function"==typeof e.toString?e.toString():O.toString(e),/\[object [a-zA-Z0-9$_]+\]/.test(t))try{t=JSON.stringify(e)}catch(e){}0===t.length&&(t="(empty array)")}return"(<"+(n=t,n.length<41?n:n.substr(0,38)+"...")+">, no stack trace)";var n}function T(){return"function"==typeof X}function C(e){var t=e.match($);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function E(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);X(this,E),t>32&&this.uncycle()}var w,R,k,I=t._getDomain,P=t._async,A=e("./errors").Warning,O=e("./util"),D=O.canAttachTrace,x=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,N=/\((?:timers\.js):\d+:\d+\)/,L=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,M=null,j=null,F=!1,U=!(0==O.env("BLUEBIRD_DEBUG")),H=!(0==O.env("BLUEBIRD_WARNINGS")||!U&&!O.env("BLUEBIRD_WARNINGS")),B=!(0==O.env("BLUEBIRD_LONG_STACK_TRACES")||!U&&!O.env("BLUEBIRD_LONG_STACK_TRACES")),G=0!=O.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(H||!!O.env("BLUEBIRD_W_FORGOTTEN_RETURN"));t.prototype.suppressUnhandledRejections=function(){var e=this._target();e._bitField=-1048577&e._bitField|524288},t.prototype._ensurePossibleRejectionHandled=function(){if(0==(524288&this._bitField)){this._setRejectionIsUnhandled();var e=this;setTimeout(function(){e._notifyUnhandledRejection()},1)}},t.prototype._notifyUnhandledRejectionIsHandled=function(){S("rejectionHandled",w,void 0,this)},t.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},t.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField)},t.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var e=this._settledValue();this._setUnhandledRejectionIsNotified(),S("unhandledRejection",R,e,this)}},t.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},t.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},t.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},t.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},t.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},t.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},t.prototype._warn=function(e,t,n){return v(e,t,n||this)},t.onPossiblyUnhandledRejection=function(e){var t=I();R="function"==typeof e?null===t?e:O.domainBind(t,e):void 0},t.onUnhandledRejectionHandled=function(e){var t=I();w="function"==typeof e?null===t?e:O.domainBind(t,e):void 0};var J=function(){};t.longStackTraces=function(){if(P.haveItemsQueued()&&!Y.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!Y.longStackTraces&&T()){var e=t.prototype._captureStackTrace,n=t.prototype._attachExtraTrace;Y.longStackTraces=!0,J=function(){if(P.haveItemsQueued()&&!Y.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");t.prototype._captureStackTrace=e,t.prototype._attachExtraTrace=n,r.deactivateLongStackTraces(),P.enableTrampoline(),Y.longStackTraces=!1},t.prototype._captureStackTrace=f,t.prototype._attachExtraTrace=m,r.activateLongStackTraces(),P.disableTrampolineIfNecessary()}},t.hasLongStackTraces=function(){return Y.longStackTraces&&T()};var V=(function(){try{if("function"==typeof CustomEvent){var e=new CustomEvent("CustomEvent");return O.global.dispatchEvent(e),function(e,t){var n=new CustomEvent(e.toLowerCase(),{detail:t,cancelable:!0});return!O.global.dispatchEvent(n)}}return"function"==typeof Event?(e=new Event("CustomEvent"),O.global.dispatchEvent(e),function(e,t){var n=new Event(e.toLowerCase(),{cancelable:!0});return n.detail=t,!O.global.dispatchEvent(n)}):((e=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),O.global.dispatchEvent(e),function(e,t){var n=document.createEvent("CustomEvent");return n.initCustomEvent(e.toLowerCase(),!1,!0,t),!O.global.dispatchEvent(n)})}catch(e){}return function(){return!1}})(),W=O.isNode?function(){return n.emit.apply(n,arguments)}:O.global?function(e){var t="on"+e.toLowerCase(),n=O.global[t];return!!n&&(n.apply(O.global,[].slice.call(arguments,1)),!0)}:function(){return!1},q={promiseCreated:i,promiseFulfilled:i,promiseRejected:i,promiseResolved:i,promiseCancelled:i,promiseChained:function(e,t,n){return{promise:t,child:n}},warning:function(e,t){return{warning:t}},unhandledRejection:function(e,t,n){return{reason:t,promise:n}},rejectionHandled:i},K=function(e){var t=!1;try{t=W.apply(null,arguments)}catch(e){P.throwLater(e),t=!0}var n=!1;try{n=V(e,q[e].apply(null,arguments))}catch(e){P.throwLater(e),n=!0}return n||t};t.config=function(e){if("longStackTraces"in(e=Object(e))&&(e.longStackTraces?t.longStackTraces():!e.longStackTraces&&t.hasLongStackTraces()&&J()),"warnings"in e){var n=e.warnings;Y.warnings=!!n,G=Y.warnings,O.isObject(n)&&"wForgottenReturn"in n&&(G=!!n.wForgottenReturn)}if("cancellation"in e&&e.cancellation&&!Y.cancellation){if(P.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");t.prototype._clearCancellationData=d,t.prototype._propagateFrom=p,t.prototype._onCancel=u,t.prototype._setOnCancel=l,t.prototype._attachCancellationCallback=s,t.prototype._execute=a,z=p,Y.cancellation=!0}return"monitoring"in e&&(e.monitoring&&!Y.monitoring?(Y.monitoring=!0,t.prototype._fireEvent=K):!e.monitoring&&Y.monitoring&&(Y.monitoring=!1,t.prototype._fireEvent=o)),t},t.prototype._fireEvent=o,t.prototype._execute=function(e,t,n){try{e(t,n)}catch(e){return e}},t.prototype._onCancel=function(){},t.prototype._setOnCancel=function(e){},t.prototype._attachCancellationCallback=function(e){},t.prototype._captureStackTrace=function(){},t.prototype._attachExtraTrace=function(){},t.prototype._clearCancellationData=function(){},t.prototype._propagateFrom=function(e,t){};var z=function(e,t){0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)},Q=function(){return!1},$=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;O.inherits(E,Error),r.CapturedTrace=E,E.prototype.uncycle=function(){var e=this._length;if(!(e<2)){for(var t=[],n={},r=0,i=this;void 0!==i;++r)t.push(i),i=i._parent;for(r=(e=this._length=r)-1;r>=0;--r){var o=t[r].stack;void 0===n[o]&&(n[o]=r)}for(r=0;r0&&(t[a-1]._parent=void 0,t[a-1]._length=1),t[r]._parent=void 0,t[r]._length=1;var s=r>0?t[r-1]:this;a=0;--u)t[u]._length=c,c++;return}}}},E.prototype.attachExtraTrace=function(e){if(!e.__stackCleaned__){this.uncycle();for(var t=y(e),n=t.message,r=[t.stack],i=this;void 0!==i;)r.push(g(i.stack.split("\n"))),i=i._parent;!(function(e){for(var t=e[0],n=1;n=0;--s)if(r[s]===o){a=s;break}for(s=a;s>=0;--s){var c=r[s];if(t[i]!==c)break;t.pop(),i--}t=r}})(r),(function(e){for(var t=0;t=0)return M=/@/,j=t,F=!0,function(e){e.stack=(new Error).stack};var i;try{throw new Error}catch(e){i="stack"in e}return"stack"in r||!i||"number"!=typeof Error.stackTraceLimit?(j=function(e,t){return"string"==typeof e?e:"object"!==(void 0===t?"undefined":c(t))&&"function"!=typeof t||void 0===t.name||void 0===t.message?_(t):t.toString()},null):(M=e,j=t,function(e){Error.stackTraceLimit+=6;try{throw new Error}catch(t){e.stack=t.stack}Error.stackTraceLimit-=6})})();"undefined"!=typeof console&&void 0!==console.warn&&(k=function(e){console.warn(e)},O.isNode&&n.stderr.isTTY?k=function(e,t){var n=t?"\x1b[33m":"\x1b[31m";console.warn(n+e+"\x1b[0m\n")}:O.isNode||"string"!=typeof(new Error).stack||(k=function(e,t){console.warn("%c"+e,t?"color: darkorange":"color: red")}));var Y={warnings:H,longStackTraces:!1,cancellation:!1,monitoring:!1};return B&&t.longStackTraces(),{longStackTraces:function(){return Y.longStackTraces},warnings:function(){return Y.warnings},cancellation:function(){return Y.cancellation},monitoring:function(){return Y.monitoring},propagateFromFunction:function(){return z},boundValueFunction:function(){return h},checkForgottenReturns:function(e,t,n,r,i){if(void 0===e&&null!==t&&G){if(void 0!==i&&i._returnedNonUndefined())return;if(0==(65535&r._bitField))return;n&&(n+=" ");var o="",a="";if(t._trace){for(var s=t._trace.stack.split("\n"),c=g(s),u=c.length-1;u>=0;--u){var l=c[u];if(!N.test(l)){var d=l.match(L);d&&(o="at "+d[1]+":"+d[2]+":"+d[3]+" ");break}}if(c.length>0){var p=c[0];for(u=0;u0&&(a="\n"+s[u-1]);break}}}var h="a promise was created in a "+n+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+a;r._warn(h,!0,t)}},setBounds:function(e,t){if(T()){for(var n,r,i=e.stack.split("\n"),o=t.stack.split("\n"),a=-1,s=-1,c=0;c=s||(Q=function(e){if(x.test(e))return!0;var t=C(e);return!!(t&&t.fileName===n&&a<=t.line&&t.line<=s)})}},warn:v,deprecated:function(e,t){var n=e+" is deprecated and will be removed in a future version.";return t&&(n+=" Use "+t+" instead."),v(n)},CapturedTrace:E,fireDomEvent:V,fireGlobalEvent:W}}},{"./errors":12,"./util":36}],10:[function(e,t,n){"use strict";t.exports=function(e){function t(){return this.value}function n(){throw this.reason}e.prototype.return=e.prototype.thenReturn=function(n){return n instanceof e&&n.suppressUnhandledRejections(),this._then(t,void 0,void 0,{value:n},void 0)},e.prototype.throw=e.prototype.thenThrow=function(e){return this._then(n,void 0,void 0,{reason:e},void 0)},e.prototype.catchThrow=function(e){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:e},void 0);var t=arguments[1];return this.caught(e,function(){throw t})},e.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof e&&n.suppressUnhandledRejections(),this._then(void 0,t,void 0,{value:n},void 0);var r=arguments[1];r instanceof e&&r.suppressUnhandledRejections();return this.caught(n,function(){return r})}}},{}],11:[function(e,t,n){"use strict";t.exports=function(e,t){function n(){return i(this)}var r=e.reduce,i=e.all;e.prototype.each=function(e){return r(this,e,t,0)._then(n,void 0,void 0,this,void 0)},e.prototype.mapSeries=function(e){return r(this,e,t,t)},e.each=function(e,i){return r(e,i,t,0)._then(n,void 0,void 0,e,void 0)},e.mapSeries=function(e,n){return r(e,n,t,t)}}},{}],12:[function(e,t,n){"use strict";function r(e,t){function n(r){if(!(this instanceof n))return new n(r);d(this,"message","string"==typeof r?r:t),d(this,"name",e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return l(n,Error),n}function i(e){if(!(this instanceof i))return new i(e);d(this,"name","OperationalError"),d(this,"message",e),this.cause=e,this.isOperational=!0,e instanceof Error?(d(this,"message",e.message),d(this,"stack",e.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}var o,a,s=e("./es5"),c=s.freeze,u=e("./util"),l=u.inherits,d=u.notEnumerableProp,p=r("Warning","warning"),h=r("CancellationError","cancellation error"),f=r("TimeoutError","timeout error"),m=r("AggregateError","aggregate error");try{o=TypeError,a=RangeError}catch(e){o=r("TypeError","type error"),a=r("RangeError","range error")}for(var v="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g1?e.cancelPromise._reject(t):e.cancelPromise._cancel(),e.cancelPromise=null,!0)}function s(){return u.call(this,this.promise._target()._settledValue())}function c(e){if(!a(this,e))return p.e=e,p}function u(e){var i=this.promise,u=this.handler;if(!this.called){this.called=!0;var l=this.isFinallyHandler()?u.call(i._boundValue()):u.call(i._boundValue(),e);if(l===r)return l;if(void 0!==l){i._setReturnedNonUndefined();var h=n(l,i);if(h instanceof t){if(null!=this.cancelPromise){if(h._isCancelled()){var f=new d("late cancellation observer");return i._attachExtraTrace(f),p.e=f,p}h.isPending()&&h._attachCancellationCallback(new o(this))}return h._then(s,c,void 0,this,void 0)}}}return i.isRejected()?(a(this),p.e=e,p):(a(this),e)}var l=e("./util"),d=t.CancellationError,p=l.errorObj,h=e("./catch_filter")(r);return i.prototype.isFinallyHandler=function(){return 0===this.type},o.prototype._resultCancelled=function(){a(this.finallyHandler)},t.prototype._passThrough=function(e,t,n,r){return"function"!=typeof e?this.then():this._then(n,r,void 0,new i(this,t,e),void 0)},t.prototype.lastly=t.prototype.finally=function(e){return this._passThrough(e,0,u,u)},t.prototype.tap=function(e){return this._passThrough(e,1,u)},t.prototype.tapCatch=function(e){var n=arguments.length;if(1===n)return this._passThrough(e,1,void 0,u);var r,i=new Array(n-1),o=0;for(r=0;r0&&"function"==typeof arguments[t]&&(e=arguments[t]);var r=[].slice.call(arguments);e&&r.pop();var i=new n(r).promise();return void 0!==e?i.spread(e):i}}},{"./util":36}],18:[function(e,t,n){"use strict";t.exports=function(t,n,r,i,o,a){function s(e,t,n,r){this.constructor$(e),this._promise._captureStackTrace();var i=l();this._callback=null===i?t:d.domainBind(i,t),this._preservedValues=r===o?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=[],f.invoke(this._asyncInit,this,void 0)}function u(e,n,i,o){if("function"!=typeof n)return r("expecting a function but got "+d.classString(n));var a=0;if(void 0!==i){if("object"!==(void 0===i?"undefined":c(i))||null===i)return t.reject(new TypeError("options argument must be an object but it is "+d.classString(i)));if("number"!=typeof i.concurrency)return t.reject(new TypeError("'concurrency' must be a number but it is "+d.classString(i.concurrency)));a=i.concurrency}return new s(e,n,a="number"==typeof a&&isFinite(a)&&a>=1?a:0,o).promise()}var l=t._getDomain,d=e("./util"),p=d.tryCatch,h=d.errorObj,f=t._async;d.inherits(s,n),s.prototype._asyncInit=function(){this._init$(void 0,-2)},s.prototype._init=function(){},s.prototype._promiseFulfilled=function(e,n){var r=this._values,o=this.length(),s=this._preservedValues,c=this._limit;if(n<0){if(r[n=-1*n-1]=e,c>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(c>=1&&this._inFlight>=c)return r[n]=e,this._queue.push(n),!1;null!==s&&(s[n]=e);var u=this._promise,l=this._callback,d=u._boundValue();u._pushContext();var f=p(l).call(d,e,n,o),m=u._popContext();if(a.checkForgottenReturns(f,m,null!==s?"Promise.filter":"Promise.map",u),f===h)return this._reject(f.e),!0;var v=i(f,this._promise);if(v instanceof t){var g=(v=v._target())._bitField;if(0==(50397184&g))return c>=1&&this._inFlight++,r[n]=v,v._proxy(this,-1*(n+1)),!1;if(0==(33554432&g))return 0!=(16777216&g)?(this._reject(v._reason()),!0):(this._cancel(),!0);f=v._value()}r[n]=f}return++this._totalResolved>=o&&(null!==s?this._filter(r,s):this._resolve(r),!0)},s.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,n=this._values;e.length>0&&this._inFlight1){o.deprecated("calling Promise.try with more than 1 argument");var u=arguments[1],l=arguments[2];c=a.isArray(u)?s(e).apply(l,u):s(e).call(l,u)}else c=s(e)();var d=r._popContext();return o.checkForgottenReturns(c,d,"Promise.try",r),r._resolveFromSyncValue(c),r},t.prototype._resolveFromSyncValue=function(e){e===a.errorObj?this._rejectCallback(e.e,!1):this._resolveCallback(e,!0)}}},{"./util":36}],20:[function(e,t,n){"use strict";var r=e("./util"),i=r.maybeWrapAsError,o=e("./errors").OperationalError,a=e("./es5"),s=/^(?:name|message|stack|cause)$/;t.exports=function(e,t){return function(n,c){if(null!==e){if(n){var u=(function(e){var t;if((u=e)instanceof Error&&a.getPrototypeOf(u)===Error.prototype){(t=new o(e)).name=e.name,t.message=e.message,t.stack=e.stack;for(var n=a.keys(e),i=0;i1){var n,r=new Array(t-1),i=0;for(n=0;n0&&"function"!=typeof e&&"function"!=typeof t){var n=".then() only accepts functions but was passed: "+h.classString(e);arguments.length>1&&(n+=", "+h.classString(t)),this._warn(n)}return this._then(e,t,void 0,void 0,void 0)},i.prototype.done=function(e,t){this._then(e,t,void 0,void 0,void 0)._setIsFinal()},i.prototype.spread=function(e){return"function"!=typeof e?d("expecting a function but got "+h.classString(e)):this.all()._then(e,void 0,void 0,_,void 0)},i.prototype.toJSON=function(){var e={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(e.fulfillmentValue=this.value(),e.isFulfilled=!0):this.isRejected()&&(e.rejectionReason=this.reason(),e.isRejected=!0),e},i.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new E(this).promise()},i.prototype.error=function(e){return this.caught(h.originatesFromRejection,e)},i.getNewLibraryCopy=t.exports,i.is=function(e){return e instanceof i},i.fromNode=i.fromCallback=function(e){var t=new i(S);t._captureStackTrace();var n=arguments.length>1&&!!Object(arguments[1]).multiArgs,r=D(e)(A(t,n));return r===O&&t._rejectCallback(r.e,!0),t._isFateSealed()||t._setAsyncGuaranteed(),t},i.all=function(e){return new E(e).promise()},i.cast=function(e){var t=C(e);return t instanceof i||((t=new i(S))._captureStackTrace(),t._setFulfilled(),t._rejectionHandler0=e),t},i.resolve=i.fulfilled=i.cast,i.reject=i.rejected=function(e){var t=new i(S);return t._captureStackTrace(),t._rejectCallback(e,!0),t},i.setScheduler=function(e){if("function"!=typeof e)throw new y("expecting a function but got "+h.classString(e));return v.setScheduler(e)},i.prototype._then=function(e,t,n,r,o){var a=void 0!==o,s=a?o:new i(S),u=this._target(),l=u._bitField;a||(s._propagateFrom(this,3),s._captureStackTrace(),void 0===r&&0!=(2097152&this._bitField)&&(r=0!=(50397184&l)?this._boundValue():u===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,s));var d=c();if(0!=(50397184&l)){var p,f,m=u._settlePromiseCtx;0!=(33554432&l)?(f=u._rejectionHandler0,p=e):0!=(16777216&l)?(f=u._fulfillmentHandler0,p=t,u._unsetRejectionIsUnhandled()):(m=u._settlePromiseLateCancellationObserver,f=new b("late cancellation observer"),u._attachExtraTrace(f),p=t),v.invoke(m,u,{handler:null===d?p:"function"==typeof p&&h.domainBind(d,p),promise:s,receiver:r,value:f})}else u._addCallbacks(e,t,s,r,d);return s},i.prototype._length=function(){return 65535&this._bitField},i.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},i.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},i.prototype._setLength=function(e){this._bitField=-65536&this._bitField|65535&e},i.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},i.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},i.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},i.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},i.prototype._isFinal=function(){return(4194304&this._bitField)>0},i.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},i.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},i.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},i.prototype._setAsyncGuaranteed=function(){v.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},i.prototype._receiverAt=function(e){var t=0===e?this._receiver0:this[4*e-4+3];if(t!==p)return void 0===t&&this._isBound()?this._boundValue():t},i.prototype._promiseAt=function(e){return this[4*e-4+2]},i.prototype._fulfillmentHandlerAt=function(e){return this[4*e-4+0]},i.prototype._rejectionHandlerAt=function(e){return this[4*e-4+1]},i.prototype._boundValue=function(){},i.prototype._migrateCallback0=function(e){e._bitField;var t=e._fulfillmentHandler0,n=e._rejectionHandler0,r=e._promise0,i=e._receiverAt(0);void 0===i&&(i=p),this._addCallbacks(t,n,r,i,null)},i.prototype._migrateCallbackAt=function(e,t){var n=e._fulfillmentHandlerAt(t),r=e._rejectionHandlerAt(t),i=e._promiseAt(t),o=e._receiverAt(t);void 0===o&&(o=p),this._addCallbacks(n,r,i,o,null)},i.prototype._addCallbacks=function(e,t,n,r,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,"function"==typeof e&&(this._fulfillmentHandler0=null===i?e:h.domainBind(i,e)),"function"==typeof t&&(this._rejectionHandler0=null===i?t:h.domainBind(i,t));else{var a=4*o-4;this[a+2]=n,this[a+3]=r,"function"==typeof e&&(this[a+0]=null===i?e:h.domainBind(i,e)),"function"==typeof t&&(this[a+1]=null===i?t:h.domainBind(i,t))}return this._setLength(o+1),o},i.prototype._proxy=function(e,t){this._addCallbacks(void 0,void 0,t,e,null)},i.prototype._resolveCallback=function(e,t){if(0==(117506048&this._bitField)){if(e===this)return this._rejectCallback(u(),!1);var n=C(e,this);if(!(n instanceof i))return this._fulfill(e);t&&this._propagateFrom(n,2);var r=n._target();if(r!==this){var o=r._bitField;if(0==(50397184&o)){var a=this._length();a>0&&r._migrateCallback0(this);for(var s=1;s>>16)){if(e===this){var n=u();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=e,(65535&t)>0&&(0!=(134217728&t)?this._settlePromises():v.settlePromises(this))}},i.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return v.fatalError(e,h.isNode);(65535&t)>0?v.settlePromises(this):this._ensurePossibleRejectionHandled()}},i.prototype._fulfillPromises=function(e,t){for(var n=1;n0){if(0!=(16842752&e)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,e),this._rejectPromises(t,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,e),this._fulfillPromises(t,r)}this._setLength(0)}this._clearCancellationData()},i.prototype._settledValue=function(){var e=this._bitField;return 0!=(33554432&e)?this._rejectionHandler0:0!=(16777216&e)?this._fulfillmentHandler0:void 0},i.defer=i.pending=function(){return k.deprecated("Promise.defer","new Promise"),{promise:new i(S),resolve:o,reject:a}},h.notEnumerableProp(i,"_makeSelfResolutionError",u),e("./method")(i,S,C,d,k),e("./bind")(i,S,C,k),e("./cancel")(i,E,d,k),e("./direct_resolve")(i),e("./synchronous_inspection")(i),e("./join")(i,E,C,S,v,c),i.Promise=i,i.version="3.5.1",e("./map.js")(i,E,d,C,S,k),e("./call_get.js")(i),e("./using.js")(i,d,C,R,S,k),e("./timers.js")(i,S,k),e("./generators.js")(i,d,S,C,r,k),e("./nodeify.js")(i),e("./promisify.js")(i,S),e("./props.js")(i,E,C,d),e("./race.js")(i,S,C,d),e("./reduce.js")(i,E,d,C,S,k),e("./settle.js")(i,E,k),e("./some.js")(i,E,d),e("./filter.js")(i,S),e("./each.js")(i,S),e("./any.js")(i),h.toFastProperties(i),h.toFastProperties(i.prototype),s({a:1}),s({b:2}),s({c:3}),s(1),s(function(){}),s(void 0),s(!1),s(new i(S)),k.setBounds(m.firstLineError,h.lastLineError),i}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(e,t,n){"use strict";t.exports=function(t,n,r,i,o){function a(e){var r=this._promise=new t(n);e instanceof t&&r._propagateFrom(e,3),r._setOnCancel(this),this._values=e,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var s=e("./util");return s.isArray,s.inherits(a,o),a.prototype.length=function(){return this._length},a.prototype.promise=function(){return this._promise},a.prototype._init=function e(n,o){var a=r(this._values,this._promise);if(a instanceof t){var c=(a=a._target())._bitField;if(this._values=a,0==(50397184&c))return this._promise._setAsyncGuaranteed(),a._then(e,this._reject,void 0,this,o);if(0==(33554432&c))return 0!=(16777216&c)?this._reject(a._reason()):this._cancel();a=a._value()}if(null!==(a=s.asArray(a)))0!==a.length?this._iterate(a):-5===o?this._resolveEmptyArray():this._resolve((function(e){switch(o){case-2:return[];case-3:return{};case-6:return new Map}})());else{var u=i("expecting an array or an iterable object but got "+s.classString(a)).reason();this._promise._rejectCallback(u,!1)}},a.prototype._iterate=function(e){var n=this.getActualLength(e.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var i=this._promise,o=!1,a=null,s=0;s=this._length&&(this._resolve(this._values),!0)},a.prototype._promiseCancelled=function(){return this._cancel(),!0},a.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},a.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof t)e.cancel();else for(var n=0;n=this._length){var n;if(this._isMap)n=(function(e){for(var t=new s,n=e.length/2|0,r=0;r>1},t.prototype.props=function(){return a(this)},t.props=function(e){return a(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,n){"use strict";function r(e){this._capacity=e,this._length=0,this._front=0}r.prototype._willBeOverCapacity=function(e){return this._capacity=this._length&&(this._resolve(this._values),!0)},i.prototype._promiseFulfilled=function(e,t){var n=new o;return n._bitField=33554432,n._settledValueField=e,this._promiseResolved(t,n)},i.prototype._promiseRejected=function(e,t){var n=new o;return n._bitField=16777216,n._settledValueField=e,this._promiseResolved(t,n)},t.settle=function(e){return r.deprecated(".settle()",".reflect()"),new i(e).promise()},t.prototype.settle=function(){return t.settle(this)}}},{"./util":36}],31:[function(e,t,n){"use strict";t.exports=function(t,n,r){function i(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(e,t){if((0|t)!==t||t<0)return r("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var n=new i(e),o=n.promise();return n.setHowMany(t),n.init(),o}var a=e("./util"),s=e("./errors").RangeError,c=e("./errors").AggregateError,u=a.isArray,l={};a.inherits(i,n),i.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=u(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(e){this._howMany=e},i.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},i.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},i.prototype._promiseCancelled=function(){return this._values instanceof t||null==this._values?this._cancel():(this._addRejected(l),this._checkOutcome())},i.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new c,t=this.length();t0?this._reject(e):this._cancel(),!0}return!1},i.prototype._fulfilled=function(){return this._totalResolved},i.prototype._rejected=function(){return this._values.length-this.length()},i.prototype._addRejected=function(e){this._values.push(e)},i.prototype._addFulfilled=function(e){this._values[this._totalResolved++]=e},i.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},i.prototype._getRangeError=function(e){var t="Input array must contain at least "+this._howMany+" items but contains only "+e+" items";return new s(t)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},t.some=function(e,t){return o(e,t)},t.prototype.some=function(e){return o(this,e)},t._SomePromiseArray=i}},{"./errors":12,"./util":36}],32:[function(e,t,n){"use strict";t.exports=function(e){function t(e){void 0!==e?(e=e._target(),this._bitField=e._bitField,this._settledValueField=e._isFateSealed()?e._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}t.prototype._settledValue=function(){return this._settledValueField};var n=t.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},r=t.prototype.error=t.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=t.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},o=t.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},a=t.prototype.isPending=function(){return 0==(50397184&this._bitField)},s=t.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};t.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},e.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},e.prototype._isCancelled=function(){return this._target().__isCancelled()},e.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},e.prototype.isPending=function(){return a.call(this._target())},e.prototype.isRejected=function(){return o.call(this._target())},e.prototype.isFulfilled=function(){return i.call(this._target())},e.prototype.isResolved=function(){return s.call(this._target())},e.prototype.value=function(){return n.call(this._target())},e.prototype.reason=function(){var e=this._target();return e._unsetRejectionIsUnhandled(),r.call(e)},e.prototype._value=function(){return this._settledValue()},e.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},e.PromiseInspection=t}},{}],33:[function(e,t,n){"use strict";t.exports=function(t,n){var r=e("./util"),i=r.errorObj,o=r.isObject,a={}.hasOwnProperty;return function(e,s){if(o(e)){if(e instanceof t)return e;var c=(function(e){try{return e.then}catch(e){return i.e=e,i}})(e);if(c===i){s&&s._pushContext();var u=t.reject(c.e);return s&&s._popContext(),u}if("function"==typeof c)return(function(e){try{return a.call(e,"_promise0")}catch(e){return!1}})(e)?(u=new t(n),e._then(u._fulfill,u._reject,void 0,u,null),u):(function(e,o,a){var s=new t(n),c=s;a&&a._pushContext(),s._captureStackTrace(),a&&a._popContext();var u=!0,l=r.tryCatch(o).call(e,function(e){s&&(s._resolveCallback(e),s=null)},function(e){s&&(s._rejectCallback(e,u,!0),s=null)});return u=!1,s&&l===i&&(s._rejectCallback(l.e,!0,!0),s=null),c})(e,c,s)}return e}}},{"./util":36}],34:[function(e,t,n){"use strict";t.exports=function(t,n,r){function i(e){this.handle=e}function o(e){return clearTimeout(this.handle),e}function a(e){throw clearTimeout(this.handle),e}var s=e("./util"),c=t.TimeoutError;i.prototype._resultCancelled=function(){clearTimeout(this.handle)};var u=function(e){return l(+this).thenReturn(e)},l=t.delay=function(e,o){var a,s;return void 0!==o?(a=t.resolve(o)._then(u,null,null,e,void 0),r.cancellation()&&o instanceof t&&a._setOnCancel(o)):(a=new t(n),s=setTimeout(function(){a._fulfill()},+e),r.cancellation()&&a._setOnCancel(new i(s)),a._captureStackTrace()),a._setAsyncGuaranteed(),a};t.prototype.delay=function(e){return l(e,this)},t.prototype.timeout=function(e,t){e=+e;var n,u,l=new i(setTimeout(function(){n.isPending()&&(function(e,t,n){var r;r="string"!=typeof t?t instanceof Error?t:new c("operation timed out"):new c(t),s.markAsOriginatingFromRejection(r),e._attachExtraTrace(r),e._reject(r),null!=n&&n.cancel()})(n,t,u)},e));return r.cancellation()?(u=this.then(),(n=u._then(o,a,void 0,l,void 0))._setOnCancel(l)):n=this._then(o,a,void 0,l,void 0),n}}},{"./util":36}],35:[function(e,t,n){"use strict";t.exports=function(t,n,r,i,o,a){function s(e){setTimeout(function(){throw e},0)}function c(e,t,n){this._data=e,this._promise=t,this._context=n}function u(e,t,n){this.constructor$(e,t,n)}function l(e){return c.isDisposer(e)?(this.resources[this.index]._setDisposable(e),e.promise()):e}function d(e){this.length=e,this.promise=null,this[e-1]=null}var p=e("./util"),h=e("./errors").TypeError,f=e("./util").inherits,m=p.errorObj,v=p.tryCatch,g={};c.prototype.data=function(){return this._data},c.prototype.promise=function(){return this._promise},c.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():g},c.prototype.tryDispose=function(e){var t=this.resource(),n=this._context;void 0!==n&&n._pushContext();var r=t!==g?this.doDispose(t,e):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},c.isDisposer=function(e){return null!=e&&"function"==typeof e.resource&&"function"==typeof e.tryDispose},f(u,c),u.prototype.doDispose=function(e,t){return this.data().call(e,e,t)},d.prototype._resultCancelled=function(){for(var e=this.length,n=0;n=a)return c._fulfill();var u=(function(e){var t=r(e);return t!==e&&"function"==typeof e._isDisposable&&"function"==typeof e._getDisposer&&e._isDisposable()&&t._setDisposable(e._getDisposer()),t})(e[i++]);if(u instanceof t&&u._isDisposable()){try{u=r(u._getDisposer().tryDispose(n),e.promise)}catch(e){return s(e)}if(u instanceof t)return u._then(o,s,null,null,null)}o()})(),c})(f,e)});return f.promise=C,C._setOnCancel(f),C},t.prototype._setDisposable=function(e){this._bitField=131072|this._bitField,this._disposer=e},t.prototype._isDisposable=function(){return(131072&this._bitField)>0},t.prototype._getDisposer=function(){return this._disposer},t.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},t.prototype.disposer=function(e){if("function"==typeof e)return new u(e,this,i());throw new h}}},{"./errors":12,"./util":36}],36:[function(e,t,i){"use strict";function o(){try{var e=h;return h=null,e.apply(this,arguments)}catch(e){return v.e=e,v}}function a(e){return null==e||!0===e||!1===e||"string"==typeof e||"number"==typeof e}function s(e,t,n){if(a(e))return e;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return f.defineProperty(e,t,r),e}function u(e){try{return e+""}catch(e){return"[no string representation]"}}function l(e){return e instanceof Error||null!==e&&"object"===(void 0===e?"undefined":c(e))&&"string"==typeof e.message&&"string"==typeof e.name}function d(e){return l(e)&&f.propertyIsWritable(e,"stack")}function p(e){return{}.toString.call(e)}var h,f=e("./es5"),m="undefined"==typeof navigator,v={e:{}},g="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r?r:void 0!==this?this:null,y=(function(){var e=[Array.prototype,Object.prototype,Function.prototype],t=function(t){for(var n=0;n1,r=t.length>0&&!(1===t.length&&"constructor"===t[0]),i=b.test(e+"")&&f.names(e).length>0;if(n||r||i)return!0}return!1}catch(e){return!1}},isIdentifier:function(e){return S.test(e)},inheritedDataKeys:y,getDataPropertyOrDefault:function(e,t,n){if(!f.isES5)return{}.hasOwnProperty.call(e,t)?e[t]:void 0;var r=Object.getOwnPropertyDescriptor(e,t);return null!=r?null==r.get&&null==r.set?r.value:n:void 0},thrower:function(e){throw e},isArray:f.isArray,asArray:T,notEnumerableProp:s,isPrimitive:a,isObject:function(e){return"function"==typeof e||"object"===(void 0===e?"undefined":c(e))&&null!==e},isError:l,canEvaluate:m,errorObj:v,tryCatch:function(e){return h=e,o},inherits:function(e,t){function n(){this.constructor=e,this.constructor$=t;for(var n in t.prototype)r.call(t.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=t.prototype[n])}var r={}.hasOwnProperty;return n.prototype=t.prototype,e.prototype=new n,e.prototype},withAppended:function(e,t){var n,r=e.length,i=new Array(r+1);for(n=0;n10||e[0]>0})(),R.isNode&&R.toFastProperties(n);try{throw new Error}catch(e){R.lastLineError=e}t.exports=R},{"./es5":13}]},{},[4])(4)},"object"==c(t)&&void 0!==e?e.exports=u():(a=[],void 0===(s="function"==typeof(o=u)?o.apply(t,a):o)||(e.exports=s)),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise);var u}).call(t,n(34),n(20),n(40).setImmediate)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"CONNECTION_DISCONNECTED",function(){return r}),n.d(t,"CONNECTION_ESTABLISHED",function(){return i}),n.d(t,"CONNECTION_FAILED",function(){return o}),n.d(t,"WRONG_STATE",function(){return a});var r="connection.connectionDisconnected",i="connection.connectionEstablished",o="connection.connectionFailed",a="connection.wrongState"},function(e,t,n){"use strict";(function(e){var r=n(0),i=(n.n(r),n(124)),o=n(3),a=n.n(o),s=n(7),c=n(125),u=n(12),l=n(17),d=n(10),p=n(148),h=n(4),f=n(1),m=n(9),v=n.n(m),g=n(28),y=n(5),b=n(149),S=n(13),_=n.n(S),T=(function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};!(function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this);var r=(function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t})(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.conference=e,r.peerConnections=new Map,r.localTracks=[],r.options=n,r._channel=null,r._channelOpen=!1,r._lastN=-1,r._lastNEndpoints=null,r._pinnedEndpoint=null,r._selectedEndpoint=null,r._lastNChangeListener=r._onLastNChanged.bind(r),g.a.isDeviceChangeAvailable("output")&&(g.a.addListener(v.a.AUDIO_OUTPUT_DEVICE_CHANGED,function(e){return r._updateAudioOutputForAudioTracks(e)}),g.a.addListener(v.a.DEVICE_LIST_CHANGED,function(){return r._updateAudioOutputForAudioTracks(g.a.getAudioOutputDevice())})),r}return(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)})(t,d.a),T(t,[{key:"initializeBridgeChannel",value:function(e,t){var n=this;this._channel=new i.a(e,t,this.eventEmitter),this._channelOpenListener=function(){n._channelOpen=!0;try{n._channel.sendPinnedEndpointMessage(n._pinnedEndpoint),n._channel.sendSelectedEndpointMessage(n._selectedEndpoint)}catch(e){a.a.callErrorHandler(e),E.error("Cannot send selected("+n._selectedEndpoint+")pinned("+n._pinnedEndpoint+") endpoint message.",e)}n.removeListener(v.a.DATA_CHANNEL_OPEN,n._channelOpenListener),n._channelOpenListener=null,-1!==n._lastN&&n._channel.sendSetLastNMessage(n._lastN)},this.addListener(v.a.DATA_CHANNEL_OPEN,this._channelOpenListener),this.addListener(v.a.LASTN_ENDPOINT_CHANGED,this._lastNChangeListener)}},{key:"_onLastNChanged",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this._lastNEndpoints||[],r=[],i=[];this._lastNEndpoints=t,r=n.filter(function(t){return!e.isInLastN(t)}),i=t.filter(function(e){return-1===n.indexOf(e)}),this.conference.eventEmitter.emit(s.LAST_N_ENDPOINTS_CHANGED,r,i)}},{key:"onCallEnded",value:function(){this._channel&&(this._channel&&"websocket"===this._channel.mode&&this._channel.close(),this._channel=null,this._channelOpen=!1)}},{key:"setReceiverVideoConstraint",value:function(e){this._channel&&this._channel.sendReceiverVideoConstraintMessage(e)}},{key:"selectEndpoint",value:function(e){this._selectedEndpoint=e,this._channel&&this._channelOpen&&this._channel.sendSelectedEndpointMessage(e)}},{key:"pinEndpoint",value:function(e){this._pinnedEndpoint=e,this._channel&&this._channelOpen&&this._channel.sendPinnedEndpointMessage(e)}},{key:"createPeerConnection",value:function(e,n,r,i){var o=t.getPCConstraints(r);void 0!==i.abtestSuspendVideo&&(g.a.setSuspendVideo(o,i.abtestSuspendVideo),y.a.analytics.addPermanentProperties({abtestSuspendVideo:i.abtestSuspendVideo})),w=Object(p.a)(w);var a=new b.a(this,w,e,n,o,r,i);return this.peerConnections.set(a.id,a),a}},{key:"_removePeerConnection",value:function(e){var t=e.id;return!!this.peerConnections.has(t)&&(this.peerConnections.delete(t),!0)}},{key:"addLocalTrack",value:function(e){if(!e)throw new Error("track must not be null nor undefined");this.localTracks.push(e),e.conference=this.conference}},{key:"getLastN",value:function(){return this._lastN}},{key:"getLocalVideoTrack",value:function(){var e=this.getLocalTracks(h.b);return e.length?e[0]:void 0}},{key:"getLocalAudioTrack",value:function(){var e=this.getLocalTracks(h.a);return e.length?e[0]:void 0}},{key:"getLocalTracks",value:function(e){var t=this.localTracks.slice();return void 0!==e&&(t=t.filter(function(t){return t.getType()===e})),t}},{key:"getRemoteTracks",value:function(e){var t=[],n=!0,r=!1,i=void 0;try{for(var o,a=this.peerConnections.values()["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(n=(o=a.next()).done);n=!0){var s=o.value.getRemoteTracks(void 0,e);s&&(t=t.concat(s))}}catch(e){r=!0,i=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw i}}return t}},{key:"setAudioMute",value:function(e){var t=[];return this.getLocalTracks(h.a).forEach(function(n){t.push(e?n.mute():n.unmute())}),Promise.all(t)}},{key:"removeLocalTrack",value:function(e){var t=this.localTracks.indexOf(e);-1!==t&&this.localTracks.splice(t,1)}},{key:"removeRemoteTracks",value:function(e){var t=[],n=!0,r=!1,i=void 0;try{for(var o,a=this.peerConnections.values()["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(n=(o=a.next()).done);n=!0){var s=o.value.removeRemoteTracks(e);t=t.concat(s)}}catch(e){r=!0,i=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw i}}return E.debug("Removed remote tracks for "+e+" count: "+t.length),t}},{key:"closeBridgeChannel",value:function(){this._channel&&(this._channel.close(),this._channelOpen=!1,this.removeListener(v.a.LASTN_ENDPOINT_CHANGED,this._lastNChangeListener))}},{key:"setAudioLevel",value:function(e,t,n,r){var i=e.getTrackBySSRC(t);i&&(i.isAudioTrack()?(i.isLocal()!==r&&E.error(i+" was expected to "+(r?"be":"not be")+" local"),i.setAudioLevel(n,e)):E.warn("Received audio level for non-audio track: "+t))}},{key:"sendChannelMessage",value:function(e,t){if(!this._channel)throw new Error("Channel support is disabled!");this._channel.sendMessage(e,t)}},{key:"setLastN",value:function(e){this._lastN!==e&&(this._lastN=e,this._channel&&this._channelOpen&&this._channel.sendSetLastNMessage(e),this.eventEmitter.emit(v.a.LASTN_VALUE_CHANGED,e))}},{key:"isInLastN",value:function(e){return!this._lastNEndpoints||this._lastNEndpoints.indexOf(e)>-1}},{key:"_updateAudioOutputForAudioTracks",value:function(e){var t=this.getRemoteTracks(h.a),n=!0,r=!1,i=void 0;try{for(var o,a=t["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(n=(o=a.next()).done);n=!0)o.value.setAudioOutput(e)}catch(e){r=!0,i=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw i}}}}],[{key:"obtainAudioAndVideoPermissions",value:function(e){var t=f.b.usesNewGumFlow();return(t?g.a.newObtainAudioAndVideoPermissions(e):g.a.obtainAudioAndVideoPermissions(e)).then(function(n){var r=t?(function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(function(e){var t=e.sourceId,n=e.sourceType,r=e.stream,i=e.track,o=e.videoType,a=i.getSettings(),s=a.deviceId,u=a.facingMode;return R=Object(p.a)(R),new c.a({deviceId:s,facingMode:u,mediaType:i.kind,rtcId:R,sourceId:t,sourceType:n,stream:r,track:i,videoType:o||null})})})(n):(function(e,t){var r=[],i=null;return n.forEach(function(e){e.mediaType===h.a?i=t.micDeviceId:e.videoType===_.a.CAMERA&&(i=t.cameraDeviceId),R=Object(p.a)(R);var n=new c.a(C({},e,{deviceId:i,facingMode:t.facingMode,rtcId:R}));r.push(n)}),r})(0,e);return r.some(function(e){return!e._isReceivingData()})?Promise.reject(new u.a(l.NO_DATA_FROM_SOURCE)):r})}},{key:"addListener",value:function(e,t){g.a.addListener(e,t)}},{key:"removeListener",value:function(e,t){g.a.removeListener(e,t)}},{key:"isRTCReady",value:function(){return g.a.isRTCReady()}},{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.options=e,g.a.init(this.options)}},{key:"getDeviceAvailability",value:function(){return g.a.getDeviceAvailability()}},{key:"getPCConstraints",value:function(e){var t=e?g.a.p2pPcConstraints:g.a.pcConstraints;return t?JSON.parse(JSON.stringify(t)):{}}},{key:"attachMediaStream",value:function(e,t){return g.a.attachMediaStream(e,t)}},{key:"getStreamID",value:function(e){return g.a.getStreamID(e)}},{key:"getTrackID",value:function(e){return g.a.getTrackID(e)}},{key:"isDeviceListAvailable",value:function(){return g.a.isDeviceListAvailable()}},{key:"isDeviceChangeAvailable",value:function(e){return g.a.isDeviceChangeAvailable(e)}},{key:"getAudioOutputDevice",value:function(){return g.a.getAudioOutputDevice()}},{key:"getCurrentlyAvailableMediaDevices",value:function(){return g.a.getCurrentlyAvailableMediaDevices()}},{key:"getEventDataForActiveDevice",value:function(e){return g.a.getEventDataForActiveDevice(e)}},{key:"setAudioOutputDevice",value:function(e){return g.a.setAudioOutputDevice(e)}},{key:"isUserStream",value:function(e){return t.isUserStreamById(g.a.getStreamID(e))}},{key:"isUserStreamById",value:function(e){return e&&"mixedmslabel"!==e&&"default"!==e}},{key:"enumerateDevices",value:function(e){g.a.enumerateDevices(e)}},{key:"stopMediaStream",value:function(e){g.a.stopMediaStream(e)}},{key:"isDesktopSharingEnabled",value:function(){return g.a.isDesktopSharingEnabled()}}]),t})();t.a=k}).call(t,"modules/RTC/RTC.js")},function(e,t,n){"use strict";(function(e){function r(e,t){var n={audio:!1,video:!1},r=I.b.isFirefox()||I.b.isEdge()||I.b.isReactNative()||I.b.isTemasysPluginUsed();if(e.indexOf("video")>=0){if(n.video={mandatory:{},optional:[]},t.cameraDeviceId)r&&(n.video.deviceId=t.cameraDeviceId),n.video.optional.push({sourceId:t.cameraDeviceId});else{var i=t.facingMode||g.a.USER;r&&(n.video.facingMode=i),n.video.optional.push({facingMode:i})}(t.minFps||t.maxFps||t.fps)&&((t.minFps||t.fps)&&(t.minFps=t.minFps||t.fps,n.video.mandatory.minFrameRate=t.minFps),t.maxFps&&(n.video.mandatory.maxFrameRate=t.maxFps)),o=n,a=r,s=t.resolution,k.a[s]&&(a&&(o.video.width={ideal:k.a[s].width},o.video.height={ideal:k.a[s].height}),o.video.mandatory.minWidth=k.a[s].width,o.video.mandatory.minHeight=k.a[s].height),o.video.mandatory.minWidth&&(o.video.mandatory.maxWidth=o.video.mandatory.minWidth),o.video.mandatory.minHeight&&(o.video.mandatory.maxHeight=o.video.mandatory.minHeight)}var o,a,s;if(e.indexOf("audio")>=0&&(I.b.isReactNative()?n.audio=!0:I.b.isFirefox()?t.micDeviceId?n.audio={mandatory:{},deviceId:t.micDeviceId,optional:[{sourceId:t.micDeviceId}]}:n.audio=!0:(n.audio={mandatory:{},optional:[]},t.micDeviceId&&(r&&(n.audio.deviceId=t.micDeviceId),n.audio.optional.push({sourceId:t.micDeviceId})),n.audio.optional.push({echoCancellation:!K&&!q},{googEchoCancellation:!K&&!q},{googAutoGainControl:!Q&&!q},{googNoiseSuppression:!z&&!q},{googHighpassFilter:!X&&!q},{googNoiseSuppression2:!z&&!q},{googEchoCancellation2:!K&&!q},{googAutoGainControl2:!Q&&!q}))),e.indexOf("screen")>=0)if(I.b.isChrome())n.video={mandatory:{chromeMediaSource:"screen",maxWidth:window.screen.width,maxHeight:window.screen.height,maxFrameRate:3},optional:[]};else if(I.b.isTemasysPluginUsed())n.video={optional:[{sourceId:H.WebRTCPlugin.plugin.screensharingKey}]};else if(I.b.isFirefox())n.video={mozMediaSource:"window",mediaSource:"window"};else{var c="'screen' WebRTC media source is supported only in Chrome and with Temasys plugin";T.a.callErrorHandler(new Error(c)),U.error(c)}return e.indexOf("desktop")>=0&&(n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t.desktopStream,maxWidth:window.screen.width,maxHeight:window.screen.height,maxFrameRate:3},optional:[]}),t.bandwidth&&(n.video||(n.video={mandatory:{},optional:[]}),n.video.optional.push({bandwidth:t.bandwidth})),I.b.isFirefox()&&t.firefox_fake_device&&(n.fake=!0),n}function i(e,t){var n=t&&t.getAudioTracks().length>0,r=t&&t.getVideoTracks().length>0;-1!==e.indexOf("video")&&(J.video=r),-1!==e.indexOf("audio")&&(J.audio=n),B.emit(A.a.AVAILABLE_DEVICES_CHANGED,J)}function o(){te&&te(function(e){void 0===ee?ee=e.slice(0):(function(e){function t(e){return JSON.stringify({kind:e.kind,deviceId:e.deviceId,groupId:e.groupId,label:e.label,facing:e.facing})}return e.length!==ee.length||e.map(t).sort().join("")!==ee.map(t).sort().join("")})(e)&&s(e),window.setTimeout(o,G)})}function a(e){var t=e.filter(function(e){return"audioinput"===e.kind}).length,n=e.filter(function(e){return"audiooutput"===e.kind}).length,r=e.filter(function(e){return"videoinput"===e.kind}).length,i=e.filter(function(e){return"videooutput"===e.kind}).length;e.forEach(function(e){var o={audio_input_device_count:t,audio_output_device_count:n,video_input_device_count:r,video_output_device_count:i,device_id:e.deviceId,device_group_id:e.groupId,device_kind:e.kind,device_label:e.label};N.a.sendAnalytics(m.j,o)})}function s(e){ee=e.slice(0),U.info("list of media devices has changed:",ee),a(ee);var t=ee.filter(function(e){return"videoinput"===e.kind}),n=ee.filter(function(e){return"audioinput"===e.kind}),r=t.filter(function(e){return""===e.label}),i=n.filter(function(e){return""===e.label});t.length&&t.length===r.length&&(J.video=!1),n.length&&n.length===i.length&&(J.audio=!1),B.emit(A.a.DEVICE_LIST_CHANGED,e)}function c(e,t){e&&e.apply(void 0,(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1&&void 0!==arguments[1]&&arguments[1]?function(t,n,r){return e(t).then(function(e){return c(n,[e]),e}).catch(function(e){throw c(r,[e]),e})}:function(t,n,r){e(t,function(e){c(n,[e])},function(e){c(r,[e])})}}function l(e){MediaStreamTrack.getSources(function(t){return e(t.map(d))})}function d(e){var t=(e.kind||"").toLowerCase();return{facing:e.facing||null,label:e.label,kind:t?"audiooutput"===t?t:t+"input":null,deviceId:e.id,groupId:e.groupId||null}}function p(e,t){var n="srcObject";if(n in e||(n="mozSrcObject")in e||(n=null),n)e[n]=t;else{var r=void 0;t&&((r=t.jitsiObjectURL)||(t.jitsiObjectURL=r=(URL||webkitURL).createObjectURL(t))),e.src=r||""}}function h(e,t){re=!0,B.emit(A.a.RTC_READY,!0),D.a.init(e,t),oe.isDeviceListAvailable()&&te&&te(function(e){ee=e.splice(0),U.info("Available devices: ",ee),a(ee),B.emit(A.a.DEVICE_LIST_AVAILABLE,ee),ne?navigator.mediaDevices.addEventListener("devicechange",function(){return oe.enumerateDevices(s)}):o()})}function f(e){return function(t,n){var r=e.apply(oe,arguments);return n&&oe.isDeviceChangeAvailable("output")&&n.getAudioTracks&&n.getAudioTracks().length&&W&&t.setSinkId(oe.getAudioOutputDevice()).catch(function(e){var n=new C.a(e,null,["audiooutput"]);T.a.callUnhandledRejectionHandler({promise:this,reason:n}),U.warn("Failed to set audio output device for the element. Default audio output device will be used instead",t,n)}),r}}var m=n(6),v=n(56),g=n.n(v),y=n(16),b=n.n(y),S=n(0),_=(n.n(S),n(3)),T=n.n(_),C=n(12),E=n(10),w=n(4),R=n(35),k=n.n(R),I=n(1),P=n(9),A=n.n(P),O=n(126),D=n(135),x=n(14),N=n(5),L=n(13),M=n.n(L),j=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return"boolean"==typeof t.disableAEC&&(K=t.disableAEC,U.info("Disable AEC: "+K)),"boolean"==typeof t.disableNS&&(z=t.disableNS,U.info("Disable NS: "+z)),"boolean"==typeof t.disableAP&&(q=t.disableAP,U.info("Disable AP: "+q)),"boolean"==typeof t.disableAGC&&(Q=t.disableAGC,U.info("Disable AGC: "+Q)),"boolean"==typeof t.disableHPF&&(X=t.disableHPF,U.info("Disable HPF: "+X)),te=navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?function(e){navigator.mediaDevices.enumerateDevices().then(e,function(){return e([])})}:MediaStreamTrack&&MediaStreamTrack.getSources?function(e){MediaStreamTrack.getSources(function(t){return e(t.map(d))})}:void 0,new Promise(function(n,r){if(I.b.usesNewGumFlow())e.RTCPeerConnectionType=window.RTCPeerConnection,e.getUserMedia=function(e,t,n){return window.navigator.mediaDevices.getUserMedia(e).then(function(e){return t&&t(e),e}).catch(function(e){return n&&n(e),Promise.reject(e)})},e.enumerateDevices=function(e){return window.navigator.mediaDevices.enumerateDevices().then(function(t){return e(t),t}).catch(function(t){return U.error("Error enumerating devices: "+t),e([]),[]})},e.attachMediaStream=f(function(e,t){return e&&(e.srcObject=t),e}),e.getStreamID=function(e){return e.id},e.getTrackID=function(e){return e.id};else if(I.b.isChrome()||I.b.isOpera()||I.b.isNWJS()||I.b.isElectron()||I.b.isReactNative()){e.RTCPeerConnectionType=webkitRTCPeerConnection;var i=navigator.webkitGetUserMedia.bind(navigator);e.getUserMedia=u(i),e.enumerateDevices=te,e.attachMediaStream=f(function(e,t){return p(e,t),e}),e.getStreamID=function(e){var t=e.id;return"number"==typeof t?t:x.a.filterSpecialChars(t)},e.getTrackID=function(e){return e.id},webkitMediaStream.prototype.getVideoTracks||(webkitMediaStream.prototype.getVideoTracks=function(){return this.videoTracks}),webkitMediaStream.prototype.getAudioTracks||(webkitMediaStream.prototype.getAudioTracks=function(){return this.audioTracks})}else if(I.b.isEdge())e.RTCPeerConnectionType=O.a,e.getUserMedia=u(navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices),!0),e.enumerateDevices=te,e.attachMediaStream=f(function(e,t){return p(e,t),e}),e.getStreamID=function(e){var t=e.jitsiRemoteId||e.id;return x.a.filterSpecialChars(t)},e.getTrackID=function(e){return e.jitsiRemoteId||e.id};else{if(!I.b.isTemasysPluginUsed())return void(function(e,t){var n=new Error(e);n.name="WEBRTC_NOT_SUPPORTED",U.error(e),t(n)})("Browser does not appear to be WebRTC-capable",r);var o=new Promise(function(e){return H.webRTCReady(e)});H.WebRTCPlugin.isPluginInstalled(H.WebRTCPlugin.pluginInfo.prefix,H.WebRTCPlugin.pluginInfo.plugName,H.WebRTCPlugin.pluginInfo.type,function(){o.then(function(){e.RTCPeerConnectionType=RTCPeerConnection,e.getUserMedia=window.getUserMedia,e.enumerateDevices=l,e.attachMediaStream=f(function(e,t){if(t){if("dummyAudio"===t.id||"dummyVideo"===t.id)return;var n=$(e);if(I.b.isTemasysPluginUsed()&&!n.is(":visible")&&n.show(),t.getVideoTracks().length>0&&!$(e).is(":visible"))throw new Error("video element must be visible to attach video stream")}return attachMediaStream(e,t)}),e.getStreamID=function(e){return x.a.filterSpecialChars(e.label)},e.getTrackID=function(e){return e.id},h(t,e.getUserMediaWithConstraints.bind(e)),n()})},function(){var e=new Error("Temasys plugin is not installed");e.name="WEBRTC_NOT_READY",e.webRTCReadyPromise=o,r(e)})}e._initPCConstraints(t),I.b.isTemasysPluginUsed()||(h(t,e.getUserMediaWithConstraints.bind(e)),n())})}},{key:"_initPCConstraints",value:function(e){I.b.isFirefox()?this.pcConstraints={}:(I.b.isChrome()||I.b.isOpera()||I.b.isNWJS()||I.b.isElectron()||I.b.isReactNative())&&(this.pcConstraints={optional:[{googHighStartBitrate:0},{googPayloadPadding:!0},{googScreencastMinBitrate:400},{googCpuOveruseDetection:!0},{googCpuOveruseEncodeUsage:!0},{googCpuUnderuseThreshold:55},{googCpuOveruseThreshold:85}]},e.useIPv6&&this.pcConstraints.optional.push({googIPv6:!0}),this.p2pPcConstraints=JSON.parse(JSON.stringify(this.pcConstraints)),e.disableSuspendVideo||this.pcConstraints.optional.push({googSuspendBelowMinBitrate:!0}),this.p2pPcConstraints.optional.push({googSuspendBelowMinBitrate:!0})),this.p2pPcConstraints=this.p2pPcConstraints||this.pcConstraints}},{key:"getUserMediaWithConstraints",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=r(e,o);U.info("Get media constraints",a);try{this.getUserMedia(a,function(n){U.log("onUserMediaSuccess"),i(e,n),t(n)},function(t){i(e,void 0),U.warn("Failed to get access to local media. Error ",t,a),n&&n(new C.a(t,a,e))})}catch(t){U.error("GUM failed: ",t),n&&n(new C.a(t,a,e))}}},{key:"_newGetUserMediaWithConstraints",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(r,o){try{t.getUserMedia(n).then(function(t){U.log("onUserMediaSuccess"),i(e,t),r(t)}).catch(function(t){U.warn("Failed to get access to local media. "+t+" "+n+" "),i(e,void 0),o(new C.a(t,n,e))})}catch(t){U.error("GUM failed: "+t),o(new C.a(t,n,e))}})}},{key:"_newGetDesktopMedia",value:function(e,t){if(!D.a.isSupported()||!I.b.supportsVideo())return Promise.reject(new Error("Desktop sharing is not supported!"));var n=j({},e,{desktopSharingSources:t});return new Promise(function(e,t){D.a.obtainStream(n,function(t){e(t)},function(e){t(e)})})}},{key:"obtainAudioAndVideoPermissions",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this,i=j({},t.desktopSharingExtensionExternalInstallation,{desktopSharingSources:t.desktopSharingSources});return new Promise(function(o,a){var s=function(e){o((function(e,t){var n=void 0,r=void 0,i=void 0,o=[];if(e){var a=e.audioVideo;if(a){var s=window.webkitMediaStream||window.MediaStream,c=a.getAudioTracks();if(c.length){n=new s;for(var u=0;u-1;l&&t.devices.splice(t.devices.indexOf("desktop"),1),t.devices.length?e.getUserMediaWithConstraints(t.devices,function(e){var o=-1!==t.devices.indexOf("audio"),c=-1!==t.devices.indexOf("video"),u=e.getAudioTracks().length>0,d=e.getVideoTracks().length>0;if(o&&!u||c&&!d){n.stopMediaStream(e);var p=[];return o&&!u&&p.push("audio"),c&&!d&&p.push("video"),void n.getUserMediaWithConstraints(p,function(){a(new C.a({name:"UnknownError"},r(t.devices,t),p))},function(e){a(e)},t)}l?D.a.obtainStream(i,function(t){s({audioVideo:e,desktop:t})},function(t){n.stopMediaStream(e),a(t)}):s({audioVideo:e})},function(e){return a(e)},t):l&&D.a.obtainStream(i,function(e){return s({desktop:e})},function(e){return a(e)})}})}},{key:"newObtainAudioAndVideoPermissions",value:function(e){U.info("Using the new gUM flow");var t=[],n=function(){return-1!==(e.devices||[]).indexOf("desktop")?this._newGetDesktopMedia(e.desktopSharingExtensionExternalInstallation,e.desktopSharingSources):Promise.resolve()}.bind(this),r=function(){var t=(e.devices||["audio","video"]).filter(function(e){return"audio"===e||"video"===e&&I.b.supportsVideo()});if(!t.length)return Promise.resolve();var n=(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=JSON.parse(JSON.stringify(t.constraints||ie));if(e.indexOf("video")>=0)if(n.video||(n.video={}),t.cameraDeviceId)n.video.deviceId=t.cameraDeviceId;else{var r=t.facingMode||g.a.USER;n.video.facingMode=r}else n.video=!1;return e.indexOf("audio")>=0?(n.audio&&"boolean"!=typeof n.audio||(n.audio={}),n.audio.optional||(n.audio.optional=[]),n.audio.optional.push({sourceId:t.micDeviceId},{echoCancellation:!K&&!q},{googEchoCancellation:!K&&!q},{googAutoGainControl:!Q&&!q},{googNoiseSuppression:!z&&!q},{googHighpassFilter:!X&&!q},{googNoiseSuppression2:!z&&!q},{googEchoCancellation2:!K&&!q},{googAutoGainControl2:!Q&&!q})):n.audio=!1,e.indexOf("desktop")>=0&&(n.video&&"boolean"!=typeof n.video||(n.video={}),n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t.desktopStream,maxWidth:window.screen.width,maxHeight:window.screen.height,maxFrameRate:3}}),n})(t,e);return U.info("Got media constraints: ",n),this._newGetUserMediaWithConstraints(t,n)}.bind(this);return n().then(function(e){if(e){var n=e.stream,r=e.sourceId,i=e.sourceType;t.push({stream:n,sourceId:r,sourceType:i,track:n.getVideoTracks()[0],videoType:M.a.DESKTOP})}}).then(r).then(function(e){if(e){var n=e.getAudioTracks();if(n.length){var r=new MediaStream(n);t.push({stream:r,track:r.getAudioTracks()[0]})}var i=e.getVideoTracks();if(i.length){var o=new MediaStream(i);t.push({stream:o,track:o.getVideoTracks()[0],videoType:M.a.CAMERA})}}}).then(function(){return t})}},{key:"getDeviceAvailability",value:function(){return J}},{key:"isRTCReady",value:function(){return re}},{key:"_isDeviceListAvailable",value:function(){if(!re)throw new Error("WebRTC not ready yet");return Boolean(navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices||"undefined"!=typeof MediaStreamTrack&&MediaStreamTrack.getSources)}},{key:"onRTCReady",value:function(){return re?Promise.resolve():new Promise(function(e){B.addListener(A.a.RTC_READY,function t(){B.removeListener(A.a.RTC_READY,t),e()})})}},{key:"isDeviceListAvailable",value:function(){return this.onRTCReady().then(this._isDeviceListAvailable.bind(this))}},{key:"isDeviceChangeAvailable",value:function(e){return"output"===e||"audiooutput"===e?Z:I.b.isChrome()||I.b.isFirefox()||I.b.isOpera()||I.b.isTemasysPluginUsed()||I.b.isNWJS()||I.b.isElectron()||I.b.isEdge()}},{key:"stopMediaStream",value:function(e){e.getTracks().forEach(function(e){!I.b.isTemasysPluginUsed()&&e.stop&&e.stop()}),e.stop&&e.stop(),e.release&&e.release();var t=e.jitsiObjectURL;t&&(delete e.jitsiObjectURL,(URL||webkitURL).revokeObjectURL(t))}},{key:"isDesktopSharingEnabled",value:function(){return D.a.isSupported()}},{key:"setAudioOutputDevice",value:function(e){return this.isDeviceChangeAvailable("output")||Promise.reject(new Error("Audio output device change is not supported")),Y.setSinkId(e).then(function(){V=e,W=!0,U.log("Audio output device set to "+e),B.emit(A.a.AUDIO_OUTPUT_DEVICE_CHANGED,e)})}},{key:"getAudioOutputDevice",value:function(){return V}},{key:"getCurrentlyAvailableMediaDevices",value:function(){return ee}},{key:"getEventDataForActiveDevice",value:function(e){var t=[],n={deviceId:e.deviceId,kind:e.kind,label:e.label,groupId:e.groupId};return t.push(n),{deviceList:t}}},{key:"setSuspendVideo",value:function(e,t){e.optional||(e.optional=[]),e.optional=e.optional.filter(function(e){return!e.hasOwnProperty("googSuspendBelowMinBitrate")}),t&&e.optional.push({googSuspendBelowMinBitrate:"true"})}}]),t})());t.a=oe}).call(t,"modules/RTC/RTCUtils.js")},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){return parseInt(e.ssrcs.split(" ")[0],10)}function o(e){return parseInt(e.ssrcs.split(" ")[1],10)}function a(e){return e.ssrcs?e.ssrcs.map(function(e){return e.id}).filter(function(e,t,n){return n.indexOf(e)===t}).length:0}t.b=i,t.c=o,n.d(t,"a",function(){return l});var s=n(15),c=(n.n(s),(function(){function e(e,t){for(var n=0;n1)for(var n=1;n=i}},{key:"refreshConnectionStatusForAll",value:function(){var e=this.conference.getParticipants(),t=!0,n=!1,r=void 0;try{for(var i,o=e["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(t=(i=o.next()).done);t=!0){var a=i.value;this.figureOutConnectionStatus(a.getId())}}catch(e){n=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}}},{key:"figureOutConnectionStatus",value:function(t){var n=this.conference.getParticipantById(t);if(n){var r=this.conference.isP2PActive(),i=this._isRestoringTimedout(t),o=0===this.rtc.getLastN(),a=n.isVideoMuted()||o,s=this.isVideoTrackFrozen(n),c=this.rtc.isInLastN(t),u=this.connStatusFromJvb[t];"boolean"!=typeof u&&(p.debug("Assuming connection active by JVB - no notification"),u=!0);var l=r?e._getNewStateForP2PMode(a,s):e._getNewStateForJvbMode(u,c,i,a,s);l!==m.RESTORING&&this._clearRestoringTimer(t),p.debug("Figure out conn status for "+t+", is video muted: "+a+" is active(jvb): "+u+" video track frozen: "+s+" p2p mode: "+r+" is in last N: "+c+" currentStatus => newStatus: "+n.getConnectionStatus()+" => "+l),this._changeConnectionStatus(n,l)}else p.warn("figure out conn status - no participant for: "+t)}},{key:"_onLastNChanged",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Date.now();p.debug("leaving/entering lastN",e,t,n);var r=!0,i=!1,o=void 0;try{for(var a,s=e["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(r=(a=s.next()).done);r=!0){var c=a.value;this.enteredLastNTimestamp.delete(c),this._clearRestoringTimer(c),this.figureOutConnectionStatus(c)}}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}var u=!0,l=!1,d=void 0;try{for(var h,f=t["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(u=(h=f.next()).done);u=!0){var m=h.value;this.enteredLastNTimestamp.set(m,n),this.figureOutConnectionStatus(m)}}catch(e){l=!0,d=e}finally{try{!u&&f.return&&f.return()}finally{if(l)throw d}}}},{key:"_clearRestoringTimer",value:function(e){var t=this.restoringTimers.get(e);t&&(clearTimeout(t),this.restoringTimers.delete(e))}},{key:"_isRestoringTimedout",value:function(e){var t=this,n=this.enteredLastNTimestamp.get(e);return!!(n&&Date.now()-n>=5e3)||(this.restoringTimers.get(e)||this.restoringTimers.set(e,setTimeout(function(){return t.figureOutConnectionStatus(e)},5e3)),!1)}},{key:"onTrackRtcMuted",value:function(e){var t=this,n=e.getParticipantId(),r=this.conference.getParticipantById(n);if(p.debug("Detector track RTC muted: "+n,Date.now()),r){if(this.rtcMutedTimestamp[n]=Date.now(),!r.isVideoMuted()){this.clearTimeout(n);var i=this._getVideoFrozenTimeout(n);this.trackTimers[n]=window.setTimeout(function(){p.debug("Set RTC mute timeout for: "+n+" of "+i+" ms"),t.clearTimeout(n),t.figureOutConnectionStatus(n)},i)}}else p.error("No participant for id: "+n)}},{key:"onTrackRtcUnmuted",value:function(e){var t=e.getParticipantId();p.debug("Detector track RTC unmuted: "+t,Date.now()),this.clearTimeout(t),this.clearRtcMutedTimestamp(t),this.figureOutConnectionStatus(t)}},{key:"onSignallingMuteChanged",value:function(e){var t=e.getParticipantId();p.debug("Detector on track signalling mute changed: "+t,e.isMuted()),this.figureOutConnectionStatus(t)}}]),e})();t.b=v}).call(t,"modules/connectivity/ParticipantConnectionStatus.js")},function(e,t,n){(function(t){var r,o=n(0).getLogger(t),a=a||{};e.exports=a,a.options=a.options||{},a.VERSION="0.14.0",a.onwebrtcready=a.onwebrtcready||function(e){},a._onwebrtcreadies=[],a.webRTCReady=function(e){if("function"!=typeof e)throw new Error("Callback provided is not a function");!0===a.onwebrtcreadyDone?e(null!==a.WebRTCPlugin.plugin):a._onwebrtcreadies.push(e)},a.WebRTCPlugin=a.WebRTCPlugin||{},a.WebRTCPlugin.pluginInfo=a.WebRTCPlugin.pluginInfo||{prefix:"Tem",plugName:"TemWebRTCPlugin",pluginId:"plugin0",type:"application/x-temwebrtcplugin",onload:"__TemWebRTCReady0",portalLink:"http://skylink.io/plugin/",downloadLink:null,companyName:"Temasys",downloadLinks:{mac:"http://bit.ly/webrtcpluginpkg",win:"http://bit.ly/webrtcpluginmsi"}},void 0!==a.WebRTCPlugin.pluginInfo.downloadLinks&&null!==a.WebRTCPlugin.pluginInfo.downloadLinks&&(navigator.platform.match(/^Mac/i)?a.WebRTCPlugin.pluginInfo.downloadLink=a.WebRTCPlugin.pluginInfo.downloadLinks.mac:navigator.platform.match(/^Win/i)&&(a.WebRTCPlugin.pluginInfo.downloadLink=a.WebRTCPlugin.pluginInfo.downloadLinks.win)),a.WebRTCPlugin.TAGS={NONE:"none",AUDIO:"audio",VIDEO:"video"},a.WebRTCPlugin.pageId=Math.random().toString(36).slice(2),a.WebRTCPlugin.plugin=null,a.WebRTCPlugin.setLogLevel=null,a.WebRTCPlugin.defineWebRTCInterface=null,a.WebRTCPlugin.isPluginInstalled=null,a.WebRTCPlugin.pluginInjectionInterval=null,a.WebRTCPlugin.injectPlugin=null,a.WebRTCPlugin.PLUGIN_STATES={NONE:0,INITIALIZING:1,INJECTING:2,INJECTED:3,READY:4},a.WebRTCPlugin.pluginState=a.WebRTCPlugin.PLUGIN_STATES.NONE,a.onwebrtcreadyDone=!1,a.WebRTCPlugin.PLUGIN_LOG_LEVELS={NONE:"NONE",ERROR:"ERROR",WARNING:"WARNING",INFO:"INFO",VERBOSE:"VERBOSE",SENSITIVE:"SENSITIVE"},a.WebRTCPlugin.WaitForPluginReady=null,a.WebRTCPlugin.callWhenPluginReady=null,__TemWebRTCReady0=function(){if("complete"===document.readyState)a.WebRTCPlugin.pluginState=a.WebRTCPlugin.PLUGIN_STATES.READY,a.maybeThroughWebRTCReady();else var e=setInterval(function(){"complete"===document.readyState&&(clearInterval(e),a.WebRTCPlugin.pluginState=a.WebRTCPlugin.PLUGIN_STATES.READY,a.maybeThroughWebRTCReady())},100)},a.maybeThroughWebRTCReady=function(){a.onwebrtcreadyDone||(a.onwebrtcreadyDone=!0,a._onwebrtcreadies.length?a._onwebrtcreadies.forEach(function(e){"function"==typeof e&&e(null!==a.WebRTCPlugin.plugin)}):"function"==typeof a.onwebrtcready&&a.onwebrtcready(null!==a.WebRTCPlugin.plugin))},a.TEXT={PLUGIN:{REQUIRE_INSTALLATION:"This website requires you to install a WebRTC-enabling plugin to work on this browser.",NOT_SUPPORTED:"Your browser does not support WebRTC.",BUTTON:"Install Now"},REFRESH:{REQUIRE_REFRESH:"Please refresh page",BUTTON:"Refresh Page"}},a._iceConnectionStates={starting:"starting",checking:"checking",connected:"connected",completed:"connected",done:"completed",disconnected:"disconnected",failed:"failed",closed:"closed"},a._iceConnectionFiredStates=[],a.isDefined=null,a.parseWebrtcDetectedBrowser=function(){var e=null;if(window.opr&&opr.addons||window.opera||navigator.userAgent.indexOf(" OPR/")>=0)e=navigator.userAgent.match(/OPR\/(\d+)/i)||[],webrtcDetectedBrowser="opera",webrtcDetectedVersion=parseInt(e[1]||"0",10),webrtcMinimumVersion=26,webrtcDetectedType="webkit",webrtcDetectedDCSupport="SCTP";else if(navigator.userAgent.match(/Bowser\/[0-9.]*/g)){e=navigator.userAgent.match(/Bowser\/[0-9.]*/g)||[];var t=parseInt((navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./i)||[])[2]||"0",10);webrtcDetectedBrowser="bowser",webrtcDetectedVersion=parseFloat((e[0]||"0/0").split("/")[1],10),webrtcMinimumVersion=0,webrtcDetectedType="webkit",webrtcDetectedDCSupport=t>30?"SCTP":"RTP"}else if(navigator.userAgent.indexOf("OPiOS")>0)e=navigator.userAgent.match(/OPiOS\/([0-9]+)\./),webrtcDetectedBrowser="opera",webrtcDetectedVersion=parseInt(e[1]||"0",10),webrtcMinimumVersion=0,webrtcDetectedType=null,webrtcDetectedDCSupport=null;else if(navigator.userAgent.indexOf("CriOS")>0)e=navigator.userAgent.match(/CriOS\/([0-9]+)\./)||[],webrtcDetectedBrowser="chrome",webrtcDetectedVersion=parseInt(e[1]||"0",10),webrtcMinimumVersion=0,webrtcDetectedType=null,webrtcDetectedDCSupport=null;else if(navigator.userAgent.indexOf("FxiOS")>0)e=navigator.userAgent.match(/FxiOS\/([0-9]+)\./)||[],webrtcDetectedBrowser="firefox",webrtcDetectedVersion=parseInt(e[1]||"0",10),webrtcMinimumVersion=0,webrtcDetectedType=null,webrtcDetectedDCSupport=null;else if(document.documentMode)e=/\brv[ :]+(\d+)/g.exec(navigator.userAgent)||[],webrtcDetectedBrowser="IE",webrtcDetectedVersion=parseInt(e[1],10),webrtcMinimumVersion=9,webrtcDetectedType="plugin",webrtcDetectedDCSupport="SCTP",webrtcDetectedVersion||(e=/\bMSIE[ :]+(\d+)/g.exec(navigator.userAgent)||[],webrtcDetectedVersion=parseInt(e[1]||"0",10));else if(window.StyleMedia||navigator.userAgent.match(/Edge\/(\d+).(\d+)$/))e=navigator.userAgent.match(/Edge\/(\d+).(\d+)$/)||[],webrtcDetectedBrowser="edge",webrtcDetectedVersion=parseFloat((e[0]||"0/0").split("/")[1],10),webrtcMinimumVersion=13.10547,webrtcDetectedType="ms",webrtcDetectedDCSupport=null;else if("undefined"!=typeof InstallTrigger||navigator.userAgent.indexOf("irefox")>0)e=navigator.userAgent.match(/Firefox\/([0-9]+)\./)||[],webrtcDetectedBrowser="firefox",webrtcDetectedVersion=parseInt(e[1]||"0",10),webrtcMinimumVersion=31,webrtcDetectedType="moz",webrtcDetectedDCSupport="SCTP";else if(window.chrome&&window.chrome.webstore||navigator.userAgent.indexOf("Chrom")>0)e=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./i)||[],webrtcDetectedBrowser="chrome",webrtcDetectedVersion=parseInt(e[2]||"0",10),webrtcMinimumVersion=38,webrtcDetectedType="webkit",webrtcDetectedDCSupport=webrtcDetectedVersion>30?"SCTP":"RTP";else if(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)){e=navigator.userAgent.match(/version\/(\d+)/i)||[];var n=navigator.userAgent.match(/(iPhone|iPad)/gi)||[];webrtcDetectedBrowser="safari",webrtcDetectedVersion=parseInt(e[1]||"0",10),webrtcMinimumVersion=7,webrtcDetectedType=0===n.length?"plugin":null,webrtcDetectedDCSupport=0===n.length?"SCTP":null}else/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent)&&(e=navigator.userAgent.match(/AppleWebKit\/([0-9]+)\./)||[],webrtcDetectedBrowser="safari",webrtcDetectedVersion=parseInt(e[1]||"0",10),webrtcMinimumVersion=0,webrtcDetectedType=null,webrtcDetectedDCSupport=null);window.webrtcDetectedBrowser=webrtcDetectedBrowser,window.webrtcDetectedVersion=webrtcDetectedVersion,window.webrtcMinimumVersion=webrtcMinimumVersion,window.webrtcDetectedType=webrtcDetectedType,window.webrtcDetectedDCSupport=webrtcDetectedDCSupport},a.addEvent=function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent?e.attachEvent("on"+t,n):e[t]=n},a.renderNotificationBar=function(e,t,n,r,i){if("complete"===document.readyState){var o=window,s=document.createElement("iframe");s.name="adapterjs-alert",s.style.position="fixed",s.style.top="-41px",s.style.left=0,s.style.right=0,s.style.width="100%",s.style.height="40px",s.style.backgroundColor="#ffffe1",s.style.border="none",s.style.borderBottom="1px solid #888888",s.style.zIndex="9999999","string"==typeof s.style.webkitTransition?s.style.webkitTransition="all .5s ease-out":"string"==typeof s.style.transition&&(s.style.transition="all .5s ease-out"),document.body.appendChild(s);var c=s.contentWindow?s.contentWindow:s.contentDocument.document?s.contentDocument.document:s.contentDocument;c.document.open(),c.document.write(''+e+""),t&&n?(c.document.write(''),c.document.close(),a.addEvent(c.document.getElementById("okay"),"click",function(e){i&&a.renderNotificationBar(a.TEXT.EXTENSION?a.TEXT.EXTENSION.REQUIRE_REFRESH:a.TEXT.REFRESH.REQUIRE_REFRESH,a.TEXT.REFRESH.BUTTON,"javascript:location.reload()"),window.open(n,r?"_blank":"_top"),e.preventDefault();try{e.cancelBubble=!0}catch(e){}var t=setInterval(function(){isIE||navigator.plugins.refresh(!1),a.WebRTCPlugin.isPluginInstalled(a.WebRTCPlugin.pluginInfo.prefix,a.WebRTCPlugin.pluginInfo.plugName,a.WebRTCPlugin.pluginInfo.type,function(){clearInterval(t),a.WebRTCPlugin.defineWebRTCInterface()},function(){})},500)}),a.addEvent(c.document.getElementById("cancel"),"click",function(e){o.document.body.removeChild(s)})):c.document.close(),setTimeout(function(){"string"==typeof s.style.webkitTransform?s.style.webkitTransform="translateY(40px)":"string"==typeof s.style.transform?s.style.transform="translateY(40px)":s.style.top="0px"},300)}},webrtcDetectedType=null,checkMediaDataChannelSettings=function(e,t,n,r){if("function"==typeof n){var i=!0,a="firefox"===webrtcDetectedBrowser,s="moz"===webrtcDetectedType&&webrtcDetectedVersion>30,c="firefox"===e;if(a&&c||s)try{delete r.mandatory.MozDontOfferDataChannel}catch(e){o.error("Failed deleting MozDontOfferDataChannel"),o.error(e)}else a&&!c&&(r.mandatory.MozDontOfferDataChannel=!0);if(!a)for(var u in r.mandatory)r.mandatory.hasOwnProperty(u)&&-1!==u.indexOf("Moz")&&delete r.mandatory[u];!a||c||s||(i=!1),n(i,r)}},checkIceConnectionState=function(e,t,n){"function"==typeof n?(e=e||"peer",a._iceConnectionFiredStates[e]&&t!==a._iceConnectionStates.disconnected&&t!==a._iceConnectionStates.failed&&t!==a._iceConnectionStates.closed||(a._iceConnectionFiredStates[e]=[]),t=a._iceConnectionStates[t],a._iceConnectionFiredStates[e].indexOf(t)<0&&(a._iceConnectionFiredStates[e].push(t),t===a._iceConnectionStates.connected&&setTimeout(function(){a._iceConnectionFiredStates[e].push(a._iceConnectionStates.done),n(a._iceConnectionStates.done)},1e3),n(t))):o.warn("No callback specified in checkIceConnectionState. Aborted.")},createIceServer=null,createIceServers=null,RTCPeerConnection=null,RTCSessionDescription="function"==typeof RTCSessionDescription?RTCSessionDescription:null,RTCIceCandidate="function"==typeof RTCIceCandidate?RTCIceCandidate:null,getUserMedia=null,attachMediaStream=null,reattachMediaStream=null,webrtcDetectedBrowser=null,webrtcDetectedVersion=null,webrtcMinimumVersion=null,!(navigator.mozGetUserMedia||navigator.webkitGetUserMedia||navigator.mediaDevices&&navigator.userAgent.match(/Edge\/(\d+).(\d+)$/))||0===(navigator.userAgent.match(/android/gi)||[]).length&&0===(navigator.userAgent.match(/chrome/gi)||[]).length&&navigator.userAgent.indexOf("Safari/")>0?("object"==typeof o&&"function"==typeof o.log||((o={}||o).log=function(e){},o.info=function(e){},o.error=function(e){},o.dir=function(e){},o.exception=function(e){},o.trace=function(e){},o.warn=function(e){},o.count=function(e){},o.debug=function(e){},o.count=function(e){},o.time=function(e){},o.timeEnd=function(e){},o.group=function(e){},o.groupCollapsed=function(e){},o.groupEnd=function(e){}),a.parseWebrtcDetectedBrowser(),isIE="IE"===webrtcDetectedBrowser,a.WebRTCPlugin.WaitForPluginReady=function(){for(;a.WebRTCPlugin.pluginState!==a.WebRTCPlugin.PLUGIN_STATES.READY;);},a.WebRTCPlugin.callWhenPluginReady=function(e){if(a.WebRTCPlugin.pluginState===a.WebRTCPlugin.PLUGIN_STATES.READY)e();else var t=setInterval(function(){a.WebRTCPlugin.pluginState===a.WebRTCPlugin.PLUGIN_STATES.READY&&(clearInterval(t),e())},100)},a.WebRTCPlugin.setLogLevel=function(e){a.WebRTCPlugin.callWhenPluginReady(function(){a.WebRTCPlugin.plugin.setLogLevel(e)})},a.WebRTCPlugin.injectPlugin=function(){if("complete"===document.readyState&&a.WebRTCPlugin.pluginState===a.WebRTCPlugin.PLUGIN_STATES.INITIALIZING){if(a.WebRTCPlugin.pluginState=a.WebRTCPlugin.PLUGIN_STATES.INJECTING,"IE"===webrtcDetectedBrowser&&webrtcDetectedVersion<=10){var e=document.createDocumentFragment();for(a.WebRTCPlugin.plugin=document.createElement("div"),a.WebRTCPlugin.plugin.innerHTML=' '+(a.options.getAllCams?'':"")+"";a.WebRTCPlugin.plugin.firstChild;)e.appendChild(a.WebRTCPlugin.plugin.firstChild);document.body.appendChild(e),a.WebRTCPlugin.plugin=document.getElementById(a.WebRTCPlugin.pluginInfo.pluginId)}else a.WebRTCPlugin.plugin=document.createElement("object"),a.WebRTCPlugin.plugin.id=a.WebRTCPlugin.pluginInfo.pluginId,isIE?(a.WebRTCPlugin.plugin.width="1px",a.WebRTCPlugin.plugin.height="1px"):(a.WebRTCPlugin.plugin.width="0px",a.WebRTCPlugin.plugin.height="0px"),a.WebRTCPlugin.plugin.type=a.WebRTCPlugin.pluginInfo.type,a.WebRTCPlugin.plugin.innerHTML=' '+(a.options.getAllCams?'':"")+'',document.body.appendChild(a.WebRTCPlugin.plugin);a.WebRTCPlugin.pluginState=a.WebRTCPlugin.PLUGIN_STATES.INJECTED}},a.WebRTCPlugin.isPluginInstalled=function(e,t,n,r,i){if(isIE){try{new ActiveXObject(e+"."+t)}catch(e){return void i()}r()}else{for(var o=navigator.mimeTypes,a=0;a=0)return void r();i()}},a.WebRTCPlugin.defineWebRTCInterface=function(){if(a.WebRTCPlugin.pluginState!==a.WebRTCPlugin.PLUGIN_STATES.READY){a.WebRTCPlugin.pluginState=a.WebRTCPlugin.PLUGIN_STATES.INITIALIZING,a.isDefined=function(e){return null!==e&&void 0!==e},createIceServer=function(e,t,n){var r=null,i=e.split(":");return 0===i[0].indexOf("stun")?r={url:e,hasCredentials:!1}:0===i[0].indexOf("turn")&&(r={url:e,hasCredentials:!0,credential:n,username:t}),r},createIceServers=function(e,t,n){for(var r=[],i=0;i1)return r&&(e.iceServers=r),a.WebRTCPlugin.plugin.PeerConnection(e);var o=t&&t.mandatory?t.mandatory:null,s=t&&t.optional?t.optional:null;return a.WebRTCPlugin.plugin.PeerConnection(a.WebRTCPlugin.pageId,r,o,s)},MediaStreamTrack=function(){},MediaStreamTrack.getSources=function(e){a.WebRTCPlugin.callWhenPluginReady(function(){a.WebRTCPlugin.plugin.GetSources(e)})};var e=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach(function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var r="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);var i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==r.ideal){t.optional=t.optional||[];var o={};"number"==typeof r.ideal?(o[i("min",n)]=r.ideal,t.optional.push(o),(o={})[i("max",n)]=r.ideal,t.optional.push(o)):(o[i("",n)]=r.ideal,t.optional.push(o))}void 0!==r.exact&&"number"!=typeof r.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",n)]=r.exact):["min","max"].forEach(function(e){void 0!==r[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,n)]=r[e])})}}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t};getUserMedia=function(t,n,r){var i={};i.audio=!!t.audio&&e(t.audio),i.video=!!t.video&&e(t.video),a.WebRTCPlugin.callWhenPluginReady(function(){a.WebRTCPlugin.plugin.getUserMedia(i,n,r)})},window.navigator.getUserMedia=getUserMedia,navigator.mediaDevices||"undefined"==typeof Promise||(requestUserMedia=function(e){return new Promise(function(t,n){getUserMedia(e,t,n)})},navigator.mediaDevices={getUserMedia:requestUserMedia,enumerateDevices:function(){return new Promise(function(e){var t={audio:"audioinput",video:"videoinput"};return MediaStreamTrack.getSources(function(n){e(n.map(function(e){return{label:e.label,kind:t[e.kind],id:e.id,deviceId:e.id,groupId:""}}))})})}}),attachMediaStream=function(e,t){if(e&&e.parentNode){var n;null===t?n="":(void 0!==t.enableSoundTracks&&t.enableSoundTracks(!0),n=t.id);var r=0===e.id.length?Math.random().toString(36).slice(2):e.id,i=e.nodeName.toLowerCase();if("object"!==i){var o;switch(i){case"audio":o=a.WebRTCPlugin.TAGS.AUDIO;break;case"video":o=a.WebRTCPlugin.TAGS.VIDEO;break;default:o=a.WebRTCPlugin.TAGS.NONE}var s=document.createDocumentFragment(),c=document.createElement("div"),u="";for(e.className?u='class="'+e.className+'" ':e.attributes&&e.attributes.class&&(u='class="'+e.attributes.class.value+'" '),c.innerHTML=' ';c.firstChild;)s.appendChild(c.firstChild);var l="",d="";e.clientWidth||e.clientHeight?(d=e.clientWidth,l=e.clientHeight):(e.width||e.height)&&(d=e.width,l=e.height),e.parentNode.insertBefore(s,e),(s=document.getElementById(r)).width=d,s.height=l,e.parentNode.removeChild(e)}else{for(var p=e.children,h=0;h!==p.length;++h)if("streamId"===p[h].name){p[h].value=n;break}e.setStreamId(n)}var f=document.getElementById(r);return a.forwardEventHandlers(f,e,Object.getPrototypeOf(e)),f}},reattachMediaStream=function(e,t){for(var n=null,r=t.children,i=0;i!==r.length;++i)if("streamId"===r[i].name){a.WebRTCPlugin.WaitForPluginReady(),n=a.WebRTCPlugin.plugin.getStreamWithId(a.WebRTCPlugin.pageId,r[i].value);break}if(null!==n)return attachMediaStream(e,n);o.log("Could not find the stream associated with this element")},window.attachMediaStream=attachMediaStream,window.reattachMediaStream=reattachMediaStream,window.getUserMedia=getUserMedia,a.attachMediaStream=attachMediaStream,a.reattachMediaStream=reattachMediaStream,a.getUserMedia=getUserMedia,a.forwardEventHandlers=function(e,t,n){properties=Object.getOwnPropertyNames(n);for(var r in properties)r&&(propName=properties[r],"function"==typeof propName.slice&&"on"===propName.slice(0,2)&&"function"==typeof t[propName]&&a.addEvent(e,propName.slice(2),t[propName]));var i=Object.getPrototypeOf(n);i&&a.forwardEventHandlers(e,t,i)},RTCIceCandidate=function(e){return e.sdpMid||(e.sdpMid=""),a.WebRTCPlugin.WaitForPluginReady(),a.WebRTCPlugin.plugin.ConstructIceCandidate(e.sdpMid,e.sdpMLineIndex,e.candidate)},a.addEvent(document,"readystatechange",a.WebRTCPlugin.injectPlugin),a.WebRTCPlugin.injectPlugin()}else o.error("AdapterJS - WebRTC interface has already been defined")},a.WebRTCPlugin.pluginNeededButNotInstalledCb=a.WebRTCPlugin.pluginNeededButNotInstalledCb||function(){a.addEvent(document,"readystatechange",a.WebRTCPlugin.pluginNeededButNotInstalledCbPriv),a.WebRTCPlugin.pluginNeededButNotInstalledCbPriv()},a.WebRTCPlugin.pluginNeededButNotInstalledCbPriv=function(){if(!a.options.hidePluginInstallPrompt){var e=a.WebRTCPlugin.pluginInfo.downloadLink;if(e){var t;t=a.WebRTCPlugin.pluginInfo.portalLink?'This website requires you to install the '+a.WebRTCPlugin.pluginInfo.companyName+" WebRTC Plugin to work on this browser.":a.TEXT.PLUGIN.REQUIRE_INSTALLATION,a.renderNotificationBar(t,a.TEXT.PLUGIN.BUTTON,e)}else a.renderNotificationBar(a.TEXT.PLUGIN.NOT_SUPPORTED)}},a.WebRTCPlugin.isPluginInstalled(a.WebRTCPlugin.pluginInfo.prefix,a.WebRTCPlugin.pluginInfo.plugName,a.WebRTCPlugin.pluginInfo.type,a.WebRTCPlugin.defineWebRTCInterface,a.WebRTCPlugin.pluginNeededButNotInstalledCb)):(s=function(){return(function e(t,n,i){function o(s,c){if(!n[s]){if(!t[s]){if(!c&&"function"==typeof r&&r)return r(s,!0);if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[s]={exports:{}};t[s][0].call(l.exports,function(e){return o(t[s][1][e]||e)},l,l.exports,e,t,n,i)}return n[s].exports}for(var a="function"==typeof r&&r,s=0;s-1?(n.attribute=e.substr(t+1,r-t-1),n.value=e.substr(r+1)):n.attribute=e.substr(t+1),n},r.getDtlsParameters=function(e,t){var n=r.splitLines(e),i=(n=n.concat(r.splitLines(t))).filter(function(e){return 0===e.indexOf("a=fingerprint:")})[0].substr(14);return{role:"auto",fingerprints:[{algorithm:i.split(" ")[0],value:i.split(" ")[1]}]}},r.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach(function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"}),n},r.getIceParameters=function(e,t){var n=r.splitLines(e);return{usernameFragment:(n=n.concat(r.splitLines(t))).filter(function(e){return 0===e.indexOf("a=ice-ufrag:")})[0].substr(12),password:n.filter(function(e){return 0===e.indexOf("a=ice-pwd:")})[0].substr(10)}},r.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},r.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=r.splitLines(e)[0].split(" "),i=3;i0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=t.codecs.map(function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType}).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach(function(e){n+=r.writeRtpMap(e),n+=r.writeFmtp(e),n+=r.writeRtcpFb(e)}),n+="a=rtcp-mux\r\n"},r.parseRtpEncodingParameters=function(e){var t,n=[],i=r.parseRtpParameters(e),o=-1!==i.fecMechanisms.indexOf("RED"),a=-1!==i.fecMechanisms.indexOf("ULPFEC"),s=r.matchPrefix(e,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute}),c=s.length>0&&s[0].ssrc,u=r.matchPrefix(e,"a=ssrc-group:FID").map(function(e){var t=e.split(" ");return t.shift(),t.map(function(e){return parseInt(e,10)})});u.length>0&&u[0].length>1&&u[0][0]===c&&(t=u[0][1]),i.codecs.forEach(function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var r={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10),rtx:{payloadType:e.payloadType,ssrc:t}};n.push(r),o&&((r=JSON.parse(JSON.stringify(r))).fec={ssrc:t,mechanism:a?"red+ulpfec":"red"},n.push(r))}}),0===n.length&&c&&n.push({ssrc:c});var l=r.matchPrefix(e,"b=");return l.length&&(0===l[0].indexOf("b=TIAS:")?l=parseInt(l[0].substr(7),10):0===l[0].indexOf("b=AS:")&&(l=parseInt(l[0].substr(5),10)),n.forEach(function(e){e.maxBitrate=l})),n},r.writeSessionBoilerplate=function(){return"v=0\r\no=thisisadapterortc 8169639915646943137 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},r.writeMediaSection=function(e,t,n,i){var o=r.writeRtpDescription(e.kind,t);if(o+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),o+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?o+="a=sendrecv\r\n":e.rtpSender?o+="a=sendonly\r\n":e.rtpReceiver?o+="a=recvonly\r\n":o+="a=inactive\r\n",e.rtpSender){var a="msid:"+i.id+" "+e.rtpSender.track.id+"\r\n";o+="a="+a,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+a}return o+"a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n"},r.getDirection=function(e,t){for(var n=r.splitLines(e),i=0;i0&&"function"==typeof e)return i(e,t);var a=function(e){var t={};return e.result().forEach(function(e){var n={id:e.id,timestamp:e.timestamp,type:e.type};e.names().forEach(function(t){n[t]=e.stat(t)}),t[n.id]=n}),t},s=function(e,t){var n=new Map(Object.keys(e).map(function(t){return[t,e[t]]}));return t=t||e,Object.keys(t).forEach(function(e){n[e]=t[e]}),n};if(arguments.length>=2){var c=function(e){o[1](s(a(e)))};return i.apply(this,[c,arguments[0]])}return new Promise(function(t,n){1===o.length&&"object"==typeof e?i.apply(r,[function(e){t(s(a(e)))},n]):i.apply(r,[function(e){t(s(a(e),e.result()))},n])}).then(t,n)},n},window.RTCPeerConnection.prototype=webkitRTCPeerConnection.prototype,webkitRTCPeerConnection.generateCertificate&&Object.defineProperty(window.RTCPeerConnection,"generateCertificate",{get:function(){return webkitRTCPeerConnection.generateCertificate}}),["createOffer","createAnswer"].forEach(function(e){var t=webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e]=function(){var e=this;if(arguments.length<1||1===arguments.length&&"object"==typeof arguments[0]){var n=1===arguments.length?arguments[0]:void 0;return new Promise(function(r,i){t.apply(e,[r,i,n])})}return t.apply(this,arguments)}}),i.version<51&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){var t=webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e]=function(){var e=arguments,n=this,r=new Promise(function(r,i){t.apply(n,[e[0],r,i])});return e.length<2?r:r.then(function(){e[1].apply(null,[])},function(t){e.length>=3&&e[2].apply(null,[t])})}}),["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){var t=webkitRTCPeerConnection.prototype[e];webkitRTCPeerConnection.prototype[e]=function(){return arguments[0]=new("addIceCandidate"===e?RTCIceCandidate:RTCSessionDescription)(arguments[0]),t.apply(this,arguments)}});var e=RTCPeerConnection.prototype.addIceCandidate;RTCPeerConnection.prototype.addIceCandidate=function(){return null===arguments[0]?Promise.resolve():e.apply(this,arguments)}}};t.exports={shimMediaStream:o.shimMediaStream,shimOnTrack:o.shimOnTrack,shimSourceObject:o.shimSourceObject,shimPeerConnection:o.shimPeerConnection,shimGetUserMedia:e("./getusermedia")}},{"../utils.js":10,"./getusermedia":4}],4:[function(e,t,n){"use strict";var r=e("../utils.js").log;t.exports=function(){var e=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach(function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var r="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);var i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==r.ideal){t.optional=t.optional||[];var o={};"number"==typeof r.ideal?(o[i("min",n)]=r.ideal,t.optional.push(o),(o={})[i("max",n)]=r.ideal,t.optional.push(o)):(o[i("",n)]=r.ideal,t.optional.push(o))}void 0!==r.exact&&"number"!=typeof r.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",n)]=r.exact):["min","max"].forEach(function(e){void 0!==r[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,n)]=r[e])})}}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},t=function(t,n){if((t=JSON.parse(JSON.stringify(t)))&&t.audio&&(t.audio=e(t.audio)),t&&"object"==typeof t.video){var i=t.video.facingMode;if((i=i&&("object"==typeof i?i:{ideal:i}))&&("user"===i.exact||"environment"===i.exact||"user"===i.ideal||"environment"===i.ideal)&&(!navigator.mediaDevices.getSupportedConstraints||!navigator.mediaDevices.getSupportedConstraints().facingMode)&&(delete t.video.facingMode,"environment"===i.exact||"environment"===i.ideal))return navigator.mediaDevices.enumerateDevices().then(function(o){var a=(o=o.filter(function(e){return"videoinput"===e.kind})).find(function(e){return-1!==e.label.toLowerCase().indexOf("back")})||o.length&&o[o.length-1];return a&&(t.video.deviceId=i.exact?{exact:a.deviceId}:{ideal:a.deviceId}),t.video=e(t.video),r("chrome: "+JSON.stringify(t)),n(t)});t.video=e(t.video)}return r("chrome: "+JSON.stringify(t)),n(t)},n=function(e){return{name:{PermissionDeniedError:"NotAllowedError",ConstraintNotSatisfiedError:"OverconstrainedError"}[e.name]||e.name,message:e.message,constraint:e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}};navigator.getUserMedia=function(e,r,i){t(e,function(e){navigator.webkitGetUserMedia(e,r,function(e){i(n(e))})})};var i=function(e){return new Promise(function(t,n){navigator.getUserMedia(e,t,n)})};if(navigator.mediaDevices||(navigator.mediaDevices={getUserMedia:i,enumerateDevices:function(){return new Promise(function(e){var t={audio:"audioinput",video:"videoinput"};return MediaStreamTrack.getSources(function(n){e(n.map(function(e){return{label:e.label,kind:t[e.kind],deviceId:e.id,groupId:""}}))})})}}),navigator.mediaDevices.getUserMedia){var o=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(e){return t(e,function(e){return o(e).catch(function(e){return Promise.reject(n(e))})})}}else navigator.mediaDevices.getUserMedia=function(e){return i(e)};void 0===navigator.mediaDevices.addEventListener&&(navigator.mediaDevices.addEventListener=function(){r("Dummy mediaDevices.addEventListener called.")}),void 0===navigator.mediaDevices.removeEventListener&&(navigator.mediaDevices.removeEventListener=function(){r("Dummy mediaDevices.removeEventListener called.")})}},{"../utils.js":10}],5:[function(e,t,n){"use strict";var r=e("sdp"),i=e("../utils").browserDetails,o={shimPeerConnection:function(){window.RTCIceGatherer&&(window.RTCIceCandidate||(window.RTCIceCandidate=function(e){return e}),window.RTCSessionDescription||(window.RTCSessionDescription=function(e){return e})),window.RTCPeerConnection=function(e){var t=this,n=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach(function(e){t[e]=n[e].bind(n)}),this.onicecandidate=null,this.onaddstream=null,this.ontrack=null,this.onremovestream=null,this.onsignalingstatechange=null,this.oniceconnectionstatechange=null,this.onnegotiationneeded=null,this.ondatachannel=null,this.localStreams=[],this.remoteStreams=[],this.getLocalStreams=function(){return t.localStreams},this.getRemoteStreams=function(){return t.remoteStreams},this.localDescription=new RTCSessionDescription({type:"",sdp:""}),this.remoteDescription=new RTCSessionDescription({type:"",sdp:""}),this.signalingState="stable",this.iceConnectionState="new",this.iceGatheringState="new",this.iceOptions={gatherPolicy:"all",iceServers:[]},e&&e.iceTransportPolicy)switch(e.iceTransportPolicy){case"all":case"relay":this.iceOptions.gatherPolicy=e.iceTransportPolicy;break;case"none":throw new TypeError('iceTransportPolicy "none" not supported')}if(this.usingBundle=e&&"max-bundle"===e.bundlePolicy,e&&e.iceServers){var r=JSON.parse(JSON.stringify(e.iceServers));this.iceOptions.iceServers=r.filter(function(e){if(e&&e.urls){var t=e.urls;return"string"==typeof t&&(t=[t]),!!(t=t.filter(function(e){return 0===e.indexOf("turn:")&&-1!==e.indexOf("transport=udp")&&-1===e.indexOf("turn:[")||0===e.indexOf("stun:")&&i.version>=14393})[0])}return!1})}this.transceivers=[],this._localIceCandidatesBuffer=[]},window.RTCPeerConnection.prototype._emitBufferedCandidates=function(){var e=this,t=r.splitSections(e.localDescription.sdp);this._localIceCandidatesBuffer.forEach(function(n){if(n.candidate&&0!==Object.keys(n.candidate).length)-1===n.candidate.candidate.indexOf("typ endOfCandidates")&&(t[n.candidate.sdpMLineIndex+1]+="a="+n.candidate.candidate+"\r\n");else for(var r=1;r-1&&(this.localStreams.splice(t,1),this._maybeFireNegotiationNeeded())},window.RTCPeerConnection.prototype.getSenders=function(){return this.transceivers.filter(function(e){return!!e.rtpSender}).map(function(e){return e.rtpSender})},window.RTCPeerConnection.prototype.getReceivers=function(){return this.transceivers.filter(function(e){return!!e.rtpReceiver}).map(function(e){return e.rtpReceiver})},window.RTCPeerConnection.prototype._getCommonCapabilities=function(e,t){var n={codecs:[],headerExtensions:[],fecMechanisms:[]};return e.codecs.forEach(function(e){for(var r=0;r0;t.forEach(function(e,t){var a=i.transceivers[t],s=a.iceGatherer,c=a.iceTransport,u=a.dtlsTransport,l=a.localCapabilities,d=a.remoteCapabilities;if("0"!==e.split("\n",1)[0].split(" ",2)[1]&&!a.isDatachannel){var p=r.getIceParameters(e,n);if(o){var h=r.matchPrefix(e,"a=candidate:").map(function(e){return r.parseCandidate(e)}).filter(function(e){return"1"===e.component});h.length&&c.setRemoteCandidates(h)}var f=r.getDtlsParameters(e,n);o&&(f.role="server"),i.usingBundle&&0!==t||(c.start(s,p,o?"controlling":"controlled"),u.start(f));var m=i._getCommonCapabilities(l,d);i._transceive(a,m.codecs.length>0,!1)}})}switch(this.localDescription={type:e.type,sdp:e.sdp},e.type){case"offer":this._updateSignalingState("have-local-offer");break;case"answer":this._updateSignalingState("stable");break;default:throw new TypeError('unsupported type "'+e.type+'"')}var a=arguments.length>1&&"function"==typeof arguments[1];if(a){var s=arguments[1];window.setTimeout(function(){s(),"new"===i.iceGatheringState&&(i.iceGatheringState="gathering"),i._emitBufferedCandidates()},0)}var c=Promise.resolve();return c.then(function(){a||("new"===i.iceGatheringState&&(i.iceGatheringState="gathering"),window.setTimeout(i._emitBufferedCandidates.bind(i),500))}),c},window.RTCPeerConnection.prototype.setRemoteDescription=function(e){var t=this,n=new MediaStream,i=[],o=r.splitSections(e.sdp),a=o.shift(),s=r.matchPrefix(a,"a=ice-lite").length>0;switch(this.usingBundle=r.matchPrefix(a,"a=group:BUNDLE ").length>0,o.forEach(function(o,c){var u=r.splitLines(o)[0].substr(2).split(" "),l=u[0],d="0"===u[1],p=r.getDirection(o,a),h=r.matchPrefix(o,"a=mid:");if(h=h.length?h[0].substr(6):r.generateIdentifier(),"application"!==l||"DTLS/SCTP"!==u[2]){var f,m,v,g,y,b,S,_,T,C,E,w,R=r.parseRtpParameters(o);d||(E=r.getIceParameters(o,a),(w=r.getDtlsParameters(o,a)).role="client"),_=r.parseRtpEncodingParameters(o);var k,I=r.matchPrefix(o,"a=ssrc:").map(function(e){return r.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute})[0];I&&(k=I.value);var P=r.matchPrefix(o,"a=end-of-candidates",a).length>0,A=r.matchPrefix(o,"a=candidate:").map(function(e){return r.parseCandidate(e)}).filter(function(e){return"1"===e.component});if("offer"!==e.type||d)"answer"!==e.type||d||(m=(f=t.transceivers[c]).iceGatherer,v=f.iceTransport,g=f.dtlsTransport,y=f.rtpSender,b=f.rtpReceiver,S=f.sendEncodingParameters,T=f.localCapabilities,t.transceivers[c].recvEncodingParameters=_,t.transceivers[c].remoteCapabilities=R,t.transceivers[c].cname=k,(s||P)&&A.length&&v.setRemoteCandidates(A),t.usingBundle&&0!==c||(v.start(m,E,"controlling"),g.start(w)),t._transceive(f,"sendrecv"===p||"recvonly"===p,"sendrecv"===p||"sendonly"===p),!b||"sendrecv"!==p&&"sendonly"!==p?delete f.rtpReceiver:(C=b.track,i.push([C,b]),n.addTrack(C)));else{var O=t.usingBundle&&c>0?{iceGatherer:t.transceivers[0].iceGatherer,iceTransport:t.transceivers[0].iceTransport,dtlsTransport:t.transceivers[0].dtlsTransport}:t._createIceAndDtlsTransports(h,c);if(P&&O.iceTransport.setRemoteCandidates(A),T=RTCRtpReceiver.getCapabilities(l),S=[{ssrc:1001*(2*c+2)}],C=(b=new RTCRtpReceiver(O.dtlsTransport,l)).track,i.push([C,b]),n.addTrack(C),t.localStreams.length>0&&t.localStreams[0].getTracks().length>=c){var D;"audio"===l?D=t.localStreams[0].getAudioTracks()[0]:"video"===l&&(D=t.localStreams[0].getVideoTracks()[0]),D&&(y=new RTCRtpSender(D,O.dtlsTransport))}t.transceivers[c]={iceGatherer:O.iceGatherer,iceTransport:O.iceTransport,dtlsTransport:O.dtlsTransport,localCapabilities:T,remoteCapabilities:R,rtpSender:y,rtpReceiver:b,kind:l,mid:h,cname:k,sendEncodingParameters:S,recvEncodingParameters:_},t._transceive(t.transceivers[c],!1,"sendrecv"===p||"sendonly"===p)}}else t.transceivers[c]={mid:h,isDatachannel:!0}}),this.remoteDescription={type:e.type,sdp:e.sdp},e.type){case"offer":this._updateSignalingState("have-remote-offer");break;case"answer":this._updateSignalingState("stable");break;default:throw new TypeError('unsupported type "'+e.type+'"')}return n.getTracks().length&&(t.remoteStreams.push(n),window.setTimeout(function(){var e=new Event("addstream");e.stream=n,t.dispatchEvent(e),null!==t.onaddstream&&window.setTimeout(function(){t.onaddstream(e)},0),i.forEach(function(r){var i=r[0],o=r[1],a=new Event("track");a.track=i,a.receiver=o,a.streams=[n],t.dispatchEvent(e),null!==t.ontrack&&window.setTimeout(function(){t.ontrack(a)},0)})},0)),arguments.length>1&&"function"==typeof arguments[1]&&window.setTimeout(arguments[1],0),Promise.resolve()},window.RTCPeerConnection.prototype.close=function(){this.transceivers.forEach(function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()}),this._updateSignalingState("closed")},window.RTCPeerConnection.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this.dispatchEvent(t),null!==this.onsignalingstatechange&&this.onsignalingstatechange(t)},window.RTCPeerConnection.prototype._maybeFireNegotiationNeeded=function(){var e=new Event("negotiationneeded");this.dispatchEvent(e),null!==this.onnegotiationneeded&&this.onnegotiationneeded(e)},window.RTCPeerConnection.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,checking:0,connected:0,completed:0,failed:0};if(this.transceivers.forEach(function(e){t[e.iceTransport.state]++,t[e.dtlsTransport.state]++}),t.connected+=t.completed,e="new",t.failed>0?e="failed":t.connecting>0||t.checking>0?e="connecting":t.disconnected>0?e="disconnected":t.new>0?e="new":(t.connected>0||t.completed>0)&&(e="connected"),e!==this.iceConnectionState){this.iceConnectionState=e;var n=new Event("iceconnectionstatechange");this.dispatchEvent(n),null!==this.oniceconnectionstatechange&&this.oniceconnectionstatechange(n)}},window.RTCPeerConnection.prototype.createOffer=function(){var e=this;if(this._pendingOffer)throw new Error("createOffer called while there is a pending offer.");var t;1===arguments.length&&"function"!=typeof arguments[0]?t=arguments[0]:3===arguments.length&&(t=arguments[2]);var n=[],i=0,o=0;if(this.localStreams.length&&(i=this.localStreams[0].getAudioTracks().length,o=this.localStreams[0].getVideoTracks().length),t){if(t.mandatory||t.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==t.offerToReceiveAudio&&(i=t.offerToReceiveAudio),void 0!==t.offerToReceiveVideo&&(o=t.offerToReceiveVideo)}for(this.localStreams.length&&this.localStreams[0].getTracks().forEach(function(e){n.push({kind:e.kind,track:e,wantReceive:"audio"===e.kind?i>0:o>0}),"audio"===e.kind?i--:"video"===e.kind&&o--});i>0||o>0;)i>0&&(n.push({kind:"audio",wantReceive:!0}),i--),o>0&&(n.push({kind:"video",wantReceive:!0}),o--);var a=r.writeSessionBoilerplate(),s=[];n.forEach(function(t,n){var i,o,a=t.track,c=t.kind,u=r.generateIdentifier(),l=e.usingBundle&&n>0?{iceGatherer:s[0].iceGatherer,iceTransport:s[0].iceTransport,dtlsTransport:s[0].dtlsTransport}:e._createIceAndDtlsTransports(u,n),d=RTCRtpSender.getCapabilities(c),p=[{ssrc:1001*(2*n+1)}];a&&(i=new RTCRtpSender(a,l.dtlsTransport)),t.wantReceive&&(o=new RTCRtpReceiver(l.dtlsTransport,c)),s[n]={iceGatherer:l.iceGatherer,iceTransport:l.iceTransport,dtlsTransport:l.dtlsTransport,localCapabilities:d,remoteCapabilities:null,rtpSender:i,rtpReceiver:o,kind:c,mid:u,sendEncodingParameters:p,recvEncodingParameters:null}}),this.usingBundle&&(a+="a=group:BUNDLE "+s.map(function(e){return e.mid}).join(" ")+"\r\n"),n.forEach(function(t,n){var i=s[n];a+=r.writeMediaSection(i,i.localCapabilities,"offer",e.localStreams[0])}),this._pendingOffer=s;var c=new RTCSessionDescription({type:"offer",sdp:a});return arguments.length&&"function"==typeof arguments[0]&&window.setTimeout(arguments[0],0,c),Promise.resolve(c)},window.RTCPeerConnection.prototype.createAnswer=function(){var e=this,t=r.writeSessionBoilerplate();this.usingBundle&&(t+="a=group:BUNDLE "+this.transceivers.map(function(e){return e.mid}).join(" ")+"\r\n"),this.transceivers.forEach(function(n){if(n.isDatachannel)t+="m=application 0 DTLS/SCTP 5000\r\nc=IN IP4 0.0.0.0\r\na=mid:"+n.mid+"\r\n";else{var i=e._getCommonCapabilities(n.localCapabilities,n.remoteCapabilities);t+=r.writeMediaSection(n,i,"answer",e.localStreams[0])}});var n=new RTCSessionDescription({type:"answer",sdp:t});return arguments.length&&"function"==typeof arguments[0]&&window.setTimeout(arguments[0],0,n),Promise.resolve(n)},window.RTCPeerConnection.prototype.addIceCandidate=function(e){if(null===e)this.transceivers.forEach(function(e){e.iceTransport.addRemoteCandidate({})});else{var t=e.sdpMLineIndex;if(e.sdpMid)for(var n=0;n0?r.parseCandidate(e.candidate):{};if("tcp"===o.protocol&&(0===o.port||9===o.port))return;if("1"!==o.component)return;"endOfCandidates"===o.type&&(o={}),i.iceTransport.addRemoteCandidate(o);var a=r.splitSections(this.remoteDescription.sdp);a[t+1]+=(o.type?e.candidate.trim():"a=end-of-candidates")+"\r\n",this.remoteDescription.sdp=a.join("")}}return arguments.length>1&&"function"==typeof arguments[1]&&window.setTimeout(arguments[1],0),Promise.resolve()},window.RTCPeerConnection.prototype.getStats=function(){var e=[];this.transceivers.forEach(function(t){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach(function(n){t[n]&&e.push(t[n].getStats())})});var t=arguments.length>1&&"function"==typeof arguments[1]&&arguments[1];return new Promise(function(n){var r=new Map;Promise.all(e).then(function(e){e.forEach(function(e){Object.keys(e).forEach(function(t){r.set(t,e[t]),r[t]=e[t]})}),t&&window.setTimeout(t,0,r),n(r)})})}}};t.exports={shimPeerConnection:o.shimPeerConnection,shimGetUserMedia:e("./getusermedia")}},{"../utils":10,"./getusermedia":6,sdp:1}],6:[function(e,t,n){"use strict";t.exports=function(){var e=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(t){return e(t).catch(function(e){return Promise.reject({name:{PermissionDeniedError:"NotAllowedError"}[(t=e).name]||t.name,message:t.message,constraint:t.constraint,toString:function(){return this.name}});var t})}}},{}],7:[function(e,t,n){"use strict";var r=e("../utils").browserDetails,i={shimOnTrack:function(){"object"!=typeof window||!window.RTCPeerConnection||"ontrack"in window.RTCPeerConnection.prototype||Object.defineProperty(window.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&(this.removeEventListener("track",this._ontrack),this.removeEventListener("addstream",this._ontrackpoly)),this.addEventListener("track",this._ontrack=e),this.addEventListener("addstream",this._ontrackpoly=function(e){e.stream.getTracks().forEach(function(t){var n=new Event("track");n.track=t,n.receiver={track:t},n.streams=[e.stream],this.dispatchEvent(n)}.bind(this))}.bind(this))}})},shimSourceObject:function(){"object"==typeof window&&(!window.HTMLMediaElement||"srcObject"in window.HTMLMediaElement.prototype||Object.defineProperty(window.HTMLMediaElement.prototype,"srcObject",{get:function(){return this.mozSrcObject},set:function(e){this.mozSrcObject=e}}))},shimPeerConnection:function(){if("object"==typeof window&&(window.RTCPeerConnection||window.mozRTCPeerConnection)){window.RTCPeerConnection||(window.RTCPeerConnection=function(e,t){if(r.version<38&&e&&e.iceServers){for(var n=[],i=0;i=n&&parseInt(r[n],10)},detectBrowser:function(){var e={};if(e.browser=null,e.version=null,"undefined"==typeof window||!window.navigator)return e.browser="Not a browser.",e;if(navigator.mozGetUserMedia)e.browser="firefox",e.version=this.extractVersion(navigator.userAgent,/Firefox\/([0-9]+)\./,1);else if(navigator.webkitGetUserMedia)if(window.webkitRTCPeerConnection)e.browser="chrome",e.version=this.extractVersion(navigator.userAgent,/Chrom(e|ium)\/([0-9]+)\./,2);else{if(!navigator.userAgent.match(/Version\/(\d+).(\d+)/))return e.browser="Unsupported webkit-based browser with GUM support but no WebRTC support.",e;e.browser="safari",e.version=this.extractVersion(navigator.userAgent,/AppleWebKit\/([0-9]+)\./,1)}else{if(!navigator.mediaDevices||!navigator.userAgent.match(/Edge\/(\d+).(\d+)$/))return e.browser="Not a supported browser.",e;e.browser="edge",e.version=this.extractVersion(navigator.userAgent,/Edge\/(\d+).(\d+)$/,2)}return e}};t.exports={log:i.log,disableLog:i.disableLog,browserDetails:i.detectBrowser(),extractVersion:i.extractVersion}},{}]},{},[2])(2)},e.exports=s(),a.parseWebrtcDetectedBrowser(),navigator.mozGetUserMedia?(MediaStreamTrack.getSources=function(e){setTimeout(function(){e([{kind:"audio",id:"default",label:"",facing:""},{kind:"video",id:"default",label:"",facing:""}])},0)},attachMediaStream=function(e,t){return e.srcObject=t,e},reattachMediaStream=function(e,t){return e.srcObject=t.srcObject,e},createIceServer=function(e,t,n){o.warn("createIceServer is deprecated. It should be replaced with an application level implementation.");var r=null,i=e.split(":");if(0===i[0].indexOf("stun"))r={urls:[e]};else if(0===i[0].indexOf("turn"))if(webrtcDetectedVersion<27){var a=e.split("?");1!==a.length&&0!==a[1].indexOf("transport=udp")||(r={urls:[a[0]],credential:n,username:t})}else r={urls:[e],credential:n,username:t};return r},createIceServers=function(e,t,n){o.warn("createIceServers is deprecated. It should be replaced with an application level implementation.");var r=[];for(i=0;i=43?e.srcObject=t:void 0!==e.src?e.src=URL.createObjectURL(t):o.error("Error attaching stream to element."),e},reattachMediaStream=function(e,t){return webrtcDetectedVersion>=43?e.srcObject=t.srcObject:e.src=t.src,e},createIceServer=function(e,t,n){o.warn("createIceServer is deprecated. It should be replaced with an application level implementation.");var r=null,i=e.split(":");return 0===i[0].indexOf("stun")?r={url:e}:0===i[0].indexOf("turn")&&(r={url:e,credential:n,username:t}),r},createIceServers=function(e,t,n){o.warn("createIceServers is deprecated. It should be replaced with an application level implementation.");var r=[];if(webrtcDetectedVersion>=34)r={urls:e,credential:n,username:t};else for(i=0;i38?e.srcObject=t:void 0!==e.src&&(e.src=URL.createObjectURL(t))}),attachMediaStream=function(e,t){return"chrome"!==webrtcDetectedBrowser&&"opera"!==webrtcDetectedBrowser||t?attachMediaStream_base(e,t):e.src="",e},reattachMediaStream_base=reattachMediaStream,reattachMediaStream=function(e,t){return reattachMediaStream_base(e,t),e},window.attachMediaStream=attachMediaStream,window.reattachMediaStream=reattachMediaStream,window.getUserMedia=function(e,t,n){navigator.getUserMedia(e,t,n)},a.attachMediaStream=attachMediaStream,a.reattachMediaStream=reattachMediaStream,a.getUserMedia=getUserMedia,"undefined"==typeof Promise&&(requestUserMedia=null),a.maybeThroughWebRTCReady());var s;!(function(){"use strict";var e=null;a.TEXT.EXTENSION={REQUIRE_INSTALLATION_FF:"To enable screensharing you need to install the Skylink WebRTC tools Firefox Add-on.",REQUIRE_INSTALLATION_CHROME:"To enable screensharing you need to install the Skylink WebRTC tools Chrome Extension.",REQUIRE_REFRESH:"Please refresh this page after the Skylink WebRTC tools extension has been installed.",BUTTON_FF:"Install Now",BUTTON_CHROME:"Go to Chrome Web Store"};var t=function(e){if(null===e||"object"!=typeof e)return e;var t=e.constructor();for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t};if(window.navigator.mozGetUserMedia?(e=window.navigator.getUserMedia,navigator.getUserMedia=function(n,r,i){if(n&&n.video&&n.video.mediaSource){if("screen"!==n.video.mediaSource&&"window"!==n.video.mediaSource)return void i(new Error('GetUserMedia: Only "screen" and "window" are supported as mediaSource constraints'));var o=t(n);o.video.mozMediaSource=o.video.mediaSource;var s=setInterval(function(){"complete"===document.readyState&&(clearInterval(s),e(o,r,function(e){["PermissionDeniedError","SecurityError"].indexOf(e.name)>-1&&"https:"===window.parent.location.protocol?a.renderNotificationBar(a.TEXT.EXTENSION.REQUIRE_INSTALLATION_FF,a.TEXT.EXTENSION.BUTTON_FF,"https://addons.mozilla.org/en-US/firefox/addon/skylink-webrtc-tools/",!0,!0):i(e)}))},1)}else e(n,r,i)},a.getUserMedia=window.getUserMedia=navigator.getUserMedia):window.navigator.webkitGetUserMedia&&"safari"!==window.webrtcDetectedBrowser?(e=window.navigator.getUserMedia,navigator.getUserMedia=function(n,i,o){if(n&&n.video&&n.video.mediaSource){if("chrome"!==window.webrtcDetectedBrowser)return void o(new Error("Current browser does not support screensharing"));var s=t(n),c=function(t,n){t?o("permission-denied"===t?new Error("Permission denied for screen retrieval"):new Error("Failed retrieving selected screen")):(s.video.mandatory=s.video.mandatory||{},s.video.mandatory.chromeMediaSource="desktop",s.video.mandatory.maxWidth=window.screen.width>1920?window.screen.width:1920,s.video.mandatory.maxHeight=window.screen.height>1080?window.screen.height:1080,n&&(s.video.mandatory.chromeMediaSourceId=n),delete s.video.mediaSource,e(s,i,o))},u=function e(t){t.data&&(t.data.chromeMediaSourceId&&("PermissionDeniedError"===t.data.chromeMediaSourceId?c("permission-denied"):c(null,t.data.chromeMediaSourceId)),t.data.chromeExtensionStatus&&("not-installed"===t.data.chromeExtensionStatus?a.renderNotificationBar(a.TEXT.EXTENSION.REQUIRE_INSTALLATION_CHROME,a.TEXT.EXTENSION.BUTTON_CHROME,t.data.data,!0,!0):c(t.data.chromeExtensionStatus,null)),window.removeEventListener("message",e))};window.addEventListener("message",u),r({captureSourceId:!0})}else e(n,i,o)},a.getUserMedia=window.getUserMedia=navigator.getUserMedia,navigator.mediaDevices.getUserMedia=function(e){return new Promise(function(t,n){window.getUserMedia(e,t,n)})}):navigator.mediaDevices&&navigator.userAgent.match(/Edge\/(\d+).(\d+)$/)?o.warn("Edge does not support screensharing feature in getUserMedia"):(e=window.navigator.getUserMedia,navigator.getUserMedia=function(n,r,i){if(n&&n.video&&n.video.mediaSource){var o=t(n);a.WebRTCPlugin.callWhenPluginReady(function(){a.WebRTCPlugin.plugin.HasScreensharingFeature&&a.WebRTCPlugin.plugin.isScreensharingAvailable?(o.video.optional=o.video.optional||[],o.video.optional.push({sourceId:a.WebRTCPlugin.plugin.screensharingKey||"Screensharing"}),delete o.video.mediaSource,e(o,r,i)):i(new Error("Your version of the WebRTC plugin does not support screensharing"))})}else e(n,r,i)},a.getUserMedia=getUserMedia=window.getUserMedia=navigator.getUserMedia,navigator.mediaDevices&&"undefined"!=typeof Promise&&(navigator.mediaDevices.getUserMedia="undefined"==typeof requestUserMedia?void 0:requestUserMedia)),"chrome"===window.webrtcDetectedBrowser){var n=document.createElement("iframe");n.onload=function(){n.isLoaded=!0},n.src="https://cdn.temasys.com.sg/skylink/extensions/detectRTC.html",n.style.display="none",(document.body||document.documentElement).appendChild(n);var r=function(e){e=e||{},n.isLoaded?n.contentWindow.postMessage(e,"*"):setTimeout(function(){n.contentWindow.postMessage(e,"*")},100)}}else"opera"===window.webrtcDetectedBrowser&&o.warn("Opera does not support screensharing feature in getUserMedia")})()}).call(t,"modules/RTC/adapter.screenshare.js")},function(e,t){function n(){var e=arguments[0],t=arguments[1],n=Array.prototype.slice.call(arguments,2);if(!(i[t]: ").apply(c,n)}}function r(e,t,r,o){this.id=t,this.format=o,this.transports=r,this.transports||(this.transports=[]),this.level=i[e];for(var a=Object.keys(i),s=0;s=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(90),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:1200;(function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this),this.message={timestamp:"",sentBytes:1e4,padding:""};var n=r(t-o.getCurrent().toString().length-JSON.stringify(this.message).length);this.message.padding=n}return i(e,[{key:"make",value:function(e){return this.message.timestamp=o.getCurrent(),this.message.sentBytes=e,JSON.stringify(this.message)}}]),e})();t.MessageMaker=a,t.randomAsciiString=r},function(e,t,n){"use strict";function r(e,t,n){this.stream=e,this.intervalId=null,this.intervalMilis=t,this.audioLevel=0,this.callback=n}t.a=r;var i=n(1);window.AudioContext=window.AudioContext||window.webkitAudioContext;var o=null;window.AudioContext&&(o=new AudioContext).suspend&&o.suspend(),r.prototype.start=function(){if(r.isLocalStatsSupported()){o.resume();var e=o.createAnalyser();e.smoothingTimeConstant=.8,e.fftSize=2048,o.createMediaStreamSource(this.stream).connect(e);var t=this;this.intervalId=setInterval(function(){var n=new Uint8Array(e.frequencyBinCount);e.getByteTimeDomainData(n);var r=(function(e){for(var t=0,n=e.length,r=0;r.2?t-.2:n<-.4?t+.4:e).toFixed(3))})(r,t.audioLevel),t.callback(t.audioLevel))},this.intervalMilis)}},r.prototype.stop=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)},r.isLocalStatsSupported=function(){return Boolean(o&&!i.b.isTemasysPluginUsed())}},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"c",function(){return o}),n.d(t,"d",function(){return a});var r="statistics.audioLevel",i="statistics.before_disposed",o="statistics.byte_sent_stats",a="statistics.connectionstats"},function(e,t,n){var r=n(96),i={loadScript:function(e,t,n,i,o,a){var s=document,c=s.createElement("script"),u=s.getElementsByTagName("script")[0];if(c.async=t,i){var l=r();if(l){var d=l.src,p=d.substring(0,d.lastIndexOf("/")+1);d&&p&&(e=p+e)}}o&&(c.onload=o),a&&(c.onerror=a),c.src=e,n?u.parentNode.insertBefore(c,u):u.parentNode.appendChild(c)}};e.exports=i},function(e,t,n){"use strict";(function(e){var r=n(0),i=(n.n(r),n(2)),o=(n.n(i),n(101)),a=(n.n(o),n(19)),s=n.n(a),c=n(47),u=n(26),l=n(1),d=n(102),p=n(105),h=n(113),f=n(114),m=n(115),v=n(116),g=n(10),y=n(117),b=(function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"/http-bind";e&&(t+=(-1===t.indexOf("?")?"?":"&")+"token="+e);var n=new i.Strophe.Connection(t);return n.maxRetries=3,n})(n,e.bosh),r.caps=new y.a(r.connection,r.options.clientNode),r.initFeaturesList(),$(window).on("beforeunload unload",r.disconnect.bind(r)),r}return(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)})(t,g.a),b(t,[{key:"initFeaturesList",value:function(){this.caps.addFeature("urn:xmpp:jingle:1"),this.caps.addFeature("urn:xmpp:jingle:apps:rtp:1"),this.caps.addFeature("urn:xmpp:jingle:transports:ice-udp:1"),this.caps.addFeature("urn:xmpp:jingle:apps:dtls:0"),this.caps.addFeature("urn:xmpp:jingle:transports:dtls-sctp:1"),this.caps.addFeature("urn:xmpp:jingle:apps:rtp:audio"),this.caps.addFeature("urn:xmpp:jingle:apps:rtp:video"),!this.options.disableRtx&&l.b.supportsRtx()&&this.caps.addFeature("urn:ietf:rfc:4588"),this.caps.addFeature("urn:ietf:rfc:5761"),this.caps.addFeature("urn:ietf:rfc:5888"),l.b.isChrome()&&!1!==this.options.enableLipSync&&(S.info("Lip-sync enabled !"),this.caps.addFeature("http://jitsi.org/meet/lipsync")),this.connection.rayo&&this.caps.addFeature("urn:xmpp:rayo:client:1")}},{key:"getConnection",value:function(){return this.connection}},{key:"connectionHandler",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this,n=arguments[1],r=arguments[2],o=window.performance.now(),a=i.Strophe.getStatusString(n).toLowerCase();if(this.connectionTimes[a]=o,S.log("(TIME) Strophe "+a+(r?"["+r+"]":"")+":\t",o),n===i.Strophe.Status.CONNECTED||n===i.Strophe.Status.ATTACHED){(this.options.useStunTurn||this.options.p2p&&this.options.p2p.useStunTurn)&&this.connection.jingle.getStunAndTurnCredentials(),S.info("My Jabber ID: "+this.connection.jid);var s=this.connection.domain;this.connection.ping.hasPingSupport(s,function(e){e?t.connection.ping.startInterval(s):S.warn("Ping NOT supported by "+s)}),e.password&&(this.authenticatedUser=!0),this.connection&&this.connection.connected&&i.Strophe.getResourceFromJid(this.connection.jid)&&this.eventEmitter.emit(u.CONNECTION_ESTABLISHED,i.Strophe.getResourceFromJid(this.connection.jid))}else if(n===i.Strophe.Status.CONNFAIL)"x-strophe-bad-non-anon-jid"===r?this.anonymousConnectionFailed=!0:this.connectionFailed=!0,this.lastErrorMsg=r,"giving-up"===r&&this.eventEmitter.emit(u.CONNECTION_FAILED,c.OTHER_ERROR,r);else if(n===i.Strophe.Status.DISCONNECTED){this.connection.ping.stopInterval();var l=this.disconnectInProgress,d=r||this.lastErrorMsg;if(this.disconnectInProgress=!1,this.anonymousConnectionFailed)this.eventEmitter.emit(u.CONNECTION_FAILED,c.PASSWORD_REQUIRED);else if(this.connectionFailed)this.eventEmitter.emit(u.CONNECTION_FAILED,c.OTHER_ERROR,d,void 0,this._getConnectionFailedReasonDetails());else if(l)this.eventEmitter.emit(u.CONNECTION_DISCONNECTED,d);else{S.error("XMPP connection dropped!");var p=i.Strophe.getLastErrorStatus();p>=500&&p<600?this.eventEmitter.emit(u.CONNECTION_FAILED,c.SERVER_ERROR,d||"server-error"):this.eventEmitter.emit(u.CONNECTION_FAILED,c.CONNECTION_DROPPED_ERROR,d||"connection-dropped-error")}}else n===i.Strophe.Status.AUTHFAIL&&this.eventEmitter.emit(u.CONNECTION_FAILED,c.PASSWORD_REQUIRED,r,e)}},{key:"_connect",value:function(e,t){this.anonymousConnectionFailed=!1,this.connectionFailed=!1,this.lastErrorMsg=void 0,this.connection.connect(e,t,this.connectionHandler.bind(this,{jid:e,password:t}))}},{key:"attach",value:function(e){var t=this.connectionTimes.attaching=window.performance.now();S.log("(TIME) Strophe Attaching\t:"+t),this.connection.attach(e.jid,e.sid,parseInt(e.rid,10)+1,this.connectionHandler.bind(this,{jid:e.jid,password:e.password}))}},{key:"connect",value:function(e,t){if(!e){var n=this.options.hosts,r=n.anonymousdomain,i=n.domain,o=r||i,a=window.location;if(r){var s=a&&a.search;(s&&-1!==s.indexOf("login=true")||this.token)&&(o=i)}e=o||a&&a.hostname}return this._connect(e,t)}},{key:"createRoom",value:function(e,t){var n=i.Strophe.getNodeFromJid(this.connection.jid),r=e+"@"+this.options.hosts.muc+"/",o=t.useNicks&&t.nick?t.nick:null;return o?n=t.nick:this.authenticatedUser||(n=n.substr(0,8)),(this.authenticatedUser||null!==o)&&(n+="-"+s.a.randomHexString(6)),r+=n,this.connection.emuc.createRoom(r,null,t)}},{key:"getJingleLog",value:function(){var e=this.connection.jingle;return e?e.getLog():{}}},{key:"getXmppLog",value:function(){return(this.connection.logger||{}).log||null}},{key:"dial",value:function(){var e;(e=this.connection.rayo).dial.apply(e,arguments)}},{key:"setMute",value:function(e,t){this.connection.moderate.setMute(e,t)}},{key:"eject",value:function(e){this.connection.moderate.eject(e)}},{key:"getSessions",value:function(){return this.connection.jingle.sessions}},{key:"disconnect",value:function(e){if(!this.disconnectInProgress&&this.connection&&this.connection.connected){if(this.disconnectInProgress=!0,this.connection.flush(),null!==e&&void 0!==e){var t=e.type;"beforeunload"!==t&&"unload"!==t||(this.connection.options.sync=!0)}this.connection.disconnect(),!0!==this.connection.options.sync&&this.connection.flush()}else this.eventEmitter.emit(u.WRONG_STATE)}},{key:"_initStrophePlugins",value:function(){var e={jvb:{iceServers:[]},p2p:{iceServers:[]}},t=this.options.p2p&&this.options.p2p.stunServers||[{urls:"stun:stun.l.google.com:19302"},{urls:"stun:stun1.l.google.com:19302"},{urls:"stun:stun2.l.google.com:19302"}];Array.isArray(t)&&(S.info("P2P STUN servers: ",t),e.p2p.iceServers=t),this.options.p2p&&this.options.p2p.iceTransportPolicy&&(S.info("P2P ICE transport policy: ",this.options.p2p.iceTransportPolicy),e.p2p.iceTransportPolicy=this.options.p2p.iceTransportPolicy),Object(d.a)(this),Object(p.a)(this,this.eventEmitter,e),Object(h.a)(),Object(f.a)(this),Object(m.a)(),Object(v.a)()}},{key:"_getConnectionFailedReasonDetails",value:function(){var e={};if(this.options.deploymentInfo&&this.options.deploymentInfo.shard&&this.connection._proto&&this.connection._proto.lastResponseHeaders){var t={};this.connection._proto.lastResponseHeaders.trim().split(/[\r\n]+/).forEach(function(e){var n=e.split(": "),r=n.shift(),i=n.join(": ");t[r]=i}),e.shard_changed=this.options.deploymentInfo.shard!==t["x-jitsi-shard"]}return e.suspend_time=this.connection.ping.getPingSuspendTime(),e}}]),t})();t.a=_}).call(t,"modules/xmpp/xmpp.js")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"CONNECTION_DROPPED_ERROR",function(){return r}),n.d(t,"OTHER_ERROR",function(){return i}),n.d(t,"PASSWORD_REQUIRED",function(){return o}),n.d(t,"SERVER_ERROR",function(){return a});var r="connection.droppedError",i="connection.otherError",o="connection.passwordRequired",a="connection.serverError"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"ON",function(){return r}),n.d(t,"OFF",function(){return i});var r="on",i="off"},function(e,t){e.exports={IDENTITY_UPDATED:"authentication.identity_updated"}},function(e,t,n){"use strict";(function(e){function r(e){if("function"==typeof e.querySelector){var t=e.querySelector("error"),n=t&&t.querySelector("text");return t&&{code:t.attributes.code&&t.attributes.code.value,type:t.attributes.type&&t.attributes.type.value,message:n&&n.textContent}}var r=null,i=!0,o=!1,a=void 0;try{for(var s,c=e.children["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(i=(s=c.next()).done);i=!0){var u=s.value;if("error"===u.tagName){r=u;break}}}catch(e){o=!0,a=e}finally{try{!i&&c.return&&c.return()}finally{if(o)throw a}}if(!r)return null;var l=null,d=!0,p=!1,h=void 0;try{for(var f,m=r.children["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(d=(f=m.next()).done);d=!0){var v=f.value;if("text"===v.tagName){l=v.value;break}}}catch(e){p=!0,h=e}finally{try{!d&&m.return&&m.return()}finally{if(p)throw h}}return{code:r.attributes.code,type:r.attributes.type,message:l}}function i(e,t,n,r,o,a){this.eventEmitter=t,this.connection=n,this.state=null,this.focusMucJid=r,this.jirecon=o,this.url=null,this.type=e,this._isSupported=!(e===i.types.JIRECON&&!this.jirecon||e!==i.types.JIBRI&&e!==i.types.JIBRI_FILE&&e!==i.types.COLIBRI),this.jireconRid=null,this.roomjid=a}t.a=i;var o=n(0),a=(n.n(o),n(2)),s=(n.n(a),n(8)),c=n(51),u=n(3),l=Object(o.getLogger)(e);i.types={COLIBRI:"colibri",JIRECON:"jirecon",JIBRI:"jibri",JIBRI_FILE:"jibri_file"},i.status={ON:"on",OFF:"off",AVAILABLE:"available",UNAVAILABLE:"unavailable",PENDING:"pending",RETRYING:"retrying",ERROR:"error",BUSY:"busy",FAILED:"failed"},i.action={START:"start",STOP:"stop"},i.prototype.handleJibriPresence=function(e){var t=e.attributes;if(t){var n=t.status,o=r(e);l.log("Handle Jibri presence : "+n,o),n!==this.state&&("undefined"===n?this.state=i.status.UNAVAILABLE:n===i.status.OFF?this.state&&"undefined"!==this.state&&this.state!==i.status.UNAVAILABLE?this.state=i.status.OFF:this.state=i.status.AVAILABLE:this.state=n,this.eventEmitter.emit(s.RECORDER_STATE_CHANGED,this.state))}},i.prototype.setRecordingJibri=function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e===this.state&&n(c.INVALID_STATE);var s=Object(a.$iq)({to:this.focusMucJid,type:"set"}).c("jibri",{xmlns:"http://jitsi.org/protocol/jibri",action:e===i.status.ON?i.action.START:i.action.STOP,recording_mode:this.type===i.types.JIBRI_FILE?"file":"stream",streamid:this.type===i.types.JIBRI?o.streamId:void 0}).up();l.log("Set jibri recording: "+e,s.nodeTree),l.log(s.nodeTree),this.connection.sendIQ(s,function(e){l.log("Result",e);var n=$(e).find("jibri");t(n.attr("state"),n.attr("url"))},function(e){l.log("Failed to start recording, error: ",r(e)),n(e)})},i.prototype.setRecordingJirecon=function(e,t,n){e===this.state&&n(new Error("Invalid state!"));var r=Object(a.$iq)({to:this.jirecon,type:"set"}).c("recording",{xmlns:"http://jitsi.org/protocol/jirecon",action:e===i.status.ON?i.action.START:i.action.STOP,mucjid:this.roomjid});e===i.status.OFF&&r.attrs({rid:this.jireconRid}),l.log("Start recording");var o=this;this.connection.sendIQ(r,function(n){o.jireconRid=$(n).find("recording").attr("rid");var r=e===i.status.ON?"started":"stopped";l.log("Recording "+r+"(jirecon)"+n),o.state=e,e===i.status.OFF&&(o.jireconRid=null),t(e)},function(e){l.log("Failed to start recording, error: ",e),n(e)})},i.prototype.setRecordingColibri=function(e,t,n,r){var i=Object(a.$iq)({to:this.focusMucJid,type:"set"});i.c("conference",{xmlns:"http://jitsi.org/protocol/colibri"}),i.c("recording",{state:e,token:r.token});var o=this;this.connection.sendIQ(i,function(n){l.log('Set recording "',e,'". Result:',n);var r=$(n).find(">conference>recording").attr("state");o.state=r,t(r),"pending"===r&&o.connection.addHandler(function(e){var n=$(e).find("recording").attr("state");n&&(o.state=r,t(n))},"http://jitsi.org/protocol/colibri","iq",null,null,null)},function(e){l.warn(e),n(e)})},i.prototype.setRecording=function(){switch(this.type){case i.types.JIRECON:this.setRecordingJirecon.apply(this,arguments);break;case i.types.COLIBRI:this.setRecordingColibri.apply(this,arguments);break;case i.types.JIBRI:case i.types.JIBRI_FILE:this.setRecordingJibri.apply(this,arguments);break;default:var e="Unknown recording type!";u.callErrorHandler(new Error(e)),l.error(e)}},i.prototype.toggleRecording=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1],n=this.state;if(n===i.status.UNAVAILABLE||n===i.status.FAILED?t(i.status.FAILED,c.RECORDER_UNAVAILABLE):n===i.status.BUSY&&t(i.status.BUSY,c.RECORDER_BUSY),(n===i.status.OFF||n===i.status.AVAILABLE)&&(!e.token&&this.type===i.types.COLIBRI||!e.streamId&&this.type===i.types.JIBRI))return t(i.status.FAILED,c.NO_TOKEN),void l.error("No token passed!");var r=n===i.status.AVAILABLE||n===i.status.OFF?i.status.ON:i.status.OFF,o=this;l.log("Toggle recording (old state, new state): ",n,r),this.setRecording(r,function(e,r){e&&e!==n&&(o.state=e,o.url=r,t(e))},function(e){return t(i.status.FAILED,e)},e)},i.prototype.isSupported=function(){return this._isSupported},i.prototype.getState=function(){return this.state},i.prototype.getURL=function(){return this.url}}).call(t,"modules/xmpp/recording.js")},function(e,t){e.exports={RECORDER_UNAVAILABLE:"recorder.unavailable",RECORDER_BUSY:"recorder.busy",NO_TOKEN:"recorder.noToken",STATE_CHANGE_FAILED:"recorder.stateChangeFailed",INVALID_STATE:"recorder.invalidState"}},function(e,t,n){"use strict";n.d(t,"c",function(){return r}),n.d(t,"a",function(){return i}),n.d(t,"b",function(){return o});var r="pending",i="active",o="ended"},function(e,t,n){"use strict";function r(e){for(var t=e.split("\r\nm="),n=1,r=t.length;n2&&t.attrs({streams:a[2]}),t.up()}if(i.a.findLines(this.media[e],"a=fingerprint:",this.session).forEach(function(o){(n=i.a.parseFingerprint(o)).xmlns="urn:xmpp:jingle:apps:dtls:0",t.c("fingerprint").t(n.fingerprint),delete n.fingerprint,(o=i.a.findLine(r.media[e],"a=setup:",r.session))&&(n.setup=o.substr(8)),t.attrs(n),t.up()}),n=i.a.iceparams(this.media[e],this.session)){n.xmlns="urn:xmpp:jingle:transports:ice-udp:1",t.attrs(n);var s=i.a.findLines(this.media[e],"a=candidate:",this.session);s.length&&s.forEach(function(e){var n=i.a.candidateToJingle(e);r.failICE&&(n.ip="1.1.1.1");var o=n&&"string"==typeof n.protocol?n.protocol.toLowerCase():"";r.removeTcpCandidates&&("tcp"===o||"ssltcp"===o)||r.removeUdpCandidates&&"udp"===o||t.c("candidate",n).up()})}t.up()},r.prototype.rtcpFbToJingle=function(e,t,n){i.a.findLines(this.media[e],"a=rtcp-fb:"+n).forEach(function(e){var n=i.a.parseRTCPFB(e);"trr-int"===n.type?(t.c("rtcp-fb-trr-int",{xmlns:"urn:xmpp:jingle:apps:rtp:rtcp-fb:0",value:n.params[0]}),t.up()):(t.c("rtcp-fb",{xmlns:"urn:xmpp:jingle:apps:rtp:rtcp-fb:0",type:n.type}),n.params.length>0&&t.attrs({subtype:n.params[0]}),t.up())})},r.prototype.rtcpFbFromJingle=function(e,t){var n="",r=e.find('>rtcp-fb-trr-int[xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0"]');return r.length&&(n+="a=rtcp-fb:* trr-int ",r.attr("value")?n+=r.attr("value"):n+="0",n+="\r\n"),(r=e.find('>rtcp-fb[xmlns="urn:xmpp:jingle:apps:rtp:rtcp-fb:0"]')).each(function(){n+="a=rtcp-fb:"+t+" "+$(this).attr("type"),$(this).attr("subtype")&&(n+=" "+$(this).attr("subtype")),n+="\r\n"}),n},r.prototype.fromJingle=function(e){var t=this;this.raw="v=0\r\no=- 1923518516 2 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\n";var n=$(e).find('>group[xmlns="urn:xmpp:jingle:apps:grouping:0"]');n.length&&n.each(function(e,n){var r=$(n).find(">content").map(function(e,t){return t.getAttribute("name")}).get();r.length>0&&(t.raw+="a=group:"+(n.getAttribute("semantics")||n.getAttribute("type"))+" "+r.join(" ")+"\r\n")}),this.session=this.raw,e.find(">content").each(function(){var e=t.jingle2media($(this));t.media.push(e)}),this.raw=this.session+this.media.join("")},r.prototype.jingle2media=function(e){var t=e.find("description"),n="",r=this,o=e.find('>transport>sctpmap[xmlns="urn:xmpp:jingle:transports:dtls-sctp:1"]'),a={media:t.attr("media")};if(a.port="1","rejected"===e.attr("senders")&&(a.port="0"),e.find(">transport>fingerprint").length||t.find("encryption").length?a.proto=o.length?"DTLS/SCTP":"RTP/SAVPF":a.proto="RTP/AVPF",o.length){n+="m=application 1 DTLS/SCTP "+o.attr("number")+"\r\n",n+="a=sctpmap:"+o.attr("number")+" "+o.attr("protocol");var s=o.attr("streams");n+=s?" "+s+"\r\n":"\r\n"}else a.fmt=t.find("payload-type").map(function(){return this.getAttribute("id")}).get(),n+=i.a.buildMLine(a)+"\r\n";switch(n+="c=IN IP4 0.0.0.0\r\n",o.length||(n+="a=rtcp:1 IN IP4 0.0.0.0\r\n"),(a=e.find('>transport[xmlns="urn:xmpp:jingle:transports:ice-udp:1"]')).length&&(a.attr("ufrag")&&(n+=i.a.buildICEUfrag(a.attr("ufrag"))+"\r\n"),a.attr("pwd")&&(n+=i.a.buildICEPwd(a.attr("pwd"))+"\r\n"),a.find(">fingerprint").each(function(){n+="a=fingerprint:"+this.getAttribute("hash"),n+=" "+$(this).text(),n+="\r\n",this.getAttribute("setup")&&(n+="a=setup:"+this.getAttribute("setup")+"\r\n")})),e.attr("senders")){case"initiator":n+="a=sendonly\r\n";break;case"responder":n+="a=recvonly\r\n";break;case"none":n+="a=inactive\r\n";break;case"both":n+="a=sendrecv\r\n"}return n+="a=mid:"+e.attr("name")+"\r\n",t.find("rtcp-mux").length&&(n+="a=rtcp-mux\r\n"),t.find("encryption").length&&t.find("encryption>crypto").each(function(){n+="a=crypto:"+this.getAttribute("tag"),n+=" "+this.getAttribute("crypto-suite"),n+=" "+this.getAttribute("key-params"),this.getAttribute("session-params")&&(n+=" "+this.getAttribute("session-params")),n+="\r\n"}),t.find("payload-type").each(function(){n+=i.a.buildRTPMap(this)+"\r\n",$(this).find(">parameter").length&&(n+="a=fmtp:"+this.getAttribute("id")+" ",n+=$(this).find("parameter").map(function(){var e=this.getAttribute("name");return(e?e+"=":"")+this.getAttribute("value")}).get().join("; "),n+="\r\n"),n+=r.rtcpFbFromJingle($(this),this.getAttribute("id"))}),n+=r.rtcpFbFromJingle(t,"*"),(a=t.find('>rtp-hdrext[xmlns="urn:xmpp:jingle:apps:rtp:rtp-hdrext:0"]')).each(function(){n+="a=extmap:"+this.getAttribute("id")+" "+this.getAttribute("uri")+"\r\n"}),e.find('>transport[xmlns="urn:xmpp:jingle:transports:ice-udp:1"]>candidate').each(function(){var e=this.getAttribute("protocol");e="string"==typeof e?e.toLowerCase():"",r.removeTcpCandidates&&("tcp"===e||"ssltcp"===e)||r.removeUdpCandidates&&"udp"===e||(r.failICE&&this.setAttribute("ip","1.1.1.1"),n+=i.a.candidateFromJingle(this))}),e.find('description>ssrc-group[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]').each(function(){var e=this.getAttribute("semantics"),t=$(this).find(">source").map(function(){return this.getAttribute("ssrc")}).get();t.length&&(n+="a=ssrc-group:"+e+" "+t.join(" ")+"\r\n")}),(a=e.find('description>source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]')).each(function(){var e=this.getAttribute("ssrc");$(this).find(">parameter").each(function(){var t=this.getAttribute("name"),r=this.getAttribute("value");r=i.a.filterSpecialChars(r),n+="a=ssrc:"+e+" "+t,r&&r.length&&(n+=":"+r),n+="\r\n"})}),n}},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i});var r="signaling.peerMuted",i="signaling.peerVideoType"},function(e,t,n){"use strict";(function(e){function r(e,t){void 0===e.active?e.onended=t:e.oninactive=t}var i=n(16),o=n.n(i),a=n(0),s=(n.n(a),n(18)),c=n(4),u=n(28),l=(function(){function e(e,t){for(var n=0;n=0;--n){var r=t[n];e||u.a.attachMediaStream(r,null),e&&r!==e||t.splice(n,1)}e&&u.a.attachMediaStream(e,null)}},{key:"_attachTTFMTracker",value:function(e){}},{key:"dispose",value:function(){return this.removeAllListeners(),this.disposed=!0,Promise.resolve()}},{key:"isScreenSharing",value:function(){}},{key:"getId",value:function(){return this.stream?u.a.getStreamID(this.stream):null}},{key:"isActive",value:function(){return void 0===this.stream.active||this.stream.active}},{key:"setAudioLevel",value:function(e,t){this.audioLevel!==e&&(this.audioLevel=e,this.emit(s.TRACK_AUDIO_LEVEL_CHANGED,e,t))}},{key:"getMSID",value:function(){var e=this.getStreamId(),t=this.getTrackId();return e&&t?e+" "+t:null}},{key:"setAudioOutput",value:function(e){var t=this;return u.a.isDeviceChangeAvailable("output")?this.isVideoTrack()?Promise.resolve():Promise.all(this.containers.map(function(t){return t.setSinkId(e).catch(function(e){throw d.warn("Failed to change audio output device on element. Default or previously set audio output device will be used.",t,e),e})})).then(function(){t.emit(s.TRACK_AUDIO_OUTPUT_CHANGED,e)}):Promise.reject(new Error("Audio output device change is not supported"))}}]),t})();t.a=h}).call(t,"modules/RTC/JitsiTrack.js")},function(e,t){e.exports={ENVIRONMENT:"environment",USER:"user"}},function(e,t){var n=e.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w\/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-\.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return null!=e.address?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%d trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return null!=e.subtype?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))? (\S*)(?: (\S*))?/,names:["value","direction","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+" %s"+(e.config?" %s":"")}},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return null!=e.sessionConfig?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=null!=e.raddr?" raddr %s rport %d":"%v%v",t+=null!=e.tcptype?" tcptype %s":"%v",null!=e.generation&&(t+=" generation %d"),(t+=null!=e["network-id"]?" network-id %d":"%v")+(null!=e["network-cost"]?" network-cost %d":"%v")}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return null!=e.attribute&&(t+=" %s",null!=e.value&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_\/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return null!=e.maxMessageSize?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{push:"invalid",names:["value"]}]};Object.keys(n).forEach(function(e){n[e].forEach(function(e){e.reg||(e.reg=/(.*)/),e.format||(e.format="%s")})})},function(e,t,n){"use strict";(function(e){var t="function"==typeof Symbol&&"symbol"==typeof("function"==typeof Symbol?Symbol.iterator:"@@iterator")?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==("function"==typeof Symbol?Symbol.prototype:"@@prototype")?"symbol":typeof e},n={};n.generateIdentifier=function(){return Math.random().toString(36).substr(2,10)},n.localCName=n.generateIdentifier(),n.splitLines=function(e){return e.trim().split("\n").map(function(e){return e.trim()})},n.splitSections=function(e){return e.split("\nm=").map(function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"})},n.matchPrefix=function(e,t){return n.splitLines(e).filter(function(e){return 0===e.indexOf(t)})},n.parseCandidate=function(e){for(var t,n={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},n.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},n.parseFmtp=function(e){for(var t,n={},r=e.substr(e.indexOf(" ")+1).split(";"),i=0;i-1?(n.attribute=e.substr(t+1,r-t-1),n.value=e.substr(r+1)):n.attribute=e.substr(t+1),n},n.getMid=function(e){var t=n.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},n.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},n.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:n.matchPrefix(e+t,"a=fingerprint:").map(n.parseFingerprint)}},n.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach(function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"}),n},n.getIceParameters=function(e,t){var r=n.splitLines(e);return{usernameFragment:(r=r.concat(n.splitLines(t))).filter(function(e){return 0===e.indexOf("a=ice-ufrag:")})[0].substr(12),password:r.filter(function(e){return 0===e.indexOf("a=ice-pwd:")})[0].substr(10)}},n.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},n.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},r=n.splitLines(e)[0].split(" "),i=3;i0?"9":"0",r+=" UDP/TLS/RTP/SAVPF ",r+=t.codecs.map(function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType}).join(" ")+"\r\n",r+="c=IN IP4 0.0.0.0\r\n",r+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach(function(e){r+=n.writeRtpMap(e),r+=n.writeFmtp(e),r+=n.writeRtcpFb(e)});var i=0;return t.codecs.forEach(function(e){e.maxptime>i&&(i=e.maxptime)}),i>0&&(r+="a=maxptime:"+i+"\r\n"),r+="a=rtcp-mux\r\n",t.headerExtensions.forEach(function(e){r+=n.writeExtmap(e)}),r},n.parseRtpEncodingParameters=function(e){var t,r=[],i=n.parseRtpParameters(e),o=-1!==i.fecMechanisms.indexOf("RED"),a=-1!==i.fecMechanisms.indexOf("ULPFEC"),s=n.matchPrefix(e,"a=ssrc:").map(function(e){return n.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute}),c=s.length>0&&s[0].ssrc,u=n.matchPrefix(e,"a=ssrc-group:FID").map(function(e){var t=e.split(" ");return t.shift(),t.map(function(e){return parseInt(e,10)})});u.length>0&&u[0].length>1&&u[0][0]===c&&(t=u[0][1]),i.codecs.forEach(function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var n={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10),rtx:{ssrc:t}};r.push(n),o&&((n=JSON.parse(JSON.stringify(n))).fec={ssrc:t,mechanism:a?"red+ulpfec":"red"},r.push(n))}}),0===r.length&&c&&r.push({ssrc:c});var l=n.matchPrefix(e,"b=");return l.length&&(l=0===l[0].indexOf("b=TIAS:")?parseInt(l[0].substr(7),10):0===l[0].indexOf("b=AS:")?1e3*parseInt(l[0].substr(5),10)*.95-16e3:void 0,r.forEach(function(e){e.maxBitrate=l})),r},n.parseRtcpParameters=function(e){var t={},r=n.matchPrefix(e,"a=ssrc:").map(function(e){return n.parseSsrcMedia(e)}).filter(function(e){return"cname"===e.attribute})[0];r&&(t.cname=r.value,t.ssrc=r.ssrc);var i=n.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=i.length>0,t.compound=0===i.length;var o=n.matchPrefix(e,"a=rtcp-mux");return t.mux=o.length>0,t},n.parseMsid=function(e){var t,r=n.matchPrefix(e,"a=msid:");if(1===r.length)return{stream:(t=r[0].substr(7).split(" "))[0],track:t[1]};var i=n.matchPrefix(e,"a=ssrc:").map(function(e){return n.parseSsrcMedia(e)}).filter(function(e){return"msid"===e.attribute});return i.length>0?{stream:(t=i[0].value.split(" "))[0],track:t[1]}:void 0},n.generateSessionId=function(){return Math.random().toString().substr(2,21)},n.writeSessionBoilerplate=function(e,t){var r=void 0!==t?t:2;return"v=0\r\no=thisisadapterortc "+(e||n.generateSessionId())+" "+r+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},n.writeMediaSection=function(e,t,r,i){var o=n.writeRtpDescription(e.kind,t);if(o+=n.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=n.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===r?"actpass":"active"),o+="a=mid:"+e.mid+"\r\n",e.direction?o+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?o+="a=sendrecv\r\n":e.rtpSender?o+="a=sendonly\r\n":e.rtpReceiver?o+="a=recvonly\r\n":o+="a=inactive\r\n",e.rtpSender){var a="msid:"+i.id+" "+e.rtpSender.track.id+"\r\n";o+="a="+a,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+a,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+a,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+n.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+n.localCName+"\r\n"),o},n.getDirection=function(e,t){for(var r=n.splitLines(e),i=0;i0&&t.data.push(e.data)},t},a.prototype.removeTrack=function(e){if(!e.isVideoTrack()){var t=this.recorders,n=void 0;for(n=0;n0){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);n.id="deployment_info",M.a.sendLog(JSON.stringify(n))}if(this.version){var i={id:"component_version",component:"lib-jitsi-meet",version:this.version};M.a.sendLog(JSON.stringify(i))}return O.a.init(e||{})},isDesktopSharingEnabled:function(){return O.a.isDesktopSharingEnabled()},setLogLevel:function(e){R.a.setLogLevel(e)},setLogLevelById:function(e,t){R.a.setLogLevelById(e,t)},addGlobalLogTransport:function(e){R.a.addGlobalTransport(e)},removeGlobalLogTransport:function(e){R.a.removeGlobalTransport(e)},createLocalTracks:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=!1;return!0===arguments[1]&&window.setTimeout(function(){n||m.a.emitEvent(v.PERMISSION_PROMPT_IS_SHOWN,D.b.getName())},1e3),window.connectionTimes||(window.connectionTimes={}),window.connectionTimes["obtainPermissions.start"]=window.performance.now(),O.a.obtainAudioAndVideoPermissions(t).then(function(e){if(n=!0,window.connectionTimes["obtainPermissions.end"]=window.performance.now(),M.a.sendAnalytics(Object(i.y)("success",r(t))),!O.a.options.disableAudioLevels)for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:{};this.xmpp.connect(e.id,e.password)},r.prototype.attach=function(e){this.xmpp.attach(e)},r.prototype.disconnect=function(){var e;(e=this.xmpp).disconnect.apply(e,arguments)},r.prototype.setToken=function(e){this.token=e},r.prototype.initJitsiConference=function(e,t){return new o.a({name:e,config:t,connection:this})},r.prototype.addEventListener=function(e,t){this.xmpp.addListener(e,t)},r.prototype.removeEventListener=function(e,t){this.xmpp.removeListener(e,t)},r.prototype.getConnectionTimes=function(){return this.xmpp.connectionTimes},r.prototype.addFeature=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.xmpp.caps.addFeature(e,t)},r.prototype.removeFeature=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.xmpp.caps.removeFeature(e,t)}},function(e,t,n){"use strict";(function(e){function r(e){if(!e.name||e.name.toLowerCase()!==e.name){var t="Invalid conference name (no conference name passed or it contains invalid characters like capital letters)!";throw B.error(t),new Error(t)}this.eventEmitter=new h.a,this.options=e,this.eventManager=new v.a(this),this.participants={},this._init(e),this.componentsVersions=new s.a(this),this.jvbJingleSession=null,this.lastDominantSpeaker=null,this.dtmfManager=null,this.somebodySupportsDTMF=!1,this.authEnabled=!1,this.startAudioMuted=!1,this.startVideoMuted=!1,this.startMutedPolicy={audio:!1,video:!1},this.availableDevices={audio:void 0,video:void 0},this.isMutedByFocus=!1,this.wasStopped=!1,this.connectionQuality=new c.a(this,this.eventEmitter,e),this.avgRtpStatsReporter=new a.a(this,e.config.avgRtpStatsN||15),this.isJvbConnectionInterrupted=!1,this.speakerStatsCollector=new H.a(this),this.deferredStartP2PTask=null;var n=parseInt(e.config.p2p&&e.config.p2p.backToP2PDelay,10);this.backToP2PDelay=isNaN(n)?5:n,B.info("backToP2PDelay: "+this.backToP2PDelay),this.isP2PConnectionInterrupted=!1,this.p2p=!1,this.p2pJingleSession=null,this.videoSIPGWHandler=new j.a(this.room)}t.a=r;var i=n(2),o=(n.n(i),n(6)),a=n(66),s=n(98),c=n(99),u=n(0),l=(n.n(u),n(3)),d=n.n(l),p=n(16),h=n.n(p),f=n(100),m=n(32),v=n(118),g=n(7),y=n(120),b=n.n(y),S=n(121),_=n(12),T=n(17),C=n(18),E=n(122),w=n(4),R=n(36),k=n(123),I=n(27),P=n(1),A=n(9),O=(n.n(A),n(5)),D=n(160),x=n(161),N=n.n(x),L=n(13),M=n.n(L),j=n(166),F=n(30),U=n(8),H=(n.n(U),n(168)),B=Object(u.getLogger)(e);r.prototype.constructor=r,r.prototype._init=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.connection&&(this.connection=t.connection,this.xmpp=this.connection.xmpp,this.eventManager.setupXMPPListeners());var n=this.options.config;if(this.room=this.xmpp.createRoom(this.options.name,n),this._onIceConnectionInterrupted=this._onIceConnectionInterrupted.bind(this),this.room.addListener(U.CONNECTION_INTERRUPTED,this._onIceConnectionInterrupted),this._onIceConnectionRestored=this._onIceConnectionRestored.bind(this),this.room.addListener(U.CONNECTION_RESTORED,this._onIceConnectionRestored),this._onIceConnectionEstablished=this._onIceConnectionEstablished.bind(this),this.room.addListener(U.CONNECTION_ESTABLISHED,this._onIceConnectionEstablished),this.room.updateDeviceAvailability(I.a.getDeviceAvailability()),this.rtc||(this.rtc=new I.a(this,t),this.eventManager.setupRTCListeners()),this.participantConnectionStatus=new R.b(this.rtc,this,{rtcMuteTimeout:n._peerConnStatusRtcMuteTimeout,outOfLastNTimeout:n._peerConnStatusOutOfLastNTimeout}),this.participantConnectionStatus.init(),!this.statistics){var r=window.location,i=this.myUserId();n.enableDisplayNameInStats&&n.displayName&&(i=n.displayName),this.statistics=new O.a(this.xmpp,{callStatsAliasName:i,callStatsConfIDNamespace:n.callStatsConfIDNamespace||r&&r.hostname||n.hosts&&n.hosts.domain,callStatsCustomScriptUrl:n.callStatsCustomScriptUrl,callStatsID:n.callStatsID,callStatsSecret:n.callStatsSecret,roomName:this.options.name,swapUserNameAndAlias:n.enableStatsID,applicationName:n.applicationName,getWiFiStatsMethod:n.getWiFiStatsMethod})}this.eventManager.setupChatRoomListeners(),this.eventManager.setupStatisticsListeners(),n.enableTalkWhileMuted&&new D.a(this,function(){return e.eventEmitter.emit(g.TALK_WHILE_MUTED)}),"channelLastN"in n&&this.setLastN(n.channelLastN),this.jvb121Status=new E.a(this),this.p2pDominantSpeakerDetection=new k.a(this)},r.prototype.join=function(e){this.room&&this.room.join(e)},r.prototype.authenticateAndUpgradeRole=function(){for(var e=arguments.length,t=Array(e),n=0;n0&&void 0!==arguments[0]&&arguments[0],t=this.getParticipants();return e||(t=t.filter(function(e){return!e.isHidden()})),t.length+1},r.prototype.getParticipantById=function(e){return this.participants[e]},r.prototype.kickParticipant=function(e){var t=this.getParticipantById(e);t&&this.room.kick(t.getJid())},r.prototype.muteParticipant=function(e){var t=this.getParticipantById(e);t&&this.room.muteParticipant(t.getJid(),!0)},r.prototype.onMemberJoined=function(e,t,n,r,o,a){var s=this,c=i.Strophe.getResourceFromJid(e);if("focus"!==c&&this.myUserId()!==c){var u=new S.a(e,this,t,r,o,a);u._role=n,this.participants[c]=u,this.eventEmitter.emit(g.USER_JOINED,c,u),this.xmpp.caps.getFeatures(e).then(function(e){u._supportsDTMF=e.has("urn:xmpp:jingle:dtmf:0"),s.updateDTMFSupport()},function(t){return B.warn("Failed to discover features of "+e,t)}),this._maybeStartOrStopP2P()}},r.prototype.onMemberLeft=function(e){var t=this,n=i.Strophe.getResourceFromJid(e);if("focus"!==n&&this.myUserId()!==n){var r=this.participants[n];delete this.participants[n],this.rtc.removeRemoteTracks(n).forEach(function(e){return t.eventEmitter.emit(g.TRACK_REMOVED,e)}),r&&this.eventEmitter.emit(g.USER_LEFT,n,r),this._maybeStartOrStopP2P(!0)}},r.prototype.onLocalRoleChanged=function(e){this.eventEmitter.emit(g.USER_ROLE_CHANGED,this.myUserId(),e),this._maybeStartOrStopP2P()},r.prototype.onUserRoleChanged=function(e,t){var n=i.Strophe.getResourceFromJid(e),r=this.getParticipantById(n);r&&(r._role=t,this.eventEmitter.emit(g.USER_ROLE_CHANGED,n,t))},r.prototype.onDisplayNameChanged=function(e,t){var n=i.Strophe.getResourceFromJid(e),r=this.getParticipantById(n);r&&r._displayName!==t&&(r._displayName=t,this.eventEmitter.emit(g.DISPLAY_NAME_CHANGED,n,t))},r.prototype.onRemoteTrackAdded=function(e){var t=this;if(!e.isP2P||this.isP2PActive())if(e.isP2P||!this.isP2PActive()){var n=e.getParticipantId(),r=this.getParticipantById(n);if(r){r._tracks.push(e),this.transcriber&&this.transcriber.addTrack(e);var i=this.eventEmitter;e.addEventListener(C.TRACK_MUTE_CHANGED,function(){return i.emit(g.TRACK_MUTE_CHANGED,e)}),e.addEventListener(C.TRACK_AUDIO_LEVEL_CHANGED,function(e,r){t.getActivePeerConnection()===r&&i.emit(g.TRACK_AUDIO_LEVEL_CHANGED,n,e)}),i.emit(g.TRACK_ADDED,e)}else B.error("No participant found for id: "+n)}else B.info("Trying to add remote JVB track, when in P2P - IGNORED");else B.info("Trying to add remote P2P track, when not in P2P - IGNORED")},r.prototype.onCallAccepted=function(e,t){this.p2pJingleSession===e&&(B.info("P2P setAnswer"),this.p2pJingleSession.setAnswer(t))},r.prototype.onTransportInfo=function(e,t){this.p2pJingleSession===e&&(B.info("P2P addIceCandidates"),this.p2pJingleSession.addIceCandidates(t))},r.prototype.onRemoteTrackRemoved=function(e){var t=this;this.getParticipants().forEach(function(n){for(var r=n.getTracks(),i=0;icontent>transport>web-socket").first();1===r.length&&(n=r[0].getAttribute("url"));var i=void 0;switch(this.options.config.openBridgeChannel){case"datachannel":case!0:case void 0:i="datachannel";break;case"websocket":i="websocket"}"datachannel"!==i||P.b.supportsDataChannels()||(i="websocket"),"datachannel"===i?this.rtc.initializeBridgeChannel(t,null):"websocket"===i&&n&&this.rtc.initializeBridgeChannel(null,n)},r.prototype._rejectIncomingCall=function(e,t){t&&t.errorMsg&&d.a.callErrorHandler(new Error(t.errorMsg)),e.terminate(null,function(e){B.warn("An error occurred while trying to terminate invalid Jingle session",e)},{reason:t&&t.reason,reasonDescription:t&&t.reasonDescription,sendSessionTerminate:!0})},r.prototype.onCallEnded=function(e,t,n){B.info("Call ended: "+t+" - "+n+" P2P ?"+e.isP2P),e===this.jvbJingleSession?(this.wasStopped=!0,O.a.sendAnalytics(Object(o.z)(o.d,{p2p:!1})),this.statistics&&(this.statistics.stopRemoteStats(this.jvbJingleSession.peerconnection),B.info("Stopping JVB CallStats"),this.statistics.stopCallStats(this.jvbJingleSession.peerconnection)),this.jvbJingleSession=null,this.rtc.onCallEnded()):e===this.p2pJingleSession?("decline"===t&&"force JVB121"===n?(B.info("In forced JVB 121 mode..."),O.a.analytics.addPermanentProperties({forceJvb121:!0})):"connectivity-error"===t&&"ICE FAILED"===n&&O.a.analytics.addPermanentProperties({p2pFailed:!0}),this._stopP2PSession()):B.error("Received onCallEnded for invalid session",e.sid,e.remoteJid,t,n)},r.prototype.onSuspendDetected=function(e){e.isP2P||(this.leave(),this.eventEmitter.emit(g.SUSPEND_DETECTED))},r.prototype.updateDTMFSupport=function(){for(var e=!1,t=this.getParticipants(),n=0;n "+i),!i&&this.deferredStartP2PTask&&this._maybeClearDeferredStartP2P(),r&&!this.p2pJingleSession&&i){var a=n&&t[0];if(r&&"moderator"===a.getRole()){var s=this.myUserId(),c=a.getId();if(s>c)return void B.debug("Everyone's a moderator - the other peer should start P2P",s,c);if(s===c)return void B.error("The same IDs ? ",s,c)}var u=a.getJid();if(e){if(this.deferredStartP2PTask)return void B.error("Deferred start P2P task's been set already!");B.info("Will start P2P with: "+u+" after "+this.backToP2PDelay+" seconds..."),this.deferredStartP2PTask=setTimeout(this._startP2PSession.bind(this,u),1e3*this.backToP2PDelay)}else B.info("Will start P2P with: "+u),this._startP2PSession(u)}else this.p2pJingleSession&&!i&&(B.info("Will stop P2P with: "+this.p2pJingleSession.remoteJid),this.p2pJingleSession.isInitiator&&n>1&&O.a.sendAnalyticsAndLog(Object(o.B)(o.i)),this._stopP2PSession())}else B.info("Auto P2P disabled")},r.prototype._stopP2PSession=function(e,t){if(this.p2pJingleSession){var n=this.isP2PActive();n&&(this.jvbJingleSession&&this._resumeMediaTransferForJvbConnection(),this._removeRemoteP2PTracks()),B.info("Stopping remote stats for P2P connection"),this.statistics.stopRemoteStats(this.p2pJingleSession.peerconnection),B.info("Stopping CallStats for P2P connection"),this.statistics.stopCallStats(this.p2pJingleSession.peerconnection),this.p2pJingleSession.terminate(function(){B.info("P2P session terminate RESULT")},function(t){e&&B.error("An error occurred while trying to terminate P2P Jingle session",t)},{reason:e||"success",reasonDescription:t||"Turing off P2P session",sendSessionTerminate:this.room&&this.getParticipantById(i.Strophe.getResourceFromJid(this.p2pJingleSession.remoteJid))}),this.p2pJingleSession=null,this._setP2PStatus(!1),n&&(this.jvbJingleSession?this._addRemoteJVBTracks():B.info("Not adding remote JVB tracks - no session yet"))}else B.error("No P2P session to be stopped!")},r.prototype.isP2PActive=function(){return this.p2p},r.prototype.getP2PConnectionState=function(){return this.isP2PActive()?this.p2pJingleSession.peerconnection.getConnectionState():null},r.prototype.startP2PSession=function(){var e=this.getParticipants();if(1!==e.length)throw new Error("There must be exactly 1 participant to start the P2P session !");var t=e[0].getJid();this._startP2PSession(t)},r.prototype.stopP2PSession=function(){this._stopP2PSession()},r.prototype.getSpeakerStats=function(){return this.speakerStatsCollector.getStats()},r.prototype.setReceiverVideoConstraint=function(e){this.rtc.setReceiverVideoConstraint(e)},r.prototype.createVideoSIPGWSession=function(e,t){return this.room?this.videoSIPGWHandler.createVideoSIPGWSession(e,t):new Error(F.ERROR_NO_CONNECTION)}}).call(t,"JitsiConference.js")},function(e,t,n){"use strict";(function(e){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=n(6),o=n(0),a=(n.n(o),n(31)),s=n(7),c=n(4),u=n(1),l=n(5),d=n(13),p=(n.n(d),(function(){function e(e,t){for(var n=0;n=this._n){if(u.b.supportsRTTStatistics()){var t=this._avgRtpStatsReporter._conference,n={p2p:this.isP2P,conference_size:t.getParticipantCount()};if(e.transport&&e.transport.length&&babelHelpers.extends(n,{local_candidate_type:e.transport[0].localCandidateType,remote_candidate_type:e.transport[0].remoteCandidateType,transport_type:e.transport[0].type}),this._avgRTT.appendReport(n),this.isP2P){var r=this._avgRtpStatsReporter.jvbStatsMonitor._avgEnd2EndRTT;isNaN(r)||(n.rtt_diff=this._avgRTT.calculate()-r)}else{var o=this._calculateAvgRemoteRTT(),a=this._avgRTT.calculate();this._avgEnd2EndRTT=a+o,isNaN(a)||isNaN(o)||(n.end2end_rtt_avg=this._avgEnd2EndRTT)}l.a.sendAnalytics(Object(i.D)(n))}this._resetAvgStats()}}else h.error("No stats")}},{key:"_calculateAvgRemoteRTT",value:function(){var e=0,t=0,n=!0,r=!1,i=void 0;try{for(var o,a=this._avgRemoteRTTMap.values()["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(n=(o=a.next()).done);n=!0){var s=o.value,c=s.calculate();isNaN(c)||(t+=c,e+=1,s.reset())}}catch(e){r=!0,i=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw i}}return t/e}},{key:"_processRemoteStats",value:function(e,t){var n="number"==typeof t.jvbRTT,r=this._avgRemoteRTTMap.get(e);!r&&n&&(r=new f(e+"_stat_rtt"),this._avgRemoteRTTMap.set(e,r)),n?r.addNext(t.jvbRTT):r&&this._avgRemoteRTTMap.delete(e)}},{key:"_resetAvgStats",value:function(){this._avgRTT.reset(),this._avgRemoteRTTMap&&this._avgRemoteRTTMap.clear(),this._sampleIdx=0}},{key:"dispose",value:function(){var e=this._avgRtpStatsReporter._conference;e.statistics.removeConnectionStatsListener(this._onConnectionStats),this.isP2P||(e.off(a.REMOTE_STATS_UPDATED,this._onRemoteStatsUpdated),e.off(s.USER_LEFT,this._onUserLeft))}}]),e})(),v=(function(){function e(t,n){var i=this;r(this,e),this._n=n,n>0?(h.info("Avg RTP stats will be calculated every "+n+" samples"),this._sampleIdx=0,this._conference=t,this._avgAudioBitrateUp=new f("bitrate_audio_upload"),this._avgAudioBitrateDown=new f("bitrate_audio_download"),this._avgVideoBitrateUp=new f("bitrate_video_upload"),this._avgVideoBitrateDown=new f("bitrate_video_download"),this._avgBandwidthUp=new f("bandwidth_upload"),this._avgBandwidthDown=new f("bandwidth_download"),this._avgPacketLossTotal=new f("packet_loss_total"),this._avgPacketLossUp=new f("packet_loss_upload"),this._avgPacketLossDown=new f("packet_loss_download"),this._avgRemoteFPS=new f("framerate_remote"),this._avgRemoteScreenFPS=new f("framerate_screen_remote"),this._avgLocalFPS=new f("framerate_local"),this._avgLocalScreenFPS=new f("framerate_screen_local"),this._avgRemoteCameraPixels=new f("pixels_remote"),this._avgRemoteScreenPixels=new f("pixels_screen_remote"),this._avgLocalCameraPixels=new f("pixels_local"),this._avgLocalScreenPixels=new f("pixels_screen_local"),this._avgCQ=new f("connection_quality"),this._onLocalStatsUpdated=function(e){return i._calculateAvgStats(e)},t.on(a.LOCAL_STATS_UPDATED,this._onLocalStatsUpdated),this._onP2PStatusChanged=function(){h.debug("Resetting average stats calculation"),i._resetAvgStats(),i.jvbStatsMonitor._resetAvgStats(),i.p2pStatsMonitor._resetAvgStats()},t.on(s.P2P_STATUS,this._onP2PStatusChanged),this._onJvb121StatusChanged=function(e,t){!0===t&&(h.info("Resetting JVB avg RTP stats"),i._resetAvgJvbStats())},t.on(s.JVB121_STATUS,this._onJvb121StatusChanged),this.jvbStatsMonitor=new m(this,!1,n),this.p2pStatsMonitor=new m(this,!0,n)):h.info("Avg RTP stats reports are disabled.")}return p(e,[{key:"_calculateAvgStats",value:function(e){if(e){var t=this._conference.isP2PActive(),n=this._conference.getParticipantCount();if(t||!(n<2)){var r=e.bitrate,o=e.bandwidth,a=e.packetLoss,s=e.framerate,c=e.resolution;if(r)if(o)if(a)if(s)if(c){if(this._avgAudioBitrateUp.addNext(r.audio.upload),this._avgAudioBitrateDown.addNext(r.audio.download),this._avgVideoBitrateUp.addNext(r.video.upload),this._avgVideoBitrateDown.addNext(r.video.download),u.b.supportsBandwidthStatistics()&&(this._avgBandwidthUp.addNext(o.upload),this._avgBandwidthDown.addNext(o.download)),this._avgPacketLossUp.addNext(a.upload),this._avgPacketLossDown.addNext(a.download),this._avgPacketLossTotal.addNext(a.total),this._avgCQ.addNext(e.connectionQuality),s&&(this._avgRemoteFPS.addNext(this._calculateAvgVideoFps(s,!1,d.CAMERA)),this._avgRemoteScreenFPS.addNext(this._calculateAvgVideoFps(s,!1,d.DESKTOP)),this._avgLocalFPS.addNext(this._calculateAvgVideoFps(s,!0,d.CAMERA)),this._avgLocalScreenFPS.addNext(this._calculateAvgVideoFps(s,!0,d.DESKTOP))),c&&(this._avgRemoteCameraPixels.addNext(this._calculateAvgVideoPixels(c,!1,d.CAMERA)),this._avgRemoteScreenPixels.addNext(this._calculateAvgVideoPixels(c,!1,d.DESKTOP)),this._avgLocalCameraPixels.addNext(this._calculateAvgVideoPixels(c,!0,d.CAMERA)),this._avgLocalScreenPixels.addNext(this._calculateAvgVideoPixels(c,!0,d.DESKTOP))),this._sampleIdx+=1,this._sampleIdx>=this._n){var p={p2p:t,conference_size:n};e.transport&&e.transport.length&&babelHelpers.extends(p,{local_candidate_type:e.transport[0].localCandidateType,remote_candidate_type:e.transport[0].remoteCandidateType,transport_type:e.transport[0].type}),this._avgAudioBitrateUp.appendReport(p),this._avgAudioBitrateDown.appendReport(p),this._avgVideoBitrateUp.appendReport(p),this._avgVideoBitrateDown.appendReport(p),u.b.supportsBandwidthStatistics()&&(this._avgBandwidthUp.appendReport(p),this._avgBandwidthDown.appendReport(p)),this._avgPacketLossUp.appendReport(p),this._avgPacketLossDown.appendReport(p),this._avgPacketLossTotal.appendReport(p),this._avgRemoteFPS.appendReport(p),isNaN(this._avgRemoteScreenFPS.calculate())||this._avgRemoteScreenFPS.appendReport(p),this._avgLocalFPS.appendReport(p),isNaN(this._avgLocalScreenFPS.calculate())||this._avgLocalScreenFPS.appendReport(p),this._avgRemoteCameraPixels.appendReport(p),isNaN(this._avgRemoteScreenPixels.calculate())||this._avgRemoteScreenPixels.appendReport(p),this._avgLocalCameraPixels.appendReport(p),isNaN(this._avgLocalScreenPixels.calculate())||this._avgLocalScreenPixels.appendReport(p),this._avgCQ.appendReport(p),l.a.sendAnalytics(Object(i.D)(p)),this._resetAvgStats()}}else h.error("No resolution");else h.error('No "framerate"');else h.error('No "packetloss"');else h.error('No "bandwidth"');else h.error('No "bitrate"')}}else h.error("No stats")}},{key:"_calculateAvgVideoPixels",value:function(e,t,n){var r=0,i=0,o=this._conference.myUserId(),a=!0,s=!1,c=void 0;try{for(var u,l=Object.keys(e)["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(a=(u=l.next()).done);a=!0){var d=u.value;if(t?d===o:d!==o){var p=t?null:this._conference.getParticipantById(d),h=e[d];if((t||p)&&h){var f=this._calculatePeerAvgVideoPixels(h,p,n);isNaN(f)||(r+=f,i+=1)}}}}catch(e){s=!0,c=e}finally{try{!a&&l.return&&l.return()}finally{if(s)throw c}}return r/i}},{key:"_calculatePeerAvgVideoPixels",value:function(e,t,n){var r=Object.keys(e).map(function(e){return Number(e)}),i=null,o=this._conference.getActivePeerConnection();t?(i=t.getTracksByMediaType(c.b))&&(r=r.filter(function(e){return i.find(function(t){return!t.isMuted()&&t.getSSRC()===e&&t.videoType===n})})):(i=this._conference.getLocalTracks(c.b),r=r.filter(function(e){return i.find(function(t){return!t.isMuted()&&o.getLocalSSRC(t)===e&&t.videoType===n})}));var a=0,s=0,u=!0,l=!1,d=void 0;try{for(var p,h=r["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(u=(p=h.next()).done);u=!0){var f=p.value,m=Number(e[f].height)*Number(e[f].width);!isNaN(m)&&m>0&&(a+=m,s+=1)}}catch(e){l=!0,d=e}finally{try{!u&&h.return&&h.return()}finally{if(l)throw d}}return a/s}},{key:"_calculateAvgVideoFps",value:function(e,t,n){var r=0,i=0,o=this._conference.myUserId(),a=!0,s=!1,c=void 0;try{for(var u,l=Object.keys(e)["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(a=(u=l.next()).done);a=!0){var d=u.value;if(t?d===o:d!==o){var p=t?null:this._conference.getParticipantById(d),h=e[d];if((t||p)&&h){var f=this._calculatePeerAvgVideoFps(h,p,n);isNaN(f)||(r+=f,i+=1)}}}}catch(e){s=!0,c=e}finally{try{!a&&l.return&&l.return()}finally{if(s)throw c}}return r/i}},{key:"_calculatePeerAvgVideoFps",value:function(e,t,n){var r=Object.keys(e).map(function(e){return Number(e)}),i=null,o=this._conference.getActivePeerConnection();t?(i=t.getTracksByMediaType(c.b))&&(r=r.filter(function(e){return i.find(function(t){return!t.isMuted()&&t.getSSRC()===e&&t.videoType===n})})):(i=this._conference.getLocalTracks(c.b),r=r.filter(function(e){return i.find(function(t){return!t.isMuted()&&o.getLocalSSRC(t)===e&&t.videoType===n})}));var a=0,s=0,u=!0,l=!1,d=void 0;try{for(var p,h=r["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(u=(p=h.next()).done);u=!0){var f=p.value,m=Number(e[f]);!isNaN(m)&&m>0&&(a+=m,s+=1)}}catch(e){l=!0,d=e}finally{try{!u&&h.return&&h.return()}finally{if(l)throw d}}return a/s}},{key:"_resetAvgJvbStats",value:function(){this._resetAvgStats(),this.jvbStatsMonitor._resetAvgStats()}},{key:"_resetAvgStats",value:function(){this._avgAudioBitrateUp.reset(),this._avgAudioBitrateDown.reset(),this._avgVideoBitrateUp.reset(),this._avgVideoBitrateDown.reset(),this._avgBandwidthUp.reset(),this._avgBandwidthDown.reset(),this._avgPacketLossUp.reset(),this._avgPacketLossDown.reset(),this._avgPacketLossTotal.reset(),this._avgRemoteFPS.reset(),this._avgRemoteScreenFPS.reset(),this._avgLocalFPS.reset(),this._avgLocalScreenFPS.reset(),this._avgRemoteCameraPixels.reset(),this._avgRemoteScreenPixels.reset(),this._avgLocalCameraPixels.reset(),this._avgLocalScreenPixels.reset(),this._avgCQ.reset(),this._sampleIdx=0}},{key:"dispose",value:function(){this._conference.off(s.P2P_STATUS,this._onP2PStatusChanged),this._conference.off(a.LOCAL_STATS_UPDATED,this._onLocalStatsUpdated),this._conference.off(s.JVB121_STATUS,this._onJvb121StatusChanged),this.jvbStatsMonitor.dispose(),this.p2pStatsMonitor.dispose()}}]),e})();t.a=v}).call(t,"modules/statistics/AvgRTPStatsReporter.js")},function(e,t,n){function r(e,t){this.logStorage=e,this.stringifyObjects=!(!t||!t.stringifyObjects)&&t.stringifyObjects,this.storeInterval=t&&t.storeInterval?t.storeInterval:3e4,this.maxEntryLength=t&&t.maxEntryLength?t.maxEntryLength:1e4,Object.keys(o.levels).forEach(function(e){this[o.levels[e]]=function(e){this._log.apply(this,arguments)}.bind(this,e)}.bind(this)),this.storeLogsIntervalID=null,this.queue=[],this.totalLen=0,this.outputCache=[]}var i="function"==typeof Symbol&&"symbol"==typeof("function"==typeof Symbol?Symbol.iterator:"@@iterator")?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==("function"==typeof Symbol?Symbol.prototype:"@@prototype")?"symbol":typeof e},o=n(38);r.prototype.stringify=function(e){try{return JSON.stringify(e)}catch(e){return"[object with circular refs?]"}},r.prototype.formatLogMessage=function(e){for(var t="",n=1,r=arguments.length;n=this.maxEntryLength&&this._flush(!0,!0)},r.prototype.start=function(){this._reschedulePublishInterval()},r.prototype._reschedulePublishInterval=function(){this.storeLogsIntervalID&&(window.clearTimeout(this.storeLogsIntervalID),this.storeLogsIntervalID=null),this.storeLogsIntervalID=window.setTimeout(this._flush.bind(this,!1,!0),this.storeInterval)},r.prototype.flush=function(){this._flush(!1,!0)},r.prototype._flush=function(e,t){this.totalLen>0&&(this.logStorage.isReady()||e)&&(this.logStorage.isReady()?(this.outputCache.length&&(this.outputCache.forEach(function(e){this.logStorage.storeLogs(e)}.bind(this)),this.outputCache=[]),this.logStorage.storeLogs(this.queue)):this.outputCache.push(this.queue),this.queue=[],this.totalLen=0),t&&this._reschedulePublishInterval()},r.prototype.stop=function(){this._flush(!1,!1)},e.exports=r},function(e,t,n){"use strict";(function(e){function r(){var e=navigator.userAgent;if(e.match(/Electron/)){var t=e.match(/Electron\/([\d.]+)/)[1];return d.info("This appears to be Electron, ver: "+t),{name:u.ELECTRON,version:t}}}function i(){var e=navigator.userAgent;if(e.match(/JitsiMeetNW/)){var t=e.match(/JitsiMeetNW\/([\d.]+)/)[1];return d.info("This appears to be JitsiMeetNW, ver: "+t),{name:u.NWJS,version:t}}}function o(){var e=navigator.userAgent.match(/\b(react[ \t_-]*native)(?:\/(\S+))?/i),t=void 0;if(e||"ReactNative"===navigator.product){var n=void 0;return e&&e.length>2&&(n=e[1],t=e[2]),n||(n="react-native"),t||(t="unknown"),d.info("This appears to be "+n+", ver: "+t),{name:u.REACT_NATIVE,version:t}}}var a=n(69),s=n.n(a),c=n(0),u=(n.n(c),n(39)),l=(function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:(function(){for(var e=void 0,t=[o,r,i],n=0;n1&&n[1]||""}function n(t){var n=e.match(t);return n&&n.length>1&&n[2]||""}var r,i=t(/(ipod|iphone|ipad)/i).toLowerCase(),a=!/like android/i.test(e)&&/android/i.test(e),s=/nexus\s*[0-6]\s*/i.test(e),c=!s&&/nexus\s*[0-9]+/i.test(e),u=/CrOS/.test(e),l=/silk/i.test(e),d=/sailfish/i.test(e),p=/tizen/i.test(e),h=/(web|hpw)os/i.test(e),f=/windows phone/i.test(e),m=(/SamsungBrowser/i.test(e),!f&&/windows/i.test(e)),v=!i&&!l&&/macintosh/i.test(e),g=!a&&!d&&!p&&!h&&/linux/i.test(e),y=n(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),b=t(/version\/(\d+(\.\d+)?)/i),S=/tablet/i.test(e)&&!/tablet pc/i.test(e),_=!S&&/[^-]mobi/i.test(e),T=/xbox/i.test(e);/opera/i.test(e)?r={name:"Opera",opera:o,version:b||t(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(e)?r={name:"Opera",opera:o,version:t(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||b}:/SamsungBrowser/i.test(e)?r={name:"Samsung Internet for Android",samsungBrowser:o,version:b||t(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(e)?r={name:"Opera Coast",coast:o,version:b||t(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(e)?r={name:"Yandex Browser",yandexbrowser:o,version:b||t(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(e)?r={name:"UC Browser",ucbrowser:o,version:t(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(e)?r={name:"Maxthon",maxthon:o,version:t(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(e)?r={name:"Epiphany",epiphany:o,version:t(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(e)?r={name:"Puffin",puffin:o,version:t(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(e)?r={name:"Sleipnir",sleipnir:o,version:t(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(e)?r={name:"K-Meleon",kMeleon:o,version:t(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:f?(r={name:"Windows Phone",osname:"Windows Phone",windowsphone:o},y?(r.msedge=o,r.version=y):(r.msie=o,r.version=t(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(e)?r={name:"Internet Explorer",msie:o,version:t(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:u?r={name:"Chrome",osname:"Chrome OS",chromeos:o,chromeBook:o,chrome:o,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(e)?r={name:"Microsoft Edge",msedge:o,version:y}:/vivaldi/i.test(e)?r={name:"Vivaldi",vivaldi:o,version:t(/vivaldi\/(\d+(\.\d+)?)/i)||b}:d?r={name:"Sailfish",osname:"Sailfish OS",sailfish:o,version:t(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(e)?r={name:"SeaMonkey",seamonkey:o,version:t(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(e)?(r={name:"Firefox",firefox:o,version:t(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(e)&&(r.firefoxos=o,r.osname="Firefox OS")):l?r={name:"Amazon Silk",silk:o,version:t(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(e)?r={name:"PhantomJS",phantom:o,version:t(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(e)?r={name:"SlimerJS",slimer:o,version:t(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(e)||/rim\stablet/i.test(e)?r={name:"BlackBerry",osname:"BlackBerry OS",blackberry:o,version:b||t(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:h?(r={name:"WebOS",osname:"WebOS",webos:o,version:b||t(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(e)&&(r.touchpad=o)):/bada/i.test(e)?r={name:"Bada",osname:"Bada",bada:o,version:t(/dolfin\/(\d+(\.\d+)?)/i)}:p?r={name:"Tizen",osname:"Tizen",tizen:o,version:t(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||b}:/qupzilla/i.test(e)?r={name:"QupZilla",qupzilla:o,version:t(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||b}:/chromium/i.test(e)?r={name:"Chromium",chromium:o,version:t(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||b}:/chrome|crios|crmo/i.test(e)?r={name:"Chrome",chrome:o,version:t(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:a?r={name:"Android",version:b}:/safari|applewebkit/i.test(e)?(r={name:"Safari",safari:o},b&&(r.version=b)):i?(r={name:"iphone"==i?"iPhone":"ipad"==i?"iPad":"iPod"},b&&(r.version=b)):r=/googlebot/i.test(e)?{name:"Googlebot",googlebot:o,version:t(/googlebot\/(\d+(\.\d+))/i)||b}:{name:t(/^(.*)\/(.*) /),version:n(/^(.*)\/(.*) /)},!r.msedge&&/(apple)?webkit/i.test(e)?(/(apple)?webkit\/537\.36/i.test(e)?(r.name=r.name||"Blink",r.blink=o):(r.name=r.name||"Webkit",r.webkit=o),!r.version&&b&&(r.version=b)):!r.opera&&/gecko\//i.test(e)&&(r.name=r.name||"Gecko",r.gecko=o,r.version=r.version||t(/gecko\/(\d+(\.\d+)?)/i)),r.windowsphone||!a&&!r.silk?!r.windowsphone&&i?(r[i]=o,r.ios=o,r.osname="iOS"):v?(r.mac=o,r.osname="macOS"):T?(r.xbox=o,r.osname="Xbox"):m?(r.windows=o,r.osname="Windows"):g&&(r.linux=o,r.osname="Linux"):(r.android=o,r.osname="Android");var C="";r.windows?C=(function(e){switch(t(/Windows ((NT|XP)( \d\d?.\d)?)/i)){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}})():r.windowsphone?C=t(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):r.mac?C=(C=t(/Mac OS X (\d+([_\.\s]\d+)*)/i)).replace(/[_\s]/g,"."):i?C=(C=t(/os (\d+([_\s]\d+)*) like mac os x/i)).replace(/[_\s]/g,"."):a?C=t(/android[ \/-](\d+(\.\d+)*)/i):r.webos?C=t(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):r.blackberry?C=t(/rim\stablet\sos\s(\d+(\.\d+)*)/i):r.bada?C=t(/bada\/(\d+(\.\d+)*)/i):r.tizen&&(C=t(/tizen[\/\s](\d+(\.\d+)*)/i)),C&&(r.osversion=C);var E=!r.windows&&C.split(".")[0];return S||c||"ipad"==i||a&&(3==E||E>=4&&!_)||r.silk?r.tablet=o:(_||"iphone"==i||"ipod"==i||a||s||r.blackberry||r.webos||r.bada)&&(r.mobile=o),r.msedge||r.msie&&r.version>=10||r.yandexbrowser&&r.version>=15||r.vivaldi&&r.version>=1||r.chrome&&r.version>=20||r.samsungBrowser&&r.version>=4||r.firefox&&r.version>=20||r.safari&&r.version>=6||r.opera&&r.version>=10||r.ios&&r.osversion&&r.osversion.split(".")[0]>=6||r.blackberry&&r.version>=10.1||r.chromium&&r.version>=20?r.a=o:r.msie&&r.version<10||r.chrome&&r.version<20||r.firefox&&r.version<20||r.safari&&r.version<6||r.opera&&r.version<10||r.ios&&r.osversion&&r.osversion.split(".")[0]<6||r.chromium&&r.version<20?r.c=o:r.x=o,r}function t(e){return e.split(".").length}function n(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n=0;){if(i[0][r]>i[1][r])return 1;if(i[0][r]!==i[1][r])return-1;if(0===r)return 0}}function i(t,n,i){var o=a;"string"==typeof n&&(i=n,n=void 0),void 0===n&&(n=!1),i&&(o=e(i));var s=""+o.version;for(var c in t)if(t.hasOwnProperty(c)&&o[c]){if("string"!=typeof t[c])throw new Error("Browser version in the minVersion map should be a string: "+c+": "+String(t));return r([s,t[c]])<0}return n}var o=!0,a=e("undefined"!=typeof navigator?navigator.userAgent||"":"");return a.test=function(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:{},n=null;"string"==typeof e?n={type:r.q,action:e,actionSubject:e,source:e,attributes:t}:"object"===(void 0===e?"undefined":s(e))&&(n=e),this._verifyRequiredFields(n)?this._sendEvent(n):u.error("Dropping a mis-formatted event: "+JSON.stringify(n))}},{key:"_verifyRequiredFields",value:function(e){if(!e)return!1;e.type||(e.type=r.q);var t=e.type;return t!==r.q&&t!==r.r&&t!==r.t&&t!==r.s?(u.error("Unknown event type: "+t),!1):t===r.r?Boolean(e.name):(e.action=e.action||e.name||e.actionSubject,e.actionSubject=e.actionSubject||e.name||e.action,e.source=e.source||e.name||e.action||e.actionSubject,e.action&&e.actionSubject&&e.source?!!(t!==r.s||(e.objectType=e.objectType||"generic-object-type",e.containerType=e.containerType||"conference","conference"!==e.containerType||e.containerId||(e.containerId=this.conferenceName),e.objectType&&e.objectId&&e.containerType&&e.containerId))||(u.error("Required field missing (containerId, containerType, objectId or objectType)"),!1):(u.error("Required field missing (action, actionSubject or source)"),!1))}},{key:"_maybeCacheEvent",value:function(e){return!!this.cache&&(this.cache.push(e),this.cache.length>100&&this.cache.splice(0,1),!0)}},{key:"_sendEvent",value:function(e){if(this._maybeCacheEvent(e));else{this._appendPermanentProperties(e);var t=!0,n=!1,r=void 0;try{for(var i,o=this.analyticsHandlers["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(t=(i=o.next()).done);t=!0){var a=i.value;try{a.sendEvent(e)}catch(e){u.warn("Error sending analytics event: "+e)}}}catch(e){n=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}}}},{key:"_appendPermanentProperties",value:function(e){e.attributes||(e.attributes={}),e.attributes=babelHelpers.extends(e.attributes,this.permanentProperties)}}]),e})();t.a=new l}).call(t,"modules/statistics/AnalyticsAdapter.js")},function(e,t,n){var r=n(19),i=["Aaliyah","Aaron","Abagail","Abbey","Abbie","Abbigail","Abby","Abdiel","Abdul","Abdullah","Abe","Abel","Abelardo","Abigail","Abigale","Abigayle","Abner","Abraham","Ada","Adah","Adalberto","Adaline","Adam","Adan","Addie","Addison","Adela","Adelbert","Adele","Adelia","Adeline","Adell","Adella","Adelle","Aditya","Adolf","Adolfo","Adolph","Adolphus","Adonis","Adrain","Adrian","Adriana","Adrianna","Adriel","Adrien","Adrienne","Afton","Aglae","Agnes","Agustin","Agustina","Ahmad","Ahmed","Aida","Aidan","Aiden","Aileen","Aisha","Aiyana","Akeem","Al","Alaina","Alan","Alana","Alanis","Alanna","Alayna","Alba","Albert","Alberta","Albertha","Alberto","Albin","Albina","Alda","Alden","Alec","Aleen","Alejandra","Alejandrin","Alek","Alena","Alene","Alessandra","Alessandro","Alessia","Aletha","Alex","Alexa","Alexander","Alexandra","Alexandre","Alexandrea","Alexandria","Alexandrine","Alexandro","Alexane","Alexanne","Alexie","Alexis","Alexys","Alexzander","Alf","Alfonso","Alfonzo","Alford","Alfred","Alfreda","Alfredo","Ali","Alia","Alice","Alicia","Alisa","Alisha","Alison","Alivia","Aliya","Aliyah","Aliza","Alize","Allan","Allen","Allene","Allie","Allison","Ally","Alphonso","Alta","Althea","Alva","Alvah","Alvena","Alvera","Alverta","Alvina","Alvis","Alyce","Alycia","Alysa","Alysha","Alyson","Alysson","Amalia","Amanda","Amani","Amara","Amari","Amaya","Amber","Ambrose","Amelia","Amelie","Amely","America","Americo","Amie","Amina","Amir","Amira","Amiya","Amos","Amparo","Amy","Amya","Ana","Anabel","Anabelle","Anahi","Anais","Anastacio","Anastasia","Anderson","Andre","Andreane","Andreanne","Andres","Andrew","Andy","Angel","Angela","Angelica","Angelina","Angeline","Angelita","Angelo","Angie","Angus","Anibal","Anika","Anissa","Anita","Aniya","Aniyah","Anjali","Anna","Annabel","Annabell","Annabelle","Annalise","Annamae","Annamarie","Anne","Annetta","Annette","Annie","Ansel","Ansley","Anthony","Antoinette","Antone","Antonetta","Antonette","Antonia","Antonietta","Antonina","Antonio","Antwan","Antwon","Anya","April","Ara","Araceli","Aracely","Arch","Archibald","Ardella","Arden","Ardith","Arely","Ari","Ariane","Arianna","Aric","Ariel","Arielle","Arjun","Arlene","Arlie","Arlo","Armand","Armando","Armani","Arnaldo","Arne","Arno","Arnold","Arnoldo","Arnulfo","Aron","Art","Arthur","Arturo","Arvel","Arvid","Arvilla","Aryanna","Asa","Asha","Ashlee","Ashleigh","Ashley","Ashly","Ashlynn","Ashton","Ashtyn","Asia","Assunta","Astrid","Athena","Aubree","Aubrey","Audie","Audra","Audreanne","Audrey","August","Augusta","Augustine","Augustus","Aurelia","Aurelie","Aurelio","Aurore","Austen","Austin","Austyn","Autumn","Ava","Avery","Avis","Axel","Ayana","Ayden","Ayla","Aylin","Baby","Bailee","Bailey","Barbara","Barney","Baron","Barrett","Barry","Bart","Bartholome","Barton","Baylee","Beatrice","Beau","Beaulah","Bell","Bella","Belle","Ben","Benedict","Benjamin","Bennett","Bennie","Benny","Benton","Berenice","Bernadette","Bernadine","Bernard","Bernardo","Berneice","Bernhard","Bernice","Bernie","Berniece","Bernita","Berry","Bert","Berta","Bertha","Bertram","Bertrand","Beryl","Bessie","Beth","Bethany","Bethel","Betsy","Bette","Bettie","Betty","Bettye","Beulah","Beverly","Bianka","Bill","Billie","Billy","Birdie","Blair","Blaise","Blake","Blanca","Blanche","Blaze","Bo","Bobbie","Bobby","Bonita","Bonnie","Boris","Boyd","Brad","Braden","Bradford","Bradley","Bradly","Brady","Braeden","Brain","Brandi","Brando","Brandon","Brandt","Brandy","Brandyn","Brannon","Branson","Brant","Braulio","Braxton","Brayan","Breana","Breanna","Breanne","Brenda","Brendan","Brenden","Brendon","Brenna","Brennan","Brennon","Brent","Bret","Brett","Bria","Brian","Briana","Brianne","Brice","Bridget","Bridgette","Bridie","Brielle","Brigitte","Brionna","Brisa","Britney","Brittany","Brock","Broderick","Brody","Brook","Brooke","Brooklyn","Brooks","Brown","Bruce","Bryana","Bryce","Brycen","Bryon","Buck","Bud","Buddy","Buford","Bulah","Burdette","Burley","Burnice","Buster","Cade","Caden","Caesar","Caitlyn","Cale","Caleb","Caleigh","Cali","Calista","Callie","Camden","Cameron","Camila","Camilla","Camille","Camren","Camron","Camryn","Camylle","Candace","Candelario","Candice","Candida","Candido","Cara","Carey","Carissa","Carlee","Carleton","Carley","Carli","Carlie","Carlo","Carlos","Carlotta","Carmel","Carmela","Carmella","Carmelo","Carmen","Carmine","Carol","Carolanne","Carole","Carolina","Caroline","Carolyn","Carolyne","Carrie","Carroll","Carson","Carter","Cary","Casandra","Casey","Casimer","Casimir","Casper","Cassandra","Cassandre","Cassidy","Cassie","Catalina","Caterina","Catharine","Catherine","Cathrine","Cathryn","Cathy","Cayla","Ceasar","Cecelia","Cecil","Cecile","Cecilia","Cedrick","Celestine","Celestino","Celia","Celine","Cesar","Chad","Chadd","Chadrick","Chaim","Chance","Chandler","Chanel","Chanelle","Charity","Charlene","Charles","Charley","Charlie","Charlotte","Chase","Chasity","Chauncey","Chaya","Chaz","Chelsea","Chelsey","Chelsie","Chesley","Chester","Chet","Cheyanne","Cheyenne","Chloe","Chris","Christ","Christa","Christelle","Christian","Christiana","Christina","Christine","Christop","Christophe","Christopher","Christy","Chyna","Ciara","Cicero","Cielo","Cierra","Cindy","Citlalli","Clair","Claire","Clara","Clarabelle","Clare","Clarissa","Clark","Claud","Claude","Claudia","Claudie","Claudine","Clay","Clemens","Clement","Clementina","Clementine","Clemmie","Cleo","Cleora","Cleta","Cletus","Cleve","Cleveland","Clifford","Clifton","Clint","Clinton","Clotilde","Clovis","Cloyd","Clyde","Coby","Cody","Colby","Cole","Coleman","Colin","Colleen","Collin","Colt","Colten","Colton","Columbus","Concepcion","Conner","Connie","Connor","Conor","Conrad","Constance","Constantin","Consuelo","Cooper","Cora","Coralie","Corbin","Cordelia","Cordell","Cordia","Cordie","Corene","Corine","Cornelius","Cornell","Corrine","Cortez","Cortney","Cory","Coty","Courtney","Coy","Craig","Crawford","Creola","Cristal","Cristian","Cristina","Cristobal","Cristopher","Cruz","Crystal","Crystel","Cullen","Curt","Curtis","Cydney","Cynthia","Cyril","Cyrus","Dagmar","Dahlia","Daija","Daisha","Daisy","Dakota","Dale","Dallas","Dallin","Dalton","Damaris","Dameon","Damian","Damien","Damion","Damon","Dan","Dana","Dandre","Dane","D'angelo","Dangelo","Danial","Daniela","Daniella","Danielle","Danika","Dannie","Danny","Dante","Danyka","Daphne","Daphnee","Daphney","Darby","Daren","Darian","Dariana","Darien","Dario","Darion","Darius","Darlene","Daron","Darrel","Darrell","Darren","Darrick","Darrin","Darrion","Darron","Darryl","Darwin","Daryl","Dashawn","Dasia","Dave","David","Davin","Davion","Davon","Davonte","Dawn","Dawson","Dax","Dayana","Dayna","Dayne","Dayton","Dean","Deangelo","Deanna","Deborah","Declan","Dedric","Dedrick","Dee","Deion","Deja","Dejah","Dejon","Dejuan","Delaney","Delbert","Delfina","Delia","Delilah","Dell","Della","Delmer","Delores","Delpha","Delphia","Delphine","Delta","Demarco","Demarcus","Demario","Demetris","Demetrius","Demond","Dena","Denis","Dennis","Deon","Deondre","Deontae","Deonte","Dereck","Derek","Derick","Deron","Derrick","Deshaun","Deshawn","Desiree","Desmond","Dessie","Destany","Destin","Destinee","Destiney","Destini","Destiny","Devan","Devante","Deven","Devin","Devon","Devonte","Devyn","Dewayne","Dewitt","Dexter","Diamond","Diana","Dianna","Diego","Dillan","Dillon","Dimitri","Dina","Dino","Dion","Dixie","Dock","Dolly","Dolores","Domenic","Domenica","Domenick","Domenico","Domingo","Dominic","Dominique","Don","Donald","Donato","Donavon","Donna","Donnell","Donnie","Donny","Dora","Dorcas","Dorian","Doris","Dorothea","Dorothy","Dorris","Dortha","Dorthy","Doug","Douglas","Dovie","Doyle","Drake","Drew","Duane","Dudley","Dulce","Duncan","Durward","Dustin","Dusty","Dwight","Dylan","Earl","Earlene","Earline","Earnest","Earnestine","Easter","Easton","Ebba","Ebony","Ed","Eda","Edd","Eddie","Eden","Edgar","Edgardo","Edison","Edmond","Edmund","Edna","Eduardo","Edward","Edwardo","Edwin","Edwina","Edyth","Edythe","Effie","Efrain","Efren","Eileen","Einar","Eino","Eladio","Elaina","Elbert","Elda","Eldon","Eldora","Eldred","Eldridge","Eleanora","Eleanore","Eleazar","Electa","Elena","Elenor","Elenora","Eleonore","Elfrieda","Eli","Elian","Eliane","Elias","Eliezer","Elijah","Elinor","Elinore","Elisa","Elisabeth","Elise","Eliseo","Elisha","Elissa","Eliza","Elizabeth","Ella","Ellen","Ellie","Elliot","Elliott","Ellis","Ellsworth","Elmer","Elmira","Elmo","Elmore","Elna","Elnora","Elody","Eloisa","Eloise","Elouise","Eloy","Elroy","Elsa","Else","Elsie","Elta","Elton","Elva","Elvera","Elvie","Elvis","Elwin","Elwyn","Elyse","Elyssa","Elza","Emanuel","Emelia","Emelie","Emely","Emerald","Emerson","Emery","Emie","Emil","Emile","Emilia","Emiliano","Emilie","Emilio","Emily","Emma","Emmalee","Emmanuel","Emmanuelle","Emmet","Emmett","Emmie","Emmitt","Emmy","Emory","Ena","Enid","Enoch","Enola","Enos","Enrico","Enrique","Ephraim","Era","Eriberto","Eric","Erica","Erich","Erick","Ericka","Erik","Erika","Erin","Erling","Erna","Ernest","Ernestina","Ernestine","Ernesto","Ernie","Ervin","Erwin","Eryn","Esmeralda","Esperanza","Esta","Esteban","Estefania","Estel","Estell","Estella","Estelle","Estevan","Esther","Estrella","Etha","Ethan","Ethel","Ethelyn","Ethyl","Ettie","Eudora","Eugene","Eugenia","Eula","Eulah","Eulalia","Euna","Eunice","Eusebio","Eva","Evalyn","Evan","Evangeline","Evans","Eve","Eveline","Evelyn","Everardo","Everett","Everette","Evert","Evie","Ewald","Ewell","Ezekiel","Ezequiel","Ezra","Fabian","Fabiola","Fae","Fannie","Fanny","Fatima","Faustino","Fausto","Favian","Fay","Faye","Federico","Felicia","Felicita","Felicity","Felipa","Felipe","Felix","Felton","Fermin","Fern","Fernando","Ferne","Fidel","Filiberto","Filomena","Finn","Fiona","Flavie","Flavio","Fleta","Fletcher","Flo","Florence","Florencio","Florian","Florida","Florine","Flossie","Floy","Floyd","Ford","Forest","Forrest","Foster","Frances","Francesca","Francesco","Francis","Francisca","Francisco","Franco","Frank","Frankie","Franz","Fred","Freda","Freddie","Freddy","Frederic","Frederick","Frederik","Frederique","Fredrick","Fredy","Freeda","Freeman","Freida","Frida","Frieda","Friedrich","Fritz","Furman","Gabe","Gabriel","Gabriella","Gabrielle","Gaetano","Gage","Gail","Gardner","Garett","Garfield","Garland","Garnet","Garnett","Garret","Garrett","Garrick","Garrison","Garry","Garth","Gaston","Gavin","Gay","Gayle","Gaylord","Gene","General","Genesis","Genevieve","Gennaro","Genoveva","Geo","Geoffrey","George","Georgette","Georgiana","Georgianna","Geovanni","Geovanny","Geovany","Gerald","Geraldine","Gerard","Gerardo","Gerda","Gerhard","Germaine","German","Gerry","Gerson","Gertrude","Gia","Gianni","Gideon","Gilbert","Gilberto","Gilda","Giles","Gillian","Gina","Gino","Giovani","Giovanna","Giovanni","Giovanny","Gisselle","Giuseppe","Gladyce","Gladys","Glen","Glenda","Glenna","Glennie","Gloria","Godfrey","Golda","Golden","Gonzalo","Gordon","Grace","Gracie","Graciela","Grady","Graham","Grant","Granville","Grayce","Grayson","Green","Greg","Gregg","Gregoria","Gregorio","Gregory","Greta","Gretchen","Greyson","Griffin","Grover","Guadalupe","Gudrun","Guido","Guillermo","Guiseppe","Gunnar","Gunner","Gus","Gussie","Gust","Gustave","Guy","Gwen","Gwendolyn","Hadley","Hailee","Hailey","Hailie","Hal","Haleigh","Haley","Halie","Halle","Hallie","Hank","Hanna","Hannah","Hans","Hardy","Harley","Harmon","Harmony","Harold","Harrison","Harry","Harvey","Haskell","Hassan","Hassie","Hattie","Haven","Hayden","Haylee","Hayley","Haylie","Hazel","Hazle","Heath","Heather","Heaven","Heber","Hector","Heidi","Helen","Helena","Helene","Helga","Hellen","Helmer","Heloise","Henderson","Henri","Henriette","Henry","Herbert","Herman","Hermann","Hermina","Herminia","Herminio","Hershel","Herta","Hertha","Hester","Hettie","Hilario","Hilbert","Hilda","Hildegard","Hillard","Hillary","Hilma","Hilton","Hipolito","Hiram","Hobart","Holden","Hollie","Hollis","Holly","Hope","Horace","Horacio","Hortense","Hosea","Houston","Howard","Howell","Hoyt","Hubert","Hudson","Hugh","Hulda","Humberto","Hunter","Hyman","Ian","Ibrahim","Icie","Ida","Idell","Idella","Ignacio","Ignatius","Ike","Ila","Ilene","Iliana","Ima","Imani","Imelda","Immanuel","Imogene","Ines","Irma","Irving","Irwin","Isaac","Isabel","Isabell","Isabella","Isabelle","Isac","Isadore","Isai","Isaiah","Isaias","Isidro","Ismael","Isobel","Isom","Israel","Issac","Itzel","Iva","Ivah","Ivory","Ivy","Izabella","Izaiah","Jabari","Jace","Jacey","Jacinthe","Jacinto","Jack","Jackeline","Jackie","Jacklyn","Jackson","Jacky","Jaclyn","Jacquelyn","Jacques","Jacynthe","Jada","Jade","Jaden","Jadon","Jadyn","Jaeden","Jaida","Jaiden","Jailyn","Jaime","Jairo","Jakayla","Jake","Jakob","Jaleel","Jalen","Jalon","Jalyn","Jamaal","Jamal","Jamar","Jamarcus","Jamel","Jameson","Jamey","Jamie","Jamil","Jamir","Jamison","Jammie","Jan","Jana","Janae","Jane","Janelle","Janessa","Janet","Janice","Janick","Janie","Janis","Janiya","Jannie","Jany","Jaquan","Jaquelin","Jaqueline","Jared","Jaren","Jarod","Jaron","Jarred","Jarrell","Jarret","Jarrett","Jarrod","Jarvis","Jasen","Jasmin","Jason","Jasper","Jaunita","Javier","Javon","Javonte","Jay","Jayce","Jaycee","Jayda","Jayde","Jayden","Jaydon","Jaylan","Jaylen","Jaylin","Jaylon","Jayme","Jayne","Jayson","Jazlyn","Jazmin","Jazmyn","Jazmyne","Jean","Jeanette","Jeanie","Jeanne","Jed","Jedediah","Jedidiah","Jeff","Jefferey","Jeffery","Jeffrey","Jeffry","Jena","Jenifer","Jennie","Jennifer","Jennings","Jennyfer","Jensen","Jerad","Jerald","Jeramie","Jeramy","Jerel","Jeremie","Jeremy","Jermain","Jermaine","Jermey","Jerod","Jerome","Jeromy","Jerrell","Jerrod","Jerrold","Jerry","Jess","Jesse","Jessica","Jessie","Jessika","Jessy","Jessyca","Jesus","Jett","Jettie","Jevon","Jewel","Jewell","Jillian","Jimmie","Jimmy","Jo","Joan","Joana","Joanie","Joanne","Joannie","Joanny","Joany","Joaquin","Jocelyn","Jodie","Jody","Joe","Joel","Joelle","Joesph","Joey","Johan","Johann","Johanna","Johathan","John","Johnathan","Johnathon","Johnnie","Johnny","Johnpaul","Johnson","Jolie","Jon","Jonas","Jonatan","Jonathan","Jonathon","Jordan","Jordane","Jordi","Jordon","Jordy","Jordyn","Jorge","Jose","Josefa","Josefina","Joseph","Josephine","Josh","Joshua","Joshuah","Josiah","Josiane","Josianne","Josie","Josue","Jovan","Jovani","Jovanny","Jovany","Joy","Joyce","Juana","Juanita","Judah","Judd","Jude","Judge","Judson","Judy","Jules","Julia","Julian","Juliana","Julianne","Julie","Julien","Juliet","Julio","Julius","June","Junior","Junius","Justen","Justice","Justina","Justine","Juston","Justus","Justyn","Juvenal","Juwan","Kacey","Kaci","Kacie","Kade","Kaden","Kadin","Kaela","Kaelyn","Kaia","Kailee","Kailey","Kailyn","Kaitlin","Kaitlyn","Kale","Kaleb","Kaleigh","Kaley","Kali","Kallie","Kameron","Kamille","Kamren","Kamron","Kamryn","Kane","Kara","Kareem","Karelle","Karen","Kari","Kariane","Karianne","Karina","Karine","Karl","Karlee","Karley","Karli","Karlie","Karolann","Karson","Kasandra","Kasey","Kassandra","Katarina","Katelin","Katelyn","Katelynn","Katharina","Katherine","Katheryn","Kathleen","Kathlyn","Kathryn","Kathryne","Katlyn","Katlynn","Katrina","Katrine","Kattie","Kavon","Kay","Kaya","Kaycee","Kayden","Kayla","Kaylah","Kaylee","Kayleigh","Kayley","Kayli","Kaylie","Kaylin","Keagan","Keanu","Keara","Keaton","Keegan","Keeley","Keely","Keenan","Keira","Keith","Kellen","Kelley","Kelli","Kellie","Kelly","Kelsi","Kelsie","Kelton","Kelvin","Ken","Kendall","Kendra","Kendrick","Kenna","Kennedi","Kennedy","Kenneth","Kennith","Kenny","Kenton","Kenya","Kenyatta","Kenyon","Keon","Keshaun","Keshawn","Keven","Kevin","Kevon","Keyon","Keyshawn","Khalid","Khalil","Kian","Kiana","Kianna","Kiara","Kiarra","Kiel","Kiera","Kieran","Kiley","Kim","Kimberly","King","Kip","Kira","Kirk","Kirsten","Kirstin","Kitty","Kobe","Koby","Kody","Kolby","Kole","Korbin","Korey","Kory","Kraig","Kris","Krista","Kristian","Kristin","Kristina","Kristofer","Kristoffer","Kristopher","Kristy","Krystal","Krystel","Krystina","Kurt","Kurtis","Kyla","Kyle","Kylee","Kyleigh","Kyler","Kylie","Kyra","Lacey","Lacy","Ladarius","Lafayette","Laila","Laisha","Lamar","Lambert","Lamont","Lance","Landen","Lane","Laney","Larissa","Laron","Larry","Larue","Laura","Laurel","Lauren","Laurence","Lauretta","Lauriane","Laurianne","Laurie","Laurine","Laury","Lauryn","Lavada","Lavern","Laverna","Laverne","Lavina","Lavinia","Lavon","Lavonne","Lawrence","Lawson","Layla","Layne","Lazaro","Lea","Leann","Leanna","Leanne","Leatha","Leda","Lee","Leif","Leila","Leilani","Lela","Lelah","Leland","Lelia","Lempi","Lemuel","Lenna","Lennie","Lenny","Lenora","Lenore","Leo","Leola","Leon","Leonard","Leonardo","Leone","Leonel","Leonie","Leonor","Leonora","Leopold","Leopoldo","Leora","Lera","Lesley","Leslie","Lesly","Lessie","Lester","Leta","Letha","Letitia","Levi","Lew","Lewis","Lexi","Lexie","Lexus","Lia","Liam","Liana","Libbie","Libby","Lila","Lilian","Liliana","Liliane","Lilla","Lillian","Lilliana","Lillie","Lilly","Lily","Lilyan","Lina","Lincoln","Linda","Lindsay","Lindsey","Linnea","Linnie","Linwood","Lionel","Lisa","Lisandro","Lisette","Litzy","Liza","Lizeth","Lizzie","Llewellyn","Lloyd","Logan","Lois","Lola","Lolita","Loma","Lon","London","Lonie","Lonnie","Lonny","Lonzo","Lora","Loraine","Loren","Lorena","Lorenz","Lorenza","Lorenzo","Lori","Lorine","Lorna","Lottie","Lou","Louie","Louisa","Lourdes","Louvenia","Lowell","Loy","Loyal","Loyce","Lucas","Luciano","Lucie","Lucienne","Lucile","Lucinda","Lucio","Lucious","Lucius","Lucy","Ludie","Ludwig","Lue","Luella","Luigi","Luis","Luisa","Lukas","Lula","Lulu","Luna","Lupe","Lura","Lurline","Luther","Luz","Lyda","Lydia","Lyla","Lynn","Lyric","Lysanne","Mabel","Mabelle","Mable","Mac","Macey","Maci","Macie","Mack","Mackenzie","Macy","Madaline","Madalyn","Maddison","Madeline","Madelyn","Madelynn","Madge","Madie","Madilyn","Madisen","Madison","Madisyn","Madonna","Madyson","Mae","Maegan","Maeve","Mafalda","Magali","Magdalen","Magdalena","Maggie","Magnolia","Magnus","Maia","Maida","Maiya","Major","Makayla","Makenna","Makenzie","Malachi","Malcolm","Malika","Malinda","Mallie","Mallory","Malvina","Mandy","Manley","Manuel","Manuela","Mara","Marc","Marcel","Marcelina","Marcelino","Marcella","Marcelle","Marcellus","Marcelo","Marcia","Marco","Marcos","Marcus","Margaret","Margarete","Margarett","Margaretta","Margarette","Margarita","Marge","Margie","Margot","Margret","Marguerite","Maria","Mariah","Mariam","Marian","Mariana","Mariane","Marianna","Marianne","Mariano","Maribel","Marie","Mariela","Marielle","Marietta","Marilie","Marilou","Marilyne","Marina","Mario","Marion","Marisa","Marisol","Maritza","Marjolaine","Marjorie","Marjory","Mark","Markus","Marlee","Marlen","Marlene","Marley","Marlin","Marlon","Marques","Marquis","Marquise","Marshall","Marta","Martin","Martina","Martine","Marty","Marvin","Mary","Maryam","Maryjane","Maryse","Mason","Mateo","Mathew","Mathias","Mathilde","Matilda","Matilde","Matt","Matteo","Mattie","Maud","Maude","Maudie","Maureen","Maurice","Mauricio","Maurine","Maverick","Mavis","Max","Maxie","Maxime","Maximilian","Maximillia","Maximillian","Maximo","Maximus","Maxine","Maxwell","May","Maya","Maybell","Maybelle","Maye","Maymie","Maynard","Mayra","Mazie","Mckayla","Mckenna","Mckenzie","Meagan","Meaghan","Meda","Megane","Meggie","Meghan","Mekhi","Melany","Melba","Melisa","Melissa","Mellie","Melody","Melvin","Melvina","Melyna","Melyssa","Mercedes","Meredith","Merl","Merle","Merlin","Merritt","Mertie","Mervin","Meta","Mia","Micaela","Micah","Michael","Michaela","Michale","Micheal","Michel","Michele","Michelle","Miguel","Mikayla","Mike","Mikel","Milan","Miles","Milford","Miller","Millie","Milo","Milton","Mina","Minerva","Minnie","Miracle","Mireille","Mireya","Misael","Missouri","Misty","Mitchel","Mitchell","Mittie","Modesta","Modesto","Mohamed","Mohammad","Mohammed","Moises","Mollie","Molly","Mona","Monica","Monique","Monroe","Monserrat","Monserrate","Montana","Monte","Monty","Morgan","Moriah","Morris","Mortimer","Morton","Mose","Moses","Moshe","Mossie","Mozell","Mozelle","Muhammad","Muriel","Murl","Murphy","Murray","Mustafa","Mya","Myah","Mylene","Myles","Myra","Myriam","Myrl","Myrna","Myron","Myrtice","Myrtie","Myrtis","Myrtle","Nadia","Nakia","Name","Nannie","Naomi","Naomie","Napoleon","Narciso","Nash","Nasir","Nat","Natalia","Natalie","Natasha","Nathan","Nathanael","Nathanial","Nathaniel","Nathen","Nayeli","Neal","Ned","Nedra","Neha","Neil","Nelda","Nella","Nelle","Nellie","Nels","Nelson","Neoma","Nestor","Nettie","Neva","Newell","Newton","Nia","Nicholas","Nicholaus","Nichole","Nick","Nicklaus","Nickolas","Nico","Nicola","Nicolas","Nicole","Nicolette","Nigel","Nikita","Nikki","Nikko","Niko","Nikolas","Nils","Nina","Noah","Noble","Noe","Noel","Noelia","Noemi","Noemie","Noemy","Nola","Nolan","Nona","Nora","Norbert","Norberto","Norene","Norma","Norris","Norval","Norwood","Nova","Novella","Nya","Nyah","Nyasia","Obie","Oceane","Ocie","Octavia","Oda","Odell","Odessa","Odie","Ofelia","Okey","Ola","Olaf","Ole","Olen","Oleta","Olga","Olin","Oliver","Ollie","Oma","Omari","Omer","Ona","Onie","Opal","Ophelia","Ora","Oral","Oran","Oren","Orie","Orin","Orion","Orland","Orlando","Orlo","Orpha","Orrin","Orval","Orville","Osbaldo","Osborne","Oscar","Osvaldo","Oswald","Oswaldo","Otha","Otho","Otilia","Otis","Ottilie","Ottis","Otto","Ova","Owen","Ozella","Pablo","Paige","Palma","Pamela","Pansy","Paolo","Paris","Parker","Pascale","Pasquale","Pat","Patience","Patricia","Patrick","Patsy","Pattie","Paul","Paula","Pauline","Paxton","Payton","Pearl","Pearlie","Pearline","Pedro","Peggie","Penelope","Percival","Percy","Perry","Pete","Peter","Petra","Peyton","Philip","Phoebe","Phyllis","Pierce","Pierre","Pietro","Pink","Pinkie","Piper","Polly","Porter","Precious","Presley","Preston","Price","Prince","Princess","Priscilla","Providenci","Prudence","Queen","Queenie","Quentin","Quincy","Quinn","Quinten","Quinton","Rachael","Rachel","Rachelle","Rae","Raegan","Rafael","Rafaela","Raheem","Rahsaan","Rahul","Raina","Raleigh","Ralph","Ramiro","Ramon","Ramona","Randal","Randall","Randi","Randy","Ransom","Raoul","Raphael","Raphaelle","Raquel","Rashad","Rashawn","Rasheed","Raul","Raven","Ray","Raymond","Raymundo","Reagan","Reanna","Reba","Rebeca","Rebecca","Rebeka","Rebekah","Reece","Reed","Reese","Regan","Reggie","Reginald","Reid","Reilly","Reina","Reinhold","Remington","Rene","Renee","Ressie","Reta","Retha","Retta","Reuben","Reva","Rex","Rey","Reyes","Reymundo","Reyna","Reynold","Rhea","Rhett","Rhianna","Rhiannon","Rhoda","Ricardo","Richard","Richie","Richmond","Rick","Rickey","Rickie","Ricky","Rico","Rigoberto","Riley","Rita","River","Robb","Robbie","Robert","Roberta","Roberto","Robin","Robyn","Rocio","Rocky","Rod","Roderick","Rodger","Rodolfo","Rodrick","Rodrigo","Roel","Rogelio","Roger","Rogers","Rolando","Rollin","Roma","Romaine","Roman","Ron","Ronaldo","Ronny","Roosevelt","Rory","Rosa","Rosalee","Rosalia","Rosalind","Rosalinda","Rosalyn","Rosamond","Rosanna","Rosario","Roscoe","Rose","Rosella","Roselyn","Rosemarie","Rosemary","Rosendo","Rosetta","Rosie","Rosina","Roslyn","Ross","Rossie","Rowan","Rowena","Rowland","Roxane","Roxanne","Roy","Royal","Royce","Rozella","Ruben","Rubie","Ruby","Rubye","Rudolph","Rudy","Rupert","Russ","Russel","Russell","Rusty","Ruth","Ruthe","Ruthie","Ryan","Ryann","Ryder","Rylan","Rylee","Ryleigh","Ryley","Sabina","Sabrina","Sabryna","Sadie","Sadye","Sage","Saige","Sallie","Sally","Salma","Salvador","Salvatore","Sam","Samanta","Samantha","Samara","Samir","Sammie","Sammy","Samson","Sandra","Sandrine","Sandy","Sanford","Santa","Santiago","Santina","Santino","Santos","Sarah","Sarai","Sarina","Sasha","Saul","Savanah","Savanna","Savannah","Savion","Scarlett","Schuyler","Scot","Scottie","Scotty","Seamus","Sean","Sebastian","Sedrick","Selena","Selina","Selmer","Serena","Serenity","Seth","Shad","Shaina","Shakira","Shana","Shane","Shanel","Shanelle","Shania","Shanie","Shaniya","Shanna","Shannon","Shanny","Shanon","Shany","Sharon","Shaun","Shawn","Shawna","Shaylee","Shayna","Shayne","Shea","Sheila","Sheldon","Shemar","Sheridan","Sherman","Sherwood","Shirley","Shyann","Shyanne","Sibyl","Sid","Sidney","Sienna","Sierra","Sigmund","Sigrid","Sigurd","Silas","Sim","Simeon","Simone","Sincere","Sister","Skye","Skyla","Skylar","Sofia","Soledad","Solon","Sonia","Sonny","Sonya","Sophia","Sophie","Spencer","Stacey","Stacy","Stan","Stanford","Stanley","Stanton","Stefan","Stefanie","Stella","Stephan","Stephania","Stephanie","Stephany","Stephen","Stephon","Sterling","Steve","Stevie","Stewart","Stone","Stuart","Summer","Sunny","Susan","Susana","Susanna","Susie","Suzanne","Sven","Syble","Sydnee","Sydney","Sydni","Sydnie","Sylvan","Sylvester","Sylvia","Tabitha","Tad","Talia","Talon","Tamara","Tamia","Tania","Tanner","Tanya","Tara","Taryn","Tate","Tatum","Tatyana","Taurean","Tavares","Taya","Taylor","Teagan","Ted","Telly","Terence","Teresa","Terrance","Terrell","Terrence","Terrill","Terry","Tess","Tessie","Tevin","Thad","Thaddeus","Thalia","Thea","Thelma","Theo","Theodora","Theodore","Theresa","Therese","Theresia","Theron","Thomas","Thora","Thurman","Tia","Tiana","Tianna","Tiara","Tierra","Tiffany","Tillman","Timmothy","Timmy","Timothy","Tina","Tito","Titus","Tobin","Toby","Tod","Tom","Tomas","Tomasa","Tommie","Toney","Toni","Tony","Torey","Torrance","Torrey","Toy","Trace","Tracey","Tracy","Travis","Travon","Tre","Tremaine","Tremayne","Trent","Trenton","Tressa","Tressie","Treva","Trever","Trevion","Trevor","Trey","Trinity","Trisha","Tristian","Tristin","Triston","Troy","Trudie","Trycia","Trystan","Turner","Twila","Tyler","Tyra","Tyree","Tyreek","Tyrel","Tyrell","Tyrese","Tyrique","Tyshawn","Tyson","Ubaldo","Ulices","Ulises","Una","Unique","Urban","Uriah","Uriel","Ursula","Vada","Valentin","Valentina","Valentine","Valerie","Vallie","Van","Vance","Vanessa","Vaughn","Veda","Velda","Vella","Velma","Velva","Vena","Verda","Verdie","Vergie","Verla","Verlie","Vern","Verna","Verner","Vernice","Vernie","Vernon","Verona","Veronica","Vesta","Vicenta","Vicente","Vickie","Vicky","Victor","Victoria","Vida","Vidal","Vilma","Vince","Vincent","Vincenza","Vincenzo","Vinnie","Viola","Violet","Violette","Virgie","Virgil","Virginia","Virginie","Vita","Vito","Viva","Vivian","Viviane","Vivianne","Vivien","Vivienne","Vladimir","Wade","Waino","Waldo","Walker","Wallace","Walter","Walton","Wanda","Ward","Warren","Watson","Wava","Waylon","Wayne","Webster","Weldon","Wellington","Wendell","Wendy","Werner","Westley","Weston","Whitney","Wilber","Wilbert","Wilburn","Wiley","Wilford","Wilfred","Wilfredo","Wilfrid","Wilhelm","Wilhelmine","Will","Willa","Willard","William","Willie","Willis","Willow","Willy","Wilma","Wilmer","Wilson","Wilton","Winfield","Winifred","Winnifred","Winona","Winston","Woodrow","Wyatt","Wyman","Xander","Xavier","Xzavier","Yadira","Yasmeen","Yasmin","Yasmine","Yazmin","Yesenia","Yessenia","Yolanda","Yoshiko","Yvette","Yvonne","Zachariah","Zachary","Zachery","Zack","Zackary","Zackery","Zakary","Zander","Zane","Zaria","Zechariah","Zelda","Zella","Zelma","Zena","Zetta","Zion","Zita","Zoe","Zoey","Zoie","Zoila","Zola","Zora","Zula"];e.exports={generateUsername:function(){return r.randomElement(i)+"-"+r.randomAlphanumStr(3)}}},function(e,t,n){"use strict";(function(e){var r=n(1),i=n(3),o=n.n(i),a=(function(){function e(e,t){for(var n=0;n3?a-3:0),l=3;l0||parseInt(T[C].bytesSent,10)>0)&&(I[C].push(T[C]),"true"!==T[C].googActiveConnection&&!0!==T[C].googActiveConnection||(v.activeConnectionIndex=I[C].length)):(I[C].push(T[C]),"true"!==T[C].selected&&!0!==T[C].selected||(v.activeConnectionIndex=I[C].length));else if(T.localCandidate)L[T.localCandidate.id]=T.localCandidate;else if(T.remoteCandidate)M[T.remoteCandidate.id]=T.remoteCandidate;else if(T.bwe)I.bwe=T.bwe;else if(T.trackStats)I.trackStats||(I.trackStats=[]),I.trackStats.push(T.trackStats);else if(T.codec)I.codec||(I.codec=[]),I.codec.push(T.codec);else if(T.candidatePair)I.candidatePair||(I.candidatePair=[]),I.candidatePair.push(T.candidatePair);else{void 0!==(w=nt(o,T.ssrc))&&w.localStartTime||(k=it(S,b,i,o,u,null),k&&(x=!0),w=nt(o,T.ssrc)),w&&(E=w.remoteUserID),void 0===E&&(E=S);var F={userID:E,data:T.data,reportType:T.reportType,streamType:T.streamType,ssrc:T.ssrc};void 0!==w&&(F.cname=w.cname,F.msid=w.msid,F.associatedVideoTag=w.associatedVideoTag,F.usage=w.usageLabel),I.streams.push(F)}if(v.statistics=I,I.Transport&&(A=(function(e,t){var n,r,i,o,a,s,c,u,l,d=!1,p="None",h=!1,f=W.codebase,m=function(e){if(e.typePreference){var t=e.typePreference>>24;return"rtp"===e.protocol&&e.address===n&&(t>=0&&t<=2&&(p=(function(e){var n="None";switch(t){case 0:n="TURN/TLS";break;case 1:n="TURN/TCP";break;case 2:n="TURN/UDP"}return n})()),!0)}return!1};for(c=0;c0&&(t[r].csioReceivedBwKbps=8*(parseInt(t[r].bytesReceived,10)-c)/l,t[r].csioSentBwKbps=8*(parseInt(t[r].bytesSent,10)-u)/l,t[r].csioIntBytesReceived=parseInt(t[r].bytesReceived,10)-c,t[r].csioIntBytesSent=parseInt(t[r].bytesSent,10)-u,void 0!==s.packetsSent&&void 0!==t[r].packetsSent&&(t[r].csioSentPacketRate=(parseInt(t[r].packetsSent,10)-parseInt(s.packetsSent,10))/(l/1e3),t[r].csioIntPacketsSent=parseInt(t[r].packetsSent,10)-parseInt(s.packetsSent,10)),void 0!==s.packetsReceived&&void 0!==t[r].packetsReceived&&(t[r].csioReceivedPacketRate=(parseInt(t[r].packetsReceived,10)-parseInt(s.packetsReceived,10))/(l/1e3),t[r].csioIntPacketsReceived=parseInt(t[r].packetsReceived,10)-parseInt(s.packetsReceived,10))),d.push(t[r]))}return d})(e,t,r)),i})(o,I.Transport,y,f)),I.bwe&&(H.bwe=I.bwe),void 0===o.processedStatsTupleArray&&(o.processedStatsTupleArray=[]),z.stats){var ne=(function(e){var t={},n=$t.getConferenceURL();return e.connectionState&&(t.connectionState=e.connectionState),e.fabricState&&(t.fabricState=e.fabricState),n&&(t.conferenceURL=n),t.streams={},null===e.streams?t:(e.streams.forEach(function(e){var n={cname:e.cname,ssrc:e.ssrc,msid:e.msid,remoteUserID:e.userID,usageLabel:e.usage,associatedVideoTag:e.associatedVideoTag};e.data.hasOwnProperty("csioIntFL")&&(n.fractionLoss=e.data.csioIntFL),e.data.hasOwnProperty("csioIntBRKbps")&&(n.bitrate=e.data.csioIntBRKbps),e.data.hasOwnProperty("csioMark")&&(n.quality=e.data.csioMark),e.data.hasOwnProperty("csioMediaType")&&(n.mediaType=e.data.csioMediaType),e.data.hasOwnProperty("googRtt")&&(n.rtt=e.data.googRtt),e.data.hasOwnProperty("mozRtt")&&(n.rtt=e.data.mozRtt),e.data.hasOwnProperty("roundTripTime")&&(n.rtt=e.data.roundTripTime),e.data.hasOwnProperty("jitter")&&(n.jitter=e.data.jitter),e.data.hasOwnProperty("googJitterReceived")&&(n.jitter=e.data.googJitterReceived),e.data.hasOwnProperty("audioOutputLevel")&&(n.audioOutputLevel=e.data.audioOutputLevel),e.data.hasOwnProperty("audioInputLevel")&&(n.audioInputLevel=e.data.audioInputLevel),e.data.hasOwnProperty("audioLevel")&&(n.audioLevel=e.data.audioLevel),e.data.hasOwnProperty("csioAvgRtt")&&(n.averageRTT=e.data.csioAvgRtt),e.data.hasOwnProperty("csioAvgJitter")&&(n.averageJitter=e.data.csioAvgJitter),e.data.hasOwnProperty("csioPktLossPercentage")&&(n.packetLossPercentage=e.data.csioPktLossPercentage),e.reportType&&"local"===e.reportType?e.streamType&&(n.statsType=e.streamType+"-rtp"):e.reportType&&"remote"===e.reportType&&e.streamType&&(n.statsType="remote-"+e.streamType+"-rtp"),t.streams[e.ssrc]=n}),t)})(H);z.stats(ne)}H.apiTS=f,H.batteryStatus={},H.batteryStatus.batteryLevel=(function(){if(ie)return ie.level})(),H.batteryStatus.isBatteryCharging=(function(){if(ie)return ie.charging})(),H.wifiStats=D,(function(e){if(se&&se.rtc_rtp_parameters&&se.rtc_rtp_parameters.encodings){var t=function(e){return et[e]?et[e]:(et[e]={total:0,above:0,ccDriven:0,sumMaxBitrateDiff:0,sumThroughputDiff:0,prevCsioAvgBRKbps:0},et[e])},n=0;se.rtc_rtp_parameters.encodings.forEach(function(e){e&&(n=Math.max(n,e.maxBitrate))});var r=0;if(ce){ce.encodings.forEach(function(e){r=Math.max(r,e.maxBitrate)});var i=0,o=0,a=null,s=null;e.streams.forEach(function(e){var c=e.data,u=t(c.ssrc);"video"===c.mediaType&&e.streamType===ke.outbound&&(0=Q&&(o.processedStatsTupleArray=[],ee.add(re,re.processedStatistics.length),re.msgStat=ee.getStat(),(function(e,t,n,i,o,a){var s=r();e.hasOwnProperty("token")&&e.hasOwnProperty("ucID")&&!de?(g(be.processedStats,e,a),t.latestEventSent=s,t.lastFabricState=t.pcState):(e.clockUnsynced=de,Z.cacheEvent({channel:be.processedStats,data:e}))})(re,o,0,0,0,e),o.lastProcessedStatsSentInterval=0)}}}}function d(e){var t={};if("inboundrtp"===e.type||"outboundrtp"===e.type||"inbound-rtp"===e.type||"outbound-rtp"===e.type){if(t.ssrc=e.ssrc,t.streamType="inboundrtp"===e.type||"inbound-rtp"===e.type?"inbound":"outbound","Safari"===W.name&&!e.mediaType){e.id.includes("Audio")?e.mediaType="audio":e.id.includes("Video")&&(e.mediaType="video");var n=e.id.split("_");if(n[1])try{e.ssrc=parseInt(n[1]),t.ssrc=e.ssrc}catch(e){}}t.data=e,void 0!==e.isRemote?t.reportType="true"===e.isRemote||!0===e.isRemote?"remote":"local":t.reportType="local",e.trackId&&(t.trackId=e.trackId),e.mediaType&&(t.mediaType=e.mediaType)}else"candidatepair"===e.type&&e.selected?t.Transport=e:"localcandidate"===e.type||"local-candidate"===e.type?t.localCandidate=e:"remotecandidate"===e.type||"remote-candidate"===e.type?t.remoteCandidate=e:"transport"===e.type||"googCandidatePair"===e.type?t.Transport=e:"VideoBwe"===e.type?t.bwe=e:"track"===e.type?t.trackStats=e:"candidate-pair"===e.type?t.candidatePair=e:"codec"===e.type?t.codec=e:"ssrc"===e.type&&(t.reportType="local",e.bytesSent?t.streamType="outbound":t.streamType="inbound",t.ssrc=e.ssrc,t.data=e);return t}function p(e){var t,n={};e.timestamp instanceof Date&&(n.timestamp=e.timestamp.getTime().toString()),e.type&&(n.type=e.type);var r=0;if(e.names){var i=e.names();for(r=0;r0)return!1;if(0===e.length)return!0;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}function f(e){return clearInterval(e),null}function m(){le.syncHandler||($e(N,L,"log",{msg:"start clockSync"}),le.offsetResults=[],zt(),le.syncHandler=!0)}function v(e){try{if(window&&window.sessionStorage){var t=JSON.parse(window.sessionStorage.getItem("csio_ucid_data"));if(t&&t[e])return t[e].ucID}}catch(e){return null}return null}function g(e,t,n){var r=t.action,i=t.remoteID,o=t.ucID;t.channel=e,te._isTokenValid(te.authToken,N,L)?(o&&!de&&i||-1!==Ve.indexOf(r))&&t.conferenceID!==A?(t.token=te.authToken,Xt(e,t,n),n&&r&&n(Te.success,r+" sent to the backend.")):(t.clockUnsynced=de,Z.cacheEvent({channel:e,data:t,callback:n})):te.sendAuthenticationRequest(N,L,function(a,s){a!==Te.success?(a===Ce.authOngoing&&(t.clockUnsynced=de,Z.cacheEvent({channel:e,data:t,callback:n})),n&&a!==Ce.authOngoing&&n(a,s)):a===Te.success&&"SDK authentication successful."===s&&((o&&!de&&i||-1!==Ve.indexOf(r))&&t.conferenceID!==A?(t.token=te.authToken,Xt(e,t,n),n&&r&&n(Te.success,r+" sent to the backend.")):(t.clockUnsynced=de,Z.cacheEvent({channel:e,data:t,callback:n})))})}function y(){he||(he=setInterval(function(){!(function(){var e={};Object.keys(ue).forEach(function(t){var n=ue[t];if(!n)return!0;var r,i,o={ucID:n.ucID,userJoinedSent:n.userJoinedSent},a=[];if(n.participants){var s,c=n.participants;for(r=0;r=p-o||!l.data.ucID)if(d=decodeURIComponent(l.data.conferenceID),ue[d]&&ue[d].ucID)l.data.ucID=ue[d].ucID;else{if(d!==a){h.push(this.eventCache[c]);continue}l.data.ucID=s}if(l.data.clockUnsynced&&(l.data.apiTS+=le.currentOffset),l.channel===be.processedStats&&l.data.clockUnsynced&&l.data.processedStatistics&&l.data.processedStatistics.length>0)for(u=0;u=0;s--)a[s]=i.charCodeAt(s);var c=function(e){for(var t="",n=new Uint8Array(e),o=n.byteLength,a=0;a0)return f(r,i,a,u[t],e.type);console.error("Authentication failed, but no error actions were defined in response."),n=setTimeout(e.sendAuthenticationRequest,5e3,r,i,a)}else n=setTimeout(e.sendAuthenticationRequest,5e3,r,i,a)})})}var s};var p=function(){null!==i&&(clearTimeout(i),i=null)},h=function(t,n,r,o){p(),i=setTimeout(function(){e.sendAuthenticationRequest(n,r,o)},t)},f=function e(t,n,r,i,a){if(0!==i.length){var s=i.shift();if(s.action===Ye.RETRY)return"jwt"===a&&h(s.params.timeout,t,n,r),e(t,n,r,i);if(s.action===Ye.GET_NEW_TOKEN)return o=!0,e(t,n,r,i);if(s.action===Ye.REPORT_ERROR){var u="Authentication Error";return s.params&&s.params.errorCode>=0&&(u=c[s.params.errorCode]),r&&r(Te.authError,u),e(t,n,r,i)}}};this.appSecretTokenGenerator=function(t){var n=null,r=null,i=!1,o=null;return t.indexOf(":")>-1&&(o=(function(e){for(var t=a(e.replace(/[ \r\n]+$/,"")),n=[],r=0;r-1){var t,n=!1,r={fileName:e.filename,line:e.lineno,col:e.colno,jsVersion:R,eventType:"error",message:e.message,pageURL:window.location.href};for(t in ue)ue.hasOwnProperty(t)&&(r.conferenceID=t,$e(N,L,"onErrorLog",r),n=!0);n||$e(N,L,"onErrorLog",r)}});var Xe="Invalid WebRTC function name",Ye={RETRY:0,GET_NEW_TOKEN:1,REPORT_ERROR:2},Ze=e(),et=Object.create(null),tt=function(e,n,i){var o=RegExp.prototype.test.bind(/^([a-z])=(.*)/),a=/^ssrc:(\d*) ([\w_]*):(.*)/,s=/^ssrc-group:SIM (\d*)/;n.split(/(\r\n|\r|\n)/).filter(o).forEach(function(n){var o=n[0],c=n.slice(2);if("a"===o){if(a.test(c)){var u=c.match(a),l=u[1];void 0===e.ssrcMap[l]&&(e.ssrcMap[l]={}),e.ssrcMap[l][u[2]]=u[3],e.ssrcMap[l].localStartTime=t(),e.ssrcMap[l].syncedStartTime=r(),e.ssrcMap[l].streamType=i}s.test(c)&&(void 0===e.ssrcMap.ssrcGroup&&(e.ssrcMap.ssrcGroup={},e.ssrcMap.ssrcGroup[i]={}),e.ssrcMap.ssrcGroup[i].simulcastGroup=c.match(/\d+/g))}})},nt=function(e,t){return e.ssrcMap[t]},rt=function(e){return e.ssrcMap},it=function(e,t,n,r,i,o){if(!i.localDescription||!i.remoteDescription)return!1;var a=i.localDescription.sdp,s=i.remoteDescription.sdp;if(!a||!s||a===r.localSDP&&s===r.remoteSDP)return!1;if(tt(r,a,ke.outbound),tt(r,s,ke.inbound),$){var c={sdp:{}};c.sdp.localSDP=a!==r.localSDP?a:-1,c.sdp.remoteSDP=s!==r.remoteSDP?s:-1,st(e,t,n,c,r.pcHash,o)}return r.localSDP=a,r.remoteSDP=s,!0},ot=function(e,t,n,i,o,a,s){if(e){var c=r(),u={version:R,apiTS:c,action:e,localID:encodeURIComponent(L),remoteID:t?encodeURIComponent(t):null,conferenceID:encodeURIComponent(n),timeShift:0,appID:N,ucID:i,pcID:a,deviceID:j,value:o};return null===n?void $e(N,L,"log",{msg:"conferenceID is null in sendEvent for "+e}):void g(be.callStatsEvent,u,s)}console.error("sendEvent: Invalid eventType ")},at=function(e,t,n,i){if(e){var o=r(),a={version:R,channel:be.preCallTest,timestamp:o,apiTS:o,action:e,eventType:e,localID:encodeURIComponent(L),remoteID:encodeURIComponent(L),conferenceID:encodeURIComponent(t),timeShift:0,appID:N,ucID:n,deviceID:j,token:te.authToken};return"preCallTestResults"===e&&(a.results=i,null==t)?void Xt(be.preCallTest,a):(e===Se&&(a.ids=i),void(n&&!de?g(be.preCallTest,a):(a.clockUnsynced=de,Z.cacheEvent({channel:be.preCallTest,data:a,callback:null}))))}console.error("sendEvent: Invalid eventType ")},st=function(e,t,n,i,o,a){var s=r(),c={version:R,appID:N,conferenceID:encodeURIComponent(t),ucID:n,apiTS:s,localID:encodeURIComponent(L),remoteID:encodeURIComponent(e),pcID:o,deviceID:j,sdpPayload:i,action:be.sdpSubmission};te.authToken&&n&&!de?(c.token=te.authToken,g(be.sdpSubmission,c,a)):(c.clockUnsynced=de,Z.cacheEvent({channel:be.sdpSubmission,data:c,callback:a}),te.authToken||te.sendAuthenticationRequest(N,L))},ct=function(e,t,n,r,i,o,a){Ct(e,function(e){t.localCandidates=e.localCandidates,t.remoteCandidates=e.remoteCandidates,t.iceCandidatePairs=e.iceCandidatePairs,t.activeIceCandidatePair=At(t.iceCandidatePairs),a.currPair=t.activeIceCandidatePair,ot(ye.fabricStateChange,i,n,r,a,o)})},ut=function(e,t,n){var r={connectedDevices:x},i=ue[e]?ue[e].ucID:null;ot(ye.connectedDevices,t,e,i,r,n)},lt=function(e){var t={ucID:ue[e].ucID,endpoint:oe,magicKey:Ze};ot(ye.refreshPresence,null,e,ue[e].ucID,t,null)},dt=function(e,t){var n={};return n.status=e,t&&(n.message=t),n},pt=function(e,t){var n,r,i=0;if(!e)return i;for(n=0,r=e.length;n0?n[0]:null;var r},gt=function(e,t){var n=null,r=null;return(n=vt(e,t))&&(r=n.pcHash),r},yt=function(e){var t=null,n=null,r=null;for(t in ue)if(ue.hasOwnProperty(t)&&(r=vt(t,e))){n={fabric:r,conferenceID:t};break}return n},bt=function(e){if(e){var t=[],n=0;if(e&&e.result)t=e.result();else if(e&&e.forEach)e.forEach(function(e){t.push(e)});else for(n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}},St=function(e){return function(t){var n={};n=(function(e){var t,n=null,r=null,i=[],o=[],a=[],s=0;if(!(n=bt(e)))return{localCandidates:i,remoteCandidates:o};for(s=0;st&&(e=e.substring(0,t)),e):null},Rt=function(e,t,n){return t||(e&&e[n]?e[n].sdp:-1)},kt=function(e){for(var t=[],n=0;n127&&r<2048?(t[t.length]=r>>6|192,t[t.length]=63&r|128):(t[t.length]=r>>12|224,t[t.length]=r>>6&63|128,t[t.length]=63&r|128)}return new Uint8Array(t).buffer},It=function(e){for(var t,n=new DataView(e),r="",i=0;i0){var n=e.filter(function(e){return"true"===e.selected||"true"===e.googActiveConnection||!0===e.selected||!0===e.googActiveConnection});n.length>0&&(t=n[0])}return t},Ot=function(e,n){if(e){var r,i=null;if(void 0!==n){var o=n.signalingState;if((i=yt(n))&&i.fabric){r=i.fabric.signalingState,i.fabric.signalingState=o;var a=i.conferenceID,c=i.fabric,u=c.remoteUserID,l=ue[a].ucID,d={changedState:"signalingState",prevState:r,newState:o};ct(n,c,a,l,u,c.pcHash,d),"closed"===o&&Et(n,ge.fabricTerminated,i.conferenceID),"have-local-offer"!==o&&"have-local-pranswer"!==o&&"stable"!==o||i.sentSenderConfigRequest||(console.log(o,".. requesting sender config.",i.sentSenderConfigRequest),i.sentSenderConfigRequest=!0,(function(e){var n=t(),r=function(){K.senderConfig=-1,K.senderExists=!1,ht()},i=function(e){var r=JSON.parse(e.response);console.log("Sender config response:",e.status,r);var i;r.recommended&&r.recommended.sender&&(i=r.recommended.sender,console.log("ConfigService, recommended SENDER info:",i)),i&&(se=i,ae=!0),K.senderConfig=t()-n,K.senderExists=!!i,ht()},o=function(e){ce=e;var t=P+N+"/configurations",n={Authorization:"Bearer "+te.authToken},r={app_id:N,local_id:L,rtc_rtp_parameters:e},o=JSON.stringify(r);Qe(t,o,i,n)},a=function(){o({encodings:[{maxBitrate:0}]})};if(Object.keys(ue).length>1)return console.warn("Multiple PCs found, skipping"),void r();if(!e.getSenders||"function"!=typeof e.getSenders)return console.warn("Get senders error"),void a();var c,u=e.getSenders();for(var l in u){var d=u[l];if("object"!=(void 0===d?"undefined":s(d))||!d.track||"object"!=s(d.track)||!d.track.kind)return console.warn("Access senders error"),void r();if("video"===d.track.kind){if(c)return console.warn("Multiple video sender, skipping"),void r();c=d}}if(!c)return console.warn("No video sender found"),void r();if(!c.getParameters||"function"!=typeof c.getParameters)return console.warn("Sender getParameters error"),void a();var p=c.getParameters();"object"!=(void 0===p?"undefined":s(p))?r():("encodings"in p||(p.encodings=[]),0===p.encodings.length&&p.encodings.push({maxBitrate:0}),o(p))})(n))}if("closed"===o&&J)try{J.callFinished()}catch(e){B("callFinished",e),J.crashDisconnect()}if("have-remote-offer"===o||"stable"===o){if(K.remoteofferSinceCreate=t()-K.create,ht(),J)try{J.callStarts()}catch(e){B("callStarts",e),J.crashDisconnect()}$e(N,L,"log",{msg:"precalltest told to stop "+H}),H+="(stopped)"}}}},Dt=function(e,n,r){if(!e.onHold){var i=n,o=r;null===e.statsInterval&&(e.statsPollingStart=t(),jt(i,o),e.statsInterval=setInterval(function(){jt(i,o)},1e3))}},xt=function(e,t,n,r,i,o){o.localCandidates=t.localCandidates,o.remoteCandidates=t.remoteCandidates,o.iceCandidatePairs=t.iceCandidatePairs,ot(ye.iceFailed,n,r,i,o,t.pcHash,t.pcCallback)},Nt=function(e,t){if(e&&void 0!==t){var n=null;(n=yt(t))&&n.fabric&&n.fabric.numNegotiationNeededCalls++}},Lt=function(e,n){if(e&&void 0!==n){var r,i,o,a,s=null,c=null;if((c=yt(n))&&c.fabric){s=c.fabric,r=c.conferenceID,i=t()-s.startTime,o=s.iceConnectionState,a=s.iceGatheringState;var u=s.remoteUserID,l=ue[r].ucID,d={changedState:"iceConnectionState",prevState:o,newState:n.iceConnectionState};if(ct(n,s,r,l,u,s.pcHash,d),a!==n.iceGatheringState){var p={changedState:"iceGatheringState",prevState:a,newState:n.iceGatheringState};ct(n,s,r,l,u,s.pcHash,p)}"complete"===n.iceGatheringState&&"checking"===n.iceConnectionState&&(function(e,n,r,i){var o=n.iceConnectionState,a=n.remoteUserID,s=ue[r],c=t(),u={prevIceConnectionState:o,currIceConnectionState:e.iceConnectionState};n.gatheringIceCandidatesDelay=i,"disconnected"===o&&n.pcState===Ae.checkingDisrupted&&(u.disruptionDelay=c-n.disruptedTS,ot(ye.iceConnectionDisruptionEnd,a,r,s.ucID,u,n.pcHash,n.pcCallback))})(n,s,r,i),"connected"===n.iceConnectionState||"completed"===n.iceConnectionState?(function(e,n,r,i){var o=n.iceConnectionState,a=n.remoteUserID,s=ue[r],c=t(),u={prevIceConnectionState:o,currIceConnectionState:e.iceConnectionState,prevPair:n.activeIceCandidatePair},l=n.pcState===Ae.disrupted,d="completed"===e.iceConnectionState;n.connectivityIceStatusDelay=i,n.established=!0,Ct(e,function(e){if(n.localCandidates=e.localCandidates,n.remoteCandidates=e.remoteCandidates,n.iceCandidatePairs=e.iceCandidatePairs,n.activeIceCandidatePair=At(n.iceCandidatePairs),u.currPair=n.activeIceCandidatePair,u.disruptionDelay=c-n.disruptedTS,l)ot(ye.iceDisruptionEnd,a,r,s.ucID,u,n.pcHash);else if(d){var t={};t.iceCandidatePairs=e.iceCandidatePairs,ot(ye.iceCompleted,a,r,s.ucID,t,n.pcHash)}}),Ft(n.pc,ye.autoFabricSetup,r),n.pcState=Ae.established,Dt(n,e,r,a)})(n,s,r,i):"failed"===n.iceConnectionState?(function(e,t,n,r){var i=t.iceConnectionState,o=t.remoteUserID,a=ue[n],s={prevIceConnectionState:i,currIceConnectionState:e.iceConnectionState,currPair:t.activeIceCandidatePair,failureDelay:r};t.pcState=Ae.failed,"checking"===i?xt(0,t,o,n,a.ucID,s):"completed"===i||"connected"===i?ot(ye.fabricDropped,o,n,a.ucID,s,t.pcHash,t.pcCallback):"disconnected"===i&&t.established?ot(ye.fabricDropped,o,n,a.ucID,s,t.pcHash,t.pcCallback):"disconnected"===i&&xt(0,t,o,n,a.ucID,s)})(n,s,r,i):"disconnected"===n.iceConnectionState?(function(e,n,r){var i=n.iceConnectionState,o=n.remoteUserID,a=ue[r],s=t(),c={prevIceConnectionState:i,currIceConnectionState:e.iceConnectionState,prevIceConnectionStateTs:n.iceConnectionStateTS,currPair:n.activeIceCandidatePair};n.startTime=s,"connected"===i||"completed"===i?(n.pcState=Ae.disrupted,n.disruptedTS=s,ot(ye.iceDisruptionStart,o,r,a.ucID,c,n.pcHash,n.pcCallback),n.pcCallback&&n.pcCallback(Te.appConnectivityError,"Connectivity check for PC object to "+o+" failed.")):"checking"===i&&(n.pcState=Ae.checkingDisrupted,n.disruptedTS=s,ot(ye.iceConnectionDisruptionStart,o,r,a.ucID,c,n.pcHash,n.pcCallback),n.pcCallback&&n.pcCallback(Te.appConnectivityError,"Connectivity check for PC object to "+o+" failed."))})(n,s,r):"closed"===n.iceConnectionState?(function(e,t,n,r){var i=t.iceConnectionState,o=t.remoteUserID,a=ue[n],s={prevIceConnectionState:i,currIceConnectionState:e.iceConnectionState};"new"===i||"checking"===i?(s.failureDelay=r,ot(ye.iceAborted,o,n,a.ucID,s,t.pcHash,t.pcCallback)):(s.currPair=t.activeIceCandidatePair,ot(ye.iceTerminated,o,n,a.ucID,s,t.pcHash,t.pcCallback))})(n,s,r,i):"new"===n.iceConnectionState&&(function(e,t,n){var r=(void 0).iceConnectionState,i=(void 0).remoteUserID,o=ue[void 0],a={prevIceConnectionState:r,currIceConnectionState:(void 0).iceConnectionState,prevPair:(void 0).activeIceCandidatePair};"new"!==r&&((void 0).established=!1,ot(ye.iceRestarted,i,void 0,o.ucID,a,(void 0).pcHash,(void 0).pcCallback))})(),s.iceConnectionState=n.iceConnectionState,s.iceGatheringState=n.iceGatheringState,s.iceConnectionStateTS=t()}}},Mt=function(e,t){var n,r,i;if(void 0!==t){if(null!==e.candidate){var o="1"===(r=e.candidate.candidate.split(" "))[1]?"rtp":"rtcp";"0"!==r[5]&&(i=-1!==r[4].indexOf(":"),n={transport:r[2],protocol:o,typePreference:r[3],address:i?"["+r[4]+"]:"+r[5]:r[4]+":"+r[5],type:r[7],media:e.candidate.sdpMid})}var a=null;a=yt(t),Ct(t,function(e){a.localCandidates=e.localCandidates,a.remoteCandidates=e.remoteCandidates,a.iceCandidatePairs=e.iceCandidatePairs,a.activeIceCandidatePair=At(a.iceCandidatePairs)}),a&&a.fabric&&(void 0!==n&&-1===a.fabric.iceCandidates.indexOf(n)&&a.fabric.iceCandidates.push(n),n&&a.fabric.fabricSetupSent&&(function(e,n){var r=yt(t);if(r&&r.fabric){var i=r.fabric,o=i.remoteUserID,a=r.conferenceID,s=ue[a].ucID;ot(ye.iceCandidateFound,o,a,s,n,i.pcHash)}})(0,n))}},jt=function(e,t){if(ue.hasOwnProperty(t)){if("closed"===e.signalingState)return Et(e,ge.fabricTerminated,t),!0;var n=vt(t,e);if(n.pcState!==Ae.established&&n.lastFabricState===n.pcState&&"connected"!==e.iceConnectionState&&"completed"!==e.iceConnectionState)return!0;var r=ue[t].ucID;try{Tt(e,n.pcCallback,l,L,r,n)}catch(e){console.log("csioGetStats: Error",e)}}else console.error("ConferenceID %o doesn't exist. Can't call getStats for it.",t)},Ft=function(e,n,r){var i=null,o=ue[r],a=null,s=t();if(void 0===o&&console.error("sendAutoFabricSetupEvent: Conference ID not found!"),null===(a=vt(r,e))&&console.error("sendAutoFabricSetupEvent: fabricData is null"),!a.fabricSetupSent){i=a.remoteUserID;var c={setupDelay:s-a.startTime,iceGatheringDelay:a.gatheringIceCandidatesDelay,iceConnectivityDelay:a.connectivityIceStatusDelay,remoteEndpointType:a.remoteEndpointType,fabricTransmissionDirection:a.fabricTransmissionDirection};de||(c.clockSyncOffset=le.currentOffset),Ct(e,function(e){c.localCandidates=e.localCandidates,c.remoteCandidates=e.remoteCandidates,c.iceCandidatePairs=e.iceCandidatePairs,a.localCandidates=e.localCandidates,a.remoteCandidates=e.remoteCandidates,a.iceCandidatePairs=e.iceCandidatePairs,a.pcState=Ae.established,a.activeIceCandidatePair=At(a.iceCandidatePairs),a.fabricSetupSent||(ot(n,i,r,o.ucID,c,a.pcHash,a.pcCallback),a.fabricSetupSent=!0)})}},Ut=function(e,t,n){var r={},i=null,o=ue[n],a=null;void 0===o&&console.error("sendFabricTransportSwitchEvent: Conference ID not found!"),null===(a=vt(n,e))&&console.error("sendFabricTransportSwitchEvent: fabricData is null"),i=a.remoteUserID,r.prevPair=a.activeIceCandidatePair,Ct(e,function(e){r.currPair=At(e.iceCandidatePairs),a.activeIceCandidatePair=r.currPair,r.switchDelay=null,r.relayType=a.transportData.relayType,ot(t,i,n,o.ucID,r,a.pcHash,a.pcCallback)})},Ht=function(e,t){if(e.trackStats){var n=e.trackStats.filter(function(e){return e.id===t});if(n.length>0)return n[0]}},Bt=function(e,t){if(e.codec){var n=e.codec.filter(function(e){return e.id===t});if(n.length>0)return n[0]}},Gt=function(e,t){if(e.candidatePair){var n=e.candidatePair.filter(function(e){return e.id===t});if(n.length>0)return n[0]}},Jt=function(e){for(var t,n,r=e.Transport.length,i=0;ile.maxAllowedLatency)le.offsetResults=[],$e(N,L,"log",{msg:"clockSync restarting"});else{var i=e.now+r,o=i-n;le.offsetResults.push(o),$e(N,L,"log",{msg:"clockSync Info serverTime "+i+" responseRecvTs "+n+" requestExecutionTime "+t})}if(le.offsetResults.length>=le.syncAttempts){var a=le.offsetResults.reduce(function(e,t){return e+t});le.currentOffset=a/le.offsetResults.length,$e(N,L,"log",{msg:"clockSync Done "+le.currentOffset+"Length "+le.offsetResults.length}),le.offsetResults=[],de=!1,Z.sendCachedUserJoinedEvents(te),Z.sendCachedEvents(te,de)}else de&&setTimeout(function(){zt()},100)}},$t=new(function(){var e=this,n=null,r=!1,i=!1,o={};this._wsConnectionState="closed";var a=function(e,t){try{if(window&&window.sessionStorage){var n=JSON.parse(window.sessionStorage.getItem("csio_ucid_data"));n||(n={}),n[e]||(n[e]={}),n[e].ucID=t,window.sessionStorage.setItem("csio_ucid_data",JSON.stringify(n))}}catch(e){return}o[e]="https://dashboard.callstats.io/apps/"+N+"/conferences/"+encodeURIComponent(e)+"/"+t+"/general"};this.getConferenceURL=function(){return o},this._setupWebSocketConnection=function(o){return"initiated"===e._wsConnectionState||"connected"===e._wsConnectionState?($e(N,L,"log",{msg:"### _setupWebSocketConnection is called when already connected!"}),console.log("### _setupWebSocketConnection is called when already connected!"),void(o&&o(Te.success,"WebSocket establishment successful."))):(e._wsConnectionState="initiated",(n=new WebSocket(k,"echo-protocol")).onopen=function(){console.log("**** Successfully connected to the backend ",i,L),$e(N,L,"log",{msg:"Successfully connected to the backend"}),e._wsConnectionState="connected",r?i=!0:r=!0,Z.sendCachedUserJoinedEvents(te),i&&((function(){var e;for(e in ue)if(ue.hasOwnProperty(e)){if(e===A)return;lt(e),ue[e].refreshPresence=(function(e){return setInterval(function(){lt(e)},1e4)})(e)}b()})(),Z.sendCachedEvents(te,de)),i=!1},n.onclose=function(){e._wsConnectionState="closed",console.log("**** Connection to the server closed."),$e(N,L,"log",{msg:"Connection to the server closed."}),(function(){var e;for(e in ue)ue.hasOwnProperty(e)&&(ue[e].refreshPresence=f(ue[e].refreshPresence),delete ue[e].refreshPresence);y()})(),n&&(n=null),o&&o(Te.httpError,"Connection to the server closed.")},n.onerror=function(t){e._wsConnectionState="closed",$e(N,L,"log",{msg:"WebSocket establishment failed."}),console.log("WebSocket establishment failed.",t),o&&o(Te.wsChannelFailure,"WebSocket establishment failed.",t)},void(n.onmessage=function(e){var n,r=e.data,i=t(),s=JSON.parse(r);if("Error"===s.status)"Invalid client token."===s.reason&&(te.tokenData=null,te.authToken=null,te.sendAuthenticationRequest(N,L)),o&&o(Te.csProtoError,r.reason);else if("200 OK"===s.status)if("feedback"===s.event)Ke("feedback");else if(s.event===ye.userJoined||s.event===ye.refreshPresence){var c=!1,u=null;n=decodeURIComponent(s.conferenceID),ue.hasOwnProperty(n)&&(ue[n].ucID!==s.ucID&&(c=!0,a(n,s.ucID),u=s.conferenceCreationTS?s.conferenceCreationTS:s.conferenceDuration),s.event!==ye.userJoined||ue[n].refreshPresence||(ue[n].refreshPresence=(l=n,setInterval(function(){lt(l)},1e4)),b()),ue[n].ucID=s.ucID),Z.sendCachedFeedback(),Z.sendCachedEvents(te,de,c,u,n,s.ucID)}else s.event===be.clockSync?Qt(s,i):s.event===ge.fabricSetupFailed&&(n=decodeURIComponent(s.conferenceID),s.ucID&&(a(n,s.ucID),Z.sendCachedFeedback(),Z.sendCachedEvents(te,de,!0,0,n,s.ucID)));var l}))},this._isChannelReady=function(){return!(!n||1!==n.readyState)},this.getWSConnectionState=function(){return n?n.readyState:-1},this.send=function(e){n.send(JSON.stringify(e))}}),Xt=function(e,t,n){if($t._isChannelReady())try{$t.send(t)}catch(r){r&&"InvalidStateError"===r.name&&Z.cacheEvent({channel:e,data:t,callback:n})}else Z.cacheEvent({channel:e,data:t,callback:n}),$t._setupWebSocketConnection()};return navigator&&"function"==typeof navigator.getBattery&&navigator.getBattery().then(function(e){ie=e}),(function(){if(null===(j=qe("endpointID"))){var e=t();!(function(e,t){var n={name:"SHA-256"};if(window.crypto){var r=window.crypto.subtle||window.crypto.webkitSubtle;if(!r)return void pt(e,t);r.digest(n,kt(e)).then(function(e){t(It(e))}).catch(function(){pt(e,t)})}else if(window.msCrypto){if(!window.msCrypto.subtle)return void pt(e,t);var i=window.msCrypto.subtle.digest(n,kt(e));i.oncomplete=function(e){e.target&&t(It(e.target.result))},i.onerror=function(){pt(e,t)}}else pt(e,t)})((Math.random()*e).toString(),function(e){We("endpointID",j=e)})}})(),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var t,n=Object(this),r=n.length>>>0,i=arguments[1],o=0;o0&&(t=!0),t})(a)){var g=(b=Ze,{magicKey:b,statsSubmissionInterval:Q,endpoint:oe,localUserIDObject:M});ot(ye.userJoined,null,a,null,g,null,null),v=!0,f={authStatus:!!te.tokenData,clockSync:!de,msg:"userJoined sent",pageURL:window.location.href,eventType:"warn",conferenceID:a,version:R},$e(N,L,"stateMachine",f)}var b;if(null,k=v,void 0===ue[w=a]&&(ue[w]={},ue[w].participants=null,k&&(ue[w].userJoinedSent=!0)),!vt(a,n)){n&&new C(n,Mt,Lt,Ot,Nt),l=e();var S={pc:n,remoteUserID:d,fabricUsage:i,magicKey:Ze,startTime:m,pcCallback:u,pcState:Ae.initializing,fabricSetupSent:!1,iceCandidates:[],iceConnectionState:n.iceConnectionState,latestEventSent:m,pcHash:l,localSDP:-1,remoteSDP:-1,statsInterval:null,intervalAdaptionPhase:!0,gatheringIceCandidatesDelay:0,connectivityIceStatusDelay:0,numNegotiationNeededCalls:0,currentActivePhaseIndex:0,onHold:!1,ssrcMap:{},conferenceID:a,remoteEndpointType:p,fabricTransmissionDirection:h};ae&&(ot(be.senderConfiguration,r,a,null,se,S.pcHash),ae=!1),"function"!=typeof n||n.callstatsID||(n.callstatsID=l),"connected"!==n.iceConnectionState&&"completed"!==n.iceConnectionState||(S.pcState=Ae.established),(function(e,t){var n=ue[e],r=[];if(void 0===n)r.push(t),ue[e]={},ue[e].participants=r;else{var i=n.participants;null===i?(r.push(t),n.participants=r):i.push(t)}})(a,S),S.pcState===Ae.established&&(Ft(n,ye.autoFabricSetup,a),Dt(S,n,a));var _=function(e){var t=0;return Object.keys(e).forEach(function(e){e&&e.mediaType&&(t+="audio"===e.mediaType?1:0)}),00){var O=ue[a].ucID;at(Se,a,O,I)}}catch(e){B("send associate",e)}return dt(_e.success)},sendFabricEvent:Et,sendUserFeedback:function(e,t,n){var r;if(!t||!e)return console.error("sendUserFeedback: Arguments missing/Invalid"),dt(_e.error,"sendUserFeedback: Arguments missing/Invalid");if("object"!=(void 0===t?"undefined":s(t)))return console.error("sendUserFeedback: Invalid feedback object."),dt(_e.error,"sendUserFeedback: Invalid feedback object.");if(0===Object.keys(t).length)return console.error("sendUserFeedback: Feedback data object must not be empty."),dt(_e.error,"sendUserFeedback: Feedback data object must not be empty.");var i=ue[e],o=null;void 0!==i&&void 0!==i.ucID&&(o=i.ucID);var a=null;if(a=null===Ze?pe:Ze,null===o&&(o=v(e)),null===o)return console.error("sendUserFeedback: ucID unavailable"),dt(_e.error,"sendUserFeedback: ucID unavailable");r="object"==s(t.userID)?t.userID.aliasName:t.userID,t&&t.overall<=0&&(t.overall=null);var c={conferenceID:encodeURIComponent(e),magicKey:a,appID:N,version:R,ucID:o,remoteID:encodeURIComponent(r),userID:encodeURIComponent(r),userQoe:{overall:t.overall}};return t.video&&(c.userQoe.video=t.video),t.audio&&(c.userQoe.audio=t.audio),t.screen&&(c.userQoe.screen=t.screen),t.comment&&(c.userQoe.comment=t.comment),te.authToken&&!de?(c.token=te.authToken,We("feedback",JSON.stringify(c)),g(be.userFeedback,c,n)):(c.clockUnsynced=de,Z.cacheEvent({channel:be.userFeedback,data:c,callback:n}),te.sendAuthenticationRequest(N,r)),dt(_e.success)},associateMstWithUserID:function(e,t,n,r,a,c){var u=null;if(u="object"==(void 0===t?"undefined":s(t))?t.aliasName:t,n||(n=A),!(e&&r&&a&&u))return console.error("associateMstWithUserID: Arguments missing"),dt(_e.error,"associateMstWithUserID: Arguments missing");if(!o(e))return console.error("associateMstWithUserID: Invalid PeerConnection object passed"),dt(_e.error,"associateMstWithUserID: Invalid PeerConnection object passed");if(void 0===ue[n])return console.error("associateMstWithUserID: conferenceID doesn't exist"),dt(_e.error,"associateMstWithUserID: conferenceID doesn't exist");var l=null;if(null===(l=vt(n,e)))return console.error("associateMstWithUserID: Unknown pcObject passed"),dt(_e.error,"associateMstWithUserID: Unknown pcObject passed");var d=nt(l,r);return void 0===d&&(l.ssrcMap[r]={},d=nt(l,r)),d.remoteUserID=u,d.ssrc=r,d.associatedVideoTag=c,d.usageLabel=a,c&&u!==L&&(function(e,t,n,r){var o,a=document.getElementById(t);a&&(a.oncanplay=function(){o=ue[e].ucID;var t=vt(e,n);t&&(function(e,t,r,o,a){var s=gt(r,n),c=null;s&&(c=i(),ot(ye.mediaPlaybackStartEvent,t,r,e,{ssrc:a,highResTs:c},s,null))})(o,t.remoteUserID,e,0,r)},a.onsuspend=function(){o=ue[e].ucID;var t=vt(e,n);t&&(function(e,t,r,o,a){var s=gt(r,n),c=null;s&&(c=i(),ot(ye.mediaSuspendedEvent,t,r,e,{ssrc:a,highResTs:c},s,null))})(o,t.remoteUserID,e,0,r)})})(n,c,e,r),dt(_e.success)},attachWifiStatsHandler:function(e){return e?"function"!=typeof e?(console.error("attachWifiStatsHandler: Arguments Invalid"),dt(_e.error,"attachWifiStatsHandler: Arguments Invalid")):(S=e,void(function e(){S&&S().then(function(t){D=JSON.parse(t),setTimeout(function(){e()},1e4)}).catch(function(){setTimeout(function(){e()},1e4)})})()):(console.error("attachWifiStatsHandler: Arguments missing"),dt(_e.error,"attachWifiStatsHandler: Arguments missing"))},csError:Te,fabricUsage:Re,qualityRating:{excellent:5,good:4,fair:3,poor:2,bad:1},webRTCFunctions:Oe,reportError:function(n,r,i,a,c,u){if(r||(r=A),void 0===n||!i)return console.error("reportError: Arguments missing/invalid"),dt(_e.error,"reportError: Arguments missing/invalid");if(!N||!L)return console.error("reportError: SDK is not initialized"),dt(_e.error,"reportError: SDK is not initialized");if(!Oe.hasOwnProperty(i))return console.error("reportError: Invalid webRTC functionName value: %o",i),dt(_e.error,"reportError: Invalid webRTC functionName value: "+i);void 0===a&&console.warn("reportError: Missing dom error parameter");var l,d,p,h=null,f=t(),m=ue[r],g=null,y=f,b=null,S=null,_=null,T=null;if(_=v(r),d=(function(e){var t;return Oe.hasOwnProperty(e)?e===Oe.createOffer||e===Oe.createAnswer||e===Oe.setRemoteDescription?t=xe:e===Oe.setLocalDescription?t=Ne:e===Oe.addIceCandidate?t=Ne:e===Oe.getUserMedia?t=De:e===Oe.iceConnectionFailure?t=Le:e===Oe.signalingError?t=Me:(e===Oe.applicationLog||Oe.applicationError)&&(t=je):t=Xe,t})(i),i!==Oe.getUserMedia&&(T=e()),a)if(window.DOMException&&a instanceof window.DOMException)a={message:a.message,name:a.name};else if("object"==(void 0===a?"undefined":s(a))){var C={};a.message&&(C.message=a.message),a.name&&(C.name=a.name),a.constraintName&&(C.constraintName=a.constraintName),a.stack&&(C.stack=a.stack),a=C}if((w=a)&&"string"==typeof w?w=wt(w,2e4):w&&"object"==(void 0===w?"undefined":s(w))&&w.message&&(w.message=wt(w.message,2e4)),a=w,o(n)){if(m&&(_=m.ucID),(g=vt(r,n))?(l=g.remoteUserID,y=g.startTime,b=g.pcState,S=g.pc.iceConnectionState,T=g.pcHash,p=g.pcCallback):l=L,h={failureDelay:f-y,reason:d,domError:a,fabricState:b,iceConnectionState:S,function:i,magicKey:Ze,endpoint:oe},i===Oe.applicationLog||i===Oe.applicationError?ot(ge.applicationErrorLog,l,r,_,h,T,p):(ot(ge.fabricSetupFailed,l,r,_,h,T,p),K.errorSinceCreate=t()-K.create,ht()),c||u||n&&n.localDescription||n&&n.remoteDescription){var E={sdp:{}};E.sdp.localSDP=Rt(n,c,"localDescription"),E.sdp.remoteSDP=Rt(n,u,"remoteDescription"),st(l,r,_,E,T)}}else null===Ze&&(Ze=e()),l=L,h={failureDelay:0,reason:d,domError:a,function:i,magicKey:Ze,endpoint:oe},i===Oe.applicationLog||i===Oe.applicationError?ot(ge.applicationErrorLog,l,r,_,h,null,null):ot(ge.fabricSetupFailed,l,r,_,h,T,null);var w;return dt(_e.success)},reportUserIDChange:function(e,t,n,r){if(!(e&&n&&r&&t))return console.error("reportUserIDChange: Arguments missing/Invalid"),dt(_e.error,"reportUserIDChange: Arguments missing/Invalid");if(!N||!L)return console.error("reportUserIDChange: SDK not initialized."),dt(_e.error,"reportUserIDChange: SDK not initialized");if(""===n||""===t)return console.error("reportUserIDChange: id or conferenceID MUST not be empty"),dt(_e.error,"reportUserIDChange: id or conferenceID MUST not be empty");if(!o(e))return console.error("reportUserIDChange: Invalid PeerConnection object passed"),dt(_e.error,"reportUserIDChange: Invalid PeerConnection object passed");var i=null,a=ue[t];if(void 0===a)return console.error("reportUserIDChange: Conference ID not found!"),dt(_e.error,"reportUserIDChange: Conference ID not found!");var s=null;if(void 0===a.ucID)return console.error("reportUserIDChange: addNewFabric was not called"),$e(N,L,"log",{msg:"### reportUserIDChange: addNewFabric was not called"}),dt(_e.error,"reportUserIDChange: addNewFabric was not called");if(s=a.ucID,null===(i=vt(t,e)))return console.error("reportUserIDChange: Invalid pcObject passed as argument"),dt(_e.error,"reportUserIDChange: Invalid pcObject passed as argument");var c={id:n,idType:r};return ot(ge.userIDChangedEvent,void 0,t,s,c,null,i.pcCallback),dt(_e.success)},userIDType:{local:"local",remote:"remote"},setProxyConfig:function(e){return window&&!window.csioproxy?(console.error("setCallstatsURLs: cannot be called if window.csioproxy is false"),dt(_e.error,"setCallstatsURLs: cannot be called if window.csioproxy is false")):e?(e.collectorURL&&(E=e.collectorURL),e.authServiceURL&&(w=e.authServiceURL),e.csioInternalAPIURL&&(I=e.csioInternalAPIURL),e.wsURL&&(k=e.wsURL),Kt(),m(),y(),dt(_e.success)):(console.error("setCallstatsURLs: Arguments missing/Invalid"),dt(_e.error,"setCallstatsURLs: Arguments missing/Invalid"))},callStatsAPIReturnStatus:_e,setIdentifiers:function(e,t){return e?(e.conferenceID&&((function(e){if(ue[A]){var t=ue[A].participants;if(t)for(var n=0;nr&&(o=u[c].name.substr(u[c].name.lastIndexOf("/")+1),r=u[c].duration),u[c].duration-1&&(t=u[c].duration);return{support:"full",callstats:t,min:{name:i,time:n},max:{name:o,time:r},total:s}}return"Firefox"===e.name?{support:"limited",total:s}:void 0},r.prototype.detectBrowserInfo=function(){var e="Chrome",t=null,n=null,r=null,i="Chrome";if(!window.navigator.userAgent||window.csioReactNative)return console.log("Invalid userAgent"),window&&window.csioGetOsName&&(t=window.csioGetOsName()),window&&window.csioGetOsVer&&(n=window.csioGetOsVer()),window&&window.csioReactNative&&(r="react-native"),{name:e,codebase:i,os:t,osVersion:n,userAgent:r};var o,a=(r=navigator.userAgent).toLowerCase(),s=navigator.appVersion,c=""+parseFloat(navigator.appVersion);-1!==(o=a.indexOf("opera"))?(e="Opera",c=a.substring(o+6),-1!==(o=a.indexOf("Version"))&&(c=a.substring(o+8)),i="Chrome"):-1!==(o=a.indexOf("opr"))?(e="Opera",c=a.substring(o+4),-1!==(o=a.indexOf("Version"))&&(c=a.substring(o+8)),i="Chrome"):-1!==(o=a.indexOf("msie"))?(e="Microsoft Internet Explorer",c=a.substring(o+5),i="Chrome"):-1!==(o=a.indexOf("edge"))?(e="Edge",c=a.substring(o+5),i="Edge"):-1!==(o=a.indexOf("chrome"))?(e="Chrome",c=a.substring(o+7),i="Chrome"):-1!==(o=a.indexOf("safari"))?(e="Safari",c=a.substring(o+7),-1!==(o=a.indexOf("version"))&&(c=a.substring(o+8)),i="Chrome"):-1!==(o=a.indexOf("firefox"))?(e="Firefox",c=a.substring(o+8),i="Firefox"):-1!==(o=a.indexOf("trident"))&&(e="Microsoft Internet Explorer",o=a.indexOf("rv"),c=a.substring(o+3,o+7),i="Chrome");var u,l,d=[{s:"Windows 3.11",r:/win16/},{s:"Windows 95",r:/(windows 95|win95|windows_95)/},{s:"Windows ME",r:/(win 9x 4.90|windows me)/},{s:"Windows 98",r:/(windows 98|win98)/},{s:"Windows CE",r:/windows ce/},{s:"Windows 2000",r:/(windows nt 5.0|windows 2000)/},{s:"Windows XP",r:/(windows nt 5.1|windows xp)/},{s:"Windows Server 2003",r:/windows nt 5.2/},{s:"Windows Vista",r:/windows nt 6.0/},{s:"Windows 7",r:/(windows 7|windows nt 6.1)/},{s:"Windows 8.1",r:/(windows 8.1|windows nt 6.3)/},{s:"Windows 8",r:/(windows 8|windows nt 6.2)/},{s:"Windows 10",r:/(windows 10|windows nt 10.0)/},{s:"Windows NT 4.0",r:/(windows nt 4.0|winnt4.0|winnt|windows nt)/},{s:"Windows ME",r:/windows me/},{s:"Android",r:/android/},{s:"Open BSD",r:/openbsd/},{s:"Sun OS",r:/sunos/},{s:"Linux",r:/(linux|x11)/},{s:"iOS",r:/(iphone|ipad|ipod)/},{s:"Mac OS X",r:/mac os x/},{s:"Mac OS",r:/(macppc|macintel|mac_powerpc|macintosh)/},{s:"QNX",r:/qnx/},{s:"UNIX",r:/unix/},{s:"BeOS",r:/beos/},{s:"OS/2",r:/os\/2/},{s:"Search Bot",r:/(nuhk|googlebot|yammybot|openbot|slurp|msnbot|ask jeeves\/teoma|ia_archiver)/}];for(u in d)if((l=d[u]).r.test(a)){t=l.s;break}switch(t&&/Windows/.test(t)&&(n=/Windows (.*)/.exec(t)[1],t="Windows"),t){case"Mac OS X":n=/mac os x (10[\.\_\d]+)/.exec(a)[1];break;case"Android":n=/android ([\.\_\d]+)/.exec(a)[1];break;case"iOS":n=(n=/os (\d+)_(\d+)_?(\d+)?/.exec(s))[1]+"."+n[2]+"."+(0|n[3])}return{name:e,ver:c.toString(),os:t,osVersion:n,codebase:i,userAgent:r}},e.exports=r},function(e,t,n){function r(){this.invoker=null,this.receiver=null}function i(){this.listeners=[]}function o(e){this.stats=null,this.lastResponsed=(new Date).getTime(),this.onDataSent=e}function a(e){this.ssrc=null,this.direction=void 0,this.mediaType=null,this.resolution=null,this.frameRateReceived=null,this.frameWidth=null,this.rtt=null,this.droppedFramesNum=null,this.packetLosts=null,this.jitter=null,this.bytesReceived=-1,this.packetsReceived=-1,this.packetsDiscarded=-1,this.bytesSent=-1,this.packetsSent=-1,this.stream=e}function s(e,t){var n="number"==typeof e?e:parseInt(e),r="number"==typeof t?t:parseInt(t);return n===r?0:n0&&n>0&&(i=r.concat("x",n,"@",t)),i},getFrameWidth:function(e){var t;return void 0!==e.data.googFrameWidthReceived?t=e.data.googFrameWidthReceived:void 0!==e.data.googFrameWidthSent?t=e.data.googFrameWidthSent:void 0!==e.data.frameWidth&&(t=e.data.frameWidth),t},validateRTT:function(e){return isNaN(e)||e<0?null:e},getLatencyData:function(e){return void 0===e?null:void 0!==e.data.googRtt?this.validateRTT(parseInt(e.data.googRtt,10)):void 0!==e.data.roundTripTime?this.validateRTT(parseInt(e.data.roundTripTime,10)):void 0!==e.data.mozRtt?this.validateRTT(parseInt(e.data.mozRtt,10)):null},getMediaType:function(e){var t=this.mediaType.unknown;if(void 0!==e)return e.data&&void 0!==e.data.mediaType?e.data.mediaType:(e.data.mediaType?t=e.data.mediaType:void 0!==e.data.googFrameRateReceived||void 0!==e.data.googFrameRateSent?t=this.mediaType.video:void 0!==e.data.audioInputLevel||void 0!==e.data.audioOutputLevel||void 0!==e.data.audioLevel?t=this.mediaType.audio:void 0!==e.data.framerateMean&&(t=this.mediaType.video),t)},checkForNan:function(e){return isNaN(e)?null:e},checkForNegativeValue:function(e){if(null!==(e=this.checkForNan(e)))return e<0?null:e},toString:function(){return"ToString function is not defined. for this object"}},m.prototype=Object.create(O.prototype),m.prototype.constructor=m,m.prototype.onDataSent=function(){this.prev=this.actual},m.prototype.getActual=function(){return this.actual},m.prototype.getFirst=function(){return this.first},m.prototype.getDelta=function(){return this.delta=this.actual-this.prev,this.delta},m.prototype.getPrevious=function(){return this.prev},m.prototype.add=function(e){var t=this.extractorFnc(e);if(void 0!==t&&null!==t){if(0===this.first)return this.first=t,void(this.actual=t);this.actual=t,this.notify({last:this.prev,delta:this.delta})}},m.prototype.remove=function(){},v.prototype=Object.create(O.prototype),v.prototype.constructor=v,v.prototype.add=function(e){void 0!==e&&null!==e&&(this.prev=this.extractorFnc(e))},v.prototype.remove=function(){},v.prototype.getPrevious=function(){return this.prev},g.prototype={constructor:g,getIntervalLoss:function(){return this.intervalLoss},getIntervalPacketsRecv:function(){return this.intervalPacketsRecv},getValue:function(){return void 0===this.intervalPacketsRecv||void 0===this.intervalLoss?null:null===this.intervalPacketsRecv||null===this.intervalLoss?null:0===this.intervalLoss&&0===this.intervalPacketsRecv?0:this.intervalLoss/(this.intervalPacketsRecv+this.intervalLoss)}},S.VideoThroughputThresholds={green:1024,red:256},S.AudioThroughputThresholds={green:30,red:8},S.FrameRateRatioTresholds={green:.8,red:.3},S.VideoRTTThresholds={green:400,red:1e3},S.VideoFractionLostTreshdolds={green:10,red:50},S.AudioFractionLostTresholds={green:15,red:30},S.AudioEModelTresholds={green:240,red:400},S.avQualityRating={excellent:3,fair:2,bad:1},S.avQualityRatingString={excellent:"excellent",fair:"fair",bad:"bad"},S.prototype={constructor:S,doStart:function(){return!0},getStartTime:function(){return this.firstAdded},hasTraffic:function(){var e=this.getLastMeasurement();return this.direction===a.Direction.inbound?00&&(e.data.csioAvgBRKbps=8*this.bytesReceivedTracker.getActual()/this.getTotalTimeInMs()),e.data.csioIntFL=t.getValue(),e.data.csioPercentileFl=this.getIntervalFractionLost95(),e.data.csioeM=(null!==this.getRTT95()?this.getRTT95():0)+40,e.data.csioIntPktLoss=this.packetLostTracker.getDelta(),void 0!==e.data.csioAvgBRKbps&&null!==e.data.csioAvgBRKbps?e.data.csioAvgPacketSize=this.bytesReceivedTracker.getDelta()/this.packetsReceivedTracker.getDelta():e.data.csioAvgPacketSize=null,e.data.csioPktLossPercentage=this.packetLostTracker.getDelta()/this.packetsReceivedTracker.getDelta()*100},T.prototype=Object.create(_.prototype),T.prototype.constructor=T,T.prototype.setup=function(e){_.prototype.setup.call(this,e),e.data.csioMediaType=a.MediaTypes.audio,this.quality.eModel=this.getQualityReverseEvaluation(e.data.csioeM,S.AudioEModelTresholds),this.quality.bandwidth=this.getQualityEvaluation(e.data.csioIntBRKbps,S.AudioThroughputThresholds),e.data.csioMark=this.getQuality()},T.prototype.getQuality=function(){var e=0,t=.5*this.quality.bandwidth+.5*this.quality.eModel;return(t=Math.floor(t))===S.avQualityRating.excellent?e=S.avQualityRatingString.excellent:t===S.avQualityRating.fair?e=S.avQualityRatingString.fair:t===S.avQualityRating.bad&&(e=S.avQualityRatingString.bad),e},C.prototype=Object.create(_.prototype),C.prototype.constructor=C,C.prototype.setFrameRatioQuality=function(){var e=this.frameRateReceivedTracker.getActual(),t=this.frameRateReceivedTracker.getPrevious(),n=0;this.quality.frameRate=0,void 0!==e&&void 0!==t&&null!==e&&null!==t&&0!==t&&(n=e/t,this.quality.frameRate=this.getQualityEvaluation(n,S.FrameRateRatioTresholds))},C.prototype.setFrameRateReceived10=function(e){return null===e?void(this.frameRateReceived10=null):void(this.frameRateReceived10=e.actual)},C.prototype.setup=function(e){_.prototype.setup.call(this,e),e.data.csioMediaType=a.MediaTypes.video,this.setFrameRatioQuality(),this.quality.eModel=this.getQualityReverseEvaluation(e.data.csioeM,S.AudioEModelTresholds),this.quality.bandwidth=this.getQualityEvaluation(e.data.csioIntBRKbps,S.VideoThroughputThresholds),e.data.csioMark=this.getQuality()},C.prototype.getQuality=function(){var e=0,t=.33*this.quality.bandwidth+.33*this.quality.eModel+.33*this.quality.frameRate;return(t=Math.floor(t))===S.avQualityRating.excellent?e=S.avQualityRatingString.excellent:t===S.avQualityRating.fair?e=S.avQualityRatingString.fair:t===S.avQualityRating.bad&&(e=S.avQualityRatingString.bad),e},E.prototype=Object.create(S.prototype),E.prototype.constructor=E,E.prototype.setup=function(e){S.prototype.setup.call(this,e);var t=new g(this.packetLostTracker.getDelta(),this.packetsSentTracker.getDelta());this.addIntervalFractionLost(t),this.setIntBRAndPR(this.bytesSentTracker,this.packetsSentTracker,e),this.getTotalTimeInMs()>0&&(e.data.csioAvgBRKbps=8*this.bytesSentTracker.getActual()/this.getTotalTimeInMs()),e.data.csioIntFL=t.getValue(),e.data.csioIntPktRcv=this.packetsSentTracker.getDelta(),e.data.csioPercentileFl=this.getIntervalFractionLost95(),e.data.csioeM=(null!==this.getRTT95()?this.getRTT95():0)+40,e.data.csioIntPktLoss=this.packetLostTracker.getDelta(),void 0!==e.data.csioAvgBRKbps&&null!==e.data.csioAvgBRKbps?e.data.csioAvgPacketSize=this.bytesSentTracker.getDelta()/this.packetsSentTracker.getDelta():e.data.csioAvgPacketSize=null,e.data.csioPktLossPercentage=this.packetLostTracker.getDelta()/this.packetsSentTracker.getDelta()*100},w.verificationElapsedThreshold=1e4,w.initialElapsedThreshold=15e3,w.minStableKBpsSlack=50,w.prototype=Object.create(E.prototype),w.prototype.constructor=w,w.prototype.setFrameRatioQuality=function(){var e=this.frameRateReceivedTracker.getActual(),t=this.frameRateReceivedTracker.getPrevious(),n=0;this.quality.frameRate=0,void 0!==e&&void 0!==t&&null!==e&&null!==t&&0!==t&&(n=e/t,this.quality.frameRate=this.getQualityEvaluation(n,S.FrameRateRatioTresholds))},w.prototype.setFrameRateReceived10=function(e){return null===e?void(this.frameRateReceived10=null):void(this.frameRateReceived10=e.actual)},w.prototype.getSendingKBitrateObservations=function(){var e=this.sendingThroughputObservations;return e.ready?{ssrc:e.ssrc,maxsendingKBitrate:e.max,timeToMaxSendingKBitrate:e.maxTs-e.started,stablesendingKBitrate:e.stable,timeToStableSendingKBitrate:e.stableTs-e.started}:null},w.prototype.checkSendingKBitrateObservations=function(e){var t=this.sendingThroughputObservations,n=(new Date).getTime();if(!0!==t.ready){if(0===t.started)return t.ssrc=this.getSSRC(),void(t.started=n);var r=e.data.csioIntBRKbps,i=Math.min(w.minStableKBpsSlack,.05*r);t.maxS.AudioEModelTresholds.green&&eS.AudioEModelTresholds.red&&(this.quality.eModel=S.avQualityRating.bad)},R.prototype.setThroughputQuality=function(e){null!==e&&void 0!==e&&(e>S.AudioThroughputThresholds.green?this.quality.bandwidth=S.avQualityRating.excellent:e>S.AudioThroughputThresholds.red&&e ("+r+") values: ["+t.value.toString()+"]"),null!==t.left&&e(t.left,n+1,"Left"),null!==t.right&&e(t.right,n+1,"Right")}})(this.root,0,"Root"))},r.prototype.insertByTop=function(e){this.inserting(e,this.top)},r.prototype.insertByBottom=function(e){this.inserting(e,this.bottom)},r.prototype.insert=function(e){this.inserting(e,this.root)},r.prototype.inserting=function(e,t){var r=function(){var t=new n(e);return(null===this.top||this.comparator(this.top.value[0],t.value[0])<0)&&(this.top=t),(null===this.bottom||this.comparator(t.value[0],this.bottom.value[0])<0)&&(this.bottom=t),t};if(null===this.root)return this.root=r.call(this),void(this.node_counter=1);for(var i=null,o=t,a=0,s=function(t){return t===e};null!==o;){if(0===(a=this.comparator(e,o.value[0])))return void(o.value.find(s)||(o.value.push(e),++this.duplicate_counter));i=o,o=a<0?o.left:o.right}++this.node_counter,a<0?i.left=r.call(this):i.right=r.call(this)},r.prototype.search=function(e){for(var t,n=this.root,r=null,i=function(t){return t===e};null!==n;){if(0===(t=this.comparator(e,n.value[0])))return n.value.find(i)?(n.parent=r,n):null;r=n,n=t<0?n.left:n.right}return null},r.prototype.getRightist=function(e){for(var t=null;null!==e.right;)t=e,e=e.right;return e.parent=t,e},r.prototype.getLeftist=function(e){for(var t=null;null!==e.left;)t=e,e=e.left;return e.parent=t,e},r.prototype.deleteBottomValue=function(){for(;null===this.bottom;)return null;var e=this.bottom.value[0];return this.delete(e),e},r.prototype.deleteTopValue=function(){for(;null===this.top;)return null;var e=this.top.value[0];return this.delete(e),e},r.prototype.delete=function(e){var t=null,n=function(e,t,n){null!==t?t.left===e?t.left=n:t.right=n:this.root=n};if(null===(t=this.search(e)))return!1;if(10)&&e)){this.turnTestCounter=0,this.resultsHandler=new s.ResultsHandler;var n={type:"browser",os:this.browserInfo.os,osVersion:this.browserInfo.osVersion,buildName:this.browserInfo.browserName,buildVersion:this.browserInfo.browserVersion};this.resultsHandler.add("endpointInfo",n),this.onlineCheck.start(),this.active=!0,this._start()}}},{key:"_start",value:function(){var e=this;this.active&&this.turnConnection.connect(this.iceServers).then(function(){e.active&&e.startTurnTests().then(function(){e.stop()},function(t){e.stop()})},function(t){e.resultsHandler.failure(t),e.resultsHandler.getFailureNumber()>=10?e.stop():(e.turnConnection.disconnect(),setTimeout(function(){e._start()},0))})}},{key:"stop",value:function(){var e=this;if(this.browserInfo.browserName!==u.Constants.browserName.msie&&this.active){this.active=!1,this.activeTurnTest&&this.activeTurnTest.forceStop();var t=this.onlineCheck.stop();this.resultsHandler.add("onlineStatus",t),this.turnConnection.getIceResults().then(function(t){e.resultsHandler.add("ice",t),e.turnConnection.disconnect(),e.sendResults()},function(t){e.resultsHandler.failure(t),e.turnConnection.disconnect(),e.sendResults()})}}},{key:"sendResults",value:function(){var e=this.resultsHandler.getResults();this.callback&&this.callback(e),this.resultsHandler=null}},{key:"callStarts",value:function(){this.callsInProgress+=1,this.stop()}},{key:"callFinished",value:function(){this.callsInProgress-=1}},{key:"getId",value:function(){return this.resultsHandler?this.resultsHandler.getId():null}},{key:"crashDisconnect",value:function(){try{this.turnConnection.disconnect()}catch(e){}}},{key:"startTurnTests",value:function(){var e=this;if(this.turnTestCounter>=this.turnTests.length)return new l(function(e,t){e()});var t=this.turnTests[this.turnTestCounter],n=null;switch(t){case d.RTT:n=new o.RttTest(this.turnConnection);break;case d.THROUGHPUT:n=new a.ThroughputTest(this.turnConnection,this.rtt);break;default:return new l(function(e,n){n(new Error("Unknown test: "+t))})}return this.activeTurnTest=n,this.active?n.start().then(function(){return e.handleTestResults(t,n.getResults()),e.turnTestCounter+=1,e.activeTurnTest=null,e.startTurnTests()},function(r){return e.handleTestResults(t,n.getResults(),r),e.turnTestCounter+=1,e.activeTurnTest=null,e.startTurnTests()}):new l(function(e,t){t(new Error("Test trying to start while testing is not active"))})}},{key:"handleTestResults",value:function(e,t){null==(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)&&e==d.RTT&&(this.rtt=t.median),this.resultsHandler&&this.resultsHandler.add(e,t)}}]),e})();t.PreCallTest=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TurnConnection=void 0;var r=(function(){function e(e,t){for(var n=0;n>24;if("rtp"===this.protocol&&n>=0&&n<=2)switch(n){case 0:t="TLS";break;case 1:t="TCP";break;case 2:t="UDP"}return t}},{key:"getString",value:function(){return this.iceCandidateStr}},{key:"getType",value:function(){return this.type}},{key:"isHost",value:function(){return"host"===this.type.toLowerCase()}},{key:"isServerReflexive",value:function(){return"srflx"===this.type.toLowerCase()}},{key:"isPeerReflexive",value:function(){return"prflx"===this.type.toLowerCase()}},{key:"isRelay",value:function(){return"relay"===this.type.toLowerCase()||"relayed"===this.type.toLowerCase()}},{key:"getTypeTransport",value:function(){return this.typeTransport}},{key:"isTypeTransportUdp",value:function(){return"UDP"===this.typeTransport}},{key:"isTypeTransportTcp",value:function(){return"TCP"===this.typeTransport}},{key:"isTypeTransportTls",value:function(){return"TLS"===this.typeTransport}},{key:"getTransport",value:function(){return this.transport}},{key:"isUdp",value:function(){return"udp"===this.transport.toLowerCase()}},{key:"isTcp",value:function(){return"tcp"===this.transport.toLowerCase()}},{key:"getProtocol",value:function(){return this.protocol}},{key:"isRtp",value:function(){return"rtp"===this.protocol}},{key:"isRtcp",value:function(){return"rtcp"===this.protocol}},{key:"isIpv6",value:function(){return this.ipv6}},{key:"getIpAddress",value:function(){return this.ipAddress}},{key:"getPort",value:function(){return this.port}}]),e})();t.ParsedIceCandidate=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GetStatsHandler=void 0;var r=(function(){function e(e,t){for(var n=0;n>24;c.mozLocalTransport=this.formatRelayType(u)}c.mozLocalTransport=c.mozLocalTransport.toLowerCase()}t.push(c)}else s.remoteCandidate&&n.push(s.remoteCandidate)}if(i)for(var l=0;l=this.intervalLength){var r=n-this.intervalStart,i=this.averageThroughput(this.intervalBytes,r),a=null;try{a=n-JSON.parse(this.lastMessage).timestamp}catch(e){}this.intervals.push({startTimestamp:this.intervalStart,endTimestamp:n,bytesReceived:this.intervalBytes,average:i,rtt:a}),this.intervalStart=n,this.intervalBytes=0}this.results.startTimestamp&&n-this.results.startTimestamp>this.duration/2&&(this.secondHalfStart||(this.secondHalfStart=n),this.secondHalfBytes+=e.length)}}},{key:"handleError",value:function(e){this.stop(),this.failed(e)}},{key:"averageThroughput",value:function(e,t){return e/(t/1e3)*8/1024}},{key:"bufferListener",value:function(){this.sendChannel.removeEventListener("bufferedamountlow",this.bufferListener.bind(this)),this.fillBuffer()}},{key:"fillBuffer",value:function(){for(0==this.sendChannel.bufferedAmount&&(this.bufferEmpty+=1);this.isActive();){if(this.sendChannel.bufferedAmount>this.bufferFullThreshold)return void(this.usePolling?setTimeout(this.fillBuffer.bind(this),250):this.sendChannel.addEventListener("bufferedamountlow",this.bufferListener.bind(this)));var e=this.messageMaker.make(this.sentBytes);this.sentBytes+=e.length,this.send(e)}this.sendChannel.removeEventListener("bufferedamountlow",this.bufferListener.bind(this))}},{key:"startSend",value:function(){this.isActive()&&(this.bufferFullThreshold=1e3*this.chunkSize,this.sendChannel=this.connection.sendChannel,this.usePolling=!0,"number"==typeof this.sendChannel.bufferedAmountLowThreshold&&(this.usePolling=!1,this.sendChannel.bufferedAmountLowThreshold=this.bufferFullThreshold/10),setTimeout(this.fillBuffer.bind(this),0))}},{key:"fillResults",value:function(){this.results.endTimestamp=o.getCurrent(),this.results.maxDuration=this.duration,this.results.forceStopped=this.forceStopped,this.results.bufferEmpty=this.bufferEmpty,this.results.intervals=this.intervals,this.results.bytesPrepared=this.sentBytes,this.results.bytesReceived=this.receivedBytes;var e=0,t=0;this.secondHalfStart&&(e=this.results.endTimestamp-this.secondHalfStart,t=this.averageThroughput(this.secondHalfBytes,e));var n=this.results.endTimestamp-this.results.startTimestamp,r=this.averageThroughput(this.receivedBytes,n);r>t&&(t=r),this.results.average=t;var i=null;try{i=JSON.parse(this.lastMessage)}catch(e){return}if(i){var a=i.sentBytes+this.lastMessage.length;this.results.bytesSent=a,this.results.fractionLostBytes=1-this.receivedBytes/a}else this.results.bytesSent=-1,this.results.fractionLostBytes=-1}},{key:"stop",value:function(){this.isActive()&&(clearTimeout(this.sendTimer),this.sendTimer=null,(function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0})(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"stop",this).call(this),this.fillResults())}}]),t})();t.ThroughputTest=c},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof("function"==typeof Symbol?Symbol.iterator:"@@iterator")?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==("function"==typeof Symbol?Symbol.prototype:"@@prototype")?"symbol":typeof e};Object.defineProperty(t,"__esModule",{value:!0}),t.ResultsHandler=void 0;var i="function"==typeof Symbol&&"symbol"==r("function"==typeof Symbol?Symbol.iterator:"@@iterator")?function(e){return void 0===e?"undefined":r(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==("function"==typeof Symbol?Symbol.prototype:"@@prototype")?"symbol":void 0===e?"undefined":r(e)},o=(function(){function e(e,t){for(var n=0;n0&&(P=A-t(m,"bytesSent")))),P=Math.max(0,P);var O=u.timestamp-m.timestamp,D=0,x=0;O>0&&(D=Math.round(8*I/O),x=Math.round(8*P/O)),g.addBitrate({download:D,upload:x});var N={height:null,width:null};try{var L=void 0,M=void 0;(L=t(u,"googFrameHeightReceived"))&&(M=t(u,"googFrameWidthReceived"))?(N.height=L,N.width=M):(L=t(u,"googFrameHeightSent"))&&(M=t(u,"googFrameWidthSent"))&&(N.height=L,N.width=M)}catch(e){}var j=void 0;try{j=t(u,"googFrameRateReceived")||t(u,"googFrameRateSent")||0}catch(e){try{j=this.getNonNegativeStat(u,"framerateMean")}catch(e){}}g.setFramerate(Math.round(j||0)),N.height&&N.width?g.setResolution(N):g.setResolution(null)}}}}var F={download:0,upload:0},U={download:0,upload:0},H=0,B=0,G={},J={},V=0,W=0,q=0,K=0,z=!0,Q=!1,$=void 0;try{for(var X,Y=this.ssrc2stats["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(z=(X=Y.next()).done);z=!0){var Z=X.value,ee=c(Z,2),te=ee[0],ne=ee[1],re=ne.loss,ie=re.isDownloadStream?"download":"upload";F[ie]+=re.packetsTotal,U[ie]+=re.packetsLost,H+=ne.bitrate.download,B+=ne.bitrate.upload;var oe=this.peerconnection.getTrackBySSRC(te);if(oe){oe.isAudioTrack()?(V+=ne.bitrate.download,W+=ne.bitrate.upload):(q+=ne.bitrate.download,K+=ne.bitrate.upload);var ae=oe.getParticipantId();if(ae){var se=ne.resolution;if(se.width&&se.height&&-1!==se.width&&-1!==se.height){var ce=G[ae]||{};ce[te]=se,G[ae]=ce}if(0!==ne.framerate){var ue=J[ae]||{};ue[te]=ne.framerate,J[ae]=ue}}else l.error("No participant ID returned by "+oe)}else this.peerconnection.isP2P&&l.error("JitsiTrack not found for SSRC "+te+" in "+this.peerconnection);ne.resetBitrate()}}catch(e){Q=!0,$=e}finally{try{!z&&Y.return&&Y.return()}finally{if(Q)throw $}}this.eventEmitter.emit(s.c,this.peerconnection,n),this.conferenceStats.bitrate={upload:B,download:H},this.conferenceStats.bitrate.audio={upload:W,download:V},this.conferenceStats.bitrate.video={upload:K,download:q},this.conferenceStats.packetLoss={total:r(U.download+U.upload,F.download+F.upload),download:r(U.download,F.download),upload:r(U.upload,F.upload)},this.eventEmitter.emit(s.d,this.peerconnection,{bandwidth:this.conferenceStats.bandwidth,bitrate:this.conferenceStats.bitrate,packetLoss:this.conferenceStats.packetLoss,resolution:G,framerate:J,transport:this.conferenceStats.transport}),this.conferenceStats.transport=[]}},o.prototype.processAudioLevelReport=function(){if(this.baselineAudioLevelsReport){var e=this._getStatValue;for(var t in this.currentAudioLevelsReport)if(this.currentAudioLevelsReport.hasOwnProperty(t)){var n=this.currentAudioLevelsReport[t];if("ssrc"===n.type||"track"===n.type){var r=this.baselineAudioLevelsReport[t],i=this.getNonNegativeStat(n,"ssrc");if(!i&&Array.isArray(n.ssrcIds)&&(i=Number(n.ssrcIds[0])),r)if(i){var o=void 0;try{o=e(n,"audioInputLevel")||e(n,"audioOutputLevel")}catch(e){return l.warn("Audio Levels are not available in the statistics."),void clearInterval(this.audioLevelsIntervalId)}if(o){var c=void 0;c="ssrc"===n.type?!e(n,"packetsReceived"):!n.remoteSource,a.b.isEdge()?o=o<0?Math.pow(10,o/20):0:o/=32767,this.eventEmitter.emit(s.a,this.peerconnection,i,o,c)}}else Date.now()-n.timestamp<3e3&&l.warn("No ssrc: ");else l.warn(i+" not enough data")}}}}}).call(t,"modules/statistics/RTPStatsCollector.js")},function(e,t,n){var r,i;"function"==typeof Symbol&&"function"==typeof Symbol&&Symbol.iterator,this||window,void 0===(i="function"==typeof(r=function(){function e(){if(0===i.length)return null;var n,l,d,p,h,f=[],m=e.skipStackDepth||1;for(n=0;n0?e(t.slice(t.indexOf(r[0])+r[0].length),n-1):r[1])),i})(d,m),f))&&r&&p===r&&(h=(function(e){var t,n,r=null;for(t=0,n=(e=e||i).length;t0&&i.a.sendLog(JSON.stringify(s))}else o.warn("Received versions not from the focus user: "+e,n);else o.warn("Ignored presence versions node - invalid xmlns",e)},r.prototype.getComponentVersion=function(e){return this.versions[e]}}).call(t,"modules/version/ComponentsVersions.js")},function(e,t,n){"use strict";(function(e){var r=n(31),i=n(7),o=n(0),a=(n.n(o),(function(){function e(e,t){for(var n=0;n0&&(h=o.startBitrate),t.on(i.CONNECTION_INTERRUPTED,function(){a._updateLocalConnectionQuality(0),a.eventEmitter.emit(r.LOCAL_STATS_UPDATED,a._localStats),a._broadcastLocalStats()}),t.room.addListener(s.ICE_CONNECTION_STATE_CHANGED,function(e,t){e.isP2P||"connected"!==t||(a._timeIceConnected=window.performance.now())}),t.on(i.ENDPOINT_MESSAGE_RECEIVED,function(e,t){t.type===d&&a._updateRemoteStats(e.getId(),t.values)}),t.statistics.addConnectionStatsListener(this._updateLocalStats.bind(this)),t.on(i.TRACK_MUTE_CHANGED,function(e){e.isVideoTrack()&&(e.isMuted()?a._timeVideoUnmuted=-1:a._maybeUpdateUnmuteTime())}),t.on(i.TRACK_ADDED,function(e){e.isVideoTrack()&&!e.isMuted()&&a._maybeUpdateUnmuteTime()})}return a(e,[{key:"_maybeUpdateUnmuteTime",value:function(){this._timeVideoUnmuted<0&&(this._timeVideoUnmuted=window.performance.now())}},{key:"_calculateConnectionQuality",value:function(e,t,n){var r=u[n],i=100,o=void 0,a=void 0,s=void 0,d=void 0;if(this._localStats.packetLoss&&(s=this._localStats.packetLoss.upload,t&&(s*=.5)),t||!r||e===c.DESKTOP||this._timeIceConnected<0||this._timeVideoUnmuted<0)void 0===s?(l.error("Cannot calculate connection quality, unknown packet loss."),i=100):i=s<=2?100:s<=4?70:s<=6?50:s<=8?30:s<=12?10:0;else{a=window.performance.now()-Math.max(this._timeVideoUnmuted,this._timeIceConnected);var f=this._conference.getActivePeerConnection();d=(function(e,t,n){if(n<5e3)return 1;var r=0,i=Math.min(t.height,t.width);if(e){var o=p.find(function(e){return e.height<=i});if(o)for(i=o.height;i>=180&&"break"!==(function(){var e=i;if(!(o=p.find(function(t){return t.height===e})))return"break";r+=o.target})();i/=2);}else{var a=t.width*t.height;r=a<=76800?600:a<=307200?1700:a<=518400?2e3:2500}return Math.min(r,(s=Math.max(0,n-1e3))>6e4?Number.MAX_SAFE_INTEGER:h*Math.pow(1.08,s/1e3));var s})(o=Boolean(f&&f.isSimulcastOn()),r,a),d*=.9,i=100*this._localStats.bitrate.upload/d,s&&s>=10&&(i=Math.min(i,30))}if(this._lastConnectionQualityUpdate>0){var m=this._localStats.connectionQuality,v=(window.performance.now()-this._lastConnectionQualityUpdate)/1e3;i=Math.min(i,m+2*v)}var g=Math.min(100,i);return console.debug("calculated connection quality",JSON.stringify({connectionQuality:g,isMuted:t,isSimulcastOn:o,lastUpdate:this._lastConnectionQualityUpdate,millisSinceStart:a,packetLoss:s,resolution:r,target:d,upload:this._localStats.bitrate&&this._localStats.bitrate.upload})),g}},{key:"_updateLocalConnectionQuality",value:function(e){this._localStats.connectionQuality=e,this._lastConnectionQualityUpdate=window.performance.now()}},{key:"_broadcastLocalStats",value:function(){var e={bitrate:this._localStats.bitrate,packetLoss:this._localStats.packetLoss,connectionQuality:this._localStats.connectionQuality,jvbRTT:this._localStats.jvbRTT};try{this._conference.broadcastEndpointMessage({type:d,values:e})}catch(e){}}},{key:"_updateLocalStats",value:function(e,t){if(!e.isP2P){var n=t.transport&&t.transport.length&&t.transport[0].rtt;this._localStats.jvbRTT=n||void 0}if(e===this._conference.getActivePeerConnection()){var i=void 0,o=!this._conference.isConnectionInterrupted(),a=this._conference.getLocalVideoTrack(),s=a?a.videoType:void 0,c=!a||a.isMuted(),u=a?a.resolution:null;c||this._maybeUpdateUnmuteTime();for(i in t)t.hasOwnProperty(i)&&(this._localStats[i]=t[i]);o&&this._updateLocalConnectionQuality(this._calculateConnectionQuality(s,c,u)),this.eventEmitter.emit(r.LOCAL_STATS_UPDATED,this._localStats),this._broadcastLocalStats()}}},{key:"_updateRemoteStats",value:function(e,t){this._remoteStats[e]={bitrate:t.bitrate,packetLoss:t.packetLoss,connectionQuality:t.connectionQuality,jvbRTT:t.jvbRTT},this.eventEmitter.emit(r.REMOTE_STATS_UPDATED,e,this._remoteStats[e])}},{key:"getStats",value:function(){return this._localStats}}]),e})();t.a=f}).call(t,"modules/connectivity/ConnectionQuality.js")},function(e,t,n){"use strict";t.a=function(e){var t=this,n=e.id,o=e.password,a=e.onLoginSuccessful,s=e.roomPassword,c=!1,u=void 0,l=new i.a(this.connection.options),d=new Promise(function(e,i){u=i,l.addListener(r.CONNECTION_DISCONNECTED,function(){l=void 0}),l.addListener(r.CONNECTION_ESTABLISHED,function(){c||(a&&a(),l.createRoom(t.options.name,t.options.config).moderator.authenticate().then(function(){l&&l.disconnect(),c||(t.join(s),e())}).catch(function(e){var t=e.error,n=e.message;l.disconnect(),i({authenticationError:t,message:n})}))}),l.addListener(r.CONNECTION_FAILED,function(e,t,n){i({connectionError:e,credentials:n,message:t}),l=void 0}),c||l.connect(n,o)});return d.cancel=function(){c=!0,u({}),l&&l.disconnect()},d};var r=n(26),i=n(46)},function(e,t,n){var r,i,o;a=function(e){"use strict";e.Strophe.addConnectionPlugin("disco",{_connection:null,_identities:[],_features:[],_items:[],init:function(t){this._connection=t,this._identities=[],this._features=[],this._items=[],t.addHandler(this._onDiscoInfo.bind(this),e.Strophe.NS.DISCO_INFO,"iq","get",null,null),t.addHandler(this._onDiscoItems.bind(this),e.Strophe.NS.DISCO_ITEMS,"iq","get",null,null)},addIdentity:function(e,t,n,r){for(var i=0;ix[xmlns="http://jabber.org/protocol/muc#user"]>status[code="201"]').length&&n.createNonAnonymousRoom(),n.onPresence(e),!0):void 0}},{key:"onPresenceUnavailable",value:function(e){var t=e.getAttribute("from"),n=this.rooms[i.Strophe.getBareJidFromJid(t)];if(n)return n.onPresenceUnavailable(e,t),!0}},{key:"onPresenceError",value:function(e){var t=e.getAttribute("from"),n=this.rooms[i.Strophe.getBareJidFromJid(t)];if(n)return n.onPresenceError(e,t),!0}},{key:"onMessage",value:function(e){var t=e.getAttribute("from"),n=this.rooms[i.Strophe.getBareJidFromJid(t)];if(n)return n.onMessage(e,t),!0}},{key:"onMute",value:function(e){var t=e.getAttribute("from"),n=this.rooms[i.Strophe.getBareJidFromJid(t)];if(n)return n.onMute(e),!0}}]),t})();t.a=function(e){i.Strophe.addConnectionPlugin("emuc",new d(e))}}).call(t,"modules/xmpp/strophe.emuc.js")},function(e,t,n){"use strict";(function(e){function r(e,t){for(var n=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:{};this.presMap.to=this.myroomjid,this.presMap.xns="http://jabber.org/protocol/muc",this.presMap.nodes=[],this.presMap.nodes.push({tagName:"user-agent",value:navigator.userAgent,attributes:{xmlns:"http://jitsi.org/jitmeet/user-agent"}}),e.enableStatsID&&this.presMap.nodes.push({tagName:"stats-id",value:l.a.callStatsUserName}),this.addVideoInfoToPresence(!1),e.deploymentInfo&&e.deploymentInfo.userRegion&&this.presMap.nodes.push({tagName:"region",attributes:{id:e.deploymentInfo.userRegion,xmlns:"http://jitsi.org/jitsi-meet"}})}},{key:"updateDeviceAvailability",value:function(e){this.presMap.nodes.push({tagName:"devices",children:[{tagName:"audio",value:e.audio},{tagName:"video",value:e.video}]})}},{key:"join",value:function(e){var t=this;this.password=e,this.moderator.allocateConferenceFocus(function(){return t.sendPresence(!0)})}},{key:"sendPresence",value:function(e){var t=this.presMap.to;if(t&&(this.joined||e)){var n=Object(o.$pres)({to:t});e&&(n.c("x",{xmlns:this.presMap.xns}),this.password&&n.c("password").t(this.password).up(),n.up()),b.json2packet(this.presMap.nodes,n),this.connection.send(n),e&&this.connection.flush()}}},{key:"doLeave",value:function(){y.log("do leave",this.myroomjid);var e=Object(o.$pres)({to:this.myroomjid,type:"unavailable"});this.presMap.length=0,this.connection.flush(),this.connection.send(e),this.connection.flush()}},{key:"discoRoomInfo",value:function(){var e=this,t=Object(o.$iq)({type:"get",to:this.roomjid}).c("query",{xmlns:o.Strophe.NS.DISCO_INFO});this.connection.sendIQ(t,function(t){var n=1===$(t).find('>query>feature[var="muc_passwordprotected"]').length;n!==e.locked&&(e.eventEmitter.emit(h.a.MUC_LOCK_CHANGED,n),e.locked=n)},function(e){s.a.callErrorHandler(e),y.error("Error getting room info: ",e)})}},{key:"createNonAnonymousRoom",value:function(){var e=Object(o.$iq)({type:"get",to:this.roomjid}).c("query",{xmlns:"http://jabber.org/protocol/muc#owner"}).c("x",{xmlns:"jabber:x:data",type:"submit"}),t=this;this.connection.sendIQ(e,function(e){if(!$(e).find('>query>x[xmlns="jabber:x:data"]>field[var="muc#roomconfig_whois"]').length){var n="non-anonymous rooms not supported";return s.a.callErrorHandler(new Error(n)),void y.error(n)}var r=Object(o.$iq)({to:t.roomjid,type:"set"}).c("query",{xmlns:"http://jabber.org/protocol/muc#owner"});r.c("x",{xmlns:"jabber:x:data",type:"submit"}),r.c("field",{var:"FORM_TYPE"}).c("value").t("http://jabber.org/protocol/muc#roomconfig").up().up(),r.c("field",{var:"muc#roomconfig_whois"}).c("value").t("anyone").up().up(),t.connection.sendIQ(r)},function(e){s.a.callErrorHandler(e),y.error("Error getting room configuration form: ",e)})}},{key:"onPresence",value:function(e){var t=e.getAttribute("from"),n={};n.show=$(e).find(">show").text();var r=$(e).find(">status");r.length&&(n.status=r.text());var i=!1,a=$(e).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>item');n.affiliation=a.attr("affiliation"),n.role=a.attr("role");var s=a.attr("jid");n.jid=s,n.isFocus=s&&0===s.indexOf(this.moderator.getFocusUserJid()+"/"),n.isHiddenDomain=s&&s.indexOf("@")>0&&this.options.hiddenDomain===s.substring(s.indexOf("@")+1,s.indexOf("/")),$(e).find(">x").remove();var c=[];b.packet2JSON(e,c),this.lastPresences[t]=c;for(var u=null,l=0;l0&&this.eventEmitter.emit(h.a.DISPLAY_NAME_CHANGED,t,S)}break;case"bridgeNotAvailable":n.isFocus&&!this.noBridgeAvailable&&(this.noBridgeAvailable=!0,this.eventEmitter.emit(h.a.BRIDGE_DOWN));break;case"jibri-recording-status":u=g;break;case"transcription-status":var _=g.attributes;if(!_)break;var T=_.status;T&&T!==this.transcriptionStatus&&(this.transcriptionStatus=T,this.eventEmitter.emit(h.a.TRANSCRIPTION_STATUS_CHANGED,T));break;case"call-control":var C=g.attributes;if(!C)break;this.phoneNumber=C.phone||null,this.phonePin=C.pin||null,this.eventEmitter.emit(h.a.PHONE_NUMBER_CHANGED);break;default:this.processNode(g,t)}}i&&this.eventEmitter.emit(h.a.PRESENCE_STATUS,t,n.status),u&&(this.lastJibri=u,this.recording&&this.recording.handleJibriPresence(u))}},{key:"_initFocus",value:function(e,t){this.focusMucJid=e,this.recording||(this.recording=new m.a(this.options.recordingType,this.eventEmitter,this.connection,this.focusMucJid,this.options.jirecon,this.roomjid),this.lastJibri&&this.recording.handleJibriPresence(this.lastJibri)),y.info("Ignore focus: "+e+", real JID: "+t)}},{key:"setParticipantPropertyListener",value:function(e){this.participantPropertyListener=e}},{key:"processNode",value:function(e,t){try{var n=this.presHandlers[e.tagName];e.tagName.startsWith("jitsi_participant_")&&(n=[this.participantPropertyListener]),n&&n.forEach(function(n){n(e,o.Strophe.getResourceFromJid(t),t)})}catch(t){s.a.callErrorHandler(t),y.error("Error processing:"+e.tagName+" node.",t)}}},{key:"sendMessage",value:function(e,t){var n=Object(o.$msg)({to:this.roomjid,type:"groupchat"});n.c("body",e).up(),t&&n.c("nick",{xmlns:"http://jabber.org/protocol/nick"}).t(t).up().up(),this.connection.send(n),this.eventEmitter.emit(h.a.SENDING_CHAT_MESSAGE,e)}},{key:"sendPrivateMessage",value:function(e,t,n){var r=Object(o.$msg)({to:this.roomjid+"/"+e,type:"chat"});r.c("body",t).up(),n&&r.c("nick",{xmlns:"http://jabber.org/protocol/nick"}).t(n).up().up(),this.connection.send(r),this.eventEmitter.emit(h.a.SENDING_PRIVATE_CHAT_MESSAGE,t)}},{key:"setSubject",value:function(e){var t=Object(o.$msg)({to:this.roomjid,type:"groupchat"});t.c("subject",e),this.connection.send(t)}},{key:"onParticipantLeft",value:function(e,t){delete this.lastPresences[e],t||(this.eventEmitter.emit(h.a.MUC_MEMBER_LEFT,e),this.moderator.onMucMemberLeft(e))}},{key:"onPresenceUnavailable",value:function(e,t){var n=this;if($(e).find('>ignore[xmlns="http://jitsi.org/jitmeet/"]').length)return!0;if($(e).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>destroy').length){var r=void 0,i=$(e).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>destroy>reason');return i.length&&(r=i.text()),this.eventEmitter.emit(h.a.MUC_DESTROYED,r),this.connection.emuc.doLeave(this.roomjid),!0}var o=$(e).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>status[code="110"]').length,a=$(e).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>status[code="307"]').length,s=Object.keys(this.members);o?s.length>0&&(s.forEach(function(e){var t=n.members[e];delete n.members[e],n.onParticipantLeft(e,t.isFocus)}),this.connection.emuc.doLeave(this.roomjid),a||this.eventEmitter.emit(h.a.MUC_LEFT)):(delete this.members[t],this.onParticipantLeft(t,!1)),a&&this.myroomjid===t&&this.eventEmitter.emit(h.a.KICKED)}},{key:"onMessage",value:function(e,t){var n=$(e).find('>nick[xmlns="http://jabber.org/protocol/nick"]').text()||o.Strophe.getResourceFromJid(t),r=$(e).find(">body").text(),i=e.getAttribute("type");if("error"===i)return this.eventEmitter.emit(h.a.CHAT_ERROR_RECEIVED,$(e).find(">text").text(),r),!0;var a=$(e).find(">subject");if(a.length){var s=a.text();(s||""===s)&&(this.eventEmitter.emit(h.a.SUBJECT_CHANGED,s),y.log("Subject is changed to "+s))}var c=$(e).find(">delay").attr("stamp");if(!c&&(c=$(e).find('>[xmlns="jabber:x:delay"]').attr("stamp"))){var u=c.match(/(\d{4})(\d{2})(\d{2}T\d{2}:\d{2}:\d{2})/);c=u[1]+"-"+u[2]+"-"+u[3]+"Z"}t===this.roomjid&&$(e).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>status[code="104"]').length&&this.discoRoomInfo();var l=(function(e){try{var t=JSON.parse(e);if(t&&"object"===(void 0===t?"undefined":g(t))){var n=t[S[0]],r=t[S[1]];if(("string"==typeof n||n instanceof String)&&r)return t;y.debug("parsing valid json but does not have correct structure","topic: ",n,"payload: ",r)}}catch(e){return!1}return!1})(r);l?this.eventEmitter.emit(h.a.JSON_MESSAGE_RECEIVED,t,l):r&&("chat"===i&&(y.log("privatechat",n,r),this.eventEmitter.emit(h.a.PRIVATE_MESSAGE_RECEIVED,t,n,r,this.myroomjid,c)),"groupchat"===i&&(y.log("chat",n,r),this.eventEmitter.emit(h.a.MESSAGE_RECEIVED,t,n,r,this.myroomjid,c)))}},{key:"onPresenceError",value:function(e,t){$(e).find('>error[type="auth"]>not-authorized[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]').length?(y.log("on password required",t),this.eventEmitter.emit(h.a.PASSWORD_REQUIRED)):$(e).find('>error[type="cancel"]>not-allowed[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]').length?o.Strophe.getDomainFromJid(e.getAttribute("to"))===this.xmpp.options.hosts.anonymousdomain?this.eventEmitter.emit(h.a.ROOM_JOIN_ERROR):(y.warn("onPresError ",e),this.eventEmitter.emit(h.a.ROOM_CONNECT_NOT_ALLOWED_ERROR)):$(e).find(">error>service-unavailable").length?(y.warn("Maximum users limit for the room has been reached",e),this.eventEmitter.emit(h.a.ROOM_MAX_USERS_ERROR)):(y.warn("onPresError ",e),this.eventEmitter.emit(h.a.ROOM_CONNECT_ERROR))}},{key:"kick",value:function(e){var t=Object(o.$iq)({to:this.roomjid,type:"set"}).c("query",{xmlns:"http://jabber.org/protocol/muc#admin"}).c("item",{nick:o.Strophe.getResourceFromJid(e),role:"none"}).c("reason").t("You have been kicked.").up().up().up();this.connection.sendIQ(t,function(t){return y.log("Kick participant with jid: ",e,t)},function(e){return y.log("Kick participant error: ",e)})}},{key:"lockRoom",value:function(e,t,n,r){var i=this;this.connection.sendIQ(Object(o.$iq)({to:this.roomjid,type:"get"}).c("query",{xmlns:"http://jabber.org/protocol/muc#owner"}),function(a){if($(a).find('>query>x[xmlns="jabber:x:data"]>field[var="muc#roomconfig_roomsecret"]').length){var s=Object(o.$iq)({to:i.roomjid,type:"set"}).c("query",{xmlns:"http://jabber.org/protocol/muc#owner"});s.c("x",{xmlns:"jabber:x:data",type:"submit"}),s.c("field",{var:"FORM_TYPE"}).c("value").t("http://jabber.org/protocol/muc#roomconfig").up().up(),s.c("field",{var:"muc#roomconfig_roomsecret"}).c("value").t(e).up().up(),s.c("field",{var:"muc#roomconfig_whois"}).c("value").t("anyone").up().up(),i.connection.sendIQ(s,t,n)}else r()},n)}},{key:"addToPresence",value:function(e,t){t.tagName=e,this.removeFromPresence(e),this.presMap.nodes.push(t)}},{key:"removeFromPresence",value:function(e){var t=this.presMap.nodes.filter(function(t){return e!==t.tagName});this.presMap.nodes=t}},{key:"addPresenceListener",value:function(e,t){if("function"!=typeof t)throw new Error('"handler" is not a function');var n=this.presHandlers[e];n||(this.presHandlers[e]=n=[]),-1===n.indexOf(t)?n.push(t):y.warn("Trying to add the same handler more than once for: "+e)}},{key:"removePresenceListener",value:function(e,t){var n=this.presHandlers[e],r=n?n.indexOf(t):-1;-1!==r?n.splice(r,1):y.warn("Handler for: "+e+" was not registered")}},{key:"isFocus",value:function(e){var t=this.members[e];return t?t.isFocus:null}},{key:"isModerator",value:function(){return"moderator"===this.role}},{key:"getMemberRole",value:function(e){return this.members[e]?this.members[e].role:null}},{key:"setVideoMute",value:function(e,t){this.sendVideoInfoPresence(e),t&&t(e)}},{key:"setAudioMute",value:function(e,t){return this.sendAudioInfoPresence(e,t)}},{key:"addAudioInfoToPresence",value:function(e){this.removeFromPresence("audiomuted"),this.addToPresence("audiomuted",{attributes:{xmlns:"http://jitsi.org/jitmeet/audio"},value:e.toString()})}},{key:"sendAudioInfoPresence",value:function(e,t){this.addAudioInfoToPresence(e),this.connection&&this.sendPresence(),t&&t()}},{key:"addVideoInfoToPresence",value:function(e){this.removeFromPresence("videomuted"),this.addToPresence("videomuted",{attributes:{xmlns:"http://jitsi.org/jitmeet/video"},value:e.toString()})}},{key:"sendVideoInfoPresence",value:function(e){this.addVideoInfoToPresence(e),this.connection&&this.sendPresence()}},{key:"getMediaPresenceInfo",value:function(e,t){var n=this.lastPresences[this.roomjid+"/"+e];if(!n)return null;var i={muted:!1,videoType:void 0},o=null;if(t===d.a)o=r(n,"audiomuted");else{if(t!==d.b)return y.error("Unsupported media type: "+t),null;o=r(n,"videomuted");var a=r(n,"videoType");a.length>0&&(i.videoType=a[0].value)}return i.muted=o.length>0&&"true"===o[0].value,i}},{key:"isRecordingSupported",value:function(){return!!this.recording&&this.recording.isSupported()}},{key:"getRecordingState",value:function(){return this.recording?this.recording.getState():void 0}},{key:"getRecordingURL",value:function(){return this.recording?this.recording.getURL():null}},{key:"toggleRecording",value:function(e,t){return this.recording?this.recording.toggleRecording(e,t):t("error",new Error("The conference is not created yet!"))}},{key:"isSIPCallingSupported",value:function(){return!!this.moderator&&this.moderator.isSipGatewayEnabled()}},{key:"dial",value:function(e){return this.connection.rayo.dial(e,"fromnumber",o.Strophe.getBareJidFromJid(this.myroomjid),this.password,this.focusMucJid)}},{key:"hangup",value:function(){return this.connection.rayo.hangup()}},{key:"getPhoneNumber",value:function(){return this.phoneNumber}},{key:"getPhonePin",value:function(){return this.phonePin}},{key:"muteParticipant",value:function(e,t){y.info("set mute",t);var n=Object(o.$iq)({to:this.focusMucJid,type:"set"}).c("mute",{xmlns:"http://jitsi.org/jitmeet/audio",jid:e}).t(t.toString()).up();this.connection.sendIQ(n,function(e){return y.log("set mute",e)},function(e){return y.log("set mute error",e)})}},{key:"onMute",value:function(e){if(e.getAttribute("from")===this.focusMucJid){var t=$(e).find("mute");t.length&&"true"===t.text()?this.eventEmitter.emit(h.a.AUDIO_MUTED_BY_FOCUS):y.warn("Ignoring a mute request which does not explicitly specify a positive mute command.")}else y.warn("Ignored mute from non focus peer")}},{key:"leave",value:function(){var e=this;return new Promise(function(t,n){function r(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];o.removeListener(h.a.MUC_LEFT,r),clearTimeout(i),e?n(new Error("The timeout for the confirmation about leaving the room expired.")):t()}var i=setTimeout(function(){return r(!0)},5e3),o=e.eventEmitter;o.on(h.a.MUC_LEFT,r),e.doLeave()})}}]),t})();t.a=_}).call(t,"modules/xmpp/ChatRoom.js")},function(e,t,n){"use strict";(function(e){function r(e){var t=1;return function(n){if(!n){var r=Math.pow(2,t-1);return t+=1,r*e}t=1}}function i(e,t,n,i){function o(e){if(e.data&&e.data.sessionId){if(e.origin!==window.location.origin)return void c.warn("Ignoring sessionId from different origin: "+e.origin);s.a.sessionId=e.data.sessionId}}this.roomName=e,this.xmppService=t,this.getNextTimeout=r(1e3),this.getNextErrorTimeout=r(1e3),this.externalAuthEnabled=!1,this.options=i,this.sipGatewayEnabled=this.options.connection.hosts&&void 0!==this.options.connection.hosts.call_control,this.eventEmitter=n,this.connection=this.xmppService.connection,window.addEventListener?window.addEventListener("message",o,!1):window.attachEvent("onmessage",o)}t.a=i;var o=n(2),a=(n.n(o),n(1)),s=n(23),c=n(0).getLogger(e),u=n(8),l=n(49),d=n(3);i.prototype.isExternalAuthEnabled=function(){return this.externalAuthEnabled},i.prototype.isSipGatewayEnabled=function(){return this.sipGatewayEnabled},i.prototype.onMucMemberLeft=function(e){c.info("Someone left is it focus ? "+e),"focus"===o.Strophe.getResourceFromJid(e)&&(c.info("Focus has left the room - leaving conference"),this.eventEmitter.emit(u.FOCUS_LEFT))},i.prototype.setFocusUserJid=function(e){this.focusUserJid||(this.focusUserJid=e,c.info("Focus jid set to: "+this.focusUserJid))},i.prototype.getFocusUserJid=function(){return this.focusUserJid},i.prototype.getFocusComponent=function(){var e=this.options.connection.hosts.focus;return e||(e="focus."+this.options.connection.hosts.domain),e},i.prototype.createConferenceIq=function(){var e=Object(o.$iq)({to:this.getFocusComponent(),type:"set"}),t=s.a.sessionId,n=s.a.machineId;c.info("Session ID: "+t+" machine UID: "+n),e.c("conference",{xmlns:"http://jitsi.org/protocol/focus",room:this.roomName,"machine-uid":n}),t&&e.attrs({"session-id":t}),void 0!==this.options.connection.enforcedBridge&&e.c("property",{name:"enforcedBridge",value:this.options.connection.enforcedBridge}).up(),void 0!==this.options.connection.hosts&&void 0!==this.options.connection.hosts.call_control&&e.c("property",{name:"call_control",value:this.options.connection.hosts.call_control}).up(),void 0!==this.options.conference.channelLastN&&e.c("property",{name:"channelLastN",value:this.options.conference.channelLastN}).up(),e.c("property",{name:"disableRtx",value:Boolean(this.options.conference.disableRtx)}).up(),e.c("property",{name:"enableLipSync",value:!1!==this.options.connection.enableLipSync}).up(),void 0!==this.options.conference.audioPacketDelay&&e.c("property",{name:"audioPacketDelay",value:this.options.conference.audioPacketDelay}).up(),this.options.conference.startBitrate&&e.c("property",{name:"startBitrate",value:this.options.conference.startBitrate}).up(),this.options.conference.minBitrate&&e.c("property",{name:"minBitrate",value:this.options.conference.minBitrate}).up();var r=void 0;switch(this.options.conference.openBridgeChannel){case"datachannel":case!0:case void 0:r=!0;break;case"websocket":r=!1}return r&&!a.b.supportsDataChannels()&&(r=!1),e.c("property",{name:"openSctp",value:r}).up(),void 0!==this.options.conference.startAudioMuted&&e.c("property",{name:"startAudioMuted",value:this.options.conference.startAudioMuted}).up(),void 0!==this.options.conference.startVideoMuted&&e.c("property",{name:"startVideoMuted",value:this.options.conference.startVideoMuted}).up(),void 0!==this.options.conference.stereo&&e.c("property",{name:"stereo",value:this.options.conference.stereo}).up(),void 0!==this.options.conference.useRoomAsSharedDocumentName&&e.c("property",{name:"useRoomAsSharedDocumentName",value:this.options.conference.useRoomAsSharedDocumentName}).up(),e.up(),e},i.prototype.parseSessionId=function(e){var t=$(e).find("conference").attr("session-id");t&&(c.info("Received sessionId: "+t),s.a.sessionId=t)},i.prototype.parseConfigOptions=function(e){this.setFocusUserJid($(e).find("conference").attr("focusjid"));var t=$(e).find(">conference>property[name='authentication'][value='true']").length>0;c.info("Authentication enabled: "+t),this.externalAuthEnabled=$(e).find(">conference>property[name='externalAuth'][value='true']").length>0,c.info("External authentication enabled: "+this.externalAuthEnabled),this.externalAuthEnabled||this.parseSessionId(e);var n=$(e).find(">conference").attr("identity");this.eventEmitter.emit(l.IDENTITY_UPDATED,t,n),$(e).find(">conference>property[name='sipGatewayEnabled'][value='true']").length&&(this.sipGatewayEnabled=!0),c.info("Sip gateway enabled: "+this.sipGatewayEnabled)},i.prototype.allocateConferenceFocus=function(e){var t=this;this.setFocusUserJid(this.options.connection.focusUserJid),this.connection.sendIQ(this.createConferenceIq(),function(n){return t._allocateConferenceFocusSuccess(n,e)},function(n){return t._allocateConferenceFocusError(n,e)}),this.connection.flush()},i.prototype._allocateConferenceFocusError=function(e,t){var n=this,r=$(e).find(">error>session-invalid").length||$(e).find(">error>not-acceptable").length;if(r&&(c.info("Session expired! - removing"),s.a.sessionId=void 0),$(e).find(">error>graceful-shutdown").length)this.eventEmitter.emit(u.GRACEFUL_SHUTDOWN);else{var i=$(e).find(">error>reservation-error");if(i.length){var a=i.attr("error-code"),l=$(e).find(">error>text"),p=void 0;return l&&(p=l.text()),void this.eventEmitter.emit(u.RESERVATION_ERROR,a,p)}if($(e).find(">error>not-authorized").length)return c.warn("Unauthorized to start the conference",e),o.Strophe.getDomainFromJid(e.getAttribute("to"))!==this.options.connection.hosts.anonymousdomain&&(this.externalAuthEnabled=!0),void this.eventEmitter.emit(u.AUTHENTICATION_REQUIRED);var h=this.getNextErrorTimeout(),f="Focus error, retry after "+h;d.callErrorHandler(new Error(f)),c.error(f,e);var m=this.getFocusComponent(),v=h/1e3;r||this.eventEmitter.emit(u.FOCUS_DISCONNECTED,m,v),this.getNextTimeout(!0),window.setTimeout(function(){return n.allocateConferenceFocus(t)},h)}},i.prototype._allocateConferenceFocusSuccess=function(e,t){var n=this;if(this.parseConfigOptions(e),this.getNextErrorTimeout(!0),"true"===$(e).find("conference").attr("ready"))this.getNextTimeout(!0),t();else{var r=this.getNextTimeout();c.info("Waiting for the focus... "+r),window.setTimeout(function(){return n.allocateConferenceFocus(t)},r)}},i.prototype.authenticate=function(){var e=this;return new Promise(function(t,n){e.connection.sendIQ(e.createConferenceIq(),function(n){e.parseSessionId(n),t()},function(e){return n({error:$(e).find("iq>error :first").prop("tagName"),message:$(e).find("iq>error>text").text()})})})},i.prototype.getLoginUrl=function(e,t){this._getLoginUrl(!1,e,t)},i.prototype._getLoginUrl=function(e,t,n){function r(e,t){d.callErrorHandler(new Error(e)),c.error(e,t),n(t)}var i=Object(o.$iq)({to:this.getFocusComponent(),type:"get"}),a={xmlns:"http://jitsi.org/protocol/focus",room:this.roomName,"machine-uid":s.a.machineId},u="auth url";e&&(a.popup=!0,u="POPUP "+u),i.c("login-url",a),this.connection.sendIQ(i,function(e){var n=$(e).find("login-url").attr("url");(n=decodeURIComponent(n))?(c.info("Got "+u+": "+n),t(n)):r("Failed to get "+u+" from the focus",e)},r.bind(void 0,"Get "+u+" error"))},i.prototype.getPopupLoginUrl=function(e,t){this._getLoginUrl(!0,e,t)},i.prototype.logout=function(e){var t=Object(o.$iq)({to:this.getFocusComponent(),type:"set"}),n=s.a.sessionId;n?(t.c("logout",{xmlns:"http://jitsi.org/protocol/focus","session-id":n}),this.connection.sendIQ(t,function(t){var n=$(t).find("logout").attr("logout-url");n&&(n=decodeURIComponent(n)),c.info("Log out OK, url: "+n,t),s.a.sessionId=void 0,e(n)},function(e){d.callErrorHandler(new Error("Logout error")),c.error("Logout error",e)})):e()}}).call(t,"modules/xmpp/moderator.js")},function(e,t,n){"use strict";(function(e){t.a=function(e,t,n){o.Strophe.addConnectionPlugin("jingle",new g(e,t,n))};var r=n(6),i=n(0),o=(n.n(i),n(2)),a=(n.n(o),n(8)),s=n.n(a),c=n(3),u=n.n(c),l=n(19),d=n.n(l),p=n(5),h=n(106),f=n(22),m=(function(){function e(e,t){for(var n=0;nstartmuted");if(f&&f.length>0){var m=f.attr("audio"),g=f.attr("video");this.eventEmitter.emit(s.a.START_MUTED_FROM_FOCUS,"true"===m,"true"===g)}v.info("Marking session from "+i+" as "+(d?"":"*not*")+" P2P"),c=new h.a($(e).find("jingle").attr("sid"),$(e).attr("to"),i,this.connection,this.mediaConstraints,d?this.p2pIceConfig:this.jvbIceConfig,d,!1,this.xmpp.options),this.sessions[c.sid]=c,this.eventEmitter.emit(s.a.CALL_INCOMING,c,$(e).find(">jingle"),l);break;case"session-accept":this.eventEmitter.emit(s.a.CALL_ACCEPTED,c,$(e).find(">jingle"));break;case"content-modify":c.modifyContents($(e).find(">jingle"));break;case"transport-info":this.eventEmitter.emit(s.a.TRANSPORT_INFO,c,$(e).find(">jingle"));break;case"session-terminate":v.log("terminating...",c.sid);var y=null,b=null;$(e).find(">jingle>reason").length&&(y=$(e).find(">jingle>reason>:first")[0].tagName,b=$(e).find(">jingle>reason>text").text()),this.terminate(c.sid,y,b),this.eventEmitter.emit(s.a.CALL_ENDED,c,y,b);break;case"transport-replace":v.info("(TIME) Start transport replace",l),p.a.sendAnalytics(Object(r.z)(r.e,{p2p:d,value:l})),c.replaceTransport($(e).find(">jingle"),function(){var e=window.performance.now();v.info("(TIME) Transport replace success!",e),p.a.sendAnalytics(Object(r.z)(r.f,{p2p:d,value:e}))},function(e){u.a.callErrorHandler(e),v.error("Transport replace failed",e),c.sendTransportReject()});break;case"addsource":case"source-add":c.addRemoteStream($(e).find(">jingle>content"));break;case"removesource":case"source-remove":c.removeRemoteStream($(e).find(">jingle>content"));break;default:v.warn("jingle action not implemented",n),a.attrs({type:"error"}),a.c("error",{type:"cancel"}).c("bad-request",{xmlns:"urn:ietf:params:xml:ns:xmpp-stanzas"}).up()}return this.connection.send(a),!0}},{key:"newP2PJingleSession",value:function(e,t){var n=new h.a(d.a.randomHexString(12),e,t,this.connection,this.mediaConstraints,this.p2pIceConfig,!0,!0,this.xmpp.options);return this.sessions[n.sid]=n,n}},{key:"terminate",value:function(e,t,n){this.sessions.hasOwnProperty(e)&&("ended"!==this.sessions[e].state&&this.sessions[e].onTerminated(t,n),delete this.sessions[e])}},{key:"getStunAndTurnCredentials",value:function(){var e=this;this.connection.sendIQ(Object(o.$iq)({type:"get",to:this.connection.domain}).c("services",{xmlns:"urn:xmpp:extdisco:1"}).c("service",{host:"turn."+this.connection.domain}),function(t){var n=[];$(t).find(">services>service").each(function(e,t){var r={},i=(t=$(t)).attr("type");switch(i){case"stun":r.url="stun:"+t.attr("host"),t.attr("port")&&(r.url+=":"+t.attr("port")),n.push(r);break;case"turn":case"turns":r.url=i+":";var o=t.attr("username");if(o){var a=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);a&&parseInt(a[2],10)<28?r.url+=o+"@":r.username=o}r.url+=t.attr("host");var s=t.attr("port");s&&"3478"!==s&&(r.url+=":"+t.attr("port"));var c=t.attr("transport");c&&"udp"!==c&&(r.url+="?transport="+c),r.credential=t.attr("password")||r.credential,n.push(r)}});var r=e.xmpp.options;r.useStunTurn&&(e.jvbIceConfig.iceServers=n),r.p2p&&r.p2p.useStunTurn&&(e.p2pIceConfig.iceServers=n)},function(e){v.warn("getting turn credentials failed",e),v.warn("is mod_turncredentials or similar installed?")})}},{key:"getLog",value:function(){var e=this,t={};return Object.keys(this.sessions).forEach(function(n){var r=e.sessions[n].peerconnection;r&&r.updateLog&&(t["jingle_"+n]={updateLog:r.updateLog,stats:r.stats,url:window.location.href})}),t}}]),t})()}).call(t,"modules/xmpp/strophe.jingle.js")},function(e,t,n){"use strict";(function(e){var r=n(6),i=n(107),o=n.n(i),a=n(0),s=(n.n(a),n(2)),c=(n.n(s),n(108)),u=(n.n(c),n(109)),l=n(52),d=n(53),p=n(110),h=n(14),f=n(111),m=n(5),v=n(8),g=n.n(v),y=n(3),b=n.n(y),S=(function(){function e(e,t){for(var n=0;ncontent[name="video"]');if(t.length){var n=t[0].getAttribute("senders");if("both"===n||"initiator"===n||"responder"===n||"none"===n)return n}return null}}]),S(t,[{key:"_assertNotEnded",value:function(e){return this.state!==l.b||(_.log("The session has ended - cancelling action: "+e),!1)}},{key:"doInitialize",value:function(){var e=this;this.lasticecandidate=!1,this.isReconnect=!1,this.wasstable=!1;var t={disableRtx:this.room.options.disableRtx};if(this.isP2P){t.disableSimulcast=!0,t.disableH264=this.room.options.p2p&&this.room.options.p2p.disableH264,t.preferH264=this.room.options.p2p&&this.room.options.p2p.preferH264;var n=this._abtestSuspendVideoEnabled();void 0!==n&&(t.abtestSuspendVideo=n)}else t.disableSimulcast=this.room.options.disableSimulcast||this.room.options.preferH264&&!this.room.options.disableH264,t.preferH264=this.room.options.preferH264,t.enableFirefoxSimulcast=this.room.options.testing&&this.room.options.testing.enableFirefoxSimulcast;this.peerconnection=this.rtc.createPeerConnection(this.signalingLayer,this.iceConfig,this.isP2P,t),this.peerconnection.onicecandidate=function(t){if(t){var n=t.candidate,i=window.performance.now();if(n){null===e._gatheringStartedTimestamp&&(e._gatheringStartedTimestamp=i);var o=n.protocol;if("string"==typeof o)if("tcp"===(o=o.toLowerCase())||"ssltcp"===o){if(e.webrtcIceTcpDisable)return}else if("udp"===o&&e.webrtcIceUdpDisable)return}else e._gatheringReported||(m.a.sendAnalytics(r.m,{phase:"gathering",value:i-e._gatheringStartedTimestamp,p2p:e.isP2P,initiator:e.isInitiator}),e._gatheringReported=!0);e.sendIceCandidate(n)}},this.peerconnection.onsignalingstatechange=function(){e.peerconnection&&("stable"===e.peerconnection.signalingState?e.wasstable=!0:"closed"!==e.peerconnection.signalingState&&"closed"!==e.peerconnection.connectionState||e.closed||e.room.eventEmitter.emit(g.a.SUSPEND_DETECTED,e))},this.peerconnection.oniceconnectionstatechange=function(){if(e.peerconnection&&e._assertNotEnded("oniceconnectionstatechange")){var t=window.performance.now();switch(e.isP2P||(e.room.connectionTimes["ice.state."+e.peerconnection.iceConnectionState]=t),_.log("(TIME) ICE "+e.peerconnection.iceConnectionState+" P2P? "+e.isP2P+":\t",t),m.a.sendAnalytics(r.o,{p2p:e.isP2P,state:e.peerconnection.iceConnectionState,signaling_state:e.peerconnection.signalingState,reconnect:e.isReconnect,value:t}),e.room.eventEmitter.emit(g.a.ICE_CONNECTION_STATE_CHANGED,e,e.peerconnection.iceConnectionState),e.peerconnection.iceConnectionState){case"checking":e._iceCheckingStartedTimestamp=t;break;case"connected":if("stable"===e.peerconnection.signalingState&&e.isReconnect&&e.room.eventEmitter.emit(g.a.CONNECTION_RESTORED,e),!e.wasConnected&&e.wasstable){m.a.sendAnalytics(r.m,{phase:"checking",value:t-e._iceCheckingStartedTimestamp,p2p:e.isP2P,initiator:e.isInitiator});var n=Math.min(e._iceCheckingStartedTimestamp,e._gatheringStartedTimestamp);e.establishmentDuration=t-n,m.a.sendAnalytics(r.m,{phase:"establishment",value:e.establishmentDuration,p2p:e.isP2P,initiator:e.isInitiator}),e.wasConnected=!0,e.room.eventEmitter.emit(g.a.CONNECTION_ESTABLISHED,e)}e.isReconnect=!1;break;case"disconnected":if(e.closed)break;e.isReconnect=!0,e.wasstable&&e.room.eventEmitter.emit(g.a.CONNECTION_INTERRUPTED,e);break;case"failed":e.room.eventEmitter.emit(g.a.CONNECTION_ICE_FAILED,e),e.room.eventEmitter.emit(g.a.CONFERENCE_SETUP_FAILED,e,new Error("ICE fail"))}}},this.peerconnection.onnegotiationneeded=function(){e.room.eventEmitter.emit(g.a.PEERCONNECTION_READY,e)},this.signalingLayer.setChatRoom(this.room)}},{key:"sendIceCandidate",value:function(e){var t=this,n=new d.a(this.peerconnection.localDescription.sdp);if(e&&!this.lasticecandidate){var r=h.a.iceparams(n.media[e.sdpMLineIndex],n.session),i=h.a.candidateToJingle(e.candidate);if(!r||!i){var o="failed to get ice && jcand";return b.a.callErrorHandler(new Error(o)),void _.error(o)}r.xmlns="urn:xmpp:jingle:transports:ice-udp:1",this.usedrip?(0===this.dripContainer.length&&setTimeout(function(){0!==t.dripContainer.length&&(t.sendIceCandidates(t.dripContainer),t.dripContainer=[])},20),this.dripContainer.push(e)):this.sendIceCandidates([e])}else _.log("sendIceCandidate: last candidate."),this.lasticecandidate=!0}},{key:"sendIceCandidates",value:function(e){var t=this;if(this._assertNotEnded("sendIceCandidates")){_.log("sendIceCandidates",e);for(var n=Object(s.$iq)({to:this.remoteJid,type:"set"}).c("jingle",{xmlns:"urn:xmpp:jingle:1",action:"transport-info",initiator:this.initiator,sid:this.sid}),r=new d.a(this.peerconnection.localDescription.sdp),i=0;i0){var s=h.a.iceparams(r.media[i],r.session);s.xmlns="urn:xmpp:jingle:transports:ice-udp:1",n.c("content",{creator:t.initiator===t.localJid?"initiator":"responder",name:o[0].sdpMid?o[0].sdpMid:a.media}).c("transport",s);for(var c=0;ccontent>transport>candidate").each(function(e,t){var r=h.a.candidateFromJingle(t);r=r.replace("\r\n","").replace("a=","");var i=new RTCIceCandidate({sdpMLineIndex:0,sdpMid:"",candidate:r});n.push(i)}),n.length?(_.debug("Queued add ("+n.length+") ICE candidates task..."),this.modificationQueue.push(function(e){var r=!0,i=!1,o=void 0;try{for(var a,s=n["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(r=(a=s.next()).done);r=!0){var c=a.value;t.peerconnection.addIceCandidate(c,function(){_.debug("addIceCandidate ok!")},function(e){_.error("addIceCandidate failed!",e)})}}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}e()})):_.error("No ICE candidates to add ?",e[0]&&e[0].outerHTML)}else _.warn("Ignored add ICE candidate when in closed state")}},{key:"readSsrcInfo",value:function(e){var t=this;$(e).find('>description>source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]').each(function(e,n){var r=Number(n.getAttribute("ssrc"));t.isP2P?t.signalingLayer.setSSRCOwner(r,s.Strophe.getResourceFromJid(t.remoteJid)):$(n).find('>ssrc-info[xmlns="http://jitsi.org/jitmeet"]').each(function(e,n){var i=n.getAttribute("owner");i&&i.length&&(isNaN(r)||r<0?_.warn("Invalid SSRC "+r+" value received for "+i):t.signalingLayer.setSSRCOwner(r,s.Strophe.getResourceFromJid(i)))})})}},{key:"generateRecvonlySsrc",value:function(){this.peerconnection?this.peerconnection.generateRecvonlySsrc():_.error("Unable to generate recvonly SSRC - no peerconnection")}},{key:"acceptOffer",value:function(e,t,n,r){var i=this;this.setOfferAnswerCycle(e,function(){i.sendSessionAccept(t,n)},n,r)}},{key:"invite",value:function(e){var t=this;if(!this.isInitiator)throw new Error("Trying to invite from the responder session");this.modificationQueue.push(function(n){var r=!0,i=!1,o=void 0;try{for(var a,s=e["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(r=(a=s.next()).done);r=!0){var c=a.value;t.peerconnection.addTrack(c)}}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}t.peerconnection.createOffer(function(e){t.peerconnection.setLocalDescription(e,function(){t.sendSessionInitiate(t.peerconnection.localDescription.sdp),n()},function(t){_.error("Failed to set local SDP",t,e),n(t)})},function(e){_.error("Failed to create an offer",e,t.mediaConstraints),n(e)},t.mediaConstraints)},function(e){e?_.error("invite error",e):_.debug("invite executed - OK")})}},{key:"sendSessionInitiate",value:function(e){var t=Object(s.$iq)({to:this.remoteJid,type:"set"}).c("jingle",{xmlns:"urn:xmpp:jingle:1",action:"session-initiate",initiator:this.initiator,sid:this.sid});new d.a(e).toJingle(t,this.initiator===this.me?"initiator":"responder"),t=t.tree(),_.info("Session-initiate: ",t),this.connection.sendIQ(t,function(){_.info('Got RESULT for "session-initiate"')},function(e){_.error('"session-initiate" error',e)},1e4)}},{key:"setAnswer",value:function(e){if(!this.isInitiator)throw new Error("Trying to set an answer on the responder session");this.setOfferAnswerCycle(e,function(){_.info("setAnswer - succeeded")},function(e){_.error("setAnswer failed: ",e)})}},{key:"setOfferAnswerCycle",value:function(e,n,r,i){var o=this;this.modificationQueue.push(function(n){if(i){var r=!0,a=!1,s=void 0;try{for(var c,u=i["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(r=(c=u.next()).done);r=!0){var p=c.value;o.peerconnection.addTrack(p)}}catch(e){a=!0,s=e}finally{try{!r&&u.return&&u.return()}finally{if(a)throw s}}}var h=o._processNewJingleOfferIq(e),f=o.peerconnection.localDescription.sdp;o._renegotiate(h.raw).then(function(){if(o.state===l.c&&(o.state=l.a,o.isP2P&&!o._localVideoActive&&o.sendContentModify(o._localVideoActive)),f){var e=new d.a(o.peerconnection.localDescription.sdp);o.notifyMySSRCUpdate(new d.a(f),e)}n()},function(e){_.error("Error renegotiating after setting new remote "+(o.isInitiator?"answer: ":"offer: ")+e,h),t.onJingleFatalError(o,e),n(e)})},function(e){e?r(e):n()})}},{key:"replaceTransport",value:function(e,t,n){var r=this;this.room.eventEmitter.emit(g.a.ICE_RESTARTING,this);var i=e.clone();e.find(">content[name='data']").remove(),this.setOfferAnswerCycle(e,function(){r.setOfferAnswerCycle(i,function(){var e=new d.a(r.peerconnection.localDescription.sdp);r.sendTransportAccept(e,t,n)},n)},n)}},{key:"sendSessionAccept",value:function(e,t){var n=this,r=new d.a(this.peerconnection.localDescription.sdp),i=Object(s.$iq)({to:this.remoteJid,type:"set"}).c("jingle",{xmlns:"urn:xmpp:jingle:1",action:"session-accept",initiator:this.initiator,responder:this.responder,sid:this.sid});this.webrtcIceTcpDisable&&(r.removeTcpCandidates=!0),this.webrtcIceUdpDisable&&(r.removeUdpCandidates=!0),this.failICE&&(r.failICE=!0),r.toJingle(i,this.initiator===this.localJid?"initiator":"responder",null),i=i.tree(),_.info("Sending session-accept",i),this.connection.sendIQ(i,e,this.newJingleErrorHandler(i,function(e){t(e),n.room.eventEmitter.emit(g.a.SESSION_ACCEPT_TIMEOUT,n)}),1e4)}},{key:"sendContentModify",value:function(e){var t=e?"both":"none",n=Object(s.$iq)({to:this.remoteJid,type:"set"}).c("jingle",{xmlns:"urn:xmpp:jingle:1",action:"content-modify",initiator:this.initiator,sid:this.sid}).c("content",{name:"video",senders:t});_.info("Sending content-modify, video senders: "+t),this.connection.sendIQ(n,null,this.newJingleErrorHandler(n),1e4)}},{key:"sendTransportAccept",value:function(e,t,n){var r=this,i=Object(s.$iq)({to:this.remoteJid,type:"set"}).c("jingle",{xmlns:"urn:xmpp:jingle:1",action:"transport-accept",initiator:this.initiator,sid:this.sid});e.media.forEach(function(t,n){var o=h.a.parseMLine(t.split("\r\n")[0]);i.c("content",{creator:r.initiator===r.localJid?"initiator":"responder",name:o.media}),e.transportToJingle(n,i),i.up()}),i=i.tree(),_.info("Sending transport-accept: ",i),this.connection.sendIQ(i,t,this.newJingleErrorHandler(i,n),1e4)}},{key:"sendTransportReject",value:function(e,t){var n=Object(s.$iq)({to:this.remoteJid,type:"set"}).c("jingle",{xmlns:"urn:xmpp:jingle:1",action:"transport-reject",initiator:this.initiator,sid:this.sid});n=n.tree(),_.info("Sending 'transport-reject",n),this.connection.sendIQ(n,e,this.newJingleErrorHandler(n,t),1e4)}},{key:"terminate",value:function(e,t,n){if(this.state!==l.b){if(!n||Boolean(n.sendSessionTerminate)){var r=Object(s.$iq)({to:this.remoteJid,type:"set"}).c("jingle",{xmlns:"urn:xmpp:jingle:1",action:"session-terminate",initiator:this.initiator,sid:this.sid}).c("reason").c(n&&n.reason||"success");n&&n.reasonDescription&&r.up().c("text").t(n.reasonDescription),r=r.tree(),_.info("Sending session-terminate",r),this.connection.sendIQ(r,e,this.newJingleErrorHandler(r,t),1e4)}else _.info("Skipped sending session-terminate for "+this);this.connection.jingle.terminate(this.sid)}}},{key:"onTerminated",value:function(e,t){this.state=l.b,this.establishmentDuration=void 0,_.info("Session terminated "+this,e,t),this.close()}},{key:"_parseSsrcInfoFromSourceAdd",value:function(e,t){var n=[];return $(e).each(function(e,r){var i=$(r).attr("name"),o="";$(r).find('ssrc-group[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]').each(function(){var e=this.getAttribute("semantics"),t=$(this).find(">source").map(function(){return this.getAttribute("ssrc")}).get();t.length&&(o+="a=ssrc-group:"+e+" "+t.join(" ")+"\r\n")}),$(r).find('source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]').each(function(){var e=$(this).attr("ssrc");t.containsSSRC(e)?_.warn("Source-add request for existing SSRC: "+e):$(this).find(">parameter").each(function(){o+="a=ssrc:"+e+" "+$(this).attr("name"),$(this).attr("value")&&$(this).attr("value").length&&(o+=":"+$(this).attr("value")),o+="\r\n"})}),t.media.forEach(function(e,t){h.a.findLine(e,"a=mid:"+i)&&(n[t]||(n[t]=""),n[t]+=o)})}),n}},{key:"addRemoteStream",value:function(e){this._addOrRemoveRemoteStream(!0,e)}},{key:"removeRemoteStream",value:function(e){this._addOrRemoveRemoteStream(!1,e)}},{key:"_addOrRemoveRemoteStream",value:function(e,t){var n=this,r=e?"addRemoteStream":"removeRemoteStream";e&&this.readSsrcInfo(t),this.modificationQueue.push(function(i){if(!n.peerconnection.localDescription||!n.peerconnection.localDescription.sdp){var o=r+" - localDescription not ready yet";return _.error(o),void i(o)}_.log("Processing "+r),_.log("ICE connection state: ",n.peerconnection.iceConnectionState);var a=new d.a(n.peerconnection.localDescription.sdp),s=new d.a(n.peerconnection.remoteDescription.sdp),c=e?n._parseSsrcInfoFromSourceAdd(t,s):n._parseSsrcInfoFromSourceRemove(t,s),u=e?n._processRemoteAddSource(c):n._processRemoteRemoveSource(c);n._renegotiate(u.raw).then(function(){var e=new d.a(n.peerconnection.localDescription.sdp);_.log(r+" - OK, SDPs: ",a,e),n.notifyMySSRCUpdate(a,e),i()},function(e){_.error(r+" failed:",e),i(e)})})}},{key:"_processQueueTasks",value:function(e,t){e(t)}},{key:"_processNewJingleOfferIq",value:function(e){var t=new d.a("");return this.webrtcIceTcpDisable&&(t.removeTcpCandidates=!0),this.webrtcIceUdpDisable&&(t.removeUdpCandidates=!0),this.failICE&&(t.failICE=!0),t.fromJingle(e),this.readSsrcInfo($(e).find(">content")),t}},{key:"_processRemoteRemoveSource",value:function(e){var t=new d.a(this.peerconnection.remoteDescription.sdp);return e.forEach(function(e,n){(e=e.split("\r\n")).pop(),e.forEach(function(e){t.media[n]=t.media[n].replace(e+"\r\n","")})}),t.raw=t.session+t.media.join(""),t}},{key:"_processRemoteAddSource",value:function(e){var t=new d.a(this.peerconnection.remoteDescription.sdp);return e.forEach(function(e,n){t.media[n]+=e}),t.raw=t.session+t.media.join(""),t}},{key:"_renegotiate",value:function(e){var t=this,n=e||this.peerconnection.remoteDescription.sdp;if(!n)return Promise.reject("Can not renegotiate without remote description,- current state: "+this.state);var r=new RTCSessionDescription({type:this.isInitiator?"answer":"offer",sdp:n});return new Promise(function(e,n){"closed"!==t.peerconnection.signalingState?t.isInitiator?t._initiatorRenegotiate(r,e,n):t._responderRenegotiate(r,e,n):n("Attempted to renegotiate in state closed")})}},{key:"_responderRenegotiate",value:function(e,t,n){var r=this;_.debug("Renegotiate: setting remote description"),this.peerconnection.setRemoteDescription(e,function(){_.debug("Renegotiate: creating answer"),r.peerconnection.createAnswer(function(e){_.debug("Renegotiate: setting local description"),r.peerconnection.setLocalDescription(e,function(){t()},function(e){n("setLocalDescription failed: "+e)})},function(e){return n("createAnswer failed: "+e)},r.mediaConstraints)},function(e){return n("setRemoteDescription failed: "+e)})}},{key:"_initiatorRenegotiate",value:function(e,t,n){var r=this;"have-local-offer"===this.peerconnection.signalingState?(_.debug("Renegotiate: setting remote description"),this.peerconnection.setRemoteDescription(e,function(){r._initiatorRenegotiate(e,t,n)},function(e){return n("setRemoteDescription failed: "+e)})):(_.debug("Renegotiate: creating offer"),this.peerconnection.createOffer(function(i){_.debug("Renegotiate: setting local description"),r.peerconnection.setLocalDescription(i,function(){_.debug("Renegotiate: setting remote description"),r.peerconnection.setRemoteDescription(e,function(){t()},function(e){return n("setRemoteDescription failed: "+e)})},function(e){n("setLocalDescription failed: ",e)})},function(e){return n("createOffer failed: "+e)},this.mediaConstraints))}},{key:"replaceTrack",value:function(e,t){var n=this;this.modificationQueue.push(function(r){if("closed"===n.peerconnection.signalingState||"closed"===n.peerconnection.connectionState||n.closed)r();else{var i=n.peerconnection.localDescription.sdp;!e&&t&&t.isVideoTrack()?n.peerconnection.clearRecvonlySsrc():e&&e.isVideoTrack()&&!t&&(n.peerconnection.clearRecvonlySsrc(),n.peerconnection.generateRecvonlySsrc()),e&&n.peerconnection.removeTrack(e),t&&n.peerconnection.addTrack(t),(e||t)&&n.state===l.a?n._renegotiate().then(function(){var e=new d.a(n.peerconnection.localDescription.sdp);n.notifyMySSRCUpdate(new d.a(i),e),r()},r):r()}},function(e){e?_.error("Replace track error:",e):_.info("Replace track done!")})}},{key:"_parseSsrcInfoFromSourceRemove",value:function(e,t){var n=[];return $(e).each(function(e,r){var i=$(r).attr("name"),o="";$(r).find('ssrc-group[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]').each(function(){var e=this.getAttribute("semantics"),t=$(this).find(">source").map(function(){return this.getAttribute("ssrc")}).get();t.length&&(o+="a=ssrc-group:"+e+" "+t.join(" ")+"\r\n")});var a=[];$(r).find('source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]').each(function(){var e=$(this).attr("ssrc");a.push(e)}),t.media.forEach(function(e,t){h.a.findLine(e,"a=mid:"+i)&&(n[t]||(n[t]=""),a.forEach(function(r){var i=h.a.findLines(e,"a=ssrc:"+r);i.length&&(n[t]+=i.join("\r\n")+"\r\n")}),n[t]+=o)})}),n}},{key:"_verifyNoSSRCChanged",value:function(e,t){var n=new d.a(this.peerconnection.localDescription.sdp),r=new p.a(t,n),i=r.getNewMedia();if(Object.keys(i).length)return _.error(this+" - some SSRC were added on "+e,i),!1;var o=(r=new p.a(n,t)).getNewMedia();return!Object.keys(o).length||(_.error(this+" - some SSRCs were removed on "+e,o),!1)}},{key:"addTrackAsUnmute",value:function(e){return this._addRemoveTrackAsMuteUnmute(!1,e)}},{key:"removeTrackAsMute",value:function(e){return this._addRemoveTrackAsMuteUnmute(!0,e)}},{key:"_addRemoveTrackAsMuteUnmute",value:function(e,t){var n=this;if(!t)return Promise.reject('invalid "track" argument value');var r=e?"removeTrackMute":"addTrackUnmute",i=(function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t})(function(i){var o=n.peerconnection;if(o){var a=o.localDescription.sdp;(e?o.removeTrackMute.bind(o,t):o.addTrackUnmute.bind(o,t))()?a&&o.remoteDescription.sdp?n._renegotiate().then(function(){n._verifyNoSSRCChanged(r,new d.a(a)),i()},i):i():i(r+" failed!")}else i("Error: tried "+r+" track with no active peerconnection")});return new Promise(function(e,t){n.modificationQueue.push(i,function(n){n?t(n):e()})})}},{key:"setMediaTransferActive",value:function(e,t){var n=this;if(!this.peerconnection)return Promise.reject('Can not modify transfer active state, before "initialize" is called');var r=e?"audio active":"audio inactive",i=t?"video active":"video inactive";_.info("Queued make "+i+", "+r+" task...");var o=function(r){var i=n.state===l.a,o=n.peerconnection.setAudioTransferActive(e);n._localVideoActive!==t&&(n._localVideoActive=t,n.isP2P&&i&&n.sendContentModify(t));var a=n.peerconnection.setVideoTransferActive(n._localVideoActive&&n._remoteVideoActive);i&&(o||a)?n._renegotiate().then(r,r):r()};return new Promise(function(e,t){n.modificationQueue.push(o,function(n){n?t(n):e()})})}},{key:"modifyContents",value:function(e){var n=this,r=t.parseVideoSenders(e);null!==r?(_.debug(this+' queued "content-modify" task(video senders="'+r+'")'),this.modificationQueue.push(function(e){n._assertNotEnded("content-modify")&&n._modifyRemoteVideoActive(r)?n._renegotiate().then(e,e):e()},function(e){e&&_.error('"content-modify" failed',e)})):_.error(this+' - failed to parse video "senders" attribute in"content-modify" action')}},{key:"_modifyRemoteVideoActive",value:function(e){var t="both"===e||"initiator"===e&&this.isInitiator||"responder"===e&&!this.isInitiator;return t!==this._remoteVideoActive&&(_.debug(this+" new remote video active: "+t),this._remoteVideoActive=t),this.peerconnection.setVideoTransferActive(this._localVideoActive&&this._remoteVideoActive)}},{key:"notifyMySSRCUpdate",value:function(e,t){if(this.state===l.a){var n=new p.a(t,e),r=Object(s.$iq)({to:this.remoteJid,type:"set"}).c("jingle",{xmlns:"urn:xmpp:jingle:1",action:"source-remove",initiator:this.initiator,sid:this.sid});n.toJingle(r)?(_.info("Sending source-remove",r.tree()),this.connection.sendIQ(r,null,this.newJingleErrorHandler(r),1e4)):_.log("removal not necessary"),n=new p.a(e,t);var i=Object(s.$iq)({to:this.remoteJid,type:"set"}).c("jingle",{xmlns:"urn:xmpp:jingle:1",action:"source-add",initiator:this.initiator,sid:this.sid});n.toJingle(i)?(_.info("Sending source-add",i.tree()),this.connection.sendIQ(i,null,this.newJingleErrorHandler(i),1e4)):_.log("addition not necessary")}else _.warn("Skipping SSRC update in '"+this.state+" ' state.")}},{key:"newJingleErrorHandler",value:function(e,t){var n=this;return function(e){var r={},i=$(e).find("error");if(i.length){r.code=i.attr("code");var o=$(e).find("error :first");o.length&&(r.reason=o[0].tagName);var a=i.find(">text");a.length&&(r.msg=a.text())}e||(r.reason="timeout"),r.session=n.toString(),t?t(r):n.state===l.b&&"item-not-found"===r.reason?_.debug("Jingle error: "+JSON.stringify(r)):b.a.callErrorHandler(new Error("Jingle error: "+JSON.stringify(r)))}}},{key:"getIceConnectionState",value:function(){return this.peerconnection.iceConnectionState}},{key:"close",value:function(){this.closed=!0,this.signalingLayer.setChatRoom(null),this.peerconnection&&(this.peerconnection.signalingState&&"closed"!==this.peerconnection.signalingState||this.peerconnection.connectionState&&"closed"!==this.peerconnection.connectionState)&&this.peerconnection.close()}},{key:"toString",value:function(){return"JingleSessionPC[p2p="+this.isP2P+",initiator="+this.isInitiator+",sid="+this.sid+"]"}},{key:"_abtestSuspendVideoEnabled",value:function(){if(this.room.options.abTesting&&this.room.options.abTesting.enableSuspendVideoTest){var e=this._getInitiatorJid();return Object(c.integerHash)(e)%2==0}}}],[{key:"onJingleFatalError",value:function(e,t){this.room&&(this.room.eventEmitter.emit(g.a.CONFERENCE_SETUP_FAILED,e,t),this.room.eventEmitter.emit(g.a.JINGLE_FATAL_ERROR,e,t))}}]),t})();t.a=T}).call(t,"modules/xmpp/JingleSessionPC.js")},function(e,t,n){(function(n,r){var i;!(function(){function o(e){var t=!1;return function(){if(t)throw new Error("Callback was already called.");t=!0,e.apply(a,arguments)}}var a,s,c={};null!=(a=this)&&(s=a.async),c.noConflict=function(){return a.async=s,c};var u=Object.prototype.toString,l=Array.isArray||function(e){return"[object Array]"===u.call(e)},d=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n=e.length&&n()}if(n=n||function(){},!e.length)return n();var i=0;d(e,function(e){t(e,o(r))})},c.forEach=c.each,c.eachSeries=function(e,t,n){if(n=n||function(){},!e.length)return n();var r=0;!(function i(){t(e[r],function(t){t?(n(t),n=function(){}):(r+=1)>=e.length?n():i()})})()},c.forEachSeries=c.eachSeries,c.eachLimit=function(e,t,n,r){f(t).apply(null,[e,n,r])},c.forEachLimit=c.eachLimit;var f=function(e){return function(t,n,r){if(r=r||function(){},!t.length||e<=0)return r();var i=0,o=0,a=0;!(function s(){if(i>=t.length)return r();for(;a=t.length?r():s())})})()}},m=function(e){return function(){var t=Array.prototype.slice.call(arguments);return e.apply(null,[c.each].concat(t))}},v=function(e){return function(){var t=Array.prototype.slice.call(arguments);return e.apply(null,[c.eachSeries].concat(t))}},g=function(e,t,n,r){if(t=p(t,function(e,t){return{index:t,value:e}}),r){var i=[];e(t,function(e,t){n(e.value,function(n,r){i[e.index]=r,t(n)})},function(e){r(e,i)})}else e(t,function(e,t){n(e.value,function(e){t(e)})})};c.map=m(g),c.mapSeries=v(g),c.mapLimit=function(e,t,n,r){return y(t)(e,n,r)};var y=function(e){return t=e,n=g,function(){var e=Array.prototype.slice.call(arguments);return n.apply(null,[f(t)].concat(e))};var t,n};c.reduce=function(e,t,n,r){c.eachSeries(e,function(e,r){n(t,e,function(e,n){t=n,r(e)})},function(e){r(e,t)})},c.inject=c.reduce,c.foldl=c.reduce,c.reduceRight=function(e,t,n,r){var i=p(e,function(e){return e}).reverse();c.reduce(i,t,n,r)},c.foldr=c.reduceRight;var b=function(e,t,n,r){var i=[];e(t=p(t,function(e,t){return{index:t,value:e}}),function(e,t){n(e.value,function(n){n&&i.push(e),t()})},function(e){r(p(i.sort(function(e,t){return e.index-t.index}),function(e){return e.value}))})};c.filter=m(b),c.filterSeries=v(b),c.select=c.filter,c.selectSeries=c.filterSeries;var S=function(e,t,n,r){var i=[];e(t=p(t,function(e,t){return{index:t,value:e}}),function(e,t){n(e.value,function(n){n||i.push(e),t()})},function(e){r(p(i.sort(function(e,t){return e.index-t.index}),function(e){return e.value}))})};c.reject=m(S),c.rejectSeries=v(S);var _=function(e,t,n,r){e(t,function(e,t){n(e,function(n){n?(r(e),r=function(){}):t()})},function(e){r()})};c.detect=m(_),c.detectSeries=v(_),c.some=function(e,t,n){c.each(e,function(e,r){t(e,function(e){e&&(n(!0),n=function(){}),r()})},function(e){n(!1)})},c.any=c.some,c.every=function(e,t,n){c.each(e,function(e,r){t(e,function(e){e||(n(!1),n=function(){}),r()})},function(e){n(!0)})},c.all=c.every,c.sortBy=function(e,t,n){c.map(e,function(e,n){t(e,function(t,r){t?n(t):n(null,{value:e,criteria:r})})},function(e,t){if(e)return n(e);n(null,p(t.sort(function(e,t){var n=e.criteria,r=t.criteria;return nr?1:0}),function(e){return e.value}))})},c.auto=function(e,t){t=t||function(){};var n=h(e),r=n.length;if(!r)return t();var i={},o=[],a=function(e){o.unshift(e)},s=function(){r--,d(o.slice(0),function(e){e()})};a(function(){if(!r){var e=t;t=function(){},e(null,i)}}),d(n,function(n){var r=l(e[n])?e[n]:[e[n]],u=function(e){var r=Array.prototype.slice.call(arguments,1);if(r.length<=1&&(r=r[0]),e){var o={};d(h(i),function(e){o[e]=i[e]}),o[n]=r,t(e,o),t=function(){}}else i[n]=r,c.setImmediate(s)},p=r.slice(0,Math.abs(r.length-1))||[],f=function(){return t=function(e,t){return e&&i.hasOwnProperty(t)},r=!0,((e=p).reduce?e.reduce(t,r):(d(e,function(e,n,i){r=t(r,e)}),r))&&!i.hasOwnProperty(n);var e,t,r};f()?r[r.length-1](u,i):a(function e(){f()&&((function(e){for(var t=0;t>>1);n(t,e[o])>=0?r=o:i=o-1}return r})(e.tasks,o,n)+1,0,o),e.saturated&&e.tasks.length===e.concurrency&&e.saturated(),c.setImmediate(e.process)})})(r,e,t,i)},delete r.unshift,r},c.cargo=function(e,t){var n=!1,r=[],i={tasks:r,payload:t,saturated:null,empty:null,drain:null,drained:!0,push:function(e,n){l(e)||(e=[e]),d(e,function(e){r.push({data:e,callback:"function"==typeof n?n:null}),i.drained=!1,i.saturated&&r.length===t&&i.saturated()}),c.setImmediate(i.process)},process:function o(){if(!n){if(0===r.length)return i.drain&&!i.drained&&i.drain(),void(i.drained=!0);var a="number"==typeof t?r.splice(0,t):r.splice(0,r.length),s=p(a,function(e){return e.data});i.empty&&i.empty(),n=!0,e(s,function(){n=!1;var e=arguments;d(a,function(t){t.callback&&t.callback.apply(null,e)}),o()})}},length:function(){return r.length},running:function(){return n}};return i};var E=function(e){return function(t){var n=Array.prototype.slice.call(arguments,1);t.apply(null,n.concat([function(t){var n=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(t?console.error&&console.error(t):console[e]&&d(n,function(t){console[e](t)}))}]))}};c.log=E("log"),c.dir=E("dir"),c.memoize=function(e,t){var n={},r={};t=t||function(e){return e};var i=function(){var i=Array.prototype.slice.call(arguments),o=i.pop(),a=t.apply(null,i);a in n?c.nextTick(function(){o.apply(null,n[a])}):a in r?r[a].push(o):(r[a]=[o],e.apply(null,i.concat([function(){n[a]=arguments;var e=r[a];delete r[a];for(var t=0,i=e.length;t2?n.apply(this,Array.prototype.slice.call(arguments,2)):n};c.applyEach=m(w),c.applyEachSeries=v(w),c.forever=function(e,t){!(function n(r){if(r){if(t)return t(r);throw r}e(n)})()},void 0!==e&&e.exports?e.exports=c:void 0===(i=function(){return c}.apply(t,[]))||(e.exports=i)})()}).call(t,n(34),n(40).setImmediate)},function(e,t){e.exports={integerHash:function(e){if(!e)return 0;var t=0,n=void 0;for(n=0;n1&&void 0!==arguments[1]?arguments[1]:1e4;if(this.intervalId){var r="Ping task scheduled already";return a.a.callErrorHandler(new Error(r)),void u.error(r)}this.intervalId=window.setInterval(function(){t.ping(e,function(){t.failedPings=0},function(e){t.failedPings+=1;var n="Ping "+(e?"error":"timeout");t.failedPings>=3?(a.a.callErrorHandler(new Error(n)),u.error(n,e)):u.warn(n,e)},15e3)},n),u.info("XMPP pings will be sent every "+n+" ms")}},{key:"stopInterval",value:function(){this.intervalId&&(window.clearInterval(this.intervalId),this.intervalId=null,this.failedPings=0,u.info("Ping interval cleared"))}},{key:"_addPingExecutionTimestamp",value:function(){this.pingExecIntervals.push((new Date).getTime()),this.pingExecIntervals.length>l&&this.pingExecIntervals.shift()}},{key:"getPingSuspendTime",value:function(){var e=this.pingExecIntervals.slice();e.push((new Date).getTime());var t=0,n=e[0];return e.forEach(function(e){var r=e-n;r>t&&(t=r),n=e}),t-=1e4,Math.max(t,0)}}]),t})();t.a=function(e){i.Strophe.addConnectionPlugin("ping",new d(e))}}).call(t,"modules/xmpp/strophe.ping.js")},function(e,t,n){"use strict";(function(e){var r=n(0),i=(n.n(r),n(2)),o=(n.n(i),n(22)),a=(function(){function e(e,t){for(var n=0;nt[r]?1:e[r]0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"http://jitsi.org/jitsimeet";!(function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this);var r=(function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t})(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(r.node=n,r.disco=e.disco,!r.disco)throw new Error("Missing strophe-plugins (disco plugin is required)!");r.versionToCapabilities=Object.create(null),r.jidToVersion=Object.create(null),r.version="",r.rooms=new Set;var o=e.emuc;return o.addListener(a.a.EMUC_ROOM_ADDED,function(e){return r._addChatRoom(e)}),o.addListener(a.a.EMUC_ROOM_REMOVED,function(e){return r._removeChatRoom(e)}),Object.keys(o.rooms).forEach(function(e){r._addChatRoom(o.rooms[e])}),i.Strophe.addNamespace("CAPS","http://jabber.org/protocol/caps"),r.disco.addFeature(i.Strophe.NS.CAPS),e.addHandler(r._handleCaps.bind(r),i.Strophe.NS.CAPS),r._onMucMemberLeft=r._removeJidToVersionEntry.bind(r),r}return(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)})(t,s.a),c(t,[{key:"addFeature",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.disco.addFeature(e),this._generateVersion(),t&&this.submit()}},{key:"removeFeature",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.disco.removeFeature(e),this._generateVersion(),t&&this.submit()}},{key:"submit",value:function(){this.rooms.forEach(function(e){return e.sendPresence()})}},{key:"getFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3,r=e in this.jidToVersion?this.jidToVersion[e]:null;if(!(r&&r.version in this.versionToCapabilities)){var i=r?r.node+"#"+r.version:null;return new Promise(function(o,a){return t.disco.info(e,i,function(e){var n=new Set;$(e).find(">query>feature").each(function(e,t){return n.add(t.getAttribute("var"))}),r&&(t.versionToCapabilities[r.version]=n),o(n)},a,n)})}return Promise.resolve(this.versionToCapabilities[r.version])}},{key:"_addChatRoom",value:function(e){this.rooms.add(e),e.addListener(a.a.MUC_MEMBER_LEFT,this._onMucMemberLeft),this._fixChatRoomPresenceMap(e)}},{key:"_removeChatRoom",value:function(e){this.rooms.delete(e),e.removeListener(a.a.MUC_MEMBER_LEFT,this._onMucMemberLeft)}},{key:"_fixChatRoomPresenceMap",value:function(e){e.addToPresence("c",{attributes:{xmlns:i.Strophe.NS.CAPS,hash:"sha-1",node:this.node,ver:this.version}})}},{key:"_notifyVersionChanged",value:function(){var e=this;this.rooms.forEach(function(t){return e._fixChatRoomPresenceMap(t)}),this.submit()}},{key:"_generateVersion",value:function(){var e=this.disco._identities.sort(r).reduce(function(e,t){return u.reduce(function(e,n,r){return e+(0===r?"":"/")+t[n]},"")+"<"},""),t=this.disco._features.sort().reduce(function(e,t){return e+t+"<"},"");this.version=Object(i.b64_sha1)(e+t),this._notifyVersionChanged()}},{key:"_handleCaps",value:function(e){var t=e.getAttribute("from"),n=e.querySelector("c"),r=n.getAttribute("ver"),i=n.getAttribute("node"),o=this.jidToVersion[t];return this.jidToVersion[t]={version:r,node:i},o&&o.version!==r&&this.eventEmitter.emit(a.a.PARTCIPANT_FEATURES_CHANGED,t),!0}},{key:"_removeJidToVersionEntry",value:function(e){e in this.jidToVersion&&delete this.jidToVersion[e]}}]),t})();t.a=d},function(e,t,n){"use strict";(function(e){function r(e){this.conference=e,e.on(p.TRACK_MUTE_CHANGED,function(t){if(t.isLocal()&&e.statistics){var n=t.isP2P?e.p2pJingleSession:e.jvbJingleSession,r=n&&n.peerconnection||null;e.statistics.sendMuteEvent(r,t.isMuted(),t.getType())}})}t.a=r;var i=n(2),o=(n.n(i),n(6)),a=n(49),s=n.n(a),c=n(119),u=n.n(c),l=n(0),d=(n.n(l),n(32)),p=n(7),h=n(4),f=n(9),m=n.n(f),v=n(13),g=n.n(v),y=n(5),b=n(8),S=n.n(b),_=Object(l.getLogger)(e);r.prototype.setupChatRoomListeners=function(){var e=this,t=this.conference,n=t.room;this.chatRoomForwarder=new u.a(n,this.conference.eventEmitter),n.addListener(S.a.ICE_RESTARTING,function(e){e.isP2P||t.rtc.closeBridgeChannel()}),n.addListener(S.a.AUDIO_MUTED_BY_FOCUS,function(){y.a.sendAnalytics(Object(o.C)()),t.rtc.setAudioMute(!0).then(function(){t.isMutedByFocus=!0},function(){return _.warn("Error while audio muting due to focus request")})}),this.chatRoomForwarder.forward(S.a.SUBJECT_CHANGED,p.SUBJECT_CHANGED),this.chatRoomForwarder.forward(S.a.MUC_JOINED,p.CONFERENCE_JOINED),n.addListener(S.a.MUC_JOINED,function(){e.conference.isJvbConnectionInterrupted=!1,Object.keys(n.connectionTimes).forEach(function(e){var t=Object(o.w)("conference_"+e,{value:n.connectionTimes[e]});y.a.sendAnalytics(t)}),Object.keys(n.xmpp.connectionTimes).forEach(function(e){var t=Object(o.w)("xmpp_"+e,{value:n.xmpp.connectionTimes[e]});y.a.sendAnalytics(t)})}),this.chatRoomForwarder.forward(S.a.ROOM_JOIN_ERROR,p.CONFERENCE_FAILED,d.CONNECTION_ERROR),this.chatRoomForwarder.forward(S.a.ROOM_CONNECT_ERROR,p.CONFERENCE_FAILED,d.CONNECTION_ERROR),this.chatRoomForwarder.forward(S.a.ROOM_CONNECT_NOT_ALLOWED_ERROR,p.CONFERENCE_FAILED,d.NOT_ALLOWED_ERROR),this.chatRoomForwarder.forward(S.a.ROOM_MAX_USERS_ERROR,p.CONFERENCE_FAILED,d.CONFERENCE_MAX_USERS),this.chatRoomForwarder.forward(S.a.PASSWORD_REQUIRED,p.CONFERENCE_FAILED,d.PASSWORD_REQUIRED),this.chatRoomForwarder.forward(S.a.AUTHENTICATION_REQUIRED,p.CONFERENCE_FAILED,d.AUTHENTICATION_REQUIRED),this.chatRoomForwarder.forward(S.a.BRIDGE_DOWN,p.CONFERENCE_FAILED,d.VIDEOBRIDGE_NOT_AVAILABLE),n.addListener(S.a.BRIDGE_DOWN,function(){return y.a.sendAnalytics(Object(o.u)())}),this.chatRoomForwarder.forward(S.a.RESERVATION_ERROR,p.CONFERENCE_FAILED,d.RESERVATION_ERROR),this.chatRoomForwarder.forward(S.a.GRACEFUL_SHUTDOWN,p.CONFERENCE_FAILED,d.GRACEFUL_SHUTDOWN),n.addListener(S.a.JINGLE_FATAL_ERROR,function(e,n){e.isP2P||t.eventEmitter.emit(p.CONFERENCE_FAILED,d.JINGLE_FATAL_ERROR,n)}),n.addListener(S.a.CONNECTION_ICE_FAILED,function(e){t._onIceConnectionFailed(e)}),this.chatRoomForwarder.forward(S.a.MUC_DESTROYED,p.CONFERENCE_FAILED,d.CONFERENCE_DESTROYED),this.chatRoomForwarder.forward(S.a.CHAT_ERROR_RECEIVED,p.CONFERENCE_ERROR,d.CHAT_ERROR),this.chatRoomForwarder.forward(S.a.FOCUS_DISCONNECTED,p.CONFERENCE_FAILED,d.FOCUS_DISCONNECTED),n.addListener(S.a.FOCUS_LEFT,function(){y.a.sendAnalytics(Object(o.x)()),t.eventEmitter.emit(p.CONFERENCE_FAILED,d.FOCUS_LEFT)}),n.addListener(S.a.SESSION_ACCEPT_TIMEOUT,function(e){y.a.sendAnalyticsAndLog(Object(o.z)(o.b,{p2p:e.isP2P}))}),this.chatRoomForwarder.forward(S.a.RECORDER_STATE_CHANGED,p.RECORDER_STATE_CHANGED),this.chatRoomForwarder.forward(S.a.TRANSCRIPTION_STATUS_CHANGED,p.TRANSCRIPTION_STATUS_CHANGED),this.chatRoomForwarder.forward(S.a.VIDEO_SIP_GW_AVAILABILITY_CHANGED,p.VIDEO_SIP_GW_AVAILABILITY_CHANGED),this.chatRoomForwarder.forward(S.a.VIDEO_SIP_GW_SESSION_STATE_CHANGED,p.VIDEO_SIP_GW_SESSION_STATE_CHANGED),this.chatRoomForwarder.forward(S.a.PHONE_NUMBER_CHANGED,p.PHONE_NUMBER_CHANGED),n.addListener(S.a.CONFERENCE_SETUP_FAILED,function(e,n){e.isP2P||t.eventEmitter.emit(p.CONFERENCE_FAILED,d.SETUP_FAILED,n)}),n.setParticipantPropertyListener(function(e,n){var r=t.getParticipantById(n);r&&r.setProperty(e.tagName.substring("jitsi_participant_".length),e.value)}),this.chatRoomForwarder.forward(S.a.KICKED,p.KICKED),n.addListener(S.a.KICKED,function(){t.room=null,t.leave()}),n.addListener(S.a.SUSPEND_DETECTED,t.onSuspendDetected.bind(t)),this.chatRoomForwarder.forward(S.a.MUC_LOCK_CHANGED,p.LOCK_STATE_CHANGED),n.addListener(S.a.MUC_MEMBER_JOINED,t.onMemberJoined.bind(t)),n.addListener(S.a.MUC_MEMBER_LEFT,t.onMemberLeft.bind(t)),this.chatRoomForwarder.forward(S.a.MUC_LEFT,p.CONFERENCE_LEFT),n.addListener(S.a.DISPLAY_NAME_CHANGED,t.onDisplayNameChanged.bind(t)),n.addListener(S.a.LOCAL_ROLE_CHANGED,function(e){t.onLocalRoleChanged(e),t.statistics&&t.isModerator()&&t.on(p.RECORDER_STATE_CHANGED,function(e,t){var n={id:"recorder_status",status:e};t&&(n.error=t),y.a.sendLog(JSON.stringify(n))})}),n.addListener(S.a.MUC_ROLE_CHANGED,t.onUserRoleChanged.bind(t)),n.addListener(s.a.IDENTITY_UPDATED,function(e,n){t.authEnabled=e,t.authIdentity=n,t.eventEmitter.emit(p.AUTH_STATUS_CHANGED,e,n)}),n.addListener(S.a.MESSAGE_RECEIVED,function(e,n,r,o,a){var s=i.Strophe.getResourceFromJid(e);t.eventEmitter.emit(p.MESSAGE_RECEIVED,s,r,a)}),n.addListener(S.a.PRIVATE_MESSAGE_RECEIVED,function(e,n,r,o,a){var s=i.Strophe.getResourceFromJid(e);t.eventEmitter.emit(p.PRIVATE_MESSAGE_RECEIVED,s,r,a)}),n.addListener(S.a.PRESENCE_STATUS,function(e,n){var r=i.Strophe.getResourceFromJid(e),o=t.getParticipantById(r);o&&o._status!==n&&(o._status=n,t.eventEmitter.emit(p.USER_STATUS_CHANGED,r,n))}),n.addListener(S.a.JSON_MESSAGE_RECEIVED,function(e,n){var r=i.Strophe.getResourceFromJid(e),o=t.getParticipantById(r);o?t.eventEmitter.emit(p.ENDPOINT_MESSAGE_RECEIVED,o,n):_.warn("Ignored XMPPEvents.JSON_MESSAGE_RECEIVED for not existing participant: "+e,n)}),n.addPresenceListener("startmuted",function(e,n){var r=!1;if(t.myUserId()===n&&t.isModerator())r=!0;else{var i=t.getParticipantById(n);i&&i.isModerator()&&(r=!0)}if(r){var o="true"===e.attributes.audio,a="true"===e.attributes.video,s=!1;o!==t.startMutedPolicy.audio&&(t.startMutedPolicy.audio=o,s=!0),a!==t.startMutedPolicy.video&&(t.startMutedPolicy.video=a,s=!0),s&&t.eventEmitter.emit(p.START_MUTED_POLICY_CHANGED,t.startMutedPolicy)}}),n.addPresenceListener("devices",function(e,n){var r=!1,i=!1;e.children.forEach(function(e){"audio"===e.tagName&&(r="true"===e.value),"video"===e.tagName&&(i="true"===e.value)});var o=void 0;if(t.myUserId()===n)o=t.availableDevices;else{var a=t.getParticipantById(n);if(!a)return;o=a._availableDevices}var s=!1;o.audio!==r&&(s=!0,o.audio=r),o.video!==i&&(s=!0,o.video=i),s&&t.eventEmitter.emit(p.AVAILABLE_DEVICES_CHANGED,n,o)}),t.statistics&&(n.addListener(S.a.CONNECTION_ICE_FAILED,function(e){t.statistics.sendIceConnectionFailedEvent(e.peerconnection)}),n.addListener(S.a.ADD_ICE_CANDIDATE_FAILED,function(e,n){t.statistics.sendAddIceCandidateFailed(e,n)}))},r.prototype.setupRTCListeners=function(){var e=this.conference,t=e.rtc;t.addListener(m.a.REMOTE_TRACK_ADDED,e.onRemoteTrackAdded.bind(e)),t.addListener(m.a.REMOTE_TRACK_REMOVED,e.onRemoteTrackRemoved.bind(e)),t.addListener(m.a.DOMINANT_SPEAKER_CHANGED,function(t){e.lastDominantSpeaker!==t&&e.room&&(e.lastDominantSpeaker=t,e.eventEmitter.emit(p.DOMINANT_SPEAKER_CHANGED,t)),e.statistics&&e.myUserId()===t&&e.statistics.sendDominantSpeakerEvent()}),t.addListener(m.a.DATA_CHANNEL_OPEN,function(){var t=window.performance.now(),n="data.channel.opened";_.log("(TIME) "+n,t),e.room.connectionTimes[n]=t,y.a.sendAnalytics(Object(o.w)(n,{value:t})),e.eventEmitter.emit(p.DATA_CHANNEL_OPENED)}),t.addListener(m.a.AVAILABLE_DEVICES_CHANGED,function(t){return e.room.updateDeviceAvailability(t)}),t.addListener(m.a.ENDPOINT_MESSAGE_RECEIVED,function(t,n){var r=e.getParticipantById(t);r?e.eventEmitter.emit(p.ENDPOINT_MESSAGE_RECEIVED,r,n):_.warn("Ignored ENDPOINT_MESSAGE_RECEIVED for not existing participant: "+t,n)}),t.addListener(m.a.LOCAL_UFRAG_CHANGED,function(e,t){e.isP2P||y.a.sendLog(JSON.stringify({id:"local_ufrag",value:t}))}),t.addListener(m.a.REMOTE_UFRAG_CHANGED,function(e,t){e.isP2P||y.a.sendLog(JSON.stringify({id:"remote_ufrag",value:t}))}),t.addListener(m.a.CREATE_ANSWER_FAILED,function(t,n){e.statistics.sendCreateAnswerFailed(t,n)}),t.addListener(m.a.CREATE_OFFER_FAILED,function(t,n){e.statistics.sendCreateOfferFailed(t,n)}),t.addListener(m.a.SET_LOCAL_DESCRIPTION_FAILED,function(t,n){e.statistics.sendSetLocalDescFailed(t,n)}),t.addListener(m.a.SET_REMOTE_DESCRIPTION_FAILED,function(t,n){e.statistics.sendSetRemoteDescFailed(t,n)}),t.addListener(m.a.LOCAL_TRACK_SSRC_UPDATED,function(t,n){t.isVideoTrack()&&t.videoType===g.a.DESKTOP&&e.statistics.sendScreenSharingEvent(!0,n)})},r.prototype.setupXMPPListeners=function(){var e=this.conference;e.xmpp.caps.addListener(S.a.PARTCIPANT_FEATURES_CHANGED,function(t){var n=e.getParticipantById(i.Strophe.getResourceFromJid(t));n&&e.eventEmitter.emit(p.PARTCIPANT_FEATURES_CHANGED,n)}),e.xmpp.addListener(S.a.CALL_INCOMING,e.onIncomingCall.bind(e)),e.xmpp.addListener(S.a.CALL_ACCEPTED,e.onCallAccepted.bind(e)),e.xmpp.addListener(S.a.TRANSPORT_INFO,e.onTransportInfo.bind(e)),e.xmpp.addListener(S.a.CALL_ENDED,e.onCallEnded.bind(e)),e.xmpp.addListener(S.a.START_MUTED_FROM_FOCUS,function(t,n){e.options.config.ignoreStartMuted||(e.startAudioMuted=t,e.startVideoMuted=n,e.getLocalTracks().forEach(function(t){switch(t.getType()){case h.a:e.startAudioMuted&&t.mute();break;case h.b:e.startVideoMuted&&t.mute()}}),e.eventEmitter.emit(p.STARTED_MUTED))})},r.prototype.setupStatisticsListeners=function(){var e=this.conference;e.statistics&&(e.statistics.addAudioLevelListener(function(t,n,r,i){e.rtc.setAudioLevel(t,n,r,i)}),e.statistics.addBeforeDisposedListener(function(){e.eventEmitter.emit(p.BEFORE_STATISTICS_DISPOSED)}),e.statistics.addByteSentStatsListener(function(t,n){e.getLocalTracks(h.a).forEach(function(e){var r=t.getLocalSSRC(e);r&&n.hasOwnProperty(r)&&e._onByteSentStatsReceived(t,n[r])})}))}}).call(t,"JitsiConferenceEventManager.js")},function(e,t){function n(e,t){if(!e||!t||"function"!=typeof e.addListener||"function"!=typeof t.emit)throw new Error("Invalid arguments passed to EventEmitterForwarder");this.src=e,this.dest=t}n.prototype.forward=function(){for(var e=arguments.length,t=Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:5e3;return this._conference.xmpp.caps.getFeatures(this._jid,e)}}]),e})();t.a=c},function(e,t,n){"use strict";(function(e){var r=n(0),i=(n.n(r),n(7)),o=(function(){function e(e,t){for(var n=0;n "+t),this._conference.eventEmitter.emit(i.JVB121_STATUS,e,t))}}]),e})();t.a=s}).call(t,"modules/event/Jvb121EventGenerator.js")},function(e,t,n){"use strict";var r=n(7),i=(function(){function e(e,t){for(var n=0;n0&&(this._hasSentData=!0);var r=e.getConnectionState();this._testDataSent&&"connected"===r&&(setTimeout(function(){n._hasSentData||(_.warn(n+" 'bytes sent' <= 0: "+n._bytesSent),n._fireNoDataFromSourceEvent())},3e3),this._testDataSent=!1)}},{key:"getCameraFacingMode",value:function(){if(this.isVideoTrack()&&this.videoType===v.a.CAMERA){var e=void 0;try{e=this.track.getSettings()}catch(e){}return e&&"facingMode"in e?e.facingMode:void 0!==this._facingMode?this._facingMode:d.a.USER}}},{key:"_stopStream",value:function(){this._stopStreamInProgress=!0;try{u.a.stopMediaStream(this.stream)}finally{this._stopStreamInProgress=!1}}},{key:"_switchCamera",value:function(){this.isVideoTrack()&&this.videoType===v.a.CAMERA&&"function"==typeof this.track._switchCamera&&(this.track._switchCamera(),this._facingMode=this._facingMode===d.a.ENVIRONMENT?d.a.USER:d.a.ENVIRONMENT)}},{key:"_checkForCameraIssues",value:function(){return!(!this.isVideoTrack()||this._stopStreamInProgress||this.videoType===v.a.DESKTOP||this._isReceivingData())}},{key:"_isReceivingData",value:function(){return!!this.stream&&this.stream.getTracks().some(function(e){return!("readyState"in e&&"live"!==e.readyState||"muted"in e&&!0===e.muted)})}},{key:"toString",value:function(){return"LocalTrack["+this.rtcId+","+this.getType()+"]"}}]),t})();t.a=T}).call(t,"modules/RTC/JitsiLocalTrack.js")},function(e,t,n){"use strict";(function(e){var r=n(0),i=(n.n(r),n(127)),o=n.n(i),a=n(130),s=n(133),c=n(134),u=n(19),l=n.n(u),d=n(14),p=function(e,t){if(Array.isArray(e))return e;if(("function"==typeof Symbol?Symbol.iterator:"@@iterator")in Object(e))return(function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n})(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},h=(function(){function e(e,t){for(var n=0;n1&&(k.encoding=R.numChannels),a.rtp.push(k),R.parameters){var I={config:"",payload:R.preferredPayloadType},P=!0,A=!1,O=void 0;try{for(var D,x=Object.keys(R.parameters)["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(P=(D=x.next()).done);P=!0){var N=D.value;I.config&&(I.config+=";"),I.config+=N+"="+R.parameters[N]}}catch(e){A=!0,O=e}finally{try{!P&&x.return&&x.return()}finally{if(A)throw O}}I.config&&a.fmtp.push(I)}var L=!0,M=!1,j=void 0;try{for(var F,U=(R.rtcpFeedback||[])["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(L=(F=U.next()).done);L=!0){var H=F.value;a.rtcpFb.push({payload:R.preferredPayloadType,subtype:H.parameter||void 0,type:H.type})}}catch(e){M=!0,j=e}finally{try{!L&&U.return&&U.return()}finally{if(M)throw j}}}}}catch(e){T=!0,C=e}finally{try{!_&&w.return&&w.return()}finally{if(T)throw C}}0===S.length?(a.payloads="9",a.port=0,a.direction="inactive"):a.payloads=S.join(" "),a.ssrcs=[],a.ssrcGroups=[];var B=!0,G=!1,J=void 0;try{for(var V,W=u.values()["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(B=(V=W.next()).done);B=!0){var q=V.value,K=q.rtpSender,z=q.stream.id,Q=K.track;if("ended"!==Q.readyState&&Q.kind===o){q.ssrc||(q.ssrc=d.a.generateSsrc());var $=l&&"video"===Q.kind;$&&!q.rtxSsrc&&(q.rtxSsrc=q.ssrc+1),a.ssrcs.push({attribute:"cname",id:q.ssrc,value:g}),a.ssrcs.push({attribute:"msid",id:q.ssrc,value:z+" "+Q.id}),a.ssrcs.push({attribute:"mslabel",id:q.ssrc,value:z}),a.ssrcs.push({attribute:"label",id:q.ssrc,value:Q.id}),$&&(a.ssrcs.push({attribute:"cname",id:q.rtxSsrc,value:g}),a.ssrcs.push({attribute:"msid",id:q.rtxSsrc,value:z+" "+Q.id}),a.ssrcs.push({attribute:"mslabel",id:q.rtxSsrc,value:z}),a.ssrcs.push({attribute:"label",id:q.rtxSsrc,value:Q.id}),a.ssrcGroups.push({semantics:"FID",ssrcs:q.ssrc+" "+q.rtxSsrc}))}}}catch(e){G=!0,J=e}finally{try{!B&&W.return&&W.return()}finally{if(G)throw J}}a.ext=[];var X=!0,Y=!1,Z=void 0;try{for(var ee,te=c.headerExtensions["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(X=(ee=te.next()).done);X=!0){var ne=ee.value;ne.kind&&ne.kind!==o||a.ext.push({value:ne.preferredId,uri:ne.uri})}}catch(e){Y=!0,Z=e}finally{try{!X&&te.return&&te.return()}finally{if(Y)throw Z}}a.rtcpMux="rtcp-mux",a.rtcpRsize="rtcp-rsize"}n.media.push(a)}var n={},r=this._iceGatherer.getLocalParameters(),i=this._iceGatherer.getLocalCandidates(),o=this._dtlsTransport.getLocalParameters(),s=this._dtlsTransport.getRemoteParameters(),c=this._localCapabilities,u=this._localTrackInfos;"offer"===e&&this._sdpGlobalFields.version++,n.version=0,n.origin={address:"127.0.0.1",ipVer:4,netType:"IN",sessionId:this._sdpGlobalFields.id,sessionVersion:this._sdpGlobalFields.version,username:"jitsi-ortc-webrtc-shim"},n.name="-",n.timing={start:0,stop:0},n.msidSemantic={semantic:"WMS",token:"*"},n.groups=[{mids:Array.from(this._mids.keys()).join(" "),type:"BUNDLE"}],n.media=[],n.fingerprint={hash:o.fingerprints[0].value,type:o.fingerprints[0].algorithm};var l=!1,h=!0,m=!1,v=void 0;try{for(var y,b=c.codecs["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(h=(y=b.next()).done);h=!0){var S=y.value;if("video"===S.kind&&"rtx"===S.name){l=!0;break}}}catch(e){m=!0,v=e}finally{try{!h&&b.return&&b.return()}finally{if(m)throw v}}var _=!0,T=!1,C=void 0;try{for(var E,w=this._mids["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(_=(E=w.next()).done);_=!0){var R=E.value,k=p(R,2),I=k[0],P=k[1];t.call(this,I,P)}}catch(e){T=!0,C=e}finally{try{!_&&w.return&&w.return()}finally{if(T)throw C}}var A=new a.a({type:e,_sdpObject:n});return f.debug("_createLocalDescription():",A),A}},{key:"_createOffer",value:function(e){return this._closed?Promise.reject(new c.a("RTCPeerConnection closed")):this.signalingState!==m.stable?Promise.reject(new c.a('invalid signalingState "'+this.signalingState+'"')):Promise.reject(new Error("createoOffer() not yet supported"))}},{key:"_emitAddStream",value:function(e){if(!this._closed){f.debug('emitting "addstream"');var t=new o.a.Event("addstream");t.stream=e,this.dispatchEvent(t)}}},{key:"_emitBufferedIceCandidates",value:function(){if(!this._closed){var e=!0,t=!1,n=void 0;try{for(var r,i=this._bufferedIceCandidates["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(e=(r=i.next()).done);e=!0){var a=r.value;if(a){a.sdpMIndex=this._mids.keys().next().value,f.debug('emitting buffered "icecandidate", candidate:',a);var s=new o.a.Event("icecandidate");s.candidate=a,this.dispatchEvent(s)}}}catch(e){t=!0,n=e}finally{try{!e&&i.return&&i.return()}finally{if(t)throw n}}this._bufferedIceCandidates=[]}}},{key:"_emitConnectionStateChange",value:function(){if(!this._closed||"closed"===this.connectionState){f.debug('emitting "connectionstatechange", connectionState:',this.connectionState);var e=new o.a.Event("connectionstatechange");this.dispatchEvent(e)}}},{key:"_emitIceCandidate",value:function(e){if(!this._closed){var t=null;if(e){var n=this._mids.keys().next().value,r="candidate:"+e.foundation+" 1 "+e.protocol+" "+e.priority+" "+e.ip+" "+e.port+" typ "+e.type;e.relatedAddress&&(r+=" raddr "+e.relatedAddress),e.relatedPort&&(r+=" rport "+e.relatedPort),"tcp"===e.protocol&&(r+=" tcptype "+e.tcpType),t={candidate:r,component:1,foundation:e.foundation,ip:e.ip,port:e.port,priority:e.priority,protocol:e.protocol,type:e.type,sdpMIndex:n,sdpMLineIndex:0},"tcp"===e.protocol&&(t.tcptype=e.tcpType),e.relatedAddress&&(t.relatedAddress=e.relatedAddress),e.relatedPort&&(t.relatedPort=e.relatedPort)}if(this._localDescription){f.debug('emitting "icecandidate", candidate:',t);var i=new o.a.Event("icecandidate");i.candidate=t,this.dispatchEvent(i)}else f.debug("buffering gathered ICE candidate:",t),this._bufferedIceCandidates.push(t)}}},{key:"_emitIceConnectionStateChange",value:function(){if(!this._closed||"closed"===this.iceConnectionState){f.debug('emitting "iceconnectionstatechange", iceConnectionState:',this.iceConnectionState);var e=new o.a.Event("iceconnectionstatechange");this.dispatchEvent(e)}}},{key:"_emitNegotiationNeeded",value:function(){if(this.signalingState===m.stable){f.debug('emitting "negotiationneeded"');var e=new o.a.Event("negotiationneeded");this.dispatchEvent(e)}}},{key:"_emitRemoveStream",value:function(e){if(!this._closed){f.debug('emitting "removestream"');var t=new o.a.Event("removestream");t.stream=e,this.dispatchEvent(t)}}},{key:"_getParametersForRtpReceiver",value:function(e,t){var n=t.ssrc,r=t.rtxSsrc,i=t.cname,o=this._localCapabilities,a={codecs:[],degradationPreference:"balanced",encodings:[],headerExtensions:[],muxId:"",rtcp:{cname:i,compound:!0,mux:!0,reducedSize:!0}},s=[],c=void 0,u=!0,l=!1,d=void 0;try{for(var p,h=o.codecs["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(u=(p=h.next()).done);u=!0){var f=p.value;if(f.kind===e&&"rtx"!==f.name){c=f.preferredPayloadType,s.push({clockRate:f.clockRate,maxptime:f.maxptime,mimeType:f.mimeType,name:f.name,numChannels:f.numChannels,parameters:f.parameters,payloadType:f.preferredPayloadType,ptime:f.ptime,rtcpFeedback:f.rtcpFeedback});break}}}catch(e){l=!0,d=e}finally{try{!u&&h.return&&h.return()}finally{if(l)throw d}}if(r){var m=!0,v=!1,g=void 0;try{for(var y,b=o.codecs["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(m=(y=b.next()).done);m=!0){var S=y.value;if(S.kind===e&&"rtx"===S.name){s.push({clockRate:S.clockRate,mimeType:S.mimeType,name:"rtx",parameters:S.parameters,payloadType:S.preferredPayloadType,rtcpFeedback:S.rtcpFeedback});break}}}catch(e){v=!0,g=e}finally{try{!m&&b.return&&b.return()}finally{if(v)throw g}}}a.codecs=s;var _={active:!0,codecPayloadType:c,ssrc:n};r&&(_.rtx={ssrc:r}),a.encodings.push(_);var T=!0,C=!1,E=void 0;try{for(var w,R=o.headerExtensions["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(T=(w=R.next()).done);T=!0){var k=w.value;k.kind===e&&a.headerExtensions.push({encrypt:k.preferredEncrypt,id:k.preferredId,uri:k.uri})}}catch(e){C=!0,E=e}finally{try{!T&&R.return&&R.return()}finally{if(C)throw E}}return a}},{key:"_getParametersForRtpSender",value:function(e,t){var n=t.ssrc,r=t.rtxSsrc,i=g,o=this._localCapabilities,a={codecs:[],degradationPreference:"balanced",encodings:[],headerExtensions:[],muxId:"",rtcp:{cname:i,compound:!0,mux:!0,reducedSize:!0}},s=[],c=void 0,u=!0,l=!1,d=void 0;try{for(var p,h=o.codecs["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(u=(p=h.next()).done);u=!0){var f=p.value;if(f.kind===e&&"rtx"!==f.name){c=f.preferredPayloadType,s.push({clockRate:f.clockRate,maxptime:f.maxptime,mimeType:f.mimeType,name:f.name,numChannels:f.numChannels,parameters:f.parameters,payloadType:f.preferredPayloadType,ptime:f.ptime,rtcpFeedback:f.rtcpFeedback});break}}}catch(e){l=!0,d=e}finally{try{!u&&h.return&&h.return()}finally{if(l)throw d}}if(r){var m=!0,v=!1,y=void 0;try{for(var b,S=o.codecs["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(m=(b=S.next()).done);m=!0){var _=b.value;if(_.kind===e&&"rtx"===_.name){s.push({clockRate:_.clockRate,mimeType:_.mimeType,name:"rtx",parameters:_.parameters,payloadType:_.preferredPayloadType,rtcpFeedback:_.rtcpFeedback});break}}}catch(e){v=!0,y=e}finally{try{!m&&S.return&&S.return()}finally{if(v)throw y}}}a.codecs=s;var T={active:!0,codecPayloadType:c,ssrc:n};r&&(T.rtx={ssrc:r}),a.encodings.push(T);var C=!0,E=!1,w=void 0;try{for(var R,k=o.headerExtensions["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(C=(R=k.next()).done);C=!0){var I=R.value;I.kind===e&&a.headerExtensions.push({encrypt:I.preferredEncrypt,id:I.preferredId,uri:I.uri})}}catch(e){E=!0,w=e}finally{try{!C&&k.return&&k.return()}finally{if(E)throw w}}return a}},{key:"_getStats",value:function(e){if(this._closed)return Promise.reject(new c.a("RTCPeerConnection closed"));var t=this._iceGatherer,n=this._iceTransport,r=[],i=[],o=[],a=!0,s=!1,u=void 0;try{for(var l,d=this._localTrackInfos.values()["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(a=(l=d.next()).done);a=!0){var p=l.value,h=p.rtpSender;p.sending&&r.push(h)}}catch(e){s=!0,u=e}finally{try{!a&&d.return&&d.return()}finally{if(s)throw u}}var f=!0,m=!1,v=void 0;try{for(var g,y=this._remoteTrackInfos.values()["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(f=(g=y.next()).done);f=!0){var b=g.value.rtpReceiver;i.push(b)}}catch(e){m=!0,v=e}finally{try{!f&&y.return&&y.return()}finally{if(m)throw v}}t&&o.push(t.getStats().catch(function(){return null})),n&&(o.push(n.getStats().catch(function(){return null})),"function"==typeof n.msGetStats&&o.push(n.msGetStats().catch(function(){return null})));var S=!0,_=!1,T=void 0;try{for(var C,E=r["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(S=(C=E.next()).done);S=!0)!(function(e){var t="audio"===e.track.kind;o.push(e.getStats().then(function(e){if(!t){var n=!0,r=!1,i=void 0;try{for(var o,a=Object.keys(e)["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(n=(o=a.next()).done);n=!0){var s=e[o.value];"track"===s.type&&delete s.audioLevel}}catch(e){r=!0,i=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw i}}}return e}).catch(function(){return null}))})(h=C.value)}catch(e){_=!0,T=e}finally{try{!S&&E.return&&E.return()}finally{if(_)throw T}}var w=!0,R=!1,k=void 0;try{for(var I,P=i["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(w=(I=P.next()).done);w=!0)!(function(e){var t="audio"===e.track.kind;o.push(e.getStats().then(function(e){if(!t){var n=!0,r=!1,i=void 0;try{for(var o,a=Object.keys(e)["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(n=(o=a.next()).done);n=!0){var s=e[o.value];"track"===s.type&&delete s.audioLevel}}catch(e){r=!0,i=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw i}}}return e}).catch(function(){return null}))})(b=I.value)}catch(e){R=!0,k=e}finally{try{!w&&P.return&&P.return()}finally{if(R)throw k}}return Promise.all(o).then(function(e){var t={},n=!0,r=!1,i=void 0;try{for(var o,a=e["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(s){var c=!0,u=!1,l=void 0;try{for(var d,p=Object.keys(s)["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(c=(d=p.next()).done);c=!0){var h=d.value;t[h]=s[h]}}catch(e){u=!0,l=e}finally{try{!c&&p.return&&p.return()}finally{if(u)throw l}}}}}catch(e){r=!0,i=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw i}}return t})}},{key:"_handleLocalInitialAnswer",value:function(e){f.debug("_handleLocalInitialAnswer(), desc:",e);var t=e.sdpObject;this._localCapabilities=s.a(t),f.debug("local capabilities:",this._localCapabilities)}},{key:"_handleLocalReAnswer",value:function(e){f.debug("_handleLocalReAnswer(), desc:",e);var t=e.sdpObject;this._localCapabilities=s.a(t),f.debug("local capabilities:",this._localCapabilities)}},{key:"_handleRemoteInitialOffer",value:function(e){f.debug("_handleRemoteInitialOffer(), desc:",e);var t=e.sdpObject;this._mids=s.e(t);var n=s.a(t);f.debug("remote capabilities:",n),this._localCapabilities=s.g(n),this._startIceAndDtls(e)}},{key:"_handleRemoteReOffer",value:function(e){f.debug("_handleRemoteReOffer(), desc:",e);var t=e.sdpObject;this._mids=s.e(t);var n=s.a(t);f.debug("remote capabilities:",n),this._localCapabilities=s.g(n)}},{key:"_receiveMedia",value:function(){f.debug("_receiveMedia()");var e=new Set(this._remoteTrackInfos.keys()),t=s.f(this._remoteDescription.sdpObject),n=new Map,r=new Map,i=new Map;f.debug("_receiveMedia() remote track infos:",t);var o=!0,a=!1,c=void 0;try{for(var u,l=t["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(o=(u=l.next()).done);o=!0){var d=u.value,h=p(d,2),m=h[0],v=h[1];if(!e.has(m)){f.debug("_receiveMedia() new remote track, ssrc:"+m),this._remoteTrackInfos.set(m,v);var g=v.kind,y=v.rtxSsrc,b=v.streamId,S=v.trackId,_=v.cname,T=void 0;this._remoteStreams.has(b)?T=this._remoteStreams.get(b):(f.debug("_receiveMedia() new remote stream, id:"+b),(T=new MediaStream).jitsiRemoteId=b,n.set(b,T),this._remoteStreams.set(b,T));var C=new RTCRtpReceiver(this._dtlsTransport,g),E=this._getParametersForRtpReceiver(g,{ssrc:m,rtxSsrc:y,cname:_});v.track=C.track,C.onerror=function(e){f.error('rtpReceiver "error" event, event:'),f.error(e)},v.stream=T,v.rtpReceiver=C,f.debug("calling rtpReceiver.receive(), parameters:",E);try{C.receive(E);var w=v.track;w.jitsiRemoteId=S,T.addTrack(w),n.has(b)||r.set(w,T)}catch(e){f.error("rtpReceiver.receive() failed:"+e.message),f.error(e)}}}}catch(e){a=!0,c=e}finally{try{!o&&l.return&&l.return()}finally{if(a)throw c}}var R=!0,k=!1,I=void 0;try{for(var P,A=e["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(R=(P=A.next()).done);R=!0){var O=P.value;if(!t.has(O)){f.debug("_receiveMedia() remote track removed, ssrc:"+O);var D=this._remoteTrackInfos.get(O),x=(T=D.stream,D.track);C=D.rtpReceiver;try{C.stop()}catch(e){f.warn("rtpReceiver.stop() failed:"+e)}i.set(x,T),T.removeTrack(x),this._remoteTrackInfos.delete(O)}}}catch(e){k=!0,I=e}finally{try{!R&&A.return&&A.return()}finally{if(k)throw I}}var N=!0,L=!1,M=void 0;try{for(var j,F=r["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(N=(j=F.next()).done);N=!0){var U=j.value,H=p(U,2);x=H[0],T=H[1],(q=new Event("addtrack")).track=x,T.dispatchEvent(q)}}catch(e){L=!0,M=e}finally{try{!N&&F.return&&F.return()}finally{if(L)throw M}}var B=!0,G=!1,J=void 0;try{for(var V,W=i["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(B=(V=W.next()).done);B=!0){var q,K=V.value,z=p(K,2),Q=z[0],$=z[1];(q=new Event("removetrack")).track=Q,$.dispatchEvent(q)}}catch(e){G=!0,J=e}finally{try{!B&&W.return&&W.return()}finally{if(G)throw J}}var X=!0,Y=!1,Z=void 0;try{for(var ee,te=n.values()["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(X=(ee=te.next()).done);X=!0){var ne=ee.value;0===ne.getTracks().length?(f.warn("ignoring new stream for which no track could be added"),n.delete(ne.jitsiRemoteId),this._remoteStreams.delete(ne.jitsiRemoteId)):this._emitAddStream(ne)}}catch(e){Y=!0,Z=e}finally{try{!X&&te.return&&te.return()}finally{if(Y)throw Z}}var re=!0,ie=!1,oe=void 0;try{for(var ae,se=this._remoteStreams["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(re=(ae=se.next()).done);re=!0){var ce=ae.value,ue=p(ce,2),le=(b=ue[0],ue[1]);le.getTracks().length>0||(this._remoteStreams.delete(b),this._emitRemoveStream(le))}}catch(e){ie=!0,oe=e}finally{try{!re&&se.return&&se.return()}finally{if(ie)throw oe}}}},{key:"_removeStream",value:function(e){if(this._closed)throw new c.a("RTCPeerConnection closed");var t=!0,n=!1,r=void 0;try{for(var i,o=e.getTracks()["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(t=(i=o.next()).done);t=!0){var a=i.value;if(this._localTrackInfos.has(a.id)){var s=this._localTrackInfos.get(a.id).rtpSender;try{s.stop()}catch(e){f.warn("rtpSender.stop() failed:"+e)}this._localTrackInfos.delete(a.id)}}}catch(e){n=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}this._emitNegotiationNeeded()}},{key:"_sendMedia",value:function(){f.debug("_sendMedia()");var e=!0,t=!1,n=void 0;try{for(var r,i=this._localTrackInfos.values()["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(e=(r=i.next()).done);e=!0){var o=r.value;if(!o.sending){var a=o.rtpSender,s=o.ssrc,c=o.rtxSsrc,u=a.track.kind,l=this._getParametersForRtpSender(u,{ssrc:s,rtxSsrc:c});f.debug("calling rtpSender.send(), parameters:",l);try{a.send(l),o.sending=!0}catch(e){f.error("rtpSender.send() failed:"+e.message),f.error(e)}}}}catch(e){t=!0,n=e}finally{try{!e&&i.return&&i.return()}finally{if(t)throw n}}}},{key:"_setDtlsTransport",value:function(e){var t=this,n=new RTCDtlsTransport(e);n.onstatechange=function(){f.debug('dtlsTransport "statechange" event, state:'+n.state),t._emitConnectionStateChange()},n.ondtlsstatechange=function(){f.debug('dtlsTransport "dtlsstatechange" event, state:'+n.state),t._emitConnectionStateChange()},n.onerror=function(e){var n=void 0;e.message?n=e.message:e.error&&(n=e.error.message),f.error('dtlsTransport "error" event, message:'+n),t._emitConnectionStateChange()},this._dtlsTransport=n}},{key:"_setIceGatherer",value:function(e){var t=this,n={gatherPolicy:e.iceTransportPolicy||"all",iceServers:e.iceServers||[]},r=new RTCIceGatherer(n);r.onstatechange=function(){f.debug('iceGatherer "statechange" event, state:'+r.state),t._updateAndEmitIceGatheringStateChange(r.state)},r.onlocalcandidate=function(e){var n=e.candidate,r=e.complete;f.debug('iceGatherer "localcandidate" event, candidate:',n),r||!n||0===Object.keys(n).length?(n=null,t._updateAndEmitIceGatheringStateChange(v.complete),t._emitIceCandidate(null)):t._emitIceCandidate(n)},r.onerror=function(e){var t=e.errorCode,n=e.errorText;f.error('iceGatherer "error" event, errorCode:'+t+", errorText:"+n)};try{r.gather()}catch(e){f.warn("iceGatherer.gather() failed:"+e)}this._iceGatherer=r}},{key:"_setIceTransport",value:function(e){var t=this,n=new RTCIceTransport(e);n.onstatechange=function(){f.debug('iceTransport "statechange" event, state:'+n.state),t._emitIceConnectionStateChange()},n.onicestatechange=function(){f.debug('iceTransport "icestatechange" event, state:'+n.state),"completed"===n.state&&f.debug("nominated candidate pair:",n.getNominatedCandidatePair()),t._emitIceConnectionStateChange()},n.oncandidatepairchange=function(e){f.debug('iceTransport "candidatepairchange" event, pair:'+e.pair)},this._iceTransport=n}},{key:"_setLocalDescription",value:function(e){var t=this;if(this._closed)return Promise.reject(new c.a("RTCPeerConnection closed"));var n=void 0;try{n=new a.a(e)}catch(e){return Promise.reject(new TypeError("invalid RTCSessionDescriptionInit: "+e))}switch(e.type){case"offer":return this.signalingState!==m.stable?Promise.reject(new c.a('invalid signalingState "'+this.signalingState+'"')):Promise.reject(new TypeError('setLocalDescription() with type "offer" not supported'));case"answer":if(this.signalingState!==m.haveRemoteOffer)return Promise.reject(new c.a('invalid signalingState "'+this.signalingState+'"'));var r=Boolean(!this._localDescription);return Promise.resolve().then(function(){return r?t._handleLocalInitialAnswer(n):t._handleLocalReAnswer(n)}).then(function(){f.debug("setLocalDescription() succeed"),t._localDescription=n,t._updateAndEmitSignalingStateChange(m.stable),r&&t._emitBufferedIceCandidates(),t._sendMedia(),t._receiveMedia()}).catch(function(e){throw f.error("setLocalDescription() failed: "+e.message),f.error(e),e});default:return Promise.reject(new TypeError('unsupported description.type "'+e.type+'"'))}}},{key:"_setRemoteDescription",value:function(e){var t=this;if(this._closed)return Promise.reject(new c.a("RTCPeerConnection closed"));var n=void 0;try{n=new a.a(e)}catch(e){return Promise.reject(new TypeError("invalid RTCSessionDescriptionInit: "+e))}switch(e.type){case"offer":if(this.signalingState!==m.stable)return Promise.reject(new c.a('invalid signalingState "'+this.signalingState+'"'));var r=Boolean(!this._remoteDescription);return Promise.resolve().then(function(){return r?t._handleRemoteInitialOffer(n):t._handleRemoteReOffer(n)}).then(function(){f.debug("setRemoteDescription() succeed"),t._remoteDescription=n,t._updateAndEmitSignalingStateChange(m.haveRemoteOffer)}).catch(function(e){throw f.error("setRemoteDescription() failed: "+e),e});case"answer":return this.signalingState!==m.haveLocalOffer?Promise.reject(new c.a('invalid signalingState "'+this.signalingState+'"')):Promise.reject(new TypeError('setRemoteDescription() with type "answer" not supported'));default:return Promise.reject(new TypeError('unsupported description.type "'+e.type+'"'))}}},{key:"_startIceAndDtls",value:function(e){var t=e.sdpObject,n=s.d(t),r=s.c(t),i=s.b(t);switch(e.type){case"offer":this._iceTransport.start(this._iceGatherer,n,"controlled");break;case"answer":this._iceTransport.start(this._iceGatherer,n,"controlling")}var o=!0,a=!1,c=void 0;try{for(var u,l=r["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(o=(u=l.next()).done);o=!0){var d=u.value;0!==d.port&&9!==d.port&&this._iceTransport.addRemoteCandidate(d)}}catch(e){a=!0,c=e}finally{try{!o&&l.return&&l.return()}finally{if(a)throw c}}switch(this._iceTransport.addRemoteCandidate({}),e.type){case"offer":i.role="server";break;case"answer":i.role="client"}this._dtlsTransport.start(i)}},{key:"_updateAndEmitIceGatheringStateChange",value:function(e){if(!this._closed&&e!==this.iceGatheringState){this._iceGatheringState=e,f.debug('emitting "icegatheringstatechange", iceGatheringState:',this.iceGatheringState);var t=new o.a.Event("icegatheringstatechange");this.dispatchEvent(t)}}},{key:"_updateAndEmitSignalingStateChange",value:function(e){if(e!==this.signalingState){this._signalingState=e,f.debug('emitting "signalingstatechange", signalingState:',this.signalingState);var t=new o.a.Event("signalingstatechange");this.dispatchEvent(t)}}},{key:"connectionState",get:function(){return this._dtlsTransport.state}},{key:"iceConnectionState",get:function(){return this._iceTransport.state}},{key:"iceGatheringState",get:function(){return this._iceGatheringState}},{key:"localDescription",get:function(){return this._localDescription}},{key:"remoteDescription",get:function(){return this._remoteDescription}},{key:"signalingState",get:function(){return this._signalingState}}]),t})();t.a=y}).call(t,"modules/RTC/ortc/RTCPeerConnection.js")},function(e,t,n){e.exports={EventTarget:n(128),Event:n(129)}},function(e,t){function n(){this._listeners={}}Object.defineProperties(n.prototype,{listeners:{get:function(){return this._listeners}}}),n.prototype.addEventListener=function(e,t){var n,r,i;if(e&&t){for(void 0===(n=this._listeners[e])&&(this._listeners[e]=n=[]),r=0;i=n[r];r++)if(i===t)return;n.push(t)}},n.prototype.removeEventListener=function(e,t){var n,r,i;if(e&&t&&void 0!==(n=this._listeners[e])){for(r=0;i=n[r];r++)if(i===t){n.splice(r,1);break}0===n.length&&delete this._listeners[e]}},n.prototype.dispatchEvent=function(e){var t,n,r,i,o,a=!1;if(!e||"string"!=typeof e.type)throw new Error("`event` must have a valid `type` property");e._yaeti&&(e.target=this,e.cancelable=!0);try{e.stopImmediatePropagation=function(){a=!0}}catch(e){}if(t=e.type,n=this._listeners[t]||[],"function"==typeof(r=this["on"+t]))try{r.call(this,e)}catch(e){console.error(e)}for(i=0;(o=n[i])&&!a;i++)try{o.call(this,e)}catch(e){console.error(e)}return!e.defaultPrevented},e.exports=n},function(e,t,n){(function(t){e.exports=t.Event}).call(t,n(20))},function(e,t,n){"use strict";var r=n(15),i=n.n(r),o="function"==typeof Symbol&&"symbol"==typeof("function"==typeof Symbol?Symbol.iterator:"@@iterator")?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==("function"==typeof Symbol?Symbol.prototype:"@@prototype")?"symbol":typeof e},a=(function(){function e(e,t){for(var n=0;n=r)return e;var i=n[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(i);case"%d":return Number(i);case"%v":return""}})}.apply(null,r)},a=["v","o","s","i","u","e","p","c","b","t","r","z","a"],s=["i","c","b","a"];e.exports=function(e,t){t=t||{},null==e.version&&(e.version=0),null==e.name&&(e.name=" "),e.media.forEach(function(e){null==e.payloads&&(e.payloads="")});var n=t.outerOrder||a,i=t.innerOrder||s,c=[];return n.forEach(function(t){r[t].forEach(function(n){n.name in e&&null!=e[n.name]?c.push(o(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach(function(e){c.push(o(t,n,e))})})}),e.media.forEach(function(e){c.push(o("m",r.m[0],e)),i.forEach(function(t){r[t].forEach(function(n){n.name in e&&null!=e[n.name]?c.push(o(t,n,e)):n.push in e&&null!=e[n.push]&&e[n.push].forEach(function(e){c.push(o(t,n,e))})})})}),c.join("\r\n")+"\r\n"}},function(e,t,n){"use strict";function r(e){return e.media.find(function(e){return e.iceUfrag&&0!==e.port})}t.a=function(e){var t=new Map,n=[],r=!0,i=!1,a=void 0;try{for(var s,c=e.media["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(r=(s=c.next()).done);r=!0){var u=s.value,l=u.type;if("audio"===l||"video"===l){var d=!0,p=!1,h=void 0;try{for(var f,m=u.rtp["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(d=(f=m.next()).done);d=!0){var v=f.value,g={clockRate:v.rate,kind:l,mimeType:l+"/"+v.codec,name:v.codec,numChannels:v.encoding||1,parameters:{},preferredPayloadType:v.payload,rtcpFeedback:[]};t.set(g.preferredPayloadType,g)}}catch(e){p=!0,h=e}finally{try{!d&&m.return&&m.return()}finally{if(p)throw h}}var y=!0,b=!1,S=void 0;try{for(var _,T=(u.fmtp||[])["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(y=(_=T.next()).done);y=!0){var C=_.value,E=o.a.parseFmtpConfig(C.config);(g=t.get(C.payload))&&(g.parameters=E)}}catch(e){b=!0,S=e}finally{try{!y&&T.return&&T.return()}finally{if(b)throw S}}var w=!0,R=!1,k=void 0;try{for(var I,P=(u.rtcpFb||[])["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(w=(I=P.next()).done);w=!0){var A=I.value;(g=t.get(A.payload))&&g.rtcpFeedback.push({parameter:A.subtype||"",type:A.type})}}catch(e){R=!0,k=e}finally{try{!w&&P.return&&P.return()}finally{if(R)throw k}}var O=!0,D=!1,x=void 0;try{for(var N,L=(u.ext||[])["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(O=(N=L.next()).done);O=!0){!(function(e){var t=e.value,r=e.uri,i={kind:l,uri:r,preferredId:t};n.find(function(e){return i.kind===e.kind&&i.uri===e.uri})||n.push(i)})(N.value)}}catch(e){D=!0,x=e}finally{try{!O&&L.return&&L.return()}finally{if(D)throw x}}}}}catch(e){i=!0,a=e}finally{try{!r&&c.return&&c.return()}finally{if(i)throw a}}return{codecs:Array.from(t.values()),fecMechanisms:[],headerExtensions:n}},t.b=function(e){var t=r(e),n=t.fingerprint||e.fingerprint,i=void 0;switch(t.setup){case"active":i="client";break;case"passive":i="server";break;case"actpass":i="auto"}return{role:i,fingerprints:[{algorithm:n.type,value:n.hash}]}},t.c=function(e){var t=r(e),n=[],i=!0,o=!1,a=void 0;try{for(var s,c=t.candidates["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(i=(s=c.next()).done);i=!0){var u=s.value;if(1===u.component){var l={foundation:u.foundation,ip:u.ip,port:u.port,priority:u.priority,protocol:u.transport.toLowerCase(),type:u.type};n.push(l)}}}catch(e){o=!0,a=e}finally{try{!i&&c.return&&c.return()}finally{if(o)throw a}}return n},t.d=function(e){var t=r(e),n=t.iceUfrag,i=t.icePwd;return{icelite:"ice-lite"===e.icelite,password:i,usernameFragment:n}},t.e=function(e){var t=new Map,n=!0,r=!1,i=void 0;try{for(var o,a=e.media["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(n=(o=a.next()).done);n=!0){var s=o.value;t.set(s.mid,s.type)}}catch(e){r=!0,i=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw i}}return t},t.f=function(e){var t=new Map,n=new Map,r=new Set,i=!0,o=!1,a=void 0;try{for(var s,c=e.media["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(i=(s=c.next()).done);i=!0){var u=s.value,l=u.type;if("audio"===l||"video"===l){var d=!0,p=!1,h=void 0;try{for(var f,m=(u.ssrcGroups||[])["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(d=(f=m.next()).done);d=!0){var v=f.value;if("FID"===v.semantics){var g=v.ssrcs.split(" ").map(function(e){return Number(e)}),y=g[0],b=g[1];n.set(y,b),r.add(b)}}}catch(e){p=!0,h=e}finally{try{!d&&m.return&&m.return()}finally{if(p)throw h}}var S=!0,_=!1,T=void 0;try{for(var C,E=(u.ssrcs||[])["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(S=(C=E.next()).done);S=!0){var w=C.value;y=w.id;if(!r.has(y)){var R=t.get(y);switch(R||(R={kind:l,rtxSsrc:n.get(y),ssrc:y},t.set(y,R)),w.attribute){case"cname":R.cname=w.value;break;case"msid":var k=w.value.split(" "),I=k[0],P=k[1];R.streamId=I,R.trackId=P;break;case"mslabel":var A=w.value;R.streamId=A;break;case"label":var O=w.value;R.trackId=O}}}}catch(e){_=!0,T=e}finally{try{!S&&E.return&&E.return()}finally{if(_)throw T}}}}}catch(e){o=!0,a=e}finally{try{!i&&c.return&&c.return()}finally{if(o)throw a}}return t},t.g=function(e){var t=RTCRtpReceiver.getCapabilities(),n={codecs:[],fecMechanisms:[],headerExtensions:[]},r=new Map,i=!0,o=!1,a=void 0;try{for(var s,c=e.codecs["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(i=(s=c.next()).done);i=!0){!(function(e){var i=e.name.toLowerCase();if("rtx"===i)return r.set(e.parameters.apt,e.preferredPayloadType),"continue";var o=t.codecs.find(function(t){return t.name.toLowerCase()===i&&t.kind===e.kind&&t.clockRate===e.clockRate});if(!o)return"continue";var a={clockRate:o.clockRate,kind:o.kind,mimeType:o.kind+"/"+o.name,name:o.name,numChannels:o.numChannels||1,parameters:{},preferredPayloadType:e.preferredPayloadType,rtcpFeedback:[]},s=!0,c=!1,u=void 0;try{for(var l,d=Object.keys(e.parameters)["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(s=(l=d.next()).done);s=!0){var p=l.value,h=e.parameters[p],f=!0,m=!1,v=void 0;try{for(var g,y=Object.keys(o.parameters)["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(f=(g=y.next()).done);f=!0){var b=g.value,S=o.parameters[b];if(b===p&&S===h){a.parameters[b]=S;break}}}catch(e){m=!0,v=e}finally{try{!f&&y.return&&y.return()}finally{if(m)throw v}}}}catch(e){c=!0,u=e}finally{try{!s&&d.return&&d.return()}finally{if(c)throw u}}var _=!0,T=!1,C=void 0;try{for(var E,w=e.rtcpFeedback["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(_=(E=w.next()).done);_=!0){!(function(e){var t=o.rtcpFeedback.find(function(t){return t.type===e.type&&t.parameter===e.parameter});t&&a.rtcpFeedback.push(t)})(E.value)}}catch(e){T=!0,C=e}finally{try{!_&&w.return&&w.return()}finally{if(T)throw C}}n.codecs.push(a)})(s.value)}}catch(e){o=!0,a=e}finally{try{!i&&c.return&&c.return()}finally{if(o)throw a}}var u=!0,l=!1,d=void 0;try{for(var p,h=n.codecs["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(u=(p=h.next()).done);u=!0){var f=p.value,m=f.preferredPayloadType;if(r.has(m)){var v={clockRate:f.clockRate,kind:f.kind,mimeType:f.kind+"/rtx",name:"rtx",parameters:{apt:m},preferredPayloadType:r.get(m),rtcpFeedback:[]};n.codecs.push(v)}}}catch(e){l=!0,d=e}finally{try{!u&&h.return&&h.return()}finally{if(l)throw d}}var g=!0,y=!1,b=void 0;try{for(var S,_=e.headerExtensions["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(g=(S=_.next()).done);g=!0){!(function(e){var r=t.headerExtensions.find(function(t){return t.kind===e.kind&&t.uri===e.uri});if(r){var i={kind:r.kind,preferredEncrypt:Boolean(e.preferredEncrypt),preferredId:e.preferredId,uri:r.uri};n.headerExtensions.push(i)}})(S.value)}}catch(e){y=!0,b=e}finally{try{!g&&_.return&&_.return()}finally{if(y)throw b}}var T=!0,C=!1,E=void 0;try{for(var w,R=e.fecMechanisms["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(T=(w=R.next()).done);T=!0){!(function(e){var r=t.fecMechanisms.find(function(t){return t===e});r&&n.fecMechanisms.push(r)})(w.value)}}catch(e){C=!0,E=e}finally{try{!T&&R.return&&R.return()}finally{if(C)throw E}}return n};var i=n(15),o=n.n(i)},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r,i=(r="InvalidStateError",(function(e){function t(e){!(function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this);var n=(function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t})(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return Object.defineProperty(n,"name",{value:r}),n}return(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)})(t,Error),t})())},function(e,t,n){"use strict";(function(e){function r(e,t,n){b(["screen"],function(e){return t({stream:e})},n)}function i(e){return"https://chrome.google.com/webstore/detail/"+e.desktopSharingChromeExtId}function o(e,t){"undefined"!=typeof chrome&&chrome&&chrome.runtime?chrome.runtime.sendMessage(t.desktopSharingChromeExtId,{getVersion:!0},function(n){if(!n||!n.version)return h.warn("Extension not installed?: ",chrome.runtime.lastError),void e(!1,!1);var r=n.version;h.log("Extension version is: "+r);var i=(function(e,t){try{for(var n=e.split("."),r=t.split("."),i=Math.max(n.length,r.length),o=0;os}return!1}catch(e){return f.callErrorHandler(e),h.error("Failed to parse extension version",e),!0}})(t.desktopSharingChromeMinExtVersion,r);e(!i,i)}):e(!1,!1)}function a(e,t,n){chrome.runtime.sendMessage(e.desktopSharingChromeExtId,{getStream:!0,sources:e.desktopSharingChromeSources},function(e){if(e)h.log("Response from extension: ",e),c(e,t,n);else{var r=chrome.runtime.lastError;n(r instanceof Error?r:new l.a(d.CHROME_EXTENSION_GENERIC_ERROR,r))}})}function s(e,t,n){return 0===n?Promise.reject():new Promise(function(r,i){var a=n,s=window.setInterval(function(){o(function(e){e?(window.clearInterval(s),r()):0==--a&&(i(),window.clearInterval(s))},e)},t)})}function c(e,t,n){var r=e.streamId,i=e.streamType,o=e.error;if(r)b(["desktop"],function(e){return t({stream:e,sourceId:r,sourceType:i})},n,{desktopStream:r});else{if(""===r)return void n(new l.a(d.CHROME_EXTENSION_USER_CANCELED));n(new l.a(d.CHROME_EXTENSION_GENERIC_ERROR,o))}}function u(e){if(!e.desktopSharingFirefoxDisabled&&!1!==g&&!0!==g)if(e.desktopSharingFirefoxExtId){var t=document.createElement("img");t.onload=function(){h.log("Detected firefox screen sharing extension."),g=!0},t.onerror=function(){h.log("Detected lack of firefox screen sharing extension."),g=!1};var n="chrome://"+e.desktopSharingFirefoxExtId.replace("@",".")+"/content/"+document.location.hostname+".png";t.setAttribute("src",n)}else g=!1}var l=n(12),d=n(17),p=n(1),h=n(0).getLogger(e),f=n(3),m=!1,v=!1,g=null,y=!1,b=null,S={intChromeExtPromise:null,obtainStream:null,init:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{disableDesktopSharing:!1,desktopSharingChromeDisabled:!1,desktopSharingChromeExtId:null,desktopSharingFirefoxDisabled:!1,desktopSharingFirefoxExtId:null},t=arguments[1];this.options=e=e||{},b=t,this.obtainStream=this.options.disableDesktopSharing?null:this._createObtainStreamMethod(e),this.obtainStream||h.info("Desktop sharing disabled")},_createObtainStreamMethod:function(e){var t=this;if(p.b.isNWJS())return function(e,t,n){window.JitsiMeetNW.obtainDesktopStream(t,function(e,t){var r=void 0;r=e&&"InvalidStateError"===e.name?new l.a(d.CHROME_EXTENSION_USER_CANCELED):new l.a(e,t,["desktop"]),"function"==typeof n&&n(r)})};if(p.b.isElectron())return this.obtainScreenOnElectron;if(p.b.isTemasysPluginUsed()){var a=n(37).WebRTCPlugin.plugin;return a.HasScreensharingFeature?a.isScreensharingAvailable?(h.info("Using Temasys plugin for desktop sharing"),r):(h.warn("Screensharing not available with Temasys plugin on this site"),null):(h.warn("Screensharing not supported by this plugin version"),null)}return p.b.isChrome()||p.b.isOpera()?p.b.isVersionLessThan("34")?(h.info("Chrome extension not supported until ver 34"),null):e.desktopSharingChromeDisabled||!1===e.desktopSharingChromeMethod||!e.desktopSharingChromeExtId?null:(h.info("Using Chrome extension for desktop sharing"),this.intChromeExtPromise=(function(e){return t=e,0===$("link[rel=chrome-webstore-item]").length&&$("head").append(''),$("link[rel=chrome-webstore-item]").attr("href",i(t)),new Promise(function(t){o(function(e,n){m=e,v=n,h.info("Chrome extension installed: "+m+" updateRequired: "+v),t()},e)});var t})(e).then(function(){t.intChromeExtPromise=null}),this.obtainScreenFromExtension):p.b.isFirefox()?e.desktopSharingFirefoxDisabled?null:"http:"===window.location.protocol?(h.log("Screen sharing is not supported over HTTP. Use of HTTPS is required."),null):(u(e),this.obtainScreenOnFirefox):(h.log("Screen sharing not supported by the current browser: ",p.b.getName()),null)},isSupported:function(){return null!==this.obtainStream},obtainScreenOnFirefox:function(e,t,n){var i=this,o=!1,a=this.options.desktopSharingFirefoxMaxVersionExtRequired;if("number"==typeof a&&(o=-1===a,a>=0&&(a=String(a))),"string"==typeof a&&(o=!p.b.isVersionGreaterThan(a)),o&&h.log("Jidesha extension required on firefox version "+p.b.getVersion()),o&&!0!==g){if(y&&(y=!1,u(this.options)),null===g)return window.setTimeout(function(){null===g&&(g=!1),i.obtainScreenOnFirefox(t,n)},300),void h.log("Waiting for detection of jidesha on firefox to finish.");g=null,y=!0,n(new l.a(d.FIREFOX_EXTENSION_NEEDED))}else r(0,t,n)},obtainScreenOnElectron:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1],n=arguments[2];window.JitsiMeetScreenObtainer&&window.JitsiMeetScreenObtainer.openDesktopPicker?window.JitsiMeetScreenObtainer.openDesktopPicker({desktopSharingSources:e.desktopSharingSources||this.options.desktopSharingChromeSources},function(e,r){return c({streamId:e,streamType:r},t,n)},function(e){return n(new l.a(d.ELECTRON_DESKTOP_PICKER_ERROR,e))}):n(new l.a(d.ELECTRON_DESKTOP_PICKER_NOT_FOUND))},obtainScreenFromExtension:function(e,t,n){var r=this;if(null===this.intChromeExtPromise){var o=this.options,c=o.desktopSharingChromeExtId,u=o.desktopSharingChromeSources,l={desktopSharingChromeExtId:c,desktopSharingChromeSources:e.desktopSharingSources||u};if(m)a(l,t,n);else{if(v&&alert("Jitsi Desktop Streamer requires update. Changes will take effect after next Chrome restart."),p.b.isOpera())return void this.handleExternalInstall(e,t,n);try{chrome.webstore.install(i(this.options),function(i){h.log("Extension installed successfully",i),m=!0,s(r.options,200,10).then(function(){a(l,t,n)}).catch(function(){r.handleExtensionInstallationError(e,t,n)})},this.handleExtensionInstallationError.bind(this,e,t,n))}catch(r){this.handleExtensionInstallationError(e,t,n,r)}}}else this.intChromeExtPromise.then(function(){r.obtainScreenFromExtension(e,t,n)})},handleExternalInstall:function(e,t,n,r){var o=i(this.options);e.listener("waitingForExtension",o),this.checkForChromeExtensionOnInterval(e,t,n,r)},handleExtensionInstallationError:function(e,t,n,r){var o=i(this.options);if(("Inline installs can not be initiated from pop-up windows."===r||"Chrome Web Store installations can only be started by the top frame."===r||"Installs can only be initiated by one of the Chrome Web Store item's verified sites."===r||"Inline installation is not supported for this item. The user will be redirected to the Chrome Web Store."===r)&&e.interval>0&&"function"==typeof e.checkAgain&&"function"==typeof e.listener)this.handleExternalInstall(e,t,n,r);else{var a="Failed to install the extension from "+o;h.log(a,r);var s="Chrome Web Store installations can only be initated by a user gesture."===r?d.CHROME_EXTENSION_USER_GESTURE_REQUIRED:d.CHROME_EXTENSION_INSTALLATION_ERROR;n(new l.a(s,a))}},checkForChromeExtensionOnInterval:function(e,t,n){var r=this;!1!==e.checkAgain()?s(this.options,e.interval,1).then(function(){m=!0,e.listener("extensionFound"),r.obtainScreenFromExtension(e,t,n)}).catch(function(){r.checkForChromeExtensionOnInterval(e,t,n)}):n(new l.a(d.CHROME_EXTENSION_INSTALLATION_ERROR))}};t.a=S}).call(t,"modules/RTC/ScreenObtainer.js")},function(e,t,n){"use strict";(function(t){var r=n(137);e.exports=r({window:t.window})}).call(t,n(20))},function(e,t,n){"use strict";var r=n(11);e.exports=function(e,t){var i=e&&e.window,o={shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0};for(var a in t)hasOwnProperty.call(t,a)&&(o[a]=t[a]);var s=r.log,c=r.detectBrowser(i),u={browserDetails:c,extractVersion:r.extractVersion,disableLog:r.disableLog,disableWarnings:r.disableWarnings},l=n(138)||null,d=n(140)||null,p=n(144)||null,h=n(146)||null,f=n(147)||null;switch(c.browser){case"chrome":if(!l||!l.shimPeerConnection||!o.shimChrome)return s("Chrome shim is not included in this adapter release."),u;s("adapter.js shimming chrome."),u.browserShim=l,f.shimCreateObjectURL(i),l.shimGetUserMedia(i),l.shimMediaStream(i),l.shimSourceObject(i),l.shimPeerConnection(i),l.shimOnTrack(i),l.shimAddTrackRemoveTrack(i),l.shimGetSendersWithDtmf(i),f.shimRTCIceCandidate(i);break;case"firefox":if(!p||!p.shimPeerConnection||!o.shimFirefox)return s("Firefox shim is not included in this adapter release."),u;s("adapter.js shimming firefox."),u.browserShim=p,f.shimCreateObjectURL(i),p.shimGetUserMedia(i),p.shimSourceObject(i),p.shimPeerConnection(i),p.shimOnTrack(i),f.shimRTCIceCandidate(i);break;case"edge":if(!d||!d.shimPeerConnection||!o.shimEdge)return s("MS edge shim is not included in this adapter release."),u;s("adapter.js shimming edge."),u.browserShim=d,f.shimCreateObjectURL(i),d.shimGetUserMedia(i),d.shimPeerConnection(i),d.shimReplaceTrack(i);break;case"safari":if(!h||!o.shimSafari)return s("Safari shim is not included in this adapter release."),u;s("adapter.js shimming safari."),u.browserShim=h,f.shimCreateObjectURL(i),h.shimRTCIceServerUrls(i),h.shimCallbacksAPI(i),h.shimLocalStreamsAPI(i),h.shimRemoteStreamsAPI(i),h.shimTrackEventTransceiver(i),h.shimGetUserMedia(i),h.shimCreateOfferLegacy(i),f.shimRTCIceCandidate(i);break;default:s("Unsupported browser!")}return u}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof("function"==typeof Symbol?Symbol.iterator:"@@iterator")?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==("function"==typeof Symbol?Symbol.prototype:"@@prototype")?"symbol":typeof e},i=n(11),o=i.log,a={shimMediaStream:function(e){e.MediaStream=e.MediaStream||e.webkitMediaStream},shimOnTrack:function(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)}});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var n=this;return n._ontrackpoly||(n._ontrackpoly=function(t){t.stream.addEventListener("addtrack",function(r){var i;i=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find(function(e){return e.track&&e.track.id===r.track.id}):{track:r.track};var o=new Event("track");o.track=r.track,o.receiver=i,o.transceiver={receiver:i},o.streams=[t.stream],n.dispatchEvent(o)}),t.stream.getTracks().forEach(function(r){var i;i=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find(function(e){return e.track&&e.track.id===r.id}):{track:r};var o=new Event("track");o.track=r,o.receiver=i,o.transceiver={receiver:i},o.streams=[t.stream],n.dispatchEvent(o)})},n.addEventListener("addstream",n._ontrackpoly)),t.apply(n,arguments)}}},shimGetSendersWithDtmf:function(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){var t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};var n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){var i=n.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};var i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){i.apply(this,arguments);var t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}var o=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var n=this;n._senders=n._senders||[],o.apply(n,[e]),e.getTracks().forEach(function(e){n._senders.push(t(n,e))})};var a=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;t._senders=t._senders||[],a.apply(t,[e]),e.getTracks().forEach(function(e){var n=t._senders.find(function(t){return t.track===e});n&&t._senders.splice(t._senders.indexOf(n),1)})}}else if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){var s=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=s.apply(e,[]);return t.forEach(function(t){t._pc=e}),t},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}},shimSourceObject:function(e){var t=e&&e.URL;"object"===(void 0===e?"undefined":r(e))&&(!e.HTMLMediaElement||"srcObject"in e.HTMLMediaElement.prototype||Object.defineProperty(e.HTMLMediaElement.prototype,"srcObject",{get:function(){return this._srcObject},set:function(e){var n=this;this._srcObject=e,this.src&&t.revokeObjectURL(this.src),e?(this.src=t.createObjectURL(e),e.addEventListener("addtrack",function(){n.src&&t.revokeObjectURL(n.src),n.src=t.createObjectURL(e)}),e.addEventListener("removetrack",function(){n.src&&t.revokeObjectURL(n.src),n.src=t.createObjectURL(e)})):this.src=""}}))},shimAddTrackRemoveTrack:function(e){function t(e,t){var n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(function(t){var r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(i.id,"g"),r.id)}),new RTCSessionDescription({type:t.type,sdp:n})}var n=i.detectBrowser(e);if(!(e.RTCPeerConnection.prototype.addTrack&&n.version>=63)){var r=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this,t=r.apply(this);return e._reverseStreams=e._reverseStreams||{},t.map(function(t){return e._reverseStreams[t.id]})};var o=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){var n=this;if(n._streams=n._streams||{},n._reverseStreams=n._reverseStreams||{},t.getTracks().forEach(function(e){if(n.getSenders().find(function(t){return t.track===e}))throw new DOMException("Track already exists.","InvalidAccessError")}),!n._reverseStreams[t.id]){var r=new e.MediaStream(t.getTracks());n._streams[t.id]=r,n._reverseStreams[r.id]=t,t=r}o.apply(n,[t])};var a=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},a.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){var r=this;if("closed"===r.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var i=[].slice.call(arguments,1);if(1!==i.length||!i[0].getTracks().find(function(e){return e===t}))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(r.getSenders().find(function(e){return e.track===t}))throw new DOMException("Track already exists.","InvalidAccessError");r._streams=r._streams||{},r._reverseStreams=r._reverseStreams||{};var o=r._streams[n.id];if(o)o.addTrack(t),Promise.resolve().then(function(){r.dispatchEvent(new Event("negotiationneeded"))});else{var a=new e.MediaStream([t]);r._streams[n.id]=a,r._reverseStreams[a.id]=n,r.addStream(a)}return r.getSenders().find(function(e){return e.track===t})},["createOffer","createAnswer"].forEach(function(n){var r=e.RTCPeerConnection.prototype[n];e.RTCPeerConnection.prototype[n]=function(){var e=this,n=arguments;return arguments.length&&"function"==typeof arguments[0]?r.apply(e,[function(r){var i=t(e,r);n[0].apply(null,[i])},function(e){n[1]&&n[1].apply(null,e)},arguments[2]]):r.apply(e,arguments).then(function(n){return t(e,n)})}});var s=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=(function(e,t){var n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(function(t){var r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(r.id,"g"),i.id)}),new RTCSessionDescription({type:t.type,sdp:n})})(this,arguments[0]),s.apply(this,arguments)):s.apply(this,arguments)};var c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get:function(){var e=c.get.apply(this);return""===e.type?e:t(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;if("closed"===t.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(e._pc!==t)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");t._streams=t._streams||{};var n;Object.keys(t._streams).forEach(function(r){t._streams[r].getTracks().find(function(t){return e.track===t})&&(n=t._streams[r])}),n&&(1===n.getTracks().length?t.removeStream(t._reverseStreams[n.id]):n.removeTrack(e.track),t.dispatchEvent(new Event("negotiationneeded")))}}},shimPeerConnection:function(e){var t=i.detectBrowser(e);if(e.RTCPeerConnection){var n=e.RTCPeerConnection;e.RTCPeerConnection=function(e,t){if(e&&e.iceServers){for(var r=[],o=0;o0&&"function"==typeof e)return a.apply(this,arguments);if(0===a.length&&(0===arguments.length||"function"!=typeof arguments[0]))return a.apply(this,[]);var o=function(e){var t={};return e.result().forEach(function(e){var n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach(function(t){n[t]=e.stat(t)}),t[n.id]=n}),t},s=function(e){return new Map(Object.keys(e).map(function(t){return[t,e[t]]}))};if(arguments.length>=2){var c=function(e){i[1](s(o(e)))};return a.apply(this,[c,arguments[0]])}return new Promise(function(e,t){a.apply(r,[function(t){e(s(o(t)))},t])}).then(t,n)},t.version<51&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){var n=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){var e=arguments,t=this,r=new Promise(function(r,i){n.apply(t,[e[0],r,i])});return e.length<2?r:r.then(function(){e[1].apply(null,[])},function(t){e.length>=3&&e[2].apply(null,[t])})}}),t.version<52&&["createOffer","createAnswer"].forEach(function(t){var n=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){var e=this;if(arguments.length<1||1===arguments.length&&"object"===r(arguments[0])){var t=1===arguments.length?arguments[0]:void 0;return new Promise(function(r,i){n.apply(e,[r,i,t])})}return n.apply(this,arguments)}}),["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){var n=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}});var s=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?s.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}};e.exports={shimMediaStream:a.shimMediaStream,shimOnTrack:a.shimOnTrack,shimAddTrackRemoveTrack:a.shimAddTrackRemoveTrack,shimGetSendersWithDtmf:a.shimGetSendersWithDtmf,shimSourceObject:a.shimSourceObject,shimPeerConnection:a.shimPeerConnection,shimGetUserMedia:n(139)}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof("function"==typeof Symbol?Symbol.iterator:"@@iterator")?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==("function"==typeof Symbol?Symbol.prototype:"@@prototype")?"symbol":typeof e},i=n(11),o=i.log;e.exports=function(e){var t=i.detectBrowser(e),n=e&&e.navigator,a=function(e){if("object"!==(void 0===e?"undefined":r(e))||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach(function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var i="object"===r(e[n])?e[n]:{ideal:e[n]};void 0!==i.exact&&"number"==typeof i.exact&&(i.min=i.max=i.exact);var o=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==i.ideal){t.optional=t.optional||[];var a={};"number"==typeof i.ideal?(a[o("min",n)]=i.ideal,t.optional.push(a),(a={})[o("max",n)]=i.ideal,t.optional.push(a)):(a[o("",n)]=i.ideal,t.optional.push(a))}void 0!==i.exact&&"number"!=typeof i.exact?(t.mandatory=t.mandatory||{},t.mandatory[o("",n)]=i.exact):["min","max"].forEach(function(e){void 0!==i[e]&&(t.mandatory=t.mandatory||{},t.mandatory[o(e,n)]=i[e])})}}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},s=function(e,i){if(t.version>=61)return i(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"===r(e.audio)){var s=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};s((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),s(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=a(e.audio)}if(e&&"object"===r(e.video)){var c=e.video.facingMode;c=c&&("object"===(void 0===c?"undefined":r(c))?c:{ideal:c});var u=t.version<66;if(c&&("user"===c.exact||"environment"===c.exact||"user"===c.ideal||"environment"===c.ideal)&&(!n.mediaDevices.getSupportedConstraints||!n.mediaDevices.getSupportedConstraints().facingMode||u)){delete e.video.facingMode;var l;if("environment"===c.exact||"environment"===c.ideal?l=["back","rear"]:"user"!==c.exact&&"user"!==c.ideal||(l=["front"]),l)return n.mediaDevices.enumerateDevices().then(function(t){var n=(t=t.filter(function(e){return"videoinput"===e.kind})).find(function(e){return l.some(function(t){return-1!==e.label.toLowerCase().indexOf(t)})});return!n&&t.length&&-1!==l.indexOf("back")&&(n=t[t.length-1]),n&&(e.video.deviceId=c.exact?{exact:n.deviceId}:{ideal:n.deviceId}),e.video=a(e.video),o("chrome: "+JSON.stringify(e)),i(e)})}e.video=a(e.video)}return o("chrome: "+JSON.stringify(e)),i(e)},c=function(e){return{name:{PermissionDeniedError:"NotAllowedError",InvalidStateError:"NotReadableError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotReadableError",MediaDeviceKillSwitchOn:"NotReadableError"}[e.name]||e.name,message:e.message,constraint:e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}};n.getUserMedia=function(e,t,r){s(e,function(e){n.webkitGetUserMedia(e,t,function(e){r&&r(c(e))})})};var u=function(e){return new Promise(function(t,r){n.getUserMedia(e,t,r)})};if(n.mediaDevices||(n.mediaDevices={getUserMedia:u,enumerateDevices:function(){return new Promise(function(t){var n={audio:"audioinput",video:"videoinput"};return e.MediaStreamTrack.getSources(function(e){t(e.map(function(e){return{label:e.label,kind:n[e.kind],deviceId:e.id,groupId:""}}))})})},getSupportedConstraints:function(){return{deviceId:!0,echoCancellation:!0,facingMode:!0,frameRate:!0,height:!0,width:!0}}}),n.mediaDevices.getUserMedia){var l=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(e){return s(e,function(e){return l(e).then(function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach(function(e){e.stop()}),new DOMException("","NotFoundError");return t},function(e){return Promise.reject(c(e))})})}}else n.mediaDevices.getUserMedia=function(e){return u(e)};void 0===n.mediaDevices.addEventListener&&(n.mediaDevices.addEventListener=function(){o("Dummy mediaDevices.addEventListener called.")}),void 0===n.mediaDevices.removeEventListener&&(n.mediaDevices.removeEventListener=function(){o("Dummy mediaDevices.removeEventListener called.")})}},function(e,t,n){"use strict";var r=n(11),i=n(141);e.exports={shimGetUserMedia:n(143),shimPeerConnection:function(e){var t=r.detectBrowser(e);if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){var n=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set:function(e){n.set.call(this,e);var t=new Event("enabled");t.enabled=e,this.dispatchEvent(t)}})}!e.RTCRtpSender||"dtmf"in e.RTCRtpSender.prototype||Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCPeerConnection=i(e,t.version)},shimReplaceTrack:function(e){!e.RTCRtpSender||"replaceTrack"in e.RTCRtpSender.prototype||(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)}}},function(e,t,n){"use strict";function r(e,t,n,r,i){var o=l.writeRtpDescription(e.kind,t);if(o+=l.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=l.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":i||"active"),o+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?o+="a=sendrecv\r\n":e.rtpSender?o+="a=sendonly\r\n":e.rtpReceiver?o+="a=recvonly\r\n":o+="a=inactive\r\n",e.rtpSender){var a="msid:"+r.id+" "+e.rtpSender.track.id+"\r\n";o+="a="+a,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+a,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+a,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+l.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+l.localCName+"\r\n"),o}function i(e,t){var n={codecs:[],headerExtensions:[],fecMechanisms:[]},r=function(e,t){e=parseInt(e,10);for(var n=0;n=14393&&-1===e.indexOf("?transport=udp"):(n=!0,!0)}),delete e.url,e.urls=i?r[0]:r,!!r.length}})})(n.iceServers||[],t),this._iceGatherers=[],n.iceCandidatePoolSize)for(var o=n.iceCandidatePoolSize;o>0;o--)this._iceGatherers=new e.RTCIceGatherer({iceServers:n.iceServers,gatherPolicy:n.iceTransportPolicy});else n.iceCandidatePoolSize=0;this._config=n,this.transceivers=[],this._sdpSessionId=l.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};n.prototype.onicecandidate=null,n.prototype.onaddstream=null,n.prototype.ontrack=null,n.prototype.onremovestream=null,n.prototype.onsignalingstatechange=null,n.prototype.oniceconnectionstatechange=null,n.prototype.onicegatheringstatechange=null,n.prototype.onnegotiationneeded=null,n.prototype.ondatachannel=null,n.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},n.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},n.prototype.getConfiguration=function(){return this._config},n.prototype.getLocalStreams=function(){return this.localStreams},n.prototype.getRemoteStreams=function(){return this.remoteStreams},n.prototype._createTransceiver=function(e){var t=this.transceivers.length>0,n={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&t)n.iceTransport=this.transceivers[0].iceTransport,n.dtlsTransport=this.transceivers[0].dtlsTransport;else{var r=this._createIceAndDtlsTransports();n.iceTransport=r.iceTransport,n.dtlsTransport=r.dtlsTransport}return this.transceivers.push(n),n},n.prototype.addTrack=function(t,n){if(this.transceivers.find(function(e){return e.track===t}))throw u("InvalidAccessError","Track already exists.");if("closed"===this.signalingState)throw u("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");for(var r,i=0;i=15025)e.getTracks().forEach(function(t){n.addTrack(t,e)});else{var r=e.clone();e.getTracks().forEach(function(e,t){var n=r.getTracks()[t];e.addEventListener("enabled",function(e){n.enabled=e.enabled})}),r.getTracks().forEach(function(e){n.addTrack(e,r)})}},n.prototype.removeTrack=function(t){if(!(t instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var n=this.transceivers.find(function(e){return e.rtpSender===t});if(!n)throw u("InvalidAccessError","Sender was not created by this connection.");var r=n.stream;n.rtpSender.stop(),n.rtpSender=null,n.track=null,n.stream=null,-1===this.transceivers.map(function(e){return e.stream}).indexOf(r)&&this.localStreams.indexOf(r)>-1&&this.localStreams.splice(this.localStreams.indexOf(r),1),this._maybeFireNegotiationNeeded()},n.prototype.removeStream=function(e){var t=this;e.getTracks().forEach(function(e){var n=t.getSenders().find(function(t){return t.track===e});n&&t.removeTrack(n)})},n.prototype.getSenders=function(){return this.transceivers.filter(function(e){return!!e.rtpSender}).map(function(e){return e.rtpSender})},n.prototype.getReceivers=function(){return this.transceivers.filter(function(e){return!!e.rtpReceiver}).map(function(e){return e.rtpReceiver})},n.prototype._createIceGatherer=function(t,n){var r=this;if(n&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var i=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(i,"state",{value:"new",writable:!0}),this.transceivers[t].candidates=[],this.transceivers[t].bufferCandidates=function(e){var n=!e.candidate||0===Object.keys(e.candidate).length;i.state=n?"completed":"gathering",null!==r.transceivers[t].candidates&&r.transceivers[t].candidates.push(e.candidate)},i.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),i},n.prototype._gather=function(t,n){var r=this,i=this.transceivers[n].iceGatherer;if(!i.onlocalcandidate){var o=this.transceivers[n].candidates;this.transceivers[n].candidates=null,i.removeEventListener("localcandidate",this.transceivers[n].bufferCandidates),i.onlocalcandidate=function(e){if(!(r.usingBundle&&n>0)){var o=new Event("icecandidate");o.candidate={sdpMid:t,sdpMLineIndex:n};var a=e.candidate,s=!a||0===Object.keys(a).length;s?"new"!==i.state&&"gathering"!==i.state||(i.state="completed"):("new"===i.state&&(i.state="gathering"),a.component=1,o.candidate.candidate=l.writeCandidate(a));var c=l.splitSections(r.localDescription.sdp);c[o.candidate.sdpMLineIndex+1]+=s?"a=end-of-candidates\r\n":"a="+o.candidate.candidate+"\r\n",r.localDescription.sdp=c.join("");var u=r.transceivers.every(function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state});"gathering"!==r.iceGatheringState&&(r.iceGatheringState="gathering",r._emitGatheringStateChange()),s||r._dispatchEvent("icecandidate",o),u&&(r._dispatchEvent("icecandidate",new Event("icecandidate")),r.iceGatheringState="complete",r._emitGatheringStateChange())}},e.setTimeout(function(){o.forEach(function(e){var t=new Event("RTCIceGatherEvent");t.candidate=e,i.onlocalcandidate(t)})},0)}},n.prototype._createIceAndDtlsTransports=function(){var t=this,n=new e.RTCIceTransport(null);n.onicestatechange=function(){t._updateConnectionState()};var r=new e.RTCDtlsTransport(n);return r.ondtlsstatechange=function(){t._updateConnectionState()},r.onerror=function(){Object.defineProperty(r,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:n,dtlsTransport:r}},n.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var n=this.transceivers[e].iceTransport;n&&(delete n.onicestatechange,delete this.transceivers[e].iceTransport);var r=this.transceivers[e].dtlsTransport;r&&(delete r.ondtlsstatechange,delete r.onerror,delete this.transceivers[e].dtlsTransport)},n.prototype._transceive=function(e,n,r){var o=i(e.localCapabilities,e.remoteCapabilities);n&&e.rtpSender&&(o.encodings=e.sendEncodingParameters,o.rtcp={cname:l.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(o.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(o)),r&&e.rtpReceiver&&o.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&t<15019&&e.recvEncodingParameters.forEach(function(e){delete e.rtx}),e.recvEncodingParameters.length&&(o.encodings=e.recvEncodingParameters),o.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(o.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(o.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(o))},n.prototype.setLocalDescription=function(e){var t=this;if(!o("setLocalDescription",e.type,this.signalingState)||this._isClosed)return Promise.reject(u("InvalidStateError","Can not set local "+e.type+" in state "+t.signalingState));var n,r;if("offer"===e.type)n=l.splitSections(e.sdp),r=n.shift(),n.forEach(function(e,n){var r=l.parseRtpParameters(e);t.transceivers[n].localCapabilities=r}),this.transceivers.forEach(function(e,n){t._gather(e.mid,n)});else if("answer"===e.type){n=l.splitSections(t.remoteDescription.sdp),r=n.shift();var a=l.matchPrefix(r,"a=ice-lite").length>0;n.forEach(function(e,n){var o=t.transceivers[n],s=o.iceGatherer,c=o.iceTransport,u=o.dtlsTransport,d=o.localCapabilities,p=o.remoteCapabilities;if(!(l.isRejected(e)&&0===l.matchPrefix(e,"a=bundle-only").length||o.isDatachannel)){var h=l.getIceParameters(e,r),f=l.getDtlsParameters(e,r);a&&(f.role="server"),t.usingBundle&&0!==n||(t._gather(o.mid,n),"new"===c.state&&c.start(s,h,a?"controlling":"controlled"),"new"===u.state&&u.start(f));var m=i(d,p);t._transceive(o,m.codecs.length>0,!1)}})}switch(this.localDescription={type:e.type,sdp:e.sdp},e.type){case"offer":this._updateSignalingState("have-local-offer");break;case"answer":this._updateSignalingState("stable");break;default:throw new TypeError('unsupported type "'+e.type+'"')}return Promise.resolve()},n.prototype.setRemoteDescription=function(n){var r=this;if(!o("setRemoteDescription",n.type,this.signalingState)||this._isClosed)return Promise.reject(u("InvalidStateError","Can not set remote "+n.type+" in state "+r.signalingState));var i={};this.remoteStreams.forEach(function(e){i[e.id]=e});var d=[],p=l.splitSections(n.sdp),h=p.shift(),f=l.matchPrefix(h,"a=ice-lite").length>0,m=l.matchPrefix(h,"a=group:BUNDLE ").length>0;this.usingBundle=m;var v=l.matchPrefix(h,"a=ice-options:")[0];switch(this.canTrickleIceCandidates=!!v&&v.substr(14).split(" ").indexOf("trickle")>=0,p.forEach(function(o,c){var u=l.splitLines(o),p=l.getKind(o),v=l.isRejected(o)&&0===l.matchPrefix(o,"a=bundle-only").length,g=u[0].substr(2).split(" ")[2],y=l.getDirection(o,h),b=l.parseMsid(o),S=l.getMid(o)||l.generateIdentifier();if("application"!==p||"DTLS/SCTP"!==g){var _,T,C,E,w,R,k,I,P,A,O,D=l.parseRtpParameters(o);v||(A=l.getIceParameters(o,h),(O=l.getDtlsParameters(o,h)).role="client"),k=l.parseRtpEncodingParameters(o);var x=l.parseRtcpParameters(o),N=l.matchPrefix(o,"a=end-of-candidates",h).length>0,L=l.matchPrefix(o,"a=candidate:").map(function(e){return l.parseCandidate(e)}).filter(function(e){return 1===e.component});if(("offer"===n.type||"answer"===n.type)&&!v&&m&&c>0&&r.transceivers[c]&&(r._disposeIceAndDtlsTransports(c),r.transceivers[c].iceGatherer=r.transceivers[0].iceGatherer,r.transceivers[c].iceTransport=r.transceivers[0].iceTransport,r.transceivers[c].dtlsTransport=r.transceivers[0].dtlsTransport,r.transceivers[c].rtpSender&&r.transceivers[c].rtpSender.setTransport(r.transceivers[0].dtlsTransport),r.transceivers[c].rtpReceiver&&r.transceivers[c].rtpReceiver.setTransport(r.transceivers[0].dtlsTransport)),"offer"!==n.type||v)"answer"!==n.type||v||(T=(_=r.transceivers[c]).iceGatherer,C=_.iceTransport,E=_.dtlsTransport,w=_.rtpReceiver,R=_.sendEncodingParameters,I=_.localCapabilities,r.transceivers[c].recvEncodingParameters=k,r.transceivers[c].remoteCapabilities=D,r.transceivers[c].rtcpParameters=x,L.length&&"new"===C.state&&(!f&&!N||m&&0!==c?L.forEach(function(e){a(_.iceTransport,e)}):C.setRemoteCandidates(L)),m&&0!==c||("new"===C.state&&C.start(T,A,"controlling"),"new"===E.state&&E.start(O)),r._transceive(_,"sendrecv"===y||"recvonly"===y,"sendrecv"===y||"sendonly"===y),!w||"sendrecv"!==y&&"sendonly"!==y?delete _.rtpReceiver:(P=w.track,b?(i[b.stream]||(i[b.stream]=new e.MediaStream),s(P,i[b.stream]),d.push([P,w,i[b.stream]])):(i.default||(i.default=new e.MediaStream),s(P,i.default),d.push([P,w,i.default]))));else{(_=r.transceivers[c]||r._createTransceiver(p)).mid=S,_.iceGatherer||(_.iceGatherer=r._createIceGatherer(c,m)),L.length&&"new"===_.iceTransport.state&&(!N||m&&0!==c?L.forEach(function(e){a(_.iceTransport,e)}):_.iceTransport.setRemoteCandidates(L)),I=e.RTCRtpReceiver.getCapabilities(p),t<15019&&(I.codecs=I.codecs.filter(function(e){return"rtx"!==e.name})),R=_.sendEncodingParameters||[{ssrc:1001*(2*c+2)}];var M=!1;if("sendrecv"===y||"sendonly"===y){if(M=!_.rtpReceiver,w=_.rtpReceiver||new e.RTCRtpReceiver(_.dtlsTransport,p),M){var j;P=w.track,b&&"-"===b.stream||(b?(i[b.stream]||(i[b.stream]=new e.MediaStream,Object.defineProperty(i[b.stream],"id",{get:function(){return b.stream}})),Object.defineProperty(P,"id",{get:function(){return b.track}}),j=i[b.stream]):(i.default||(i.default=new e.MediaStream),j=i.default)),j&&(s(P,j),_.associatedRemoteMediaStreams.push(j)),d.push([P,w,j])}}else _.rtpReceiver&&_.rtpReceiver.track&&(_.associatedRemoteMediaStreams.forEach(function(e){var t=e.getTracks().find(function(e){return e.id===_.rtpReceiver.track.id});t&&(function(e,t){t.removeTrack(e);var n=new Event("removetrack");n.track=e,t.dispatchEvent(n)})(t,e)}),_.associatedRemoteMediaStreams=[]);_.localCapabilities=I,_.remoteCapabilities=D,_.rtpReceiver=w,_.rtcpParameters=x,_.sendEncodingParameters=R,_.recvEncodingParameters=k,r._transceive(r.transceivers[c],!1,M)}}else r.transceivers[c]={mid:S,isDatachannel:!0}}),void 0===this._dtlsRole&&(this._dtlsRole="offer"===n.type?"active":"passive"),this.remoteDescription={type:n.type,sdp:n.sdp},n.type){case"offer":this._updateSignalingState("have-remote-offer");break;case"answer":this._updateSignalingState("stable");break;default:throw new TypeError('unsupported type "'+n.type+'"')}return Object.keys(i).forEach(function(t){var n=i[t];if(n.getTracks().length){if(-1===r.remoteStreams.indexOf(n)){r.remoteStreams.push(n);var o=new Event("addstream");o.stream=n,e.setTimeout(function(){r._dispatchEvent("addstream",o)})}d.forEach(function(e){var t=e[0],i=e[1];n.id===e[2].id&&c(r,t,i,[n])})}}),d.forEach(function(e){e[2]||c(r,e[0],e[1],[])}),e.setTimeout(function(){r&&r.transceivers&&r.transceivers.forEach(function(e){e.iceTransport&&"new"===e.iceTransport.state&&e.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),e.iceTransport.addRemoteCandidate({}))})},4e3),Promise.resolve()},n.prototype.close=function(){this.transceivers.forEach(function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()}),this._isClosed=!0,this._updateSignalingState("closed")},n.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},n.prototype._maybeFireNegotiationNeeded=function(){var t=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,e.setTimeout(function(){if(!1!==t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}},0))},n.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach(function(e){t[e.iceTransport.state]++,t[e.dtlsTransport.state]++}),t.connected+=t.completed,e="new",t.failed>0?e="failed":t.connecting>0||t.checking>0?e="connecting":t.disconnected>0?e="disconnected":t.new>0?e="new":(t.connected>0||t.completed>0)&&(e="connected"),e!==this.iceConnectionState){this.iceConnectionState=e;var n=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",n)}},n.prototype.createOffer=function(){var n=this;if(this._isClosed)return Promise.reject(u("InvalidStateError","Can not call createOffer after close"));var i=this.transceivers.filter(function(e){return"audio"===e.kind}).length,o=this.transceivers.filter(function(e){return"video"===e.kind}).length,a=arguments[0];if(a){if(a.mandatory||a.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==a.offerToReceiveAudio&&(i=!0===a.offerToReceiveAudio?1:!1===a.offerToReceiveAudio?0:a.offerToReceiveAudio),void 0!==a.offerToReceiveVideo&&(o=!0===a.offerToReceiveVideo?1:!1===a.offerToReceiveVideo?0:a.offerToReceiveVideo)}for(this.transceivers.forEach(function(e){"audio"===e.kind?--i<0&&(e.wantReceive=!1):"video"===e.kind&&--o<0&&(e.wantReceive=!1)});i>0||o>0;)i>0&&(this._createTransceiver("audio"),i--),o>0&&(this._createTransceiver("video"),o--);var s=l.writeSessionBoilerplate(this._sdpSessionId,this._sdpSessionVersion++);this.transceivers.forEach(function(r,i){var o=r.track,a=r.kind,s=l.generateIdentifier();r.mid=s,r.iceGatherer||(r.iceGatherer=n._createIceGatherer(i,n.usingBundle));var c=e.RTCRtpSender.getCapabilities(a);t<15019&&(c.codecs=c.codecs.filter(function(e){return"rtx"!==e.name})),c.codecs.forEach(function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1")});var u=r.sendEncodingParameters||[{ssrc:1001*(2*i+1)}];o&&t>=15019&&"video"===a&&!u[0].rtx&&(u[0].rtx={ssrc:u[0].ssrc+1}),r.wantReceive&&(r.rtpReceiver=new e.RTCRtpReceiver(r.dtlsTransport,a)),r.localCapabilities=c,r.sendEncodingParameters=u}),"max-compat"!==this._config.bundlePolicy&&(s+="a=group:BUNDLE "+this.transceivers.map(function(e){return e.mid}).join(" ")+"\r\n"),s+="a=ice-options:trickle\r\n",this.transceivers.forEach(function(e,t){s+=r(e,e.localCapabilities,"offer",e.stream,n._dtlsRole),s+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===n.iceGatheringState||0!==t&&n.usingBundle||(e.iceGatherer.getLocalCandidates().forEach(function(e){e.component=1,s+="a="+l.writeCandidate(e)+"\r\n"}),"completed"===e.iceGatherer.state&&(s+="a=end-of-candidates\r\n"))});var c=new e.RTCSessionDescription({type:"offer",sdp:s});return Promise.resolve(c)},n.prototype.createAnswer=function(){var n=this;if(this._isClosed)return Promise.reject(u("InvalidStateError","Can not call createAnswer after close"));var o=l.writeSessionBoilerplate(this._sdpSessionId,this._sdpSessionVersion++);this.usingBundle&&(o+="a=group:BUNDLE "+this.transceivers.map(function(e){return e.mid}).join(" ")+"\r\n");var a=l.splitSections(this.remoteDescription.sdp).length-1;this.transceivers.forEach(function(e,s){if(!(s+1>a))if(e.isDatachannel)o+="m=application 0 DTLS/SCTP 5000\r\nc=IN IP4 0.0.0.0\r\na=mid:"+e.mid+"\r\n";else{if(e.stream){var c;"audio"===e.kind?c=e.stream.getAudioTracks()[0]:"video"===e.kind&&(c=e.stream.getVideoTracks()[0]),c&&t>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1})}var u=i(e.localCapabilities,e.remoteCapabilities);!u.codecs.filter(function(e){return"rtx"===e.name.toLowerCase()}).length&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,o+=r(e,u,"answer",e.stream,n._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(o+="a=rtcp-rsize\r\n")}});var s=new e.RTCSessionDescription({type:"answer",sdp:o});return Promise.resolve(s)},n.prototype.addIceCandidate=function(e){var t;if(e&&""!==e.candidate){if(void 0===e.sdpMLineIndex&&!e.sdpMid)throw new TypeError("sdpMLineIndex or sdpMid required");if(!this.remoteDescription)return Promise.reject(u("InvalidStateError","Can not add ICE candidate without a remote description"));var n=e.sdpMLineIndex;if(e.sdpMid)for(var r=0;r0?l.parseCandidate(e.candidate):{};if("tcp"===o.protocol&&(0===o.port||9===o.port))return Promise.resolve();if(o.component&&1!==o.component)return Promise.resolve();if((0===n||n>0&&i.iceTransport!==this.transceivers[0].iceTransport)&&!a(i.iceTransport,o))return Promise.reject(u("OperationError","Can not add ICE candidate"));var s=e.candidate.trim();0===s.indexOf("a=")&&(s=s.substr(2)),(t=l.splitSections(this.remoteDescription.sdp))[n+1]+="a="+(o.type?s:"end-of-candidates")+"\r\n",this.remoteDescription.sdp=t.join("")}else for(var c=0;c55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){var d=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},p=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(e){return"object"===(void 0===e?"undefined":r(e))&&"object"===r(e.audio)&&(e=JSON.parse(JSON.stringify(e)),d(e.audio,"autoGainControl","mozAutoGainControl"),d(e.audio,"noiseSuppression","mozNoiseSuppression")),p(e)},a&&a.prototype.getSettings){var h=a.prototype.getSettings;a.prototype.getSettings=function(){var e=h.apply(this,arguments);return d(e,"mozAutoGainControl","autoGainControl"),d(e,"mozNoiseSuppression","noiseSuppression"),e}}if(a&&a.prototype.applyConstraints){var f=a.prototype.applyConstraints;a.prototype.applyConstraints=function(e){return"audio"===this.kind&&"object"===(void 0===e?"undefined":r(e))&&(e=JSON.parse(JSON.stringify(e)),d(e,"autoGainControl","mozAutoGainControl"),d(e,"noiseSuppression","mozNoiseSuppression")),f.apply(this,[e])}}}n.getUserMedia=function(e,r,o){if(t.version<44)return c(e,r,o);i.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(r,o)}}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof("function"==typeof Symbol?Symbol.iterator:"@@iterator")?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==("function"==typeof Symbol?Symbol.prototype:"@@prototype")?"symbol":typeof e},i=n(11),o={shimLocalStreamsAPI:function(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),"getStreamById"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getStreamById=function(e){var t=null;return this._localStreams&&this._localStreams.forEach(function(n){n.id===e&&(t=n)}),this._remoteStreams&&this._remoteStreams.forEach(function(n){n.id===e&&(t=n)}),t}),!("addStream"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),-1===this._localStreams.indexOf(e)&&this._localStreams.push(e);var n=this;e.getTracks().forEach(function(r){t.call(n,r,e)})},e.RTCPeerConnection.prototype.addTrack=function(e,n){n&&(this._localStreams?-1===this._localStreams.indexOf(n)&&this._localStreams.push(n):this._localStreams=[n]),t.call(this,e,n)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);var t=this._localStreams.indexOf(e);if(-1!==t){this._localStreams.splice(t,1);var n=this,r=e.getTracks();this.getSenders().forEach(function(e){-1!==r.indexOf(e.track)&&n.removeTrack(e)})}})}},shimRemoteStreamsAPI:function(e){"object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),"onaddstream"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(e){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=function(e){var t=e.streams[0];if(this._remoteStreams||(this._remoteStreams=[]),!(this._remoteStreams.indexOf(t)>=0)){this._remoteStreams.push(t);var n=new Event("addstream");n.stream=e.streams[0],this.dispatchEvent(n)}}.bind(this))}}))},shimCallbacksAPI:function(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype,n=t.createOffer,i=t.createAnswer,o=t.setLocalDescription,a=t.setRemoteDescription,s=t.addIceCandidate;t.createOffer=function(e,t){var r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){var n=arguments.length>=2?arguments[2]:arguments[0],r=i.apply(this,[n]);return t?(r.then(e,t),Promise.resolve()):r};var c=function(e,t,n){var r=o.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r};t.setLocalDescription=c,c=function(e,t,n){var r=a.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.setRemoteDescription=c,c=function(e,t,n){var r=s.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.addIceCandidate=c}},shimGetUserMedia:function(e){var t=e&&e.navigator;t.getUserMedia||(t.webkitGetUserMedia?t.getUserMedia=t.webkitGetUserMedia.bind(t):t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t)))},shimRTCIceServerUrls:function(e){var t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){for(var r=[],o=0;o=Number.MAX_SAFE_INTEGER&&(t=0),t+1}},function(e,t,n){"use strict";(function(e){function r(e,t,r,i,o,a,s){var c=this;this.audioTransferActive=!0,this.videoTransferActive=!0,this.rtc=e,this.id=t,this.isP2P=a,this.remoteTracks=new Map,this.localTracks=new Map,this._addedStreams=[],this.localSSRCs=new Map,this.localUfrag=null,this.remoteUfrag=null,this.signalingLayer=r,this._peerVideoTypeChanged=this._peerVideoTypeChanged.bind(this),this.signalingLayer.on(T.b,this._peerVideoTypeChanged),this._peerMutedChanged=this._peerMutedChanged.bind(this),this.signalingLayer.on(T.a,this._peerMutedChanged),this.options=s,this.peerconnection=new h.a.RTCPeerConnectionType(i,o),this.updateLog=[],this.stats={},this.statsinterval=null,this.maxstats=0;var u=n(154).Interop;this.interop=new u;var l=n(158);this.simulcast=new l({numOfLayers:w,explodeRemoteSimulcast:!1}),this.sdpConsistency=new b.a(this.toString()),this.localSdpMunger=new d.a(this),this.eventEmitter=e.eventEmitter,this.rtxModifier=new g.a,this.trace=function(e,t){E.debug(e,t),c.updateLog.push({time:new Date,type:e,value:t||""})},this.onicecandidate=null,this.peerconnection.onicecandidate=function(e){f.b.isTemasysPluginUsed()||c.trace("onicecandidate",JSON.stringify(e.candidate,null," ")),null!==c.onicecandidate&&c.onicecandidate(e)},this.peerconnection.onaddstream=function(e){return c._remoteStreamAdded(e.stream)},this.peerconnection.onremovestream=function(e){return c._remoteStreamRemoved(e.stream)},this.onsignalingstatechange=null,this.peerconnection.onsignalingstatechange=function(e){c.trace("onsignalingstatechange",c.signalingState),null!==c.onsignalingstatechange&&c.onsignalingstatechange(e)},this.oniceconnectionstatechange=null,this.peerconnection.oniceconnectionstatechange=function(e){c.trace("oniceconnectionstatechange",c.iceConnectionState),null!==c.oniceconnectionstatechange&&c.oniceconnectionstatechange(e)},this.onnegotiationneeded=null,this.peerconnection.onnegotiationneeded=function(e){c.trace("onnegotiationneeded"),null!==c.onnegotiationneeded&&c.onnegotiationneeded(e)},this.ondatachannel=null,this.peerconnection.ondatachannel=function(e){c.trace("ondatachannel"),null!==c.ondatachannel&&c.ondatachannel(e)},!f.b.isFirefox()&&this.maxstats&&(this.statsinterval=window.setInterval(function(){c.peerconnection.getStats(function(e){for(var t=e.result(),n=new Date,r=0;rc.maxstats&&(o.values.shift(),o.times.shift()),o.endTime=n})})(r)})},1e3)),E.info("Create new "+this)}function i(e){return e&&e.groups&&e.groups.length?e.groups[0].ssrcs[0]:e&&e.ssrcs&&e.ssrcs.length?e.ssrcs[0]:null}t.a=r;var o=n(0),a=(n.n(o),n(15)),s=n.n(a),c=n(3),u=(n.n(c),n(150)),l=n(4),d=n(151),p=n(27),h=n(28),f=n(1),m=n(9),v=n.n(m),g=n(152),y=n(53),b=n(153),S=n(29),_=n(14),T=n(54),C="function"==typeof Symbol&&"symbol"==typeof("function"==typeof Symbol?Symbol.iterator:"@@iterator")?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==("function"==typeof Symbol?Symbol.prototype:"@@prototype")?"symbol":typeof e},E=Object(o.getLogger)(e),w=3,R=["1","2","3"],k=function(e){return void 0===e||null===e?"":"type: "+e.type+"\r\n"+e.sdp};r.prototype.getConnectionState=function(){var e=this.peerconnection.iceConnectionState;return"completed"===e?"connected":e},r.prototype._getDesiredMediaDirection=function(e){var t=!0;return e===l.a?t=this.audioTransferActive:e===l.b&&(t=this.videoTransferActive),t?this.hasAnyTracksOfType(e)?"sendrecv":"recvonly":"inactive"},r.prototype.isSimulcastOn=function(){return!this.options.disableSimulcast&&f.b.supportsSimulcast()&&(!f.b.isFirefox()||this.options.enableFirefoxSimulcast)},r.prototype._peerVideoTypeChanged=function(e,t){if(e){var n=this.getRemoteTracks(e,l.b);n.length&&n[0]._setVideoType(t)}else E.error("No endpointID on peerVideoTypeChanged "+this)},r.prototype._peerMutedChanged=function(e,t,n){if(e){var r=this.getRemoteTracks(e,t);r.length&&r[0].setMute(n)}else E.error("On peerMuteChanged - no endpoint ID")},r.prototype.getLocalTracks=function(e){var t=Array.from(this.localTracks.values());return void 0!==e&&(t=t.filter(function(t){return t.getType()===e})),t},r.prototype.hasAnyTracksOfType=function(e){if(!e)throw new Error('"mediaType" is required');return this.getLocalTracks(e).length>0},r.prototype.getRemoteTracks=function(e,t){var n=[],r=e?[e]:this.remoteTracks.keys(),i=!0,o=!1,a=void 0;try{for(var s,c=r["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(i=(s=c.next()).done);i=!0){var u=s.value,l=this.remoteTracks.get(u);if(l){var d=!0,p=!1,h=void 0;try{for(var f,m=l.keys()["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(d=(f=m.next()).done);d=!0){var v=f.value;if(!t||t===v){var g=l.get(v);g&&n.push(g)}}}catch(e){p=!0,h=e}finally{try{!d&&m.return&&m.return()}finally{if(p)throw h}}}}}catch(e){o=!0,a=e}finally{try{!i&&c.return&&c.return()}finally{if(o)throw a}}return n},r.prototype.getTrackBySSRC=function(e){if("number"!=typeof e)throw new Error("SSRC "+e+" is not a number");var t=!0,n=!1,r=void 0;try{for(var i,o=this.localTracks.values()["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(t=(i=o.next()).done);t=!0){var a=i.value;if(this.getLocalSSRC(a)===e)return a}}catch(e){n=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}var s=!0,c=!1,u=void 0;try{for(var l,d=this.getRemoteTracks()["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(s=(l=d.next()).done);s=!0){var p=l.value;if(p.getSSRC()===e)return p}}catch(e){c=!0,u=e}finally{try{!s&&d.return&&d.return()}finally{if(c)throw u}}return null},r.prototype._remoteStreamAdded=function(e){var t=this,n=p.a.getStreamID(e);if(p.a.isUserStreamById(n)){(f.b.isChrome()||f.b.isNWJS()||f.b.isElectron()||f.b.isEdge())&&(e.onaddtrack=function(n){t._remoteTrackAdded(e,n.track)},e.onremovetrack=function(n){t._remoteTrackRemoved(e,n.track)});var r=e.getAudioTracks(),i=!0,o=!1,a=void 0;try{for(var s,c=r["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(i=(s=c.next()).done);i=!0){var u=s.value;this._remoteTrackAdded(e,u)}}catch(e){o=!0,a=e}finally{try{!i&&c.return&&c.return()}finally{if(o)throw a}}var l=e.getVideoTracks(),d=!0,h=!1,m=void 0;try{for(var v,g=l["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(d=(v=g.next()).done);d=!0){var y=v.value;this._remoteTrackAdded(e,y)}}catch(e){h=!0,m=e}finally{try{!d&&g.return&&g.return()}finally{if(h)throw m}}}else E.info(this+" ignored remote 'stream added' event for non-user streamid: "+n)},r.prototype._remoteTrackAdded=function(e,t){var n=p.a.getStreamID(e),r=t.kind;if(E.info(this+" remote track added:",n,r),r){var i=new y.a(this.remoteDescription.sdp).media.filter(function(e){return e.startsWith("m="+r)});if(i.length){var o=_.a.findLines(i[0],"a=ssrc:");if((o=o.filter(function(e){var t=f.b.isTemasysPluginUsed()?"mslabel":"msid";return-1!==e.indexOf(t+":"+n)})).length){var a=o[0].substring(7).split(" ")[0],s=Number(a),u=this.signalingLayer.getSSRCOwner(s);if(isNaN(s)||s<0)c.callErrorHandler(new Error("Invalid SSRC: "+a+" for remote track, msid: "+n+" media type: "+r));else if(u){E.log(this+" associated ssrc",u,s);var l=this.signalingLayer.getPeerMediaInfo(u,r);if(l){var d=l.muted,h=l.videoType;this._createRemoteTrack(u,e,t,r,h,s,d)}else c.callErrorHandler(new Error(this+": no peer media info available for "+u))}else c.callErrorHandler(new Error("No SSRC owner known for: "+s+" for remote track, msid: "+n+" media type: "+r))}else c.callErrorHandler(new Error("No SSRC lines for streamId "+n+" for remote track, media type: "+r))}else c.callErrorHandler(new Error("No media lines for type "+r+" found in remote SDP for remote track: "+n))}else c.callErrorHandler(new Error("MediaType undefined for remote track, stream id: "+n))},r.prototype._createRemoteTrack=function(e,t,n,r,i,o,a){var s=new u.a(this.rtc,this.rtc.conference,e,t,n,r,i,o,a,this.isP2P),c=this.remoteTracks.get(e);c||(c=new Map,this.remoteTracks.set(e,c)),c.has(r)&&E.error(this+" overwriting remote track! "+s,e,r),c.set(r,s),this.eventEmitter.emit(v.a.REMOTE_TRACK_ADDED,s)},r.prototype._remoteStreamRemoved=function(e){if(p.a.isUserStream(e)){var t=e.getVideoTracks(),n=!0,r=!1,i=void 0;try{for(var o,a=t["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(n=(o=a.next()).done);n=!0){var s=o.value;this._remoteTrackRemoved(e,s)}}catch(e){r=!0,i=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw i}}var c=e.getAudioTracks(),u=!0,l=!1,d=void 0;try{for(var h,f=c["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(u=(h=f.next()).done);u=!0){var m=h.value;this._remoteTrackRemoved(e,m)}}catch(e){l=!0,d=e}finally{try{!u&&f.return&&f.return()}finally{if(l)throw d}}}else{var v=p.a.getStreamID(e);E.info("Ignored remote 'stream removed' event for non-user stream "+v)}},r.prototype._remoteTrackRemoved=function(e,t){var n=p.a.getStreamID(e),r=t&&p.a.getTrackID(t);E.info(this+" - remote track removed: "+n+", "+r),n?r?this._removeRemoteTrackById(n,r)||E.warn(this+" Removed track not found for msid: "+n+",\n track id: "+r):c.callErrorHandler(new Error(this+" remote track removal failed - no track ID")):c.callErrorHandler(new Error(this+" remote track removal failed - no stream ID"))},r.prototype._getRemoteTrackById=function(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=this.remoteTracks.values()["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(n=(o=a.next()).done);n=!0){var s=o.value,c=!0,u=!1,l=void 0;try{for(var d,p=s.values()["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(c=(d=p.next()).done);c=!0){var h=d.value;if(h.getStreamId()==e&&h.getTrackId()==t)return h}}catch(e){u=!0,l=e}finally{try{!c&&p.return&&p.return()}finally{if(u)throw l}}}}catch(e){r=!0,i=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw i}}},r.prototype.removeRemoteTracks=function(e){var t=[],n=this.remoteTracks.get(e);if(n){var r=n.get(l.a),i=n.get(l.b);r&&t.push(r),i&&t.push(i),this.remoteTracks.delete(e)}return E.debug(this+" removed remote tracks for "+e+" count: "+t.length),t},r.prototype._removeRemoteTrack=function(e){e.dispose();var t=e.getParticipantId(),n=this.remoteTracks.get(t);n?n.delete(e.getType())||E.error("Failed to remove "+e+" - type mapping messed up ?"):E.error("removeRemoteTrack: no remote tracks map for "+t),this.eventEmitter.emit(v.a.REMOTE_TRACK_REMOVED,e)},r.prototype._removeRemoteTrackById=function(e,t){var n=this._getRemoteTrackById(e,t);return n&&this._removeRemoteTrack(n),n},r.prototype.getLocalSSRC=function(e){var t=this._getSSRC(e.rtcId);return t&&t.ssrcs[0]},r.prototype._injectSsrcGroupForUnifiedSimulcast=function(e){var t=s.a.parse(e.sdp),n=t.media.find(function(e){return"video"===e.type});if(n.simulcast_03){var r=[];if(n.ssrcs.forEach(function(e){"msid"===e.attribute&&r.push(e.id)}),n.ssrcGroups=n.ssrcGroups||[],n.ssrcGroups.find(function(e){return"SIM"===e.semantics}))return e;n.ssrcGroups.push({semantics:"SIM",ssrcs:r.join(" ")})}return new RTCSessionDescription({type:e.type,sdp:s.a.write(t)})};var I={signalingState:function(){return this.peerconnection.signalingState},iceConnectionState:function(){return this.peerconnection.iceConnectionState},localDescription:function(){var e=this.peerconnection.localDescription;return e?(this.trace("getLocalDescription::preTransform",k(e)),f.b.usesUnifiedPlan()&&(e=this.interop.toPlanB(e),this.trace("getLocalDescription::postTransform (Plan B)",k(e)),e=this._injectSsrcGroupForUnifiedSimulcast(e),this.trace("getLocalDescription::postTransform (inject ssrc group)",k(e))),f.b.doesVideoMuteByStreamRemove()&&(e=this.localSdpMunger.maybeAddMutedLocalVideoTracksToSDP(e),E.debug("getLocalDescription::postTransform (munge local SDP)",e)),e=(function(e){if(!e)throw new Error("No local description passed in.");var t=new S.a(e.sdp),n=t.selectMedia("audio"),r=!1;n&&"sendrecv"!==n.direction&&(n.direction="sendrecv",r=!0);var i=t.selectMedia("video");return i&&"sendrecv"!==i.direction&&(i.direction="sendrecv",r=!0),r?new RTCSessionDescription({type:e.type,sdp:t.toRawSDP()}):e})(e),e=this.localSdpMunger.transformStreamIdentifiers(e)):(E.debug("getLocalDescription no localDescription found"),{})},remoteDescription:function(){var e=this.peerconnection.remoteDescription;return this.trace("getRemoteDescription::preTransform",k(e)),f.b.usesUnifiedPlan()&&(e=this.interop.toPlanB(e),this.trace("getRemoteDescription::postTransform (Plan B)",k(e))),e||{}}};Object.keys(I).forEach(function(e){Object.defineProperty(r.prototype,e,{get:I[e]})}),r.prototype._getSSRC=function(e){return this.localSSRCs.get(e)},r.prototype.addTrack=function(e){var t=e.rtcId;if(E.info("add "+e+" to: "+this),this.localTracks.has(t))E.error(e+" is already in "+this);else{this.localTracks.set(t,e);var n=e.getOriginalStream();if(n?this._addStream(n):(!f.b.doesVideoMuteByStreamRemove()||e.isAudioTrack()||e.isVideoTrack()&&!e.isMuted())&&E.error(this+" no WebRTC stream for: "+e),f.b.doesVideoMuteByStreamRemove()&&e.isVideoTrack()&&e.isMuted()){var r=this.generateNewStreamSSRCInfo(e);this.sdpConsistency.setPrimarySsrc(r.ssrcs[0]);var i=r.groups.find(function(e){return"SIM"===e.semantics});i&&this.simulcast.setSsrcCache(i.ssrcs);var o=r.groups.filter(function(e){return"FID"===e.semantics});if(o){var a=new Map;o.forEach(function(e){var t=e.ssrcs[0],n=e.ssrcs[1];a.set(t,n)}),this.rtxModifier.setSsrcCache(a)}}}},r.prototype.addTrackUnmute=function(e){if(!this._assertTrackBelongs("addTrackUnmute",e))return!1;E.info("Adding "+e+" as unmute to "+this);var t=e.getOriginalStream();return t?(this._addStream(t),!0):(E.error("Unable to add "+e+" as unmute to "+this+" - no WebRTC stream"),!1)},r.prototype._addStream=function(e){this.peerconnection.addStream(e),this._addedStreams.push(e)},r.prototype._removeStream=function(e){f.b.isFirefox()?this._handleFirefoxRemoveStream(e):this.peerconnection.removeStream(e),this._addedStreams=this._addedStreams.filter(function(t){return t!==e})},r.prototype._assertTrackBelongs=function(e,t){var n=this.localTracks.has(t.rtcId);return n||E.error(e+": "+t+" does not belong to "+this),n},r.prototype.isMediaStreamInPc=function(e){return this._addedStreams.indexOf(e)>-1},r.prototype.removeTrack=function(e){var t=e.getOriginalStream();this.trace("removeStream",e.rtcId,t?t.id:void 0),this._assertTrackBelongs("removeStream",e)&&(this.localTracks.delete(e.rtcId),this.localSSRCs.delete(e.rtcId),t&&(f.b.isFirefox()?this._handleFirefoxRemoveStream(t):this.peerconnection.removeStream(t)))},r.prototype.removeTrackMute=function(e){var t=e.getOriginalStream();return this.trace("removeStreamMute",e.rtcId,t?t.id:null),!!this._assertTrackBelongs("removeStreamMute",e)&&(t?(E.info("Removing "+e+" as mute from "+this),this._removeStream(t),!0):(E.error("removeStreamMute - no WebRTC stream for "+e),!1))},r.prototype._handleFirefoxRemoveStream=function(e){if(e){var t=null,n=null;e.getAudioTracks()&&e.getAudioTracks().length?n=e.getAudioTracks()[0]:e.getVideoTracks()&&e.getVideoTracks().length&&(n=e.getVideoTracks()[0]),n?(this.peerconnection.getSenders().some(function(e){return e.track===n&&(t=e,!0)}),t?this.peerconnection.removeTrack(t):E.log("Cannot remove tracks: no RTPSender.")):E.error("Cannot remove tracks: no tracks.")}},r.prototype.createDataChannel=function(e,t){return this.trace("createDataChannel",e,t),this.peerconnection.createDataChannel(e,t)},r.prototype._ensureSimulcastGroupIsLast=function(e){var t=e.sdp,n=t.indexOf("m=video"),r=t.indexOf("a=ssrc-group:SIM",n),i=t.lastIndexOf("a=ssrc-group");if(-1===r||-1===i||i===r)return e;var o=t.indexOf("\r\n",r),a=t.substring(r,o+2);i=(t=t.replace(a,"")).lastIndexOf("a=ssrc-group");var s=t.indexOf("\r\n",i);return t=t.slice(0,s)+"\r\n"+a.trim()+t.slice(s),new RTCSessionDescription({type:e.type,sdp:t})},r.prototype._adjustLocalMediaDirection=function(e){var t=new S.a(e.sdp),n=!1,r=t.selectMedia("audio");if(r){var i=this._getDesiredMediaDirection(l.a);r.direction!==i&&(r.direction=i,E.info("Adjusted local audio direction to "+i),n=!0)}else E.warn('No "audio" media found int the local description');var o=t.selectMedia("video");if(o){var a=this._getDesiredMediaDirection(l.b);o.direction!==a&&(o.direction=a,E.info("Adjusted local video direction to "+a),n=!0)}else E.warn('No "video" media found in the local description');return n?new RTCSessionDescription({type:e.type,sdp:t.toRawSDP()}):e},r.prototype.setLocalDescription=function(e,t,n){var r=this,i=e;if(this.trace("setLocalDescription::preTransform",k(i)),this.options.disableH264||this.options.preferH264){var o=s.a.parse(i.sdp),a=o.media.find(function(e){return"video"===e.type});this.options.disableH264?_.a.stripVideoCodec(a,"h264"):_.a.preferVideoCodec(a,"h264"),i=new RTCSessionDescription({type:i.type,sdp:s.a.write(o)}),this.trace("setLocalDescription::postTransform (H264)",k(i))}i=this._adjustLocalMediaDirection(i),i=this._ensureSimulcastGroupIsLast(i),f.b.usesUnifiedPlan()&&(i=this.interop.toUnifiedPlan(i),this.trace("setLocalDescription::postTransform (Unified Plan)",k(i))),this.peerconnection.setLocalDescription(i,function(){r.trace("setLocalDescriptionOnSuccess");var e=_.a.getUfrag(i.sdp);e!==r.localUfrag&&(r.localUfrag=e,r.eventEmitter.emit(v.a.LOCAL_UFRAG_CHANGED,r,e)),t()},function(e){r.trace("setLocalDescriptionOnFailure",e),r.eventEmitter.emit(v.a.SET_LOCAL_DESCRIPTION_FAILED,e,r),n(e)})},r.prototype.setAudioTransferActive=function(e){E.debug(this+" audio transfer active: "+e);var t=this.audioTransferActive!==e;return this.audioTransferActive=e,t},r.prototype._insertUnifiedPlanSimulcastReceive=function(e){var t=s.a.parse(e.sdp),n=t.media.find(function(e){return"video"===e.type});return n.rids=[{id:"1",direction:"recv"},{id:"2",direction:"recv"},{id:"3",direction:"recv"}],n.simulcast_03={value:"recv rid="+R.join(";")},new RTCSessionDescription({type:e.type,sdp:s.a.write(t)})},r.prototype.setRemoteDescription=function(e,t,r){var i=this;if(this.trace("setRemoteDescription::preTransform",k(e)),e=this.simulcast.mungeRemoteDescription(e),this.trace("setRemoteDescription::postTransform (simulcast)",k(e)),this.options.preferH264){var o=s.a.parse(e.sdp),a=o.media.find(function(e){return"video"===e.type});_.a.preferVideoCodec(a,"h264"),e=new RTCSessionDescription({type:e.type,sdp:s.a.write(o)})}f.b.usesUnifiedPlan()?(e=new RTCSessionDescription({type:e.type,sdp:this.rtxModifier.stripRtx(e.sdp)}),this.trace("setRemoteDescription::postTransform (stripRtx)",k(e)),e=this.interop.toUnifiedPlan(e),this.trace("setRemoteDescription::postTransform (Plan A)",k(e)),this.isSimulcastOn()&&(e=this._insertUnifiedPlanSimulcastReceive(e),this.trace("setRemoteDescription::postTransform (sim receive)",k(e)))):e=(function(e){if("object"!==(void 0===e?"undefined":C(e))||null===e||"string"!=typeof e.sdp)return E.warn("An empty description was passed as an argument."),e;var t=n(15),r=t.parse(e.sdp);void 0!==r&&void 0!==r.media&&Array.isArray(r.media)&&r.media.forEach(function(e){var t=[],n=[];if(void 0!==e.ssrcGroups&&Array.isArray(e.ssrcGroups)&&e.ssrcGroups.forEach(function(e){void 0!==e.semantics&&"FID"===e.semantics&&void 0!==e.ssrcs&&t.push(Number(e.ssrcs.split(" ")[0]))}),Array.isArray(e.ssrcs)){var r=void 0;for(r=0;r=0&&(n.push(e.ssrcs[r]),delete e.ssrcs[r]);for(r=0;r=96;u--)if(!a.includes(u)){c=u,a.push(u),n.payloads=a.join(" ");break}return void 0===c?(E.error("Could not find valid payload type to inject."),e):(o.push({codec:"H264",payload:c,rate:9e4}),r.push({config:"level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f",payload:c}),E.debug("Injecting H264 payload type "+c+" into video mLine."),new RTCSessionDescription({type:e.type,sdp:s.a.write(t)}))},r.prototype.setVideoTransferActive=function(e){E.debug(this+" video transfer active: "+e);var t=this.videoTransferActive!==e;return this.videoTransferActive=e,t},r.prototype.generateRecvonlySsrc=function(){var e=_.a.generateSsrc();E.info(this+" generated new recvonly SSRC: "+e),this.sdpConsistency.setPrimarySsrc(e)},r.prototype.clearRecvonlySsrc=function(){E.info("Clearing primary video SSRC!"),this.sdpConsistency.clearVideoSsrcCache()},r.prototype.close=function(){this.trace("stop"),this.signalingLayer.off(T.a,this._peerMutedChanged),this.signalingLayer.off(T.b,this._peerVideoTypeChanged);var e=!0,t=!1,n=void 0;try{for(var r,i=this.remoteTracks.values()["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(e=(r=i.next()).done);e=!0){var o=r.value,a=!0,s=!1,c=void 0;try{for(var u,l=o.values()["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(a=(u=l.next()).done);a=!0){var d=u.value;this._removeRemoteTrack(d)}}catch(e){s=!0,c=e}finally{try{!a&&l.return&&l.return()}finally{if(s)throw c}}}}catch(e){t=!0,n=e}finally{try{!e&&i.return&&i.return()}finally{if(t)throw n}}this.remoteTracks.clear(),this._addedStreams=[],this.rtc._removePeerConnection(this)||E.error("RTC._removePeerConnection returned false"),null!==this.statsinterval&&(window.clearInterval(this.statsinterval),this.statsinterval=null),E.info("Closing "+this+"..."),this.peerconnection.close()},r.prototype.createAnswer=function(e,t,n){if(f.b.supportsRtpSender()&&this.isSimulcastOn()){var r={encodings:[{rid:"1",scaleResolutionDownBy:4},{rid:"2",scaleResolutionDownBy:2},{rid:"3"}]};this.peerconnection.getSenders().find(function(e){return"video"===e.track.kind}).setParameters(r)}this._createOfferOrAnswer(!1,e,t,n)},r.prototype.createOffer=function(e,t,n){this._createOfferOrAnswer(!0,e,t,n)},r.prototype._createOfferOrAnswer=function(e,t,n,r){var i=this,o=e?"Offer":"Answer";this.trace("create"+o,JSON.stringify(r,null," "));var a=function(r){try{if(i.trace("create"+o+"OnSuccess::preTransform",k(r)),f.b.usesUnifiedPlan()&&(r=i.interop.toPlanB(r),i.trace("create"+o+"OnSuccess::postTransform (Plan B)",k(r)),i.isSimulcastOn()&&(r=i._injectSsrcGroupForUnifiedSimulcast(r),i.trace("create"+o+"OnSuccess::postTransform(inject ssrc group)",k(r)))),f.b.isFirefox()||(i.hasAnyTracksOfType(l.b)||i.sdpConsistency.hasPrimarySsrcCached()||i.generateRecvonlySsrc(),r=new RTCSessionDescription({type:r.type,sdp:i.sdpConsistency.makeVideoPrimarySsrcsConsistent(r.sdp)}),i.trace("create"+o+"OnSuccess::postTransform (make primary audio/video ssrcs consistent)",k(r))),i.isSimulcastOn()&&(r=i.simulcast.mungeLocalDescription(r),i.trace("create"+o+"OnSuccess::postTransform (simulcast)",k(r))),!i.options.disableRtx&&f.b.supportsRtx()&&(r=new RTCSessionDescription({type:r.type,sdp:i.rtxModifier.modifyRtxSsrcs(r.sdp)}),i.trace("create"+o+"OnSuccess::postTransform (rtx modifier)",k(r))),!e){var a=new y.a(i.remoteDescription.sdp),c=new y.a(r.sdp);d=a,p=c,f.b.isChrome()&&d&&p&&d.media&&p.media&&d.media.length===p.media.length&&(p.media.forEach(function(e,t){_.a.findLine(d.media[t],"a=setup:actpass",d.session)&&(p.media[t]=e.replace(/a=setup:active/g,"a=setup:passive"))}),p.raw=p.session+p.media.join("")),r=new RTCSessionDescription({type:r.type,sdp:c.raw})}var u=(function(e){var t=new Map,n=new Map;if("object"!==(void 0===e?"undefined":C(e))||null===e||"string"!=typeof e.sdp)return E.warn("An empty description was passed as an argument."),t;var r=s.a.parse(e.sdp);if(!Array.isArray(r.media))return t;var i=!0,o=!1,a=void 0;try{for(var c,u=r.media["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(i=(c=u.next()).done);i=!0){var l=c.value;if(Array.isArray(l.ssrcs)){if(Array.isArray(l.ssrcGroups)){var d=!0,p=!1,h=void 0;try{for(var f,m=l.ssrcGroups["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(d=(f=m.next()).done);d=!0){var v=f.value;if(void 0!==v.semantics&&void 0!==v.ssrcs){var g=v.ssrcs.split(" ").map(function(e){return parseInt(e,10)}),y=g[0];v.ssrcs=g,n.has(y)||n.set(y,[]),n.get(y).push(v)}}}catch(e){p=!0,h=e}finally{try{!d&&m.return&&m.return()}finally{if(p)throw h}}}var b=!0,S=!1,_=void 0;try{for(var T,w=l.ssrcs["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(b=(T=w.next()).done);b=!0){var R=T.value;if("msid"===R.attribute){var k=R.value,I=t.get(k);I||(I={ssrcs:[],groups:[],msid:k},t.set(k,I));var P=R.id;if(I.ssrcs.push(P),n.has(P)){var A=n.get(P),O=!0,D=!1,x=void 0;try{for(var N,L=A["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(O=(N=L.next()).done);O=!0){var M=N.value;I.groups.push(M)}}catch(e){D=!0,x=e}finally{try{!O&&L.return&&L.return()}finally{if(D)throw x}}}}}}catch(e){S=!0,_=e}finally{try{!b&&w.return&&w.return()}finally{if(S)throw _}}}}}catch(e){o=!0,a=e}finally{try{!i&&u.return&&u.return()}finally{if(o)throw a}}return t})(r);E.debug("Got local SSRCs MAP: ",u),i._processLocalSSRCsMap(u),t(r)}catch(e){i.trace("create"+o+"OnError",e),i.trace("create"+o+"OnError",k(r)),E.error("create"+o+"OnError",e,k(r)),n(e)}var d,p},c=function(t){i.trace("create"+o+"OnFailure",t);var r=e?v.a.CREATE_OFFER_FAILED:v.a.CREATE_ANSWER_FAILED;i.eventEmitter.emit(r,t,i),n(t)};e?this.peerconnection.createOffer(a,c,r):this.peerconnection.createAnswer(a,c,r)},r.prototype._processLocalSSRCsMap=function(e){var t=!0,n=!1,r=void 0;try{for(var o,a=this.localTracks.values()["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(t=(o=a.next()).done);t=!0){var s=o.value,c=s.getMSID();if(e.has(c)){var u=e.get(c);if(!u)return void E.error("No SSRC found for: "+c+" in "+this);var l=this.localSSRCs.get(s.rtcId),d=i(u),p=i(l);d!==p?(null===p?E.info("Storing new local SSRC for "+s+" in "+this,u):E.error("Overwriting SSRC for "+s+" "+c+" in "+this+" with: ",u),this.localSSRCs.set(s.rtcId,u),this.eventEmitter.emit(v.a.LOCAL_TRACK_SSRC_UPDATED,s,d)):E.debug("The local SSRC("+d+") for "+s+" "+c+"is still up to date in "+this)}else E.warn("No local track matched with: "+c+" in "+this)}}catch(e){n=!0,r=e}finally{try{!t&&a.return&&a.return()}finally{if(n)throw r}}},r.prototype.addIceCandidate=function(e,t,n){this.trace("addIceCandidate",JSON.stringify({candidate:e.candidate,sdpMid:e.sdpMid,sdpMLineIndex:e.sdpMLineIndex,usernameFragment:e.usernameFragment},null," ")),this.peerconnection.addIceCandidate(e,t,n)},r.prototype.getStats=function(e,t){f.b.isFirefox()||f.b.isTemasysPluginUsed()||f.b.isReactNative()?this.peerconnection.getStats(null,e,t||function(){}):f.b.isSafariWithWebrtc()||this.peerconnection.getStats(e)},r.prototype.generateNewStreamSSRCInfo=function(e){var t=e.rtcId,n=this._getSSRC(t);if(n&&E.error("Will overwrite local SSRCs for track ID: "+t),this.isSimulcastOn()){n={ssrcs:[],groups:[]};for(var r=0;r should fake sdp ? : "+m),m){var v=this.tpc.isSimulcastOn()?this.tpc.simulcast.ssrcCache:[this.tpc.sdpConsistency.cachedPrimarySsrc];if(v.length){r=!0,n.direction="sendrecv";var g="injected-"+v[0],y=!0,b=!1,S=void 0;try{for(var _,T=v["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(y=(_=T.next()).done);y=!0){var C=_.value;n.removeSSRC(C),s.debug(this.tpc+" injecting video SSRC: "+C+" for "+d),n.addSSRCAttribute({id:C,attribute:"cname",value:g}),n.addSSRCAttribute({id:C,attribute:"msid",value:d.storedMSID})}}catch(e){b=!0,S=e}finally{try{!y&&T.return&&T.return()}finally{if(b)throw S}}if(v.length>1){var E={ssrcs:v.join(" "),semantics:"SIM"};n.findGroup(E.semantics,E.ssrcs)||(s.debug(this.tpc+" injecting SIM group for "+d,E),n.addSSRCGroup(E))}this.tpc.options.disableRtx||this.tpc.rtxModifier.modifyRtxSsrcs2(n)}else s.error("No SSRCs stored for: "+d+" in "+this.tpc)}}}catch(e){a=!0,c=e}finally{try{!o&&l.return&&l.return()}finally{if(a)throw c}}return r}},{key:"_transformMediaIdentifiers",value:function(e){var t=this.tpc.id,n=!0,r=!1,i=void 0;try{for(var o,a=e.ssrcs["function"==typeof Symbol?Symbol.iterator:"@@iterator"]();!(n=(o=a.next()).done);n=!0){var c=o.value;switch(c.attribute){case"cname":case"label":case"mslabel":c.value=c.value&&c.value+"-"+t;break;case"msid":if(c.value){var u=c.value.split(" ");if(2===u.length){var l=u[0],d=u[1];c.value=l+"-"+t+" "+d+"-"+t}else s.warn("Unable to munge local MSID- weird format detected: "+c.value)}}}}catch(e){r=!0,i=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw i}}}},{key:"maybeAddMutedLocalVideoTracksToSDP",value:function(e){if(!e)throw new Error("No local description passed in.");var t=new o.a(e.sdp);return this._addMutedLocalVideoTracksToSDP(t)?new RTCSessionDescription({type:e.type,sdp:t.toRawSDP()}):e}},{key:"transformStreamIdentifiers",value:function(e){if(!e||!e.sdp||!e.type)return e;var t=new o.a(e.sdp),n=t.selectMedia("audio");n&&this._transformMediaIdentifiers(n);var r=t.selectMedia("video");return r&&this._transformMediaIdentifiers(r),new RTCSessionDescription({type:e.type,sdp:t.toRawSDP()})}}]),e})();t.a=c}).call(t,"modules/RTC/LocalSdpMunger.js")},function(e,t,n){"use strict";(function(e){function r(e,t,n){c.debug("Updating mline to associate "+n+"rtx ssrc with primary stream, "+t.id);var r=t.id,i=t.msid,o=t.cname,a=e.getRtxSSRC(r);a!==n?(a&&(c.debug(r+" was previously associated with rtx"+a+", removing all references to it"),e.removeSSRC(a),c.debug("groups before filtering for "+a),c.debug(e.dumpSSRCGroups()),e.removeGroupsWithSSRC(a)),e.addSSRCAttribute({id:n,attribute:"cname",value:o}),e.addSSRCAttribute({id:n,attribute:"msid",value:i}),e.addSSRCGroup({semantics:"FID",ssrcs:r+" "+n})):c.debug(n+" was already associated with "+r)}var i=n(0),o=(n.n(i),n(29)),a=n(14),s=(function(){function e(e,t){for(var n=0;n3||!n.media.every(function(e){return-1!==["video","audio","data"].indexOf(e.mid)}))return console.warn("This description does not look like Plan B."),e;var r=[];n.media.forEach(function(e){r.push(e.mid)});var s=!1;if(void 0!==n.groups&&Array.isArray(n.groups)&&(s=n.groups.every(function(e){return"BUNDLE"!==e.type||a.apply(e.mids.sort(),[r.sort()])})),!s)throw new Error("Cannot convert to Unified Plan because m-lines that are not bundled were found.");var c;void 0!==this.cache[e.type]&&(c=o.parse(this.cache[e.type]));var u={audio:{},video:{}},l={},d=0,p=0;if(n.media.forEach(function(n){if(("string"!=typeof n.rtcpMux||"rtcp-mux"!==n.rtcpMux)&&"inactive"!==n.direction)throw new Error("Cannot convert to Unified Plan because m-lines without the rtcp-mux attribute were found.");if("application"!==n.type){var r=n.sources,o=n.ssrcGroups,a=n.candidates,s=n.iceUfrag,h=n.icePwd,f=n.fingerprint,m=n.port;delete n.sources,delete n.ssrcGroups,delete n.candidates,delete n.iceUfrag,delete n.icePwd,delete n.fingerprint,delete n.port,delete n.mid;var v={};void 0!==o&&Array.isArray(o)&&o.forEach(function(e){"SIM"!==e.semantics&&void 0!==e.ssrcs&&Array.isArray(e.ssrcs)&&e.ssrcs.forEach(function(t){void 0===v[t]&&(v[t]=[]),v[t].push(e)})});var g={};"object"===(void 0===r?"undefined":i(r))&&Object.keys(r).forEach(function(o){var y;if("offer"!==e.type||r[o].msid)if(void 0!==v[o]&&Array.isArray(v[o])&&v[o].some(function(e){return e.ssrcs.some(function(e){if("object"===i(g[e]))return y=g[e],!0})}),"object"===(void 0===y?"undefined":i(y)))y.sources[o]=r[o],delete r[o].msid;else{if(y=Object.create(n),g[o]=y,void 0!==r[o].msid&&(y.msid=r[o].msid,delete r[o].msid),y.sources={},y.sources[o]=r[o],y.ssrcGroups=v[o],void 0!==c&&void 0!==c.media&&Array.isArray(c.media)&&c.media.forEach(function(e){"object"===i(e.sources)&&Object.keys(e.sources).forEach(function(t){t===o&&(y.mid=e.mid)})}),void 0===y.mid){if("answer"===e.type)throw new Error("An unmapped SSRC was found.");y.mid=[n.type,"-",o].join("")}y.candidates=a,y.iceUfrag=s,y.icePwd=h,y.fingerprint=f,y.port=m,l[y.mid]=y,t.cache.mlU2BMap[p]=d,void 0===t.cache.mlB2UMap[d]&&(t.cache.mlB2UMap[d]=p),p++}else u[n.type][o]=r[o]}),d++}else l[n.mid]=n}),n.media=[],r=[],"answer"===e.type)for(var h=0;h0&&null===(r=t.getFirstSendingIndexFromAnswer(e)))for(var i=0;ir){var o=n.media[r];Object.keys(u[e]).forEach(function(t){o.sources&&o.sources[t]&&console.warn("Replacing an existing SSRC."),o.sources||(o.sources={}),o.sources[t]=u[e][t]})}}}),n.groups.some(function(e){if("BUNDLE"===e.type)return e.mids=r.join(" "),!0}),n.msidSemantic={semantic:"WMS",token:"*"};var m=o.write(n);return this.cache[e.type]=m,new RTCSessionDescription({type:e.type,sdp:m})}},function(e,t,n){var r=n(15);t.write=function(e,t){return void 0!==e&&void 0!==e.media&&Array.isArray(e.media)&&e.media.forEach(function(e){void 0!==e.sources&&0!==Object.keys(e.sources).length&&(e.ssrcs=[],Object.keys(e.sources).forEach(function(t){var n=e.sources[t];Object.keys(n).forEach(function(r){e.ssrcs.push({id:t,attribute:r,value:n[r]})})}),delete e.sources),void 0!==e.ssrcGroups&&Array.isArray(e.ssrcGroups)&&e.ssrcGroups.forEach(function(e){void 0!==e.ssrcs&&Array.isArray(e.ssrcs)&&(e.ssrcs=e.ssrcs.join(" "))})}),void 0!==e&&void 0!==e.groups&&Array.isArray(e.groups)&&e.groups.forEach(function(e){void 0!==e.mids&&Array.isArray(e.mids)&&(e.mids=e.mids.join(" "))}),r.write(e,t)},t.parse=function(e){var t=r.parse(e);return void 0!==t&&void 0!==t.media&&Array.isArray(t.media)&&t.media.forEach(function(e){void 0!==e.ssrcs&&Array.isArray(e.ssrcs)&&(e.sources={},e.ssrcs.forEach(function(t){e.sources[t.id]||(e.sources[t.id]={}),e.sources[t.id][t.attribute]=t.value}),delete e.ssrcs),void 0!==e.ssrcGroups&&Array.isArray(e.ssrcGroups)&&e.ssrcGroups.forEach(function(e){"string"==typeof e.ssrcs&&(e.ssrcs=e.ssrcs.split(" "))})}),void 0!==t&&void 0!==t.groups&&Array.isArray(t.groups)&&t.groups.forEach(function(e){"string"==typeof e.mids&&(e.mids=e.mids.split(" "))}),t}},function(e,t){e.exports=function e(t){if(!t)return!1;if(this.length!=t.length)return!1;for(var n=0,r=this.length;n2)return e;if(2==n&&0===r)return e;if(1===n)t=e.ssrcs[0].id;else{var i=e.ssrcGroups.filter(function(e){return"FID"===e.semantics})[0];if(!i)return e;t=parseInt(i.ssrcs.split(" ")[0])}return console.log("SdpSimulcast: current ssrc cache: ",this.ssrcCache),console.log("SdpSimulcast: parsed primary ssrc "+t),-1!==this.ssrcCache.indexOf(t)?(console.log("SdpSimulcast: Have seen primary ssrc before, filling in data from cache"),e=this._fillInSourceDataFromCache(e)):(console.log("SdpSimulcast: Have not seen primary ssrc before, generating source data"),e=this._generateSourceData(e,t)),this.ssrcCache=this._parseSimLayers(e),e},i.prototype.mungeRemoteDescription=function(e){if(!a(e))return e;var t=s.parse(e.sdp),n=this;return o(t,function(e){n.options.explodeRemoteSimulcast?(function(e){if(e&&Array.isArray(e.ssrcGroups))for(var t=u(e),n=[],r=e.ssrcGroups.length;r--;)if("SIM"===e.ssrcGroups[r].semantics){for(var i=e.ssrcGroups[r].ssrcs.split(" "),o=0;o=0)){var i=e[r];Object.keys(i).forEach(function(e){n.push({id:r,attribute:e,value:i[e]})})}})}return n},t.parseSsrcs=function(e){var t={};return void 0!==e.ssrcs&&Array.isArray(e.ssrcs)&&e.ssrcs.forEach(function(e){t[e.id]||(t[e.id]={}),t[e.id][e.attribute]=e.value}),t}},function(e,t,n){"use strict";var r=n(7),i=(function(){function e(e,t){for(var n=0;n.6&&(this._eventFired=!0,this._callback())}},{key:"_isLocalAudioTrack",value:function(e){return e.isAudioTrack()&&e.isLocal()}},{key:"_trackAdded",value:function(e){this._isLocalAudioTrack(e)&&(this.audioTrack=e)}},{key:"_trackMuteChanged",value:function(e){this._isLocalAudioTrack(e)&&e.isMuted()&&(this._eventFired=!1)}}]),e})();t.a=o},function(e,t,n){function r(){this.audioRecorder=new o,this.transcriptionService=new a,this.counter=null,this.startTime=null,this.transcription=null,this.callback=null,this.results=[],this.state=s,this.lineLength=0}function i(e){for(var t=0;t0}var o=n(59),a=n(163),s="before";r.prototype.start=function(){if(this.state!==s)throw new Error("The transcription can only start when it's in the \""+s+'" state. It\'s currently in the "'+this.state+'" state');this.state="recording",this.audioRecorder.start(),this.startTime=new Date},r.prototype.stop=function(e){var t=this;if("recording"!==this.state)throw new Error('The transcription can only stop when it\'s in the "recording" state. It\'s currently in the "'+this.state+'" state');console.log("stopping recording and sending audio files"),this.audioRecorder.stop();var n=function(e,t){if(console.log("retrieved an answer from the transcription service. The answer has an array of length: "+t.wordArray.length),t.wordArray.length>0){var n=t.startTime.getUTCMilliseconds()-e.startTime.getUTCMilliseconds();n<0&&(n=0);var r="[";t.wordArray.forEach(function(e){e.begin+=n,e.end+=n,r+=e.word+","}),r+="]",console.log(r),t.wordArray.name=t.name}e.results.push(t.wordArray),e.counter--,console.log("current counter: "+e.counter),e.maybeMerge()}.bind(null,this);this.audioRecorder.getRecordingResults().forEach(function(e){t.transcriptionService.send(e,n),t.counter++}),this.state="transcribing",this.callback=e},r.prototype.maybeMerge=function(){"transcribing"===this.state&&0===this.counter&&this.merge()},r.prototype.merge=function(){var e=this;console.log("starting merge process!\n The length of the array: "+this.results.length),this.transcription="";var t=this.results,n=[];for(i(t),t.forEach(function(e){return(function(e,t){if(0===e.length)e.push(t);else{if(e[e.length-1].begin<=t.begin)return void e.push(t);for(var n=0;n0&&"break"!==(function(){var i=!1,o=n[0].begin;if(t.forEach(function(e){e[0].begin80&&(this.transcription+="\n ",this.lineLength=4),this.transcription+=" "+e.word,this.lineLength+=e.word.length+1},r.prototype.addTrack=function(e){this.audioRecorder.addTrack(e)},r.prototype.removeTrack=function(e){this.audioRecorder.removeTrack(e)},r.prototype.getTranscription=function(){if("finished"!==this.state)throw new Error('The transcription can only be retrieved when it\'s in the "finished" state. It\'s currently in the "'+this.state+'" state');return this.transcription},r.prototype.getState=function(){return this.state},r.prototype.reset=function(){this.state=s,this.counter=null,this.transcription=null,this.startTime=null,this.callback=null,this.results=[],this.lineLength=0},e.exports=r},function(e,t){e.exports=function(e,t,n,r){this.blob=e,this.name=t,this.startTime=n,this.wordArray=r}},function(e,t,n){var r=n(164),i=n(165),o=n(59),a=function(){this.url=(function(){var e="config does not contain an url to a Sphinx4 https server";if(void 0===config.sphinxURL)console.log(e);else{var t=config.sphinxURL;if(void 0!==t.includes&&t.includes("https://"))return t;console.log(e)}})()};a.prototype=Object.create(r.prototype),a.constructor=a,a.prototype.sendRequest=function(e,t){console.log("sending an audio file to "+this.url),console.log("the audio file being sent: "+e);var n=new XMLHttpRequest;n.onreadystatechange=function(){if(n.readyState===XMLHttpRequest.DONE&&200===n.status)t(n.responseText);else if(n.readyState===XMLHttpRequest.DONE)throw new Error("unable to accept response from sphinx server. status: "+n.status)},n.open("POST",this.url),n.setRequestHeader("Content-Type",o.determineCorrectFileType()),n.send(e),console.log("send "+e)},a.prototype.formatResponse=function(e){var t=JSON.parse(e).objects;t.shift();var n=[];return t.forEach(function(e){return e.filler||n.push(new i(e.word,e.start,e.end))}),n},a.prototype.verify=function(e){if(console.log("response from server:"+e.toString()),"string"!=typeof e)return!1;var t=void 0;try{t=JSON.parse(e)}catch(e){return console.log(e),!1}if(void 0===t.objects)return!1;var n=t.objects;return!(!n[0]||!n[0]["session-id"])},e.exports=a},function(e,t){var n=function(){throw new Error("TranscriptionService is abstract and cannot becreated")};n.prototype.send=function(e,t){var n=this;this.sendRequest(e.blob,function(r){n.verify(r)?e.wordArray=n.formatResponse(r):(console.log("the retrieved response from the server is not valid!"),e.wordArray=[]),t(e)})},n.prototype.sendRequest=function(e,t){throw new Error("TranscriptionService.sendRequest is abstract")},n.prototype.formatResponse=function(e){throw new Error("TranscriptionService.format is abstract")},n.prototype.verify=function(e){throw new Error("TranscriptionService.verify is abstract")},e.exports=n},function(e,t){var n=function(e,t,n){this.word=e,this.begin=t,this.end=n};n.prototype.getWord=function(){return this.word},n.prototype.getBeginTime=function(){return this.begin},n.prototype.getEndTime=function(){return this.end},e.exports=n},function(e,t,n){"use strict";(function(e){var r=n(0),i=(n.n(r),n(167)),o=n(30),a=n(8),s=n.n(a),c=(function(){function e(e,t){for(var n=0;n0&&r(e,c.a.getCurrentlyAvailableMediaDevices()),c.a.setAudioOutputDevice(e)},addEventListener:function(e,t){h.addListener(e,t)},removeEventListener:function(e,t){h.removeListener(e,t)},emitEvent:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;rparam[value="video"]');return n.length?(n.length>1&&i.warn("Container with more than one video elements: ",e),n.parent()[0]):void 0},isResizeEventSupported:function(){return!r.b.isTemasysPluginUsed()},setVolume:function(e,t){r.b.isIExplorer()||(e.volume=t)},setAutoPlay:function(e,t){r.b.isIExplorer()||(e.autoplay=t)}};t.a=o}).call(t,"modules/RTC/RTCUIHelper.js")}])},"object"==typeof r&&"object"==typeof n?n.exports=a():"function"==typeof define&&define.amd?define([],a):"object"==typeof r?r.JitsiMeetJS=a():o.JitsiMeetJS=a();var o,a},443); -__d(function(e,t,n,r){i="undefined"!=typeof window?window:this,o=function(e,t){var n=[],r=n.slice,i=n.concat,o=n.push,s=n.indexOf,a={},u=a.toString,l=a.hasOwnProperty,c={},f=e.document,p=function e(t,n){return new e.fn.init(t,n)},d=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,h=/^-ms-/,g=/-([\da-z])/gi,m=function(e,t){return t.toUpperCase()};p.fn=p.prototype={jquery:"2.1.4",constructor:p,selector:"",length:0,toArray:function(){return r.call(this)},get:function(e){return null!=e?e<0?this[e+this.length]:this[e]:r.call(this)},pushStack:function(e){var t=p.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return p.each(this,e,t)},map:function(e){return this.pushStack(p.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(r.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n=0},isPlainObject:function(e){return"object"===p.type(e)&&!e.nodeType&&!p.isWindow(e)&&!(e.constructor&&!l.call(e.constructor.prototype,"isPrototypeOf"))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?a[u.call(e)]||"object":typeof e},globalEval:function(e){var t,n=eval;(e=p.trim(e))&&(1===e.indexOf("use strict")?((t=f.createElement("script")).text=e,f.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(h,"ms-").replace(g,m)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r=0,i=e.length,o=v(e);if(n){if(o)for(;r0&&t-1 in e))}var y=(function(e){var t,n,r,i,o,s,a,u,l,c,f,p,d,h,g,m,v,y,x,b="sizzle"+1*new Date,w=e.document,T=0,C=0,N=se(),k=se(),E=se(),S=function(e,t){return e===t&&(f=!0),0},D=-2147483648,j={}.hasOwnProperty,A=[],L=A.pop,q=A.push,H=A.push,O=A.slice,F=function(e,t){for(var n=0,r=e.length;n+~]|"+R+")"+R+"*"),U=new RegExp("="+R+"*([^\\]'\"]*?)"+R+"*\\]","g"),V=new RegExp(I),Y=new RegExp("^"+W+"$"),G={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+$),PSEUDO:new RegExp("^"+I),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+R+"*(even|odd|(([+-]|)(\\d*)n|)"+R+"*(?:([+-]|)"+R+"*(\\d+)|))"+R+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+R+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+R+"*((?:-\\d)?\\d*)"+R+"*\\)|)(?=[^-]|$)","i")},Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=/'|\\/g,ne=new RegExp("\\\\([\\da-f]{1,6}"+R+"?|("+R+")|.)","ig"),re=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},ie=function(){p()};try{H.apply(A=O.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){H={apply:A.length?function(e,t){q.apply(e,O.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function oe(e,t,r,i){var o,a,l,c,f,h,v,y,T,C;if((t?t.ownerDocument||t:w)!==d&&p(t),t=t||d,r=r||[],c=t.nodeType,"string"!=typeof e||!e||1!==c&&9!==c&&11!==c)return r;if(!i&&g){if(11!==c&&(o=Z.exec(e)))if(l=o[1]){if(9===c){if(!(a=t.getElementById(l))||!a.parentNode)return r;if(a.id===l)return r.push(a),r}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(l))&&x(t,a)&&a.id===l)return r.push(a),r}else{if(o[2])return H.apply(r,t.getElementsByTagName(e)),r;if((l=o[3])&&n.getElementsByClassName)return H.apply(r,t.getElementsByClassName(l)),r}if(n.qsa&&(!m||!m.test(e))){if(y=v=b,T=t,C=1!==c&&e,1===c&&"object"!==t.nodeName.toLowerCase()){for(h=s(e),(v=t.getAttribute("id"))?y=v.replace(te,"\\$&"):t.setAttribute("id",y),y="[id='"+y+"'] ",f=h.length;f--;)h[f]=y+me(h[f]);T=ee.test(e)&&he(t.parentNode)||t,C=h.join(",")}if(C)try{return H.apply(r,T.querySelectorAll(C)),r}catch(e){}finally{v||t.removeAttribute("id")}}}return u(e.replace(_,"$1"),t,r,i)}function se(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function ae(e){return e[b]=!0,e}function ue(e){var t=d.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){for(var n=e.split("|"),i=e.length;i--;)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function de(e){return ae(function(t){return t=+t,ae(function(n,r){for(var i,o=e([],n.length,t),s=o.length;s--;)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}function he(e){return e&&void 0!==e.getElementsByTagName&&e}n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,i,s=e?e.ownerDocument||e:w;return s!==d&&9===s.nodeType&&s.documentElement?(d=s,h=s.documentElement,(i=s.defaultView)&&i!==i.top&&(i.addEventListener?i.addEventListener("unload",ie,!1):i.attachEvent&&i.attachEvent("onunload",ie)),g=!o(s),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(s.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=K.test(s.getElementsByClassName),n.getById=ue(function(e){return h.appendChild(e).id=b,!s.getElementsByName||!s.getElementsByName(b).length}),n.getById?(r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},r.filter.ID=function(e){var t=e.replace(ne,re);return function(e){return e.getAttribute("id")===t}}):(delete r.find.ID,r.filter.ID=function(e){var t=e.replace(ne,re);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(g)return t.getElementsByClassName(e)},v=[],m=[],(n.qsa=K.test(s.querySelectorAll))&&(ue(function(e){h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+R+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+R+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+b+"-]").length||m.push("~="),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||m.push(".#.+[+~]")}),ue(function(e){var t=s.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+R+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:")})),(n.matchesSelector=K.test(y=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),v.push("!=",I)}),m=m.length&&new RegExp(m.join("|")),v=v.length&&new RegExp(v.join("|")),t=K.test(h.compareDocumentPosition),x=t||K.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},S=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===s||e.ownerDocument===w&&x(w,e)?-1:t===s||t.ownerDocument===w&&x(w,t)?1:c?F(c,e)-F(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],u=[t];if(!i||!o)return e===s?-1:t===s?1:i?-1:o?1:c?F(c,e)-F(c,t):0;if(i===o)return ce(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?ce(a[r],u[r]):a[r]===w?-1:u[r]===w?1:0},s):d},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&p(e),t=t.replace(U,"='$1']"),n.matchesSelector&&g&&(!v||!v.test(t))&&(!m||!m.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,d,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==d&&p(e),x(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==d&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&j.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(S),f){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:ae,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ne,re),e[3]=(e[3]||e[4]||e[5]||"").replace(ne,re),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&V.test(n)&&(t=s(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ne,re).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=new RegExp("(^|"+R+")"+e+"("+R+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(B," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==s?"nextSibling":"previousSibling",m=t.parentNode,v=a&&t.nodeName.toLowerCase(),y=!u&&!a;if(m){if(o){for(;g;){for(f=t;f=f[g];)if(a?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[s?m.firstChild:m.lastChild],s&&y){for(d=(l=(c=m[b]||(m[b]={}))[e]||[])[0]===T&&l[1],p=l[0]===T&&l[2],f=d&&m.childNodes[d];f=++d&&f&&f[g]||(p=d=0)||h.pop();)if(1===f.nodeType&&++p&&f===t){c[e]=[T,d,p];break}}else if(y&&(l=(t[b]||(t[b]={}))[e])&&l[0]===T)p=l[1];else for(;(f=++d&&f&&f[g]||(p=d=0)||h.pop())&&((a?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++p||(y&&((f[b]||(f[b]={}))[e]=[T,p]),f!==t)););return(p-=i)===r||p%r==0&&p/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ae(function(e,n){for(var r,o=i(e,t),s=o.length;s--;)e[r=F(e,o[s])]=!(n[r]=o[s])}):function(e){return i(e,0,n)}):i}},pseudos:{not:ae(function(e){var t=[],n=[],r=a(e.replace(_,"$1"));return r[b]?ae(function(e,t,n,i){for(var o,s=r(e,null,i,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:ae(function(e){return function(t){return oe(e,t).length>0}}),contains:ae(function(e){return e=e.replace(ne,re),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:ae(function(e){return Y.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(ne,re).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:de(function(){return[0]}),last:de(function(e,t){return[t-1]}),eq:de(function(e,t,n){return[n<0?n+t:n]}),even:de(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:de(function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xe(e,t,n,r,i){for(var o,s=[],a=0,u=e.length,l=null!=t;a-1&&(o[l]=!(s[l]=f))}}else v=xe(v===s?v.splice(h,v.length):v),i?i(null,s,v,u):H.apply(s,v)})}function we(e){for(var t,n,i,o=e.length,s=r.relative[e[0].type],a=s||r.relative[" "],u=s?1:0,c=ve(function(e){return e===t},a,!0),f=ve(function(e){return F(t,e)>-1},a,!0),p=[function(e,n,r){var i=!s&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u1&&ye(p),u>1&&me(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(_,"$1"),n,u0,i=e.length>0,o=function(o,s,a,u,c){var f,p,h,g=0,m="0",v=o&&[],y=[],x=l,b=o||i&&r.find.TAG("*",c),w=T+=null==x?1:Math.random()||.1,C=b.length;for(c&&(l=s!==d&&s);m!==C&&null!=(f=b[m]);m++){if(i&&f){for(p=0;h=e[p++];)if(h(f,s,a)){u.push(f);break}c&&(T=w)}n&&((f=!h&&f)&&g--,o&&v.push(f))}if(g+=m,n&&m!==g){for(p=0;h=t[p++];)h(v,y,s,a);if(o){if(g>0)for(;m--;)v[m]||y[m]||(y[m]=L.call(u));y=xe(y)}H.apply(u,y),c&&!o&&y.length>0&&g+t.length>1&&oe.uniqueSort(u)}return c&&(T=w,l=x),v};return n?ae(o):o})(o,i))).selector=e}return a},u=oe.select=function(e,t,i,o){var u,l,c,f,p,d="function"==typeof e&&e,h=!o&&s(e=d.selector||e);if(i=i||[],1===h.length){if((l=h[0]=h[0].slice(0)).length>2&&"ID"===(c=l[0]).type&&n.getById&&9===t.nodeType&&g&&r.relative[l[1].type]){if(!(t=(r.find.ID(c.matches[0].replace(ne,re),t)||[])[0]))return i;d&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(u=G.needsContext.test(e)?0:l.length;u--&&(c=l[u],!r.relative[f=c.type]);)if((p=r.find[f])&&(o=p(c.matches[0].replace(ne,re),ee.test(l[0].type)&&he(t.parentNode)||t))){if(l.splice(u,1),!(e=o.length&&me(l)))return H.apply(i,o),i;break}}return(d||a(e,h))(o,t,!g,i,ee.test(e)&&he(t.parentNode)||t),i},n.sortStable=b.split("").sort(S).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(d.createElement("div"))}),ue(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||le("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||le("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||le(P,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe})(e);p.find=y,p.expr=y.selectors,p.expr[":"]=p.expr.pseudos,p.unique=y.uniqueSort,p.text=y.getText,p.isXMLDoc=y.isXML,p.contains=y.contains;var x=p.expr.match.needsContext,b=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function T(e,t,n){if(p.isFunction(t))return p.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return p.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(w.test(t))return p.filter(t,e,n);t=p.filter(t,e)}return p.grep(e,function(e){return s.call(t,e)>=0!==n})}p.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?p.find.matchesSelector(r,e)?[r]:[]:p.find.matches(e,p.grep(t,function(e){return 1===e.nodeType}))},p.fn.extend({find:function(e){var t,n=this.length,r=[],i=this;if("string"!=typeof e)return this.pushStack(p(e).filter(function(){for(t=0;t1?p.unique(r):r)).selector=this.selector?this.selector+" "+e:e,r},filter:function(e){return this.pushStack(T(this,e||[],!1))},not:function(e){return this.pushStack(T(this,e||[],!0))},is:function(e){return!!T(this,"string"==typeof e&&x.test(e)?p(e):e||[],!1).length}});var C,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(p.fn.init=function(e,t){var n,r;if(!e)return this;if("string"==typeof e){if(!(n="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:N.exec(e))||!n[1]&&t)return!t||t.jquery?(t||C).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof p?t[0]:t,p.merge(this,p.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:f,!0)),b.test(n[1])&&p.isPlainObject(t))for(n in t)p.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}return(r=f.getElementById(n[2]))&&r.parentNode&&(this.length=1,this[0]=r),this.context=f,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):p.isFunction(e)?void 0!==C.ready?C.ready(e):e(p):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),p.makeArray(e,this))}).prototype=p.fn,C=p(f);var k=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};p.extend({dir:function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&p(e).is(n))break;r.push(e)}return r},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}}),p.fn.extend({has:function(e){var t=p(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&p.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?p.unique(o):o)},index:function(e){return e?"string"==typeof e?s.call(p(e),this[0]):s.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(p.unique(p.merge(this.get(),p(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function S(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}p.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return p.dir(e,"parentNode")},parentsUntil:function(e,t,n){return p.dir(e,"parentNode",n)},next:function(e){return S(e,"nextSibling")},prev:function(e){return S(e,"previousSibling")},nextAll:function(e){return p.dir(e,"nextSibling")},prevAll:function(e){return p.dir(e,"previousSibling")},nextUntil:function(e,t,n){return p.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return p.dir(e,"previousSibling",n)},siblings:function(e){return p.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return p.sibling(e.firstChild)},contents:function(e){return e.contentDocument||p.merge([],e.childNodes)}},function(e,t){p.fn[e]=function(n,r){var i=p.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=p.filter(r,i)),this.length>1&&(E[e]||p.unique(i),k.test(e)&&i.reverse()),this.pushStack(i)}});var D=/\S+/g,j={};p.Callbacks=function(e){var t,n,r,i,o,s,a=[],u=!(e="string"==typeof e?j[e]||(function(e){var t=j[e]={};return p.each(e.match(D)||[],function(e,n){t[n]=!0}),t})(e):p.extend({},e)).once&&[],l=function l(f){for(t=e.memory&&f,n=!0,s=i||0,i=0,o=a.length,r=!0;a&&s-1;)a.splice(n,1),r&&(n<=o&&o--,n<=s&&s--)}),this},has:function(e){return e?p.inArray(e,a)>-1:!(!a||!a.length)},empty:function(){return a=[],o=0,this},disable:function(){return a=u=t=void 0,this},disabled:function(){return!a},lock:function(){return u=void 0,t||c.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!a||n&&!u||(t=[e,(t=t||[]).slice?t.slice():t],r?u.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!n}};return c},p.extend({Deferred:function(e){var t=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return p.Deferred(function(n){p.each(t,function(t,o){var s=p.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&p.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o[0]+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?p.extend(e,r):r}},i={};return r.pipe=r.then,p.each(t,function(e,o){var s=o[2],a=o[3];r[o[1]]=s.add,a&&s.add(function(){n=a},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=s.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,i,o=0,s=r.call(arguments),a=s.length,u=1!==a||e&&p.isFunction(e.promise)?a:0,l=1===u?e:p.Deferred(),c=function(e,n,i){return function(o){n[e]=this,i[e]=arguments.length>1?r.call(arguments):o,i===t?l.notifyWith(n,i):--u||l.resolveWith(n,i)}};if(a>1)for(t=new Array(a),n=new Array(a),i=new Array(a);o0||(A.resolveWith(f,[p]),p.fn.triggerHandler&&(p(f).triggerHandler("ready"),p(f).off("ready"))))}});function L(){f.removeEventListener("DOMContentLoaded",L,!1),e.removeEventListener("load",L,!1),p.ready()}p.ready.promise=function(t){return A||(A=p.Deferred(),"complete"===f.readyState?setTimeout(p.ready):(f.addEventListener("DOMContentLoaded",L,!1),e.addEventListener("load",L,!1))),A.promise(t)},p.ready.promise();var q=p.access=function(e,t,n,r,i,o,s){var a=0,u=e.length,l=null==n;if("object"===p.type(n)){i=!0;for(a in n)p.access(e,t,a,n[a],!0,o,s)}else if(void 0!==r&&(i=!0,p.isFunction(r)||(s=!0),l&&(s?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(p(e),n)})),t))for(;a1,null,!0)},removeData:function(e){return this.each(function(){F.remove(this,e)})}}),p.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=O.get(e,t),n&&(!r||p.isArray(n)?r=O.access(e,t,p.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=p.queue(e,t),r=n.length,i=n.shift(),o=p._queueHooks(e,t),s=function(){p.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,s,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return O.get(e,n)||O.access(e,n,{empty:p.Callbacks("once memory").add(function(){O.remove(e,[t+"queue",n])})})}}),p.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.lengthx",c.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue})();var _="undefined";c.focusinBubbles="onfocusin"in e;var z=/^key/,X=/^(?:mouse|pointer|contextmenu)|click/,U=/^(?:focusinfocus|focusoutblur)$/,V=/^([^.]*)(?:\.(.+)|)$/;function Y(){return!0}function G(){return!1}function Q(){try{return f.activeElement}catch(e){}}p.event={global:{},add:function(e,t,n,r,i){var o,s,a,u,l,c,f,d,h,g,m,v=O.get(e);if(v)for(n.handler&&(n=(o=n).handler,i=o.selector),n.guid||(n.guid=p.guid++),(u=v.events)||(u=v.events={}),(s=v.handle)||(s=v.handle=function(t){return typeof p!==_&&p.event.triggered!==t.type?p.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(D)||[""]).length;l--;)h=m=(a=V.exec(t[l])||[])[1],g=(a[2]||"").split(".").sort(),h&&(f=p.event.special[h]||{},h=(i?f.delegateType:f.bindType)||h,f=p.event.special[h]||{},c=p.extend({type:h,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&p.expr.match.needsContext.test(i),namespace:g.join(".")},o),(d=u[h])||((d=u[h]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,g,s)||e.addEventListener&&e.addEventListener(h,s,!1)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,c):d.push(c),p.event.global[h]=!0)},remove:function(e,t,n,r,i){var o,s,a,u,l,c,f,d,h,g,m,v=O.hasData(e)&&O.get(e);if(v&&(u=v.events)){for(l=(t=(t||"").match(D)||[""]).length;l--;)if(h=m=(a=V.exec(t[l])||[])[1],g=(a[2]||"").split(".").sort(),h){for(f=p.event.special[h]||{},d=u[h=(r?f.delegateType:f.bindType)||h]||[],a=a[2]&&new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=d.length;o--;)c=d[o],!i&&m!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,f.remove&&f.remove.call(e,c));s&&!d.length&&(f.teardown&&!1!==f.teardown.call(e,g,v.handle)||p.removeEvent(e,h,v.handle),delete u[h])}else for(h in u)p.event.remove(e,h+t[l],n,r,!0);p.isEmptyObject(u)&&(delete v.handle,O.remove(e,"events"))}},trigger:function(t,n,r,i){var o,s,a,u,c,d,h,g=[r||f],m=l.call(t,"type")?t.type:t,v=l.call(t,"namespace")?t.namespace.split("."):[];if(s=a=r=r||f,3!==r.nodeType&&8!==r.nodeType&&!U.test(m+p.event.triggered)&&(m.indexOf(".")>=0&&(m=(v=m.split(".")).shift(),v.sort()),c=m.indexOf(":")<0&&"on"+m,(t=t[p.expando]?t:new p.Event(m,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=v.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:p.makeArray(n,[t]),h=p.event.special[m]||{},i||!h.trigger||!1!==h.trigger.apply(r,n))){if(!i&&!h.noBubble&&!p.isWindow(r)){for(u=h.delegateType||m,U.test(u+m)||(s=s.parentNode);s;s=s.parentNode)g.push(s),a=s;a===(r.ownerDocument||f)&&g.push(a.defaultView||a.parentWindow||e)}for(o=0;(s=g[o++])&&!t.isPropagationStopped();)t.type=o>1?u:h.bindType||m,(d=(O.get(s,"events")||{})[t.type]&&O.get(s,"handle"))&&d.apply(s,n),(d=c&&s[c])&&d.apply&&p.acceptData(s)&&(t.result=d.apply(s,n),!1===t.result&&t.preventDefault());return t.type=m,i||t.isDefaultPrevented()||h._default&&!1!==h._default.apply(g.pop(),n)||!p.acceptData(r)||c&&p.isFunction(r[m])&&!p.isWindow(r)&&((a=r[c])&&(r[c]=null),p.event.triggered=m,r[m](),p.event.triggered=void 0,a&&(r[c]=a)),t.result}},dispatch:function(e){e=p.event.fix(e);var t,n,i,o,s,a=[],u=r.call(arguments),l=(O.get(this,"events")||{})[e.type]||[],c=p.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,e)){for(a=p.event.handlers.call(this,e,l),t=0;(o=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,n=0;(s=o.handlers[n++])&&!e.isImmediatePropagationStopped();)e.namespace_re&&!e.namespace_re.test(s.namespace)||(e.handleObj=s,e.data=s.data,void 0!==(i=((p.event.special[s.origType]||{}).handle||s.handler).apply(o.elem,u))&&!1===(e.result=i)&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,s=[],a=t.delegateCount,u=e.target;if(a&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!==this;u=u.parentNode||this)if(!0!==u.disabled||"click"!==e.type){for(r=[],n=0;n=0:p.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&s.push({elem:u,handlers:r})}return a]*)\/>/gi,K=/<([\w:]+)/,Z=/<|&#?\w+;/,ee=/<(?:script|style|link)/i,te=/checked\s*(?:[^=]|=\s*.checked.)/i,ne=/^$|\/(?:java|ecma)script/i,re=/^true\/(.*)/,ie=/^\s*\s*$/g,oe={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};oe.optgroup=oe.option,oe.tbody=oe.tfoot=oe.colgroup=oe.caption=oe.thead,oe.th=oe.td;function se(e,t){return p.nodeName(e,"table")&&p.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function ae(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function ue(e){var t=re.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function le(e,t){for(var n=0,r=e.length;n0&&le(s,!u&&fe(e,"script")),a},buildFragment:function(e,t,n,r){for(var i,o,s,a,u,l,c=t.createDocumentFragment(),f=[],d=0,h=e.length;d")+a[2],l=a[0];l--;)o=o.lastChild;p.merge(f,o.childNodes),(o=c.firstChild).textContent=""}else f.push(t.createTextNode(i));for(c.textContent="",d=0;i=f[d++];)if((!r||-1===p.inArray(i,r))&&(u=p.contains(i.ownerDocument,i),o=fe(c.appendChild(i),"script"),u&&le(o),n))for(l=0;i=o[l++];)ne.test(i.type||"")&&n.push(i);return c},cleanData:function(e){for(var t,n,r,i,o=p.event.special,s=0;void 0!==(n=e[s]);s++){if(p.acceptData(n)&&(i=n[O.expando])&&(t=O.cache[i])){if(t.events)for(r in t.events)o[r]?p.event.remove(n,r):p.removeEvent(n,r,t.handle);O.cache[i]&&delete O.cache[i]}delete F.cache[n[F.expando]]}}}),p.fn.extend({text:function(e){return q(this,function(e){return void 0===e?p.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){se(this,e).appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=se(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=e?p.filter(e,this):this,i=0;null!=(n=r[i]);i++)t||1!==n.nodeType||p.cleanData(fe(n)),n.parentNode&&(t&&p.contains(n.ownerDocument,n)&&le(fe(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(p.cleanData(fe(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return p.clone(this,e,t)})},html:function(e){return q(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!ee.test(e)&&!oe[(K.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(J,"<$1>");try{for(;n1&&"string"==typeof g&&!c.checkClone&&te.test(g))return this.each(function(n){var r=d.eq(n);m&&(e[0]=g.call(this,n,r.html())),r.domManip(e,t)});if(f&&(r=(n=p.buildFragment(e,this[0].ownerDocument,!1,this)).firstChild,1===n.childNodes.length&&(n=r),r)){for(s=(o=p.map(fe(n,"script"),ae)).length;l")).appendTo(t.documentElement))[0].contentDocument).write(),t.close(),n=ge(e,t),de.detach()),he[e]=n),n}var ve=/^margin/,ye=new RegExp("^("+W+")(?!px)[a-z%]+$","i"),xe=function(t){return t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):e.getComputedStyle(t,null)};function be(e,t,n){var r,i,o,s,a=e.style;return(n=n||xe(e))&&(s=n.getPropertyValue(t)||n[t]),n&&(""!==s||p.contains(e.ownerDocument,e)||(s=p.style(e,t)),ye.test(s)&&ve.test(t)&&(r=a.width,i=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=n.width,a.width=r,a.minWidth=i,a.maxWidth=o)),void 0!==s?s+"":s}function we(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!(function(){var t,n,r=f.documentElement,i=f.createElement("div"),o=f.createElement("div");o.style&&(o.style.backgroundClip="content-box",o.cloneNode(!0).style.backgroundClip="",c.clearCloneStyle="content-box"===o.style.backgroundClip,i.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",i.appendChild(o),e.getComputedStyle&&p.extend(c,{pixelPosition:function(){return s(),t},boxSizingReliable:function(){return null==n&&s(),n},reliableMarginRight:function(){var t,n=o.appendChild(f.createElement("div"));return n.style.cssText=o.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",n.style.marginRight=n.style.width="0",o.style.width="1px",r.appendChild(i),t=!parseFloat(e.getComputedStyle(n,null).marginRight),r.removeChild(i),o.removeChild(n),t}}));function s(){o.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",o.innerHTML="",r.appendChild(i);var s=e.getComputedStyle(o,null);t="1%"!==s.top,n="4px"===s.width,r.removeChild(i)}})(),p.swap=function(e,t,n,r){var i,o,s={};for(o in t)s[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=s[o];return i};var Te=/^(none|table(?!-c[ea]).+)/,Ce=new RegExp("^("+W+")(.*)$","i"),Ne=new RegExp("^([+-])=("+W+")","i"),ke={position:"absolute",visibility:"hidden",display:"block"},Ee={letterSpacing:"0",fontWeight:"400"},Se=["Webkit","O","Moz","ms"];function De(e,t){if(t in e)return t;for(var n=t[0].toUpperCase()+t.slice(1),r=t,i=Se.length;i--;)if((t=Se[i]+n)in e)return t;return r}function je(e,t,n){var r=Ce.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function Ae(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,s=0;o<4;o+=2)"margin"===n&&(s+=p.css(e,n+$[o],!0,i)),r?("content"===n&&(s-=p.css(e,"padding"+$[o],!0,i)),"margin"!==n&&(s-=p.css(e,"border"+$[o]+"Width",!0,i))):(s+=p.css(e,"padding"+$[o],!0,i),"padding"!==n&&(s+=p.css(e,"border"+$[o]+"Width",!0,i)));return s}function Le(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=xe(e),s="border-box"===p.css(e,"boxSizing",!1,o);if(i<=0||null==i){if(((i=be(e,t,o))<0||null==i)&&(i=e.style[t]),ye.test(i))return i;r=s&&(c.boxSizingReliable()||i===e.style[t]),i=parseFloat(i)||0}return i+Ae(e,t,n||(s?"border":"content"),r,o)+"px"}function qe(e,t){for(var n,r,i,o=[],s=0,a=e.length;s1)},show:function(){return qe(this,!0)},hide:function(){return qe(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){I(this)?p(this).show():p(this).hide()})}});function He(e,t,n,r,i){return new He.prototype.init(e,t,n,r,i)}p.Tween=He,He.prototype={constructor:He,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(p.cssNumber[n]?"":"px")},cur:function(){var e=He.propHooks[this.prop];return e&&e.get?e.get(this):He.propHooks._default.get(this)},run:function(e){var t,n=He.propHooks[this.prop];return this.options.duration?this.pos=t=p.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):He.propHooks._default.set(this),this}},He.prototype.init.prototype=He.prototype,He.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=p.css(e.elem,e.prop,""))&&"auto"!==t?t:0:e.elem[e.prop]},set:function(e){p.fx.step[e.prop]?p.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[p.cssProps[e.prop]]||p.cssHooks[e.prop])?p.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},He.propHooks.scrollTop=He.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},p.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},p.fx=He.prototype.init,p.fx.step={};var Oe,Fe,Pe=/^(?:toggle|show|hide)$/,Re=new RegExp("^(?:([+-])=|)("+W+")([a-z%]*)$","i"),Me=/queueHooks$/,We=[function(e,t,n){var r,i,o,s,a,u,l,c=this,f={},d=e.style,h=e.nodeType&&I(e),g=O.get(e,"fxshow");n.queue||(null==(a=p._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,u=a.empty.fire,a.empty.fire=function(){a.unqueued||u()}),a.unqueued++,c.always(function(){c.always(function(){a.unqueued--,p.queue(e,"fx").length||a.empty.fire()})}));1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],l=p.css(e,"display"),"inline"===("none"===l?O.get(e,"olddisplay")||me(e.nodeName):l)&&"none"===p.css(e,"float")&&(d.display="inline-block"));n.overflow&&(d.overflow="hidden",c.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Pe.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(h?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;h=!0}f[r]=g&&g[r]||p.style(e,r)}else l=void 0;if(p.isEmptyObject(f))"inline"===("none"===l?me(e.nodeName):l)&&(d.display=l);else{g?"hidden"in g&&(h=g.hidden):g=O.access(e,"fxshow",{}),o&&(g.hidden=!h),h?p(e).show():c.done(function(){p(e).hide()}),c.done(function(){var t;O.remove(e,"fxshow");for(t in f)p.style(e,t,f[t])});for(r in f)s=_e(h?g[r]:0,r,c),r in g||(g[r]=s.start,h&&(s.end=s.start,s.start="width"===r||"height"===r?1:0))}}],$e={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Re.exec(t),o=i&&i[3]||(p.cssNumber[e]?"":"px"),s=(p.cssNumber[e]||"px"!==o&&+r)&&Re.exec(p.css(n.elem,e)),a=1,u=20;if(s&&s[3]!==o){o=o||s[3],i=i||[],s=+r||1;do{s/=a=a||".5",p.style(n.elem,e,s+o)}while(a!==(a=n.cur()/r)&&1!==a&&--u)}return i&&(s=n.start=+s||+r||0,n.unit=o,n.end=i[1]?s+(i[1]+1)*i[2]:+i[2]),n}]};function Ie(){return setTimeout(function(){Oe=void 0}),Oe=p.now()}function Be(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=$[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function _e(e,t,n){for(var r,i=($e[t]||[]).concat($e["*"]),o=0,s=i.length;o1)},removeAttr:function(e){return this.each(function(){p.removeAttr(this,e)})}}),p.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return typeof e.getAttribute===_?p.prop(e,t,n):(1===o&&p.isXMLDoc(e)||(t=t.toLowerCase(),r=p.attrHooks[t]||(p.expr.match.bool.test(t)?Xe:void 0)),void 0===n?r&&"get"in r&&null!==(i=r.get(e,t))?i:null==(i=p.find.attr(e,t))?void 0:i:null!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):void p.removeAttr(e,t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(D);if(o&&1===e.nodeType)for(;n=o[i++];)r=p.propFix[n]||n,p.expr.match.bool.test(n)&&(e[r]=!1),e.removeAttribute(n)},attrHooks:{type:{set:function(e,t){if(!c.radioValue&&"radio"===t&&p.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}}}),Xe={set:function(e,t,n){return!1===t?p.removeAttr(e,n):e.setAttribute(n,n),n}},p.each(p.expr.match.bool.source.match(/\w+/g),function(e,t){var n=Ue[t]||p.find.attr;Ue[t]=function(e,t,r){var i,o;return r||(o=Ue[t],Ue[t]=i,i=null!=n(e,t,r)?t.toLowerCase():null,Ue[t]=o),i}});var Ve=/^(?:input|select|textarea|button)$/i;p.fn.extend({prop:function(e,t){return q(this,p.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[p.propFix[e]||e]})}}),p.extend({propFix:{for:"htmlFor",class:"className"},prop:function(e,t,n){var r,i,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return(1!==o||!p.isXMLDoc(e))&&(t=p.propFix[t]||t,i=p.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||Ve.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),c.optSelected||(p.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),p.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){p.propFix[this.toLowerCase()]=this});var Ye=/[\t\r\n\f]/g;p.fn.extend({addClass:function(e){var t,n,r,i,o,s,a="string"==typeof e&&e,u=0,l=this.length;if(p.isFunction(e))return this.each(function(t){p(this).addClass(e.call(this,t,this.className))});if(a)for(t=(e||"").match(D)||[];u=0;)r=r.replace(" "+i+" "," ");s=e?p.trim(r):"",n.className!==s&&(n.className=s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):p.isFunction(e)?this.each(function(n){p(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var t,r=0,i=p(this),o=e.match(D)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else n!==_&&"boolean"!==n||(this.className&&O.set(this,"__className__",this.className),this.className=this.className||!1===e?"":O.get(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;n=0)return!0;return!1}});var Ge=/\r/g;p.fn.extend({val:function(e){var t,n,r,i=this[0];if(arguments.length)return r=p.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,p(this).val()):e)?i="":"number"==typeof i?i+="":p.isArray(i)&&(i=p.map(i,function(e){return null==e?"":e+""})),(t=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return(t=p.valHooks[i.type]||p.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(Ge,""):null==n?"":n}}),p.extend({valHooks:{option:{get:function(e){var t=p.find.attr(e,"value");return null!=t?t:p.trim(p.text(e))}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||i<0,s=o?null:[],a=o?i+1:r.length,u=i<0?a:o?i:0;u=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),p.each(["radio","checkbox"],function(){p.valHooks[this]={set:function(e,t){if(p.isArray(t))return e.checked=p.inArray(p(e).val(),t)>=0}},c.checkOn||(p.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),p.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){p.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),p.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var Qe=p.now(),Je=/\?/;p.parseJSON=function(e){return JSON.parse(e+"")},p.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||p.error("Invalid XML: "+e),t};var Ke=/#.*$/,Ze=/([?&])_=[^&]*/,et=/^(.*?):[ \t]*([^\r\n]*)$/gm,tt=/^(?:GET|HEAD)$/,nt=/^\/\//,rt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,it={},ot={},st="*/".concat("*"),at=e.location.href,ut=rt.exec(at.toLowerCase())||[];function lt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(D)||[];if(p.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function ct(e,t,n,r){var i={},o=e===ot;function s(a){var u;return i[a]=!0,p.each(e[a]||[],function(e,a){var l=a(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),s(l),!1)}),u}return s(t.dataTypes[0])||!i["*"]&&s("*")}function ft(e,t){var n,r,i=p.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&p.extend(!0,e,r),e}p.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:at,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ut[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":st,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?ft(ft(e,p.ajaxSettings),t):ft(p.ajaxSettings,e)},ajaxPrefilter:lt(it),ajaxTransport:lt(ot),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,r,i,o,s,a,u,l,c=p.ajaxSetup({},t),f=c.context||c,d=c.context&&(f.nodeType||f.jquery)?p(f):p.event,h=p.Deferred(),g=p.Callbacks("once memory"),m=c.statusCode||{},v={},y={},x=0,b="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!o)for(o={};t=et.exec(i);)o[t[1].toLowerCase()]=t[2];t=o[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?i:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=y[n]=y[n]||e,v[e]=t),this},overrideMimeType:function(e){return x||(c.mimeType=e),this},statusCode:function(e){var t;if(e)if(x<2)for(t in e)m[t]=[m[t],e[t]];else w.always(e[w.status]);return this},abort:function(e){var t=e||b;return n&&n.abort(t),T(0,t),this}};if(h.promise(w).complete=g.add,w.success=w.done,w.error=w.fail,c.url=((e||c.url||at)+"").replace(Ke,"").replace(nt,ut[1]+"//"),c.type=t.method||t.type||c.method||c.type,c.dataTypes=p.trim(c.dataType||"*").toLowerCase().match(D)||[""],null==c.crossDomain&&(a=rt.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ut[1]&&a[2]===ut[2]&&(a[3]||("http:"===a[1]?"80":"443"))===(ut[3]||("http:"===ut[1]?"80":"443")))),c.data&&c.processData&&"string"!=typeof c.data&&(c.data=p.param(c.data,c.traditional)),ct(it,c,t,w),2===x)return w;(u=p.event&&c.global)&&0==p.active++&&p.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!tt.test(c.type),r=c.url,c.hasContent||(c.data&&(r=c.url+=(Je.test(r)?"&":"?")+c.data,delete c.data),!1===c.cache&&(c.url=Ze.test(r)?r.replace(Ze,"$1_="+Qe++):r+(Je.test(r)?"&":"?")+"_="+Qe++)),c.ifModified&&(p.lastModified[r]&&w.setRequestHeader("If-Modified-Since",p.lastModified[r]),p.etag[r]&&w.setRequestHeader("If-None-Match",p.etag[r])),(c.data&&c.hasContent&&!1!==c.contentType||t.contentType)&&w.setRequestHeader("Content-Type",c.contentType),w.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+("*"!==c.dataTypes[0]?", "+st+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)w.setRequestHeader(l,c.headers[l]);if(c.beforeSend&&(!1===c.beforeSend.call(f,w,c)||2===x))return w.abort();b="abort";for(l in{success:1,error:1,complete:1})w[l](c[l]);if(n=ct(ot,c,t,w)){w.readyState=1,u&&d.trigger("ajaxSend",[w,c]),c.async&&c.timeout>0&&(s=setTimeout(function(){w.abort("timeout")},c.timeout));try{x=1,n.send(v,T)}catch(e){if(!(x<2))throw e;T(-1,e)}}else T(-1,"No Transport");function T(e,t,o,a){var l,v,y,b,T,C=t;2!==x&&(x=2,s&&clearTimeout(s),n=void 0,i=a||"",w.readyState=e>0?4:0,l=e>=200&&e<300||304===e,o&&(b=(function(e,t,n){for(var r,i,o,s,a=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}s||(s=i)}o=o||s}if(o)return o!==u[0]&&u.unshift(o),n[o]})(c,w,o)),b=(function(e,t,n,r){var i,o,s,a,u,l={},c=e.dataTypes.slice();if(c[1])for(s in e.converters)l[s.toLowerCase()]=e.converters[s];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(s=l[u+" "+o]||l["* "+o]))for(i in l)if((a=i.split(" "))[1]===o&&(s=l[u+" "+a[0]]||l["* "+a[0]])){!0===s?s=l[i]:!0!==l[i]&&(o=a[0],c.unshift(a[1]));break}if(!0!==s)if(s&&e.throws)t=s(t);else try{t=s(t)}catch(e){return{state:"parsererror",error:s?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}})(c,b,w,l),l?(c.ifModified&&((T=w.getResponseHeader("Last-Modified"))&&(p.lastModified[r]=T),(T=w.getResponseHeader("etag"))&&(p.etag[r]=T)),204===e||"HEAD"===c.type?C="nocontent":304===e?C="notmodified":(C=b.state,v=b.data,l=!(y=b.error))):(y=C,!e&&C||(C="error",e<0&&(e=0))),w.status=e,w.statusText=(t||C)+"",l?h.resolveWith(f,[v,C,w]):h.rejectWith(f,[w,C,y]),w.statusCode(m),m=void 0,u&&d.trigger(l?"ajaxSuccess":"ajaxError",[w,c,l?v:y]),g.fireWith(f,[w,C]),u&&(d.trigger("ajaxComplete",[w,c]),--p.active||p.event.trigger("ajaxStop")))}return w},getJSON:function(e,t,n){return p.get(e,t,n,"json")},getScript:function(e,t){return p.get(e,void 0,t,"script")}}),p.each(["get","post"],function(e,t){p[t]=function(e,n,r,i){return p.isFunction(n)&&(i=i||r,r=n,n=void 0),p.ajax({url:e,type:t,dataType:i,data:n,success:r})}}),p._evalUrl=function(e){return p.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},p.fn.extend({wrapAll:function(e){var t;return p.isFunction(e)?this.each(function(t){p(this).wrapAll(e.call(this,t))}):(this[0]&&(t=p(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return p.isFunction(e)?this.each(function(t){p(this).wrapInner(e.call(this,t))}):this.each(function(){var t=p(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=p.isFunction(e);return this.each(function(n){p(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()}}),p.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0},p.expr.filters.visible=function(e){return!p.expr.filters.hidden(e)};var pt=/%20/g,dt=/\[\]$/,ht=/\r?\n/g,gt=/^(?:submit|button|image|reset|file)$/i,mt=/^(?:input|select|textarea|keygen)/i;function vt(e,t,n,r){var i;if(p.isArray(t))p.each(t,function(t,i){n||dt.test(e)?r(e,i):vt(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==p.type(t))r(e,t);else for(i in t)vt(e+"["+i+"]",t[i],n,r)}p.param=function(e,t){var n,r=[],i=function(e,t){t=p.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=p.ajaxSettings&&p.ajaxSettings.traditional),p.isArray(e)||e.jquery&&!p.isPlainObject(e))p.each(e,function(){i(this.name,this.value)});else for(n in e)vt(n,e[n],t,i);return r.join("&").replace(pt,"+")},p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=p.prop(this,"elements");return e?p.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!p(this).is(":disabled")&&mt.test(this.nodeName)&&!gt.test(e)&&(this.checked||!B.test(e))}).map(function(e,t){var n=p(this).val();return null==n?null:p.isArray(n)?p.map(n,function(e){return{name:t.name,value:e.replace(ht,"\r\n")}}):{name:t.name,value:n.replace(ht,"\r\n")}}).get()}}),p.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var yt=0,xt={},bt={0:200,1223:204},wt=p.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",function(){for(var e in xt)xt[e]()}),c.cors=!!wt&&"withCredentials"in wt,c.ajax=wt=!!wt,p.ajaxTransport(function(e){var t;if(c.cors||wt&&!e.crossDomain)return{send:function(n,r){var i,o=e.xhr(),s=++yt;if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)o[i]=e.xhrFields[i];e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)o.setRequestHeader(i,n[i]);t=function(e){return function(){t&&(delete xt[s],t=o.onload=o.onerror=null,"abort"===e?o.abort():"error"===e?r(o.status,o.statusText):r(bt[o.status]||o.status,o.statusText,"string"==typeof o.responseText?{text:o.responseText}:void 0,o.getAllResponseHeaders()))}},o.onload=t(),o.onerror=t("error"),t=xt[s]=t("abort");try{o.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return p.globalEval(e),e}}}),p.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),p.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=p("