define("metaserver/static/js/dropbox/proto/ccpa_data/ccpa_data",["require","exports","tslib","protobufjs/minimal"],(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ccpa_data=void 0;const o=(n=i.__importStar(n)).Reader,r=n.Writer,s=(n.util,n.roots.default||(n.roots.default={}));var a;t.default=s,t.ccpa_data=s.ccpa_data=((a=s.ccpa_data||{}).CCPALogContext=(function(e){function e(e){if(e)for(let t=Object.keys(e),i=0;i>>3){case 1:n.userAgent=e.string();break;case 2:n.sessionId=e.string();break;case 3:n.anonIp=e.string();break;case 4:n.localeUserSelected=e.string();break;case 5:n.localeBrowserHeader=e.string();break;case 6:n.country=e.string();break;case 7:n.uaBrowserName=e.string();break;case 8:n.uaBrowserVersion=e.string();break;case 9:n.uaOsName=e.string();break;case 10:n.uaOsVersion=e.string();break;default:e.skipType(7&t)}}return n},e.getTypeUrl=function(){return"type.googleapis.com/ccpa_data.CCPALogContext"},e})(a.CCPALogContext||{}),a)})),define("metaserver/static/js/dropbox/proto/js_init_data/privacy_consent/privacy_consent",["require","exports","tslib","protobufjs/minimal","metaserver/static/js/dropbox/proto/ccpa_data/ccpa_data","metaserver/static/js/dropbox/proto/js_init_data/web_timing_logger/web_timing_logger"],(function(e,t,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.privacy_consent=void 0;const o=(n=i.__importStar(n)).Reader,r=n.Writer,s=n.util,a=n.roots.default||(n.roots.default={});var c;t.default=a,t.privacy_consent=a.privacy_consent=((c=a.privacy_consent||{}).PrivacyConsentInitData=(function(e){function e(e){if(e)for(let t=Object.keys(e),i=0;i>>3){case 1:n.iframeOrigin=e.string();break;case 2:n.countryCode=e.string();break;case 3:n.isCcpaEnabled=e.bool();break;case 4:n.loggedInState=e.int32();break;default:e.skipType(7&t)}}return n},e.getTypeUrl=function(){return"type.googleapis.com/privacy_consent.PrivacyConsentInitData"},e.LoggedInState=(function(){const e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="LOGGED_OUT"]=1,t[e[2]="LOGGED_IN"]=2,t})(),e})(c.PrivacyConsentInitData||{}),c.UserDNSInitState=(function(){const e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="LOGGED_OUT_NOT_ENROLLED"]=1,t[e[2]="LOGGED_OUT_EMAIL_PENDING"]=2,t[e[3]="LOGGED_OUT_ENROLLED"]=3,t[e[7]="LOGGED_OUT_GPC_ENABLED"]=7,t[e[4]="LOGGED_IN_NOT_ENROLLED"]=4,t[e[5]="LOGGED_IN_EMAIL_PENDING"]=5,t[e[6]="LOGGED_IN_ENROLLED"]=6,t})(),c.CCPAIFrameInitData=(function(e){function e(e){if(this.userEmails=[],this.verifiedEmails=[],this.unverifiedEmails=[],this.localizedTextOverrides={},e)for(let t=Object.keys(e),i=0;i>>3){case 1:c.consentIframeOrigin=e.string();break;case 2:c.dnsState=e.int32();break;case 3:c.userEmails&&c.userEmails.length||(c.userEmails=[]),c.userEmails.push(e.string());break;case 4:c.verifiedEmails&&c.verifiedEmails.length||(c.verifiedEmails=[]),c.verifiedEmails.push(e.string());break;case 5:c.unverifiedEmails&&c.unverifiedEmails.length||(c.unverifiedEmails=[]),c.unverifiedEmails.push(e.string());break;case 6:c.loggingContext=a.ccpa_data.CCPALogContext.decode(e,e.uint32());break;case 7:c.ccpaToken=e.string();break;case 8:c.isGpcEnabled=e.bool();break;case 9:{c.localizedTextOverrides===s.emptyObject&&(c.localizedTextOverrides={});let t=e.uint32()+e.pos;for(i="",n="";e.pos>>3){case 1:i=e.string();break;case 2:n=e.string();break;default:e.skipType(7&t)}}c.localizedTextOverrides[i]=n;break}case 10:c.csrfToken=e.string();break;default:e.skipType(7&t)}}return c},e.getTypeUrl=function(){return"type.googleapis.com/privacy_consent.CCPAIFrameInitData"},e})(c.CCPAIFrameInitData||{}),c.CCPADNSVerificationInitData=(function(e){function e(e){if(e)for(let t=Object.keys(e),i=0;i>>3){case 1:n.confirmationStatus=e.int32();break;case 2:n.userEmailToken=e.string();break;case 3:n.countryCode=e.string();break;case 4:n.locale=e.string();break;case 5:n.hasError=e.bool();break;case 6:n.webTimingLoggerServerContext=a.web_timing_logger.WebTimingLoggerServerContext.decode(e,e.uint32());break;default:e.skipType(7&t)}}return n},e.getTypeUrl=function(){return"type.googleapis.com/privacy_consent.CCPADNSVerificationInitData"},e.DNSVerificationStatus=(function(){const e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="CONFIRMED"]=1,t[e[2]="CANCELED"]=2,t[e[3]="PENDING"]=3,t})(),e})(c.CCPADNSVerificationInitData||{}),c)})),define("metaserver/static/js/modules/clean/privacy_consent",["require","exports","tslib","metaserver/static/js/proto_utils/unpack","metaserver/static/js/modules/clean/web_timing_logger","metaserver/static/js/dropbox/proto/js_init_data/privacy_consent/privacy_consent","metaserver/static/js/modules/core/browser","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/active_user","metaserver/static/js/modules/clean/privacy_consent/chat_client","metaserver/static/js/modules/clean/privacy_consent/i18n","metaserver/static/js/modules/clean/privacy_consent/log","metaserver/static/js/modules/clean/privacy_consent/marketing_tracker","metaserver/static/js/modules/clean/privacy_consent/privacy_consent_platform"],(function(e,t,i,n,o,r,s,a,c,l,d,u,p,g){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.moduleInit=t.initialize_module=t.PrivacyConsentPlatform=t.maybeReloadPage=void 0,s=i.__importStar(s);const h=new l.ChatClientInjectorImpl(5e3),C=()=>{const[e]=window.location.pathname.split("/").filter(e=>e);return-1!==["scl","preview","work","home","starred","recents","personal","shared","h","s"].indexOf(e)},m=()=>document.getElementById("locale-container")||document.querySelector(".warp-locale-selector-plank, .warp-dwg-locale-selector-plank"),_=e=>{const t=document.querySelector("body");t&&t.style.setProperty("--privacy-consent-banner-height",`${e}px`)},f=e=>{const t=m();if(t){t.style.removeProperty("margin-bottom");const i=parseInt(window.getComputedStyle(t).marginBottom,10)||0;t.style.marginBottom=`${e+i}px`}_(e),h.setCookieBannerInfo(!0,e)},v=()=>{const e=m();e&&e.style.removeProperty("margin-bottom"),_(0),h.setCookieBannerInfo(!1,0)},E=e=>{let t;if(null==e||0===e){t=void 0!==c.getActiveUserId()}else t=e===r.privacy_consent.PrivacyConsentInitData.LoggedInState.LOGGED_IN;return t&&C()};function b(e){t.PrivacyConsentPlatform.config||t.PrivacyConsentPlatform.init(e,{onBannerVisible:f,onBannerNotVisible:v,disableBanner:E(e.loggedInState),consentChangedCallback:t.maybeReloadPage,priorConsentCallback:(e,i)=>{i&&t.maybeReloadPage(e)},injectFloatingButton:!(["/transfer","/transfer/manage"].includes(window.location.pathname)||C()),injectToFooter:!0})}t.maybeReloadPage=e=>{e&&e.all||window.location.reload(!0)},t.PrivacyConsentPlatform=new g.PrivacyConsentPlatformSingleton({intlText:d.getIntlText(a.intl),log:new u.PrivacyConsentLogImpl,updateConsentCategories:p.updateConsentCategories,redirect:s.redirect,ttiTimeout:5e3,waitForTTI:o.waitForTTI}),t.initialize_module=b,t.moduleInit=function(e){b(n.unpackProto(e,r.privacy_consent.PrivacyConsentInitData))}}));var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&__createBinding(t,e,i);return __setModuleDefault(t,e),t};define("metaserver/static/js/modules/clean/privacy_consent/chat_client",["require","exports","metaserver/static/js/modules/clean/web_timing_logger"],(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatClientInjectorImpl=void 0;class n{constructor(e){if(n.instance)return n.instance;n.instance=this,this.ttiTimeout=e}loadChatModule(){return this.chatLoadPromise?this.chatLoadPromise:(this.chatLoadPromise=i.waitForTTI({timeoutMS:this.ttiTimeout}).then(()=>new Promise((t,i)=>{e(["metaserver/static/js/modules/clean/chat/chat_client"],t,i)}).then(__importStar)),this.chatLoadPromise)}setCookieBannerInfo(e,t){this.loadChatModule().then(i=>{const n=i.ChatClientSingleton;n.isSetup()&&n.setCookieBannerInfo(e,t)})}}t.ChatClientInjectorImpl=n})),define("metaserver/static/js/modules/clean/privacy_consent/i18n",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getIntlText=void 0,t.getIntlText=e=>({manageCookies:e.formatMessage({id:"yF4LPz",defaultMessage:"Manage cookies"}),cookiesAndCCPA:e.formatMessage({id:"glGIgS",defaultMessage:"Cookies & CCPA preferences"}),cookiePolicy:e.formatMessage({id:"t0O/69",defaultMessage:"Cookie policy"}),consentIframeTitle:e.formatMessage({id:"C4AGEz",defaultMessage:"Cookies & CCPA Preferences - Dropbox"}),sandboxRedirectTitle:e.formatMessage({id:"fy9qFc",defaultMessage:"Error"}),sandboxRedirectDetails:e.formatMessage({id:"yIZcC9",defaultMessage:"Cookie preferences cannot be confirmed on this page. If you wish to continue cookie consent selection, click the Cookie preferences button below."}),sandboxRedirectLinkText:e.formatMessage({id:"59MGG1",defaultMessage:"Cookie preferences"}),doNotSellRedirectTitle:e.formatMessage({id:"B/scGc",defaultMessage:"Do not sell or share my information"}),doNotSellRedirectDetails1:e.formatMessage({id:"0l+dTX",defaultMessage:"Do Not Sell preferences cannot be confirmed on this page. If you wish to continue Do Not Sell selection, visit our"}),doNotSellLinkText:e.formatMessage({id:"LNz7a7",defaultMessage:"Do Not Sell"}),doNotSellRedirectDetails2:e.formatMessage({id:"my7axt",defaultMessage:"page."})})})),define("metaserver/static/js/modules/clean/privacy_consent/log",["require","exports","tslib","metaserver/static/js/modules/clean/privacy_consent/stats","metaserver/static/js/modules/clean/ux_analytics/lazy_ux_analytics","metaserver/static/js/modules/clean/ux_analytics/dispatch_custom_event","metaserver/static/js/modules/core/exception"],(function(e,t,i,n,o,r,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PrivacyConsentLogImpl=void 0,r=i.__importStar(r);t.PrivacyConsentLogImpl=class{logIframeLoad(e,t){const i=(new Date).valueOf()-e.valueOf();a("privacyConsentIframeLoaded",{total_time:i.toString(),iframe_uri:t}),n.PrivacyConsentStats.logDuration(n.PrivacyConsentAmpMetrics.CROWNPEAK_LOAD_LATENCY,{},i),n.PrivacyConsentStats.logCounter(n.PrivacyConsentAmpMetrics.EVENTS,{eventName:n.PrivacyConsentEvent.SETUP_REENTRY_START})}logPrivacyConsentResult(e){const t=e?n.PrivacyConsentEvent.SETUP_REENTRY_SUCCESS:n.PrivacyConsentEvent.SETUP_REENTRY_FAILURE;n.PrivacyConsentStats.logCounter(n.PrivacyConsentAmpMetrics.EVENTS,{event_name:t}),e||s.reportException({err:new Error(`Privacy consent module is not visible on page ${window.location.pathname}`),severity:s.SEVERITY.NONCRITICAL,tags:["privacy_consent"]})}logPrivacyConsentScriptLoaded(e){a("privacyConsentScriptLoaded",{script_id:e.scriptId,script_url:e.scriptUrl})}logPrivacyConsentScriptLoadError(e){a("privacyConsentScriptLoadError",{script_id:e.scriptId,script_url:e.scriptUrl}),s.reportException({err:new Error("Privacy consent module is running into load error"),severity:s.SEVERITY.NONCRITICAL,tags:["privacy_consent"]})}logCCPAIframeLoad(e){n.PrivacyConsentStats.logCounter(n.PrivacyConsentAmpMetrics.EVENTS,{event_name:n.CCPAEvent.IFRAME_LOAD_SUCCESS}),n.PrivacyConsentStats.logDuration(n.PrivacyConsentAmpMetrics.CCPA_IFRAME_LOAD_LATENCY,{},e)}logCCPAIframeError(e){const t=Date.now()-e.start_time;n.PrivacyConsentStats.logCounter(n.PrivacyConsentAmpMetrics.EVENTS,{event_name:n.CCPAEvent.IFRAME_LOAD_ERROR}),n.PrivacyConsentStats.logDuration(n.PrivacyConsentAmpMetrics.CCPA_IFRAME_LOAD_LATENCY,{},t),s.reportException({err:new Error("CCPA iframe failed to load"),severity:s.SEVERITY.CRITICAL,tags:["privacy_consent","ccpa_iframe"]})}logInvalidCookieCategoryException(e){s.reportException({err:new Error("Invalid cookie category id"),severity:s.SEVERITY.NONCRITICAL,tags:["privacy_consent"],exc_extra:{cookie_id:e}})}logCookieParseException(e,t){s.reportException({err:new Error(`Cookie ${e} could not be parsed`),severity:s.SEVERITY.NONCRITICAL,tags:["privacy_consent"],exc_extra:{cookie_str:t}})}};const a=(e,t)=>{const i={detail:{eventType:e,extra:t}};o.runAfterUxaListening(()=>{r.dispatchCustomEvent("privacy_consent_custom_event",i)})}})),define("metaserver/static/js/modules/clean/privacy_consent/marketing_tracker",["require","exports","metaserver/static/js/modules/clean/marketing_tracker"],(function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateConsentCategories=void 0,t.updateConsentCategories=e=>{i.MarketingTracker.tryPushEvent("updateConsentCategories",i.EventTypeEnum.Link,{consent_categories:e.join(",")})}})),define("metaserver/static/js/modules/clean/privacy_consent/privacy_consent_platform",["require","exports","metaserver/static/js/modules/clean/privacy_consent/privacy_consent_cookies","metaserver/static/js/modules/clean/privacy_consent/consent_iframe_wrapper","metaserver/static/js/modules/clean/privacy_consent/sandbox_redirect"],(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PrivacyConsentPlatformSingleton=void 0;class r{constructor(e){if(this.manageCookiesSet=!1,this.manageCookiesInjected=!1,this.floatingButtonVisible=!1,this.bannerVisible=!1,this.isInIframe=!1,this.gpcSignal=!1,this.isFooterLoading=!1,r.instance)return r.instance;r.instance=this,this.log=e.log,this.updateConsentCategories=e.updateConsentCategories,this.intlText=e.intlText,this.ttiTimeout=e.ttiTimeout,this.waitForTTI=e.waitForTTI,this.redirect=e.redirect,this.isInIframe=window.self!=window.top,this.openOptionsDialog=this.openOptionsDialog.bind(this)}init(e,t){var o,r,s;this.config=e,this.redirectUrlForSandboxedPage=null===(o=null==t?void 0:t.thirdPartyConfig)||void 0===o?void 0:o.redirectUrlForSandboxedPage;const a={};if((null===(r=null==t?void 0:t.thirdPartyConfig)||void 0===r?void 0:r.cookieDomain)&&(a.cookieDomain=t.thirdPartyConfig.cookieDomain),this.cookieStore=new i.ConsentCookieStore(a,this.log),this.updateTealiumDataLayer(),!e.iframeOrigin||(null===(s=this.consentIframeWrapper)||void 0===s?void 0:s.iframeExists())||document.getElementById("consent-iframe")||this.isInIframe)return;const c=!(null==t||!t.disableBanner)&&(null==t?void 0:t.disableBanner);this.onBannerVisibleCallback=null==t?void 0:t.onBannerVisible,this.consentChangedCallback=null==t?void 0:t.consentChangedCallback,this.priorConsentCallback=null==t?void 0:t.priorConsentCallback,this.consentDeclinedCallback=null==t?void 0:t.consentDeclinedCallback,this.disableFloatingButton=!!t&&!t.injectFloatingButton,this.injectToFooter=!t||t.injectToFooter;const l=new URLSearchParams(window.location.search);this.consentIframeWrapper=new n.ConsentIframeWrapper({log:this.log,waitForTTI:this.waitForTTI,ttiTimeout:this.ttiTimeout,iframeOrigin:`https://${e.iframeOrigin}`,iframeTitle:this.intlText.consentIframeTitle,clientInfo:l.get("client_info")||"",disableBanner:c,isCcpaEnabled:this.config.isCcpaEnabled,isGpcEnabled:this.isGPCEnabled(),hideGdpr:this.getHideGDPR(l.get("hide_gdpr")),sandboxRedirect:void 0!==this.redirectUrlForSandboxedPage,ccpaToken:this.getCCPAToken(l.get("ccpa_token")),locale:null==t?void 0:t.locale,urlHash:window.location.hash,onRenderSandboxRedirect:this.onRenderSandboxRedirect.bind(this),onBannerVisible:e=>this.onBannerVisible(e),onBannerNotVisible:null==t?void 0:t.onBannerNotVisible,onIframeLoad:()=>this.onIframeLoad(),setupSettingsReEntry:()=>this.setupSettingsReEntry(),onEvidonCookieWrite:e=>{var t;return null===(t=this.cookieStore)||void 0===t?void 0:t.bakeEvidonCookie(e)},onPriorConsent:e=>this.onPriorConsent(e),onConsentChanged:e=>this.onConsentChanged(e),onConsentDeclined:e=>this.onConsentDeclined(e),onDNSEnabled:(e,t)=>this.onDNSEnabled(e,t),onDNSDisabled:()=>this.onDNSDisabled(),onGPCEnabled:()=>this.onGPCEnabled(),redirect:e=>this.redirect(e)}),this.gpcSignal=this.isGPCEnabled(),this.consentIframeWrapper.createIframe()}getHideGDPR(e){return("true"===e||"false"===e)&&"true"===e}getCCPAToken(e){var t,n;if(null!==e){const i=new Date;i.setDate(i.getDate()+1),null===(t=this.cookieStore)||void 0===t||t.bakeCCPATokenCookie({ccpaToken:e,expireDate:i.toISOString()});const n=/&?ccpa_token=[^&^#]+/,o=window.location.search.replace(n,""),r=`${window.location.pathname}${o}${window.location.hash}`;return window.history.replaceState({},"",r),e}const o=null===(n=this.cookieStore)||void 0===n?void 0:n.getCurrentCookieObj(i.CCPA_TOKEN_COOKIE_NAME);return o&&o.ccpaToken?o.ccpaToken:""}onIframeLoad(){var e;null===(e=this.consentIframeWrapper)||void 0===e||e.sendCCPARedirectText({doNotSellRedirectTitle:this.intlText.doNotSellRedirectTitle,doNotSellRedirectDetails1:this.intlText.doNotSellRedirectDetails1,doNotSellLinkText:this.intlText.doNotSellLinkText,doNotSellRedirectDetails2:this.intlText.doNotSellRedirectDetails2}),this.setupSettingsReEntry(),this.logPrivacyConsentResult()}onFooterLoaded(){this.waitForTTI({timeoutMS:this.ttiTimeout}).then(()=>{var e;this.setupSettingsReEntry();const t=null===(e=this.consentIframeWrapper)||void 0===e?void 0:e.getBannerHeight();void 0!==t&&void 0!==this.onBannerVisible&&this.onBannerVisible(t)})}setupSettingsReEntry(){!this.config||this.manageCookiesSet||this.manageCookiesInjected||(this.injectToFooter&&(this.setManageCookies(),this.injectManageCookies()),this.maybeUseFloatingButton())}setManageCookies(){if(this.manageCookiesSet||this.manageCookiesInjected)return;const e=this.findManageCookies();e&&(e.setAttribute("href","#manage-cookies"),e.onclick=e=>this.onClickManageCookies(e),e.textContent=this.config.isCcpaEnabled?this.intlText.cookiesAndCCPA:this.intlText.manageCookies,this.manageCookiesSet=!0)}openOptionsDialog(){var e;null===(e=this.consentIframeWrapper)||void 0===e||e.openOptionsDialog()}isGPCEnabled(){return this.config.isCcpaEnabled&&navigator.globalPrivacyControl}onGPCEnabled(){var e;const t=new Date;t.setMonth(t.getMonth()+12),null===(e=this.cookieStore)||void 0===e||e.bakeDNSCookie({optInToDNS:!0,expireDate:t.toISOString()})}maybeUseFloatingButton(){var e,t;this.disableFloatingButton||null===(e=this.consentIframeWrapper)||void 0===e||!e.iframeExists()||this.manageCookiesSet||this.manageCookiesInjected||this.isFooterLoading||(null===(t=this.consentIframeWrapper)||void 0===t||t.sendShowFloatingButton(this.config.isCcpaEnabled?this.intlText.cookiesAndCCPA:void 0),this.floatingButtonVisible=!0)}updateTealiumDataLayer(){this.updateConsentCategories&&this.cookieStore&&this.updateConsentCategories(this.cookieStore.getAllowedCategories())}onPriorConsent(e){var t,i,n;const o=(null===(t=this.cookieStore)||void 0===t?void 0:t.mapCookies(e))||{};let r=!0;this.cookieStore&&(r=null===(i=this.cookieStore)||void 0===i?void 0:i.havePreferencesChanged(o)),(!(null===(n=this.cookieStore)||void 0===n?void 0:n.hasUserInteracted())&&!this.gpcSignal||r)&&this.saveShadowCookie(e,!0),this.priorConsentCallback&&this.priorConsentCallback(o,r)}onConsentChanged(e){var t,i;const n=(null===(t=this.cookieStore)||void 0===t?void 0:t.mapCookies(e))||{},o=null===(i=this.cookieStore)||void 0===i?void 0:i.havePreferencesChanged(n);this.saveShadowCookie(e,!0),o&&this.consentChangedCallback&&this.consentChangedCallback(n)}onConsentDeclined(e){var t;if(this.saveShadowCookie(e,!0),this.consentDeclinedCallback){const i=(null===(t=this.cookieStore)||void 0===t?void 0:t.mapCookies(e))||{};this.consentDeclinedCallback(i)}}onDNSEnabled(e,t){var i;null!=t&&""!==t&&null!=e&&(null===(i=this.cookieStore)||void 0===i||i.bakeDNSCookie({optInToDNS:e,expireDate:t}))}onDNSDisabled(){var e;null===(e=this.cookieStore)||void 0===e||e.clearDNSCookie()}onClickManageCookies(e){var t;e.preventDefault(),void 0!==this.redirectUrlForSandboxedPage?this.onRenderSandboxRedirect():null===(t=this.consentIframeWrapper)||void 0===t||t.openOptionsDialog()}onRenderSandboxRedirect(){o.renderSandboxRedirect({sandboxRedirectTitle:this.intlText.sandboxRedirectTitle,sandboxRedirectDetails:this.intlText.sandboxRedirectDetails,sandboxRedirectLinkText:this.intlText.sandboxRedirectLinkText,href:this.redirectUrlForSandboxedPage})}onBannerVisible(e){var t;(null===(t=this.cookieStore)||void 0===t?void 0:t.hasUserInteracted())||this.saveShadowCookie({},!1),this.onBannerVisibleCallback&&this.onBannerVisibleCallback(e)}saveShadowCookie(e,t){var n,o,r;if(this.cookieStore){const s=null===(n=this.cookieStore)||void 0===n?void 0:n.mapCookies(e),a=null===(o=this.cookieStore)||void 0===o?void 0:o.createShadowCookieValue(s,t);if(null===(r=this.cookieStore)||void 0===r||r.bakeShadowCookie(a),this.consentIframeWrapper){const e=new Date(a.expireDate).toUTCString(),t=i.createCookieStr("dropbox.com",i.SHADOW_COOKIE_NAME,a,e,"None");this.consentIframeWrapper.writeShadowCookie(t)}}}findManageCookies(){return document.querySelector('a[href*="#manage-cookies"], a.evidon-notice-link')||null}findCookiePolicy(e){return(null==e?void 0:e.querySelector('a[href*="/terms/cookies"],a[href*="/accounts-billing/security/cookies"]'))||null}getLinkWrapper(e){return e.closest("li")}createManageCookies(e){const t=this.getLinkWrapper(e);if(t){const i=t.cloneNode(),n=document.createElement("a");return n.textContent=this.config.isCcpaEnabled?this.intlText.cookiesAndCCPA:this.intlText.manageCookies,n.setAttribute("class",e.className),n.setAttribute("href","#manage-cookies"),n.onclick=e=>this.onClickManageCookies(e),i.appendChild(n),i}return null}findFooter(){const e=["pre-footer","matrix__footer","footer-cta","footer-secondary-cta","cta-footer"],t=["div","section","footer"],i=Array.from(document.querySelectorAll(["footer",'[id="footer"]','[class="footer"]','[class^="footer "]','[class*=" footer "]','[class$=" footer"]','[id*="-footer"]','[id^="footer-"]','[id*="_footer"]','[id^="footer_"]','[class*="-footer"]','[class^="footer-"]','[class*="_footer"]','[class^="footer_"]'].join(","))).filter(i=>t.includes(i.tagName.toLowerCase())&&!e.some(e=>i.classList.contains(e)));return i.length?i[0]:null}injectManageCookies(){if(this.manageCookiesSet||this.manageCookiesInjected)return;const e=this.findFooter(),t=e?this.findCookiePolicy(e):null;if(!this.manageCookiesSet&&t){const e=this.createManageCookies(t),i=this.getLinkWrapper(t);e&&i&&(i.insertAdjacentElement("afterend",e),this.renameCookiePolicyLink(t),this.manageCookiesInjected=!0)}}renameCookiePolicyLink(e){e.textContent=this.intlText.cookiePolicy}logPrivacyConsentResult(){var e;const t=this.manageCookiesSet||this.manageCookiesInjected||this.floatingButtonVisible||this.bannerVisible;null===(e=this.log)||void 0===e||e.logPrivacyConsentResult(t)}}t.PrivacyConsentPlatformSingleton=r})),define("metaserver/static/js/modules/clean/privacy_consent/stats",["require","exports","metaserver/static/js/modules/clean/metrics/index","apex-metrics/index","metaserver/static/js/modules/core/exception"],(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PrivacyConsentStats=t.PrivacyConsentStatsSingleton=t.PrivacyConsentAmpMetrics=t.PrivacyConsentEvent=t.CCPAEvent=void 0;(function(e){e.DNS_OPT_IN="dns_opt_in_submitted",e.DNS_OPT_OUT="dns_opt_out_submitted",e.IFRAME_LOAD_SUCCESS="ccpa_iframe_load_success",e.IFRAME_LOAD_ERROR="ccpa_iframe_load_error",e.LOGGED_IN_OPT_OUT_DNS_ERROR="ccpa_logged_in_opt_out_dns_error",e.LOGGED_IN_OPT_IN_DNS_ERROR="ccpa_logged_in_opt_in_dns_error",e.LOGGED_IN_RESEND_EMAIL_ERROR="ccpa_logged_in_resend_email_error",e.LOGGED_OUT_OPT_OUT_DNS_ERROR="ccpa_logged_out_opt_out_dns_error",e.LOGGED_OUT_OPT_IN_DNS_ERROR="ccpa_logged_out_opt_in_dns_error",e.LOGGED_OUT_RESEND_EMAIL_ERROR="ccpa_logged_out_resend_email_error",e.EMAIL_VERIFICATION_PAGE_VISIT="ccpa_email_verification_page_visited",e.EMAIL_VERIFICATION_PAGE_ERROR="ccpa_email_verification_page_error",e.EMAIL_VERIFICATION_CONFIRM_CLICKED="ccpa_email_confirm_clicked",e.EMAIL_VERIFICATION_CANCEL_CLICKED="ccpa_email_cancel_clicked",e.CSRF_TOKEN_ERROR="csrf_token_error"})(t.CCPAEvent||(t.CCPAEvent={})),(function(e){e.SETUP_REENTRY_SUCCESS="setup_reentry_success",e.SETUP_REENTRY_FAILURE="setup_reentry_failure",e.SETUP_REENTRY_START="setup_reentry_start"})(t.PrivacyConsentEvent||(t.PrivacyConsentEvent={})),(function(e){e.CCPA_IFRAME_LOAD_LATENCY="ccpa_iframe_load_latency",e.CROWNPEAK_LOAD_LATENCY="crownpeak_load_latency",e.EVENTS="events"})(t.PrivacyConsentAmpMetrics||(t.PrivacyConsentAmpMetrics={}));class r{constructor(){this.metricsReporter=i.getMetricsReporter()}createCounter(e,t={}){return this.metricsReporter.createCounter({ns:"privacy_consent",name:e},t)}createStats(e,t={}){return this.metricsReporter.createStats({ns:"privacy_consent",name:e},t)}logCounter(e,t={}){try{const i=this.createCounter(e,t);i.increment(),i.record()}catch(t){o.reportStack(`PrivacyConsentAmpLogError: Failed to log AMP metric for event: ${e}.`,{severity:o.SEVERITY.NONCRITICAL,tags:["privacy_consent"],silent:!0})}}logDuration(e,t={},i){try{this.createStats(e,t).recordDuration(i,n.TimeUnit.MILLISECONDS)}catch(t){o.reportStack(`PrivacyConsentAmpLogError: Failed to log AMP metric for event: ${e}.`,{severity:o.SEVERITY.NONCRITICAL,tags:["privacy_consent"],silent:!0})}}logStats(e,t={},i){try{this.createStats(e,t).record(i)}catch(t){o.reportStack(`PrivacyConsentAmpLogError: Failed to log AMP metric for event: ${e}.`,{severity:o.SEVERITY.NONCRITICAL,tags:["privacy_consent"],silent:!0})}}}t.PrivacyConsentStatsSingleton=r,t.PrivacyConsentStats=new r})),define("metaserver/static/js/modules/clean/privacy_consent/consent_iframe_wrapper",["require","exports","tslib","metaserver/static/js/modules/clean/privacy_consent/privacy_consent_cookies","metaserver/static/js/modules/clean/privacy_consent/privacy_consent.module.css"],(function(e,t,i,n,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsentIframeWrapper=void 0,o=i.__importDefault(o);var r,s;(function(e){e.shadowCookieWrite="SHADOW_COOKIE_WRITE",e.csrfHandshakeEnd="CSRF_HANDSHAKE_END",e.ccpaRedirectText="CCPA_REDIRECT_TEXT"})(r||(r={})),(function(e){e.bodyContentChange="BODY_CONTENT_CHANGE",e.bannerResize="BANNER_RESIZE",e.displayButton="DISPLAY_BUTTON",e.priorConsent="PRIOR_CONSENT",e.consentChanged="CONSENT_CHANGED",e.consentWithdrawn="CONSENT_WITHDRAWN",e.consentDeclined="CONSENT_DECLINED",e.scriptLoaded="SCRIPT_LOADED",e.scriptLoadError="SCRIPT_LOAD_ERROR",e.toggleButtonMinimize="TOGGLE_BUTTON_MINIMIZE",e.dnsEnabled="DNS_ENABLED",e.dnsDisabled="DNS_DISABLED",e.ccpaConsentSettingsRegistered="CCPA_CONSENT_SETTINGS_REGISTERED",e.ccpaCookieFaqClick="CCPA_COOKIE_FAQ_CLICK",e.dnsPageClick="DNS_PAGE_CLICK",e.ccpaIframeLoad="CCPA_IFRAME_LOAD",e.ccpaIframeError="CCPA_IFRAME_ERROR",e.evidonCookieWrite="EVIDON_COOKIE_WRITE",e.setCookieSettingsMinimized="SET_COOKIE_SETTINGS_MINIMIZED",e.csrfHandshakeStart="CSRF_HANDSHAKE_START",e.renderSandboxRedirect="RENDER_SANDBOX_REDIRECT"})(s||(s={}));t.ConsentIframeWrapper=class{constructor(e){this.bannerVisible=!1,this.optionsButtonLoaded=!1,this.manageCookiesSet=!1,this.log=e.log,this.waitForTTI=e.waitForTTI,this.ttiTimeout=e.ttiTimeout,this.iframeOrigin=e.iframeOrigin,this.iframeTitle=e.iframeTitle,this.clientInfo=e.clientInfo,this.disableBanner=e.disableBanner,this.countryCode=e.countryCode,this.isCcpaEnabled=e.isCcpaEnabled,this.isGpcEnabled=e.isGpcEnabled,this.hideGdpr=e.hideGdpr,this.sandboxRedirect=e.sandboxRedirect,this.ccpaToken=e.ccpaToken,this.locale=e.locale,this.urlHash=e.urlHash,this.onIframeLoad=e.onIframeLoad,this.setupSettingsReEntry=e.setupSettingsReEntry,this.onEvidonCookieWrite=e.onEvidonCookieWrite,this.onRenderSandboxRedirect=e.onRenderSandboxRedirect,this.onBannerVisible=e.onBannerVisible,this.onBannerNotVisible=e.onBannerNotVisible,this.onPriorConsent=e.onPriorConsent,this.onConsentChanged=e.onConsentChanged,this.onConsentDeclined=e.onConsentDeclined,this.onDNSEnabled=e.onDNSEnabled,this.onDNSDisabled=e.onDNSDisabled,this.onGPCEnabled=e.onGPCEnabled,this.redirect=e.redirect}createIframe(){const e=new Date,t=document.createElement("iframe"),i=new URLSearchParams;i.append("hide_gdpr",String(this.hideGdpr)),i.append("is_ccpa_enabled",String(this.isCcpaEnabled)),i.append("gpc_signal",String(this.isGpcEnabled)),i.append("origin",encodeURIComponent(window.location.origin)),i.append("sandbox_redirect",String(this.sandboxRedirect)),this.locale&&i.append("locale",this.locale),this.ccpaToken&&i.append("ccpa_token",this.ccpaToken),void 0!==window.sandbox_verifier&&i.append("sandbox_verifier",window.sandbox_verifier);const r=this.isCrossOrigin(),s=n.getCookieStr(n.EVIDON_CONSENT_COOKIE_NAME),a=n.getCookieStr(n.EVIDON_SUPPRESS_COOKIE_NAME);r&&""!==s&&i.append(n.EVIDON_CONSENT_COOKIE_NAME,encodeURIComponent(s)),r&&""!==a&&i.append(n.EVIDON_SUPPRESS_COOKIE_NAME,encodeURIComponent(a));let c=null;try{c=sessionStorage.getItem("cookie-settings-minimized")}catch(e){}null!=c&&i.append("minimized",c);const l=`${this.iframeOrigin}?${i.toString()}${this.urlHash}`;t.src=l,t.setAttribute("sandbox","allow-scripts allow-same-origin allow-popups allow-forms"),t.setAttribute("class",`${o.default.consentIframe} ${this.disableBanner?o.default.noBanner:""}`),t.setAttribute("id","consent-iframe"),t.setAttribute("allowTransparency","true"),t.setAttribute("width","0"),t.setAttribute("height","0"),t.setAttribute("hidden","true"),t.setAttribute("scrolling","no"),t.setAttribute("title",this.iframeTitle),t.setAttribute("tabindex","1"),document.body.insertBefore(t,document.body.childNodes[0]),t.addEventListener("load",()=>{this.handleIframeLoad(e,this.iframeOrigin)}),window.addEventListener("message",e=>this.receiveMessage(e),!1),this.iframeEl=t}iframeExists(){return void 0!==this.iframeEl}receiveMessage(e){var t,i;const n=e.data;if(e.source===(null===(t=this.iframeEl)||void 0===t?void 0:t.contentWindow)||e.origin.endsWith("dropbox.com"))switch(n.message_type){case s.bodyContentChange:this.onBodyContentChange(n);break;case s.bannerResize:this.onBannerResize(n);break;case s.displayButton:this.onDisplayButton(n);break;case s.priorConsent:this.onPriorConsent(n.categories);break;case s.consentChanged:case s.consentWithdrawn:this.onConsentChanged(n.categories);break;case s.consentDeclined:this.onConsentDeclined(n.categories);break;case s.scriptLoaded:this.onScriptLoaded(n);break;case s.scriptLoadError:this.onScriptLoadError(n);break;case s.toggleButtonMinimize:this.onToggleButtonMinimize(n.buttonMinimized);break;case s.dnsEnabled:this.onDNSEnabled(n.optInToDNS,n.expireDate);break;case s.dnsDisabled:this.onDNSDisabled();break;case s.ccpaConsentSettingsRegistered:break;case s.ccpaCookieFaqClick:this.redirect("https://help.dropbox.com/accounts-billing/security/cookies");break;case s.dnsPageClick:window.open("https://www.dropbox.com/ccpa-consent-settings?hide_gdpr=true","_blank","noopener,noreferrer");break;case s.ccpaIframeLoad:this.onCCPAIFrameLoad(n);break;case s.ccpaIframeError:null===(i=this.log)||void 0===i||i.logCCPAIframeError(n);break;case s.evidonCookieWrite:this.onEvidonCookieWrite(n.cookie);break;case s.setCookieSettingsMinimized:try{sessionStorage.setItem("cookie-settings-minimized",n.minimized)}catch(e){}break;case s.csrfHandshakeStart:this.send({message_type:r.csrfHandshakeEnd,token:n.token});break;case s.renderSandboxRedirect:this.onRenderSandboxRedirect()}}openOptionsDialog(){this.send({message_type:"OPEN_OPTIONS_DIALOG"})}sendShowFloatingButton(e){this.send({message_type:"SHOW_FLOATING_BUTTON",text_override:e})}getBannerHeight(){var e;if(this.bannerVisible){return(null===(e=this.iframeEl)||void 0===e?void 0:e.height)?parseInt(this.iframeEl.height,10):0}}writeShadowCookie(e){this.isCrossOrigin()&&this.send({message_type:r.shadowCookieWrite,cookie:e})}sendCCPARedirectText(e){this.isCrossOrigin()&&this.send({message_type:r.ccpaRedirectText,localized_text:e})}send(e){var t,i;void 0===this.iframeEl&&console.log("Cannot send message before consent iframe is created");let n=window.sandbox_verifier?"*":this.iframeOrigin;null===(i=null===(t=this.iframeEl)||void 0===t?void 0:t.contentWindow)||void 0===i||i.postMessage(e,n)}handleGPCSignal(){this.isGpcEnabled&&(this.onGPCEnabled(),this.send({message_type:"DNS_GPC_SIGNAL"}))}sendCountryCode(){this.countryCode&&this.send({message_type:"COUNTRY_CODE",country_code:this.countryCode})}handleIframeLoad(e,t){var i;null===(i=this.log)||void 0===i||i.logIframeLoad(e,t),this.waitForTTI({timeoutMS:this.ttiTimeout}).then(()=>{this.handleGPCSignal(),this.sendCountryCode(),this.bannerVisible&&this.triggerOnBannerVisible(),this.onIframeLoad()})}onBodyContentChange(e){var t,i,n,r,s,a;const{bannerVisible:c,dialogVisible:l,optionsButtonVisible:d,optionsButtonLoaded:u}=e;this.bannerVisible=c&&!this.isGpcEnabled;const p=!this.bannerVisible&&!l&&!d;if(null===(t=this.iframeEl)||void 0===t||t.classList.toggle(o.default.bannerVisible,c),null===(i=this.iframeEl)||void 0===i||i.classList.toggle(o.default.dialogOpen,l),null===(n=this.iframeEl)||void 0===n||n.classList.toggle(o.default.buttonEnabled,d),u&&!this.optionsButtonLoaded&&(this.optionsButtonLoaded=!0,this.setupSettingsReEntry()),p?(this.setIframeHeight("0"),this.setIframeWidth("0")):null===(r=this.iframeEl)||void 0===r||r.removeAttribute("hidden"),this.bannerVisible?this.triggerOnBannerVisible():this.onBannerNotVisible&&this.onBannerNotVisible(),d){let e=!1;try{e="true"===sessionStorage.getItem("cookie-settings-minimized")}catch(e){}null===(s=this.iframeEl)||void 0===s||s.classList.toggle("prev-collapsed",e)}else null===(a=this.iframeEl)||void 0===a||a.classList.remove(o.default.prevCollapsed,o.default.collapsed,o.default.expanded)}onBannerResize(e){var t;e.bannerHeight&&e.bannerHeight!==(null===(t=this.iframeEl)||void 0===t?void 0:t.height)&&(this.setIframeHeight(e.bannerHeight),this.onBannerVisible&&this.triggerOnBannerVisible())}onDisplayButton(e){!this.manageCookiesSet&&e.buttonHeight&&e.buttonWidth&&(this.setIframeHeight(e.buttonHeight),this.setIframeWidth(e.buttonWidth))}onToggleButtonMinimize(e){var t,i,n,r;null===(t=this.iframeEl)||void 0===t||t.classList.remove(o.default.prevCollapsed),null===(i=this.iframeEl)||void 0===i||i.classList.toggle(o.default.collapsed,e),null===(n=this.iframeEl)||void 0===n||n.classList.toggle(o.default.expanded,!e);try{sessionStorage.setItem("cookie-settings-minimized",(null===(r=this.iframeEl)||void 0===r?void 0:r.classList.contains("collapsed"))?"true":"false")}catch(e){}}onScriptLoaded(e){var t;null===(t=this.log)||void 0===t||t.logPrivacyConsentScriptLoaded(e)}onScriptLoadError(e){var t;null===(t=this.log)||void 0===t||t.logPrivacyConsentScriptLoadError(e)}onCCPAIFrameLoad(e){var t;this.sendPrivacyConsentPageInfo();const i=Date.now()-e.start_time;null===(t=this.log)||void 0===t||t.logCCPAIframeLoad(i)}setIframeHeight(e){this.iframeEl&&(this.iframeEl.height=e)}setIframeWidth(e){this.iframeEl&&(this.iframeEl.width=e)}triggerOnBannerVisible(){var e;const t=(null===(e=this.iframeEl)||void 0===e?void 0:e.height)?parseInt(this.iframeEl.height,10):0;this.onBannerVisible&&this.onBannerVisible(t)}sendPrivacyConsentPageInfo(){const e=window.location.hostname;this.send({message_type:"PRIVACY_CONSENT_PAGE_INFO",hostname:e,foreign_session_id:null,client_info:this.clientInfo})}isCrossOrigin(){return!(window.location.host.endsWith("dropbox.com")||window.location.host.endsWith(".dev.corp.dropbox.com")&&5===window.location.host.split(".").length)||void 0!==window.sandbox_verifier}}})); //# sourceMappingURL=pkg-privacy-consent-post-tti.min.js-vflPYcijX.map