Module 147964

1,585 characters · in no known chunk
Dependencies
Source Raw
function(e,t,n){"use strict";let r,i,s;n.d(t,{A:()=>y}),n(142703);var a=n(311907),o=n(73153),l=n(284016),u=n(253932),c=n(617617),d=n(189081);let _={applicationId:null,originURL:null},f=_,p=new Set,h=!1;function m(){s=null}function E(){r=null,i=null,p=new Set,f.applicationId=null,f.originURL=null,m()}function g(e){let{applicationId:t}=e;p.add(t),s=null}function A(e){let{applicationId:t,originURL:n}=e;r=t,i=n,p.delete(t),s=null,f.applicationId=t,f.originURL=n}function I(e){let{applicationId:t,error:n}=e;p.delete(t),s=n}function T(e){let{testModeApplicationId:t}=e;r=t}class S extends a.Ay.PersistedStore{static displayName="TestModeStore";static persistKey="TestModeStore";initialize(e){r=(f={...e??_}).applicationId,i=f.originURL,this.waitFor(d.A,l.A,c.A),this.syncWith([c.A,l.A],()=>!0),d.A.whenInitialized(()=>{h=!0})}inTestModeForApplication(e){return r===e}inTestModeForEmbeddedApplication(e){return r===e&&null!=i}shouldDisplayTestMode(e){return u.Q_.getSetting()&&this.inTestModeForApplication(e)}getState(){return f}get isTestMode(){return null!=r}get isFetchingAuthorization(){return p.size>0}get testModeEmbeddedApplicationId(){return null!=i?r:null}get testModeApplicationId(){return r}get testModeOriginURL(){return i}get error(){return s}whenInitialized(e){this.addConditionalChangeListener(()=>{if(h)return setImmediate(e),!1})}}let y=new S(o.h,{DEVELOPER_TEST_MODE_AUTHORIZATION_START:g,DEVELOPER_TEST_MODE_AUTHORIZATION_SUCCESS:A,DEVELOPER_TEST_MODE_AUTHORIZATION_FAIL:I,OVERLAY_INITIALIZE:T,DEVELOPER_TEST_MODE_RESET_ERROR:m,LOGOUT:E,DEVELOPER_TEST_MODE_RESET:E})}