module.exports = "(function(n,e,t){var i=t(5894),r=t(4527),a=\":\",o=\"holdback\",s=\"treatment\",l=\"\",g=t(4810),m=t(3316),u=__BACKFILLED_LAYER_INTEGRATION_STRING__;function c(n){return n.replace(/[^a-zA-Z0-9\\.\\~\\!\\*\\(\\)\\']+/g,\"_\")}e.formatNamesAndIdsForAnalytics=function(n,e,t,a){var o={layer:n.name||l,experiment:e.name||l,variation:t.name||l};a&&(o=i.mapValues(o,c));var s,g=u?1===n.integrationStringVersion:!n.integrationStringVersion||1===n.integrationStringVersion;if(o.experiment===l&&g)if(s=e.audienceIds,!i.isEmpty(s)&&i.includes([\"and\",\"or\",\"not\"],s[0]))o.experiment=\"Exp\";else{var m=r.get(\"stores/audience_data\");o.experiment=function(n,e){return i.isEmpty(e)?\"everyone_else\":i.reduce(e,(function(e,t){var i=n.get(t);return i?e+c(i.name?i.name:i.id)+\",\":e}),\"\").slice(0,-1)}(m,e.audienceIds)}return{names:o,idStrings:{layer:\"(\"+c(n.id)+\")\",experiment:\"(\"+c(e.id)+\")\",variation:\"(\"+c(t.id)+\")\"}}},e.combineAndTruncateIdAndName=function(n,e,t){var i=t-e.length;if(i<0&&(g.warn(\"maxLength must be at least long enough to fit the entity ID, which is length\"+e.length+\". Defaulting to only use entity ID as name.\"),n=l),n===l)return e;if(n.length>i){var r=Math.min(n.length,i);return(n=n.substring(0,r))+e}return n+\" \"+e},e.generateAnalyticsString=function(n,t,r,l,g,u){return n.integrationStringVersion&&2===n.integrationStringVersion?function(n,t,r,s,l,g){if(m.isSingleExperimentPolicy(n.policy)&&s)return;var u=!m.isSingleExperimentPolicy(n.policy)&&s,c=e.formatNamesAndIdsForAnalytics(n,t,r,g),h=[c.names.experiment,c.names.variation],d=[c.idStrings.experiment,c.idStrings.variation];m.isSingleExperimentPolicy(n.policy)||(h.unshift(c.names.layer),d.unshift(c.idStrings.layer));var f=i.reduce(d,(function(n,e){return n+e.length}),0),p=h.length-1+(u?1:0),y=f+1*p;if(u&&(y+=8),y>l)throw new Error(\"The analytics string size is too low to send the entity IDs.\");for(var v=l-y,x=h.length,S=[],I=h.length-1;I>=0;I--){var A=h[I],E=Math.min(A.length,Math.floor(v/x));v-=E,x--,S.unshift(A.substring(0,E))}var _=i.map(S,(function(n,e){return n+d[e]}));return u&&_.push(o),_.join(a)}(n,t,r,l,g,u):function(n,t,r,l,g,u){var c=l?o:s,h=3,d=e.formatNamesAndIdsForAnalytics(n,t,r,u),f=d.names,p=d.idStrings,y=i.reduce(p,(function(n,e){return n+e.length}),0);if(y+h+c.length>g)throw new Error(\"The analytics string size is too low to send the campaign, experiment, and variation IDs.\");var v=g-y-h-c.length,x={};x.variation=Math.min(f.variation.length,Math.floor(v/3)),v-=x.variation,x.experiment=Math.min(f.experiment.length,Math.floor(v/2)),v-=x.experiment,x.layer=v;var S={};i.each(f,(function(n,e){S[e]=n.substring(0,x[e])}));var I=[];return m.isSingleExperimentPolicy(n.policy)||I.push(S.layer+p.layer),(I=I.concat([S.experiment+p.experiment,S.variation+p.variation,c])).join(a)}(n,t,r,l,g,u)}})";