module.exports = "(function(e,t,i){var r=i(5894),n=i(4727),o=i(7152),a=i(4810),s=i(4846),l=i(5218),g=\"google_analytics_4_audience_targeting\",u={provider:{isAsync:!0,isLazy:!0,getter:[\"stores/global\",\"stores/integration_settings\",function(e,t){var i=__GA4_AUDIENCE_EXTRACTION_URL__,u=e.getProjectId(),d=t.get(g);if(r.isEmpty(u))return n.reject(l.createGA4Error(\"GA4Audience missing projectId\"));var c,_,A=null==d?void 0:d.ga4_id_type;if(r.isEmpty(A)){var I=null==d?void 0:d.ga4_user_id;A=r.isEmpty(I)?s.GA4_ID_TYPE_DEVICE_ID:s.GA4_ID_TYPE_USER_ID}if(A===s.GA4_ID_TYPE_USER_ID){var E=null==d?void 0:d.ga4_user_id;if(a.log(\"GA4Audience using \"+E+\" to retrieve GA4 userID\"),r.isEmpty(E)){a.warn(\"GA4Audience Could not find User ID variable from integration settings, attempting to read ga4_user_id value from global store\");var G=e.getGA4UserId();c=\"function\"==typeof G?G.call():G}else{var p=o.getGlobalByPath(E);a.log(\"GA4Audience got GA4 userID from window: \"+p),c=\"function\"==typeof p?p.call():p}r.isEmpty(c)?a.warn(\"GA4Audience could not find User ID variable missing, attempting to use deviceID\"):a.log(\"GA4Audience using GA4 userID \"+c)}else window.optimizely=window.optimizely||[],_=l.getGACookie();var v=l.getDataLayer(),y=l.getTagId(v),D=l.getGtagFn(),m=\"GA4audience\";return A===s.GA4_ID_TYPE_USER_ID&&(r.isEmpty(v)||0===(null==v?void 0:v.length)||r.isEmpty(y))?l.callMakeAsyncRequest({source:m,url:i,projectId:u,ga4UserId:c}):A!==s.GA4_ID_TYPE_DEVICE_ID||r.isEmpty(_)?!c&&(null==v?void 0:v.length)>0&&r.isEmpty(y)?n.reject(l.createGA4Error(\"GA4Audience tagId missing\")):l.getGAClientIdFromGtagFn(D,y,\"client_id\").then((function(e){return l.callMakeAsyncRequest({source:m,url:i,projectId:u,ga4UserId:c,ga4DeviceId:e})})):l.callMakeAsyncRequest({source:m,url:i,projectId:u,ga4UserId:null,ga4DeviceId:_})}]},matcher:i(3584),vendor:g};e.exports=function(e){e.registerAudiencePlugin(u)}})";