PageSourceSearch

https://www.pfizermedicalinformation.com.sg/external_link.js

js pfizermedicalinformation.com.sg collected 2026-10-05 01:53:05 UTC 8,922 bytes, 26 lines download raw bytes

1(function(){
2/*!******************************************************!*\
3  !*** ./resources/assets/builder/external_link_v2.js ***!
4  \******************************************************/
5function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}
6function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}
7function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value" in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}
8function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}
9function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}
10function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}
11var ExternalLink=function(){function ExternalLink(){_classCallCheck(this,ExternalLink)}
12return _createClass(ExternalLink,null,[{key:"init",value:function init(config){var _this=this;this.placeholder={title:'',body:'You are now leaving a Pfizer-operated 
12website. Links to all outside sites are provided as a resource to our visitors. Pfizer accepts no responsibility for the content of sites that are not owned and operated by Pfizer.',continue:'Go to link',cancel:'Cancel'};this.lang=document.querySelector('html').lang||'';this.whitelist=config.whitelist;this.primaryPopup=null;this.overridePopups=[];this.overridePopupsAny=[];if(Array.isArray(config.popups)){this.primaryPopup=config.popups.find(function(popup){return popup.type==='primary'&&popup.language===_this.lang});if(!this.primaryPopup){this.primaryPopup=config.popups.find(function(popup){return popup.type==='primary'&&popup.language==='any'})}
13if(!this.primaryPopup){return}
14this.overridePopups=config.popups.filter(function(popup){return popup.type==='override'&&popup.enabled&&popup.language===_this.lang});this.overridePopupsAny=config.popups.filter(function(popup){return popup.type==='override'&&popup.enabled&&popup.language==='any'})}
15this.helixContainer=document.querySelector('#helix-container');if(!this.helixContainer){this.helixContainer=document.createElement('div');this.helixContainer.id='helix-container';document.body.appendChild(this.helixContainer)}
16this.attach()}},{key:"attach",value:function attach(){var _this2=this;var pattern=/^((http[s]?|ftp):\/\/)?\/?([^\/\.]+\.)*?([^\/\.]+\.[^:\/\s\.]{2,3}(\.[^:\/\s\.]{2,3})?(:\d+)?)($|\/)([^#?\s]+)?(.*?)?(#[\w\-]+)?$/;var host=window.location.host.replace(pattern,'$4');var subdomainPattern='([^/]*\\.)?';if(this.primaryPopup.whitelist){var array=this.primaryPopup.whitelist.split('\n');var whitelistedDomains=[];for(var i=0;i<array.length;i++){var whitelistPattern=array[i].replace(/(\r\n|\n|\r)/gm,'');if(whitelistPattern){whitelistPattern=whitelistPattern.replace('*','.*');whitelistedDomains.push(new RegExp("^https?:\\/\\/".concat(whitelistPattern,".*$"),'i'))}}
17this.primaryPopup.whitelistedDomains=whitelistedDomains}
18this.overridePopups.map(function(popup){var array=popup.blacklist.split('\n');var blacklistedDomains=[];for(var _i=0;_i<array.length;_i++){var blacklistPattern=array[_i].replace(/(\r\n|\n|\r)/gm,'');if(blacklistPattern){blacklistPattern=blacklistPattern.replace('*','.*');blacklistedDomains.push(new RegExp("^https?:\\/\\/".concat(blacklistPattern,".*$"),'i'))}}
19popup.blacklistedDomains=blacklistedDomains;return popup});this.overridePopupsAny.map(function(popup){var array=popup.blacklist.split('\n');var blacklistedDomains=[];for(var _i2=0;_i2<array.length;_i2++){var blacklistPattern=array[_i2].replace(/(\r\n|\n|\r)/gm,'');if(blacklistPattern){blacklistPattern=blacklistPattern.replace('*','.*');blacklistedDomains.push(new RegExp("^https?:\\/\\/".concat(blacklistPattern,".*$"),'i'))}}
20popup.blacklistedDomains=blacklistedDomains;return popup});var internalLink=new RegExp("^https?://([^@]*@)?".concat(subdomainPattern).concat(host),'i');document.body.addEventListener('click',function(ev){var target=ev.composedPath().find(function(target){return target.tagName==='A'});if(target){var url=target.href;if(_this2.primaryPopup.whitelistedDomains&&Array.isArray(_this2.primaryPopup.whitelistedDomains)){var index=_this2.primaryPopup.whitelistedDomains.findIndex(function(domain){return domain.test(url)});if(index>-1){return}}
21if(url.indexOf('http')===0&&!internalLink.test(url)){ev.preventDefault();_this2.showModal(target.href)}}})}},{key:"showModal",value:function showModal(href){var _this3=this;var popup=this.overridePopups.find(function(popup){return popup.blacklistedDomains.findIndex(function(domain){return domain.test(href)})>-1});if(!popup){popup=this.overridePopupsAny.find(function(popup){return popup.blacklistedDomains.findIndex(function(domain){return domain.test(href)})>-1})}
22var values={title:this.primaryPopup.title?this.primaryPopup.title:this.placeholder.title,body:this.primaryPopup.body?this.primaryPopup.body:this.placeholder.body,continue:this.primaryPopup.continue?this.primaryPopup.continue:this.placeholder.continue,cancel:this.primaryPopup.cancel?this.primaryPopup.cancel:this.placeholder.cancel,style:this.primaryPopup.style};if(popup){values.title=popup.title?popup.title:this.placeholder.title;values.body=popup.body?popup.body:this.placeholder.body;values.continue=popup.continue?popup.continue:this.placeholder.continue;values.cancel=popup.cancel?popup.cancel:this.placeholder.cancel;values.style=popup.style?popup.style:values.style}
23if(values.style==='helix'){this.helixContainer.innerHTML="\n                <helix-core-ext-link 
23id=\"helix-ext-popup\" centered=\"true\" modal-variant=\"backdrop\" allow-list=\"/\" cancel-text=\"".concat(values.cancel,"\" go-to-link-text=\"").concat(values.continue,"\">\n                    <helix-core-heading part=\"header\" variant=\"h3\">").concat(values.title,"</helix-core-heading>\n                    <helix-core-content part=\"content\">").concat(values.body,"</helix-core-content>\n                </helix-core-ext-link>\n            ");var helix=document.querySelector('#helix-ext-popup');if(helix.trigger&&typeof helix.trigger==='function'){helix.trigger(href,'_blank')}
24var interval=setInterval(function(){helix.shadowRoot.querySelectorAll('helix-core-button').forEach(function(element){clearInterval(interval);element.addEventListener('click',function(){_this3.helixContainer.innerHTML=''})})});setTimeout(function(){clearInterval(interval)},10000);return}
25var html="<div class=\"modal\" tabindex=\"-1\" role=\"dialog\">\n                        <div class=\"modal-dialog\" role=\"document\">\n                            <div class=\"modal-content\">\n                                <div class=\"modal-header\">\n                                    <h5 class=\"modal-title\">".concat(values.title,"</h5>\n                                    <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n                                        <span aria-hidden=\"true\">&times;</span>\n                                    </button>\n                                </div>\n                                <div class=\"modal-body\">\n                                    ").concat(values.body,"\n                                </div>\n                                <div class=\"modal-footer\">\n                                    <button type=\"button\" class=\"btn btn-primary\">").concat(values.continue,"</button>\n                                    <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">").concat(values.cancel,"</button>\n                                </div>\n                            </div>\n                        </div>\n                    </div>");if(!this.container){this.container=document.createElement('div');this.container.id='external-link-modal';document.body.appendChild(this.container)}
26this.container.innerHTML=html;this.container.firstChild.style.display='block';var that=this;this.container.querySelector('button.btn-primary').addEventListener('click',function(e){that.destroyModal();window.open(href,'_blank')});this.container.querySelector('button.btn-secondary').addEventListener('click',function(e){that.destroyModal()});this.container.querySelector('button.close').addEventListener('click',function(e){that.destroyModal()})}},{key:"destroyModal",value:function destroyModal(){document.body.removeChild(this.container);this.container=null}}])}();window.externalLink=ExternalLink})()

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.