/**********************************\*\*\*\*********************************** \*

-   ADOBE CONFIDENTIAL
-   ***
-
-   Copyright 2015-2020 Adobe Systems Incorporated
-   All Rights Reserved.
-
-   NOTICE: All information contained herein is, and remains
-   the property of Adobe Systems Incorporated and its suppliers,
-   if any. The intellectual and technical concepts contained
-   herein are proprietary to Adobe Systems Incorporated and its
-   suppliers and are protected by trade secret or copyright law.
-   Dissemination of this information or reproduction of this material
-   is strictly forbidden unless prior written permission is obtained
-   from Adobe Systems Incorporated.
    ************************************\*\*************************************/

!function(t){var e={};function a(s){if(e[s])return e[s].exports;var r=e[s]={i:s,l:!1,exports:{}};return t[s].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=t,a.c=e,a.d=function(t,e,s){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(a.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)a.d(s,r,function(e){return t[e]}.bind(null,r));return s},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=41)}([function(t,e,a){"use strict";a.r(e);var s=a(8),r=a(25),i=a(22),n=a(6);function o(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}const c=new class{constructor(){o(this,"config",{ENVIRONMENT:"production",ACTIVE_VERSIONS:["V1","V2","V2_5","V2_8","V3_0","V3_1"],SUPPORTED_ACTIVE_VERSIONS:4,SETTINGS_FILE:"settings.json",SETTINGS_FILE_VERSION:3,LOOKUP_MAP_FILE:"map.json",ASSETS_DIRNAME:"assets",CC_SETTINGS_FILE:"C3Config.xml",CONSOLE_LOGGING:!1,SCOPES:"openid,AdobeID",SYNC_INITIAL_RETRY:24e4,MAX_LOG_SIZE:5242880,PROXY_REQUEST_TIMEOUT:2e3,REQUEST_TIMEOUT:3e5,CLIENT_REQUEST_TIMEOUT:9e5,USER_ANALYTICS__REQUEST_TIMEOUT:2e3,GET_NOTIFICATION_DATA_TIMEOUT:2e3,NETWORK_STATUS_INTERVAL:1e3,NODE_FETCH_TIMEOUT:3e3,STOP_SYNCING_BEYOND:6048e5,MAX_BACK_OFF:18e5,PROFILE_URL:"https://cc-collab.adobe.io/profile",PROFILE_URL_STAGING:"https://cc-collab-stage.adobe.io/profile",AVATAR:{LOG_PREFIX:"Avatar"},GLOBAL_BACKOFF_SYNC_THROTTLE:1e4,ONLINE_SYNC_THROTTLE:1e4,SERVER_TIMEOUT:3e4,LEARN_DEFAULT_EXPIRATION:2592e5,ASSET_DEFAULT_EXPIRATION:2592e5,TEMP_KILL_SWITCH_REGISTRY_KEY:"SOFTWARE\\Policies\\Adobe\\CCXProcess",TEMP_KILL_SWITCH_PLIST_PATH:"/Library/Preferences/com.adobe.CCXProcess.plist",TEMP_STOCK_TEMPLATE_DOWNLOAD_LIMIT_REGISTRY_SETTING:"TempStockDownloadLimit",TEMP_CCD_CONTENT_DOWNLOAD_REGISTRY_SETTING:"TempCCDContentDownloadDisabled",TEMP_CCD_CONTENT_DOWNLOAD_DISABLED:!1,LAUNCH_AGENT:`${process.env.HOME}/Library/LaunchAgents/com.adobe.ccxprocess.plist`,LAUNCH_DIRECTORY:`${process.env.HOME}/Library/LaunchAgents/`,NGL_INITIALIZE_TIMEOUT:6e4,TIER_1_LOCALES:["en_US","fr_FR","de_DE","ja_JP","ko_KR"],SUPPORTED_LOCALES:["cs_CZ","da_DK","de_DE","en_US","en_AE","en_GB","en_IL","es_ES","es_MX","fi_FI","fr_FR","fr_CA","fr_MA","hu_HU","it_IT","ja_JP","ko_KR","nb_NO","nl_NL","pl_PL","pt_BR","ru_RU","sv_SE","tr_TR","uk_UA","zh_CN","zh_TW"],DOWNLOAD_ASSET_TIMEOUT:6e4,DNS_CACHE_DURATION:24e4,NUM_CONCURRENT_REQUESTS:10,MIN_RANDOMIZED_TIME:1e3,MAX_RANDOMIZED_TIME:9e5,MAX_TIMEOUT:Math.pow(2,31)-1,MIN_TIMEOUT:36e6,TRIAL_DAYS:7,PRODUCT_ALIASES:{PHSP:"PHXS",SPRKDV:"SPRK",SPRKPR:"SPRK",KCCC:"ACCC"},PRODUCT_LIST:["PHXS","IDSN","PPRO","ILST","AEFT","MUSE","DRWV","FLPR","SPRK"],IGNORED_FILES_REGEXP:"^map.json|\\bassets\\b",NODE_AID_RESPONSE_SCHEMA:{id:"NODE_AID_RESPONSE",type:"object",properties:{ProductsInfo:{type:"object",properties:{ProductInfo:{type:"array",items:{type:"object",properties:{SAPCode:{type:"array",items:{type:"string"}},CodexVersion:{type:"array",items:{type:"string"}},Platform:{type:"array",items:{type:"string"}},InstallerType:{type:"array",items:{type:"string"}},IsUWPProduct:{type:"array",items:{type:"string"}},InstallLanguage:{type:"array",items:{type:"string"}},DisplayName:{type:"array",items:{type:"string"}},BuildVersion:{type:"array",items:{type:"string"}},LaunchString:{type:"array",items:{type:"string"}}}}}}}}},MAP_DATA_SCHEMA:{id:"MAP_DATA",type:"object",properties:{versionInfo:{type:"object"},metadata:{type:"object"},assetMetadata:{type:"object"},version:{type:"number"}},required:["versionInfo","metadata","assetMetadata","version"]},CARDS_CONTROL_SCHEMA:{id:"/CARDS_CONTROL",type:"object",properties:{modeID:{type:["string","null"]},cardOrder:{type:["array","null"],items:{type:"number"}}},required:["modeID","cardOrder"]},FIRST_MILE_RESPONSE_SCHEMA:{id:"/SOPHIA_RESPONSE",type:"object",properties:{analyticsData:{type:"object",properties:{responseGUID:{type:"string"}}},surfaces:{type:"object",additionalProperties:{type:"object",properties:{containers:{type:"array",items:{type:"object",properties:{data:{type:"string",dataType:"string"},containerAnalyticsData:{type:"object"}}}},surfaceAnalyticsData:{type:"object",properties:{surfaceId:{type:"string"}}}}}},expirationDTS:{type:"string"}},required:["expirationDTS"]},CARDS_DATA_SCHEMA:{V1:{id:"CARDS_DATA",type:"object",properties:{cards:{type:"array"},expirationDTS:{type:"string"},cardControl:{type:"array",items:{$ref:"/CARDS_CONTROL"}},version:{type:"number"}},required:["expirationDTS","cards","cardControl"]},V2:{id:"CARDS_DATA",type:"object",properties:{cards:{type:"array"},expirationDTS:{type:"string"},cardControl:{type:"array",items:{$ref:"/CARDS_CONTROL"}},version:{type:"number"}},required:["expirationDTS","cards","cardControl"]},V2_5:{id:"CARDS_DATA",type:"object",properties:{cards:{type:"array"},expirationDTS:{type:"string"},cardControl:{type:"array",items:{$ref:"/CARDS_CONTROL"}},version:{type:"number"}},required:["expirationDTS","cards","cardControl"]},V2_8:{id:"/SOPHIA_RESPONSE",type:"object",properties:{surfaces:{type:"object"},expirationDTS:{type:"string"},version:{type:"number"}},required:["expirationDTS","surfaces"]},V3_0:{id:"/SOPHIA_RESPONSE",type:"object",properties:{surfaces:{type:"object"},expirationDTS:{type:"string"},version:{type:"number"}},required:["expirationDTS","surfaces"]},V3_1:{id:"/SOPHIA_RESPONSE",type:"object",properties:{surfaces:{type:"object"},expirationDTS:{type:"string"},version:{type:"number"}},required:["expirationDTS","surfaces"]}},STOCK_TEMPLATES_DATA_SCHEMA:{id:"STOCK_TEMPLATES_DATA",type:"object",properties:{templates:{type:"array"},expirationDTS:{type:"string"},nb_results:{type:"number"}},required:["expirationDTS"]},VULCAN_PREFIX:"vulcan.SuiteMessage.",VULCAN_STARTUP_MESSAGE:"ccxprocess.Initialized",VULCAN_PING_REQUEST:"ccxprocess.in.request.app.ping",VULCAN_PING_RESPONSE:"ccxprocess.out.response.app.ping",VULCAN_PSDK_FEED_REQUEST:"ccxprocess.PSDKFeedRequest",VULCAN_PSDK_FEED_RESPONSE:"ccxprocess.PSDKFeedResponse",VULCAN_PSDK_FEED_BROADCAST:"ccxprocess.PSDKFeedBroadcast",VULCAN_LEARN_REQUEST:"ccxprocess.LearnRequest",VULCAN_LEARN_RESPONSE:"ccxprocess.LearnResponse",VULCAN_LEARN_USAGE_MARKER:"ccxprocess.LearnUsageMarker",VULCAN_LEARN_BROADCAST:"ccxprocess.LearnBroadcast",VULCAN_GET_USER_REQUEST:"ccxprocess.GetUserRequest",VULCAN_GET_USER_RESPONSE:"ccxprocess.GetUserResponse",VULCAN_START_SETTINGS_REQUEST:"ccxprocess.StartSettingsRequest",VULCAN_START_SETTINGS_GET_REQUEST:"ccxprocess.StartSettingsGetRequest",VULCAN_START_SETTINGS_GET_RESPONSE:"ccxprocess.StartSettingsGetResponse",VULCAN_START_SETTINGS_PATCH_UPDATE:"ccxprocess.StartSettingsPatchUpdate",VULCAN_STOCK_REQUEST:"ccxprocess.StockTemplateRequest",VULCAN_STOCK_RESPONSE:"ccxprocess.StockTemplateResponse",VULCAN_CC_PHOTO_DOWNLOAD_REQUEST:"ccxprocess.CCPhotoDownloadRequest",VULCAN_CC_PHOTO_DOWNLOAD_RESPONSE:"ccxprocess.CCPhotoDownloadResponse",VULCAN_CC_PHOTO_DOWNLOAD_PROGRESS:"ccxprocess.CCPhotoDownloadProgress",VULCAN_CC_PHOTO_DOWNLOAD_ERROR:"ccxprocess.CCPhotoDownloadError",VULCAN_AVATAR_REQUEST:"ccxprocess.UserAvatarRequest",VULCAN_AVATAR_RESPONSE:"ccxprocess.UserAvatarResponse",SKIP_LOGGING_MESSAGE_LIST:["ccxprocess.in.request.app.ping","ccxprocess.out.response.app.ping"],SKIP_LOGGING_MESSAGE_CONTENT:["ccxprocess.in.request.app.ping","ccxprocess.out.response.app.ping","adbproduct.app.UserContextDataResponse","accc.app.ProxySettingsResponse"],NOTIFICATION_REQUEST:"accc.notifications",NOTIFICATION_PSDK_RESPONSE:"ccxprocess.notification.psdk",NOTIFICATION_STOCK_RESPONSE:"ccxprocess.notification.stock",NOTIFICATION_FORCE_REFRESH_RESPONSE:"ccxprocess.notification.force-refresh",NOTIFICATION_PSDK_QUERY_DATA_BY_ID_RESPONSE:"ccxprocess.notification.psdk.byID.data",NOTIFICATION_STOCK_QUERY_DATA_BY_ID_RESPONSE:"ccxprocess.notification.stock.byID.data",NOTIFICATION_PSDK_QUERY_DATA_BY_TIME_RESPONSE:"ccxprocess.notification.psdk.byTime.data",NOTIFICATION_STOCK_QUERY_DATA_BY_TIME_RESPONSE:"ccxprocess.notification.stock.byTime.data",NOTIFICATION_FORCE_REFRESH_QUERY_DATA_BY_TIME_RESPONSE:"ccxprocess.notification.force-refresh.byTime.data",ANS_PSDK_NOTIFICATION_TYPE:"com.adobe.psdk.v1",ANS_PSDK_NOTIFICATION_SUB_TYPE:"operational.profile.updated",ANS_STOCK_NOTIFICATION_TYPE:"com.adobe.stock",ANS_STOCK_NOTIFICATION_SUB_TYPE:"templates.update",ANS_FORCE_REFRESH_NOTIFICATION_TYPE:"com.adobe.accc.generic.v1",ANS_FORCE_REFRESH_NOTIFICATION_SUB_TYPE:"esdk.force.refresh",ANS_NUJ_REFRESH_NOTIFICATION_TYPE:"com.adobe.dunamis",ANS_NUJ_REFRESH_NOTIFICATION_SUB_TYPE:"profile.state.change",USER_ANALYTICS_ENABLED:!1,ANALYTICS_INGEST_PATH:"/ingest",ANALYTICS_X_PRODUCT:"CCXStart/2.5",ANALYTICS_PROJECT:"ccx-process-service",ANALYTICS_INGEST_TYPE:"dunamis",ANALYTICS_API_KEY:"ccx-process-service",ANALYTICS_MAX_QUEUED_EVENTS:600,ANALYTICS_DEBOUNCE:1e4,ALLOW_NO_TOKEN:!0,ANALYTICS_HEARTBEAT_INTERVAL:9e5,DEFAULT_START_VERSION_CEP:"2.13.0.14",DEFAULT_START_VERSION_UXP:"3.6.0.50",SUPPORTED_UXP_APPS:{PHXS:"21.0",ILST:"24.0",FLPR:"20.0",SPRK:"29.0"},UNSUPPORTED_WINDOWS_UXP_APPS:["PHXS","ILST","SPRK"],EARLIEST_SUPPORTED_WINDOWS_VERSION_UXP:"6.2",SUPPORTED_LEARN_THIRD_PARTY_START_MIN_VERSION:"2.7",LEARN_DATA_SCHEMA:{id:"/LEARN_CARD_DATA",type:"object",properties:{tutorials:{type:"array",items:{type:"object",properties:{metadata:{type:"object",properties:{images:{type:"object",properties:{hero:{type:"string"},thumbnail:{type:"string"}}}}}}}}}},CARD_DATA_SCHEMA:{v2:{id:"/CARD_DATA",type:"object",properties:{cardType:{type:"string"},cardName:{type:"string"},displayTemplate:{type:"string"},backgroundImage:{type:["string","null"]},backgroundImageLocalPath:{type:["string","null"]},backgroundFillColor:{type:["string","null"]},startDTS:{type:["string","null"]},endDTS:{type:["string","null"]},overlayTintColor:{type:["string","null"]}},required:["cardType"]},openDoc:{},firstrun:{},footer:{},learn:{},discover:{},trial:{},welcome:{}},PRODUCT_PRIORITY:{PHXS:9,ILST:8,IDSN:7,PPRO:6,AEFT:5,SPRK:4,DRWV:3,FLPR:2,MUSE:1},DEFAULT:{LOOKUP_MAP_FILE_VERSION:1,URL_STAGING:"https://p13n-stage.adobe.io/psdk/v2/content",URL_PRODUCTION:"https://p13n.adobe.io/psdk/v2/content",SUPPORTED_PRODUCTS:{},LOOKUP_COLLECTION_FILE_VERSION:1,PRIORITY_CHANNEL:n.PriorityChannels.Unknown},OZ:{LOG_PREFIX:"Oz"},V1:{VERSION_LESS_THAN:"2.0",START_VERSION:"1.0",FIRST_MILE_PREFETCH_CLIENTS:{AEFT:"15.0",DRWV:"18.0",IDSN:"13.0",ILST:"22.0",MUSE:"2018.0",PHXS:"19.0",PPRO:"12.0"},FIRST_MILE_SURFACE_ID:["welcome","openDoc"],FIRST_MILE_SURFACE_MODE_MAP:{openDoc:"openDoc",welcome:"welcome"}},V2:{VERSION_LESS_THAN:"2.4",START_VERSION:"2.2.1.120",FIRST_MILE_PREFETCH_CLIENTS:{AEFT:"16.0",DRWV:"19.0",IDSN:"14.0",ILST:"23.0",MUSE:"2019.0",PHXS:"20.0",PPRO:"13.0"},FIRST_MILE_SURFACE_ID:["CCX_Start_2.0_FirstRun","CCX_Start_2.0_Footer","CCX_Start_2.0_Learn","CCX_Start_2.0_Discover","CCX_Start_2.0_Trial"],FIRST_MILE_SURFACE_MODE_MAP:{"CCX_Start_2.0_FirstRun":"firstrun","CCX_Start_2.0_Footer":"footer","CCX_Start_2.0_Learn":"learn","CCX_Start_2.0_Discover":"discover","CCX_Start_2.0_Trial":"trial"}},V2_4:{VERSION_LESS_THAN:"2.5",START_VERSION:"2.4.0.11",FIRST_MILE_SURFACE_ID:["CCX_TUTORIAL_2.5","CCX_Start_2.5_Learn","CCX_Start_2.5_Toast","CCX_Start_2.5_Home"],FIRST_MILE_SURFACE_MODE_MAP:{"CCX_TUTORIAL_2.5":"CCX_TUTORIAL_2.5","CCX_Start_2.5_Learn":"CCX_Start_2.5_Learn","CCX_Start_2.5_Home":"CCX_Start_2.5_Home","CCX_Start_2.5_Toast":"CCX_Start_2.5_Toast"},FIRST_MILE_PREFETCH_CLIENTS:{AEFT:"16.0",DRWV:"19.0",IDSN:"14.0",ILST:"23.0",MUSE:"2019.0",PHXS:"20.0",PPRO:"13.0"},HOME_SURFACE_ID:"CCX_Start_2.5_Home",LEARN_SURFACE_ID:"CCX_TUTORIAL_2.5"},V2_5:{VERSION_LESS_THAN:"2.8",START_VERSION:"2.7.2.14",FIRST_MILE_PREFETCH_CLIENTS:{AEFT:"16.99",DRWV:"99.99",IDSN:"14.99",ILST:"23.99",MUSE:"2019.99",PHXS:"20.99",PPRO:"13.99"},FIRST_MILE_SURFACE_ID:["CCX_Start_2.5_Learn","CCX_Start_2.5_Toast","CCX_Start_2.5_Home"],FIRST_MILE_SURFACE_MODE_MAP:{"CCX_TUTORIAL_2.5":"CCX_TUTORIAL_2.5","CCX_Start_2.5_Learn":"CCX_Start_2.5_Learn","CCX_Start_2.5_Home":"CCX_Start_2.5_Home","CCX_Start_2.5_Toast":"CCX_Start_2.5_Toast"},HOME_SURFACE_ID:"CCX_Start_2.5_Home",LEARN_SURFACE_ID:"CCX_TUTORIAL_2.5"},V2_8:{VERSION_LESS_THAN:"3.0",START_VERSION:"2.13.0.14",FIRST_MILE_PREFETCH_CLIENTS:{AEFT:"99.0",IDSN:"99.0",ILST:"24.0",MUSE:"2099.0",PHXS:"21.0",PPRO:"99.0"},FIRST_MILE_SURFACE_ID:["CCX_Start_3.1_Learn","CCX_Start_3.1_Toast","CCX_Start_3.1_Home","CCX_Start_3.1_Whats_New"],FIRST_MILE_SURFACE_MODE_MAP:{"CCX_Start_3.1_Tutorials":"CCX_Start_3.1_Tutorials","CCX_Start_3.1_Learn":"CCX_Start_3.1_Learn","CCX_Start_3.1_Home":"CCX_Start_3.1_Home","CCX_Start_3.1_Toast":"CCX_Start_3.1_Toast","CCX_Start_3.1_Whats_New":"CCX_Start_3.1_Whats_New"},HOME_SURFACE_ID:"CCX_Start_3.1_Home",LEARN_SURFACE_ID:"CCX_Start_3.1_Tutorials"},V3_0:{VERSION_LESS_THAN:"3.1",START_VERSION:"3.0.4",FIRST_MILE_PREFETCH_CLIENTS:{FLPR:"20.0",ILST:"24.0",PHXS:"21.0"},FIRST_MILE_SURFACE_ID:["CCX_Start_3.0_Learn","CCX_Start_3.0_Toast","CCX_Start_3.0_Home"],FIRST_MILE_SURFACE_MODE_MAP:{"CCX_Start_3.0_Tutorials":"CCX_Start_3.0_Tutorials","CCX_Start_3.0_Learn":"CCX_Start_3.0_Learn","CCX_Start_3.0_Home":"CCX_Start_3.0_Home","CCX_Start_3.0_Toast":"CCX_Start_3.0_Toast"},HOME_SURFACE_ID:"CCX_Start_3.0_Home",LEARN_SURFACE_ID:"CCX_Start_3.0_Tutorials"},V3_1:{VERSION_LESS_THAN:"99.9",START_VERSION:"3.6.0.50",FIRST_MILE_PREFETCH_CLIENTS:{FLPR:"99.0",ILST:"99.0",PHXS:"99.0",SPRK:"99.0"},FIRST_MILE_SURFACE_ID:["CCX_Start_3.1_Learn","CCX_Start_3.1_Toast","CCX_Start_3.1_Home","CCX_Start_3.1_Whats_New"],FIRST_MILE_SURFACE_MODE_MAP:{"CCX_Start_3.1_Tutorials":"CCX_Start_3.1_Tutorials","CCX_Start_3.1_Learn":"CCX_Start_3.1_Learn","CCX_Start_3.1_Home":"CCX_Start_3.1_Home","CCX_Start_3.1_Toast":"CCX_Start_3.1_Toast","CCX_Start_3.1_Whats_New":"CCX_Start_3.1_Whats_New"},HOME_SURFACE_ID:"CCX_Start_3.1_Home",LEARN_SURFACE_ID:"CCX_Start_3.1_Tutorials"},ANALYTICS:{w_CCX_PROCESS:"CCX Process",w_NOTIFICATION:"Notification",w_INTERNAL:"Internal",c_DESKTOP:"DESKTOP",SOPHIA_CARDS:"Sophia Cards",UTUTS:"Ututs",sc_CUSTOM_HOOK:"CustomHook.ts",sc_PROCESS:"Process",sc_SOPHIA:"Sophia",sc_STOCK:"Stock",sc_LEARN:"Learn",sc_CCX_START:"CCX Start",sc_CC_PHOTO:"CC Photo",sc_LR_CONTENT:"Lightroom Content",sc_CC_SEARCH:"CC Search",sc_OZ:"Oz",sc_CC_SEARCH_STORAGE:"CC Storage",sc_UTUTS:"Ututs",sc_AUTH:"Auth",sc_AVATAR:"Avatar",sc_FORCE_REFRESH:"Force Refresh",sc_CCX_FILE_DOWNLOAD:"CCX Start File Download",sc_PULSE:"Pulse",t_INSTALL:"install",t_UNINSTALL:"uninstall",t_UPDATE:"update",t_INIT:"init",t_START:"start",t_REQUEST:"request",t_RESPONSE:"response",t_SIGNOUT:"signout",t_SIGNIN:"signin",t_FETCH:"fetch",t_CLEAR:"clear",t_PERFORMANCE:"performance",t_APP:"app",st_PROCESS:"process",st_API:"api",st_ANS:"ans",st_CC_PHOTOS:"cc photos",st_NETWORK:"network",st_CLIENT:"client",st_TOKEN:"token",st_RECEIVED:"received",st_FINISHED:"finished",st_RUNNING:"running",ERROR:"error",NO_ERROR:null,PARAM_VALIDATION_ERR:"Param Validation Error",PAYLOAD_PARSE_FAIL:"Fail to parse payload",UNEXPECTED_ANS_MSG:"Received unexpected ANS message",PARSE_MSG_FAIL:"Fail to parse message",GET_NOTIFICATION_DATA:"Get Notification Data By ID",DATA_VALIDATION_ERR:"Data Validation Error",GC_ERROR:"GC Error",NETWORK_ERR:"Network Error",IO_ERR:"I/O Error",LR_PHOTO_DOWNLOAD_ERR:"Lightroom Photo Download Error",NO_DATA:"No data to save",NO_STOCK_PARAMS:"No Stock Params",MISSING_DATA:"Missing Data",SIGNED_OUT:"User Signed Out",OFFLINE_ERROR:"Offline",INVALID_JSON:"Invalid JSON"},SERVICE_REQUEST_SCHEMA:{id:"/SERVICE_REQUEST_SCHEMA",type:"object",properties:{params:{type:"object"},requestId:{type:"string"},version:{type:"integer",maximum:1,minimum:1},displayed:{type:"string"},urgent:{type:"boolean"},updateLastUseTime:{type:"boolean"},force:{type:"object",properties:{type:{type:"string",pattern:"stale|always|none"},depth:{type:"integer",minimum:0,maximum:2}}},analytics:{type:"object"},required:["version","params","requestId"]}},FORCE_REFRESH_SCHEMA:{id:"/FORCE_REFRESH_SCHEMA",type:"object",properties:{expire:{type:"object",properties:{FIRST_MILE:{type:["boolean","array"]},STOCK:{type:["boolean","array"]},LEARN:{type:["boolean","array"]},CCD:{type:["boolean","array"]}}},force:{type:"object",properties:{type:{type:"string",pattern:"stale|always|none"},depth:{type:"integer",minimum:0,maximum:2}}}}},CC_DIR:"",ROOT_DIR:"",LOG_DIR:"",DOWNLOAD_TMP_EXTENSION:"",PROGRESS_THROTTLE_INTERVAL:0,TMP_PHOTOS_DOWNLOAD_DIRECTORY:"",STOCK_API_PATH:"",STOCK_API_ROOT:"",CC_SEARCH_IDENTIFIER:"ccsearch-component-service",CC_TOUT_DOWNLOAD_IDENTIFIER:"ccxstart-download-file"}),o(this,"environments",{staging:{LABEL:"Staging",CLIENT_NAME:"CCXProcess1",CLIENT_ID:"CCXInAppWelcomeProcess2",CLIENT_SECRET:"220debb8-26c5-4ce3-9c92-cc38bf589c7d",IMS:"ims-na1-stg1.adobelogin.com"},production:{LABEL:"Production",CLIENT_NAME:"CCXProcess1",CLIENT_ID:"CCXInAppWelcomeProcess2",CLIENT_SECRET:"07a10ad7-27d4-4aec-8c8d-e4b47dffd414",IMS:"ims-na1.adobelogin.com"}}),o(this,"settings",{SETTINGS_FILE_VERSION:this.config.SETTINGS_FILE_VERSION}),o(this,"currentDiskState",void 0),o(this,"analytics",this.get("ANALYTICS")),this.init()}init(){if(this.isPlatformWindows()){const t=process.env.USERPROFILE.replace(/\\/g,"/");this.config.ROOT_DIR=`${t}/AppData/Roaming/`,this.config.LOG_DIR=`${process.env.TEMP.replace(/\\/g,"/")}/CreativeCloud/CCX Welcome/`;const e=process.env["ProgramFiles(x86)"].replace(/\\/g,"/");this.config.CC_DIR=`${e}/Adobe/Adobe Creative Cloud/`}else this.config.ROOT_DIR=`${process.env.HOME}/Library/Caches/`,this.config.LOG_DIR=`${process.env.HOME}/Library/Logs/CreativeCloud/CCX Welcome/`,this.config.CC_DIR="/Applications/Utilities/Adobe Creative Cloud/";let t=!1;this.isStagingRedirectInEffect()&&(this.config.ENVIRONMENT="staging",t=!0),this.config.ROOT_DIR+="Adobe/CCX Welcome/"+(t?"stage/":""),this.config.LOG_DIR+=t?"stage/":"",this.config.STOCK_API_ROOT=`/Rest/Media/${this.config.STOCK_API_VERSION}`,this.config.STOCK_API_PATH=`${this.config.STOCK_API_ROOT}/Search/Templates`,this.config.TMP_PHOTOS_DOWNLOAD_DIRECTORY="com.adobe.ccx.start.lrphotos/",this.config.PROGRESS_THROTTLE_INTERVAL=250,this.config.DOWNLOAD_TMP_EXTENSION=".tmp",["openDoc","firstrun","footer","learn","discover","trial","welcome"].forEach(t=>{this.config.CARD_DATA_SCHEMA[t]=this.config.CARD_DATA_SCHEMA.v2}),this.loadSettings(),process.argv.forEach(t=>{"--debug"===t&&(this.config.CONSOLE_LOGGING=!0)}),this.config.CONSOLE_LOGGING||global.test||(console.log(`Outputting logs to: ${this.config.LOG_DIR}`),console.log("To view log messages on the console, use the --debug argument"))}isPlatformWindows(){return 0===process.platform.indexOf("win")}get(t,e){return e?this.settings[e]&&void 0!==this.settings[e][t]?this.settings[e][t]:this.config[e]&&this.config[e][t]:void 0!==this.settings[t]?this.settings[t]:this.config[t]}set(t,e,a){return a?(this.settings[a]=this.settings[a]||{},this.settings[a][t]=e):this.settings[t]=e,this.saveSettings()}default(t){const e=t.LABEL.toLowerCase().replace(/^\w/,t=>t.toUpperCase());return t.ANALYTICS_SUBCATEGORY=t.ANALYTICS_SUBCATEGORY||e,t.LOG_PREFIX=t.LOG_PREFIX||e,t.DIR=t.DIR||e.toLowerCase()+"/",t.VULCAN_TYPE=t.VULCAN_TYPE||e,t}patch(t,e){this.config[t]=this.config[t]||{};const a=Object.assign({},this.config[t]);Object.assign(this.config[t],this.config.DEFAULT,a,e),this.default(this.config[t])}getEnvironment(){const t=this.get("ENVIRONMENT");return this.environments[t]||this.environments[this.config.ENVIRONMENT]}isStagingRedirectInEffect(){let t=!1;try{const e=r.readFileSync(this.config.CC_DIR+this.config.CC_SETTINGS_FILE,"utf8");new i.Parser({async:!1}).parseString(e,(e,a)=>{e||a.C3Config.config[0].namespace.forEach(e=>{e&&e.$&&e.$.name&&"accc.container"===e.$.name&&e.property.forEach(e=>{e&&e.$&&e.$.name&&"IMS_ENV"===e.$.name&&"STG"===e._&&(t=!0)})})})}catch(t){}return t}loadSettings(){try{const t="readFileSync";this.currentDiskState=r[t](this.config.ROOT_DIR+this.config.SETTINGS_FILE,"utf8");const e=JSON.parse(this.currentDiskState);this.settings.SETTINGS_FILE_VERSION===e.SETTINGS_FILE_VERSION&&(this.settings=e)}catch(t){}}saveSettings(){const t=JSON.stringify(this.settings,void 0,2);if(t===this.currentDiskState)return!1;try{const e=`${this.config.SETTINGS_FILE}.TEMP_${s.v4()}`;r.writeFileSync(this.config.ROOT_DIR+e,t),r.renameSync(this.config.ROOT_DIR+e,this.config.ROOT_DIR+this.config.SETTINGS_FILE),this.currentDiskState=t}catch(t){}return!0}};e.default=c},function(t,e,a){"use strict";a.r(e);var s=a(30),r=a(5),i=a(10),n=a(9),o=a(22),c=a(0),l=a(35),d=a(2);function u(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}const p=new class{constructor(){u(this,"memoize",(t,{resolver:e,refresher:a,wrapper:s}={})=>{const r=this,i=function(){const n=arguments,o=e?e.apply(this,n):n[0];if(i.cache.has(o)){const t=i.cache.get(o);if(!a||!a(t))return s?s(n,t,!0):t}const c=t.apply(this,n);return c instanceof Promise&&r.enablePromiseStateAccess(c),i.cache.set(o,c),s?s(n,c,!1):c};return i.cache=new Map,i}),u(this,"throttle",(t,e=250)=>{let a,s;return function(){const r=this,i=(new Date).getTime(),n=arguments;a&&i<a+e?(clearTimeout(s),s=setTimeout(()=>{a=i,t.apply(r,n)},e)):(a=i,t.apply(r,n))}}),u(this,"setTimeoutAsync",t=>new Promise(e=>setTimeout(e,t)))}getTimeToExpiry(t){if(!t)return 0;const e=(new Date).valueOf(),a=new Date(t).valueOf()-e;return isNaN(a)?0:Math.max(0,a)}enablePromiseStateAccess(t){t.state="pending",t.then(e=>{t.state="resolved",t.value=e},e=>{t.state="rejected",t.value=e})}isDateExpired(t){return 0===this.getTimeToExpiry(t)}getRandomizedTime(){const t=c.default.get("MIN_RANDOMIZED_TIME"),e=c.default.get("MAX_RANDOMIZED_TIME");return Math.floor(Math.random()*(e-t))+t}validateDataFields(t,e,a=null){const s=new l.Validator;a&&a.forEach(t=>{s.addSchema(t,t.id)});const r=s.validate(t,e);return 0===r.errors.length?null:r.errors}async parseXml(t){return await new Promise(async(e,a)=>{o.parseString(t,(t,s)=>{t?a(t):e(s)})})}getProductAlias(t){const e=c.default.get("PRODUCT_ALIASES");return e&&e[t]||t}getProcessVersion(){return`${s.version}-1`}isWindows(){return"win32"===process.platform}getOsVersion(){return n.release()}ccxVersionToString(t={ccxVersion:""}){return t.ccxVersion?c.default.get("ACTIVE_VERSIONS").find(e=>{const a=c.default.get("VERSION_LESS_THAN",e);return-1===this.compareMajorMinorVersions(a,t.ccxVersion)}):"V1"}retryLocalErrors(t,e=3){return async function(a){let s=0,r=null,i=null;do{r=null,i=await t(a).catch(t=>{if("ECONNRESET"!==t.code&&"ETIMEDOUT"!==t.code&&"NODE_FETCH_HUNG"!==t.code)throw t;r=t,this.log.disk(`Retry-able error present. Retrying ${s+1}. Underlying error ${t}`)})}while(++s<e&&r);if(r)throw new d.default("LOCAL_NETWORK_ERROR_RETRY_FAILED",r);return i}}sanitizeLocale(t="",e=c.default.get("SUPPORTED_LOCALES")){if(e.includes(t))return t;const a=t.slice(0,2);return e.find(t=>t.slice(0,2)===a)||"en_US"}compareMajorMinorVersions(t,e){if(!t)return 1;if(!e)return-1;let a,s,r,i;try{a=parseInt(t.split(".")[0],10),r=parseInt(t.split(".")[1]||"0",10)}catch(t){return 1}try{s=parseInt(e.split(".")[0],10),i=parseInt(e.split(".")[1]||"0",10)}catch(t){return-1}return a===s&&r===i?0:a<s||a===s&&r<i?1:-1}getClientsThatNeedRefresh(t){const e={};c.default.get("ACTIVE_VERSIONS").forEach(t=>{e[t]={}});const a=t.getCachedRequestData();Object.keys(a).forEach(t=>{Object.keys(a[t]).forEach(s=>{a[t][s].forEach(a=>{const r=this.ccxVersionToString(a),i=c.default.get("FIRST_MILE_PREFETCH_CLIENTS",r)[t];if(!i)return;if(-1!==this.compareMajorMinorVersions(i,s))return;const n=[t,s,a.subscriptionStatus,a.productLanguage,a.countryCode].join("-");e[r][n]||(e[r][n]=a)})})});const s={};return Object.keys(e).map(t=>{s[t]=Object.values(e[t])}),s}hasBeenUsedRecently(t){if(!t)return!1;const e=new Date(t);return!isNaN(e)&&(e.setMilliseconds(c.default.get("STOP_SYNCING_BEYOND")),e>new Date)}async deleteTempFiles(t,e){const a=new Date;void 0===e&&(e=864e5);const s=await r.readdir(t);await p.waitAll(s.map(async s=>{const n=i.join(t,s),o=await r.stat(n);if(!(Number(a)-Number(o.mtime)<e))return await r.unlink(n),`Deleted ${n}`}).map(t=>t.catch(t=>`Error deleting temp file: ${t}`)))}scrubStack(t){return t?(t=t.toString()).replace(/[A-Z]?\:?(\\|\/).*\1/g,"<redacted>").trim():t}async waitAll(t){let e=null;const a=await Promise.all(t.map(t=>t.catch(t=>e=e||t)));if(e)throw e;return a}};e.default=p},function(t,e,a){"use strict";a.r(e),a.d(e,"default",function(){return n});var s=a(1),r=a(9);function i(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}class n extends Error{constructor(t,e,a){super(t||"Unknown"),i(this,"underlyingError",void 0),i(this,"error_code",void 0),i(this,"silent",!1),i(this,"context",""),i(this,"headers",void 0),i(this,"payload",{}),e&&(e instanceof n?(this.silent=e.isSilent,this.underlyingError=e,Object.assign(this.payload,e.ingestPayload)):this.underlyingError=e),this.error_code=a||this.underlyingError&&"string"!=typeof this.underlyingError&&this.underlyingError.code||"Unknown"}get code(){return this.error_code}get short(){return this.message+(this.context||"")}get description(){let t=this.context+r.EOL;return this.stack&&(t+=s.default.scrubStack(this.stack)+r.EOL),this.underlyingError&&(t+=" VIA ",this.underlyingError instanceof n?t+=this.underlyingError.message+" "+this.underlyingError.code+r.EOL+this.underlyingError.description+r.EOL:this.underlyingError instanceof Error?t+=this.underlyingError.message+this.underlyingError.code+(this.underlyingError.stack?r.EOL+s.default.scrubStack(this.underlyingError.stack):"")+r.EOL:t+=this.underlyingError),t}get responseHeaders(){return this.headers}get ingestPayload(){return this.payload}setPayload(t){return Object.assign(this.payload,t),this}setResponseHeaders(t){return this.headers=t,this}setContext(t){return this.context+=t,this}toString(){return this.message+this.description}toJSON(){return{desc:this.context,message:this.message,code:this.code}}toSnapshot(){const t=`${this.message}(${this.code}) `;return this.underlyingError instanceof n?t+this.underlyingError.toSnapshot():this.underlyingError instanceof Error?t+this.underlyingError.message+this.underlyingError.code:t+this.underlyingError}silence(){return this.silent=!0,this}get isSilent(){return this.silent}}},function(t,e,a){"use strict";a.r(e),a.d(e,"BackOffType",function(){return o});var s,r=a(14),i=a(0);function n(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}let o;!function(t){t.SYNC="SYNC"}(s||(s={})),function(t){t.AUTH="BackoffAuthentication",t.NETWORK="BackOffNetwork"}(o||(o={}));const c=new class extends r.EventEmitter{constructor(...t){super(...t),n(this,"SYNC",s.SYNC),n(this,"_syncRetryTimeout",null)}isWaitingForBackOff(t){const e=i.default.get("BACK_OFF_EXPIRY",t);return!!(e&&new Date(e)>new Date)}backOffCause(t){return i.default.get("BACK_OFF_CAUSE",t)}backOffWaitTime(t){return i.default.get("BACK_OFF",t)}backOffExpiry(t){return i.default.get("BACK_OFF_EXPIRY",t)}updateBackOff(t={clear:!1,sync:!0,cause:"Unknown",type:o.NETWORK}){const{clear:e=!1,cause:a="Unknown",type:s,sync:r=!0}=t;let n=this.backOffWaitTime(s);if(e)return n&&(i.default.set("BACK_OFF_EXPIRY",void 0,s),i.default.set("BACK_OFF",void 0,s),i.default.set("BACK_OFF_CAUSE",void 0,s)),clearTimeout(this._syncRetryTimeout),void(r&&this.emit(this.SYNC));if(!this.isWaitingForBackOff(s)){n?n*=2:n=i.default.get("SYNC_INITIAL_RETRY"),n=Math.min(n,i.default.get("MAX_BACK_OFF")),i.default.set("BACK_OFF",n,s);const t=new Date;t.setMilliseconds(t.getMilliseconds()+n),i.default.set("BACK_OFF_EXPIRY",t.toISOString(),s),i.default.set("BACK_OFF_CAUSE",`${a} for ${n/1e3}s expiring ${t.toISOString()}`,s),clearTimeout(this._syncRetryTimeout),this._syncRetryTimeout=setTimeout(()=>{this.emit(this.SYNC)},this.backOffWaitTime(s))}}};e.default=c},function(t,e,a){"use strict";a.r(e);var s=a(0),r=a(11),i=a(1),n=a(3),o=a(14),c=a(12),l=a(2),d=a(9),u=a(31);function p(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}const _=a(30),h=1e4,f=s.default.getEnvironment(),g=315;e.default=new class extends o.EventEmitter{constructor(){super(),p(this,"log",void 0),p(this,"init",i.default.memoize(()=>new Promise((t,e)=>{const a=setTimeout(()=>{this.log.error(new l.default("NGL initialization timed out")),t()},s.default.get("NGL_INITIALIZE_TIMEOUT")),{userProfile:r}=u.InitializeProfileUpdates(this.nglConfig,(e,r)=>{e&&this.log.error(new l.default("Error from NGL Library"+e));const i=this.getUserId();this.setUserProfile(r);const o=this.getUserId();this.isInitialized?i&&!o?(this.log.disk("Received Sign out event."),this.log.context({authenticationDisabled:!1}).info(s.default.analytics.t_SIGNOUT),c.default.flush(!0,()=>{this.log.disk("Flushed logs due to user sign out event"),this.reset(),this.emit("SIGN_OUT")})):o!=i&&(n.default.updateBackOff({clear:!0,type:n.BackOffType.AUTH}),this.log.context({authenticationDisabled:!1}).info(s.default.analytics.t_SIGNIN),this.emit("SIGN_IN")):(this.isInitialized=!0,clearTimeout(a),t())});this.setUserProfile(r)}))),p(this,"isInitialized",!1),p(this,"userProfile",void 0),p(this,"getDeviceID",i.default.memoize(()=>Object.values(d.networkInterfaces()).map(t=>t[0].mac).find(t=>"00:00:00:00:00:00"!=t))),p(this,"getAccessTokenExpiry",i.default.memoize(t=>{try{const e=JSON.parse(Buffer.from(t.split(".")[1],"base64").toString("utf-8"));return new Date(parseInt(e.created_at)+parseInt(e.expires_in)-h)}catch(e){return t&&this.log.error(e,"Failed parsing access token"),-1}})),p(this,"getAccessToken",i.default.memoize(()=>new Promise(async(t,e)=>{await this.init();const a=this.getUserId();a?n.default.isWaitingForBackOff(n.BackOffType.AUTH)?e(new l.default(`Access Token awaiting global back-off ${n.default.backOffCause(n.BackOffType.AUTH)}`).silence()):(this.log.disk("Started NGL.GetImsAccessToken."),u.GetImsAccessToken(this.nglConfig,(r,i)=>{if(this.log.disk("Finished NGL.GetImsAccessToken."),this.getUserId()!=a)return void e(new l.default("User changed").silence());if(r===g){const t=new Error("Services not provisioned");return this.log.error(t),n.default.updateBackOff({cause:t.message,type:n.BackOffType.AUTH}),e(t)}if(r){this.log.error(new l.default("Error from NGL "+r.toString()));const t=`Error from NGL - ${r}`;return n.default.updateBackOff({cause:t,type:n.BackOffType.AUTH}),e(new Error(t))}let o={};try{o=JSON.parse(i)}catch(t){const a=new l.default("Cannot parse NGL access token response"+t);return this.log.error(a),n.default.updateBackOff({cause:a.message,type:n.BackOffType.AUTH}),e(a)}if(!o.access_token)return this.log.error(new l.default("No Access Token")),n.default.updateBackOff({cause:"No access token",type:n.BackOffType.AUTH}),e(new l.default("No access token"));this.log.context({authenticationDisabled:!1}).info(s.default.analytics.t_FETCH,"Successfully obtained access token"),n.default.updateBackOff({clear:!0,type:n.BackOffType.AUTH}),t(o.access_token)})):e(new l.default("Not Logged in").silence())}),{refresher:this.checkAccessTokenNeedsRefresh.bind(this)})),this.log=new r.default({prefix:"IMS > ",payload:{"event.subcategory":s.default.analytics.sc_AUTH,"event.subtype":s.default.analytics.st_TOKEN},authenticationDisabled:!0})}get nglConfig(){const[t,e]=_.version.split(".");return{clientName:f.CLIENT_NAME,clientId:f.CLIENT_ID,clientSecret:f.CLIENT_SECRET,clientScope:s.default.get("SCOPES"),clientVersion:`${t}.${e}`,clientLocale:"en_US",isStage:"Staging"===f.LABEL}}setUserProfile(t){try{const s=this.getUserId();var e,a;this.userProfile=JSON.parse(t),s!==this.getUserId()&&this.log.disk(`Default User: ${null===(e=this.getUserInfo())||void 0===e?void 0:e.email} (${null===(a=this.getUserInfo())||void 0===a?void 0:a.userId})`)}catch(e){this.log.error(new l.default("Unable to parse user profile from NGL"+t))}}checkAccessTokenNeedsRefresh(t){const e=t.state,a=t.value;return"pending"!==e&&("resolved"!==e||!a||this.getAccessTokenExpiry(a)<new Date)}getUserInfo(){var t;return null===(t=this.userProfile)||void 0===t?void 0:t.UserProfile}getUserId(){var t;return null===(t=this.getUserInfo())||void 0===t?void 0:t.userId}reset(){this.log.info(s.default.analytics.t_CLEAR),this.getAccessToken.cache&&this.getAccessToken.cache.clear()}}},function(t,e){t.exports=require("fs-extra")},function(t,e,a){"use strict";function s(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}let r,i;a.r(e),a.d(e,"PriorityChannels",function(){return r}),a.d(e,"PriorityLevels",function(){return i}),a.d(e,"Priority",function(){return n}),a.d(e,"default",function(){return c}),function(t){t[t.Unknown=0]="Unknown",t[t.Deprecated=1]="Deprecated",t[t.Stock=2]="Stock",t[t.CcdTertiary=3]="CcdTertiary",t[t.FirstMileOld=4]="FirstMileOld",t[t.CcdSecondary=5]="CcdSecondary",t[t.Learn=6]="Learn",t[t.CcdPrimary=7]="CcdPrimary",t[t.FirstMileLatest=8]="FirstMileLatest"}(r||(r={})),function(t){t[t.Regular=0]="Regular",t[t.BackgroundRequest=1]="BackgroundRequest",t[t.Installation=2]="Installation",t[t.UrgentRequest=3]="UrgentRequest"}(i||(i={}));class n{constructor({key:t="",value:e=0,channel:a=r.Unknown,level:n=i.Regular}={}){s(this,"key",void 0),s(this,"value",void 0),s(this,"channel",void 0),s(this,"level",void 0),this.key=t,this.value=e,this.channel=a,this.level=n}toString(){return 1e3*this.queue+this.value}get queue(){return this.channel+100*this.level}}const o=r.Unknown+100*i.Regular;class c{constructor(t=1,e=6e5){this.maxLocks=t,this.defaultTimeout=e,s(this,"hasWriteLock",!1),s(this,"readsInProgress",[]),s(this,"pendingReads",[]),s(this,"pendingWrites",[]),s(this,"priorityOverrides",{}),s(this,"prioritize",t=>{let{key:e}=t;e&&(this.priorityOverrides[e]=t,setTimeout(()=>{e&&delete this.priorityOverrides[e]},1e4),this.pendingReads.forEach(a=>{a.priority.key===e&&this.applyOverride(t,a.priority)}),this.check())})}async call(t){const e=setTimeout(()=>{t.reject(new Error("Lock Timed out"))},t.timeout);await t.callback().then(a=>{t.resolve(a),clearTimeout(e)}).catch(a=>{t.reject(a),clearTimeout(e)})}async checkReads(){const t=[];if(!this.hasWriteLock&&this.pendingReads.length>0){let e;for(;e=this.nextReadLock();){const a=e,s=this.call(a).then(()=>{this.readsInProgress.splice(this.readsInProgress.indexOf(a),1),this.check()});t.push(s)}}return await Promise.all(t),t.length}nextReadLock(){if(0===this.pendingReads.length)return;const t=this.readsInProgress.length>0&&this.readsInProgress.reduce((t,e)=>t.priority.queue>e.priority.queue?t:e),e=t?t.priority.queue:o,a=this.pendingReads.reduce((t,e)=>t.priority.queue>e.priority.queue?t:e).priority.queue;if(a<e)return;if(a===e){if(this.readsInProgress.filter(t=>t.priority.queue===e).length>=this.maxLocks)return}const s=this.pendingReads.filter(t=>t.priority.queue===a);if(0===s.length)return;const r=s.reduce((t,e)=>e.priority.value>t.priority.value?e:t);return this.pendingReads.splice(this.pendingReads.indexOf(r),1),this.readsInProgress.push(r),r}async check(){for(;0!==await this.checkReads(););if(0===this.readsInProgress.length&&!this.hasWriteLock){const t=this.pendingWrites.shift();t&&(this.hasWriteLock=!0,await this.call(t),this.hasWriteLock=!1,this.check())}}async read(t,e=new n({}),a=this.defaultTimeout){return e.channel=e.channel||r.Unknown,e.level=e.level||i.Regular,e.value=e.value||0,e.key&&this.priorityOverrides[e.key]&&this.applyOverride(this.priorityOverrides[e.key],e),new Promise((s,r)=>{this.pendingReads.push({callback:t,resolve:s,reject:r,priority:e,timeout:a}),this.check()})}async write(t,e=this.defaultTimeout){return new Promise((a,s)=>{this.pendingWrites.push({callback:t,resolve:a,reject:s,timeout:e}),this.check()})}applyOverride(t,e){e.level=Math.max(e.level,t.level)}}},function(t,e){t.exports=require("ref-napi")},function(t,e){t.exports=require("uuid")},function(t,e){t.exports=require("os")},function(t,e){t.exports=require("path")},function(t,e,a){"use strict";a.r(e),a.d(e,"LogBuilder",function(){return p}),a.d(e,"default",function(){return _});var s=a(23),r=a(8),i=a(0),n=a(24),o=a(2);function c(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,s)}return a}function l(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?c(Object(a),!0).forEach(function(e){d(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):c(Object(a)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}function d(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}let u;class p{constructor(t={},e,...a){d(this,"options",void 0),d(this,"level",void 0),d(this,"args",void 0),d(this,"logArgs",[]),d(this,"error",void 0),d(this,"params",void 0),d(this,"payload",void 0),d(this,"surfaceAnalytics",void 0),this.options=t,this.level=e,this.args=a,this.logArgs=[],this.payload=Object.assign({},this.options.payload),this.options.params&&this.setParams(this.options.params),this.options.surfaceAnalytics&&this.addSurfaceAnalytics(this.options.surfaceAnalytics)}stringifyWithCycles(t){return"string"==typeof t?t:(t instanceof Error&&t.stack&&(t.stack=t.stack.replace(/[A-Z]?:?(\\|\/).*\1/g," ")),s.inspect(t))}convertArgsToString(...t){return t.map(this.stringifyWithCycles).join(" ")}post(){return this.error&&this.error instanceof o.default&&this.error.isSilent?this:(this.options.skipDiskLog||n.default.log(this.options.prefix+`[${this.level.toUpperCase()}] `+this.convertArgsToString(...this.args,...this.logArgs)),(this.options.forceSilentError||!1!==this.options.analytics)&&u.logProcessEvent(this.payload,this.params,this.surfaceAnalytics,this.error,this.options.authenticationDisabled),this)}addSurfaceAnalytics(t){this.surfaceAnalytics=this.surfaceAnalytics||[],this.surfaceAnalytics.push(...t)}addDiskLog(...t){return this.args=this.args.concat(...t),this}appendPayload(t={}){return Object.assign(this.payload,t),this}setError(t=new o.default("No error object passed")){return t instanceof Error||(t=new o.default(""+t)),this.appendPayload({"event.type":i.default.analytics.ERROR}),t instanceof o.default&&this.appendPayload(t.ingestPayload),this.args.push(t),this.error=t,this}setParams(t={}){return t.productCode&&this.logArgs.push(` for product ${t.productCode}[${t.productVersion}]`),this.params=t,this}}class _{static init(){u=a(12).default}constructor(t){d(this,"options",{}),this.options=t}context(t){return new _(l({},this.options,{},t,{payload:l({},t.payload,{},this.options.payload),surfaceAnalytics:[...this.options.surfaceAnalytics||[],...t.surfaceAnalytics||[]]}))}disk(...t){return new p(l({analytics:!1},this.options),"DISK",...t).post()}error(t,...e){return new p(this.options,"error",...e).setError(t).post()}info(t,...e){return new p(this.options,"info",t,...e).appendPayload({"event.type":t}).post()}async time(t){const e=Date.now(),a=new p(l({},this.options,{skipDiskLog:!0}),"Perf"),s=await t(a);return a.appendPayload({"event.dts_start":new Date(e).toISOString(),"event.dts_end":(new Date).toISOString(),"event.type":i.default.analytics.t_PERFORMANCE,"event.value":a.payload&&a.payload["event.value"]||Date.now()-e}).post(),s}async request(t){const e=this.options.payload&&this.options.payload["event.context_guid"]||r.v4(),a=Date.now();new p(this.options,"INFO").appendPayload({"event.type":i.default.analytics.t_REQUEST,"event.context_guid":e}).addDiskLog("Request Received").post();const s=new p(l({},this.options,{forceSilentError:!0}),"INFO");return await t(s).then(t=>(s.appendPayload({"event.type":i.default.analytics.t_RESPONSE,"event.context_guid":e,"event.value":Date.now()-a}).addDiskLog(`Response sent in ${Date.now()-a}ms`).post(),t)).catch(t=>{throw s.appendPayload({"event.context_guid":e}).setError(t).post(),t})}console(...t){console.log(...t)}}d(_,"Builder",void 0),_.Builder=p},function(t,e,a){"use strict";a.r(e);var s=a(8),r=a(9),i=a(0),n=a(24),o=a(13),c=a(21),l=a(1),d=a(4),u=a(19),p=a(2);function _(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}let h=!1;const f=a(47),g={ENVIRONMENT:"Staging"===i.default.getEnvironment().LABEL?"stage":"prod",ANALYTICS_API_KEY:i.default.get("ANALYTICS_API_KEY"),ANALYTICS_X_PRODUCT:i.default.get("ANALYTICS_X_PRODUCT"),ANALYTICS_PROJECT:i.default.get("ANALYTICS_PROJECT"),ANALYTICS_INGEST_TYPE:i.default.get("ANALYTICS_INGEST_TYPE"),ANALYTICS_MAX_QUEUED_EVENTS:i.default.get("ANALYTICS_MAX_QUEUED_EVENTS"),ANALYTICS_DEBOUNCE:i.default.get("ANALYTICS_DEBOUNCE"),ALLOW_NO_TOKEN:i.default.get("ALLOW_NO_TOKEN")};class E{constructor(){_(this,"getAccessToken",t=>{if(h)return t();d.default.getAccessToken().then(e=>t(null,e)).catch(e=>t(null,e))}),_(this,"log",t=>{n.default.log(t)}),_(this,"getAgent",(t,e)=>{const a=c.a.stripPathFromURL(t);u.getNodeTunnelOptionsForURL(a).then(t=>{delete t.agent,e(null,t)},t=>{e(t)})})}}let T=f.createInstance(new E,g),y=f.createInstance(new E,g);e.default=Object.assign(new class{constructor(){_(this,"NO_PARAMS",null),_(this,"session_guid",s.v4()),_(this,"_status",!1),_(this,"checkIMS",(t,e)=>(e["user.service_code"]="creative_cloud",e)),_(this,"getIpAddress",l.default.memoize(()=>{var t=r.networkInterfaces();const e=Object.keys(t).map(e=>t[e].filter(t=>"IPv4"===t.family&&!t.internal)[0]).filter(t=>t);return e.length>0?e[0].address:""})),_(this,"cleanPSDKParameters",(t,e)=>(e&&(t["event.language"]=e.productLanguage,t["source.client_id"]=i.default.getEnvironment().CLIENT_ID,t["source.name"]=e.productCode,t["source.version"]=e.productVersion,t["source.platform"]=r.platform(),t["source.device"]="Desktop",t["source.os_version"]=r.release(),t["consumer.name"]="CCX Start",t["consumer.platform"]=r.platform(),t["consumer.os_version"]=r.release(),t["consumer.version"]=e.ccxVersion),t)),_(this,"createPayload",(t,e,a,r=!1)=>{if(!r){const e=d.default.getUserId();t["event.user_guid"]=e,t=this.checkIMS(e||"",t)}return t["event.guid"]=s.v4(),t["event.session_guid"]=this.session_guid,t["event.coll_dts"]=(new Date).toISOString(),t["event.dts_start"]=t["event.dts_start"]||(new Date).toISOString(),t["event.dts_end"]=t["event.dts_end"]||(new Date).toISOString(),t["event.workflow"]=t["event.workflow"]||i.default.analytics.w_CCX_PROCESS,t["event.category"]=i.default.analytics.c_DESKTOP,t["event.offline"]=o.default.status===o.default.OFFLINE,t["event.ip"]=this.getIpAddress(),t["event.language"]=t["event.language"]||u.getOSLocale(),t["event.device_guid"]=d.default.getDeviceID(),t["env.com.name"]=i.default.analytics.w_CCX_PROCESS,t["env.com.version"]=l.default.getProcessVersion(),e&&(t=this.cleanPSDKParameters(t,e)),a&&this.addSurfaceAnalytics(t,a),t}),_(this,"reset",t=>(t&&(T=f.createInstance(new E,t)),T)),_(this,"resetOperational",t=>(t&&(y=f.createInstance(new E,t)),y)),_(this,"logProcessEvent",(t,e,a,s,r,i)=>{t=this.createPayload(t,e,a,r),s&&(s instanceof p.default||(s=new p.default(s)),t["event.error_desc"]=this.limitMessageSize(s.description),t["event.error_type"]=s.message,t["event.error_code"]=s.code),r?(h=!0,this.postEvent(t,i),this.flush(!0,()=>{h=!1})):this.postEvent(t,i)}),_(this,"logPollingEvent",(t,e,a)=>{t=this.createPayload(t),e?(h=!0,this.operationalPostEvent(t,a),this.operationalFlush(!0,()=>{h=!1})):this.operationalPostEvent(t,a)}),_(this,"operationalPostEvent",(t,e=(()=>{}))=>{y.postEvent(t,e)}),_(this,"operationalFlush",(t,e=(()=>{}))=>{y.flush(t,e)}),_(this,"flush",(t,e=(()=>{}))=>{T.flush(t,e)}),_(this,"postEvent",(t,e=(()=>{}))=>{T.postEvent(t,e)}),_(this,"enable",t=>{this._status=t,T.enable(t),y.enable(!0)}),_(this,"limitMessageSize",t=>t.substring(0,1024)),o.default.on(o.default.ONLINE,()=>{this.getIpAddress.cache.clear()})}addSurfaceAnalytics(t,e){const a=(e,a)=>{a&&(t[e]=t[e]||"",t[e].toString().includes(a)||(t[e]+=(t[e].toString().length>0?", ":"")+a))};if(e)for(const t of e)t.surface&&a("exp.surface_id",t.surface),t.campaignId&&a("exp.campaign_id",""+t.campaignId),t.variationId&&a("exp.variation_id",t.variationId),t.treatmentId&&a("exp.treatment_id",t.treatmentId),t.controlGroupId&&a("exp.control_group_id",t.controlGroupId),t.actionBlockId&&a("exp.action_block_id",t.actionBlockId);return t}},i.default.analytics)},function(t,e,a){"use strict";a.r(e);var s=a(14),r=a(36),i=a(0),n=a(11),o=a(15);function c(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}const l=a(1).default,d=a(3).default,u=a(3).BackOffType;var p;!function(t){t.ONLINE="ONLINE",t.OFFLINE="OFFLINE"}(p||(p={}));const _=new class extends s.EventEmitter{constructor(){super(),c(this,"ONLINE",p.ONLINE),c(this,"OFFLINE",p.OFFLINE),c(this,"status",p.ONLINE),c(this,"lastKnownError",void 0),c(this,"log",void 0),c(this,"check",l.memoize(this.checkInternal,{refresher:t=>"pending"!==t.state})),this.on(this.OFFLINE,()=>{d.updateBackOff({type:u.NETWORK,cause:"Offline[DNS]"}),setTimeout(this.check.bind(this),i.default.get("NETWORK_STATUS_INTERVAL"))}),this.log=new n.default({prefix:"NetworkStatus >",payload:{"event.subcategory":i.default.analytics.sc_PROCESS,"event.subtype":i.default.analytics.st_PROCESS}})}async checkInternal(){return new Promise(async t=>{const e=i.default.getEnvironment(),a=new o.URL(i.default.get(`URL_${e.LABEL.toUpperCase()}`,"FIRST_MILE")).host;r.resolve(a,e=>{e?(this.lastKnownError&&this.lastKnownError.code===e.code||(this.log.error(e,"Network Error"),this.lastKnownError=e),this.status=this.OFFLINE):this.status=this.ONLINE,this.emit(this.status),t()})})}};e.default=_},function(t,e){t.exports=require("events")},function(t,e){t.exports=require("url")},function(t,e,a){"use strict";a.r(e),a.d(e,"default",function(){return _});var s=a(5),r=a(10),i=a(37),n=a(8),o=a(0),c=a(23),l=a(9),d=a(2);const u=a(1).default,p=c.promisify(i.flock);class _{static async writeJsonAtomic(t,e,a){const r=t+e,i=`${r}_${n.v4()}.json`;await s.ensureDir(t),await s.writeJson(i,a,{spaces:2,EOL:l.EOL}),await _.rename(i,r)}static async rename(t,e){let a=Date.now(),r=0;await s.rename(t,e).catch(async function i(n){if(r<100&&(r+=10),!n||"EACCES"!==n.code&&"EPERM"!==n.code&&"ENOENT"!==n.code||!(Date.now()-a<6e4))throw n;if(await u.setTimeoutAsync(r),await s.pathExists(e))throw n;await s.rename(t,e).catch(i)})}static async writeAtomic({stream:t,target:e,progress:a=(()=>{}),url:i="unknown"}){const n=e+o.default.get("DOWNLOAD_TMP_EXTENSION"),c=u.throttle(a,o.default.get("PROGRESS_THROTTLE_INTERVAL"));await s.ensureDir(r.dirname(e)),await s.remove(n);const l=s.createWriteStream(n);return await new Promise((e,a)=>{const s=new d.default("NODE_FETCH_ERROR",`Timed out with node-fetch for URL ${i}`,"NODE_FETCH_HUNG").setPayload({"event.url":i});let r=setTimeout(()=>{a(s)},o.default.get("NODE_FETCH_TIMEOUT")),n=0;t.pipe(l),t.on("data",t=>{clearTimeout(r),r=setTimeout(()=>{a(s)},o.default.get("NODE_FETCH_TIMEOUT")),c(n+=t.length)}),t.on("error",a),t.on("close",e),l.on("close",e),l.on("error",a),l.on("finish",e)}),await _.rename(n,e),e}static async cleanupFolder(t,e={},a=/^$/){await s.ensureDir(t);const r=await s.readdir(t),i=[],n=[],o=[];return r.forEach(async r=>{e[r]||a.test(r)?i.push(r):(n.push(r),o.push(s.remove(t+r)))}),await u.waitAll(o),{left:i,removed:n}}static async obtainProcessLock(t){const e=o.default.get("ROOT_DIR");await s.ensureDir(e);const a=`${e}.${t}`,r=await s.open(a,"w");await p(r,"exnb")}}},function(t,e,a){"use strict";a.r(e),a.d(e,"default",function(){return E});var s=a(8),r=a(0),i=a(11),n=a(6),o=a(19),c=a(4),l=a(13),d=a(29),u=a.n(d),p=a(15),_=a(2),h=a(3),f=a(1);function g(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}class E{constructor(t){g(this,"type",void 0),g(this,"_requestLock",void 0),g(this,"prioritize",void 0),g(this,"log",void 0),g(this,"downloadCollectionData",void 0),this.type=t,E.requestLock=E.requestLock||new n.default(r.default.get("NUM_CONCURRENT_REQUESTS")),this._requestLock=E.requestLock,this.prioritize=this._requestLock.prioritize,this.log=new i.default({prefix:`${r.default.get("LOG_PREFIX",t)}DownloadManager > `,payload:{"event.subtype":r.default.analytics.st_API}}),this.downloadCollectionData=f.default.retryLocalErrors(this.downloadCollectionDataRaw.bind(this))}async url(t){const e=r.default.getEnvironment(),a=new p.URL(r.default.get(`URL_${e.LABEL.toUpperCase()}`,this.type));return this.appendUrlSearchParams(a.searchParams,t),a.toString()}additionalAnalytics(t){return{}}applyResponseAnalytics(t,e,a){}async downloadCollectionDataRaw(t){}async get(t={url:""}){let{url:e,options:a={},auth:i=!1,id:n=s.v4(),priority:d}=t;if(h.default.isWaitingForBackOff(h.BackOffType.NETWORK))throw new Error(`Waiting for global back-off ${h.default.backOffCause(h.BackOffType.NETWORK)}`);if(l.default.status===l.default.OFFLINE)throw new Error(`Cannot get ${e} - Offline`);return a.headers=a.headers||{},a.timeout=a.timeout||r.default.get("REQUEST_TIMEOUT"),a.headers["X-Request-Id"]=n,await this._requestLock.read(async()=>{this.log.disk(`[${n}] Requesting ${i?"with Auth Headers":"without Auth Headers"} ${e} - Priority(${d&&d.toString()||0})`);const t=Date.now(),s=new p.URL(e).origin;if(i){if(h.default.isWaitingForBackOff(h.BackOffType.AUTH))throw new Error(`Waiting for global back-off ${h.default.backOffCause(h.BackOffType.AUTH)}`);const t=await c.default.getAccessToken();a.headers.Authorization=`Bearer ${t}`}a.headers.Connection="keep-alive",a.agent=(await o.getNodeTunnelOptionsForURL(s)).agent;const f=await u()(e,a).catch(t=>{if("system"===t.type&&("ENOTFOUND"===t.code||"EADDRNOTAVAIL"===t.code))throw l.default.check(),h.default.updateBackOff({cause:"Offline[Network]",type:h.BackOffType.NETWORK}),new _.default(r.default.analytics.OFFLINE_ERROR).setPayload({"event.url":e});throw"system"===t.type&&"PROXY"===t.code&&h.default.updateBackOff({cause:t.message,type:h.BackOffType.NETWORK}),t});if(!f.ok&&304!==f.status){429===f.status&&h.default.updateBackOff({cause:`Server Error[${f.status}]`,type:h.BackOffType.NETWORK}),401===f.status&&h.default.updateBackOff({cause:`Server Error[${f.status}]`,type:h.BackOffType.AUTH});const t=await f.text(),a=new _.default(r.default.analytics.st_NETWORK,`Failed to get ${e} with status code ${f.status} - ${t}`,f.status).setPayload({"event.url":e});throw a.setResponseHeaders(f.headers),a}h.default.updateBackOff({clear:!0,type:h.BackOffType.NETWORK});const g=Date.now()-t;return this.log.disk(`[${n}] Finished ${g}ms`),{response:f,time:g}},d).catch(t=>{throw this.log.disk(`[${n}] Failed - ${t}`),t})}async getResponseJson(t,e){return await Promise.race([t.json().catch(t=>{throw new _.default(r.default.analytics.INVALID_JSON,t).setPayload({"event.url":e})}),new Promise((a,s)=>{const i=new _.default("NODE_FETCH_ERROR",`Timed out with node-fetch for url ${e}`).setPayload({"event.url":e});let n=setTimeout(()=>{s(i)},r.default.get("NODE_FETCH_TIMEOUT"));t.body.on("data",()=>{clearTimeout(n),n=setTimeout(()=>{s(i)},r.default.get("NODE_FETCH_TIMEOUT"))})})])}appendUrlSearchParams(t,e={}){const a=e;for(const e in a)Array.isArray(a[e])?a[e].forEach(a=>{t.append(e,a||"")}):t.append(e,a[e]||"")}}g(E,"requestLock",void 0)},function(t,e,a){"use strict";a.d(e,"a",function(){return p});var s=a(16),r=a(5),i=a(12),n=a(2),o=a(11),c=a(0),l=a(10);function d(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,s)}return a}function u(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}class p{constructor(t,e){u(this,"_id",void 0),u(this,"_lookupMap",void 0),u(this,"_diskLock",void 0),u(this,"log",void 0),u(this,"_fileName",void 0),u(this,"_data",void 0),this._id=t,this._lookupMap=e,this._diskLock=e.diskLock,this.log=new o.default({prefix:`${c.default.get("LOG_PREFIX",e.type)}Data > `,payload:{"event.subcategory":c.default.get("ANALYTICS_SUBCATEGORY",e.type)}}),this._fileName=`${this._id}.json`}setData(t,e){const a=this.validateData(t,e);return a?this.log.error(new n.default(i.default.DATA_VALIDATION_ERR,`Invalid data: ${JSON.stringify(t)}`)):this._data=t,a}get fileName(){return this._fileName}get assetsDir(){return l.join(c.default.get("ROOT_DIR"),c.default.get("DIR",this._lookupMap.type),c.default.get("ASSETS_DIRNAME"))+"/"}hasValidCards(){return!0}get id(){return this._id}get expiryTime(){return this._data&&this._data.expirationDTS}async upgrade(t,e){return null}async load({version:t,skipSaving:e}){let a=await r.readJson(this._lookupMap.getPath()+this._fileName),s=!1;const i=a._ccx&&a._ccx.version||a.version;a&&i!==c.default.get("LOOKUP_COLLECTION_FILE_VERSION",this._lookupMap.type)&&(this.log.disk(`Collection Lookup file version mismatch: ${this._fileName}`),a=await this.upgrade(a,t).catch(t=>null),s=!0);let n=this.setData(a,t);if(n)throw n;return n||!s||e||await this.save(),this}async save(){if(!this._data)throw new Error("No data to save");await this._diskLock.write(async()=>await s.default.writeJsonAtomic(this._lookupMap.getPath(),this._fileName,this._data))}async sync(t){if(!this._data)throw new Error("Invalid data");await this.syncData(function(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?d(Object(a),!0).forEach(function(e){u(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):d(Object(a)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}({},t,{progress:async e=>{await this.save(),t.progress&&t.progress(e)}})),await this.save()}get isDefaultData(){return!!(this._data&&this._data._ccx&&this._data._ccx.isDefault)}get data(){return this._data}validateData(t,e){return null}}},function(t,e,a){const s=a(11).default,r=a(14),i=a(23),n=a(1).default,o=new s({prefix:"Proxy > "}),c=a(33),l=a(45),d=a(33).globalAgent,u={},p=a(46)((t,e)=>{o.disk(e)}),_={getRootCA:i.promisify(p.getRootCA),resolve:i.promisify(p.resolve)};t.exports=new class extends r{constructor(){super(),this._lastCredentials={},this.getOSLocale=n.memoize(p.getOSLocale),this.getNodeTunnelOptionsForURL=n.memoize(this._getNodeTunnelOptionsForURL)}async init(){p.setAuthenticationCallback((t,e)=>{const a=this._lastCredentials[t.proxy.host+t.proxy.port]||{};if(a.username===this.proxyUser&&a.password===this.proxyPassword){const a=new Error(`No new credentials for ${t.proxy.host}:${t.proxy.port}`);a.code="PROXY",e(a)}else if(this.proxyUser)a.username=this.proxyUser,a.password=this.proxyPassword,e(null,a),this._lastCredentials[t.proxy.host+t.proxy.port]=a;else{const a=new Error(`No credentials present for ${t.proxy.host}:${t.proxy.port}`);a.code="PROXY",e(a)}}),p.on("change",()=>{o.disk("System proxy settings changed"),this.getNodeTunnelOptionsForURL.cache.clear(),this.emit("change",!0)}),this._ca=await _.getRootCA().catch(t=>{o.error(t,"Error getting Root CA")}),d.options.ca=this._ca}async _getNodeTunnelOptionsForURL(t){let e=await _.resolve(t).catch(t=>{o.error(t,"Error getting proxy settings")});const a=(e=e&&e[0])&&e.agentClass||(t.startsWith("https")?c.Agent:l.Agent),s=e&&e.agentOptions||{},r={};s.ca=this._ca,s.keepAlive=!0,s.keepAliveMsecs=1e4,s.maxFreeSockets=1e3;const i=s.proxy?s.proxy.host+s.proxy.port:t.startsWith("https")?"https":"http";if(u[i]=u[i]||new a(s),r.agent=u[i],e.agent){const a=`${e.hostname}:${e.port}${this.proxyUser?" with":" without"} authentication`;o.disk(`Setting proxy for ${t}: ${a}`),r.details=a}else o.disk(`No proxy (direct connection) for ${t}`),r.details="No Proxy";return r}setProxyCredentials(t,e){this.proxyUser===t&&this.proxyPassword===e||(o.disk("Setting proxy username and password"),this.proxyUser=t,this.proxyPassword=e,this.getNodeTunnelOptionsForURL.cache.clear(),this.emit("change",!1))}getProxyCredentials(){return{user:this.proxyUser,password:this.proxyPassword}}clearCache(){this.getNodeTunnelOptionsForURL.cache&&this.getNodeTunnelOptionsForURL.cache.clear(),this.proxyUser=void 0,this.proxyPassword=void 0,this._lastCredentials={}}}},function(t,e,a){"use strict";a.r(e),a.d(e,"default",function(){return C});var s=a(0),r=a(6),i=a(2),n=a(10),o=a(15),c=a(13),l=a(3),d=a(8),u=a(5),p=a(38),_=a(4),h=a(16),f=a(11),g=a(1),E=a(21),T=a(12),y=a(14);function S(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,s)}return a}function O(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?S(Object(a),!0).forEach(function(e){I(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):S(Object(a)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}function I(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}const A=a(19);class C extends y{constructor(t){super(),I(this,"_data",void 0),I(this,"_type",void 0),I(this,"_path",void 0),I(this,"_fileName",void 0),I(this,"_downloadManager",void 0),I(this,"_diskLock",void 0),I(this,"_syncLock",void 0),I(this,"log",void 0),I(this,"gc",void 0),I(this,"_syncTimeout",void 0),I(this,"fetchAsset",void 0),I(this,"_fetchCollectionData",void 0),I(this,"fetchCollectionIndex",void 0),I(this,"_saveInProgress",!1),I(this,"_calledSave",!1),s.default.patch(t.LABEL,t||{}),this._type=t.LABEL,this._path=n.join(s.default.get("ROOT_DIR"),s.default.get("DIR",this.type)),this._fileName=s.default.get("LOOKUP_MAP_FILE"),this._downloadManager=null,this._diskLock=new r.default,this._syncLock=new r.default(9999),this.log=new f.default({prefix:`${s.default.get("LOG_PREFIX",this.type)}LookupMap > `,payload:{"event.subcategory":s.default.get("ANALYTICS_SUBCATEGORY",this.type)}}),this.fetchAsset=g.default.memoize(g.default.retryLocalErrors(this._fetchAsset.bind(this)),{refresher:t=>"pending"!==t.state,resolver:t=>t.href,wrapper:(t,e,a)=>{const s=t[0]||{};return s.force&&s.force.type&&a&&["stale","always"].includes(s.force.type)?e.then(()=>this._fetchAsset(s)):e}}),this._fetchCollectionData=g.default.memoize(this._fetchCollectionDataRaw,{refresher:t=>"pending"!==t.state,resolver:t=>this.paramsToId(t.params,!1),wrapper:(t,e,a)=>{const s=t[0]||{};return s.force&&s.force.type&&a&&["stale","always"].includes(s.force.type)?e.then(()=>this._fetchCollectionData(s)):e}}),this.fetchCollectionIndex=g.default.retryLocalErrors(this.fetchCollectionIndexRaw.bind(this)),this.gc=g.default.memoize(this._gc,{refresher:t=>"pending"!==t.state})}isSyncInProgress(t){const e=this._fetchCollectionData.cache&&this._fetchCollectionData.cache.get(t);return e&&"pending"===e.state}paramsToIdRaw(t){const e=this._getCollectionInfo(t);if(e&&e.pendingId)return e.pendingId;if(e&&e.latestId){const t=this._data.metadata[e.latestId];if(g.default.getTimeToExpiry(t.expiryTime)>0)return e.latestId}}paramsToId(t,e=!0){const a=this.paramsToIdRaw(t);if(a)return a;const s=this._generateId(t);return this._addNewCollectionInfo({params:t,isPending:!0,collectionId:s}),e?this.save().then(()=>s):(this.save(),s)}_generateId(t){return`${t.productCode}-${t.productVersion}-${t.productLanguage}-${d.v4()}`.trim()}async expireAll(t){this._data&&(Object.keys(this._data.metadata).forEach(e=>{t&&t===this._data.metadata[e].userId&&delete this._data.metadata[e].expiryTime}),await this.save())}async forceRefresh(t){const e=[...Object.values(t)],a=this.getIdsByKeys(e);await Promise.all(a.map(async t=>await this.expireOne(t)))}getIdsByKeys(t){const e=[],a=t.reduce((t,a)=>t[a]?t[a]:(e.push(a),t),this._data.versionInfo[_.default.getUserId()]),s=[];if(a.lastUsedId&&s.push(a.lastUsedId),a.pendingId&&s.push(a.pendingId),a.lastDisplayedId&&s.push(a.lastDisplayedId),a.latestId&&s.push(a.latestId),s.length>0)return s;const r=new Set,i=t=>{let a=!1;t.lastUsedId&&(s.push(t.lastUsedId),a=!0),t.pendingId&&(s.push(t.pendingId),a=!0),t.lastDisplayedId&&(s.push(t.lastDisplayedId),a=!0),t.latestId&&(s.push(t.latestId),a=!0);const n=Object.keys(t).some(e=>"object"==typeof t[e]);if(a||!n)return;const o=Object.keys(t),c=e.find(e=>!!t[e]);c?(r.add(c),i(t[c])):o.forEach(e=>i(t[e]))};return i(a),e.length>r.size?[]:s}async expireOne(t){try{delete this._data.metadata[t].expiryTime}catch(t){return}await this.save()}_getLookupKeys(t,e=null){const a=t.productVersion&&t.productVersion.split(".")[0],s=[e||_.default.getUserId()];return s.push(t.productCode,a,t.productLanguage),s}_getCollectionInfo(t,e=null){if(!t)return;const a=this._getLookupKeys(t,e);let s=this._data.versionInfo;return a.forEach(t=>{s&&(s=s[t])}),s}_setCollectionInfo(t,e){const a=this._getLookupKeys(t);let s=this._data.versionInfo;return a.forEach((t,r)=>{r===a.length-1?s[t]=e:(s[t]=s[t]||{},s=s[t])}),s}_isDataReferenced(t){const e=this._data.metadata[t],a=e&&this._getCollectionInfo(e.params,e.userId);return!!a&&!!Object.keys(a).find(e=>t===a[e])}_isDataPrimaryReference(t){const e=this._data.metadata[t],a=e&&this._getCollectionInfo(e.params,e.userId);if(a){if(a.pendingId)return t===a.pendingId;if(a.latestId)return t===a.latestId}return!1}_checkValidity(t,e){}_addNewCollectionInfo({params:t,isPending:e,collectionId:a,expiry:s,retry:r,cause:i="Unknown",refreshTime:n}){const o=this._getCollectionInfo(t)||{};let c=new Date;return Object.values(o).forEach(t=>{const e=this._data.metadata[t];if(e&&e.lastUseTime){const t=new Date(e.lastUseTime);!isNaN(t.getTime())&&t>c&&(c=t)}!r&&e&&e.retry&&(r=e.retry)}),e?o.pendingId=a:(o.latestId=a,delete o.pendingId),this._setCollectionInfo(t,o),this._data.metadata[a]={expiryTime:s?s.toISOString():void 0,userId:_.default.getUserId(),lastUseTime:c.toISOString(),retry:r,cause:i,params:t,refreshTime:n},this._data.metadata[a].params=t,this._data.metadata[a]}sanitizeParams(t){return t.productLanguage=g.default.sanitizeLocale(t.productLanguage),t}isRequestPoisoned(t){const e=s.default.get("SUPPORTED_PRODUCTS",this.type);return!(t.productCode&&e[t.productCode]&&g.default.compareMajorMinorVersions(e[t.productCode],t.productVersion)>-1)}_calculateExpiry(t,e){const a=t?t.expiryTime:void 0;let r;if(a){r=new Date(a);const t=new Date;t.setMilliseconds(s.default.get("MAX_TIMEOUT")),r>t&&(r=t);const e=new Date;e.setMilliseconds(s.default.get("MIN_TIMEOUT")),r<e&&(r=e)}return r}_calculateBackOffMetadata({id:t,error:e,updateBackOff:a=!0}){let r=0,i="killed before response";const n=e,o=this._data.metadata[t];if(n&&n.responseHeaders){const t=E.a.getRetryAfterHeader(n.responseHeaders);t&&(r=1e3*t)}else o&&o.retry&&(r=o.retry*(a?2:1));n&&(i=n.short?n.short:n.message?n.message:n.toString()),r=Math.max(s.default.get("SYNC_INITIAL_RETRY"),Math.min(r,s.default.get("MAX_TIMEOUT")));const c=new Date;return c.setMilliseconds(r),{expiry:c,retry:r,cause:i}}async fetchCollectionIndexRaw({requestId:t,desiredId:e,params:a,oldMetadata:r,priority:i,force:n,skipAuth:o=!1}){const c=this._createCollectionData(e);let l=!0;await c.load({version:g.default.ccxVersionToString(a)}).catch(t=>{l=!1}),l&&g.default.isDateExpired(c.expiryTime)&&(l=!1),l&&c.isDefaultData&&(l=!1);let d=r&&r.refreshTime;if(l&&("stale"===n.type&&g.default.isDateExpired(r.expiryTime)?l=!1:"always"===n.type&&(l=!1)),!l||o){const r=await this.downloadManager.downloadCollectionData({id:t,params:a,priority:i,skipAuth:o});r._ccx=r._ccx||{},r._ccx.version=s.default.get("LOOKUP_COLLECTION_FILE_VERSION",this.type);let n=c.setData(r,g.default.ccxVersionToString(a));if(n)throw n;await c.save(),d=(new Date).toISOString(),this._data.metadata[e].refreshTime=d,await this.save()}return this._checkValidity(c,a),c}async defaultCollectionData({params:t,desiredId:e}){}async _fetchCollectionDataRaw({params:t,priority:e,payload:a,force:r={type:"none"}}){if(l.default.isWaitingForBackOff(l.BackOffType.NETWORK))throw new i.default(`Awaiting global back-off ${l.default.backOffCause(l.BackOffType.NETWORK)}`).silence();return await this._syncLock.read(async()=>{if(!_.default.getUserId())throw new i.default("signed out").silence();if(c.default.status===c.default.OFFLINE)throw this.log.disk("Not downloading collection - offline"),new i.default("offline").silence();let n=await this.paramsToId(t);const l=this._getCollectionInfo(t),u=n;if(l&&n===l.latestId){if("always"!==r.type)return this._createCollectionData(n);delete this._data.metadata[n].expiryTime,n=await this.paramsToId(t)}let p=t=>{this.emit(n,t),u!==n&&this.emit(u,t)};if(t=this.sanitizeParams(t),(e=e||this.priority({params:t,key:n})).key=n,this.isRequestPoisoned(t))throw new i.default("Poisoned request not supported.").silence();const h=Object.assign({},this._data.metadata[n]);if(h&&!g.default.isDateExpired(h.expiryTime)&&"none"===r.type){const e=`Waiting for back-off ${h.cause} for ${(h.retry||0)/1e3}s expiring ${h.expiryTime}`;throw this.log.context({params:t}).disk(e),new i.default(e).silence()}this._addNewCollectionInfo(O({params:t,isPending:!0,collectionId:n,refreshTime:h.refreshTime},this._calculateBackOffMetadata({id:n}))),await this.save();const f=d.v4(),E=await this.downloadManager.url(t),T=await A.getNodeTunnelOptionsForURL(new o.URL(E).origin).details;let y=this.log.context({params:t,payload:O({},a,{"exp.request_guid":f,"event.url":E,"content.action":E,"event.subtype":s.default.analytics.st_API,"ccxp.proxy":T},this.downloadManager.additionalAnalytics(t))});return await y.request(async a=>{try{const o={};p(o);const c={requestId:f,params:t,desiredId:n,oldMetadata:h,force:r,priority:e},l=await this.fetchCollectionIndex(c).catch(async e=>{if(!s.default.get("ANONYMOUS_RETRY_DISABLED",this.type)&&await _.default.getAccessToken()){c.skipAuth=!0,this.log.context({params:t}).error(new i.default("Attempting Context only (bypass)",e));const a=await this.fetchCollectionIndex(c).catch(async e=>{if(!s.default.get("DEFAULT_URLS_ENABLED",this.type))throw e;this.log.context({params:t}).error(new i.default("Attempting Default URL (bypass)",e));const a=await this.defaultCollectionData({params:t,desiredId:n});if(!a)throw e;return await a.save(),a});if(!a)throw e;return await a.save(),a}{if(!s.default.get("DEFAULT_URLS_ENABLED",this.type))throw e;this.log.context({params:t}).error(new i.default("Attempting Default URL (bypass)",e));const a=await this.defaultCollectionData({params:t,desiredId:n});if(!a)throw e;return await a.save(),a}});return this.downloadManager.applyResponseAnalytics(a,l.data,t),o.path=`${this._path+l.id}.json`,o.contentId=l.id,o.total=l.totalItems,p(o),await l.sync({priority:e,payload:a.options.payload,params:t,progress:t=>{p(Object.assign(t,o))},force:r}),this._checkValidity(l,t),this._addNewCollectionInfo({params:t,isPending:!1,collectionId:l.id,expiry:this._calculateExpiry(l,t),refreshTime:this._data&&this._data.metadata[n]&&this._data.metadata[n].refreshTime}),await this.save(),this.emit("newCollection",t,l),l}catch(e){throw this._addNewCollectionInfo(O({params:t,isPending:!0,collectionId:n,refreshTime:this._data.metadata[n].refreshTime},this._calculateBackOffMetadata({id:n,error:e,updateBackOff:!1}))),await this.save(),e}})},e)}_clearScheduledSyncJob(){this._syncTimeout&&(clearTimeout(this._syncTimeout),delete this._syncTimeout)}async _scheduleNextSyncJob(){let t=1/0;if(this._clearScheduledSyncJob(),l.default.isWaitingForBackOff(l.BackOffType.NETWORK))return t=new Date(l.default.backOffExpiry(l.BackOffType.NETWORK)).getTime()-(new Date).getTime(),this.log.disk(`Scheduling next sync in ${t}ms after global backoff`),t=Math.min(s.default.get("MAX_TIMEOUT"),t),void(this._syncTimeout=setTimeout(this.sync.bind(this),t));await g.default.waitAll(Object.keys(this._data.metadata).map(async e=>{const a=this._data.metadata[e],r=a.params;if(this.needsSync(e,{checkExpiry:!1})){let e=g.default.getTimeToExpiry(a.expiryTime);if(0===e){e=s.default.get("SYNC_INITIAL_RETRY");const t=new Date;t.setMilliseconds(e),a.expiryTime=t.toISOString(),await this.save(),this.log.context({params:r}).info(s.default.analytics.MISSING_DATA,`Scheduling with expired data. Add back-off for ${r.productCode}[${r.productLanguage}] - ${a.expiryTime}`)}t=Math.min(t,e)}})),t!==1/0&&(t+=g.default.getRandomizedTime(),t=Math.min(t,s.default.get("MAX_TIMEOUT")),this.log.disk(`Scheduling next sync in ${t}ms at ${new Date(Date.now()+t).toISOString()}`),this._syncTimeout=setTimeout(this.sync.bind(this),t))}_getReferencedIdList(){const t={};return Object.keys(this._data.metadata).forEach(e=>{this._isDataReferenced(e)&&(t[e]=!0)}),t}_isPendingCollection(t){const e=this._data.metadata[t],a=e&&this._getCollectionInfo(e.params,e.userId);return!(!a||!a.pendingId)&&t===a.pendingId}async _refetchCollection(t){const e=this._data.metadata,a=e[t]&&e[t].params;return a?(this.clearCollectionInfo(a,t),this.log.disk(`Refetch collection [${t}]`),await this.addNewCollectionData({params:a}).catch(t=>this.log.context({params:a}).error(t,"Error Re-fetching collection")&&void 0)):Promise.resolve()}async _getReferencedAssetList(t){const e={};return await g.default.waitAll(Object.keys(t).map(async t=>{let a=this._createCollectionData(t);try{const s=g.default.ccxVersionToString(this._data.metadata[t].params);await a.load({version:s,skipSaving:!0}),Object.assign(e,await a.getReferencedAssets())}catch(t){if("ENOENT"!==t.code)throw t;{this.log.disk(`File is missing for collection [${a.id}]`);const t=this._data.metadata[a.id];t&&t.userId===_.default.getUserId()&&this._isDataPrimaryReference(a.id)&&!this._isPendingCollection(a.id)&&this._refetchCollection(a.id)}}})),e}_cleanupCache(t,e){const a=this._data.metadata;Object.keys(a).forEach(s=>{this._isDataPrimaryReference(s)||t[s]&&e.includes(`${s}.json`)||delete a[s]})}_cleanupAssetsCache(t,e){const a=this._data.assetMetadata;Object.keys(a).forEach(s=>{const r=a[s];r.path&&(t[r.path]&&e.includes(n.basename(r.path))||delete a[s])})}setData(t){const e=g.default.validateDataFields(t,s.default.get("MAP_DATA_SCHEMA"));return e?this.log.error(new i.default(T.default.DATA_VALIDATION_ERR,e[0])):this._data=t,e}async upgrade(t){return null}async load(){let t=await u.readJson(this._path+this._fileName).catch(t=>{this.log.disk(`Failed to load lookup file from disk: ${this._fileName} - ${g.default.scrubStack(t)}`)}),e=!1;t?t.version!==s.default.get("LOOKUP_MAP_FILE_VERSION",this._type)&&(this.log.disk(`Lookup file version mismatch: ${this._fileName}`),t=await this.upgrade(t).catch(t=>null),e=!0):this.log.disk(`Empty lookup file: ${this._fileName}`),t&&!this.setData(t)||((t={}).version=s.default.get("LOOKUP_MAP_FILE_VERSION",this._type),t.versionInfo={},t.metadata={},t.assetMetadata={},t.usersInfo={},this.setData(t)),e&&await this.save()}getPath(){return this._path}async updateDisplayedId({params:t,displayed:e}){if(e&&t){const a=n.basename(e,".json");let s=this._getCollectionInfo(t);s||(this._addNewCollectionInfo({params:t,isPending:!1,collectionId:a}),s=this._getCollectionInfo(t)),s&&s.lastDisplayedId!==a&&(s.lastDisplayedId=a,this._setCollectionInfo(t,s),await this.save())}}validateParams(t){const e=g.default.validateDataFields(t,s.default.get("PARAMETERS_SCHEMA",this.type));if(e)throw new i.default(s.default.analytics.PARAM_VALIDATION_ERR,e[0])}async getLatestPath({params:t,updateLastUsedId:e=!1,updateLastUseTime:a=!1}){this.validateParams(t);const r=this._getCollectionInfo(t);if(r&&r.latestId){let i=!1;if(e&&r.latestId!==r.lastUsedId&&(r.lastUsedId=r.latestId,this._setCollectionInfo(t,r),i=!0),a){const t=this._data.metadata[r.lastUsedId?r.lastUsedId:""]||{},e=t.lastUseTime;if(t.lastUseTime=(new Date).toISOString(),e){const t=new Date(e);t.setMilliseconds(s.default.get("STOP_SYNCING_BEYOND")),t<new Date&&this.sync()}i=!0}i&&await this.save();const n=this._data.metadata[r.latestId];if(n&&n.userId===_.default.getUserId()&&!this._isPendingCollection(r.latestId)){const e=this._createCollectionData(r.latestId);e.load({version:g.default.ccxVersionToString(t)}).catch(t=>{"ENOENT"===t.code&&(this.log.disk(`File is missing for collection [${e.id}]`),this._refetchCollection(e.id))})}return`${this._path+r.latestId}.json`}}getExpiry(t){return this._data.metadata[t]&&this._data.metadata[t].expiryTime}async save(){if(!this._data){const t=new Error(T.default.DATA_VALIDATION_ERR);throw this.log.error(t,"No data to save to LookupMap."),t}this._saveInProgress?this._calledSave=!0:(this._calledSave=!1,this._saveInProgress=!0,await this._diskLock.write(async()=>{await h.default.writeJsonAtomic(this._path,this._fileName,this._data)}).catch(t=>{this._saveInProgress=!1,this.log.error(t,`Error writing to ${this._fileName}`)}),this._saveInProgress=!1,this._calledSave&&(await this.save(),this._calledSave=!1))}async _fetchAsset({href:t,assetsDir:e,priority:a,params:r,force:i}){const o=this._data.assetMetadata[t]||{};let{lastModified:c,expiry:l}=o;if(c&&!await u.pathExists(`${e}../${o.path}`)&&(c=void 0,l=void 0),i&&i.depth>=0&&("always"===i.type||"stale"===i.type)&&(!i.from||!o.refreshTime||new Date(i.from)>new Date(o.refreshTime))&&(c=void 0,l=void 0),new Date(l||"")>new Date)return{path:o.path};if(c&&o.path&&".json"!==n.extname(o.path)&&!s.default.get("NON_IDEMPOTENT_IMAGES",this.type))return{path:o.path};const d=this._generateId(r||{}),_=c?{"If-Modified-Since":c}:void 0;let{response:f,time:g}=await this.downloadManager.get({url:t,options:{headers:_},priority:a,id:d});if(304===f.status){if(o.path)return{path:o.path};throw new Error(`Got 304 for asset not on disk for url ${t}`)}let T=p.getExtension(E.a.getContentTypeHeader(f.headers)||"");T||(T=(T=n.extname(f.url))&&T.substr(1));const y=`${e}${d}.${T}`,S=`${n.basename(e)}/${d}.${T}`,O=Date.now();return await h.default.writeAtomic({stream:f.body,target:y,url:t}),g+=Date.now()-O,this._data.assetMetadata[t]={path:S,lastModified:f.headers.get("last-modified")||(new Date).toISOString(),expiry:E.a.getExpiry(f.headers)||new Date(Date.now()+s.default.get("ASSET_DEFAULT_EXPIRATION")),refreshTime:(new Date).toISOString()},await this.save(),{path:S,time:g}}priority({params:t,key:e="",level:a=r.PriorityLevels.Regular}){return new r.Priority({key:e,value:s.default.get("PRODUCT_PRIORITY")[t.productCode]||0,channel:s.default.get("PRIORITY_CHANNEL",this._type),level:a})}isValidDataForParams({id:t,params:e}){return!0}async addNewCollectionData({params:t,payload:e,priorityLevel:a,progress:i=(()=>{}),force:n}={}){if(!t){const t=new Error(T.default.DATA_VALIDATION_ERR);throw this.log.error(t,"No parameters to add the collection of."),t}this.validateParams(t);const o=this._getCollectionInfo(t);if(o&&t.ccxVersion){let e=!1;Object.values(o).forEach(a=>{const s=this._data.metadata[a];s&&s.params&&s.params.ccxVersion&&(s.params.ccxVersion&&-1!==g.default.compareMajorMinorVersions(t.ccxVersion,s.params.ccxVersion)||(s.params.ccxVersion=t.ccxVersion,e=!0))}),e&&await this.save()}if(o&&o.latestId){const r=o.latestId;this._data.metadata[r]=this._data.metadata[r]||{};let c=!0;if(s.default.get("MINOR_VERSION_SHOULD_UPDATE_CONTENT",this.type)){Object.values(o).some(e=>{const a=this._data.metadata[e];return!!(a&&a.params&&a.params.productVersion&&0==g.default.compareMajorMinorVersions(t.productVersion,a.params.productVersion))})||(n={type:"always"})}if(n)switch(n.type){case"always":delete this._data.metadata[r].expiryTime;case"stale":g.default.isDateExpired(this._data.metadata[r].expiryTime)&&(c=!1)}if(this._data.metadata[r]?this.isValidDataForParams({id:r,params:t})||(c=!1,delete this._data.metadata[r].expiryTime):c=!1,c){const s=this._createCollectionData(r);return this._data.metadata[r].params=t,await s.load({version:g.default.ccxVersionToString(t)}).catch(async s=>(this.clearCollectionInfo(t,r),await this.addNewCollectionData({params:t,payload:e,progress:i,priorityLevel:a,force:n})))}}const c=await this.paramsToId(t),l=this.priority({params:t,key:c,level:a||r.PriorityLevels.Regular});this._syncLock.prioritize(l),this._downloadManager.prioritize(l),this.addListener(c,i);const d=await this._fetchCollectionData({params:t,priority:l,payload:e,force:n}).catch(async e=>{throw this.log.context({params:t}).disk(e,"Error adding new collection"),await this._scheduleNextSyncJob(),this.removeListener(c,i),e});return this.removeListener(c,i),d}needsSync(t,e={}){const{checkExpiry:a=!0,force:s=!1}=e,r=this._data.metadata[t];let i=r&&r.userId===_.default.getUserId()&&this._isDataPrimaryReference(t)&&!this.isSyncInProgress(t)&&!this.isRequestPoisoned(r.params);return s||(i=i&&g.default.hasBeenUsedRecently(r.lastUseTime)),a&&!s&&(i=i&&g.default.isDateExpired(r.expiryTime)),i}async sync(t={type:"none"}){if(c.default.status===c.default.OFFLINE){c.default.check(),l.default.updateBackOff({cause:"Offline[Network]",type:l.BackOffType.NETWORK}),await this._scheduleNextSyncJob();const t=new i.default("Offline");throw this.log.disk(t),t}this._clearScheduledSyncJob(),"always"===t.type&&await this.expireAll(_.default.getUserId()),this._data&&this._data.metadata&&await g.default.waitAll(Object.keys(this._data.metadata).map(e=>{const a=this._data.metadata[e];return this.needsSync(e,{force:"none"!==t.type,checkExpiry:!this._isPendingCollection(e)})?this._fetchCollectionData({params:a.params,force:t}):Promise.resolve()})).catch(async t=>{throw await this._scheduleNextSyncJob(),t}),await this.gc(),await this._scheduleNextSyncJob()}async _gc(){try{await this._syncLock.write(async()=>{await this._diskLock.write(async()=>{this.log.disk("GC starts.");const t=this._getReferencedIdList(),e={},a={};Object.keys(t).forEach(t=>{e[`${t}.json`]=!0});const{left:r,removed:i}=await h.default.cleanupFolder(this._path,e,new RegExp(s.default.get("IGNORED_FILES_REGEXP")));i.length>0&&this.log.disk(`Removed from ${this._path} - ${i.join(" ")}`);const o=await this._getReferencedAssetList(t);Object.keys(o).forEach(t=>{a[n.basename(t)]=!0});const c=this._path+s.default.get("ASSETS_DIRNAME")+"/",{left:l,removed:d}=await h.default.cleanupFolder(c,a);d.length>0&&this.log.disk(`Removed from ${c} - ${d.join(", ")}`),this._cleanupCache(t,r),this._cleanupAssetsCache(o,l)})}),await this.save(),this.log.disk("GC ended successfully.")}catch(t){throw this.log.error(t,s.default.analytics.GC_ERROR),t}}async setForUser(t,e){let a=this._data.usersInfo;(a=a||{})[_.default.getUserId()]=a[_.default.getUserId()]||{},a[_.default.getUserId()][t]=e,await this.save()}getForUser(t){const e=this._data.usersInfo&&this._data.usersInfo[_.default.getUserId()];return e&&e[t]}getLastTimeOfNotification(){let t=this.getForUser("lastTimeOfNotification");return t||(t=(new Date).getTime(),this.setForUser("lastTimeOfNotification",t)),t}async setLastTimeOfNotification(t){await this.setForUser("lastTimeOfNotification",t)}async clearCollectionInfo(t,e){this.validateParams(t);const a=this._getLookupKeys(t);let s=this._data.versionInfo,r=!1;const i=[["root",s]];if(a.forEach(t=>{s&&s[t]?(s=s[t],i.push([t,s])):r=!0}),r||0===i.length)return;let n=i.pop(),o=n[0],c=n[1];const l=[];for(Object.keys(c).forEach(t=>{e?c[t]===e&&(delete c[t],l.push(e)):(l.push(c[t]),delete c[t])}),l.forEach(t=>delete this._data.metadata[t]);i.length>0&&0===Object.keys(c).length;){let t=o;o=(n=i.pop())[0],delete(c=n[1])[t]}await this.save()}async updateLicenseInformation(t){if(!t)return;const e=Object.assign({},t);"trial"===t.subscriptionStatus?e.subscriptionStatus="paid":e.subscriptionStatus="trial",await this.clearCollectionInfo(e)}get downloadManager(){return this._downloadManager}get type(){return this._type}getCachedRequestData(){const t={};return Object.keys(this._data.metadata).forEach(e=>{const a=this._data.metadata[e];if(a.userId===_.default.getUserId()){const e=a.params;if(e&&e.productCode&&e.productVersion){t[e.productCode]||(t[e.productCode]={}),(e=>{t[e.productCode][e.productVersion]||(t[e.productCode][e.productVersion]=[]),t[e.productCode][e.productVersion].push(e)})(a.params)}}}),t}updateParams(t){var e;const a=JSON.parse(JSON.stringify(t)),s=A.getOSLocale(),r=(null===(e=_.default.getUserInfo())||void 0===e?void 0:e.countryCode)||s.split("_")[1];return a.forEach(t=>{t.productLanguage=t.productLanguage||s,t.countryCode=t.countryCode||r}),a}targetDetails(t){return t}get diskLock(){return this._diskLock}}},function(t,e,a){"use strict";a.d(e,"a",function(){return i});var s=a(15);const r=a(1).default;class i{static stripPathFromURL(t){if("string"!=typeof t)return;const e=s.parse(t);return e.protocol&&e.host?`${e.protocol}//${e.host}`:void 0}static getRetryAfterHeader(t){if(t){const e=t.get("retry-after");if(e)try{const t=parseInt(e,10);if(t)return Math.max(0,t);const a=new Date(e);if(!isNaN(a)){const t=(new Date).valueOf(),e=Math.max(0,a-t),s=r.getRandomizedTime();return Math.round((e+s)/1e3)}}catch(t){}}return 0}static getExpiry(t){let e=new Date(t.get("expiry")||"");const a=t.get("cache-control");if(a&&"string"==typeof a&&a.includes("max-age=")){const t=parseInt(a.split("max-age=")[1].trim(),10);t&&(e=new Date).setSeconds(t)}if(!isNaN(e))return e.toISOString()}static getContentTypeHeader(t){if(t){let e=t.get("content-type");if(e&&"string"==typeof e){const t=e.indexOf(";");return t>0&&(e=e.substring(0,t)),e}}}}},function(t,e){t.exports=require("xml2js")},function(t,e){t.exports=require("util")},function(t,e,a){"use strict";a.r(e);var s=a(5),r=a(0),i=a(14);function n(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}const o=new class extends i.EventEmitter{constructor(...t){super(...t),n(this,"logFilePath",`${r.default.get("LOG_DIR")}CCX Process.log`),n(this,"prevLogFilePath",`${r.default.get("LOG_DIR")}CCX Process (prev).log`),n(this,"pendingLogWrite",void 0),n(this,"writingToLog",!1),n(this,"logQueue",[])}swapLogIfNeeded(t){s.stat(this.logFilePath,(e,a)=>{!e&&a.size>r.default.get("MAX_LOG_SIZE")?s.rename(this.logFilePath,this.prevLogFilePath,t):t(null)})}doLogWrite(){s.ensureDir(r.default.get("LOG_DIR"),t=>{if(t)return this.pendingLogWrite=void 0,void console.log(t);this.swapLogIfNeeded(t=>{if(t)return this.pendingLogWrite=void 0,void console.log(t);const e=this.pendingLogWrite;this.pendingLogWrite=void 0,this.writingToLog=!0,s.appendFile(this.logFilePath,e,t=>{t&&console.log(t),this.writingToLog=!1,this.pendingLogWrite&&this.doLogWrite(),this.emit("logWrite")})})})}addMessageToLogQueue(t){this.logQueue.length>=r.default.get("MAX_ANALYTICS_LOGS")&&this.logQueue.shift(),this.logQueue.push(t)}log(...t){const e=t.join(": ");r.default.get("CONSOLE_LOGGING")&&console.log(e),this.addMessageToLogQueue(e);const a=`${(new Date).toString()} ${e}\n`;this.pendingLogWrite?this.pendingLogWrite+=a:(this.pendingLogWrite=a,this.writingToLog||this.doLogWrite())}};e.default=o},function(t,e){t.exports=require("fs")},function(t,e,a){"use strict";a.r(e);var s=a(0),r=a(14),i=a(11),n=a(1),o=a(12),c=a(2);function l(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,s)}return a}function d(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?l(Object(a),!0).forEach(function(e){u(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}function u(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}const p=a(49),_=t=>Object.keys(t).reduce((e,a)=>d({},e,{[a]:t[a][0]}),{});const h=new class extends r{constructor(){super(),u(this,"log",new i.default({prefix:"VulcanWrapper > "})),u(this,"vulcan",void 0),u(this,"installedApps",{}),u(this,"aidFetched",!1),u(this,"getInstalledApps",n.default.memoize(async()=>{try{if(this.aidFetched)return this.installedApps;const t=await new Promise(async(t,e)=>p.getAllInstalledApps(!1,(a,s)=>{a?e(a):t(s)})),e=await n.default.parseXml(t);if(n.default.validateDataFields(e,s.default.get("NODE_AID_RESPONSE_SCHEMA")))throw new c.default(o.default.DATA_VALIDATION_ERR,`Invalid data: ${JSON.stringify(e)}`);const a=e.ProductsInfo.ProductInfo;return this.installedApps=a.reduce((t,e)=>{const a=_(e);return a.SAPCode=n.default.getProductAlias(a.SAPCode),d({},t,{[a.SAPCode]:a})},{}),this.aidFetched=!0,this.installedApps}catch(t){return this.log.error(t),{}}})),u(this,"getAppVersion",n.default.memoize(t=>this.getKeyForApp("CodexVersion",t))),u(this,"getAppLanguage",n.default.memoize(async t=>{const e=await this.getKeyForApp("InstallLanguage",t);if(e&&"mul"!==e&&!e.includes(","))return e})),this.log.disk("Loading Vulcan Library...");const t=a(50);this.log.disk("Vulcan Library Successfully Loaded."),this.vulcan=new t.VulcanAdapter("CCXP","1.0.0"),this.vulcan.addMessageListener((t,e,a,r)=>{t=t.replace(s.default.get("VULCAN_PREFIX"),""),0!==this.listenerCount(t)&&(this.shouldLogMessage(t)&&this.log.disk(`<- ${a} ${r}: ${t} \n ${this.shouldLogContent(t)?e:""}`.trim()),this.emit(t,e,a,r))})}shouldLogMessage(t){const e=s.default.get("SKIP_LOGGING_MESSAGE_LIST");return!e||!e.includes(t)||s.default.get("CONSOLE_LOGGING")}shouldLogContent(t){const e=s.default.get("SKIP_LOGGING_MESSAGE_CONTENT");return!e||!e.includes(t)}sendMessage(t,e="",a="",s=""){const r=a?`${a} ${s||"*"}`:"BROADCAST";"string"!=typeof e&&(e=JSON.stringify(e)),this.shouldLogMessage(t)&&this.log.disk(`-> ${r}: ${t} \n ${this.shouldLogContent(t)?e:""}`.trim()),this.vulcan.sendMessage(t,e,a,s)}async getKeyForApp(t,e){const a=(await this.getInstalledApps())[e];return a&&a[t]}async getSpecifiers(){return Object.keys(await this.getInstalledApps())}};e.default=h},function(t,e){t.exports=require("child_process")},function(t,e,a){"use strict";a.d(e,"a",function(){return p});var s=a(0),r=a(11),i=a(5),n=a(10),o=a(1),c=a(16);function l(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,s)}return a}function d(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?l(Object(a),!0).forEach(function(e){u(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}function u(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}class p{constructor(t,e){u(this,"lock",void 0),u(this,"log",void 0),u(this,"assetsDir",void 0),this.log=new r.default({prefix:`${s.default.get("LOG_PREFIX",t)}DataManager`,payload:{"event.subcategory":s.default.get("ANALYTICS_SUBCATEGORY",t)}}),this.assetsDir=n.join(s.default.get("ROOT_DIR"),s.default.get("DIR",t),s.default.get("ASSETS_DIRNAME"))+"/",this.lock=e}async downloadYukonData({card:t,lookupMap:e,priority:a,urlKey:s,bundle:r,params:l,started:u,force:p}){if(!t[s]||0===t[s].length)return{count:0,totalTime:0};let _=0,h=0;const f=await e.fetchAsset({href:t[s],assetsDir:this.assetsDir,priority:a,params:l,force:d({},p,{depth:(p.depth||0)-1})})||{};_++,h+=f.time;const g=n.basename(f.path),E=await i.readJson(`${this.assetsDir}/${g}`);return r&&(t.content=E),t.path=f.path,u(),E.includes&&Array.isArray(E.includes.Asset)&&await o.default.waitAll(E.includes.Asset.map(async t=>{if(t.fields&&t.fields.file&&t.fields.file.url){const s=await e.fetchAsset({href:t.fields.file.url,assetsDir:this.assetsDir,priority:a,params:l,force:d({},p,{depth:(p.depth||0)-2})});t.fields.file.path=s.path,s.time&&(_++,h+=s.time)}})).catch(async t=>{throw await this.lock.write(async()=>{await c.default.writeJsonAtomic(this.assetsDir,g,E)}),t}),await this.lock.write(async()=>{await c.default.writeJsonAtomic(this.assetsDir,g,E)}),{count:_,totalTime:h}}async downloadLegacyData({card:t,lookupMap:e,priority:a,params:s}){if(!t.backgroundImage||0===t.backgroundImage.length)return{count:0,totalTime:0};let r,i=null;try{i=(r=await e.fetchAsset({href:t.backgroundImage,assetsDir:this.assetsDir,priority:a,params:s})).path}catch(s){if(404!==s.statusCode||0===t.backgroundImage.indexOf("1000x560"))throw s;t.backgroundImage=t.backgroundImage.replace("1000x560","730x280"),i=(r=await e.fetchAsset({href:t.backgroundImage,assetsDir:this.assetsDir,priority:a})).path}return t.backgroundImageLocalpath=i,{count:1,totalTime:r.time}}async downloadData({modeID:t,card:e,lookupMap:a,priority:s,bundle:r=!1,params:i={},started:n=(()=>{}),force:o={type:"none"}}){try{switch(t){case"CCX_Start_2.5_Learn":case"CCX_Start_2.5_Toast":case"CCX_Start_2.5_Home":return await this.downloadYukonData({card:e,lookupMap:a,priority:s,urlKey:"contentURL",bundle:r,params:i,started:n,force:o});case"firstrun":case"footer":case"learn":case"discover":case"trial":case"openDoc":case"welcome":return await this.downloadLegacyData({card:e,lookupMap:a,priority:s,params:i});case"CCX_Start_3.0_Learn":case"CCX_Start_3.0_Home":case"CCX_Start_3.0_Toast":default:return await this.downloadYukonData({card:e,lookupMap:a,priority:s,urlKey:"data",bundle:r,params:i,started:n,force:o})}}catch(a){throw this.log.disk(`Error downloading content for ${t} ${a}, ${a.stack}, card: ${JSON.stringify(e)},`),a}}async getReferencedAssets(t,e){const a={};if(e.backgroundImageLocalpath)return{[`${e.backgroundImageLocalpath}`]:!0};switch(t){case"CCX_Start_3.0_Learn":case"CCX_Start_3.0_Home":case"CCX_Start_3.0_Toast":case"CCX_Start_2.5_Learn":case"CCX_Start_2.5_Toast":case"CCX_Start_2.5_Home":default:let s=e.content;if(e.path){a[e.path]=!0;const t=n.basename(e.path);s=await i.readJson(`${this.assetsDir}/${t}`).catch(()=>{delete a[e.path]})}return s&&s.includes&&Array.isArray(s.includes.Asset)&&s.includes.Asset.forEach(t=>{t.fields&&t.fields.file&&t.fields.file.path&&(a[t.fields.file.path]=!0)}),a}}}},function(t,e){t.exports=require("node-fetch")},function(t){t.exports={name:"ccx-welcome-process",version:"3.8.1",private:!0,description:"CCX Welcome Process",dependencies:{"@ccx/node-aid":"git+ssh://git@git.corp.adobe.com:CCX/node-aid.git#v0.0.2","@ccx/node-ProxyResolver":"git+ssh://git@git.corp.adobe.com:ProjectCentral/node-ProxyResolver.git#v2.0.1","@ccx/node-ngl":"git+ssh://git@git.corp.adobe.com:ProjectCentral/node-ngllib-prebuilt.git#v1.0.11","fs-ext":"2.0.0","fs-extra":"8.1.0",ingest:"git+ssh://git@git.corp.adobe.com:CCX/Ingest.git#v1.1.1",jsonschema:"1.2.5",mime:"2.4.4",mkdirp:"^1.0.3","node-fetch":"2.6.0","node-vulcanjs":"git+ssh://git@git.corp.adobe.com:slade/VulcanJS.git#v1.3.0","ps-node":"0.1.6","simple-plist":"^1.1.0",uuid:"3.3.3",xml2js:"0.4.23"},devDependencies:{"7zip":"0.0.6","@adobe/tessa-npm-plugin":"1.2.1","@babel/cli":"^7.1.2","@babel/core":"^7.1.2","@babel/plugin-proposal-class-properties":"^7.1.0","@babel/plugin-proposal-object-rest-spread":"^7.0.0","@babel/preset-env":"^7.1.0","@babel/preset-typescript":"^7.1.0","@ccx/hyperdrive-builder":"git+ssh://git@git.corp.adobe.com:CCX/hyperdrive-builder.git#v3.0.45","@types/core-js":"^2.5.0","@types/es6-promise":"^3.3.0","@types/fs-ext":"0.0.29","@types/fs-extra":"5.0.4","@types/glob":"^7.1.1","@types/jest":"23.3.7","@types/mime":"^2.0.0","@types/mustache":"^4.0.1","@types/nock":"^9.3.0","@types/node":"^10.12.0","@types/node-fetch":"2.1.2","@types/uuid":"^3.4.4","@types/webpack":"^4.4.17","@types/xml2js":"0.4.3","babel-loader":"^8.0.4",glob:"7.1.3",husky:"1.1.2",jest:"23.6.0","jest-date-mock":"1.0.5","jest-extended":"0.11.0",jsftp:"2.1.3",matchdep:"2.0.0",mockery:"2.1.0",mustache:"^4.0.1",nock:"10.0.1","node-gyp":"^6.1.0","node-uglifier":"0.5.41",prettier:"2.0.5","pretty-quick":"1.8.0","terser-webpack-plugin":"1.1.0","ts-jest":"23.10.4","ts-loader":"5.2.2","ts-node":"7.0.1","ts-node-dev":"^1.0.0-pre.30",typescript:"3.8",webpack:"4.23.0","webpack-node-externals":"1.7.2"},prettier:{tabWidth:4,useTabs:!1,singleQuote:!0,trailingComma:"all",printWidth:120,arrowParens:"avoid",endOfLine:"auto"},engines:{node:">=12.0.0"},scripts:{test:"jest",coverage:"jest --coverage",updateBuildCoverageComment:"ts-node packaging/updateCoverage",start:"yarn run isMac && yarn run kill; ts-node-dev --no-deps --files main --debug","start-win":"ts-node-dev --no-deps --files main --debug",tessa:"tessa-npm-plugin update --yarn","tessa-plugin-pr":"tessa-npm-plugin check --errorOnNewVulnerability --yarn",kill:'pkill -f ".*CCXProcess.app/Contents/MacOS/../js/main.js$"',build:"ts-node --files packaging/build.ts compile",package:"ts-node --files packaging/build.ts hyperdrive",jira:"node packaging/jiraRestApi",preinstall:"node packaging/credentials",isMac:"node -p \"if (process.platform == 'darwin') { process.exit(0); } else { process.exit(-1); }\""},cepPanels:[{NOTE:"REMOVING START 2.7 from the CCXPROCESS WILL CAUSE LEARN TAB TO GO MISSING IN FRESH INSTALLS OF CC 2019 APPS. ALSO DISABLE YBR NON 2.5 COMPATIBLE CAMPAIGNS BEFORE THIS",product:"CCX Start",subproduct:"Extension",version:"2.7.2",certification:"Product Team Only",destination:"com.adobe.ccx.start-2.7.2",name:"com.adobe.ccx.start"},{product:"CCX Start",subproduct:"Extension",version:"2.13.0",certification:"Not Tested",destination:"com.adobe.ccx.start-2.13.0",name:"com.adobe.ccx.start"},{product:"CCX Start",subproduct:"CmdN",version:"3.3.0",certification:"Not Tested",destination:"com.adobe.ccx.fnft-3.3.0",name:"com.adobe.ccx.fnft"}],"UNINSTALLATION INSTRUCTIONS":{STEPS:"NAME THE KEY uninstall to uninstall extensions. The contents of the key add  an array objects each with a destination folder name and isCEP which is true if this is a CEP extension and false if this is a UXP extension.",SAMPLE:{uninstall:[{COMMENT:"The provided destination folder(com.adobe.ccx.start-2.6.1) in the CEP or UXP (CEP in this case) extension is deleted",destination:"com.adobe.ccx.start-2.6.1",isCEP:!0}]}},"uninstall-example":[{COMMENT:"Start 2.6 is really old. Forget about it please.",destination:"com.adobe.ccx.start-2.6.1",isCEP:!0},{destination:"com.adobe.ccx.fnft-2.5.1",isCEP:!0},{destination:"com.adobe.ccx.start.uxp-2019"}],uxpPanels:[{product:"CCX Start",subproduct:"HomeScreenUXP",version:"3.6.0",certification:"Not Tested",destination:"com.adobe.ccx.start-3.6.0",name:"com.adobe.ccx.start.{{build}}"}],thor:[{product:"ACCC",subproduct:"Application",version:"5.0",certification:"Release Candidate",name:"ACCCx5_0_0_{{build}}",volume:"Creative Cloud",build:"^\\d+$"},{product:"ACCC",subproduct:"HDSetup",version:"5.0",certification:"Release Candidate",name:"HDSetup",volume:"Release"}],resolutions:{"ffi-napi":"2.4.7","ref-napi":"1.4.2",xml2js:"0.4.23"},husky:{hooks:{"pre-commit":"pretty-quick --staged"}}}},function(t,e){t.exports=require("@ccx/node-ngl")},,function(t,e){t.exports=require("https")},function(t,e,a){"use strict";a.r(e),a.d(e,"Avatar",function(){return T});var s=a(4),r=a(29),i=a.n(r),n=a(16),o=a(17),c=a(0),l=a(5),d=a(11),u=a(6),p=a(1);function _(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,s)}return a}function h(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?_(Object(a),!0).forEach(function(e){f(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):_(Object(a)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}function f(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}const g=864e5;class E extends o.default{constructor(){super("AVATAR")}}class T{constructor(){f(this,"downloadManager",void 0),f(this,"log",void 0),f(this,"loaded",!1),f(this,"loading",!1),this.downloadManager=new E,this.log=new d.default({prefix:"Avatar > ",payload:{"event.subcategory":c.default.analytics.sc_AVATAR,"event.subtype":c.default.analytics.st_NETWORK}}),s.default.on("SIGN_IN",()=>{this.init()})}async init(t=!1){const[e,a]=await Promise.all([this.getRemoteAvatar(),this.getCachedAvatar()]),r=this.getFileName(a.path)!==this.getFileName(e.url),i=a.expiry<Date.now();if((t||r||i)&&e.url){this.loading=!0;const t=await this.downloadAvatar(e);c.default.set("avatar",h({},t,{expiry:g+Date.now()}),s.default.getUserId()),this.loading=!1}this.loaded=!0,setTimeout(()=>this.init(!0),g)}async getAvatar(){this.loaded||this.loading||this.init();let t=0;for(;!this.loaded&&t<3e5;)t+=500,await p.default.setTimeoutAsync(500);return c.default.get("avatar",s.default.getUserId())}getFileName(t){const e=t?t.split("/").pop():"";return(e?e.split("?")[0]:"")||null}async getRemoteAvatar(){try{const t=await s.default.getAccessToken(),e=await i()(T.profileUrl,{headers:{Authorization:`Bearer ${t}`}});return{url:(await e.json()).user.avatar,path:""}}catch(t){return this.log.error(t),{url:"",path:""}}}async getCachedAvatar(){const t=c.default.get("avatar",s.default.getUserId());return t&&await l.pathExists(t.path)?t:{url:"",path:""}}async downloadAvatar(t){try{const{url:e}=t,a=s.default.getUserId().split("@")[0],{response:r}=await this.downloadManager.get({url:e,priority:new u.Priority,id:a}),i=`${c.default.get("ROOT_DIR")}${this.getFileName(e)}`;return await n.default.writeAtomic({stream:r.body,target:i,url:e}),h({},t,{path:i})}catch(e){return this.log.error(e),t}}static get profileUrl(){return c.default.isStagingRedirectInEffect()?c.default.get("PROFILE_URL_STAGING"):c.default.get("PROFILE_URL")}}const y=new T;e.default=y},function(t,e){t.exports=require("jsonschema")},function(t,e){t.exports=require("dns")},function(t,e){t.exports=require("fs-ext")},function(t,e){t.exports=require("mime")},function(t,e){t.exports=require("ffi-napi")},function(t,e){t.exports=require("simple-plist")},function(t,e,a){t.exports=a(42)},function(t,e,a){const s=a(43).Module,r=s._nodeModulePaths.bind(s);s._nodeModulePaths=(t=>r(t).filter(t=>t.startsWith(__dirname)));const i=a(44);t.exports=(new i).init()},function(t,e){t.exports=require("module")},function(t,e,a){const s=a(0).default,r=a(1).default,i=a(11).default,n=a(4).default,o=a(16).default,c=a(3).default,l=a(3).BackOffType,d=a(48).default,u=a(19),p=a(51),_=a(64).default,h=a(62).default,f=a(63).default,g=a(53),E=a(57),T=a(12).default,y=a(13).default,S=a(17).default,O=a(6).PriorityLevels,I=a(2).default,A=(a(26).default,a(34).default),C=(a(5),a(9),a(10),a(58),a(27)),m=a(59),N=a(65).default;t.exports=class{constructor(){i.init(),this.log=new i({prefix:"Main > ",payload:{"event.subcategory":s.analytics.sc_PROCESS,"event.subtype":s.analytics.st_PROCESS}}),m.setFlagsFromString("--max_old_space_size=100"),this.stockLookupMap=new g,this.firstMileLookupMap=new _,this.learnLookupMap=new h,this.maps=[this.firstMileLookupMap,this.stockLookupMap,this.learnLookupMap,new f],this.lastKnownCredentials={},this.serviceInterface=new E(this.maps)}exec(t,e){return new Promise((a,s)=>C.exec(t,e,(t,e)=>t?s(t):a(e)))}async sync(t=this.maps,e={type:"none"}){n.getUserId()&&await r.waitAll(t.map(async t=>{await t.sync(e).catch(e=>{this.log.disk(e,`Failed to sync ${t.type}`)})}))}async updateLookupMapWithInstalledApps(){await r.waitAll(this.maps.map(async t=>{const e=await d.getMissingProductList(t);await r.waitAll(t.updateParams(e).map(async e=>await t.addNewCollectionData({params:e}))),(await d.getExcessProductList(t.getCachedRequestData())).forEach(e=>{t.clearCollectionInfo(e)})}))}setProxyCredentials(t,e){t&&this.lastKnownCredentials.user!==t&&this.lastKnownCredentials.password!==e&&(this.lastKnownCredentials={user:t,password:e},u.setProxyCredentials(t,e),this.sync())}setUserAnalyticsFlag(t){T.enable(t)}prefetchData(){if(!n.getUserId())return;const t=r.getClientsThatNeedRefresh(this.firstMileLookupMap);Object.keys(t).forEach(e=>{t[e].forEach(t=>{const a=JSON.parse(JSON.stringify(t));a.ccxVersion=s.get("START_VERSION",e),delete a.radarSessionGUID,delete a.requestId,this.firstMileLookupMap.isRequestPoisoned(a)||this.firstMileLookupMap.addNewCollectionData({params:a}).catch(t=>this.log.context({params:a}).disk(t,"Error pre-fetching"))})})}async addProductInfoToLookup(t,e){await r.waitAll(this.maps.map(async a=>{const i=s.get("SUPPORTED_PRODUCTS",a.type);i[t.productCode]&&1!==r.compareMajorMinorVersions(t.productVersion,i[t.productCode])&&await r.waitAll(a.updateParams([t]).map(async s=>{await a.addNewCollectionData({params:s,priorityLevel:e}).catch(e=>{this.log.context({params:t}).disk(e,`Error adding new ${a.type} product`)})}))}))}async forceRefresh(t,e){const a=new i({prefix:"Force Refresh > ",payload:{"event.workflow":s.analytics.w_NOTIFICATION,"event.subcategory":s.analytics.sc_FORCE_REFRESH}});if(r.validateDataFields(e,s.get("FORCE_REFRESH_SCHEMA"))){const t=new I(T.DATA_VALIDATION_ERR,`Invalid data: ${JSON.stringify(e)}`);throw a.error(t),t}try{const{expire:r={},force:i={type:"stale"}}=e,o=Object.keys(r).filter(t=>!!this.maps.find(e=>e.type===t)),d=this.maps.filter(t=>o.includes(t.type));if(d.length<1)return;c.updateBackOff({clear:!0,type:l.NETWORK,sync:!1}),c.updateBackOff({clear:!0,type:l.AUTH,sync:!1}),a.context({payload:{"event.subtype":s.analytics.st_RECEIVED,"event.value":o.join(", ")}}).info(s.analytics.t_REQUEST),await Promise.all(d.map(async e=>{const a=[];return t&&a.push(e.setLastTimeOfNotification(t)),!0===r[e.type]?await e.expireAll(n.getUserId()):((r[e.type]||[]).forEach(t=>{"PHSP"===t.productCode&&(t.productCode="PHXS"),a.push(e.forceRefresh(t))}),await Promise.all(a))})),await this.sync(d,i),a.context({payload:{"event.subtype":s.analytics.st_FINISHED,"event.value":o.join(", ")}}).info(s.analytics.t_REQUEST)}catch(t){a.error(t)}}async registerNotifications(){if(this.log.info(s.analytics.t_START),n.on("SIGN_OUT",()=>this.setUserAnalyticsFlag(!1)),y.on(y.ONLINE,r.throttle(()=>{this.log.disk("Network status back to online."),c.updateBackOff({clear:!0,type:l.NETWORK}),this.sync()},s.get("ONLINE_SYNC_THROTTLE"))),c.on(c.SYNC,r.throttle(()=>{this.log.disk("Global backoff over, syncing data."),this.sync()},s.get("GLOBAL_BACKOFF_SYNC_THROTTLE"))),n.on("SIGN_IN",()=>{n.getUserId(),p.getUserAnalyticsEnabledFlag().then(({enabled:t})=>{this.setUserAnalyticsFlag(t)}),this.sync(),this.updateLookupMapWithInstalledApps(),this.prefetchData()}),p.addListener(p.events.PROXY_SETTINGS_CHANGED,(t,e)=>{this.setProxyCredentials(t,e)}),p.addListener(p.events.FORCE_REFRESH,(t,e)=>{this.forceRefresh(t,e)}),p.addListener(p.events.PROFILE_UPDATED,async t=>{t&&await this.firstMileLookupMap.setLastTimeOfNotification(t),await this.sync([this.firstMileLookupMap],{type:"always"})}),p.addListener(p.events.SUBSCRIPTION_STATUS_CHANGED,async t=>{t&&(await this.firstMileLookupMap.setLastTimeOfNotification(t),await this.stockLookupMap.setLastTimeOfNotification(t)),await this.sync([this.firstMileLookupMap])}),p.addListener(p.events.UPDATE_STOCK,async t=>{t&&await this.stockLookupMap.setLastTimeOfNotification(t),await this.sync([this.stockLookupMap],{type:"always"})}),p.addListener(p.events.INSTALL_APPLICATION,t=>{this.log.context({params:t}).disk("Handle installApplication"),this.addProductInfoToLookup(t,O.Installation)}),p.addListener(p.events.UPDATE_APPLICATION,t=>{this.log.context({params:t}).disk("Handle updateApplication event"),this.addProductInfoToLookup(t,O.Installation)}),p.addListener(p.events.UNINSTALL_APPLICATION,t=>{this.log.context({params:t}).disk("Handle uninstallApplication event"),this.maps.forEach(e=>e.clearCollectionInfo(t))}),u.addListener("change",async t=>{if(t){const{user:t,password:e}=await p.getProxyCredentials();this.setProxyCredentials(t,e)}}),p.registerANSNotifications(),n.getUserId()){const t=this.maps.map(t=>t.getLastTimeOfNotification());p.checkForMissedNotifications(t[0],t[1],Math.max(...t))}}async onLoadHouseKeeping(){await o.obtainProcessLock("lockfile").catch(t=>{"EAGAIN"===t.code||"EWOULDBLOCK"===t.code?this.log.disk("Unable to get lock. Process is already running"):this.log.error(t,"Failed to get Lockfile."),process.exit(1)}),this.log.info(s.analytics.t_INIT),Error.stackTraceLimit=1/0,process.on("uncaughtException",t=>this.log.error(t,"Uncaught Exception")),process.on("unhandledRejection",t=>this.log.error(t,"Uncaught Promise Rejection"))}preventQuitting(){setTimeout(this.preventQuitting.bind(this),999999)}async initNetwork(){await S.requestLock.write(async()=>{await u.init();const{user:t,password:e}=await p.getProxyCredentials();this.setProxyCredentials(t,e)})}async init(){this.log.disk("-------------------------Startup------------------------------"),this.log.disk(`Build version is ${r.getProcessVersion()}, Environment: ${s.getEnvironment().LABEL}`),await N.isKillSwitchEnabled((t,e)=>{t&&"ENOENT"!==t.code&&this.log.error(new I("Failed to enable admin download blocking.",t)),e&&this.log.disk(`Successfully updated admin settings: ${JSON.stringify(e)}`)}),await this.onLoadHouseKeeping(),await y.check();for(const t of this.maps)await t.load().catch(e=>this.log.error(new I(`Failed to load lookup map ${t.type}`,e)));const t=this.initNetwork();await n.init(),this.serviceInterface.init(),await this.registerNotifications().catch(t=>{this.log.error(new I("Failed to register for notifications",t))}),await this.updateLookupMapWithInstalledApps().catch(t=>{this.log.error(new I("Failed to update lookup map on launch",t))});const{enabled:e}=await p.getUserAnalyticsEnabledFlag().catch(t=>{this.log.error(new I("Could not enable analytics",t))});return this.setUserAnalyticsFlag(e),A.init(),this.prefetchData(),await this.sync().catch(t=>{this.log.error(new I("Launch sync failed",t))}),this.preventQuitting(),await t.catch(t=>{this.log.error(new I("Failed to initialize network",t))}),this}}},function(t,e){t.exports=require("http")},function(t,e){t.exports=require("@ccx/node-ProxyResolver")},function(t,e){t.exports=require("ingest")},function(t,e,a){"use strict";a.r(e),a.d(e,"default",function(){return o});var s=a(0),r=a(11),i=a(1);const n=a(26).default;class o{static async getMissingProductList(t){const e=t.getCachedRequestData(),a=new r.default({prefix:`LookupMapUtils > ${t.type}`}),o=s.default.get("SUPPORTED_PRODUCTS",t.type),c=[];return await Promise.all((await n.getSpecifiers()).map(async t=>{const s=i.default.getProductAlias(t),[r,l]=await Promise.all([n.getAppVersion(t),n.getAppLanguage(t)]);s&&o[s]&&i.default.compareMajorMinorVersions(o[s],r)>-1&&(e[s]&&(e[s][r]||e[s][`${r}.0`])||(a.disk("App NOT found, Adding : ",s,r,l),c.push({productCode:s,productVersion:r,productLanguage:l})))})),c}static async getExcessProductList(t){const e=[];Object.values(t).forEach(t=>{Object.values(t).forEach(t=>{e.push(...t)})});const a=await n.getSpecifiers(),s=await Promise.all(a.map(async t=>{const e=i.default.getProductAlias(t),a=await n.getAppVersion(t);return e&&a?{productCode:e,productVersion:a}:{}}));return e.filter(t=>!s.find(e=>e.productCode===t.productCode&&(e.productVersion===t.productVersion||t.productVersion===e.productVersion+".0")))}}},function(t,e){t.exports=require("@ccx/node-aid")},function(t,e){t.exports=require("node-vulcanjs")},function(t,e,a){const s=a(8),r=a(22),i=a(26).default,n=a(0).default,o=a(14),c=a(11).default,l=a(2).default,d=a(12).default,u=a(4).default,p=a(1).default,_="com.adobe.aam.AAMIMSStatus",h="com.adobe.aam.AAMSIGNOUTStatus",f="accc.app.ProxySettingsRequest",g="accc.app.ProxySettingsResponse",E="any.accc.app.ProxySettingsChanged",T="accc.localapps.panel.refresh.ssoevent",y="any.accc.app.UserContextData",S="accc.app.UserContextDataRequest",O="adbproduct.app.UserContextDataResponse",I="any.accc.app.ProductDeploymentEvent",A='<?xml version="1.0" encoding="utf-8"?><request><type>accc.app.ProxySettingsRequest</type><request_id>{{uuid}}</request_id></request>',C='<?xml version="1.0" encoding="utf-8"?><NEMessage action="RegisterObserver"><type>{{NOTIFICATION_TYPE}}</type><sub-type>{{NOTIFICATION_SUB_TYPE}}</sub-type><observer-namespace>{{observer-namespace}}</observer-namespace></NEMessage>',m='<?xml version="1.0" encoding="utf-8"?><NEMessage action="GetDataByTime"><timestamp>{{TIME_STAMP}}</timestamp><type>{{NOTIFICATION_TYPE}}</type><notifications-count-limit>{{NOTIFICATION_COUNT}}</notifications-count-limit><request-context>{{uuid}}</request-context><requestor-namespace>{{requestor-namespace}}</requestor-namespace></NEMessage>',N='<?xml version="1.0" encoding="utf-8"?><NEMessage action="GetDataByID"><notification-ids>{{NOTIFICATION_IDS}}</notification-ids><request-context>{{uuid}}</request-context><requestor-namespace>{{requestor-namespace}}</requestor-namespace></NEMessage>',R='<?xml version= "1.0" encoding= "utf-8"?><request><request-id>{{uuid}}</request-id></request>',P=new r.Parser;class L extends o{constructor(){super(),this.log=new c({prefix:"CCNotifications > ",payload:{"event.subcategory":n.analytics.sc_PROCESS,"event.subtype":n.analytics.st_ANS}}),this.events={SIGN_IN:"signIn",SIGN_OUT:"signOut",PROXY_SETTINGS_CHANGED:"proxySettingsChanged",PROFILE_UPDATED:"profileUpdated",INSTALL_APPLICATION:"installApplication",UNINSTALL_APPLICATION:"uninstallApplication",UPDATE_APPLICATION:"updateApplication",SUBSCRIPTION_STATUS_CHANGED:"subscriptionStatusChanged",UPDATE_STOCK:"updateStock",UPDATE_APPLICATION_COMPONENTS:"updateApplicationComponents",USER_ANALYTICS_CHANGED:"userAnalyticsChanged",FORCE_REFRESH:"forceRefresh"},this.addListeners()}getMessageValue(t,e){let a=null;if(t){const s=new RegExp(`<${e}[^<>]*>([^<>]*)</${e}>`,""),r=t.match(s);a=r&&r[1]}return a}constructMessage(t,e){let a=t;return Object.keys(e).forEach(t=>{a=a.replace(t,e[t])}),a}normalizeProductCode(t){return p.getProductAlias(t)}addListeners(){i.addListener(T,t=>{const e=this.getMessageValue(t,"event_type");this.log.disk(`ACCC Sign-on State: ${e}`),"signin_success"===e?this.emit(this.events.SIGN_IN):"signout_success"===e&&this.emit(this.events.SIGN_OUT)}),i.addListener("accc.any.NoListenerAvailable",t=>{this.log.error(`No Listener Available: ${t}`)}),i.addListener(_,t=>{const e=this.getMessageValue(t,"Status");this.log.disk(`AAM Sign-on State: ${e}`),"USER_AUTH_SUCCESS"===e&&this.emit(this.events.SIGN_IN)}),i.addListener(h,t=>{this.emit(this.events.SIGN_OUT),this.log.disk("AAM Sign-on State: signOut")}),i.addListener(y,t=>{const e=n.get("USER_ANALYTICS_ENABLED",u.getUserId())||!1;if(!t)return this.log.error(new l(n.analytics.PARSE_MSG_FAIL,"Fail to receive user analytics message on sign in")),void d.enable(e);P.parseString(t,(t,a)=>{if(t||!a)return this.log.error(new l(n.analytics.PARSE_MSG_FAIL,`Fail to parse user analytics flag on update, err=${t}`)),void d.enable(e);if(a.response&&a.response.error)return this.log.error(new l(n.analytics.PARSE_MSG_FAIL,`Error in user analytics flag on update, err=${JSON.stringify(a.response.error)}`)),void d.enable(e);const s=a["feature-response"]&&a["feature-response"]["feature-entry"]&&a["feature-response"]["feature-entry"].find((t,e)=>"com.adobe.oobe.acc.v1.piip.user.status"===t.$.id);if(s&&s.$){this.log.disk(`GetUserAnalyticsFlag - Successfully updated user analytics enabled flag: ${s.$.state}`);const t="OptedIn"===s.$.state;return d.enable(t),void n.set(u.getUserId(),t,"USER_ANALYTICS_ENABLED")}return this.log.error(new l(n.analytics.PARSE_MSG_FAIL,`Fail to parse userAnalyticsStatus, userAnalyticsStatus=${s}`)),void d.enable(e)})}),i.addListener(E,t=>{const e=this.getMessageValue(t,"proxyuser"),a=this.getMessageValue(t,"proxypassword");null!==e&&null!==a&&this.emit(this.events.PROXY_SETTINGS_CHANGED,e,a)}),i.addListener(I,t=>{const e={productCode:this.getMessageValue(t,"productCode"),productVersion:this.getMessageValue(t,"productVersion"),productLanguage:this.getMessageValue(t,"productLanguage"),countryCode:this.getMessageValue(t,"countryCode"),subscriptionStatus:this.getMessageValue(t,"subscriptionStatus")};if(e.productCode=this.normalizeProductCode(e.productCode),n.get("PRODUCT_LIST").includes(e.productCode))switch(this.getMessageValue(t,"eventType")){case"Install":case"Install-Start":case"Install-Progress":this.emit(this.events.INSTALL_APPLICATION,e);break;case"Uninstall":this.emit(this.events.UNINSTALL_APPLICATION,e);break;case"Update":case"Update-Start":case"Update-Progress":this.emit(this.events.UPDATE_APPLICATION,e);break;case"UpdateComponents":0!==L.listenerCount(this.events.UPDATE_APPLICATION_COMPONENTS)&&(e.productID=this.getMessageValue(t,"productID"),this.emit(this.events.UPDATE_APPLICATION_COMPONENTS,e))}}),i.addListener(n.get("NOTIFICATION_PSDK_RESPONSE"),t=>{this.handleNotificationResponse(t,n.get("ANS_PSDK_NOTIFICATION_TYPE"),n.get("NOTIFICATION_PSDK_QUERY_DATA_BY_ID_RESPONSE"))}),i.addListener(n.get("NOTIFICATION_STOCK_RESPONSE"),t=>{this.handleNotificationResponse(t,n.get("ANS_STOCK_NOTIFICATION_TYPE"),n.get("NOTIFICATION_STOCK_QUERY_DATA_BY_ID_RESPONSE"))}),i.addListener(n.get("NOTIFICATION_FORCE_REFRESH_RESPONSE"),t=>{this.handleNotificationResponse(t,n.get("ANS_FORCE_REFRESH_NOTIFICATION_TYPE"),n.get("ANS_FORCE_REFRESH_NOTIFICATION_SUB_TYPE"))}),i.addListener(n.get("NOTIFICATION_FORCE_REFRESH_RESPONSE"),t=>{this.handleNotificationResponse(t,n.get("ANS_NUJ_REFRESH_NOTIFICATION_TYPE"),n.get("ANS_NUJ_REFRESH_NOTIFICATION_SUB_TYPE"))})}_handlePayload(t,e){const a={},s=(t,e,s)=>{if(t===n.get("ANS_PSDK_NOTIFICATION_TYPE")&&e===n.get("ANS_PSDK_NOTIFICATION_SUB_TYPE")){let r;this.log.disk(`Handle ANS message: type=${t}, subtype=${e}, payload=${s}`);try{r=s&&JSON.parse(s)}catch(t){return this.log.error(new Error(n.analytics.PAYLOAD_PARSE_FAIL,`Fail to parse payload: ${s}`))}switch(r&&r.eventType){case"HVA_COMMUNICATION":case"HVA_COMPLETED":case"SEGMENT_CHANGE":case"EXPERIENCE_CHANGE":case"APS_COMMUNICATION":case"APPLAUNCH_BUCKET_CHANGE":case"PERSONA_SEGMENT_CHANGE":case"ENTITLEMENT_CHANGE":case"ENGAGEMENT_CLICK_EVENT":a.profileUpdated=!0;break;case"MEMBERSHIP_CHANGE":a.subscriptionStatusChanged=!0}}else if(t===n.get("ANS_STOCK_NOTIFICATION_TYPE")&&e===n.get("ANS_STOCK_NOTIFICATION_SUB_TYPE"))a.updateStock=!0;else if(t===n.get("ANS_FORCE_REFRESH_NOTIFICATION_TYPE")&&e===n.get("ANS_FORCE_REFRESH_NOTIFICATION_SUB_TYPE"))try{const r=JSON.parse(s).payload;a[this.events.FORCE_REFRESH]=JSON.parse(r)}catch(a){this.log.error(new l(n.analytics.UNEXPECTED_ANS_MSG,`Unable to parse ANS message payload, type=${t}, subType=${e}, payload=${s}`))}else if(t===n.get("ANS_NUJ_REFRESH_NOTIFICATION_TYPE")&&e===n.get("ANS_NUJ_REFRESH_NOTIFICATION_SUB_TYPE"))try{a[this.events.FORCE_REFRESH]=JSON.parse(s[0])}catch(a){this.log.error(new l(n.analytics.UNEXPECTED_ANS_MSG,`Unable to parse ANS message payload, type=${t}, subType=${e}, payload=${s}`))}else this.log.error(new l(n.analytics.UNEXPECTED_ANS_MSG,`Received unexpected ANS message, type=${t}, subType=${e}`))};P.parseString(t,(t,r)=>{if(t)return void this.log.error(t,"Fail to parse message");const i=r["notification-error"];if(i){const t=i.error&&i.error[0],e=t&&t.$&&t.$.desc||"Unknown notification error";return void this.log.disk(e)}const n=r&&r.notifications&&r.notifications.notification||[];let o;this.log.disk(`Received ${n.length} ANS notifications.`),n.forEach(t=>{const a=t.type[0],r=t["sub-type"][0],i=parseInt(t.timestamp[0],10),n=t.payload;(!e||i>e)&&(o=!o||i>o?i:o,s(a,r,n))}),Object.keys(a).forEach(t=>{this.emit(t,o||(new Date).getTime(),a[t]||null)})})}_queryANSNotificationsByTime(t,e,a,r){const o=s.v4();let c;const l=t=>{clearTimeout(c),i.removeListener(e,l),a(null,t)};i.addListener(e,l);const d={"{{TIME_STAMP}}":(new Date).getTime(),"{{NOTIFICATION_TYPE}}":t,"{{NOTIFICATION_COUNT}}":"10","{{uuid}}":o,"{{requestor-namespace}}":e};r&&(d["{{NOTIFNOTIFICATION_SUB_TYPE}}"]=r),i.sendMessage(n.get("NOTIFICATION_REQUEST"),this.constructMessage(m,d),"ADCS",""),c=setTimeout(()=>{i.removeListener(e,l),a(new Error("GetNotificationDataByTime timeout"))},n.get("GET_NOTIFICATION_DATA_TIMEOUT"))}getUserAnalyticsEnabledFlag(){return new Promise(t=>{let e,a;const r=n.get("USER_ANALYTICS_ENABLED",u.getUserId())||!1,o=s=>{if(i.removeListener(O,o),clearTimeout(e),!s)return this.log.error(new l(n.analytics.PARSE_MSG_FAIL,"Fail to receive user analytics message on sign in.")),void t({enabled:r});P.parseString(s,(e,s)=>{if(e||!s)return this.log.error(new l(n.analytics.PARSE_MSG_FAIL,`Fail to receive user analytics flag on sign in, err=${e}`)),void t({enabled:r});if(s.response&&s.response.error){const e=s.response.error;return e[0]&&"SignInPending"===e[0].$.id?(this.log.disk("User sign in pending. Analytics flag not received yet."),void t({enabled:r})):(this.log.error(new l(n.analytics.PARSE_MSG_FAIL,`Fail to parse user analytics flag on sign in, err=${JSON.stringify(s.response.error)}`)),void t({enabled:r}))}{const e=s.response&&s.response.UserfeatureXML&&s.response.UserfeatureXML[0];P.parseString(e,(e,s)=>{if(e||!s)return this.log.error(new l(n.analytics.PARSE_MSG_FAIL,`Fail to parse UserfeatureXML, err=${e}`)),void t({enabled:r});if((a=s["feature-response"]&&s["feature-response"]["feature-entry"]&&s["feature-response"]["feature-entry"].find((t,e)=>t&&t.$&&"com.adobe.oobe.acc.v1.piip.user.status"===t.$.id))&&a.$){this.log.disk(`GetUserAnalyticsFlag - Successfully obtained user analytics enabled flag: ${a.$.state}`);const e="OptedIn"===a.$.state;return t({enabled:e}),void n.set(u.getUserId(),e,"USER_ANALYTICS_ENABLED")}return this.log.error(new l(n.analytics.PARSE_MSG_FAIL,`Fail to parse userAnalyticsStatus, userAnalyticsStatus=${a}`)),void t({enabled:r})})}})};i.addListener(O,o),i.sendMessage(S,this.constructMessage(R,{"{{uuid}}":s.v4()}),"ADCS",""),e=setTimeout(()=>{i.removeListener(O,o),this.log.disk("GetUserAnalyticsFlag - Error: timed out getting user analytics enabled flag"),t({enabled:r})},n.get("USER_ANALYTICS__REQUEST_TIMEOUT"))})}getProxyCredentials(){return new Promise(t=>{let e;const a=s=>{i.removeListener(g,a),clearTimeout(e);const r=this.getMessageValue(s,"proxyuser"),n=this.getMessageValue(s,"proxypassword");this.log.disk("GetProxySettings - Successfully obtained username/password"),t({user:r,password:n})};i.addListener(g,a),i.sendMessage(f,this.constructMessage(A,{"{{uuid}}":s.v4()}),"ADCS",""),e=setTimeout(()=>{i.removeListener(g,a),this.log.disk("GetProxySettings - Error: timed out getting proxy settings"),t({})},n.get("PROXY_REQUEST_TIMEOUT"))})}registerANSNotifications(){[{"{{NOTIFICATION_TYPE}}":n.get("ANS_PSDK_NOTIFICATION_TYPE"),"{{NOTIFICATION_SUB_TYPE}}":n.get("ANS_PSDK_NOTIFICATION_SUB_TYPE"),"{{observer-namespace}}":n.get("NOTIFICATION_PSDK_RESPONSE")},{"{{NOTIFICATION_TYPE}}":n.get("ANS_STOCK_NOTIFICATION_TYPE"),"{{NOTIFICATION_SUB_TYPE}}":n.get("ANS_STOCK_NOTIFICATION_SUB_TYPE"),"{{observer-namespace}}":n.get("NOTIFICATION_STOCK_RESPONSE")},{"{{NOTIFICATION_TYPE}}":n.get("ANS_FORCE_REFRESH_NOTIFICATION_TYPE"),"{{NOTIFICATION_SUB_TYPE}}":n.get("ANS_FORCE_REFRESH_NOTIFICATION_SUB_TYPE"),"{{observer-namespace}}":n.get("NOTIFICATION_FORCE_REFRESH_RESPONSE")},{"{{NOTIFICATION_TYPE}}":n.get("ANS_NUJ_REFRESH_NOTIFICATION_TYPE"),"{{NOTIFICATION_SUB_TYPE}}":n.get("ANS_NUJ_REFRESH_NOTIFICATION_SUB_TYPE"),"{{observer-namespace}}":n.get("NOTIFICATION_FORCE_REFRESH_RESPONSE")}].forEach(t=>{i.sendMessage(n.get("NOTIFICATION_REQUEST"),this.constructMessage(C,t),"ADCS","")})}getNotificationDataByIDs(t,e,a,r){if(0===Object.keys(t).length)return void r(new Error("No notification id"));let o;const c=s.v4(),d=t=>{i.removeListener(a,d),clearTimeout(o),r(null,t)};i.addListener(a,d);let u="";Object.keys(t).forEach(t=>{u+=`<notification-id>${t}</notification-id>`});const p={"{{NOTIFICATION_TYPE}}":e,"{{NOTIFICATION_IDS}}":u,"{{uuid}}":c,"{{requestor-namespace}}":a};i.sendMessage(n.get("NOTIFICATION_REQUEST"),this.constructMessage(N,p),"ADCS",""),o=setTimeout(()=>{i.removeListener(a,d);const t=new l(n.analytics.GET_NOTIFICATION_DATA,"GetNotificationDataByID - Error: timed out getting notification data");this.log.error(t),r(t)},n.get("GET_NOTIFICATION_DATA_TIMEOUT"))}handleNotificationResponse(t,e,a){const s={};P.parseString(t,(r,i)=>{if(r)return void this.log.error(new l(n.analytics.PARSE_MSG_FAIL,`Fail to parse message, message=${t}`));const o=i&&i["notifications-signal"],c=o&&o["notification-signal"];(c&&c[0]&&c[0]["notification-info"]||[]).forEach(t=>{const e=t&&t["notification-ids"]&&t["notification-ids"][0];(e&&e["notification-id"]||[]).forEach(t=>{s[t]=!0})}),this.getNotificationDataByIDs(s,e,a,(t,e)=>{t?this.log.disk(t):this._handlePayload(e)})})}checkForMissedNotifications(t,e,a){[{type:n.get("ANS_PSDK_NOTIFICATION_TYPE"),requestNamespace:n.get("NOTIFICATION_PSDK_QUERY_DATA_BY_TIME_RESPONSE"),lastTimeOfNotification:t},{type:n.get("ANS_STOCK_NOTIFICATION_TYPE"),requestNamespace:n.get("NOTIFICATION_STOCK_QUERY_DATA_BY_TIME_RESPONSE"),lastTimeOfNotification:e},{type:n.get("ANS_FORCE_REFRESH_NOTIFICATION_TYPE"),subtype:n.get("ANS_FORCE_REFRESH_NOTIFICATION_SUB_TYPE"),requestNamespace:n.get("NOTIFICATION_FORCE_REFRESH_QUERY_DATA_BY_TIME_RESPONSE"),lastTimeOfNotification:a},{type:n.get("ANS_NUJ_REFRESH_NOTIFICATION_TYPE"),subtype:n.get("ANS_NUJ_REFRESH_NOTIFICATION_SUB_TYPE"),requestNamespace:n.get("NOTIFICATION_FORCE_REFRESH_QUERY_DATA_BY_TIME_RESPONSE"),lastTimeOfNotification:a}].forEach(t=>{const e=t.lastTimeOfNotification;this.queryANSNotificationsByTime(t,(t,a)=>{t?this.log.disk(t):this._handlePayload(a,e)})})}queryANSNotificationsByTime(t,e){this._queryANSNotificationsByTime(t.type,t.requestNamespace,e,t.subtype)}}t.exports=new L},function(t,e,a){function s(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,s)}return a}function r(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}const i=a(8),n=a(17).default,o=a(0).default,c=a(1).default,l=a(4).default,d=a(2).default,u=a(15).URL;t.exports=class extends n{_convertSurfaceIdToModeId(t,e){const a=o.get("FIRST_MILE_SURFACE_MODE_MAP",e);return a&&a[t]?a[t]:t}async url(t){const e=o.getEnvironment(),a=new u(o.get(`URL_${e.LABEL.toUpperCase()}`,this.type)),s=o.get("FIRST_MILE_SURFACE_ID",c.ccxVersionToString(t)),r={productCode:t.productCode,productLanguage:t.productLanguage,productVersion:t.productVersion,subscriptionStatus:t.subscriptionStatus,surfaceId:s,ccxVersion:t.ccxVersion};return this.appendUrlSearchParams(a.searchParams,r),a.toString()}additionalAnalytics(t){return{"exp.surface_id":o.get("FIRST_MILE_SURFACE_ID",c.ccxVersionToString(t)).join(", ")}}applyResponseAnalytics(t,e,a){if(t.appendPayload({"exp.response_guid":e.analyticsParams&&e.analyticsParams.responseGUID,"content.type":o.analytics.SOPHIA_CARDS,"content.size":e.cards?e.cards.length:0}),a&&["V2_8","V3_0","V3_1"].includes(c.ccxVersionToString(a))){t.appendPayload({"exp.response_guid":e.analyticsData&&e.analyticsData.responseGUID,"content.size":Object.keys(e.surfaces).length});for(let a in e.surfaces)t.addSurfaceAnalytics([{surface:a}]),Array.isArray(e.surfaces[a].containers)&&t.addSurfaceAnalytics(e.surfaces[a].containers.map(t=>t.containerAnalyticsData))}else e.cardControl&&Array.isArray(e.cardControl)&&e.cardControl.forEach(e=>{Array.isArray(e.containerAnalyticsParams)&&(t.addSurfaceAnalytics(e.containerAnalyticsParams),t.addSurfaceAnalytics([{surface:e.modeID}]))})}async downloadCollectionDataRaw({params:t,priority:e,id:a=i.v4(),skipAuth:n=!1}){const u=await this.url(t),p=await this.log.context({params:t}).time(async t=>{let s={"content-type":"application/json","X-API-Key":o.getEnvironment().CLIENT_ID};const r=!n&&!!await l.getAccessToken().catch(t=>!1);r&&(s["x-gw-ims-user-id"]=l.getUserId());let{response:i,time:c}=await this.get({url:u,options:{method:"GET",timeout:o.get("SERVER_TIMEOUT"),headers:s},priority:e,auth:r,id:a});t.appendPayload({"event.value":c,"event.url":u,"env.svc.name":"Sophia"});const d=Date.now(),p=await this.getResponseJson(i,u);return c+=Date.now()-d,p}),_=o.get("FIRST_MILE_RESPONSE_SCHEMA"),h=c.validateDataFields(p,_);if(h)throw new d(o.analytics.PARAM_VALIDATION_ERR,h);if(["V2_8","V3_0","V3_1"].includes(c.ccxVersionToString(t)))return p.analyticsData&&(p.analyticsData.requestId=a),p.ccxVersion=t.ccxVersion,p.surfaces&&Object.keys(p.surfaces).forEach(t=>{const e=p.surfaces[t];e.containers&&(e.containers=e.containers.map(t=>"application/json"===t.dataType?function(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?s(Object(a),!0).forEach(function(e){r(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):s(Object(a)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}({},t,{content:JSON.parse(t.data)}):t))}),p;const f={cards:[],cardControl:[],expirationDTS:new Date(Math.min(new Date(p.expirationDTS||0),new Date(Date.now()+o.get("MAX_TIMEOUT")))).toISOString(),analyticsParams:{responseGUID:p.analyticsData&&p.analyticsData.responseGUID,requestId:a},ccxVersion:t.ccxVersion};return p.surfaces&&Object.keys(p.surfaces).forEach(e=>{if(!Array.isArray(p.surfaces[e].containers)||0==p.surfaces[e].containers.length)return;const a={modeID:this._convertSurfaceIdToModeId(e,c.ccxVersionToString(t)),cardOrder:[],containerAnalyticsParams:[]};p.surfaces[e].containers.forEach(t=>{t.containerAnalyticsData=t.containerAnalyticsData||{},a.containerAnalyticsParams.push(t.containerAnalyticsData);let s={startDTS:t.startDTS,endDTS:t.endDTS};if("application/json"===t.dataType)try{Object.assign(s,JSON.parse(t.data))}catch(s){this.log.error(new d(o.analytics.PARAM_VALIDATION_ERR,s).setContext(`Error parsing card data for ${e} with analytics ${JSON.stringify(a.containerAnalyticsData)} which was ${t.data}`))}else"URL"===t.dataType?Object.assign(s,{contentURL:t.data}):Object.assign(s,t);f.cards.push(s),a.cardOrder.push(f.cards.length-1)}),f.cardControl.push(a)}),"V2"===c.ccxVersionToString(t)&&f.cards.forEach(t=>{t.backgroundImage&&(t.backgroundImage=t.backgroundImage.replace("730x280","1000x560"))}),f}}},function(t,e,a){a(0).default;const s=a(20).default,r=a(54).default,i=(a(12).default,a(55).default),n=(a(11).default,a(4).default),o=a(56).default;t.exports=class extends s{constructor(){super(o),this._downloadManager=new i("STOCK")}_createCollectionData(t){return new r(t,this)}_getLookupKeys(t,e){t.productVersion&&t.productVersion.split(".")[0];const a=[e||n.getUserId()];return a.push(t.productCode,t.productLanguage),a}async upgrade(t){let e=null;return 1===t.version&&(e={version:2,versionInfo:t.stockTemplates,metadata:t.stockTemplatesCache,assetMetadata:t.assetsCache,usersInfo:t.usersInfo},Object.keys(e.metadata).forEach(t=>{e.metadata[t].params=e.metadata[t].stockParams,delete e.metadata[t].stockParams}),Object.keys(e.versionInfo).forEach(t=>{Object.keys(e.versionInfo[t]).forEach(a=>{const s=e.versionInfo[t][a];e.versionInfo[t][a]={},Object.keys(s).forEach(r=>{Object.keys(s[r]).forEach(i=>{e.versionInfo[t][a][i]=s[r][i];let n=s[r][i];n.latestId=n.paid&&n.paid.latestId||n.trial&&n.trial.latestId,delete n.trial,delete n.paid})})})})),e}}},function(t,e,a){"use strict";a.r(e),a.d(e,"default",function(){return c});var s=a(0),r=a(1),i=a(18);function n(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,s)}return a}function o(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}class c extends i.a{async downloadAsset({asset:t,link:e,priority:a,analytics:s,params:r}){const i=t&&t[e];if(!t||!i||0===i.length)throw new Error("Invalid data");const{path:n,time:o}=await this._lookupMap.fetchAsset({href:i.toString(),assetsDir:this.assetsDir,priority:a,params:r});s&&s.count&&s.time&&(s.time+=o,s.count++),t[e]=n}validateData(t){return r.default.validateDataFields(t,s.default.get("STOCK_TEMPLATES_DATA_SCHEMA"))}get totalItems(){return this._data&&this._data.templates&&this._data.templates.length||0}async syncData({priority:t,payload:e,params:a,progress:s=(()=>{})}){if(!this._data||!this._data.templates)return;let i={count:0,time:0};const c=[],l={started:0,complete:0};this._data.templates.forEach(e=>{l.started++,s(l);let r=0;async function n(){2===++r&&(l.complete++,s(l))}e.thumbnail_url&&0!==e.thumbnail_url.length&&e.thumbnail_url.startsWith("http")&&c.push(this.downloadAsset({asset:e,link:"thumbnail_url",priority:t,analytics:i,params:a}).then(n)),e.previews&&0!==e.previews.length&&e.previews.forEach(e=>{e&&e.url&&e.url.startsWith("http")&&c.push(this.downloadAsset({asset:e,link:"url",priority:t,analytics:i,params:a}).then(n))})}),await this.log.time(async t=>{t.appendPayload(function(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?n(Object(a),!0).forEach(function(e){o(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):n(Object(a)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}({},e,{"event.count":i.count,"event.value":i.time/i.count})),await r.default.waitAll(c)})}async getReferencedAssets(){const t={};return this._data&&this._data.templates&&this._data.templates.forEach(e=>{e&&e.thumbnail_url&&(t[e.thumbnail_url]=!0),e&&e.previews&&e.previews.forEach(e=>{e&&e.url&&(t[e.url]=!0)})}),t}}},function(t,e,a){"use strict";a.r(e),a.d(e,"default",function(){return c});var s=a(0),r=a(8),i=a(15),n=a(17),o=a(4);class c extends n.default{async url(t){const e=s.default.getEnvironment();let a=new i.URL(s.default.get(`URL_${e.LABEL.toUpperCase()}`,this.type));const r={product:t.productCode,locale:t.productLanguage,country_code:t.countryCode,"search_parameters[limit]":`${Math.min(s.default.get("TEMP_STOCK_TEMPLATE_DOWNLOAD_LIMIT"),s.default.get("TEMP_DEFAULT_TEMPLATES_DOWNLOADED",this.type))}`};return this.appendUrlSearchParams(a.searchParams,r),a.toString()}async downloadCollectionDataRaw({params:t,priority:e,id:a=r.v4()}){if(0===s.default.get("TEMP_STOCK_TEMPLATE_DOWNLOAD_LIMIT")){const t=new Date;return t.setDate(t.getDate()+14),{expirationDTS:t.toISOString(),templates:[]}}const i=await this.url(t),{response:n}=await this.get({url:i,options:{timeout:s.default.get("SERVER_TIMEOUT"),headers:{"X-API-Key":s.default.getEnvironment().CLIENT_ID,"X-Product":`${t.productCode}/${t.productVersion}`,"Content-Type":"application/json"}},priority:e,id:a,auth:!!await o.default.getAccessToken().catch(t=>!1)}),c=await this.getResponseJson(n,i);if("number"==typeof c.expirationDTS){const t=new Date(1e3*c.expirationDTS);c.expirationDTS=t.toISOString()}return c}}},function(t,e,a){"use strict";a.r(e);let s={ANALYTICS_SUBCATEGORY:"Stock",LOOKUP_MAP_FILE_VERSION:3,LOOKUP_COLLECTION_FILE_VERSION:1,SUPPORTED_PRODUCTS:{IDSN:"12.0",ILST:"21.0",PHXS:"18.0"},PARAMETERS_SCHEMA:{id:"stock_parameters",type:"object",properties:{productCode:{type:"string"},productVersion:{type:"string"},productLanguage:{type:"string"},countryCode:{type:"string"}},required:["productCode","productVersion","productLanguage","countryCode"]},LOG_PREFIX:"Stock",URL_STAGING:"https://stock-stage.adobe.io/Rest/Media/1/Search/Templates",URL_PRODUCTION:"https://stock.adobe.io/Rest/Media/1/Search/Templates",DIR:"stock/",LABEL:"STOCK",PRIORITY_CHANNEL:a(6).PriorityChannels.Stock,ANONYMOUS_RETRY_DISABLED:!0,DEFAULT_URLS_ENABLED:!1,MINOR_VERSION_SHOULD_UPDATE_CONTENT:!1,TEMP_DEFAULT_TEMPLATES_DOWNLOADED:100};e.default=s},function(t,e,a){function s(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,s)}return a}function r(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?s(Object(a),!0).forEach(function(e){i(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):s(Object(a)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}function i(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}const n=a(9),o=a(10),c=a(5),l=a(8),d=a(4).default,u=a(26).default,p=a(0).default,_=a(11).default,h=a(1).default,f=a(16).default,g=a(12).default,E=a(17).default,T=a(2).default,y=a(6).PriorityLevels,S=(a(24),a(34).default);t.exports=class{constructor(t){this.log=new _({prefix:"ServiceInterface > ",payload:{"event.subtype":g.st_CLIENT}}),this._firstMileLookupMap=t.find(t=>"FIRST_MILE"===t.type),this._stockLookupMap=t.find(t=>"STOCK"===t.type),this._learnLookupMap=t.find(t=>"LEARN"===t.type),this.maps=t}init(){u.addListener(p.get("VULCAN_PING_REQUEST"),(t,e,a)=>{u.sendMessage(p.get("VULCAN_PING_RESPONSE"),"",e,a)}),u.addListener(p.get("VULCAN_AVATAR_REQUEST"),()=>{this.log.context({payload:{"event.subcategory":p.analytics.sc_CCX_START}}).request(async()=>{u.sendMessage(p.get("VULCAN_AVATAR_RESPONSE"),await S.getAvatar())})}),u.addListener(p.get("VULCAN_PSDK_FEED_REQUEST"),async(t,e,a)=>{let s,i,n={};try{n=JSON.parse(t)}catch(e){s=new T(p.analytics.PARAM_VALIDATION_ERR,e).setContext(`Unable to parse PSDK feed data:${t}`)}n.psdkParams=n.psdkParams||{};const o={"event.context_guid":n.radarSessionGUID||l.v4()};i=this.log.context({params:n&&n.psdkParams,payload:r({"event.subcategory":p.analytics.sc_SOPHIA},o)});const c=await i.request(async()=>{if(s)throw s;if(!d.getUserId())throw new Error(p.analytics.SIGNED_OUT);const t=this._firstMileLookupMap,e={requestId:n.requestId,settings:p.get(`${n.psdkParams.productCode}_PSDK`,`SETTINGS_${d.getUserId()}`)||{}};return this._firstMileLookupMap.updateLicenseInformation(n.psdkParams),await t.updateDisplayedId({params:n.psdkParams,displayed:n.psdkParams.displayed}),n.psdkParams.urgent?(delete n.psdkParams.urgent,await t.addNewCollectionData({params:n.psdkParams,payload:o,level:y.UrgentRequest}),e.path=await t.getLatestPath({params:n.psdkParams,updateLastUsedId:!0,updateLastUseTime:!0})):(e.path=await t.getLatestPath({params:n.psdkParams,updateLastUsedId:!0,updateLastUseTime:!0}),e.path||t.addNewCollectionData({params:n.psdkParams,payload:o,level:y.BackgroundRequest})),e.path&&(e.path=e.path.replace(/\\/gi,"/")),e}).catch(t=>({requestId:n.requestId,err:t}));u.sendMessage(p.get("VULCAN_PSDK_FEED_RESPONSE"),c,e,a)}),u.addListener(p.get("VULCAN_LEARN_REQUEST"),async(t,e,a)=>{let s,i,n={};try{n=JSON.parse(t)}catch(e){s=new T(p.analytics.PARAM_VALIDATION_ERR,e).setContext(`Unable to parse Learn feed data:${t}`)}n.params=n.params||{};const o={"event.context_guid":n.radarSessionGUID||l.v4()};i=this.log.context({params:n&&n.params,payload:r({"event.subcategory":p.analytics.sc_LEARN},o)});const c=await i.request(async()=>{if(s)throw s;if(!d.getUserId())throw new T(p.analytics.SIGNED_OUT);const t=this._learnLookupMap,e={requestId:n.requestId};return await t.addNewCollectionData({params:n.params,payload:o,level:y.BackgroundRequest}),e.path=await t.getLatestPath({params:n.params,updateLastUsedId:!0,updateLastUseTime:!1}),e.path&&(e.path=e.path.replace(/\\/gi,"/")),e}).catch(t=>({requestId:n.requestId,err:t}));u.sendMessage(p.get("VULCAN_LEARN_RESPONSE"),c,e,a)}),u.addListener(p.get("VULCAN_LEARN_USAGE_MARKER"),async(t,e,a)=>{const s=this.log.context({payload:{"event.subcategory":p.analytics.sc_LEARN}});try{const e=JSON.parse(t);await this._learnLookupMap.getLatestPath({params:e.params,updateLastUsedId:!1,updateLastUseTime:!0}),s.context({params:e.params,payload:{"event.context_guid":e.radarSessionGUID||l.v4()}}).info(p.analytics.t_UPDATE,"Update last use time")}catch(t){s.error(new T(p.PARAM_VALIDATION_ERR,t),"Error parsing learn usage marker")}}),u.addListener(p.get("VULCAN_GET_USER_REQUEST"),async(t,e,a)=>{const s=this.log.context({payload:{"event.subcategory":p.analytics.sc_CCX_START}});await s.request(async()=>{u.sendMessage(p.get("VULCAN_GET_USER_RESPONSE"),{userId:d.getUserId()},e,a)})}),u.addListener(p.get("VULCAN_START_SETTINGS_REQUEST"),async(t,e,a)=>{let s=null,r=null;try{r=JSON.parse(t)}catch(r){s=new Error(`Unable to parse settings storage request from ${e}(${a}): ${t}`)}const i=this.log.context({params:r,payload:{"event.subcategory":g.sc_CCX_START}});await i.request(async()=>{if(s)throw s;if(!d.getUserId())throw new Error("Discarding start settings storage - not logged in");if(d.getUserId()!==r.userId)throw new Error(`Different user in request(${r.userId}) than the one logged in(${d.getUserId()})`);const t=`${r.productCode}_PSDK`,e=`SETTINGS_${d.getUserId()}`,a=p.get(t,e)||{};Object.keys(r.settings).forEach(t=>{a[t]?Object.assign(a[t],r.settings[t]):a[t]=r.settings[t]}),a.lastModified=(new Date).toISOString(),p.set(t,a,e)}).catch(t=>r=null),r&&u.sendMessage(p.get("VULCAN_START_SETTINGS_PATCH_UPDATE"),{settings:r.settings,userId:r.userId},r.productCode)}),u.addListener(p.get("VULCAN_START_SETTINGS_GET_REQUEST"),async(t,e,a)=>{let s={};const r=this.log.context({params:{productCode:e,productVersion:a},payload:{"event.subcategory":g.sc_CCX_START}});r.info("Start settings get Request");try{s=JSON.parse(t)}catch(s){r.error(new Error(`Unable to parse settings get request from ${e}(${a}): ${t}`))}u.sendMessage(p.get("VULCAN_START_SETTINGS_GET_RESPONSE"),{requestId:s.requestId,userId:d.getUserId(),settings:p.get(`${e}_PSDK`,`SETTINGS_${d.getUserId()}`)||{}},e,a)}),u.addListener(p.get("VULCAN_STOCK_REQUEST"),async(t,e,a)=>{let s,i,n={};try{n=JSON.parse(t)}catch(e){(s=new Error(p.analytics.PARAM_VALIDATION_ERR)).desc=`Unable to parse Stock template request:${t}`}n.stockParams=n.stockParams||{};const o={"event.context_guid":n.radarSessionGUID||l.v4()};i=this.log.context({params:n.stockParams,payload:r({"event.subcategory":p.analytics.sc_STOCK},o)});const c=await i.request(async()=>{if(s)throw s;if(!d.getUserId())throw new Error(p.analytics.SIGNED_OUT);const t=this._stockLookupMap,e={requestId:n.requestId};return e.path=await t.getLatestPath({params:n.stockParams,updateLastUsedId:!0,updateLastUseTime:!0}),e.path||t.addNewCollectionData({params:n.stockParams,level:y.BackgroundRequest}),e.path&&(e.path=e.path.replace(/\\/gi,"/")),e}).catch(t=>({requestId:n.requestId,err:t}));u.sendMessage(p.get("VULCAN_STOCK_RESPONSE"),c,e,a)}),u.addListener(p.get("VULCAN_CC_PHOTO_DOWNLOAD_REQUEST"),async(t,e,a)=>{let s,r="OZ",i=p.analytics.sc_LR_CONTENT,d=p.analytics.sc_OZ;try{(s=JSON.parse(t)).source&&s.source===p.get("CC_SEARCH_IDENTIFIER")&&(r="CCSearch",i=p.analytics.sc_CC_SEARCH,d=p.analytics.sc_CC_SEARCH_STORAGE),s.source&&s.source===p.get("CC_TOUT_DOWNLOAD_IDENTIFIER")&&(r="CCXFileDownload",i=p.analytics.sc_CCX_FILE_DOWNLOAD,d=s.downloadSubcategory)}catch(t){return u.sendMessage(p.get("VULCAN_CC_PHOTO_DOWNLOAD_ERROR"),t.toString(),e,a),void this.log.context({payload:{"event.subcategory":p.analytics.sc_CC_PHOTO,"source.name":e,"source.version":a}}).error(new T(t))}const _=await this.log.context({payload:{"event.subcategory":i,"source.name":e,"source.version":a}}).request(async()=>{const t=o.join(n.tmpdir(),p.get("TMP_PHOTOS_DOWNLOAD_DIRECTORY")),i=t+`${s.id}-${s.filename}`,_={id:s.id,path:i.replace(/\\/g,"/")};return await c.access(i,c.constants.R_OK).catch(async t=>{this._downloadManager=this._downloadManager||new E(r);const n=l.v4(),{response:o}=await this.log.context({payload:{"event.subcategory":d,"event.subtype":p.analytics.st_API,"source.name":e,"source.version":a}}).request(async()=>await this._downloadManager.get({url:s.url,options:{headers:{"x-api-key":s.clientId}},auth:!0,id:n})),c=o.headers.get("content-length");await f.writeAtomic({stream:o.body,target:i,url:s.url,progress:t=>{u.sendMessage(p.get("VULCAN_CC_PHOTO_DOWNLOAD_PROGRESS"),{id:s.id,percentage:100*t/c},e,a)}})}),await h.deleteTempFiles(t).catch(t=>this.log.disk(`Err deleting temp files - ${t}`)),_}).catch(t=>{u.sendMessage(p.get("VULCAN_CC_PHOTO_DOWNLOAD_ERROR"),t.toString(),e,a)});_&&u.sendMessage(p.get("VULCAN_CC_PHOTO_DOWNLOAD_RESPONSE"),_,e,a)}),this._firstMileLookupMap.addListener("newCollection",t=>{u.sendMessage(p.get("VULCAN_PSDK_FEED_BROADCAST"),t,t.productCode,t.productVersion)}),this._learnLookupMap.addListener("newCollection",t=>{u.sendMessage(p.get("VULCAN_LEARN_BROADCAST"),t,t.productCode,t.productVersion)}),this.maps.forEach(t=>{const e=p.get("VULCAN_TYPE",t.type),a=async(a,s,i,n)=>{let o,c={};try{c=JSON.parse(a)}catch(t){o=new T(p.analytics.PARAM_VALIDATION_ERR,`Unable to parse ${e} request:${a}`)}const l=n&&setTimeout(()=>{this.log.error(new T("CCX Process Hung. Quitting")),g.flush(!0,process.exit)},p.get("CLIENT_REQUEST_TIMEOUT")),_=c.params||{},f=c.analytics||{},E=this.log.context({params:_,payload:r({},f,{"event.subcategory":p.get("ANALYTICS_SUBCATEGORY",t.type)})}),S=await E.request(async()=>{if(o)throw o;if(!d.getUserId())throw new Error(p.analytics.SIGNED_OUT);let a=h.validateDataFields(c,p.get("SERVICE_REQUEST_SCHEMA"));if(Array.isArray(a))throw a[0];if(c.displayed&&await t.updateDisplayedId(c),!n)return void(c.updateLastUseTime&&await t.getLatestPath(c));const l={requestId:c.requestId},g=await t.addNewCollectionData({params:_,payload:f,level:c.urgent?y.UrgentRequest:y.BackgroundRequest,force:r({},c.force,{from:Date.now()}),progress:t=>{t.requestId=c.requestId,u.sendMessage(`ccxprocess.${e}Progress`,t,s,i)}});return l.path=await t.getLatestPath(r({},c,{updateLastUsedId:!0,updateLastUseTime:c.urgent?!1!==c.updateLastUseTime:c.updateLastUseTime})),l.contentId=g.id,l.expiry=t.getExpiry(g.id)||g.expiryTime,l}).catch(t=>({requestId:c.requestId,err:t instanceof Error&&!(t instanceof T)?{message:t.message}:t}));n&&(clearTimeout(l),u.sendMessage(`ccxprocess.${e}Response`,S,s,i))};u.addListener(`ccxprocess.${e}Request`,(t,e,s)=>a(t,e,s,!0)),u.addListener(`ccxprocess.${e}UsageMarker`,(t,e,s)=>a(t,e,s,!1)),t.addListener("newCollection",async(a,s)=>{const r=t.targetDetails(a);u.sendMessage(`ccxprocess.${e}Broadcast`,{params:a,path:await t.getLatestPath({params:a}),contentId:s.id},r.productCode,r.productVersion)})}),u.sendMessage(p.get("VULCAN_STARTUP_MESSAGE"),"","","")}}},function(t,e){t.exports=require("mkdirp")},function(t,e){t.exports=require("v8")},,,function(t,e,a){"use strict";a.r(e);var s=a(0),r=a(1),i=a(2),n=a(18);function o(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,s)}return a}function c(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?o(Object(a),!0).forEach(function(e){l(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):o(Object(a)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}function l(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}class d extends n.a{constructor(t,e){super(t,e)}validateData(t){return r.default.validateDataFields(t,s.default.get("LEARN_DATA_SCHEMA"))}ututAnalyticsData(t){return{"event.subcategory":s.default.analytics.sc_UTUTS,"event.subtype":s.default.analytics.st_API,"content.id":t.tutorialUUID||t.aem_id,"content.name":t.metadata&&t.metadata.descriptions&&t.metadata.descriptions.short,"content.category":t.metadata&&t.metadata.level,"content.action":t.metadata&&t.metadata.urls&&t.metadata.urls.helpx,"content.type":t.metadata&&t.metadata.learning_approach}}async upgrade(t,e){if("V3_0"===e&&t&&t.surfaces&&t.surfaces["CCX_TUTORIAL_2.5"]){this.log.disk(`Reformatting Learn Data: ${this._fileName}`);const e={surfaces:{"CCX_Start_3.0_Tutorials":t.surfaces["CCX_TUTORIAL_2.5"]},expirationDTS:t.expirationDTS,analyticsData:t.analyticsData,version:s.default.get("LOOKUP_COLLECTION_FILE_VERSION",this._lookupMap.type)};return e.surfaces["CCX_Start_3.0_Tutorials"].surfaceAnalyticsData&&(e.surfaces["CCX_Start_3.0_Tutorials"].surfaceAnalyticsData.surfaceId="CCX_Start_3.0_Tutorials"),e}return"V3_1"!==e&&"V2_8"!==e||!t||!t.surfaces||t.surfaces["CCX_Start_3.1_Tutorials"]?(t.version=2,t):(this.log.disk(`Surface mismatch, downloading new 3.1 surface content: ${this._fileName}`),null)}get totalItems(){if(this._data&&this._data.surfaces){const t=Object.values(this._data.surfaces)[0];if(t&&t.containers)return t.containers.reduce((t,e)=>e&&e.content&&e.content.tutorials&&e.content.tutorials.length?t+e.content.tutorials.length:t,0)}return 0}async syncData({priority:t,payload:e,params:a,progress:n=(()=>{})}={}){const o=this._data,l=s.default.get("LEARN_SURFACE_ID",r.default.ccxVersionToString(a));if(!o||!o.surfaces||!o.surfaces[l]||Array.isArray(!o.surfaces[l].containers))return;const d=o.surfaces[l].containers,u=this._lookupMap,p=this.assetsDir,_={started:0,complete:0};await this.log.time(async o=>{let l=0,h=0;await r.default.waitAll(d.map(async e=>{e&&e.content&&Array.isArray(e.content.tutorials)&&await r.default.waitAll(e.content.tutorials.map(async r=>{if(!r||!r.metadata||!r.metadata.images)return;const o=r.metadata.images;if(!o.thumbnail||0===o.thumbnail.length)return;_.started++,n(_);const{path:d,time:f}=await u.fetchAsset({href:o.thumbnail,assetsDir:p,priority:t,params:a}).catch(t=>(this.log.context({payload:c({},this.ututAnalyticsData(r),{"event.url":o.thumbnail})}).error(new i.default(s.default.analytics.t_FETCH,t)),e.content.tutorials.splice(e.content.tutorials.indexOf(r),1),{path:void 0,time:void 0}));_.complete++,n(_),o.thumbnailPath=d,f&&(h+=f,l+=1)}))})),o.appendPayload(c({},e,{"event.url":"","event.count":l,"event.value":h/l}))})}async getReferencedAssets(){const t={},e=this._data,a=s.default.get("LEARN_SURFACE_ID","V2_5"),r=s.default.get("LEARN_SURFACE_ID","V2_8"),i=s.default.get("LEARN_SURFACE_ID","V3_0"),n=s.default.get("LEARN_SURFACE_ID","V3_1");if(!e||!e.surfaces||!e.surfaces[a]&&!e.surfaces[r]&&!e.surfaces[i]&&!e.surfaces[n]||e.surfaces[a]&&e.surfaces[a].containers&&Array.isArray(!e.surfaces[a].containers)||e.surfaces[a]&&e.surfaces[a].containers&&Array.isArray(!e.surfaces[a].containers))return t;let o=a;return e.surfaces[i]&&(o=i),e.surfaces[r]&&(o=r),e.surfaces[n]&&(o=n),e.surfaces[o].containers.forEach(e=>{e&&e.content&&Array.isArray(e.content.tutorials)&&e.content.tutorials.forEach(e=>{if(e&&e.metadata&&e.metadata.images){const a=e.metadata.images;a.thumbnailPath&&(t[a.thumbnailPath]=!0)}})}),t}}var u=a(17),p=a(8),_=a(4),h=a(15);class f extends u.default{async url(t){const e=s.default.getEnvironment(),a=new h.URL(s.default.get(`URL_${e.LABEL.toUpperCase()}`,this.type)),i=s.default.get("LEARN_SURFACE_ID",r.default.ccxVersionToString(t)),n=r.default.compareMajorMinorVersions(s.default.get("SUPPORTED_LEARN_THIRD_PARTY_START_MIN_VERSION"),t.ccxVersion||"")>-1,o={productCode:t.productCode,productLanguage:t.productLanguage,productVersion:t.productVersion,surfaceId:i,ccxVersion:t.ccxVersion,allowThirdPartyContent:n.toString()};return this.appendUrlSearchParams(a.searchParams,o),a.toString()}additionalAnalytics(t){return{"exp.surface_id":s.default.get("LEARN_SURFACE_ID",r.default.ccxVersionToString(t))}}numberOfTutorials(t,e){let a=0,i=0;const n=s.default.get("LEARN_SURFACE_ID",r.default.ccxVersionToString(e));return t&&t.surfaces&&t.surfaces[n]&&Array.isArray(t.surfaces[n].containers)&&t.surfaces[n].containers.forEach(t=>{t.content&&Array.isArray(t.content.tutorials)&&t.content.tutorials.length>0&&(t.content.tutorials[0].metadata&&Array.isArray(t.content.tutorials[0].metadata.platforms)&&t.content.tutorials[0].metadata.platforms.includes("in-app")?i=t.content.tutorials.length:a=t.content.tutorials.length)}),{web:a,app:i}}applyResponseAnalytics(t,e,a){const r=this.numberOfTutorials(e,a);if(t.appendPayload({"exp.response_guid":e.analyticsData&&e.analyticsData.responseGUID,"content.type":s.default.analytics.UTUTS,"content.size":`${r.web}:${r.app}`}),e.surfaces)for(let a in e.surfaces)t.addSurfaceAnalytics([{surface:a}]),Array.isArray(e.surfaces[a].containers)&&t.addSurfaceAnalytics(e.surfaces[a].containers.map(t=>t.containerAnalyticsData))}async downloadCollectionDataRaw({params:t,priority:e,id:a=p.v4(),skipAuth:i}){const n=await this.url(t),o=await this.log.context({params:t}).time(async t=>{let r={"content-type":"application/json","X-API-Key":s.default.getEnvironment().CLIENT_ID};const o=!i&&!!await _.default.getAccessToken().catch(t=>!1);o&&(r["x-gw-ims-user-id"]=_.default.getUserId());let{response:c,time:l}=await this.get({url:n,options:{method:"GET",timeout:s.default.get("SERVER_TIMEOUT"),headers:r},priority:e,auth:o,id:a});t.appendPayload({"event.value":l,"event.url":n,"env.svc.name":"Learn"});const d=Date.now(),u=await this.getResponseJson(c,n);return l+=Date.now()-d,u}),c=s.default.get("LEARN_SURFACE_ID",r.default.ccxVersionToString(t));return o.surfaces&&o.surfaces[c]&&Array.isArray(o.surfaces[c].containers)&&o.surfaces[c].containers.forEach(t=>{t.data&&(t.content=JSON.parse(t.data))}),o}}var g={ANALYTICS_SUBCATEGORY:"Learn",LOOKUP_COLLECTION_FILE_VERSION:3,SUPPORTED_PRODUCTS:{AEFT:"16.0",DRWV:"19.0",FLPR:"20.0",IDSN:"14.0",ILST:"23.0",PHXS:"20.0",PPRO:"13.0",SPRK:"29.0"},PARAMETERS_SCHEMA:{id:"learn_parameters",type:"object",properties:{productCode:{type:"string"},productVersion:{type:"string"},productLanguage:{type:"string"}},required:["productCode","productVersion","productLanguage"]},LABEL:"LEARN",VULCAN_TYPE:"Tutorial",NON_IDEMPOTENT_IMAGES:!0,PRIORITY_CHANNEL:a(6).PriorityChannels.Learn,DEFAULT_URLS_ENABLED:!1,MINOR_VERSION_SHOULD_UPDATE_CONTENT:!0},E=a(20);a.d(e,"default",function(){return T});class T extends E.default{constructor(){super(g),this._downloadManager=new f(this.type)}_createCollectionData(t){return new d(t,this)}_checkValidity(t,e){const{web:a}=this._downloadManager.numberOfTutorials(t.data,e);if(0===a)throw new i.default(s.default.analytics.MISSING_DATA,"No valid web tutorials")}isRequestPoisoned(t){const e=r.default.ccxVersionToString(t);return"V1"===e||("V2"===e&&!s.default.get("TIER_1_LOCALES").includes(t.productLanguage)||(!("V2_8"!==e&&"V3_1"!==e||!t||"DRWV"!==t.productCode)||!!(r.default.isWindows()&&r.default.compareMajorMinorVersions(s.default.get("EARLIEST_SUPPORTED_WINDOWS_VERSION_UXP"),r.default.getOsVersion())<0&&s.default.get("UNSUPPORTED_WINDOWS_UXP_APPS").includes(t.productCode))))}updateParams(t){const e=s.default.get("SUPPORTED_UXP_APPS");return super.updateParams(t).map(t=>{let a=s.default.get("DEFAULT_START_VERSION_CEP");t.productCode&&e[t.productCode]&&r.default.compareMajorMinorVersions(e[t.productCode],t.productVersion)>-1&&(a=s.default.get("DEFAULT_START_VERSION_UXP"));const i=s.default.get("ACTIVE_VERSIONS").find(e=>{const a=s.default.get("FIRST_MILE_PREFETCH_CLIENTS",e)[t.productCode];return 1===r.default.compareMajorMinorVersions(t.productVersion,a)});return t.ccxVersion=s.default.get("START_VERSION",i)||a,t})}}},function(t,e,a){"use strict";a.r(e);var s=a(6);var r={LABEL:"CCD",ANALYTICS_SUBCATEGORY:"CCD",VULCAN_TYPE:"CCD",LOG_PREFIX:"CCD",LOOKUP_MAP_FILE_VERSION:2,SUPPORTED_PRODUCTS:{ACCC:"5.0"},PRIORITY_CHANNEL:s.PriorityChannels.CcdPrimary,SURFACE_PRIORITY:{ACCC_APPS_CATALOG:0,ACCC_CATEGORIES_BANNERS:100,ACCC_ALL_APPS_BANNERS:200,ACCC_APP_SKELETON:300},SECONDARY_SURFACES:["ACCC_ALL_APPS_BANNERS"],TERTIARY_SURFACES:["ACCC_APPS_CATALOG","ACCC_CATEGORIES_BANNERS"],SUPPORTED_LOCALES:["cs_CZ","da_DK","de_DE","en_US","es_ES","es_MX","fi_FI","fr_FR","fr_CA","it_IT","ja_JP","ko_KR","nb_NO","nl_NL","pl_PL","pt_BR","ru_RU","sv_SE","tr_TR","zh_CN","zh_TW"],DEFAULT_URLS_ENABLED:!1,MINOR_VERSION_SHOULD_UPDATE_CONTENT:!0},i=a(8),n=a(17),o=a(4),c=a(0);class l extends n.default{applyResponseAnalytics(t,e,a){if(t.appendPayload({"exp.response_guid":e.analyticsData&&e.analyticsData.responseGUID}),e.surfaces)for(let a in e.surfaces)t.addSurfaceAnalytics([{surface:a}]),Array.isArray(e.surfaces[a].containers)&&t.addSurfaceAnalytics(e.surfaces[a].containers.map(t=>t.containerAnalyticsData))}async downloadCollectionDataRaw({params:t,priority:e,id:a=i.v4(),skipAuth:s}){if(c.default.get("TEMP_CCD_CONTENT_DOWNLOAD_DISABLED")){const t=new Date;return t.setDate(t.getDate()+14),{expirationDTS:t.toISOString(),surfaces:{}}}const r=await this.url(t),n=await this.log.context({params:t}).time(async t=>{let{response:i,time:n}=await this.get({url:r,options:{method:"GET",timeout:c.default.get("SERVER_TIMEOUT"),headers:{"content-type":"application/json","x-gw-ims-user-id":o.default.getUserId(),"X-API-Key":c.default.getEnvironment().CLIENT_ID}},priority:e,auth:!s&&!!await o.default.getAccessToken().catch(t=>!1),id:a});t.appendPayload({"event.value":n,"event.url":r,"env.svc.name":"Learn"});const l=Date.now(),d=await this.getResponseJson(i,r);return n+=Date.now()-l,d});return n.analyticsData&&(n.analyticsData.requestId=a),n}}var d=a(18),u=a(28),p=a(1);function _(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,s)}return a}function h(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?_(Object(a),!0).forEach(function(e){f(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):_(Object(a)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}function f(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}class g extends d.a{constructor(t,e){super(t,e),f(this,"dataManager",void 0),this.dataManager=new u.a(e.type,this._lookupMap.diskLock)}async syncDataPromises({analyticsParams:t,payload:e,surface:a,card:s,priority:r,params:i,force:n,started:o}){await this.log.context({payload:e,surfaceAnalytics:[h({surface:a},t)]}).time(async t=>{let{count:e,totalTime:c}=await this.dataManager.downloadData({modeID:a,card:s,lookupMap:this._lookupMap,priority:r,params:i,started:o,force:n});t.appendPayload({"event.url":"","event.count":e,"event.value":c/e})})}async syncData({priority:t,payload:e,params:a,progress:r=(()=>{}),force:i={type:"none"}}={}){if(!this._data)return;const n={started:[],complete:[]};let o=[];Object.keys(this._data.surfaces).forEach(l=>{o.push(p.default.waitAll(this._data.surfaces[l].containers.map(async o=>{const d=new s.Priority(t);d.value+=c.default.get("SURFACE_PRIORITY",this._lookupMap.type)[l]||0,c.default.get("SECONDARY_SURFACES",this._lookupMap.type).includes(l)&&(d.channel=s.PriorityChannels.CcdSecondary),c.default.get("TERTIARY_SURFACES",this._lookupMap.type).includes(l)&&(d.channel=s.PriorityChannels.CcdTertiary),await this.syncDataPromises({analyticsParams:o.containerAnalyticsData,payload:e,surface:l,card:o,priority:d,params:a,force:i,started(){n.started.includes(l)||(n.started.push(l),r(Object.assign({},n)))}})})).then(()=>{n.started.includes(l)||n.started.push(l),n.complete.push(l),r(Object.assign({},n))}))}),await p.default.waitAll(o)}get totalItems(){return this._data&&this._data.surfaces?Object.keys(this._data.surfaces):0}async getReferencedAssets(){const t={};return this._data&&this._data.surfaces&&await p.default.waitAll(Object.keys(this._data.surfaces).map(async e=>{await p.default.waitAll(this._data.surfaces[e].containers.map(async a=>{const s=await this.dataManager.getReferencedAssets(e,a);Object.assign(t,s)}))})),t}}var E=a(20),T=a(9);a.d(e,"default",function(){return y});class y extends E.default{constructor(t){super(r),this._downloadManager=new l(this.type)}_createCollectionData(t){return new g(t,this)}_getLookupKeys(t,e){const a=[e||o.default.getUserId()];return a.push(t.productLanguage),a}validateParams(t){}isRequestPoisoned(t){return!1}_generateId(t){return`${t.productLanguage}-${i.v4()}`.trim()}updateParams(t){var e;const a=null===(e=o.default.getUserInfo())||void 0===e?void 0:e.countryCode;return super.updateParams(t).map(t=>(delete t.productCode,Object.assign({surfaceId:t.surfaceId||["ACCC_ALL_APPS_BANNERS","ACCC_CATEGORIES_BANNERS","ACCC_APPS_CATALOG","ACCC_APP_SKELETON"],productLanguage:t.productLanguage,productVersion:t.productVersion,osVersion:T.release()},a?{countryCode:a}:{},t)))}sanitizeParams(t){return t.productLanguage=p.default.sanitizeLocale(t.productLanguage,c.default.get("SUPPORTED_LOCALES",this.type)),t}targetDetails(t){return{productCode:"ACCC"}}isValidDataForParams({id:t,params:e}){const a=this._data.metadata[t];return!(a&&a.params&&a.params.countryCode&&e.countryCode&&a.params.countryCode!==e.countryCode)}}},function(t,e,a){"use strict";a.r(e);var s=a(0),r=a(20),i=a(1),n=a(18),o=a(28);function c(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,s)}return a}function l(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?c(Object(a),!0).forEach(function(e){d(t,e,a[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):c(Object(a)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))})}return t}function d(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}class u extends n.a{constructor(t,e){super(t,e),d(this,"cardDataManager",void 0),this.cardDataManager=new o.a(e.type,this._lookupMap.diskLock)}validateData(t,e){let a;if(a=i.default.validateDataFields(t,s.default.get("CARDS_DATA_SCHEMA")[e],[s.default.get("CARDS_CONTROL_SCHEMA")]))return a;let r=[];return t.cardControl&&t.cardControl.forEach(e=>{const n=s.default.get("CARD_DATA_SCHEMA")[e.modeID];if(!n)return null;e.cardOrder.forEach(e=>{const s=t.cards[e];s&&(a=i.default.validateDataFields(s,n))&&(r=r.concat(a))})}),r.length>0?r:null}async upgrade(t,e){return"V3_0"===e&&t&&t.cardControl?(this.log.disk(`Invalidating Home Data: ${this._fileName}`),null):t.version===s.default.get("LOOKUP_COLLECTION_FILE_VERSION",this._lookupMap.type)?t:t&&2===t.version?(t.version=s.default.get("LOOKUP_COLLECTION_FILE_VERSION",this._lookupMap.type),t):(this.log.disk(`Unsupported format, downloading new content: ${this._fileName}`),null)}async syncDataPromises({analyticsParams:t,payload:e,surface:a,card:s,priority:r,params:i,started:n,force:o}){await this.log.context({payload:e,surfaceAnalytics:[l({surface:a},t)]}).time(async t=>{let{count:e,totalTime:c}=await this.cardDataManager.downloadData({modeID:a,card:s,lookupMap:this._lookupMap,priority:r,bundle:!0,params:i,started:n,force:o});t.appendPayload({"event.url":"","event.count":e,"event.value":c/(e||1)})})}get totalItems(){return this._data&&this._data.surfaces?Object.keys(this._data.surfaces):this._data&&this._data.cardControl?this._data.cardControl.map(t=>t.modeID):0}async syncData({priority:t,payload:e,params:a,progress:s,force:r}){if(!this._data)return;const n={started:[],complete:[]};let o=[];if(this._data.surfaces)Object.keys(this._data.surfaces).forEach(c=>{o.push(i.default.waitAll(this._data.surfaces[c].containers.filter(t=>"URL"===t.dataType).map(async i=>{await this.syncDataPromises({analyticsParams:i.containerAnalyticsData,payload:e,surface:c,card:i,priority:t,params:a,force:r,started(){n.started.includes(c)||(n.started.push(c),s(Object.assign({},n)))}})})).then(()=>{n.started.includes(c)||n.started.push(c),n.complete.push(c),s(Object.assign({},n))}))});else{if(!this._data.cardControl)return;this._data.cardControl.forEach(c=>{o.push(i.default.waitAll(c.cardOrder.map(async(i,o)=>{const l=this._data.cards[i];l&&await this.syncDataPromises({analyticsParams:c.containerAnalyticsParams&&c.containerAnalyticsParams[o],payload:e,surface:c.modeID,card:l,priority:t,params:a,force:r,started(){n.started.includes(c.modeID)||(n.started.push(c.modeID),s(Object.assign({},n)))}})})).then(()=>{n.started.includes(c.modeID)||n.started.push(c.modeID),n.complete.push(c.modeID),s(Object.assign({},n))}))})}await i.default.waitAll(o)}hasValidCards(){const t=s.default.get("ACTIVE_VERSIONS"),e=s.default.get("SUPPORTED_ACTIVE_VERSIONS"),a=t.slice(-1*e),r=i.default.ccxVersionToString(this._data);if(!a.includes(r))return!0;const n=s.default.get("HOME_SURFACE_ID",r);return["V1","V2","V2_5"].includes(r)?!!this._data.cardControl.find(t=>t.modeID===n):!!Object.keys(this._data.surfaces).includes(n)}async getReferencedAssets(){const t={};return this._data&&this._data.surfaces?await i.default.waitAll(Object.keys(this._data.surfaces).map(async e=>{await i.default.waitAll(this._data.surfaces[e].containers.map(async a=>{const s=await this.cardDataManager.getReferencedAssets(e,a);Object.assign(t,s)}))})):this._data&&this._data.cardControl&&await i.default.waitAll(this._data.cardControl.map(async e=>{await i.default.waitAll(e.cardOrder.map(async a=>{const s=this._data.cards[a];if(s){const a=await this.cardDataManager.getReferencedAssets(e.modeID,s);Object.assign(t,a)}}))})),t}}var p=a(12),_=a(2),h=a(8),f=a(6);var g={ANALYTICS_SUBCATEGORY:"Sophia",LOOKUP_MAP_FILE_VERSION:5,LOOKUP_COLLECTION_FILE_VERSION:3,SUPPORTED_PRODUCTS:{AEFT:"15.0",DRWV:"18.0",FLPR:"20.0",IDSN:"13.0",ILST:"22.0",MUSE:"2018.0",PHXS:"19.0",PPRO:"12.0",SPRK:"29.0"},PARAMETERS_SCHEMA:{id:"psdk_parameters",type:"object",properties:{productCode:{type:"string"},productVersion:{type:"string"},productLanguage:{type:"string"},subscriptionStatus:{type:"string"}},required:["productCode","productVersion","productLanguage","subscriptionStatus"]},LOG_PREFIX:"FirstMile",LABEL:"FIRST_MILE",DIR:"data/",VULCAN_TYPE:"FirstMile",PRIORITY_CHANNEL:f.PriorityChannels.FirstMileLatest,DEFAULT_DATA_EXPIRATION:2592e5,DEFAULT_URLS_ENABLED:!0,DEFAULT_URLS:{V2_5:{PHXS:"https://cvs.adobe.com/content/dam/cvs/firstmile/V2/953/2drOpU2WQ0s4qG6KacAgmk/{locale}.json",PPRO:"https://cvs.adobe.com/content/dam/cvs/firstmile/V2/62/3JrN0dcjvNeCc1oEZPABh9/{locale}.json",AEFT:"https://cvs.adobe.com/content/dam/cvs/firstmile/V2/687/50WW9E93Dvfv7Otfe3B2UO/{locale}.json",ILST:"https://cvs.adobe.com/content/dam/cvs/firstmile/V2/832/7pCFzXfA6QAaKI6MsicKO2/{locale}.json",IDSN:"https://cvs.adobe.com/content/dam/cvs/firstmile/V2/619/1dyQrULwM8wCi4oiaY0gUy/{locale}.json",DRWV:"https://cvs.adobe.com/content/dam/cvs/firstmile/V2/709/4gK0NuqSF2G4YwYc6MoSO/{locale}.json"},V2_8:{PHXS:"https://cvs.adobe.com/content/dam/cvs/firstmile/V2/169/45a57xm7FMMg2CHHSsI5T/{locale}.json",PPRO:"https://cvs.adobe.com/content/dam/cvs/firstmile/V2/508/XFd1SlnnXACOaGHvHrkzR/{locale}.json",AEFT:"https://cvs.adobe.com/content/dam/cvs/firstmile/V2/53/66SsgxKgPwafhzfZhaH73y/{locale}.json",ILST:"https://cvs.adobe.com/content/dam/cvs/firstmile/V2/959/3QlaTwccpuG2gM4WwJu2O5/{locale}.json",IDSN:"https://cvs.adobe.com/content/dam/cvs/firstmile/V2/71/3fF2Ay5mQhhH3ruR2k7fU8/{locale}.json"},V3_0:{PHXS:"https://cvs.adobe.com/content/dam/cvs/firstmile/V2/953/2drOpU2WQ0s4qG6KacAgmk/{locale}.json",ILST:"https://cvs.adobe.com/content/dam/cvs/firstmile/V2/832/7pCFzXfA6QAaKI6MsicKO2/{locale}.json"},V3_1:{PHXS:"https://cvs.adobe.com/content/dam/cvs/firstmile/V2/169/45a57xm7FMMg2CHHSsI5T/{locale}.json",PPRO:"https://cvs.adobe.com/content/dam/cvs/firstmile/V2/508/XFd1SlnnXACOaGHvHrkzR/{locale}.json",AEFT:"https://cvs.adobe.com/content/dam/cvs/firstmile/V2/53/66SsgxKgPwafhzfZhaH73y/{locale}.json",ILST:"https://cvs.adobe.com/content/dam/cvs/firstmile/V2/959/3QlaTwccpuG2gM4WwJu2O5/{locale}.json",IDSN:"https://cvs.adobe.com/content/dam/cvs/firstmile/V2/71/3fF2Ay5mQhhH3ruR2k7fU8/{locale}.json",SPRK:"https://cvs.adobe.com/content/dam/cvs/firstmile/V2/634/hs2oiIlx8QNVYkYXaNJrs/{locale}.json"}},MINOR_VERSION_SHOULD_UPDATE_CONTENT:!0};a.d(e,"default",function(){return T});const E=a(52);class T extends r.default{constructor(){super(g),this._downloadManager=new E(this.type)}_generateId(t){return`${t.productCode}-${t.productVersion}-${t.productLanguage}-${t.subscriptionStatus}-${h.v4()}`.trim()}priority(t){let{params:e}=t;const a=super.priority(t),r=i.default.ccxVersionToString(e);return a.value+=s.default.get("priority",r),"V1"!==r&&"V2"!==r||(a.channel=f.PriorityChannels.Deprecated),"V2_5"!==r&&"V3_0"!==r||(a.channel=f.PriorityChannels.FirstMileOld),a}_createCollectionData(t){return new u(t,this)}_getLookupKeys(t,e=null){const a=super._getLookupKeys(t,e),s=i.default.ccxVersionToString(t);return a.splice(1,0,s),a.push(t.subscriptionStatus||"paid"),a}_checkValidity(t,e){if(!t||!t.hasValidCards||!t.hasValidCards())throw new _.default(p.default.MISSING_DATA,"Empty Sophia Cards")}async forceRefresh(t){const e=s.default.get("ACTIVE_VERSIONS").map(e=>[e,...Object.values(t)]).map(t=>this.getIdsByKeys(t)).reduce((t,e)=>[...t,...e],[]).filter((t,e,a)=>a.indexOf(t)===e);await Promise.all(e.map(async t=>await this.expireOne(t)))}isRequestPoisoned(t){const e=i.default.ccxVersionToString(t);return"V1"===e||("V2"===e&&!s.default.get("TIER_1_LOCALES").includes(t.productLanguage)||(!("V2_8"!==e&&"V3_1"!==e||!t||"DRWV"!==t.productCode)||!!(i.default.isWindows()&&i.default.compareMajorMinorVersions(s.default.get("EARLIEST_SUPPORTED_WINDOWS_VERSION_UXP"),i.default.getOsVersion())<0&&s.default.get("UNSUPPORTED_WINDOWS_UXP_APPS").includes(t.productCode))))}updateParams(t){t=super.updateParams(t);const e=[],a=s.default.get("SUPPORTED_UXP_APPS");return t.forEach(t=>{if(!t.subscriptionStatus){const a=Object.assign({},t);a.subscriptionStatus="trial",e.push(a),t.subscriptionStatus="paid"}e.push(t)}),e.forEach(t=>{let e=s.default.get("DEFAULT_START_VERSION_CEP");t.productCode&&a[t.productCode]&&i.default.compareMajorMinorVersions(a[t.productCode],t.productVersion)>-1&&(e=s.default.get("DEFAULT_START_VERSION_UXP"));const r=s.default.get("ACTIVE_VERSIONS").find(e=>{const a=s.default.get("FIRST_MILE_PREFETCH_CLIENTS",e)[t.productCode];return 1===i.default.compareMajorMinorVersions(t.productVersion,a)});t.ccxVersion=s.default.get("START_VERSION",r)||e}),e}async defaultCollectionData({params:t,desiredId:e}){const a=i.default.ccxVersionToString(t);if(["V2_5","V2_8","V3_0","V3_1"].includes(a)){const r=this._createCollectionData(e),i=s.default.get("DEFAULT_URLS",this.type)[a][t.productCode],n=i&&i.replace("{locale}",t.productLanguage);if(!n)return;let o={ccxVersion:"2.7.4.99",cards:[{startDTS:(new Date).toISOString(),endDTS:(new Date).toISOString(),contentURL:n}],cardControl:[{modeID:"CCX_Start_2.5_Home",cardOrder:[0],containerAnalyticsParams:[{variationId:"dummy",actionBlockId:"dummy",campaignId:0,containerId:"1",controlGroupId:"",treatmentId:"dummy"}]}],analyticsParams:{responseGUID:"dummy",requestId:"dummy"},expirationDTS:new Date(Date.now()+s.default.get("DEFAULT_DATA_EXPIRATION",this.type)).toISOString(),_ccx:{isDefault:!0,version:s.default.get("LOOKUP_COLLECTION_FILE_VERSION",this.type)}};return"V2_8"===a&&(o={ccxVersion:"2.8.0.99",_ccx:{isDefault:!0,version:s.default.get("LOOKUP_COLLECTION_FILE_VERSION",this.type)},surfaces:{"CCX_Start_3.1_Home":{containers:[{dataType:"URL",data:n,containerAnalyticsData:{variationId:"dummy",actionBlockId:"dummy",campaignId:0,containerId:"1",controlGroupId:"",treatmentId:"dummy"}}]}},analyticsData:{responseGUID:"dummy",requestId:"dummy"},expirationDTS:new Date(Date.now()+s.default.get("DEFAULT_DATA_EXPIRATION",this.type)).toISOString()}),"V3_1"===a&&(o={ccxVersion:"3.1.0.99",_ccx:{isDefault:!0,version:s.default.get("LOOKUP_COLLECTION_FILE_VERSION",this.type)},surfaces:{"CCX_Start_3.1_Home":{containers:[{dataType:"URL",data:n,containerAnalyticsData:{variationId:"dummy",actionBlockId:"dummy",campaignId:0,containerId:"1",controlGroupId:"",treatmentId:"dummy"}}]}},analyticsData:{responseGUID:"dummy",requestId:"dummy"},expirationDTS:new Date(Date.now()+s.default.get("DEFAULT_DATA_EXPIRATION",this.type)).toISOString()}),"V3_0"===a&&(o={ccxVersion:"3.0.1.99",_ccx:{isDefault:!0,version:s.default.get("LOOKUP_COLLECTION_FILE_VERSION",this.type)},surfaces:{"CCX_Start_3.0_Home":{containers:[{dataType:"URL",data:n,containerAnalyticsData:{variationId:"dummy",actionBlockId:"dummy",campaignId:0,containerId:"1",controlGroupId:"",treatmentId:"dummy"}}]}},analyticsData:{responseGUID:"dummy",requestId:"dummy"},expirationDTS:new Date(Date.now()+s.default.get("DEFAULT_DATA_EXPIRATION",this.type)).toISOString()}),r.setData(o,a),r}}}},function(t,e,a){"use strict";a.r(e);var s=a(0),r=a(1),i=a(7),n=a(39);var o=new class{constructor(){this.ROOT={HKEY_CLASSES_ROOT:2147483648,HKEY_CURRENT_USER:2147483649,HKEY_LOCAL_MACHINE:2147483650,HKEY_USERS:2147483651,HKEY_PERFORMANCE_DATA:2147483652,HKEY_CURRENT_CONFIG:2147483653,HKEY_DYN_DATA:2147483654},this.KEY_ACCESS={KEY_ALL_ACCESS:983103,KEY_CREATE_LINK:32,KEY_CREATE_SUB_KEY:4,KEY_ENUMERATE_SUB_KEYS:8,KEY_EXECUTE:131097,KEY_NOTIFY:16,KEY_QUERY_VALUE:1,KEY_READ:131097,KEY_SET_VALUE:2,KEY_WOW64_32KEY:512,KEY_WOW64_64KEY:256,KEY_WRITE:131078},this.advApi=null,this.REG_VALUE_TYPE={REG_SZ:1,REG_EXPAND_SZ:2,REG_BINARY:3,REG_DWORD:4,REG_DWORD_BIG_ENDIAN:5,REG_DWORD_LITTLE_ENDIAN:6,REG_LINK:6,REG_MULTI_SZ:7,REG_RESOURCE_LIST:8},this.types={REGSAM:i.types.ulong,DWORD:i.types.ulong,ULONG:i.types.ulong,HWND:i.refType(i.types.void),BYTE:i.types.uint8,HKEY:i.refType(i.types.void),PVOID:i.refType("pointer"),HANDLE:i.refType(i.types.void),HINSTANCE:i.refType(i.types.void),LPCTSTR:i.refType(i.types.CString),STRING:i.types.CString,INT:i.types.int,LPVOID:i.refType(i.types.void)},this.types.PHKEY=i.refType(this.types.HKEY),this.types.LPBYTE=i.refType(this.types.BYTE),this.types.LPDWORD=i.refType(this.types.DWORD)}async readValueOfKey(t,e,a,s){try{this.advApi||(this.advApi=n.Library("Advapi32",{RegOpenKeyExA:["long",["longlong","string",this.types.DWORD,this.types.REGSAM,this.types.PHKEY]],RegQueryValueExA:["long",[this.types.HKEY,"string","pointer",this.types.LPDWORD,this.types.LPBYTE,this.types.LPDWORD]],RegCloseKey:["long",[this.types.PHKEY]]}));const r=i.alloc(this.types.PHKEY,new Buffer(i.sizeof.pointer));if(!r)return null;let o=this.advApi.RegOpenKeyExA(t,e,0,s,r);if(0!==o&&2!==o)return this.advApi.RegCloseKey(r),null;const c=i.alloc(this.types.LPDWORD,new Buffer(i.sizeof.pointer)),l=i.alloc(this.types.LPDWORD,new Buffer(i.sizeof.pointer));o=this.advApi.RegQueryValueExA(r.deref(),a,null,l,null,c);const d=new Buffer(c.readUInt32LE());switch(l.readUInt32LE()){case this.REG_VALUE_TYPE.REG_SZ:case this.REG_VALUE_TYPE.REG_EXPAND_SZ:case this.REG_VALUE_TYPE.REG_LINK:d.type=this.types.LPCTSR;break;case this.REG_VALUE_TYPE.REG_BINARY:d.type=this.types.PVOID;break;case this.REG_VALUE_TYPE.REG_DWORD:case this.REG_VALUE_TYPE.REG_DWORD_BIG_ENDIAN:case this.REG_VALUE_TYPE.REG_DWORD_LITTLE_ENDIAN:d.type=this.types.DWORD;break;default:return this.advApi.RegCloseKey(r),null}return 0!==(o=this.advApi.RegQueryValueExA(r.deref(),a,null,l,d,c))?(this.advApi.RegCloseKey(r),null):(this.advApi.RegCloseKey(r),d)}catch(t){return null}}},c=a(40);const l=new class{constructor(){var t,e,a;t=this,e="isKillSwitchEnabled",a=r.default.memoize(async t=>{const e=s.default.get("TEMP_STOCK_TEMPLATE_DOWNLOAD_LIMIT_REGISTRY_SETTING"),a=s.default.get("TEMP_CCD_CONTENT_DOWNLOAD_REGISTRY_SETTING"),i=function(r,i){i&&(s.default.set("TEMP_STOCK_TEMPLATE_DOWNLOAD_LIMIT",i[e]),s.default.set("TEMP_CCD_CONTENT_DOWNLOAD_DISABLED",!!i[a])),t(r,i)};if(r.default.isWindows()){const t={},r=s.default.get("TEMP_KILL_SWITCH_REGISTRY_KEY");let n;try{const s=await o.readValueOfKey(o.ROOT.HKEY_LOCAL_MACHINE,r,e,o.KEY_ACCESS.KEY_QUERY_VALUE);if(s&&s.length){const a=s.readInt8(0);t[e]=a}const c=await o.readValueOfKey(o.ROOT.HKEY_LOCAL_MACHINE,r,a,o.KEY_ACCESS.KEY_QUERY_VALUE);if(c&&c.length){const e=c.readInt8(0);t[a]=e}i(n,t)}catch(e){i(n=e,t)}}else{let t,e;try{t=c.readFileSync(s.default.get("TEMP_KILL_SWITCH_PLIST_PATH"))}catch(t){e=t}i(e,t)}}),e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a}};e.default=l}]);