module.exports = "(function(e,t,r){var n=r(5894),o=r(6322),s=r(280).v,a=r(4934),i=r(4810),u=r(4727).Promise,p=r(6474),c=t.DCPError=s(\"DCPError\");t.fetchDCPData=function(e){var t=function(e){var t;if(e.projectId){var o=e;if(__INVARIANT__&&r(2048).isType(\"DCPProjectRequestDescriptor\",e),!o.optlyDatasourceId)return i.error(\"DCP / No Optimizely datasource id passed to getBaseURL.\"),null;t=[o.projectId,o.optlyDatasourceId.toString(),o.uid]}else{var s=e;__INVARIANT__&&r(2048).isType(\"DCPSnippetRequestDescriptor\",e),t=[\"snippet\",s.snippetId,s.dcpServiceId,s.uid]}var a=n.map(t,encodeURIComponent),u=[_].concat(a).join(\"/\"),p=n.map(e.currentAliases,(function(e,t){return encodeURIComponent(t)+\"=\"+encodeURIComponent(e)}));return n.isEmpty(p)||(u+=\"?\"+p.join(\"&\")),u}(e);if(!t)return u.resolve({});(__PROFILE__||__RUM_VERBOSE__)&&r(9256).timeEnd(\"sendDCP\");var s=n.partial(p.request,{url:t}),d=\"dcps_\"+t;return o.makeAsyncRequest(d,(function(){s().then((function(e){var t;if(e.status>399)throw new c(e.status+\": \"+e.statusText);try{t=a.parse(e.response)}catch(e){throw new c(\"Error parsing response: \"+e.toString())}if(!t)throw new c(\"No data received\");return t}),(function(e){throw new c(e.status+\": \"+e.statusText)})).then(n.partial(o.resolveRequest,d),n.partial(o.rejectRequest,d))})).then((function(e){return __INVARIANT__&&r(2048).isType(\"DCPData\",e),e}))};var _=__DCP_TARGETING_URL__;0})";