(function(){var p={"noAudience":false,"pixelUrl":"us-tag.nrich.ai/learning","audienceUrl":"us-audience.nrich.ai/audience","ltid":"7ab8344f-e9a2-48f7-8bea-ea13634364e4","ipAreaId":"36947","clientId":"1235","missIpArea":false,"isLead":false,"sendInitialOnly":false,"trackInterval":"20","isTest":false,"forceHttps":true,"inactivityPeriodMs":30000,"creInactivityPeriodMs":5000,"newMeasurementAllowedClients":"79,196","websocketAllowedClients":"196"};!function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=6)}([function(t,e){t.exports={postMessageTypes:{click:"click",scroll:"scroll",loaded:"loaded",active:"active",inactive:"inactive",playing:"playing",paused:"paused",ended:"ended",videoShow:"videoShow",videoHide:"videoHide",lead:"lead",cre:"cre"},postMessageSources:{adServer:"adServer",tag:"learningTag",innerTag:"learningTagInner"},contentTypes:{article:1,video:2},events:{tracking:"TRACKING",cre:"CRE_WIDGET_LOADED"},customEventClientId:1102}},function(t,e){t.exports=p},function(t,e,n){function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=n(9),r="not_sent",s="in_process",c="sent",a=r,u=[],l=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=new Image;if(n.src=t,"function"==typeof e){var i=function(){a=c,e()};n.complete?i():(n.addEventListener("load",i),n.addEventListener("error",i))}},d=function(){for(var t=u.pop();t;)l(t),t=u.pop()};t.exports={loadPixel:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=n?e+"?"+t.exports.toQueryString(n):e;switch(a){case r:i?(a=s,l(o,d)):u.push(o);break;case s:u.push(o);break;case c:l(o)}},loadErrorPixel:function(e,n){var i=o.parse(e)[0],r="".concat(n.forceHttps?"https://":"//").concat(n.pixelUrl,"/error?m="),s={m:e.message,j:JSON.stringify(e),n:i.functionName,l:i.lineNumber,c:i.columnNumber,f:i.fileName};t.exports.loadPixel("".concat(r).concat(btoa(JSON.stringify(s))))},loadScript:function(t,e,n){var i=document.head||document.getElementsByTagName("head")[0]||document.documentElement,o=document.createElement("script"),r=!1;o.type="text/javascript",o.src=t,n||(o.async=""),o.onload=o.onreadystatechange=function(){r||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(r=!0,e&&e(),o.onload=o.onreadystatechange=null,i&&o.parentNode&&i.removeChild(o))},i.appendChild(o)},toQueryString:function(e,n){var o=[],r=null;for(r in e)if(e.hasOwnProperty(r)){var s=n?n+"["+r+"]":r,c=e[r];o.push(null!==c&&"object"===i(c)?t.exports.toQueryString(c,s):encodeURIComponent(s)+"="+encodeURIComponent(c))}return o.join("&")},shallowMerge:function(){var t={};return Array.prototype.slice.call(arguments).forEach(function(e){for(var n in e)t[n]=e[n]}),t},debounce:function(t,e,n){var i;return function(){var o=this,r=arguments,s=n&&!i;clearTimeout(i),i=setTimeout(function(){i=null,n||t.apply(o,r)},e),s&&t.apply(o,r)}},getUrlParameter:function(t,e){for(var n=(window.location.search.split("?")[1]||"").split("&"),i=0,o=null;i<n.length;){if((o=n[i].split("="))[0]==t)return e?decodeURIComponent(o[1]):o[1];i++}return!1},isMobile:function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},isIOS:function(){return/(iPad|iPhone|iPod)/g.test(navigator.userAgent)},isES5Compliant:function(){"use strict";return Function.prototype.bind&&!this}(),initializeTags:function(e,n,i){var o=e[0],r=o&&o.en,s=o&&!0===o.cookieless,c=["TRACKING","CONTENT_LOADED","IP_AREA_MISS","CRE_WIDGET_LOADED"].indexOf(r)>=0;if(!n.noAudience&&n.audienceUrl&&!s&&c){var a="undefined";if(r)switch(r){case"TRACKING":a="tracking";break;case"CONTENT_LOADED":case"IP_AREA_MISS":a="advertisement";break;case"CRE_WIDGET_LOADED":a="cre"}t.exports.loadScript((n.forceHttps?"https://":"//")+n.audienceUrl+"/v1/renderRequiredTags?ltid="+n.ltid+"&ip_area_id="+n.ipAreaId+"&client_id="+n.clientId+"&type="+a,function(){i()})}else i()}}},function(t,e){function n(){return window.natify}function i(){return n()&&n().audience}function o(){return n()&&n().adServer}function r(){return o()?o().content:window.textIframeInstance}function s(){return o()?o().content:window.videoIframeInstance}t.exports={remarketingScripts:function(){return i()?i().remarketingScripts:{}},mas:function(){return i()&&i().mas},textIframe:r,videoIframe:s,isInWidgetIframe:function(){return!(!r()&&!s())},isInTracker:function(){return!!(o()?o():window.NatifyTrackerObject)},contentIframe:function(t){var e=document.getElementById(t);return e?e.querySelector("iframe"):null},contentWrapperDiv:function(t){return document.getElementById(t)},videoTag:function(){var t=document.getElementsByTagName("video");return t.length?t[0]:null}}},function(t,e,n){n(8);var i=n(2),o=n(3),r=n(0).postMessageTypes,s=n(0).postMessageSources,c={},a=250,u=50,l=25,d=null,f=1,h=!i.isES5Compliant,p={root:null,threshold:[]};h&&i.loadScript("https://polyfill.io/v2/polyfill.min.js?features=IntersectionObserver",function(){h=!1});for(var g=0;g<=1;g+=.01)p.threshold.push(g);function v(t){return t.visibility>=u?t.visibleDuration+(Date.now()-t.visibilityChangedAt):t.visibleDuration}function m(t,e){h?setTimeout(function(){m(t,e)},250):(observer=new window.IntersectionObserver(function(e){!function(t,e){var n=c[e];t.forEach(function(t){n.visibleDuration=v(n),n.visibility=Math.floor(t.intersectionRatio*f*100),n.visibilityChangedAt=Date.now(),n.callbacksCalled||(n.callbacksCalled=!0,n.callbacks.forEach(function(t){t()}))})}(e,t)},p),observer.POLL_INTERVAL=a,observer.observe(e))}t.exports={startTracking:function(t,e,n){var r=o.contentIframe(t),s=c[t];if(r)if(s)s.callbacksCalled?n():s.callbacks.push(n);else{if(c[t]={visibility:0,visibleDuration:0,visibilityChangedAt:Date.now(),callbacks:[n],callbacksCalled:!1},i.isIOS()){var a=o.contentWrapperDiv(t);a&&(f=a.scrollHeight/a.clientHeight)}m(t,r)}else n()},getVisibility:function(t){return c[t]&&c[t].visibility||0},getVisibleDuration:function(t){return c[t]?v(c[t]):0},isVisible:function(t){return this.getVisibility(t)>=u},createVideoViewObserver:function t(e){if(h)setTimeout(function(){t(e)},250);else{var n=new window.IntersectionObserver(function(t){t.forEach(function(t){!function(t,e){d!==t&&(d=t,e.postMessage({source:s.tag,status:t?r.videoShow:r.videoHide},"*"))}(Math.floor(100*t.intersectionRatio)>=l,window)})},p);n.POLL_INTERVAL=a,n.observe(e)}},createPageVisibilityObserver:function(t){var e,n;void 0!==document.hidden?(e="hidden",n="visibilitychange"):void 0!==document.msHidden?(e="msHidden",n="msvisibilitychange"):void 0!==document.webkitHidden&&(e="webkitHidden",n="webkitvisibilitychange"),document.addEventListener(n,function(){document[e]?t(!1):t(!0)},!1)}}},function(t,e,n){var i=n(0).postMessageTypes,o=n(0).contentTypes,r=n(0).events,s=n(0).postMessageSources,c=n(3),a=n(4),u=n(1),l=u.inactivityPeriodMs,d=u.creInactivityPeriodMs,f=-1!==u.newMeasurementAllowedClients.split(",").indexOf(u.clientId),h={},p=[];function g(t){var e=h[t];e.isEngagementBeingCounted||(e.startedCountAt=Date.now(),e.isEngagementBeingCounted=!0)}function v(t){h[t].engagementDuration=m(h[t]),h[t].isEngagementBeingCounted=!1}function m(t){return t.isEngagementBeingCounted?t.engagementDuration+(Date.now()-t.startedCountAt):t.engagementDuration}function y(t){a.isVisible(t)?g(t):v(t)}function b(t,e){var n=e.data||{};n.source===s.innerTag&&n.event===i.scroll&&n.contentId===h[t].contentId&&(g(t),function(t){h[t].shouldSendEngagement||(h[t].shouldSendEngagement=!0,h[t].onStartTrackingEngagement())}(t))}function w(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=h[t];if(n.en===r.tracking)g(t);else if(n.en===r.cre){if(e&&p[t])+new Date-p[t]>=d&&E()}}function E(){document.hidden||window.postMessage({source:s.tag,action:"creOpen"},"*")}function T(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=h[t];if(n.en===r.tracking)v(t);else if(n.en===r.cre){if(e)return void(p[t]=+new Date);E()}}function I(t,e){a.createPageVisibilityObserver(function(e){e?w(t,!0):T(t,!0)}),void 0===Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"playing")&&Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return!!(this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2)}});var n=document.querySelectorAll("video");[].slice.call(n).forEach(function(e){e.addEventListener("ended",function(){T(t)})});var i,o=null,r=function r(){var s=Date.now()-i;s>=e?(o=null,function(){if(0===n.length)return!1;for(var t=0;t<n.length;t++)if(n[t].playing)return!0;return!1}()||T(t)):o=setTimeout(r,e-s)},s=function(){i=Date.now(),w(t),o||(o=setTimeout(r,e))};document.addEventListener("mousemove",s,!1),document.addEventListener("scroll",s,!1),window.addEventListener("message",function(t){"creInnerFrame"===t.data.source&&"move"===t.data.action&&s()}),document.hidden||s()}t.exports={startTracking:function(t,e){var n=t.ltid,i=t.ntid,s=t.contentType,u=c.contentIframe(n);if(!h[n]){if(h[n]={shouldSendEngagement:s!==o.article,isEngagementBeingCounted:!1,startedCountAt:null,engagementDuration:0,en:t.en,onStartTrackingEngagement:e,contentId:i},t.en===r.tracking&&f||t.en===r.cre){var p=t.en===r.cre?d:l;I(n,p)}u&&(a.startTracking(n,i,function(){y(n)}),s===o.article&&(u.addEventListener("mouseover",function(){g(n)}),u.addEventListener("mouseout",function(){v(n)}),window.addEventListener("message",function(t){b(n,t)})),window.addEventListener("scroll",function(){y(n)}))}},getEngagementDuration:function(t){return h[t]&&h[t].shouldSendEngagement?m(h[t]):0}}},function(t,e,n){var i=n(1),o=n(7),r=n(2);try{var s=window.natify&&window.natify.$||[];i.sendInitialOnly?s.length&&s.forEach(function(t){o.sendTag(t)}):r.initializeTags(s,i,function(){o.startTracking()})}catch(t){r.loadErrorPixel(t,i)}},function(t,e,n){var i=n(4),o=n(5),r=n(11),s=n(12),c=n(13),a=n(3),u=n(2),l=n(14),d=n(1),f=n(0).customEventClientId,h={},p=10,g=2,v=null,m=window.onunload||function(){},y={ltid:d.ltid,is_test:d.isTest};function b(t){t=u.shallowMerge(t,{bwidth:window.innerWidth,bheight:window.innerHeight,swidth:window.screen.width,sheight:window.screen.height,url:location.href,ref:document.referrer||location.href,timezone:-1*(new Date).getTimezoneOffset(),_:Date.now()}),l.sendTag(t)}function w(t){t=t.map(function(t){return u.shallowMerge(t,{uuid:d.uuid,bwidth:window.innerWidth,bheight:window.innerHeight,swidth:window.screen.width,sheight:window.screen.height,url:location.href,ref:document.referrer||location.href,timezone:-1*(new Date).getTimezoneOffset(),_:Date.now()})}),l.sendSeveralTags(t)}function E(){for(var t in h)I(h[t])}function T(t,e){for(var n in h)h[n].tag.metadata=h[n].tag.metadata||{},h[n].tag.metadata[t]=e}function I(t){Date.now()-t.startTime>60*p*1e3?function(t){delete h[t.ltid]}(t.tag):(r.onAddPixelSend(t.tag.ltid),function(t){l.sendAddTag({ltid:t.ltid,visdur:i.getVisibleDuration(t.ltid),engdur:o.getEngagementDuration(t.ltid),metadata:t.metadata||{},cookieless:t.cookieless||!1,_:Date.now()},t.cookieless||!1)}(t.tag))}function S(t){var e=t.ncid,n=a.mas();t=u.shallowMerge(y,t),!n||"TRACKING"!==t.en&&"CRE_WIDGET_LOADED"!==t.en||n.loadScripts(e),"CRE_WIDGET_LOADED"!==t.en?(!function(t){h[t.ltid]={startTime:new Date,tag:t},r.startTracking(t,O,w),s.startTracking(t,O),o.startTracking(t,function(){I(h[t.ltid]),_(1e3*g)})}(t),"TRACKING"===t.en&&c.startTracking(t,b,T)):(r.startTracking(t,O,w),o.startTracking(t,function(){})),O(t)}function _(t){v&&clearTimeout(v),v=setTimeout(function(){_(2*t),E()},t)}function O(t){if(d.noAudience||function(t){var e=a.remarketingScripts(),n={ntid:t.ntid};Object.keys(e).forEach(function(i){try{e[i].track(t.en,n,function(e,n){if("CONTENT_LOADED"===t.en||"TRACKING"===t.en){var i={bid_request_id:t.bid_request_id,imp_id:t.imp_id,user_id:t.user_id,client_id:n,type:e};Object.keys(i).forEach(function(t){return 0!==i[t]&&!i[t]&&delete i[t]}),u.loadPixel((d.forceHttps?"https://":"//")+d.pixelUrl+"/v1/sync_result",i,!1)}})}catch(t){u.loadErrorPixel(t,d)}})}(t),a.isInWidgetIframe()){b(t);var e=a.videoTag();e&&i.createVideoViewObserver(e)}else if(a.isInTracker())b(t);else{if("CONTENT_LOADED"===t.en&&(b(t),t.clientId==f)){var n=+new Date;u.loadPixel("https://ad.doubleclick.net/ddm/trackimp/N9551.3486898NRICH/B22285489.239509640;dc_trk_aid=437710431;dc_trk_cid=98317036;ord="+n+";dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;tfua=?")}i.startTracking(t.ltid,t.ntid,function(){"CONTENT_LOADED"!==t.en&&b(t)})}}t.exports={startTracking:function(){var t=window.natify&&window.natify.$,e=a.isInWidgetIframe();if(t){for(;t.length;){var n=t.shift();"IP_AREA_MISS"===n.en?b(n):S(n)}e||(_(1e3*g),window.onunload=function(t){return E(),m()})}},trackTag:O,sendTag:b}},function(t,e){!function(t,e){"use strict";if("IntersectionObserver"in t&&"IntersectionObserverEntry"in t&&"intersectionRatio"in t.IntersectionObserverEntry.prototype)"isIntersecting"in t.IntersectionObserverEntry.prototype||Object.defineProperty(t.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});else{var n=[];o.prototype.THROTTLE_TIMEOUT=100,o.prototype.POLL_INTERVAL=null,o.prototype.observe=function(t){if(!this._observationTargets.some(function(e){return e.element==t})){if(!t||1!=t.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:t,entry:null}),this._monitorIntersections(),this._checkForIntersections()}},o.prototype.unobserve=function(t){this._observationTargets=this._observationTargets.filter(function(e){return e.element!=t}),this._observationTargets.length||(this._unmonitorIntersections(),this._unregisterInstance())},o.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorIntersections(),this._unregisterInstance()},o.prototype.takeRecords=function(){var t=this._queuedEntries.slice();return this._queuedEntries=[],t},o.prototype._initThresholds=function(t){var e=t||[0];return Array.isArray(e)||(e=[e]),e.sort().filter(function(t,e,n){if("number"!=typeof t||isNaN(t)||t<0||t>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return t!==n[e-1]})},o.prototype._parseRootMargin=function(t){var e=(t||"0px").split(/\s+/).map(function(t){var e=/^(-?\d*\.?\d+)(px|%)$/.exec(t);if(!e)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(e[1]),unit:e[2]}});return e[1]=e[1]||e[0],e[2]=e[2]||e[0],e[3]=e[3]||e[1],e},o.prototype._monitorIntersections=function(){this._monitoringIntersections||(this._monitoringIntersections=!0,this.POLL_INTERVAL?this._monitoringInterval=setInterval(this._checkForIntersections,this.POLL_INTERVAL):(r(t,"resize",this._checkForIntersections,!0),r(e,"scroll",this._checkForIntersections,!0),"MutationObserver"in t&&(this._domObserver=new MutationObserver(this._checkForIntersections),this._domObserver.observe(e,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))))},o.prototype._unmonitorIntersections=function(){this._monitoringIntersections&&(this._monitoringIntersections=!1,clearInterval(this._monitoringInterval),this._monitoringInterval=null,s(t,"resize",this._checkForIntersections,!0),s(e,"scroll",this._checkForIntersections,!0),this._domObserver&&(this._domObserver.disconnect(),this._domObserver=null))},o.prototype._checkForIntersections=function(){var e=this._rootIsInDom(),n=e?this._getRootRect():{top:0,bottom:0,left:0,right:0,width:0,height:0};this._observationTargets.forEach(function(o){var r=o.element,s=a(r),c=this._rootContainsTarget(r),u=o.entry,l=e&&c&&this._computeTargetAndRootIntersection(r,n),d=o.entry=new i({time:t.performance&&performance.now&&performance.now(),target:r,boundingClientRect:s,rootBounds:n,intersectionRect:l});u?e&&c?this._hasCrossedThreshold(u,d)&&this._queuedEntries.push(d):u&&u.isIntersecting&&this._queuedEntries.push(d):this._queuedEntries.push(d)},this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)},o.prototype._computeTargetAndRootIntersection=function(n,i){if("none"!=t.getComputedStyle(n).display){for(var o=a(n),r=l(n),s=!1;!s;){var u=null,d=1==r.nodeType?t.getComputedStyle(r):{};if("none"==d.display)return;if(r==this.root||r==e?(s=!0,u=i):r!=e.body&&r!=e.documentElement&&"visible"!=d.overflow&&(u=a(r)),u&&!(o=c(u,o)))break;r=l(r)}return o}},o.prototype._getRootRect=function(){var t;if(this.root)t=a(this.root);else{var n=e.documentElement,i=e.body;t={top:0,left:0,right:n.clientWidth||i.clientWidth,width:n.clientWidth||i.clientWidth,bottom:n.clientHeight||i.clientHeight,height:n.clientHeight||i.clientHeight}}return this._expandRectByRootMargin(t)},o.prototype._expandRectByRootMargin=function(t){var e=this._rootMarginValues.map(function(e,n){return"px"==e.unit?e.value:e.value*(n%2?t.width:t.height)/100}),n={top:t.top-e[0],right:t.right+e[1],bottom:t.bottom+e[2],left:t.left-e[3]};return n.width=n.right-n.left,n.height=n.bottom-n.top,n},o.prototype._hasCrossedThreshold=function(t,e){var n=t&&t.isIntersecting?t.intersectionRatio||0:-1,i=e.isIntersecting?e.intersectionRatio||0:-1;if(n!==i)for(var o=0;o<this.thresholds.length;o++){var r=this.thresholds[o];if(r==n||r==i||r<n!=r<i)return!0}},o.prototype._rootIsInDom=function(){return!this.root||u(e,this.root)},o.prototype._rootContainsTarget=function(t){return u(this.root||e,t)},o.prototype._registerInstance=function(){n.indexOf(this)<0&&n.push(this)},o.prototype._unregisterInstance=function(){var t=n.indexOf(this);-1!=t&&n.splice(t,1)},t.IntersectionObserver=o,t.IntersectionObserverEntry=i}function i(t){this.time=t.time,this.target=t.target,this.rootBounds=t.rootBounds,this.boundingClientRect=t.boundingClientRect,this.intersectionRect=t.intersectionRect||{top:0,bottom:0,left:0,right:0,width:0,height:0},this.isIntersecting=!!t.intersectionRect;var e=this.boundingClientRect,n=e.width*e.height,i=this.intersectionRect,o=i.width*i.height;this.intersectionRatio=n?o/n:this.isIntersecting?1:0}function o(t,e){var n=e||{};if("function"!=typeof t)throw new Error("callback must be a function");if(n.root&&1!=n.root.nodeType)throw new Error("root must be an Element");this._checkForIntersections=function(t,e){var n=null;return function(){n||(n=setTimeout(function(){t(),n=null},e))}}(this._checkForIntersections.bind(this),this.THROTTLE_TIMEOUT),this._callback=t,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(n.rootMargin),this.thresholds=this._initThresholds(n.threshold),this.root=n.root||null,this.rootMargin=this._rootMarginValues.map(function(t){return t.value+t.unit}).join(" ")}function r(t,e,n,i){"function"==typeof t.addEventListener?t.addEventListener(e,n,i||!1):"function"==typeof t.attachEvent&&t.attachEvent("on"+e,n)}function s(t,e,n,i){"function"==typeof t.removeEventListener?t.removeEventListener(e,n,i||!1):"function"==typeof t.detatchEvent&&t.detatchEvent("on"+e,n)}function c(t,e){var n=Math.max(t.top,e.top),i=Math.min(t.bottom,e.bottom),o=Math.max(t.left,e.left),r=Math.min(t.right,e.right),s=r-o,c=i-n;return s>=0&&c>=0&&{top:n,bottom:i,left:o,right:r,width:s,height:c}}function a(t){var e;try{e=t.getBoundingClientRect()}catch(t){}return e?(e.width&&e.height||(e={top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.right-e.left,height:e.bottom-e.top}),e):{top:0,bottom:0,left:0,right:0,width:0,height:0}}function u(t,e){for(var n=e;n;){if(n==t)return!0;n=l(n)}return!1}function l(t){var e=t.parentNode;return e&&11==e.nodeType&&e.host?e.host:e}}(window,document)},function(t,e,n){var i,o,r;!function(s,c){"use strict";o=[n(10)],void 0===(r="function"==typeof(i=function(t){var e=/(^|@)\S+:\d+/,n=/^\s*at .*(\S+:\d+|\(native\))/m,i=/^(eval@)?(\[native code])?$/;return{parse:function(t){if(void 0!==t.stacktrace||void 0!==t["opera#sourceloc"])return this.parseOpera(t);if(t.stack&&t.stack.match(n))return this.parseV8OrIE(t);if(t.stack)return this.parseFFOrSafari(t);throw new Error("Cannot parse given Error object")},extractLocation:function(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(e){var i=e.stack.split("\n").filter(function(t){return!!t.match(n)},this);return i.map(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var n=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),i=n.match(/ (\((.+):(\d+):(\d+)\)$)/),o=(n=i?n.replace(i[0],""):n).split(/\s+/).slice(1),r=this.extractLocation(i?i[1]:o.pop()),s=o.join(" ")||void 0,c=["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0];return new t({functionName:s,fileName:c,lineNumber:r[1],columnNumber:r[2],source:e})},this)},parseFFOrSafari:function(e){var n=e.stack.split("\n").filter(function(t){return!t.match(i)},this);return n.map(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new t({functionName:e});var n=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=e.match(n),o=i&&i[1]?i[1]:void 0,r=this.extractLocation(e.replace(n,""));return new t({functionName:o,fileName:r[0],lineNumber:r[1],columnNumber:r[2],source:e})},this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(e){for(var n=/Line (\d+).*script (?:in )?(\S+)/i,i=e.message.split("\n"),o=[],r=2,s=i.length;r<s;r+=2){var c=n.exec(i[r]);c&&o.push(new t({fileName:c[2],lineNumber:c[1],source:i[r]}))}return o},parseOpera10:function(e){for(var n=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,i=e.stacktrace.split("\n"),o=[],r=0,s=i.length;r<s;r+=2){var c=n.exec(i[r]);c&&o.push(new t({functionName:c[3]||void 0,fileName:c[2],lineNumber:c[1],source:i[r]}))}return o},parseOpera11:function(n){var i=n.stack.split("\n").filter(function(t){return!!t.match(e)&&!t.match(/^Error created at/)},this);return i.map(function(e){var n,i=e.split("@"),o=this.extractLocation(i.pop()),r=i.shift()||"",s=r.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;r.match(/\(([^)]*)\)/)&&(n=r.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var c=void 0===n||"[arguments not available]"===n?void 0:n.split(",");return new t({functionName:s,args:c,fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:e})},this)}}})?i.apply(e,o):i)||(t.exports=r)}()},function(t,e,n){var i,o,r;!function(n,s){"use strict";o=[],void 0===(r="function"==typeof(i=function(){function t(t){return!isNaN(parseFloat(t))&&isFinite(t)}function e(t){return t.charAt(0).toUpperCase()+t.substring(1)}function n(t){return function(){return this[t]}}var i=["isConstructor","isEval","isNative","isToplevel"],o=["columnNumber","lineNumber"],r=["fileName","functionName","source"],s=i.concat(o,r,["args"],["evalOrigin"]);function c(t){if(t)for(var n=0;n<s.length;n++)void 0!==t[s[n]]&&this["set"+e(s[n])](t[s[n]])}c.prototype={getArgs:function(){return this.args},setArgs:function(t){if("[object Array]"!==Object.prototype.toString.call(t))throw new TypeError("Args must be an Array");this.args=t},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(t){if(t instanceof c)this.evalOrigin=t;else{if(!(t instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new c(t)}},toString:function(){var t=this.getFileName()||"",e=this.getLineNumber()||"",n=this.getColumnNumber()||"",i=this.getFunctionName()||"";return this.getIsEval()?t?"[eval] ("+t+":"+e+":"+n+")":"[eval]:"+e+":"+n:i?i+" ("+t+":"+e+":"+n+")":t+":"+e+":"+n}},c.fromString=function(t){var e=t.indexOf("("),n=t.lastIndexOf(")"),i=t.substring(0,e),o=t.substring(e+1,n).split(","),r=t.substring(n+1);if(0===r.indexOf("@"))var s=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(r,""),a=s[1],u=s[2],l=s[3];return new c({functionName:i,args:o||void 0,fileName:a,lineNumber:u||void 0,columnNumber:l||void 0})};for(var a=0;a<i.length;a++)c.prototype["get"+e(i[a])]=n(i[a]),c.prototype["set"+e(i[a])]=function(t){return function(e){this[t]=Boolean(e)}}(i[a]);for(var u=0;u<o.length;u++)c.prototype["get"+e(o[u])]=n(o[u]),c.prototype["set"+e(o[u])]=function(e){return function(n){if(!t(n))throw new TypeError(e+" must be a Number");this[e]=Number(n)}}(o[u]);for(var l=0;l<r.length;l++)c.prototype["get"+e(r[l])]=n(r[l]),c.prototype["set"+e(r[l])]=function(t){return function(e){this[t]=String(e)}}(r[l]);return c})?i.apply(e,o):i)||(t.exports=r)}()},function(t,e,n){var i=n(4),o=n(5),r=n(2),s=n(3),c=n(1),a=n(0).postMessageTypes,u=n(0).postMessageSources,l={},d={contentClick:"CONTENT_CLICK",contentScroller:"CONTENT_SCROLLER",contentReader:"CONTENT_READER",contentComplete:"CONTENT_COMPLETE",contentViewed:"CONTENT_VIEWED",contentEngager:"CONTENT_ENGAGER",videoView:"VIDEO_VIEW_",videoEnded:"VIDEO_VIEW_20",videoPlayStart:"VIDEO_PLAY"},f={10:d.contentScroller,50:d.contentReader,99:d.contentComplete};function h(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;l[t]&&(parseInt(n,10)>0&&(l[t].duration=n),g(t,d.videoPlayStart,!0,e),l[t].videoPlayingInterval=setInterval(function(){l[t].videoPlayedTime+=.4,function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=l[t].videoPlayedTime,i=n<20?5:10;if(n<i)return;n>l[t].duration&&g(t,d.videoEnded,!0,e);if(l[t].duration&&n>l[t].duration+i)return;var o=d.videoView+Math.floor(n/i)*i;g(t,o,!0,e)}(t,e)},400))}function p(t,e){var n=e.data||{};if(n.source===u.innerTag&&t===n.ltid){var s=n.payload;switch(n.event){case a.click:g(t,d.contentClick,!1,!1,s);break;case a.scroll:!function(t,e){l[t].maxPercentViewed=Math.max(e.scrollPercent,l[t].maxPercentViewed),l[t].maxPercentViewed>0&&g(t,d.contentEngager,!0);var n=r.isMobile()?i.getVisibleDuration(t):o.getEngagementDuration(t);if(n>0&&n/1e3<300)for(var s=[10,50,99],c=0,a=s.length;c<a;c++)e.scrollPercent>=s[c]&&g(t,f[s[c]],!0,!1,{scrollPercent:s[c]})}(t,n.payload)}}if(n.source===u.adServer&&l[t].contentId===n.contentId)switch(n.status){case a.playing:h(t,n.embedded,n.duration);break;case a.ended:if(l[t].duration){var c=l[t].videoPlayedTime<20?5:10;g(t,d.videoView+Math.ceil(Math.floor(l[t].duration)/c)*c,!0,n.embedded)}g(t,d.videoEnded,!0,n.embedded);case a.paused:!function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;l[t]&&parseInt(e,10)>0&&(l[t].duration=e),l[t]&&l[t].videoPlayingInterval&&clearInterval(l[t].videoPlayingInterval)}(t,n.duration);break;case a.lead:g(t,n.action,!1);break;case a.cre:!function(t,e){var n=l[t].tag,i=[];Array.isArray(e)&&0!==e.length&&e.forEach(function(t){var e=r.shallowMerge(n,{cre_id:t.id,en:t.a});i.push(e)});l[t].sendSeveralTags(i)}(t,n.actions)}}function g(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(function(t,e,n){return!(n&&l[t].trackedActions[e])}(t,e,n)){l[t].trackedActions[e]=!0;var o={en:e,embedded:i},s=r.shallowMerge(l[t].tag,o);l[t].trackTag(s)}}t.exports={startTracking:function(t,e,n){var i=t.ltid,o=t.ntid,a=s.contentIframe(i);if(window.addEventListener("message",function(t){p(i,t)}),l[i]={tag:t,trackTag:e,sendSeveralTags:n,maxPercentViewed:0,inFocusSeconds:10,trackedActions:{},contentId:o,videoPlayedTime:0,videoPlayingInterval:null},a&&r.isIOS()&&!c.isLead){var d=s.contentWrapperDiv(i);d&&(d.onscroll=function(){var t=d.scrollTop+d.clientHeight,e=Math.max(0,Math.floor(t/d.scrollHeight*100));d.clientHeight!==d.scrollHeight&&(e>=100||p(i,{data:{event:"scroll",source:u.innerTag,ltid:i,payload:{scrollTop:t,scrollPercent:e}}}))})}},onAddPixelSend:function(t){l[t]&&i.getVisibility(t)>50&&g(t,d.contentViewed,!0)}}},function(t,e,n){var i,o,r=n(2),s=n(3),c=n(1),a=n(0).postMessageTypes,u=n(0).postMessageSources,l=null;function d(t){var e=(o===document?window.pageYOffset:o.scrollTop)||l||0;e+=window.fullScreenMode?window.innerHeight:i.offsetHeight;var n=Math.floor(e/function(){var t;if(window.fullScreenMode)t=document.getElementsByTagName("body")[0].scrollHeight-document.querySelector("nav.navbar").scrollHeight-((document.getElementsByTagName("footer")||{}).scrollHeight||0)-((document.querySelector(".article-summary")||{}).scrollHeight||0);else{t=document.querySelector(".article-container").scrollHeight;for(var e=document.querySelectorAll("div.share-button"),n=0,i=e.length;n<i;n++)t-=e[n].scrollHeight}return t=t-((document.querySelector("#formUserSet")||{}).scrollHeight||0)-((document.querySelector("#callToAction")||{}).scrollHeight||0)-((document.querySelector("#quiz")||{}).scrollHeight||0)}()*100);f(t,a.scroll,{scrollTop:e,scrollPercent:n})}function f(t,e,n){window.parent.postMessage({event:e,source:u.innerTag,ltid:t,contentId:s.textIframe().uuid,payload:n},"*")}t.exports={startTracking:function(t,e){var n=t.ltid,h=s.textIframe();if(h&&"block"!=h.widgetMode&&"admin"!=h.widgetMode){window.addEventListener("message",function(t){!function(t,e){var n=e.data;"[object Object]"!==Object.prototype.toString.call(n)&&(parseInt(n,10)||(l=n.scrollTop))}(0,t)}),i=document.querySelector(".article"),(o=r.isIOS()&&!window.fullScreenMode?i:document)&&i&&(o.onscroll=function(){d(n)});var p=document.getElementById("callToAction");p&&p.addEventListener("click",function(){f(n,a.click,{})});var g=document.getElementsByClassName("clickable_area").item(0);g&&g.addEventListener("click",function(){f(n,a.click,{})});var v=document.getElementsByClassName("footer-panel").item(0);if(v)v.addEventListener("click",function(){f(n,a.click,{})});else for(var m=document.getElementsByTagName("a"),y=null,b=0;b<m.length;b++)(y=m[b]).hasAttribute("target")&&!c.isLead&&y.addEventListener("click",function(){f(n,a.click,{href:y.getAttribute("href")})});window.postMessage({source:u.tag,status:a.loaded},"*")}}}},function(t,e){var n;function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var o,r,s,c={SetMetaAction:"set_meta",SendAction:"send"},a="page_subcategory",u="page_type",l=(i(n={},"page_category",75),i(n,a,75),i(n,u,32),n);function d(e){var n=e[0],o=e[1],a=e[2];if(n===c.SetMetaAction)t.exports.processMetaParams(o,a);else if(n===c.SendAction&&"event"===o){var u={};if(u.category=a.eventCategory.substring(0,75).trim(),u.action=a.eventAction.substring(0,50).trim(),u.label=a.eventLabel.substring(0,75).trim(),0===Object.keys(u).length)return;!function(t){var e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),o.forEach(function(e){i(t,e,n[e])})}return t}({},r);e.en="PAGE_EVENT",e.metadata=t,s(e)}({event:u})}}t.exports={processMetaParams:function(t,e){var n=l[t]||!1;if(n){var i=e.substr(0,n).trim();o(t,i)}},processEvent:d,startTracking:function(t,e,n){if(o=n,r=t,s=e,"undefined"!=typeof window&&window.nt&&window.nt.sq)for(var i=window.nt.sq;i.length;)d(i.shift());"undefined"!=typeof window&&(window.nt=function(){d(arguments)})}}},function(t,e,n){var i,o=n(15),r=n(2),s=n(1),c=-1!==s.websocketAllowedClients.split(",").indexOf(s.clientId),a="idle",u="in_process",l="connected",d="failed",f=a,h=[],p=function(){for(var t=h.pop();t;)g(t),t=h.pop()},g=function(t){f===l?i.perform("pixel_additional",t):r.loadPixel((s.forceHttps?"https://":"//")+s.pixelUrl+"/v1/pixel/add",t)};t.exports={sendTag:function(t){r.loadPixel((s.forceHttps?"https://":"//")+s.pixelUrl+"/v1/pixel",t)},sendSeveralTags:function(t){var e=new XMLHttpRequest,n=JSON.stringify(t);e.open("POST",(s.forceHttps?"https://":"//")+s.pixelUrl+"/v1/pixel",!0),e.widthCredentials=!0,e.setRequestHeader("Content-type","application/json"),e.send(n)},sendAddTag:function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])g(t);else switch(f){case a:f=u,h.push(t),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!c)return"function"==typeof t&&t(),void(f=d);var e=s.forceHttps||"https:"==location.protocol?"wss:":"ws:",n=o.createConsumer(e+"//"+s.pixelUrl+"/websocket");n.connection.events.error=function(){return this.subscriptions.notifyAll("disconnected",{willAttemptReconnect:this.monitor.isRunning()})},(i=n.subscriptions.create({channel:"V1::PixelDatumChannel"},{connected:function(){f=l,"function"==typeof t&&t()},disconnected:function(){f=d},rejected:function(){f=d},received:function(t){}})).consumer.connection.monitor.stop()}(p);break;case u:h.push(t);break;case l:case d:g(t)}}}},function(t,e,n){var i,o;(function(){(function(){(function(){var t=[].slice;this.ActionCable={INTERNAL:{message_types:{welcome:"welcome",ping:"ping",confirmation:"confirm_subscription",rejection:"reject_subscription"},default_mount_path:"/cable",protocols:["actioncable-v1-json","actioncable-unsupported"]},WebSocket:window.WebSocket,logger:window.console,createConsumer:function(t){var e;return null==t&&(t=null!=(e=this.getConfig("url"))?e:this.INTERNAL.default_mount_path),new r.Consumer(this.createWebSocketURL(t))},getConfig:function(t){var e;return null!=(e=document.head.querySelector("meta[name='action-cable-"+t+"']"))?e.getAttribute("content"):void 0},createWebSocketURL:function(t){var e;return t&&!/^wss?:/i.test(t)?((e=document.createElement("a")).href=t,e.href=e.href,e.protocol=e.protocol.replace("http","ws"),e.href):t},startDebugging:function(){return this.debugging=!0},stopDebugging:function(){return this.debugging=null},log:function(){var e,n;if(e=1<=arguments.length?t.call(arguments,0):[],this.debugging)return e.push(Date.now()),(n=this.logger).log.apply(n,["[ActionCable]"].concat(t.call(e)))}}}).call(this)}).call(this);var r=this.ActionCable;(function(){(function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};r.ConnectionMonitor=function(){var e,n,i;function o(e){this.connection=e,this.visibilityDidChange=t(this.visibilityDidChange,this),this.reconnectAttempts=0}return o.pollInterval={min:3,max:30},o.staleThreshold=6,o.prototype.start=function(){if(!this.isRunning())return this.startedAt=n(),delete this.stoppedAt,this.startPolling(),document.addEventListener("visibilitychange",this.visibilityDidChange),r.log("ConnectionMonitor started. pollInterval = "+this.getPollInterval()+" ms")},o.prototype.stop=function(){if(this.isRunning())return this.stoppedAt=n(),this.stopPolling(),document.removeEventListener("visibilitychange",this.visibilityDidChange),r.log("ConnectionMonitor stopped")},o.prototype.isRunning=function(){return null!=this.startedAt&&null==this.stoppedAt},o.prototype.recordPing=function(){return this.pingedAt=n()},o.prototype.recordConnect=function(){return this.reconnectAttempts=0,this.recordPing(),delete this.disconnectedAt,r.log("ConnectionMonitor recorded connect")},o.prototype.recordDisconnect=function(){return this.disconnectedAt=n(),r.log("ConnectionMonitor recorded disconnect")},o.prototype.startPolling=function(){return this.stopPolling(),this.poll()},o.prototype.stopPolling=function(){return clearTimeout(this.pollTimeout)},o.prototype.poll=function(){return this.pollTimeout=setTimeout(function(t){return function(){return t.reconnectIfStale(),t.poll()}}(this),this.getPollInterval())},o.prototype.getPollInterval=function(){var t,n,i,o;return i=(o=this.constructor.pollInterval).min,n=o.max,t=5*Math.log(this.reconnectAttempts+1),Math.round(1e3*e(t,i,n))},o.prototype.reconnectIfStale=function(){if(this.connectionIsStale())return r.log("ConnectionMonitor detected stale connection. reconnectAttempts = "+this.reconnectAttempts+", pollInterval = "+this.getPollInterval()+" ms, time disconnected = "+i(this.disconnectedAt)+" s, stale threshold = "+this.constructor.staleThreshold+" s"),this.reconnectAttempts++,this.disconnectedRecently()?r.log("ConnectionMonitor skipping reopening recent disconnect"):(r.log("ConnectionMonitor reopening"),this.connection.reopen())},o.prototype.connectionIsStale=function(){var t;return i(null!=(t=this.pingedAt)?t:this.startedAt)>this.constructor.staleThreshold},o.prototype.disconnectedRecently=function(){return this.disconnectedAt&&i(this.disconnectedAt)<this.constructor.staleThreshold},o.prototype.visibilityDidChange=function(){if("visible"===document.visibilityState)return setTimeout(function(t){return function(){if(t.connectionIsStale()||!t.connection.isOpen())return r.log("ConnectionMonitor reopening stale connection on visibilitychange. visbilityState = "+document.visibilityState),t.connection.reopen()}}(this),200)},n=function(){return(new Date).getTime()},i=function(t){return(n()-t)/1e3},e=function(t,e,n){return Math.max(e,Math.min(n,t))},o}()}).call(this),function(){var t,e,n,i,o,s=[].slice,c=function(t,e){return function(){return t.apply(e,arguments)}},a=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1};i=r.INTERNAL,e=i.message_types,n=i.protocols,o=2<=n.length?s.call(n,0,t=n.length-1):(t=0,[]),n[t++],r.Connection=function(){function t(t){this.consumer=t,this.open=c(this.open,this),this.subscriptions=this.consumer.subscriptions,this.monitor=new r.ConnectionMonitor(this),this.disconnected=!0}return t.reopenDelay=500,t.prototype.send=function(t){return!!this.isOpen()&&(this.webSocket.send(JSON.stringify(t)),!0)},t.prototype.open=function(){return this.isActive()?(r.log("Attempted to open WebSocket, but existing socket is "+this.getState()),!1):(r.log("Opening WebSocket, current state is "+this.getState()+", subprotocols: "+n),null!=this.webSocket&&this.uninstallEventHandlers(),this.webSocket=new r.WebSocket(this.consumer.url,n),this.installEventHandlers(),this.monitor.start(),!0)},t.prototype.close=function(t){var e;if((null!=t?t:{allowReconnect:!0}).allowReconnect||this.monitor.stop(),this.isActive())return null!=(e=this.webSocket)?e.close():void 0},t.prototype.reopen=function(){var t;if(r.log("Reopening WebSocket, current state is "+this.getState()),!this.isActive())return this.open();try{return this.close()}catch(e){return t=e,r.log("Failed to reopen WebSocket",t)}finally{r.log("Reopening WebSocket in "+this.constructor.reopenDelay+"ms"),setTimeout(this.open,this.constructor.reopenDelay)}},t.prototype.getProtocol=function(){var t;return null!=(t=this.webSocket)?t.protocol:void 0},t.prototype.isOpen=function(){return this.isState("open")},t.prototype.isActive=function(){return this.isState("open","connecting")},t.prototype.isProtocolSupported=function(){var t;return t=this.getProtocol(),a.call(o,t)>=0},t.prototype.isState=function(){var t,e;return e=1<=arguments.length?s.call(arguments,0):[],t=this.getState(),a.call(e,t)>=0},t.prototype.getState=function(){var t,e;for(e in WebSocket)if(WebSocket[e]===(null!=(t=this.webSocket)?t.readyState:void 0))return e.toLowerCase();return null},t.prototype.installEventHandlers=function(){var t,e;for(t in this.events)e=this.events[t].bind(this),this.webSocket["on"+t]=e},t.prototype.uninstallEventHandlers=function(){var t;for(t in this.events)this.webSocket["on"+t]=function(){}},t.prototype.events={message:function(t){var n,i,o;if(this.isProtocolSupported())switch(n=(o=JSON.parse(t.data)).identifier,i=o.message,o.type){case e.welcome:return this.monitor.recordConnect(),this.subscriptions.reload();case e.ping:return this.monitor.recordPing();case e.confirmation:return this.subscriptions.notify(n,"connected");case e.rejection:return this.subscriptions.reject(n);default:return this.subscriptions.notify(n,"received",i)}},open:function(){if(r.log("WebSocket onopen event, using '"+this.getProtocol()+"' subprotocol"),this.disconnected=!1,!this.isProtocolSupported())return r.log("Protocol is unsupported. Stopping monitor and disconnecting."),this.close({allowReconnect:!1})},close:function(t){if(r.log("WebSocket onclose event"),!this.disconnected)return this.disconnected=!0,this.monitor.recordDisconnect(),this.subscriptions.notifyAll("disconnected",{willAttemptReconnect:this.monitor.isRunning()})},error:function(){return r.log("WebSocket onerror event")}},t}()}.call(this),function(){var t=[].slice;r.Subscriptions=function(){function e(t){this.consumer=t,this.subscriptions=[]}return e.prototype.create=function(t,e){var n,i,o;return i="object"==typeof(n=t)?n:{channel:n},o=new r.Subscription(this.consumer,i,e),this.add(o)},e.prototype.add=function(t){return this.subscriptions.push(t),this.consumer.ensureActiveConnection(),this.notify(t,"initialized"),this.sendCommand(t,"subscribe"),t},e.prototype.remove=function(t){return this.forget(t),this.findAll(t.identifier).length||this.sendCommand(t,"unsubscribe"),t},e.prototype.reject=function(t){var e,n,i,o,r;for(o=[],e=0,n=(i=this.findAll(t)).length;e<n;e++)r=i[e],this.forget(r),this.notify(r,"rejected"),o.push(r);return o},e.prototype.forget=function(t){var e;return this.subscriptions=function(){var n,i,o,r;for(r=[],n=0,i=(o=this.subscriptions).length;n<i;n++)(e=o[n])!==t&&r.push(e);return r}.call(this),t},e.prototype.findAll=function(t){var e,n,i,o,r;for(o=[],e=0,n=(i=this.subscriptions).length;e<n;e++)(r=i[e]).identifier===t&&o.push(r);return o},e.prototype.reload=function(){var t,e,n,i,o;for(i=[],t=0,e=(n=this.subscriptions).length;t<e;t++)o=n[t],i.push(this.sendCommand(o,"subscribe"));return i},e.prototype.notifyAll=function(){var e,n,i,o,r,s,c;for(n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],s=[],i=0,o=(r=this.subscriptions).length;i<o;i++)c=r[i],s.push(this.notify.apply(this,[c,n].concat(t.call(e))));return s},e.prototype.notify=function(){var e,n,i,o,r,s,c;for(s=arguments[0],n=arguments[1],e=3<=arguments.length?t.call(arguments,2):[],r=[],i=0,o=(c="string"==typeof s?this.findAll(s):[s]).length;i<o;i++)s=c[i],r.push("function"==typeof s[n]?s[n].apply(s,e):void 0);return r},e.prototype.sendCommand=function(t,e){var n;return n=t.identifier,this.consumer.send({command:e,identifier:n})},e}()}.call(this),function(){r.Subscription=function(){var t;function e(e,n,i){this.consumer=e,null==n&&(n={}),this.identifier=JSON.stringify(n),t(this,i)}return e.prototype.perform=function(t,e){return null==e&&(e={}),e.action=t,this.send(e)},e.prototype.send=function(t){return this.consumer.send({command:"message",identifier:this.identifier,data:JSON.stringify(t)})},e.prototype.unsubscribe=function(){return this.consumer.subscriptions.remove(this)},t=function(t,e){var n,i;if(null!=e)for(n in e)i=e[n],t[n]=i;return t},e}()}.call(this),function(){r.Consumer=function(){function t(t){this.url=t,this.subscriptions=new r.Subscriptions(this),this.connection=new r.Connection(this)}return t.prototype.send=function(t){return this.connection.send(t)},t.prototype.connect=function(){return this.connection.open()},t.prototype.disconnect=function(){return this.connection.close({allowReconnect:!1})},t.prototype.ensureActiveConnection=function(){if(!this.connection.isActive())return this.connection.open()},t}()}.call(this)}).call(this),t.exports?t.exports=r:void 0===(o="function"==typeof(i=r)?i.call(e,n,e,t):i)||(t.exports=o)}).call(this)}]);})();
