define("metaserver/static/js/modules/clean/stormcrow/constants",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AMP_STORMCROW_EXPOSURE_METRIC_NAME=t.AMP_STORMCROW_WEB_NAMESPACE=void 0,t.AMP_STORMCROW_WEB_NAMESPACE="web_stormcrow",t.AMP_STORMCROW_EXPOSURE_METRIC_NAME="stormcrow_exposure"})),define("metaserver/static/js/modules/clean/stormcrow/explicit_exposure_logging",["require","exports","tslib","metaserver/static/js/modules/clean/stormcrow/gating_factory","metaserver/static/js/modules/core/exception"],(function(e,t,r,s,o){"use strict";function a(e,t){return r.__awaiter(this,void 0,void 0,(function*(){const r={features:e};try{const e=yield s.getGatingClientSingleton().getVariant(r,t);return null==e?void 0:e.variantInfos}catch(e){return void o.reportException({err:e,severity:o.SEVERITY.CRITICAL,force:!0})}}))}function n(e){try{s.getGatingClientSingleton().logExposure({stormcrowVariantInfo:e})}catch(e){o.reportException({err:e,severity:o.SEVERITY.CRITICAL,force:!0})}}Object.defineProperty(t,"__esModule",{value:!0}),t.logExposure=t.getVariantInfos=t.getVariantAndLogExposure=void 0,o=r.__importStar(o),t.getVariantAndLogExposure=function(e,t,r){a([e],r).then(r=>{var s;n({feature:e,variant:t,metadata:null===(s=null==r?void 0:r[0])||void 0===s?void 0:s.metadata})})},t.getVariantInfos=a,t.logExposure=n})),define("metaserver/static/js/modules/clean/stormcrow/gating_factory",["require","exports","metaserver/static/js/api_v2/user_client","metaserver/static/js/api_v2/noauth_client","metaserver/static/js/modules/clean/stormcrow/stormcrow_with_pap_gating_client"],(function(e,t,r,s,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getGatingClientSingleton=t.GatingFactory=void 0;class a{constructor(e,t){this.userApiV2Client=e,this.noAuthAPIV2Client=t}getGatingClient(){return new o.StormcrowWithPAPGatingClient(this.userApiV2Client,this.noAuthAPIV2Client)}}let n,i;t.GatingFactory=a,t.getGatingClientSingleton=function(){if(!n){const e=new r.UserApiV2Client,t=new s.NoAuthApiV2Client;n=new a(e,t)}return i||(i=n.getGatingClient()),i}})),define("metaserver/static/js/modules/clean/stormcrow/stormcrow_gating_client",["require","exports","metaserver/static/js/modules/clean/stormcrow/types/log_exposure","metaserver/static/js/modules/clean/stormcrow/utils"],(function(e,t,r,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StormcrowGatingClient=void 0;t.StormcrowGatingClient=class{constructor(e,t){this.userApiV2Client=e,this.noAuthAPIV2Client=t}getVariant(e,t){const r=this.mapToAPIV2GetAssignmentsRequest(e);let s;return s=t?this.userApiV2Client.ns("stormcrow_servicer").rpc("get_assignments",r,{subjectUserId:t}):this.noAuthAPIV2Client.ns("stormcrow_servicer").rpc("get_assignments",r,{}),s.then(e=>this.mapToGetVariantResult(e))}legacyLogExposure(e,t,o){const a=this.mapToAPIV2LogExposuresRequest(e,t);let n;n=o?this.userApiV2Client.ns("stormcrow_servicer").rpc("log_exposures",a,{subjectUserId:o}):this.noAuthAPIV2Client.ns("stormcrow_servicer").rpc("log_exposures",a,{});const i=e.stormcrowVariantInfo.feature?e.stormcrowVariantInfo.feature:"unknown",c=e.stormcrowVariantInfo.variant?e.stormcrowVariantInfo.variant:"unknown";return n.then(e=>(s.reportExposureToAmp(i,c,r.ClientLogStatus.LOG_SUCCESS),this.mapToLogExposureResult(e))).catch(e=>{throw s.reportExposureToAmp(i,c,r.ClientLogStatus.LOG_FAILURE),e})}mapToLogExposureResult(e){return{status:e.status}}mapToGetVariantResult(e){if(e.assignments){return{variantInfos:e.assignments.map(e=>({feature:e.feature,variant:e.variant,metadata:e.metadata,status:e.status}))}}return null}mapToAPIV2GetAssignmentsRequest(e){return{request_params:{request_ip:e.request_ip,locales:e.locales,user_agent:e.user_agent},features:e.features.map(e=>({feature:e}))}}mapToAPIV2LogExposuresRequest(e,t){return t||(t=Date.now()),{exposures:[{feature:e.stormcrowVariantInfo.feature,variant:e.stormcrowVariantInfo.variant,metadata:e.stormcrowVariantInfo.metadata,timestamp:t}]}}}})),define("metaserver/static/js/modules/clean/stormcrow/stormcrow_with_pap_gating_client",["require","exports","metaserver/static/js/modules/clean/stormcrow/stormcrow_gating_client","metaserver/static/js/modules/clean/pap/analytics_client"],(function(e,t,r,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StormcrowWithPAPGatingClient=void 0;class o extends r.StormcrowGatingClient{logExposure(e){this.createAndLogPAPEvent(e)}createAndLogPAPEvent(e){var t,r,o,a,n;const i=null===(r=null===(t=e.stormcrowVariantInfo.metadata)||void 0===t?void 0:t.metadata)||void 0===r?void 0:r.population_id,c=null===(a=null===(o=e.stormcrowVariantInfo.metadata)||void 0===o?void 0:o.metadata)||void 0===a?void 0:a.identity_gid,l=null===(n=e.stormcrowVariantInfo.metadata)||void 0===n?void 0:n.metadata;let u=void 0;null!=l&&(u=JSON.stringify(l)),s.logExposureEvent(e.stormcrowVariantInfo.feature,e.stormcrowVariantInfo.variant,i,c,u)}}t.StormcrowWithPAPGatingClient=o})),define("metaserver/static/js/modules/clean/stormcrow/types/log_exposure",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClientLogStatus=t.LogExposureResult=t.LogExposureRequest=void 0;t.LogExposureRequest=class{};t.LogExposureResult=class{},(function(e){e.LOG_SUCCESS="log_success",e.LOG_FAILURE="log_failure"})(t.ClientLogStatus||(t.ClientLogStatus={}))})),define("metaserver/static/js/modules/clean/stormcrow/utils",["require","exports","metaserver/static/js/modules/clean/metrics/index","metaserver/static/js/modules/clean/stormcrow/constants"],(function(e,t,r,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportExposureToAmp=void 0,t.reportExposureToAmp=function(e,t,o){r.getMetricsReporter().createStats({ns:s.AMP_STORMCROW_WEB_NAMESPACE,name:s.AMP_STORMCROW_EXPOSURE_METRIC_NAME},{feature:e,variant:t,client_log_status:o}).record(1)}})),define("typescript/component_libraries/retrieval-components/src/collapsable-section/index",["require","exports","tslib","react","classnames","spectrum/button/index"],(function(e,t,r,s,o,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CollapsableSection=void 0,s=r.__importDefault(s),o=r.__importDefault(o),t.CollapsableSection=({title:e,isOpen:t,onHeaderClick:r,children:n,top:i,strings:c,containerClassName:l})=>s.default.createElement("div",{className:o.default({"rc-collapsable-section":!0,"rc-collapsable-section--closed":!t}),style:{top:i}},s.default.createElement("div",{className:"rc-collapsable-section__header"},s.default.createElement("h2",{className:"rc-collapsable-section__header-tag"},s.default.createElement("span",null,e),s.default.createElement(a.Button,{onClick:r,className:"rc-collapsable-section__toggle",variant:"styleless"},t?c.buttonClose:c.buttonOpen))),s.default.createElement("div",{className:l,style:{display:t?void 0:"none"}},n))})); //# sourceMappingURL=pkg-explicit-exposure-logging.min.js-vfl7i1v-8.map