var __awaiter=this&&this.__awaiter||function(t,e,n,r){function a(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function o(t){try{s(r.next(t))}catch(e){i(e)}}function u(t){try{s(r["throw"](t))}catch(e){i(e)}}function s(t){t.done?n(t.value):a(t.value).then(o,u)}s((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,a,i,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(t){return function(e){return s([t,e])}}function s(o){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,a&&(i=o[0]&2?a["return"]:o[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,o[1])).done)return i;if(a=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:n.label++;return{value:o[1],done:false};case 5:n.label++;a=o[1];o=[0];continue;case 7:o=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){n.label=o[1];break}if(o[0]===6&&n.label<i[1]){n.label=i[1];i=o;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(o);break}if(i[2])n.ops.pop();n.trys.pop();continue}o=e.call(t,n)}catch(u){o=[6,u];a=0}finally{r=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./p-d0410154.system.js","./p-50f9a219.system.js","./p-2aaf0de8.system.js"],(function(t){"use strict";var e,n,r,a;return{setters:[function(t){e=t.r;n=t.h},function(){},function(t){r=t.P;a=t.a}],execute:function(){var i=this;var o="https://ionicframeworkcom.prismic.io/api/v2";var u=20*60*1e3;var s;var c=null;var l=function(){return __awaiter(i,void 0,void 0,(function(){var t,e;return __generator(this,(function(n){switch(n.label){case 0:return[4,r.getApi(o)];case 1:t=n.sent();return[4,t.query(r.Predicates.at("document.type","docs_ad"),{})];case 2:e=n.sent();s=e.results;c=Date.now();return[2]}}))}))};var d=function(){return __awaiter(i,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(c===null||Date.now()-c>u))return[3,2];return[4,l()];case 1:t.sent();t.label=2;case 2:return[2,f()]}}))}))};var f=function(){var t;var e=[];for(var n=0,r=s;n<r.length;n++){var a=r[n];if(a["data"]){if(!a["data"].ad_weight){a["data"].ad_weight=1}for(var i=0;i<a["data"].ad_weight;i++){e.push(a)}}}return((t=e[Math.floor(Math.random()*e.length)])===null||t===void 0?void 0:t.data)||null};var h=function(t){p("View",t);w("View",t)};var v=function(t,e){var n=150;if(e){e.preventDefault()}p("Click",t);w("Click",t);setTimeout((function(){var t=g(e===null||e===void 0?void 0:e.target);if(t.target&&t.target.toLowerCase()==="_blank"){window.open(t.href)}else if(t.href){document.location=t.href}}),n)};var p=function(t,e){if(!window["_hsq"]){console.warn("Unable to track Hubspot event, _hsq not found",t,e);return}window["_hsq"].push(["trackEvent",{id:"Docs ad - "+t+" - "+e}])};var w=function(t,e){if(!window["gtag"]){console.warn("Unable to track Google Analytics event, gtag not found",t,e);return}window["gtag"]("event","Docs ad - "+t+" - "+e,{event_category:"Docs ad - "+t,event_label:e})};var g=function(t){if(t["href"]){return t}else if(t.parentNode){return g(t.parentNode)}};var _="internal-ad{max-width:148px;display:block;margin:48px 0 0}internal-ad p{font-size:13px;line-height:19px;font-weight:400;letter-spacing:0.02em;color:var(--text-color--dark);-webkit-transition:.2s color;transition:.2s color}internal-ad a:hover p{color:var(--text-color)}@media (max-width: 1233px){internal-ad{display:none}}";var m=t("internal_ad",function(){function t(t){e(this,t);this.update()}t.prototype.update=function(){return __awaiter(this,void 0,void 0,(function(){var t;var e=this;return __generator(this,(function(n){switch(n.label){case 0:t=this;return[4,d()];case 1:t.ad=n.sent();if(!this.ad){return[2]}this.timeout=setTimeout((function(){h(e.ad.ad_id)}),50);return[2]}}))}))};t.prototype.disconnectedCallback=function(){clearTimeout(this.timeout)};t.prototype.render=function(){var t=this;if(!this.ad||Object.keys(this.ad).length===0){return}return n("a",{href:this.ad.ad_url.url,target:this.ad.ad_url.target,onClick:function(e){return v(t.ad.ad_id,e)}},n("picture",null,n("source",{media:"(min-width: 37.5em)",src:this.ad.ad_image.url}),n("source",{src:this.ad.ad_image["1x"].url}),n("img",{src:this.ad.ad_image.url,alt:this.ad.ad_image.alt,height:this.ad.ad_image["1x"].dimensions.height,width:this.ad.ad_image["1x"].dimensions.width}),n("p",null,this.ad.ad_image.alt)),n("div",{innerHTML:a.RichText.asHtml(this.ad.ad_copy)}))};return t}());m.style=_}}}));