@onairos/react-native 3.7.2 → 3.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/api/index.js +219 -9
- package/lib/commonjs/components/BodyText.js +27 -9
- package/lib/commonjs/components/BrandMark.js +111 -10
- package/lib/commonjs/components/CodeInput.js +120 -9
- package/lib/commonjs/components/EmailInput.js +30 -8
- package/lib/commonjs/components/GoogleButton.js +56 -9
- package/lib/commonjs/components/HeadingGroup.js +43 -9
- package/lib/commonjs/components/LLMDataInputModal.js +664 -14
- package/lib/commonjs/components/ModalHeader.js +99 -9
- package/lib/commonjs/components/ModalSheet.js +47 -9
- package/lib/commonjs/components/Onairos.js +380 -14
- package/lib/commonjs/components/OnairosButton.js +313 -13
- package/lib/commonjs/components/OnairosSignInButton.js +130 -12
- package/lib/commonjs/components/Overlay.js +465 -13
- package/lib/commonjs/components/PersonaImage.js +137 -10
- package/lib/commonjs/components/PersonaLoadingScreen.js +318 -12
- package/lib/commonjs/components/PersonalizationConsentScreen.js +467 -13
- package/lib/commonjs/components/PinCreationScreen.js +403 -12
- package/lib/commonjs/components/PinInput.js +464 -9
- package/lib/commonjs/components/PlatformConnectorsStep.js +1311 -23
- package/lib/commonjs/components/PlatformList.js +137 -10
- package/lib/commonjs/components/PlatformToggle.js +180 -9
- package/lib/commonjs/components/PrimaryButton.js +180 -10
- package/lib/commonjs/components/SignInMatchAnimation.js +197 -9
- package/lib/commonjs/components/SignInStep.js +345 -12
- package/lib/commonjs/components/UniversalOnboarding.js +2780 -30
- package/lib/commonjs/components/VerificationStep.js +176 -11
- package/lib/commonjs/components/WelcomeScreen.js +461 -22
- package/lib/commonjs/components/icons/Basicproficon.js +37 -8
- package/lib/commonjs/components/icons/Basicprofile.js +21 -8
- package/lib/commonjs/components/icons/Checkbox.js +21 -8
- package/lib/commonjs/components/icons/Checkmark.js +27 -8
- package/lib/commonjs/components/icons/Contentanalysis.js +21 -8
- package/lib/commonjs/components/icons/Contenticon.js +39 -8
- package/lib/commonjs/components/icons/EnochE.js +41 -8
- package/lib/commonjs/components/icons/Personalityicon.js +30 -8
- package/lib/commonjs/components/icons/Personalityprofile.js +21 -8
- package/lib/commonjs/components/icons/Personalitytraits.js +21 -8
- package/lib/commonjs/components/icons/Userpreferences.js +21 -8
- package/lib/commonjs/components/icons/index.js +84 -17
- package/lib/commonjs/components/onboarding/OAuthWebView.js +1754 -18
- package/lib/commonjs/components/onboarding/OnboardingHeader.js +74 -10
- package/lib/commonjs/components/onboarding/PinInput.js +283 -10
- package/lib/commonjs/components/onboarding/PlatformConnector.js +249 -11
- package/lib/commonjs/config/PLATFORM_APIS.md +849 -0
- package/lib/commonjs/config/api.js +56 -7
- package/lib/commonjs/constants/index.js +120 -7
- package/lib/commonjs/context/AuthContext.js +345 -10
- package/lib/commonjs/hooks/useConnectedAccounts.js +111 -9
- package/lib/commonjs/hooks/useConnections.js +102 -8
- package/lib/commonjs/hooks/useCredentials.js +178 -10
- package/lib/commonjs/hooks/useUserConnections.js +148 -10
- package/lib/commonjs/index.js +439 -34
- package/lib/commonjs/services/apiClient.js +298 -8
- package/lib/commonjs/services/biometricPinService.js +180 -8
- package/lib/commonjs/services/chatGPTConversationExtractor.js +155 -8
- package/lib/commonjs/services/chatGPTConversationService.js +275 -9
- package/lib/commonjs/services/claudeConversationExtractor.js +103 -8
- package/lib/commonjs/services/claudeConversationService.js +158 -9
- package/lib/commonjs/services/connectedAccountsService.js +310 -10
- package/lib/commonjs/services/googleAuthService.js +252 -11
- package/lib/commonjs/services/hingeDataExtractor.js +105 -8
- package/lib/commonjs/services/hingeDataService.js +150 -9
- package/lib/commonjs/services/imageCompressionService.js +260 -7
- package/lib/commonjs/services/instagramDataExtractor.js +126 -8
- package/lib/commonjs/services/instagramDataService.js +163 -9
- package/lib/commonjs/services/jwtStorageService.js +276 -7
- package/lib/commonjs/services/linkedinDOMExtractor.js +245 -7
- package/lib/commonjs/services/linkedinProfileService.js +222 -9
- package/lib/commonjs/services/linkedinScrapingService.js +230 -8
- package/lib/commonjs/services/llmDataStorage.js +294 -8
- package/lib/commonjs/services/mobileTrainingService.js +186 -8
- package/lib/commonjs/services/netflixDataExtractor.js +120 -8
- package/lib/commonjs/services/netflixDataService.js +198 -9
- package/lib/commonjs/services/pinEncryptionService.js +84 -8
- package/lib/commonjs/services/pinStorageUtils.js +105 -7
- package/lib/commonjs/services/platformAuthService.js +1484 -12
- package/lib/commonjs/services/sephoraDataExtractor.js +140 -8
- package/lib/commonjs/services/sephoraDataService.js +200 -9
- package/lib/commonjs/services/spotifyDataExtractor.js +148 -8
- package/lib/commonjs/services/spotifyDataService.js +241 -9
- package/lib/commonjs/services/storageService.js +404 -8
- package/lib/commonjs/services/telegramDataExtractor.js +115 -8
- package/lib/commonjs/services/telegramDataService.js +499 -9
- package/lib/commonjs/services/trainingApiHelpers.js +73 -7
- package/lib/commonjs/services/userConnectionsService.js +340 -10
- package/lib/commonjs/services/youtubeMigrationService.js +416 -10
- package/lib/commonjs/theme/index.js +250 -7
- package/lib/commonjs/types/ambient.d.js +2 -1
- package/lib/commonjs/types/declarations.d.js +2 -1
- package/lib/commonjs/types/index.js +6 -1
- package/lib/commonjs/types/node-fix.d.js +2 -1
- package/lib/commonjs/types/node-override.d.js +2 -1
- package/lib/commonjs/types/opacity.d.js +2 -1
- package/lib/commonjs/types.js +14 -1
- package/lib/commonjs/utils/Portal.js +98 -8
- package/lib/commonjs/utils/api.js +130 -9
- package/lib/commonjs/utils/assetRegistry.js +210 -35
- package/lib/commonjs/utils/auth.js +112 -9
- package/lib/commonjs/utils/connectorTests.js +613 -29
- package/lib/commonjs/utils/crypto.js +62 -8
- package/lib/commonjs/utils/debugHelper.js +64 -1
- package/lib/commonjs/utils/encryption.js +76 -7
- package/lib/commonjs/utils/eventUtils.js +288 -1
- package/lib/commonjs/utils/haptics.js +66 -9
- package/lib/commonjs/utils/imagePreloader.js +6 -1
- package/lib/commonjs/utils/networkDiagnostics.js +226 -8
- package/lib/commonjs/utils/onairosApi.js +350 -9
- package/lib/commonjs/utils/programmaticFlow.js +117 -9
- package/lib/commonjs/utils/retryHelper.js +220 -1
- package/lib/commonjs/utils/secureStorage.js +349 -10
- package/lib/commonjs/utils/webviewScripts/chatgpt.js +551 -1
- package/lib/commonjs/utils/webviewScripts/claude.js +376 -1
- package/lib/commonjs/utils/webviewScripts/hinge.js +411 -1
- package/lib/commonjs/utils/webviewScripts/index.js +698 -15
- package/lib/commonjs/utils/webviewScripts/instagram.js +454 -1
- package/lib/commonjs/utils/webviewScripts/linkedin.js +880 -1
- package/lib/commonjs/utils/webviewScripts/netflix.js +382 -1
- package/lib/commonjs/utils/webviewScripts/sephora.js +516 -1
- package/lib/commonjs/utils/webviewScripts/spotify.js +419 -1
- package/lib/commonjs/utils/webviewScripts/telegram.js +678 -1
- package/lib/module/api/index.js +211 -1
- package/lib/module/components/BodyText.js +20 -1
- package/lib/module/components/BrandMark.js +104 -1
- package/lib/module/components/CodeInput.js +113 -1
- package/lib/module/components/EmailInput.js +23 -1
- package/lib/module/components/GoogleButton.js +49 -1
- package/lib/module/components/HeadingGroup.js +36 -1
- package/lib/module/components/LLMDataInputModal.js +656 -7
- package/lib/module/components/ModalHeader.js +92 -1
- package/lib/module/components/ModalSheet.js +39 -1
- package/lib/module/components/Onairos.js +373 -1
- package/lib/module/components/OnairosButton.js +305 -1
- package/lib/module/components/OnairosSignInButton.js +121 -1
- package/lib/module/components/Overlay.js +456 -1
- package/lib/module/components/PersonaImage.js +129 -1
- package/lib/module/components/PersonaLoadingScreen.js +310 -1
- package/lib/module/components/PersonalizationConsentScreen.js +460 -1
- package/lib/module/components/PinCreationScreen.js +396 -1
- package/lib/module/components/PinInput.js +456 -1
- package/lib/module/components/PlatformConnectorsStep.js +1302 -6
- package/lib/module/components/PlatformList.js +129 -1
- package/lib/module/components/PlatformToggle.js +173 -1
- package/lib/module/components/PrimaryButton.js +172 -1
- package/lib/module/components/SignInMatchAnimation.js +189 -1
- package/lib/module/components/SignInStep.js +338 -1
- package/lib/module/components/UniversalOnboarding.js +2770 -1
- package/lib/module/components/VerificationStep.js +168 -1
- package/lib/module/components/WelcomeScreen.js +453 -1
- package/lib/module/components/icons/Basicproficon.js +30 -1
- package/lib/module/components/icons/Basicprofile.js +14 -1
- package/lib/module/components/icons/Checkbox.js +14 -1
- package/lib/module/components/icons/Checkmark.js +20 -1
- package/lib/module/components/icons/Contentanalysis.js +14 -1
- package/lib/module/components/icons/Contenticon.js +32 -1
- package/lib/module/components/icons/EnochE.js +34 -1
- package/lib/module/components/icons/Personalityicon.js +23 -1
- package/lib/module/components/icons/Personalityprofile.js +14 -1
- package/lib/module/components/icons/Personalitytraits.js +14 -1
- package/lib/module/components/icons/Userpreferences.js +14 -1
- package/lib/module/components/icons/index.js +13 -1
- package/lib/module/components/onboarding/OAuthWebView.js +1746 -1
- package/lib/module/components/onboarding/OnboardingHeader.js +66 -1
- package/lib/module/components/onboarding/PinInput.js +274 -1
- package/lib/module/components/onboarding/PlatformConnector.js +240 -1
- package/lib/module/config/PLATFORM_APIS.md +849 -0
- package/lib/module/config/api.js +47 -1
- package/lib/module/constants/index.js +114 -1
- package/lib/module/context/AuthContext.js +335 -1
- package/lib/module/hooks/useConnectedAccounts.js +106 -1
- package/lib/module/hooks/useConnections.js +95 -1
- package/lib/module/hooks/useCredentials.js +171 -6
- package/lib/module/hooks/useUserConnections.js +140 -1
- package/lib/module/index.js +172 -1
- package/lib/module/services/apiClient.js +295 -1
- package/lib/module/services/biometricPinService.js +169 -1
- package/lib/module/services/chatGPTConversationExtractor.js +149 -1
- package/lib/module/services/chatGPTConversationService.js +268 -1
- package/lib/module/services/claudeConversationExtractor.js +97 -1
- package/lib/module/services/claudeConversationService.js +151 -1
- package/lib/module/services/connectedAccountsService.js +293 -1
- package/lib/module/services/googleAuthService.js +241 -1
- package/lib/module/services/hingeDataExtractor.js +99 -1
- package/lib/module/services/hingeDataService.js +143 -1
- package/lib/module/services/imageCompressionService.js +250 -1
- package/lib/module/services/instagramDataExtractor.js +120 -1
- package/lib/module/services/instagramDataService.js +156 -1
- package/lib/module/services/jwtStorageService.js +257 -1
- package/lib/module/services/linkedinDOMExtractor.js +234 -1
- package/lib/module/services/linkedinProfileService.js +210 -1
- package/lib/module/services/linkedinScrapingService.js +219 -1
- package/lib/module/services/llmDataStorage.js +277 -1
- package/lib/module/services/mobileTrainingService.js +173 -1
- package/lib/module/services/netflixDataExtractor.js +114 -1
- package/lib/module/services/netflixDataService.js +191 -1
- package/lib/module/services/pinEncryptionService.js +74 -6
- package/lib/module/services/pinStorageUtils.js +93 -1
- package/lib/module/services/platformAuthService.js +1461 -1
- package/lib/module/services/sephoraDataExtractor.js +134 -1
- package/lib/module/services/sephoraDataService.js +193 -1
- package/lib/module/services/spotifyDataExtractor.js +142 -1
- package/lib/module/services/spotifyDataService.js +234 -1
- package/lib/module/services/storageService.js +383 -1
- package/lib/module/services/telegramDataExtractor.js +109 -1
- package/lib/module/services/telegramDataService.js +493 -1
- package/lib/module/services/trainingApiHelpers.js +67 -1
- package/lib/module/services/userConnectionsService.js +329 -1
- package/lib/module/services/youtubeMigrationService.js +405 -1
- package/lib/module/theme/index.js +245 -1
- package/lib/module/types.js +10 -1
- package/lib/module/utils/Portal.js +90 -1
- package/lib/module/utils/api.js +118 -1
- package/lib/module/utils/assetRegistry.js +200 -34
- package/lib/module/utils/auth.js +100 -1
- package/lib/module/utils/connectorTests.js +600 -27
- package/lib/module/utils/crypto.js +54 -1
- package/lib/module/utils/debugHelper.js +54 -1
- package/lib/module/utils/encryption.js +67 -1
- package/lib/module/utils/eventUtils.js +270 -1
- package/lib/module/utils/haptics.js +59 -8
- package/lib/module/utils/imagePreloader.js +3 -1
- package/lib/module/utils/networkDiagnostics.js +217 -1
- package/lib/module/utils/onairosApi.js +333 -1
- package/lib/module/utils/programmaticFlow.js +111 -1
- package/lib/module/utils/retryHelper.js +211 -1
- package/lib/module/utils/secureStorage.js +330 -6
- package/lib/module/utils/webviewScripts/chatgpt.js +545 -1
- package/lib/module/utils/webviewScripts/claude.js +370 -1
- package/lib/module/utils/webviewScripts/hinge.js +405 -1
- package/lib/module/utils/webviewScripts/index.js +434 -1
- package/lib/module/utils/webviewScripts/instagram.js +448 -1
- package/lib/module/utils/webviewScripts/linkedin.js +874 -1
- package/lib/module/utils/webviewScripts/netflix.js +376 -1
- package/lib/module/utils/webviewScripts/sephora.js +510 -1
- package/lib/module/utils/webviewScripts/spotify.js +413 -1
- package/lib/module/utils/webviewScripts/telegram.js +672 -1
- package/package.json +2 -2
|
@@ -1 +1,454 @@
|
|
|
1
|
-
'use strict';Object[_0x5ef7(0x0)](exports,_0x5ef7(0x1),{'value':!![]}),exports['INSTAGRAM_SUCCESS_SCRIPT']=exports[_0x5ef7(0x2)]=exports[_0x5ef7(0x3)]=exports[_0x5ef7(0x4)]=void 0x0;function _0x5ef7(_0x530636,_0x5ef701){_0x530636=_0x530636-0x0;const _0x426039=_0x5306();let _0x3eeaa8=_0x426039[_0x530636];return _0x3eeaa8;}const INSTAGRAM_CONSENT_POPUP_SCRIPT=exports[_0x5ef7(0x4)]='\x0a(function()\x20{\x0a\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20existing\x20=\x20document.getElementById(\x27onairos-consent-overlay\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20(existing)\x20existing.remove();\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20overlay\x20=\x20document.createElement(\x27div\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20overlay.id\x20=\x20\x27onairos-consent-overlay\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20overlay.style.cssText\x20=\x20`\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position:\x20fixed;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20top:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20left:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x20100%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height:\x20100%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20background:\x20rgba(0,\x200,\x200,\x200.7);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20z-index:\x20999999;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20flex;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20align-items:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20justify-content:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-family:\x20-apple-system,\x20BlinkMacSystemFont,\x20\x27Segoe\x20UI\x27,\x20Roboto,\x20sans-serif;\x0a\x20\x20\x20\x20\x20\x20\x20\x20`;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20popup\x20=\x20document.createElement(\x27div\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20popup.style.cssText\x20=\x20`\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20background:\x20white;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border-radius:\x2016px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding:\x2032px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20max-width:\x20400px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x2090%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20box-shadow:\x200\x2020px\x2060px\x20rgba(0,\x200,\x200,\x200.3);\x0a\x20\x20\x20\x20\x20\x20\x20\x20`;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20popup.innerHTML\x20=\x20`\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20style=\x22text-align:\x20center;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20style=\x22font-size:\x2048px;\x20margin-bottom:\x2016px;\x22>📸</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h2\x20style=\x22margin:\x200\x200\x2012px\x200;\x20font-size:\x2024px;\x20color:\x20#1a1a1a;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Export\x20Instagram\x20Data?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</h2>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20style=\x22margin:\x200\x200\x2024px\x200;\x20color:\x20#666;\x20font-size:\x2016px;\x20line-height:\x201.5;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Allow\x20Onairos\x20to\x20export\x20your\x20Instagram\x20activity\x20(likes,\x20saves)\x20for\x20analysis?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20style=\x22display:\x20flex;\x20gap:\x2012px;\x20justify-content:\x20center;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20id=\x22onairos-deny\x22\x20style=\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20flex:\x201;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding:\x2014px\x2024px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border:\x202px\x20solid\x20#e0e0e0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20background:\x20white;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20color:\x20#666;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border-radius:\x208px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2016px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-weight:\x20600;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20cursor:\x20pointer;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22>Deny</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20id=\x22onairos-allow\x22\x20style=\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20flex:\x201;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding:\x2014px\x2024px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border:\x20none;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20background:\x20linear-gradient(135deg,\x20#E1306C\x200%,\x20#C13584\x2050%,\x20#833AB4\x20100%);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20color:\x20white;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border-radius:\x208px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2016px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-weight:\x20600;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20cursor:\x20pointer;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22>Allow</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20`;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20overlay.appendChild(popup);\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.body.appendChild(overlay);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.getElementById(\x27onairos-deny\x27).onclick\x20=\x20()\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20overlay.remove();\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27INSTAGRAM_CONSENT\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20status:\x20\x27denied\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x20\x20\x20\x20\x20\x20\x20\x20};\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.getElementById(\x27onairos-allow\x27).onclick\x20=\x20()\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20document.getElementById(\x27onairos-allow\x27).innerHTML\x20=\x20\x27⏳\x20Starting...\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20document.getElementById(\x27onairos-allow\x27).disabled\x20=\x20true;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27INSTAGRAM_CONSENT\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20status:\x20\x27allowed\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20setTimeout(()\x20=>\x20overlay.remove(),\x20500);\x0a\x20\x20\x20\x20\x20\x20\x20\x20};\x0a\x20\x20\x20\x20}\x20catch\x20(error)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27INSTAGRAM_CONSENT\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20status:\x20\x27error\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20error.message\x0a\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x20\x20\x20\x20}\x0a})();\x0atrue;\x0a',INSTAGRAM_EXPORT_SCRIPT=exports[_0x5ef7(0x2)]='\x0a(function()\x20{\x0a\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27🔄\x20[INSTAGRAM]\x20Script\x20version:\x20SDK_V1\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27DEBUG_LOG\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Instagram\x20Script\x20version:\x20SDK_V1\x20loaded\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20(!document.body)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27INSTAGRAM_EXPORT_ERROR\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Page\x20not\x20ready\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20============================================================\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20PLACEHOLDER\x20API\x20CONFIGURATION\x20-\x20REPLACE\x20WITH\x20ACTUAL\x20ENDPOINTS\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20============================================================\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20INSTAGRAM_CONFIG\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Base\x20URL\x20for\x20Instagram\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20baseUrl:\x20\x27https://www.instagram.com\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20API\x20Endpoints\x20-\x20PLACEHOLDERS\x20(Instagram\x20uses\x20GraphQL\x20heavily)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20endpoints:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20GraphQL\x20endpoint\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20graphql:\x20\x27/graphql/query/\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Get\x20liked\x20posts\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20likedPosts:\x20\x27/api/v1/feed/liked/\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Get\x20saved\x20posts/collections\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20savedPosts:\x20\x27/api/v1/feed/saved/posts/\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Get\x20saved\x20collections\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20savedCollections:\x20\x27/api/v1/collections/list/\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Get\x20following\x20activity\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20activity:\x20\x27/api/v1/activity/inbox/\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20User\x20info\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20userInfo:\x20\x27/api/v1/users/web_profile_info/\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20GraphQL\x20query\x20hashes\x20-\x20PLACEHOLDERS\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20queryHashes:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20likedPosts:\x20\x27PLACEHOLDER_QUERY_HASH_LIKED\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20savedPosts:\x20\x27PLACEHOLDER_QUERY_HASH_SAVED\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20userFeed:\x20\x27PLACEHOLDER_QUERY_HASH_FEED\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Extract\x20authentication\x20data\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20getAuth:\x20()\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20auth\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20csrfToken:\x20null,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20sessionId:\x20null,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20userId:\x20null,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20appId:\x20null,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20};\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Get\x20CSRF\x20token\x20from\x20cookie\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20csrfMatch\x20=\x20document.cookie.match(/csrftoken=([^;]+)/);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(csrfMatch)\x20auth.csrfToken\x20=\x20csrfMatch[1];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Get\x20session\x20ID\x20from\x20cookie\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20sessionMatch\x20=\x20document.cookie.match(/sessionid=([^;]+)/);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(sessionMatch)\x20auth.sessionId\x20=\x20sessionMatch[1];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Try\x20to\x20get\x20user\x20ID\x20from\x20page\x20data\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20sharedData\x20=\x20window._sharedData\x20||\x20JSON.parse(document.querySelector(\x27script[type=\x22application/json\x22]\x27)?.textContent\x20||\x20\x27{}\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20auth.userId\x20=\x20sharedData?.config?.viewerId;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20auth.appId\x20=\x20sharedData?.config?.appId;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20catch\x20(e)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[INSTAGRAM]\x20Could\x20not\x20extract\x20sharedData\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Try\x20to\x20get\x20from\x20window.__additionalDataLoaded\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(window.__additionalDataLoaded)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20keys\x20=\x20Object.keys(window.__additionalDataLoaded);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(keys.length\x20>\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20data\x20=\x20window.__additionalDataLoaded[keys[0]];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(data?.graphql?.user?.id)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20auth.userId\x20=\x20data.graphql.user.id;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20auth;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Request\x20headers\x20template\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20getHeaders:\x20(auth)\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x27Accept\x27:\x20\x27*/*\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x27Accept-Language\x27:\x20\x27en-US,en;q=0.9\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x27Content-Type\x27:\x20\x27application/x-www-form-urlencoded\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x27X-CSRFToken\x27:\x20auth.csrfToken\x20||\x20\x27\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x27X-IG-App-ID\x27:\x20auth.appId\x20||\x20\x27936619743392459\x27,\x20\x20//\x20PLACEHOLDER\x20-\x20common\x20web\x20app\x20ID\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x27X-Requested-With\x27:\x20\x27XMLHttpRequest\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x27Referer\x27:\x20\x27https://www.instagram.com/\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20})\x0a\x20\x20\x20\x20\x20\x20\x20\x20};\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20============================================================\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27🚀\x20[INSTAGRAM]\x20Starting\x20extraction...\x27);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20(async\x20()\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20STEP\x201:\x20Get\x20authentication\x20data\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27INSTAGRAM_EXPORT_PROGRESS\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20stage:\x20\x27fetching_auth\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20progress:\x202,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Getting\x20authentication...\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[INSTAGRAM]\x20Getting\x20auth\x20data...\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20auth\x20=\x20INSTAGRAM_CONFIG.getAuth();\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[INSTAGRAM]\x20Auth:\x27,\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20hasCSRF:\x20!!auth.csrfToken,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20hasSession:\x20!!auth.sessionId,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20hasUserId:\x20!!auth.userId\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20});\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(!auth.csrfToken)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.warn(\x27[INSTAGRAM]\x20No\x20CSRF\x20token\x20-\x20user\x20may\x20not\x20be\x20logged\x20in\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20headers\x20=\x20INSTAGRAM_CONFIG.getHeaders(auth);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20STEP\x202:\x20Fetch\x20liked\x20posts\x20(multiple\x20API\x20approach\x20like\x20Gemini)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27INSTAGRAM_EXPORT_PROGRESS\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20stage:\x20\x27fetching_likes\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20progress:\x2015,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Fetching\x20liked\x20posts...\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20let\x20likedPosts\x20=\x20[];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[INSTAGRAM]\x20Fetching\x20liked\x20posts...\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20likesResponse\x20=\x20await\x20fetch(INSTAGRAM_CONFIG.baseUrl\x20+\x20INSTAGRAM_CONFIG.endpoints.likedPosts,\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20method:\x20\x27GET\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20credentials:\x20\x27include\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20headers:\x20headers\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20});\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[INSTAGRAM]\x20Likes\x20response:\x27,\x20likesResponse.status);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(likesResponse.ok)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20likesData\x20=\x20await\x20likesResponse.json();\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20PLACEHOLDER:\x20Adjust\x20based\x20on\x20actual\x20API\x20response\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20likedPosts\x20=\x20likesData.items\x20||\x20likesData.data\x20||\x20likesData\x20||\x20[];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[INSTAGRAM]\x20Found\x27,\x20likedPosts.length,\x20\x27liked\x20posts\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20catch\x20(likesError)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.warn(\x27[INSTAGRAM]\x20Likes\x20fetch\x20error:\x27,\x20likesError.message);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20STEP\x203:\x20Fetch\x20saved\x20posts\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27INSTAGRAM_EXPORT_PROGRESS\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20stage:\x20\x27fetching_saves\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20progress:\x2040,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Fetching\x20saved\x20posts...\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20let\x20savedPosts\x20=\x20[];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[INSTAGRAM]\x20Fetching\x20saved\x20posts...\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20savedResponse\x20=\x20await\x20fetch(INSTAGRAM_CONFIG.baseUrl\x20+\x20INSTAGRAM_CONFIG.endpoints.savedPosts,\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20method:\x20\x27GET\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20credentials:\x20\x27include\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20headers:\x20headers\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20});\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[INSTAGRAM]\x20Saved\x20response:\x27,\x20savedResponse.status);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(savedResponse.ok)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20savedData\x20=\x20await\x20savedResponse.json();\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20PLACEHOLDER:\x20Adjust\x20based\x20on\x20actual\x20API\x20response\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20savedPosts\x20=\x20savedData.items\x20||\x20savedData.data\x20||\x20savedData\x20||\x20[];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[INSTAGRAM]\x20Found\x27,\x20savedPosts.length,\x20\x27saved\x20posts\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20catch\x20(savedError)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.warn(\x27[INSTAGRAM]\x20Saved\x20fetch\x20error:\x27,\x20savedError.message);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20STEP\x204:\x20Fetch\x20saved\x20collections\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27INSTAGRAM_EXPORT_PROGRESS\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20stage:\x20\x27fetching_collections\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20progress:\x2060,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Fetching\x20collections...\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20let\x20collections\x20=\x20[];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[INSTAGRAM]\x20Fetching\x20collections...\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20collectionsResponse\x20=\x20await\x20fetch(INSTAGRAM_CONFIG.baseUrl\x20+\x20INSTAGRAM_CONFIG.endpoints.savedCollections,\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20method:\x20\x27GET\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20credentials:\x20\x27include\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20headers:\x20headers\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20});\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[INSTAGRAM]\x20Collections\x20response:\x27,\x20collectionsResponse.status);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(collectionsResponse.ok)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20collectionsData\x20=\x20await\x20collectionsResponse.json();\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20PLACEHOLDER:\x20Adjust\x20based\x20on\x20actual\x20API\x20response\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20collections\x20=\x20collectionsData.items\x20||\x20collectionsData.collections\x20||\x20collectionsData\x20||\x20[];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[INSTAGRAM]\x20Found\x27,\x20collections.length,\x20\x27collections\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20catch\x20(collectionsError)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.warn(\x27[INSTAGRAM]\x20Collections\x20fetch\x20error:\x27,\x20collectionsError.message);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20STEP\x205:\x20Process\x20and\x20format\x20data\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27INSTAGRAM_EXPORT_PROGRESS\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20stage:\x20\x27processing\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20progress:\x2080,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Processing\x20data...\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Format\x20liked\x20posts\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20formattedLikes\x20=\x20likedPosts.slice(0,\x20100).map(post\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20id:\x20post.id\x20||\x20post.pk,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27like\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20PLACEHOLDER:\x20Adjust\x20field\x20names\x20based\x20on\x20actual\x20API\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20mediaType:\x20post.media_type,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20caption:\x20post.caption?.text\x20||\x20\x27\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20owner:\x20post.user?.username\x20||\x20post.owner?.username\x20||\x20\x27\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20timestamp:\x20post.taken_at\x20||\x20post.created_at,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20url:\x20post.permalink\x20||\x20(\x27https://instagram.com/p/\x27\x20+\x20post.code),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Format\x20saved\x20posts\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20formattedSaves\x20=\x20savedPosts.slice(0,\x20100).map(post\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20id:\x20post.id\x20||\x20post.pk,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27save\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20mediaType:\x20post.media_type,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20caption:\x20post.caption?.text\x20||\x20\x27\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20owner:\x20post.user?.username\x20||\x20post.owner?.username\x20||\x20\x27\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20timestamp:\x20post.taken_at\x20||\x20post.created_at,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20url:\x20post.permalink\x20||\x20(\x27https://instagram.com/p/\x27\x20+\x20post.code),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Format\x20collections\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20formattedCollections\x20=\x20collections.slice(0,\x2020).map(col\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20id:\x20col.id\x20||\x20col.collection_id,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20name:\x20col.name\x20||\x20col.collection_name\x20||\x20\x27Untitled\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20mediaCount:\x20col.media_count\x20||\x20col.count\x20||\x200,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20coverUrl:\x20col.cover_media?.url\x20||\x20null,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20STEP\x206:\x20Send\x20results\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27✅\x20[INSTAGRAM]\x20Extraction\x20complete:\x27,\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20likes:\x20formattedLikes.length,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20saves:\x20formattedSaves.length,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20collections:\x20formattedCollections.length\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20});\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27INSTAGRAM_EXPORT_COMPLETE\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20status:\x20\x27success\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20data:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20likes:\x20formattedLikes,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20saves:\x20formattedSaves,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20collections:\x20formattedCollections,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20total_likes:\x20formattedLikes.length,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20total_saves:\x20formattedSaves.length,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20total_collections:\x20formattedCollections.length,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20userId:\x20auth.userId\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20success:\x20true\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20catch\x20(error)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.error(\x27❌\x20[INSTAGRAM]\x20Export\x20failed:\x27,\x20error.message);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27INSTAGRAM_EXPORT_ERROR\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20status:\x20\x27error\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Fetch\x20failed:\x20\x27\x20+\x20error.message,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20success:\x20false\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20})();\x0a\x0a\x20\x20\x20\x20}\x20catch\x20(error)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20console.error(\x27❌\x20[INSTAGRAM]\x20Init\x20error:\x27,\x20error.message);\x0a\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27INSTAGRAM_EXPORT_ERROR\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20status:\x20\x27error\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Script\x20error:\x20\x27\x20+\x20error.message,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20success:\x20false\x0a\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x20\x20\x20\x20}\x0a})();\x0atrue;\x0a',INSTAGRAM_SUCCESS_SCRIPT=exports['INSTAGRAM_SUCCESS_SCRIPT']=_0x5ef7(0x5),INSTAGRAM_ERROR_SCRIPT=exports[_0x5ef7(0x3)]=_0x5ef7(0x6);function _0x5306(){const _0x534848=['defineProperty','__esModule','INSTAGRAM_EXPORT_SCRIPT','INSTAGRAM_ERROR_SCRIPT','INSTAGRAM_CONSENT_POPUP_SCRIPT','\x0a(function()\x20{\x0a\x20\x20\x20\x20console.log(\x27✅\x20Instagram\x20export\x20successful!\x27);\x0a})();\x0atrue;\x0a','\x0a(function()\x20{\x0a\x20\x20\x20\x20console.log(\x27❌\x20Instagram\x20export\x20failed!\x27);\x0a})();\x0atrue;\x0a'];_0x5306=function(){return _0x534848;};return _0x5306();}
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.INSTAGRAM_SUCCESS_SCRIPT = exports.INSTAGRAM_EXPORT_SCRIPT = exports.INSTAGRAM_ERROR_SCRIPT = exports.INSTAGRAM_CONSENT_POPUP_SCRIPT = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Instagram WebView Injection Scripts
|
|
9
|
+
*
|
|
10
|
+
* JavaScript code injected into Instagram WebView to:
|
|
11
|
+
* 1. Show consent popup for user approval
|
|
12
|
+
* 2. Fetch user activity data (likes, saves, etc.)
|
|
13
|
+
* 3. Extract engagement data
|
|
14
|
+
* 4. Track progress during export
|
|
15
|
+
* 5. Send data back to React Native
|
|
16
|
+
*
|
|
17
|
+
* @reference ChatGPT implementation: src/utils/webviewScripts/chatgpt.ts
|
|
18
|
+
*
|
|
19
|
+
* NOTE: Instagram has multiple internal APIs, similar to Gemini pattern
|
|
20
|
+
* API endpoints and token structures are PLACEHOLDERS
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Consent Popup Script
|
|
25
|
+
* Shows user consent UI before exporting data
|
|
26
|
+
*/
|
|
27
|
+
const INSTAGRAM_CONSENT_POPUP_SCRIPT = exports.INSTAGRAM_CONSENT_POPUP_SCRIPT = `
|
|
28
|
+
(function() {
|
|
29
|
+
try {
|
|
30
|
+
const existing = document.getElementById('onairos-consent-overlay');
|
|
31
|
+
if (existing) existing.remove();
|
|
32
|
+
|
|
33
|
+
const overlay = document.createElement('div');
|
|
34
|
+
overlay.id = 'onairos-consent-overlay';
|
|
35
|
+
overlay.style.cssText = \`
|
|
36
|
+
position: fixed;
|
|
37
|
+
top: 0;
|
|
38
|
+
left: 0;
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
background: rgba(0, 0, 0, 0.7);
|
|
42
|
+
z-index: 999999;
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
47
|
+
\`;
|
|
48
|
+
|
|
49
|
+
const popup = document.createElement('div');
|
|
50
|
+
popup.style.cssText = \`
|
|
51
|
+
background: white;
|
|
52
|
+
border-radius: 16px;
|
|
53
|
+
padding: 32px;
|
|
54
|
+
max-width: 400px;
|
|
55
|
+
width: 90%;
|
|
56
|
+
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
|
|
57
|
+
\`;
|
|
58
|
+
|
|
59
|
+
popup.innerHTML = \`
|
|
60
|
+
<div style="text-align: center;">
|
|
61
|
+
<div style="font-size: 48px; margin-bottom: 16px;">📸</div>
|
|
62
|
+
<h2 style="margin: 0 0 12px 0; font-size: 24px; color: #1a1a1a;">
|
|
63
|
+
Export Instagram Data?
|
|
64
|
+
</h2>
|
|
65
|
+
<p style="margin: 0 0 24px 0; color: #666; font-size: 16px; line-height: 1.5;">
|
|
66
|
+
Allow Onairos to export your Instagram activity (likes, saves) for analysis?
|
|
67
|
+
</p>
|
|
68
|
+
<div style="display: flex; gap: 12px; justify-content: center;">
|
|
69
|
+
<button id="onairos-deny" style="
|
|
70
|
+
flex: 1;
|
|
71
|
+
padding: 14px 24px;
|
|
72
|
+
border: 2px solid #e0e0e0;
|
|
73
|
+
background: white;
|
|
74
|
+
color: #666;
|
|
75
|
+
border-radius: 8px;
|
|
76
|
+
font-size: 16px;
|
|
77
|
+
font-weight: 600;
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
">Deny</button>
|
|
80
|
+
<button id="onairos-allow" style="
|
|
81
|
+
flex: 1;
|
|
82
|
+
padding: 14px 24px;
|
|
83
|
+
border: none;
|
|
84
|
+
background: linear-gradient(135deg, #E1306C 0%, #C13584 50%, #833AB4 100%);
|
|
85
|
+
color: white;
|
|
86
|
+
border-radius: 8px;
|
|
87
|
+
font-size: 16px;
|
|
88
|
+
font-weight: 600;
|
|
89
|
+
cursor: pointer;
|
|
90
|
+
">Allow</button>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
\`;
|
|
94
|
+
|
|
95
|
+
overlay.appendChild(popup);
|
|
96
|
+
document.body.appendChild(overlay);
|
|
97
|
+
|
|
98
|
+
document.getElementById('onairos-deny').onclick = () => {
|
|
99
|
+
overlay.remove();
|
|
100
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
101
|
+
type: 'INSTAGRAM_CONSENT',
|
|
102
|
+
status: 'denied'
|
|
103
|
+
}));
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
document.getElementById('onairos-allow').onclick = () => {
|
|
107
|
+
document.getElementById('onairos-allow').innerHTML = '⏳ Starting...';
|
|
108
|
+
document.getElementById('onairos-allow').disabled = true;
|
|
109
|
+
|
|
110
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
111
|
+
type: 'INSTAGRAM_CONSENT',
|
|
112
|
+
status: 'allowed'
|
|
113
|
+
}));
|
|
114
|
+
|
|
115
|
+
setTimeout(() => overlay.remove(), 500);
|
|
116
|
+
};
|
|
117
|
+
} catch (error) {
|
|
118
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
119
|
+
type: 'INSTAGRAM_CONSENT',
|
|
120
|
+
status: 'error',
|
|
121
|
+
message: error.message
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
})();
|
|
125
|
+
true;
|
|
126
|
+
`;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Export Script - Instagram data extraction
|
|
130
|
+
*
|
|
131
|
+
* Instagram has multiple internal APIs (similar to Gemini pattern):
|
|
132
|
+
* 1. GraphQL API for feed/likes data
|
|
133
|
+
* 2. Web API for saved posts
|
|
134
|
+
* 3. Activity API for interactions
|
|
135
|
+
*
|
|
136
|
+
* TODO: Fill in actual API endpoints once known:
|
|
137
|
+
* - GRAPHQL_ENDPOINT: Instagram's GraphQL endpoint
|
|
138
|
+
* - SAVED_POSTS_ENDPOINT: Endpoint for saved posts
|
|
139
|
+
* - LIKED_POSTS_ENDPOINT: Endpoint for liked posts
|
|
140
|
+
* - AUTH_TOKEN_LOCATION: Where to find CSRF token and session
|
|
141
|
+
*/
|
|
142
|
+
const INSTAGRAM_EXPORT_SCRIPT = exports.INSTAGRAM_EXPORT_SCRIPT = `
|
|
143
|
+
(function() {
|
|
144
|
+
try {
|
|
145
|
+
console.log('🔄 [INSTAGRAM] Script version: SDK_V1');
|
|
146
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
147
|
+
type: 'DEBUG_LOG',
|
|
148
|
+
message: 'Instagram Script version: SDK_V1 loaded'
|
|
149
|
+
}));
|
|
150
|
+
|
|
151
|
+
if (!document.body) {
|
|
152
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
153
|
+
type: 'INSTAGRAM_EXPORT_ERROR',
|
|
154
|
+
message: 'Page not ready'
|
|
155
|
+
}));
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// ============================================================
|
|
160
|
+
// PLACEHOLDER API CONFIGURATION - REPLACE WITH ACTUAL ENDPOINTS
|
|
161
|
+
// ============================================================
|
|
162
|
+
const INSTAGRAM_CONFIG = {
|
|
163
|
+
// Base URL for Instagram
|
|
164
|
+
baseUrl: 'https://www.instagram.com',
|
|
165
|
+
|
|
166
|
+
// API Endpoints - PLACEHOLDERS (Instagram uses GraphQL heavily)
|
|
167
|
+
endpoints: {
|
|
168
|
+
// GraphQL endpoint
|
|
169
|
+
graphql: '/graphql/query/', // PLACEHOLDER
|
|
170
|
+
// Get liked posts
|
|
171
|
+
likedPosts: '/api/v1/feed/liked/', // PLACEHOLDER
|
|
172
|
+
// Get saved posts/collections
|
|
173
|
+
savedPosts: '/api/v1/feed/saved/posts/', // PLACEHOLDER
|
|
174
|
+
// Get saved collections
|
|
175
|
+
savedCollections: '/api/v1/collections/list/', // PLACEHOLDER
|
|
176
|
+
// Get following activity
|
|
177
|
+
activity: '/api/v1/activity/inbox/', // PLACEHOLDER
|
|
178
|
+
// User info
|
|
179
|
+
userInfo: '/api/v1/users/web_profile_info/', // PLACEHOLDER
|
|
180
|
+
},
|
|
181
|
+
|
|
182
|
+
// GraphQL query hashes - PLACEHOLDERS
|
|
183
|
+
queryHashes: {
|
|
184
|
+
likedPosts: 'PLACEHOLDER_QUERY_HASH_LIKED',
|
|
185
|
+
savedPosts: 'PLACEHOLDER_QUERY_HASH_SAVED',
|
|
186
|
+
userFeed: 'PLACEHOLDER_QUERY_HASH_FEED',
|
|
187
|
+
},
|
|
188
|
+
|
|
189
|
+
// Extract authentication data
|
|
190
|
+
getAuth: () => {
|
|
191
|
+
const auth = {
|
|
192
|
+
csrfToken: null,
|
|
193
|
+
sessionId: null,
|
|
194
|
+
userId: null,
|
|
195
|
+
appId: null,
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
// Get CSRF token from cookie
|
|
199
|
+
const csrfMatch = document.cookie.match(/csrftoken=([^;]+)/);
|
|
200
|
+
if (csrfMatch) auth.csrfToken = csrfMatch[1];
|
|
201
|
+
|
|
202
|
+
// Get session ID from cookie
|
|
203
|
+
const sessionMatch = document.cookie.match(/sessionid=([^;]+)/);
|
|
204
|
+
if (sessionMatch) auth.sessionId = sessionMatch[1];
|
|
205
|
+
|
|
206
|
+
// Try to get user ID from page data
|
|
207
|
+
try {
|
|
208
|
+
const sharedData = window._sharedData || JSON.parse(document.querySelector('script[type="application/json"]')?.textContent || '{}');
|
|
209
|
+
auth.userId = sharedData?.config?.viewerId;
|
|
210
|
+
auth.appId = sharedData?.config?.appId;
|
|
211
|
+
} catch (e) {
|
|
212
|
+
console.log('[INSTAGRAM] Could not extract sharedData');
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// Try to get from window.__additionalDataLoaded
|
|
216
|
+
if (window.__additionalDataLoaded) {
|
|
217
|
+
const keys = Object.keys(window.__additionalDataLoaded);
|
|
218
|
+
if (keys.length > 0) {
|
|
219
|
+
const data = window.__additionalDataLoaded[keys[0]];
|
|
220
|
+
if (data?.graphql?.user?.id) {
|
|
221
|
+
auth.userId = data.graphql.user.id;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return auth;
|
|
227
|
+
},
|
|
228
|
+
|
|
229
|
+
// Request headers template
|
|
230
|
+
getHeaders: (auth) => ({
|
|
231
|
+
'Accept': '*/*',
|
|
232
|
+
'Accept-Language': 'en-US,en;q=0.9',
|
|
233
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
234
|
+
'X-CSRFToken': auth.csrfToken || '',
|
|
235
|
+
'X-IG-App-ID': auth.appId || '936619743392459', // PLACEHOLDER - common web app ID
|
|
236
|
+
'X-Requested-With': 'XMLHttpRequest',
|
|
237
|
+
'Referer': 'https://www.instagram.com/',
|
|
238
|
+
})
|
|
239
|
+
};
|
|
240
|
+
// ============================================================
|
|
241
|
+
|
|
242
|
+
console.log('🚀 [INSTAGRAM] Starting extraction...');
|
|
243
|
+
|
|
244
|
+
(async () => {
|
|
245
|
+
try {
|
|
246
|
+
// STEP 1: Get authentication data
|
|
247
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
248
|
+
type: 'INSTAGRAM_EXPORT_PROGRESS',
|
|
249
|
+
stage: 'fetching_auth',
|
|
250
|
+
progress: 2,
|
|
251
|
+
message: 'Getting authentication...'
|
|
252
|
+
}));
|
|
253
|
+
|
|
254
|
+
console.log('[INSTAGRAM] Getting auth data...');
|
|
255
|
+
const auth = INSTAGRAM_CONFIG.getAuth();
|
|
256
|
+
console.log('[INSTAGRAM] Auth:', {
|
|
257
|
+
hasCSRF: !!auth.csrfToken,
|
|
258
|
+
hasSession: !!auth.sessionId,
|
|
259
|
+
hasUserId: !!auth.userId
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
if (!auth.csrfToken) {
|
|
263
|
+
console.warn('[INSTAGRAM] No CSRF token - user may not be logged in');
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
const headers = INSTAGRAM_CONFIG.getHeaders(auth);
|
|
267
|
+
|
|
268
|
+
// STEP 2: Fetch liked posts (multiple API approach like Gemini)
|
|
269
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
270
|
+
type: 'INSTAGRAM_EXPORT_PROGRESS',
|
|
271
|
+
stage: 'fetching_likes',
|
|
272
|
+
progress: 15,
|
|
273
|
+
message: 'Fetching liked posts...'
|
|
274
|
+
}));
|
|
275
|
+
|
|
276
|
+
let likedPosts = [];
|
|
277
|
+
console.log('[INSTAGRAM] Fetching liked posts...');
|
|
278
|
+
|
|
279
|
+
try {
|
|
280
|
+
const likesResponse = await fetch(INSTAGRAM_CONFIG.baseUrl + INSTAGRAM_CONFIG.endpoints.likedPosts, {
|
|
281
|
+
method: 'GET',
|
|
282
|
+
credentials: 'include',
|
|
283
|
+
headers: headers
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
console.log('[INSTAGRAM] Likes response:', likesResponse.status);
|
|
287
|
+
|
|
288
|
+
if (likesResponse.ok) {
|
|
289
|
+
const likesData = await likesResponse.json();
|
|
290
|
+
// PLACEHOLDER: Adjust based on actual API response
|
|
291
|
+
likedPosts = likesData.items || likesData.data || likesData || [];
|
|
292
|
+
console.log('[INSTAGRAM] Found', likedPosts.length, 'liked posts');
|
|
293
|
+
}
|
|
294
|
+
} catch (likesError) {
|
|
295
|
+
console.warn('[INSTAGRAM] Likes fetch error:', likesError.message);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// STEP 3: Fetch saved posts
|
|
299
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
300
|
+
type: 'INSTAGRAM_EXPORT_PROGRESS',
|
|
301
|
+
stage: 'fetching_saves',
|
|
302
|
+
progress: 40,
|
|
303
|
+
message: 'Fetching saved posts...'
|
|
304
|
+
}));
|
|
305
|
+
|
|
306
|
+
let savedPosts = [];
|
|
307
|
+
console.log('[INSTAGRAM] Fetching saved posts...');
|
|
308
|
+
|
|
309
|
+
try {
|
|
310
|
+
const savedResponse = await fetch(INSTAGRAM_CONFIG.baseUrl + INSTAGRAM_CONFIG.endpoints.savedPosts, {
|
|
311
|
+
method: 'GET',
|
|
312
|
+
credentials: 'include',
|
|
313
|
+
headers: headers
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
console.log('[INSTAGRAM] Saved response:', savedResponse.status);
|
|
317
|
+
|
|
318
|
+
if (savedResponse.ok) {
|
|
319
|
+
const savedData = await savedResponse.json();
|
|
320
|
+
// PLACEHOLDER: Adjust based on actual API response
|
|
321
|
+
savedPosts = savedData.items || savedData.data || savedData || [];
|
|
322
|
+
console.log('[INSTAGRAM] Found', savedPosts.length, 'saved posts');
|
|
323
|
+
}
|
|
324
|
+
} catch (savedError) {
|
|
325
|
+
console.warn('[INSTAGRAM] Saved fetch error:', savedError.message);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// STEP 4: Fetch saved collections
|
|
329
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
330
|
+
type: 'INSTAGRAM_EXPORT_PROGRESS',
|
|
331
|
+
stage: 'fetching_collections',
|
|
332
|
+
progress: 60,
|
|
333
|
+
message: 'Fetching collections...'
|
|
334
|
+
}));
|
|
335
|
+
|
|
336
|
+
let collections = [];
|
|
337
|
+
console.log('[INSTAGRAM] Fetching collections...');
|
|
338
|
+
|
|
339
|
+
try {
|
|
340
|
+
const collectionsResponse = await fetch(INSTAGRAM_CONFIG.baseUrl + INSTAGRAM_CONFIG.endpoints.savedCollections, {
|
|
341
|
+
method: 'GET',
|
|
342
|
+
credentials: 'include',
|
|
343
|
+
headers: headers
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
console.log('[INSTAGRAM] Collections response:', collectionsResponse.status);
|
|
347
|
+
|
|
348
|
+
if (collectionsResponse.ok) {
|
|
349
|
+
const collectionsData = await collectionsResponse.json();
|
|
350
|
+
// PLACEHOLDER: Adjust based on actual API response
|
|
351
|
+
collections = collectionsData.items || collectionsData.collections || collectionsData || [];
|
|
352
|
+
console.log('[INSTAGRAM] Found', collections.length, 'collections');
|
|
353
|
+
}
|
|
354
|
+
} catch (collectionsError) {
|
|
355
|
+
console.warn('[INSTAGRAM] Collections fetch error:', collectionsError.message);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
// STEP 5: Process and format data
|
|
359
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
360
|
+
type: 'INSTAGRAM_EXPORT_PROGRESS',
|
|
361
|
+
stage: 'processing',
|
|
362
|
+
progress: 80,
|
|
363
|
+
message: 'Processing data...'
|
|
364
|
+
}));
|
|
365
|
+
|
|
366
|
+
// Format liked posts
|
|
367
|
+
const formattedLikes = likedPosts.slice(0, 100).map(post => ({
|
|
368
|
+
id: post.id || post.pk,
|
|
369
|
+
type: 'like',
|
|
370
|
+
// PLACEHOLDER: Adjust field names based on actual API
|
|
371
|
+
mediaType: post.media_type,
|
|
372
|
+
caption: post.caption?.text || '',
|
|
373
|
+
owner: post.user?.username || post.owner?.username || '',
|
|
374
|
+
timestamp: post.taken_at || post.created_at,
|
|
375
|
+
url: post.permalink || ('https://instagram.com/p/' + post.code),
|
|
376
|
+
}));
|
|
377
|
+
|
|
378
|
+
// Format saved posts
|
|
379
|
+
const formattedSaves = savedPosts.slice(0, 100).map(post => ({
|
|
380
|
+
id: post.id || post.pk,
|
|
381
|
+
type: 'save',
|
|
382
|
+
mediaType: post.media_type,
|
|
383
|
+
caption: post.caption?.text || '',
|
|
384
|
+
owner: post.user?.username || post.owner?.username || '',
|
|
385
|
+
timestamp: post.taken_at || post.created_at,
|
|
386
|
+
url: post.permalink || ('https://instagram.com/p/' + post.code),
|
|
387
|
+
}));
|
|
388
|
+
|
|
389
|
+
// Format collections
|
|
390
|
+
const formattedCollections = collections.slice(0, 20).map(col => ({
|
|
391
|
+
id: col.id || col.collection_id,
|
|
392
|
+
name: col.name || col.collection_name || 'Untitled',
|
|
393
|
+
mediaCount: col.media_count || col.count || 0,
|
|
394
|
+
coverUrl: col.cover_media?.url || null,
|
|
395
|
+
}));
|
|
396
|
+
|
|
397
|
+
// STEP 6: Send results
|
|
398
|
+
console.log('✅ [INSTAGRAM] Extraction complete:', {
|
|
399
|
+
likes: formattedLikes.length,
|
|
400
|
+
saves: formattedSaves.length,
|
|
401
|
+
collections: formattedCollections.length
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
405
|
+
type: 'INSTAGRAM_EXPORT_COMPLETE',
|
|
406
|
+
status: 'success',
|
|
407
|
+
data: {
|
|
408
|
+
likes: formattedLikes,
|
|
409
|
+
saves: formattedSaves,
|
|
410
|
+
collections: formattedCollections,
|
|
411
|
+
total_likes: formattedLikes.length,
|
|
412
|
+
total_saves: formattedSaves.length,
|
|
413
|
+
total_collections: formattedCollections.length,
|
|
414
|
+
userId: auth.userId
|
|
415
|
+
},
|
|
416
|
+
success: true
|
|
417
|
+
}));
|
|
418
|
+
|
|
419
|
+
} catch (error) {
|
|
420
|
+
console.error('❌ [INSTAGRAM] Export failed:', error.message);
|
|
421
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
422
|
+
type: 'INSTAGRAM_EXPORT_ERROR',
|
|
423
|
+
status: 'error',
|
|
424
|
+
message: 'Fetch failed: ' + error.message,
|
|
425
|
+
success: false
|
|
426
|
+
}));
|
|
427
|
+
}
|
|
428
|
+
})();
|
|
429
|
+
|
|
430
|
+
} catch (error) {
|
|
431
|
+
console.error('❌ [INSTAGRAM] Init error:', error.message);
|
|
432
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
433
|
+
type: 'INSTAGRAM_EXPORT_ERROR',
|
|
434
|
+
status: 'error',
|
|
435
|
+
message: 'Script error: ' + error.message,
|
|
436
|
+
success: false
|
|
437
|
+
}));
|
|
438
|
+
}
|
|
439
|
+
})();
|
|
440
|
+
true;
|
|
441
|
+
`;
|
|
442
|
+
const INSTAGRAM_SUCCESS_SCRIPT = exports.INSTAGRAM_SUCCESS_SCRIPT = `
|
|
443
|
+
(function() {
|
|
444
|
+
console.log('✅ Instagram export successful!');
|
|
445
|
+
})();
|
|
446
|
+
true;
|
|
447
|
+
`;
|
|
448
|
+
const INSTAGRAM_ERROR_SCRIPT = exports.INSTAGRAM_ERROR_SCRIPT = `
|
|
449
|
+
(function() {
|
|
450
|
+
console.log('❌ Instagram export failed!');
|
|
451
|
+
})();
|
|
452
|
+
true;
|
|
453
|
+
`;
|
|
454
|
+
//# sourceMappingURL=instagram.js.map
|