(()=>{"use strict";var t={};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();function e(e){this._navigator=e||(t.g.navigator?t.g.navigator:window?window.navigator:void 0),this.browser=this._getBrowser(),this.flash=this._getFlash(),this.os=this._getOS(),this.device=this._getDevice(),this.locales=this._getLocales(),this.locale=this.locales?this.locales[0]:void 0}e.prototype.constructor=e,e.prototype._getBrowser=function(){const t=void 0!==this._navigator?this._navigator.userAgent.toLowerCase():"",e=function(e){const i=t.match(e);return i&&i.length>1&&i[1]||""};let i;const o=/CrOS/.test(t),s=e(/edge?\/(\d+(\.\d+)?)/i),n=s?s>=80?"chromiumEdge":"msedge":null,l=e(/version\/(\d+(\.\d+)?)/i);let r=!1;return/opera|opr/i.test(t)?i={name:"Opera",opera:!0,version:l||e(/(?:opera|opr)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(t)?i={name:"Yandex Browser",yandexbrowser:!0,version:l||e(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/windows phone/i.test(t)?(r=!0,i={name:"Windows Phone IE",ie:!0},s?(i[n]=!0,i.version=s):(i.msie=!0,i.version=e(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(t)?(i={name:"Internet Explorer",msie:!0,ie:!0,version:e(/(?:msie |rv:)(\d+(\.\d+)?)/i)},/trident/i.test(t)&&("7.0"===i.version&&"4.0"===e(/(?:trident\/)(\d+(\.\d+)?)/i)&&(i.version="8.0"),"7.0"===i.version&&"5.0"===e(/(?:trident\/)(\d+(\.\d+)?)/i)&&(i.version="9.0"))):/silk/i.test(t)?i={name:"Amazon Silk",silk:!0,version:e(/silk\/(\d+(\.\d+)?)/i)}:o?i={name:"Chrome",chrome:!0,version:e(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/chrome.+? edge?/i.test(t)?(i={name:"Microsoft Edge",version:s},i[n]=!0,i.ie="msedge"===n):/chrome|crios|crmo/i.test(t)?(i={name:"Chrome",chrome:!0,version:e(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)},/SamsungBrowser/i.test(t)&&(i.name="Samsung Browser",i.samsung=!0,i.version=e(/SamsungBrowser\/(\d+(\.\d+)?)/i))):i=/seamonkey\//i.test(t)?{name:"SeaMonkey",seamonkey:!0,version:e(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel/i.test(t)?{name:"Firefox",firefox:!0,version:e(/(?:firefox|iceweasel)[ \/](\d+(\.\d+)?)/i)}:/phantom/i.test(t)?{name:"PhantomJS",phantom:!0,version:e(/phantomjs\/(\d+(\.\d+)?)/i)}:/safari/i.test(t)?{name:"Safari",safari:!0,version:l}:{other:!0},/FBAN|FBIOS|FB_IAB|FBAV/i.test(t)&&(i.name="Facebook In-App",i.facebook=!0,i.inApp=!0),/\bFB[\w_]+\/(Messenger|MESSENGER)/i.test(t)&&(i.name="Messenger In-App",i.messenger=!0,i.inApp=!0),/\bTwitter/i.test(t)&&(i.name="Twitter In-App",i.twitter=!0,i.inApp=!0),/\bLine\//i.test(t)&&(i.name="Line In-App",i.line=!0,i.inApp=!0),/\bMicroMessenger\//i.test(t)&&(i.name="Wechat In-App",i.wechat=!0,i.inApp=!0),/\bInstagram/i.test(t)&&(i.name="Instagram In-App",i.instagram=!0,i.inApp=!0),r||i.msie||i.msedge||i.chromiumEdge||!/(apple)?webkit/i.test(t)?!i.opera&&/gecko\//i.test(t)&&(i.name=i.name||"Gecko",i.gecko=!0,i.version=i.version||e(/gecko\/(\d+(\.\d+)?)/i)):(i.name=i.name||"Webkit",i.webkit=!0,!i.version&&l&&(i.version=l)),i.name||(i.name="Other"),-1!==t.toLowerCase().indexOf("publisher")&&(i.publisher=!0),i},e.prototype._getFlash=function(){const e="Shockwave Flash",i="ShockwaveFlash.ShockwaveFlash",o="application/x-shockwave-flash";let s=null;if(void 0!==this._navigator.plugins&&"object"==typeof this._navigator.plugins[e]){let t=this._navigator.plugins[e].description;!t||void 0!==this._navigator.mimeTypes&&this._navigator.mimeTypes[o]&&!this._navigator.mimeTypes[o].enabledPlugin||(t=t.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),s=[parseInt(t.replace(/^(.*)\..*$/,"$1"),10),parseInt(t.replace(/^.*\.(.*)\s.*$/,"$1"),10),/[a-zA-Z]/.test(t)?parseInt(t.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0])}else if(void 0!==t.g.ActiveXObject)try{const e=new t.g.ActiveXObject(i);if(e){let t=e.GetVariable("$version");t&&(t=t.split(" ")[1].split(","),s=[parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10)])}}catch(n){}return s},e.prototype._getOS=function(){const t=void 0!==this._navigator?this._navigator.userAgent.toLowerCase():"",e=function(e){const i=t.match(e);return i&&i.length>1&&i[1]||""};let i={name:"Other",other:!0};const o=e(/(ipod|iphone|ipad)/i).toLowerCase(),s="ontouchstart"in document.documentElement&&/macintosh/i.test(t),n=!/like android/i.test(t)&&/android/i.test(t),l=e(/version\/(\d+(\.\d+)?)/i);return o&&!s?i={name:"iOS",version:e(/os\s(\d+_*\d*_*\d*)/).split("_").join("."),ios:!0}:s?i={name:"iPadOS",version:e(/version\/(\d+.?\d*.?\d*)\s/i),ios:!0,ipados:!0}:n?i={name:"Android",version:e(/android\s(\d+\.*\d*\.*\d*)/),android:!0}:/mac os/.test(t)?i={name:"Mac OS",mac:!0}:/windows/i.test(t)?i={name:"Windows",windows:!0}:/playbook|blackberry|\bbb\d+/i.test(t)||/rim\stablet/i.test(t)?i={name:"Blackberry",blackberry:!0,version:l||e(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:/(web|hpw)os/i.test(t)?(i={name:"WebOS",webos:!0,version:l||e(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(t)&&(i.touchpad=!0)):/bada/i.test(t)?i={name:"Bada",bada:!0,version:e(/dolfin\/(\d+(\.\d+)?)/i)}:/tizen/i.test(t)?i={name:"Tizen",tizen:!0,version:e(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||l}:/sailfish/i.test(t)?i={name:"Sailfish",sailfish:!0,version:e(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel/i.test(t)&&/\((mobile|tablet);[^)]*rv:[\d.]+\)/i.test(t)&&(i={name:"Firefox OS",firefoxos:!0}),i},e.prototype._getDevice=function(){const t=void 0!==this._navigator?this._navigator.userAgent.toLowerCase():"",e={},i=!/like android/i.test(t)&&/android/i.test(t),o=/cros/.test(t);return e.name=t.match(/ipad/)||this.os.ipados?"ipad":t.match(/ipod/)?"ipod":t.match(/iphone/)?"iphone":i?"android":t.match(/windows phone/)?"wphone":t.match(/mobile/)?"mobile":t.match(/mac|win|linux/)||o?"desktop":"other",e[e.name]=!0,e},e.prototype._getLocales=function(){if(void 0!==this._navigator){if(this._navigator.languages&&this._navigator.languages.length>0){const t=[];let e;for(let i=0;io[n]?1:-1}return i.length!==o.length?-1:0}o.prototype.constructor=o,o.prototype.getSupportedVersions=function(){const t=[];if(this.userAgentInfo.device.desktop){if(this.userAgentInfo.browser.ie)return[];t.push("html")}else{const e=this.userAgentInfo.os.ios,i=this.userAgentInfo.os.ipados,o=this.userAgentInfo.os.android&&(parseInt(this.userAgentInfo.os.version.split(".")[0],10)>4||4===parseInt(this.userAgentInfo.os.version.split(".")[0],10)&&parseInt(this.userAgentInfo.os.version.split(".")[1],10)>=1);if(e||i||o)if(i||e&&parseInt(this.userAgentInfo.os.version.split(".")[0],10)>=10||o&&parseInt(this.userAgentInfo.os.version.split(".")[0],10)>=6)t.push("mobile");else{const i=navigator.userAgent.indexOf("Mozilla/5.0")>-1&&navigator.userAgent.indexOf("Android ")>-1&&navigator.userAgent.indexOf("AppleWebKit")>-1&&-1===navigator.userAgent.indexOf("Chrome");(e&&s(this.userAgentInfo.os.version,"9")>=0||o&&1===s(this.userAgentInfo.os.version,"4.2")&&!i)&&t.push("mobile-old")}}return t},o.prototype.mainVersion=function(){const t=this.getSupportedVersions();if(this.priorities){for(let e=0;e0)return t[0];return null},o.prototype.isRenderable=function(){return!0};const n=o,l=function(e,i){let o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=100;const n=20;let l=t.g.innerWidth-s,r=t.g.innerHeight-s;const a=l/r,h=e/i;let d=a>h?e*r/i:l,c=a>h?r:i*l/e;return o&&(d>e||c>i)?(d=e,c=i,l+=s,r+=s,s=0):(d=Math.round(d),c=Math.round(c)),{width:d,height:c,paddingTop:(r+s-n-c)/2,paddingLeft:(l+s-n-d)/2}};function r(t,e,i,o){const s=this;this.onClick=function(t){let n=!0;e&&(n=n&&e(t)),n&&(t.preventDefault(),s.render(t.currentTarget,i,o))},t.addEventListener("click",this.onClick),this._sizingBound=this.sizing.bind(this),this._closeBound=this.close.bind(this),this._receiveMessageBound=this._receiveMessage.bind(this),this._keyListenerBound=this._keyListener.bind(this)}r.prototype.render=function(t,e,o){const s=new i,n=s.browser,l=-1!==["ar","he"].indexOf(s.locale);this.blackout=document.createElement("div"),this.lightbox=document.createElement("div"),this.closeButton=document.createElement("button"),this.lightbox.setAttribute("role","dialog"),this.lightbox.style.position="absolute",this.lightbox.style.display="block",this.lightbox.style.margin="50px auto",this.lightbox.style.minWidth="200px",this.lightbox.style.minHeight="150px",this.lightbox.style.maxWidth="90%",this.lightbox.style.backgroundColor="#fff",this.lightbox.style.padding="10px",this.lightbox.style.borderRadius="5px",this.closeButton.style.width="30px",this.closeButton.style.height="30px",this.closeButton.style.top="-15px",this.closeButton.style.right="-15px",this.closeButton.style.position="absolute",this.closeButton.style.padding="0",this.closeButton.style.border="none",this.closeButton.style.background="transparent url("+this._getCloseIcon()+")",this.closeButton.style.cursor="pointer",l&&(this.closeButton.style.right="initial",this.closeButton.style.left="-15px"),this.blackout.style.width="100%",this.blackout.style.height="100%",this.blackout.style.backgroundColor="rgba(0, 0, 0, 0.7)",this.blackout.style.position="fixed",this.blackout.style.top="0px",this.blackout.style.left="0px",this.blackout.style.zIndex="12147483646",this.blackout.style.opacity="0",this.blackout.style.transition="opacity .4s ease",this.lightbox.appendChild(this.closeButton),this.blackout.appendChild(this.lightbox);const r=this;if(t.getAttribute("data-img")){const e=document.createElement("img");this.sizing(100,100,!0),e.onload=function(){r.width=e.width,r.height=e.height,r.sizing(e.width,e.height,!0),e.style.width="100%",e.style.height="100%",r.lightbox.appendChild(e)},e.src=t.getAttribute("data-img"),this._sizingBound=this.sizing.bind(this,this.width,this.height,!0)}else if(t.getAttribute("href")){const i=document.createElement("iframe");let s=t.getAttribute("href");const l=s.split("#");s=l[0],s+=-1===s.indexOf("?")?"?embed=true":"&embed=true",s+="&lightbox=true",s+=l[1]?"#"+l[1]:"",i.src=s,i.width="100%",i.height="100%",i.setAttribute("type","text/html"),i.setAttribute("scrolling","no"),i.setAttribute("frameborder","0"),i.setAttribute("allowfullscreen","allowfullscreen"),i.setAttribute("allow","accelerometer; autoplay; encrypted-media; fullscreen; gyroscope; picture-in-picture;"),this.width=t.getAttribute("data-width")||600,this.height=o?this.width/o:t.getAttribute("data-height")||400,this.sizing(),this.lightbox.appendChild(i),setTimeout((function(){e(i)}),10),n.safari&&setTimeout((function(){i.contentWindow.focus()}),0),i.addEventListener("load",(function(){i.contentWindow.focus()}))}this.addCloseListeners(),document.body.appendChild(this.blackout),setTimeout((()=>{this.blackout.style.opacity="1"}),10),this.lightbox.addEventListener("wheel",this._preventer,{passive:!1}),this.blackout.addEventListener("wheel",this._preventer,{passive:!1})},r.prototype._preventer=function(t){t.preventDefault()},r.prototype._getCloseIcon=function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAQAAACROWYpAAAEAUlEQVR42oWVbWwUZRDH/+3e9l5h2yu9tsddX+hRWnupR2uFQK8hMWnrGcRCCKGKcJQ0aKgmJh4mJFWspmArYgiQGtvqN0MipOIXPyARRSIagYgJIRIhsaZRIIF723vrOHu7163cGWf2w+7M/O55ZuZ55vCIFKEYxRsM7WJLicc4Zj1uaylpKWkXNxgUO3t1yQMFiDCtWrLX8UHdqGeo4cgTE2s63EH3W65gRYUNJvYKKCqMGmCssHU7PvR+Hfj7cPISaZK6cv+jcxs317rs/ANGGPLxYjaa60q31kx2hj/PYXOZ2xnS5MFnq+pXO8skmMEpPLqqxWV/wTPzbOY2UXJ+ItkdQ1jVjuj7yfg8W6+e295eI5XBoq6uo+al9h7PqT5KEH2Vro2omK5N0Z/SROx7vqmOcbOOCzBCaq1/rzd9h2g6KYRRQIXwuwkFP9nndENiQmCcHxG2Zc6XO+9/qayqo/l6IkkU/h6PoQo2porBj2mpvav5kyBRNOPSNtwWXb+QsyMyIFuybyXh2RTRN2+6VsIOEwQFtlqcWzt//5ToWFIN90aJ5WBCeV8RneViTWieQZno7nm0oho2GMC8JK0I9MauEq3VVquNxEjFVyooy1hC9ZRHlLqVdqEepSgB8+WV3k39RA8zenbPxFT8YRY9ndIrcY3Ltn9oSROWwQSINkdLx55XiG6mdVjBZcZ0NKdfMHzysPVxVMLMsKXauy4YIvo1/e/O3p1X4bcTi+1nGD5+FG1wwsownI51/iGie+nF6FwWTWu5654f4kSvj5ifxHINFtfUDyT/Iso1SorMablu1HLfJ+eOygNuVutL4gJcLXa07Lx1gehVLWRtTM9VLd2plOrp5o+5X7Ad7bltO0Rf47YjH7M5ZQnn+rlPFhYuxsFEbk8XokRnz2IztIJxq9BsDLhCs1f0fhbWXZxv+M/y/ehFs9oqARLqDX77wJ4JYtkV/y90fSyV4UqfQRD+3CHh44lq+IS+yjdOZMfAcMHVd8RlRi9eRgib4NOOJ8Mm2OFBl7Cz7J1jMwp+Q94W17LXynSJC8XozxjBi+iCR70Y2pVEFbzoEQalQ3tn/rhJLHLmWmJSnpR/lLk5LPdmx8/jEAbRA69+JbVhADdWIyAMWkYwdfS7327QIrlza/qyOI0RRgMcpQ+D3BhCGWrgQw9vK2Qex5R0+qlvD1w/cD1wcfkMpjCOEHt64OMofQzpA5CNbnjhx3PYjdcwbBg1jGHMMFo8zF+72epnrxvaAMwbvZA4mwb4OOxpbEE/drD2Ywt/+dnawF599Ob9XxhhRRmH1KIRXg5vY/XxWyNbqthj1XPNw1mVHYgcYoYFVk0tMLNFVFbMxvyPFBXQAvIP9TCL+Lre4wwAAAAASUVORK5CYII="},r.prototype.sizing=function(t,e,i){t=t||this.width,e=e||this.height;const o=l(t,e,i=i||!1);this.lightbox.style.width=o.width+"px",this.lightbox.style.height=o.height+"px",this.lightbox.style.top=o.paddingTop+"px",this.lightbox.style.left=o.paddingLeft+"px",this.lightbox.style.margin="0"},r.prototype.close=function(e){e.stopPropagation();const i=()=>{t.g.history&&t.g.history.pushState&&window.removeEventListener("popstate",this._closeBound),window.removeEventListener("resize",this._sizingBound),window.removeEventListener("message",this._receiveMessageBound,!1),window.removeEventListener("keyup",this._keyListenerBound),this.closeButton.removeEventListener("click",this._closeBound),this.blackout.removeEventListener("click",this._closeBound),this.blackout.removeEventListener("transitionend",i),this.blackout.parentNode.removeChild(this.blackout)};this.blackout.addEventListener("transitionend",i),this.blackout.style.opacity="0"},r.prototype._receiveMessage=function(t){const e=t.data;e&&e.fbPublicationUrl&&-1!==e.fbPublicationUrl.indexOf(t.origin)&&"closeLightbox"===e.action&&this.close(t)},r.prototype._keyListener=function(t){"Escape"===t.code&&this.close(t)},r.prototype.addCloseListeners=function(){t.g.history&&t.g.history.pushState&&(t.g.history.pushState({lightbox:!0},null,t.g.location.href),window.addEventListener("popstate",this._closeBound)),window.addEventListener("resize",this._sizingBound),window.addEventListener("message",this._receiveMessageBound,!1),window.addEventListener("keyup",this._keyListenerBound),this.closeButton.addEventListener("click",this._closeBound),this.blackout.addEventListener("click",this._closeBound)};const a=r;function h(t){return!isNaN(parseFloat(t))&&isFinite(t)}const PRODUCT_CODE="fbc",d=5;function c(){this.THUMBNAIL_URL="https://pages.cld.bz/Thumbnail.aspx?url=",this.API_URL="",this.PROTECTION_API_URL="https://backend.cld.bz/Services/PublicAPI.asmx/IsBookDomainProtected",this.elementsArray=[],this.elementId=0,this.embeds={},this.requestInterval=1e3/d,this.lastRequestTime=0,this.userAgentDetector=new i,this.publicationDetector=new n(this.userAgentDetector,["html","mobile"]),this.version=this.publicationDetector.mainVersion(),this.parseAllEmbeds(),window.addEventListener("message",this._receiveMessage.bind(this),!1),this.onMobileResizeBound=this.onMobileResize.bind(this),this.closeMobileLightboxBound=this.closeMobileLightbox.bind(this,this.currentLigtboxId)}void 0!==t.g[PRODUCT_CODE+"Embed"]&&t.g[PRODUCT_CODE+"Embed"].parseAllEmbeds(),c.prototype.parseAllEmbeds=function(){const t=this._getElementsByClass(PRODUCT_CODE+"-embed");for(let e=0;e0?"&":"")+"page="+g,f+=r):(f.lastIndexOf("/")!==f.length-1&&(f+="/"),f+=g+"/"+r):f+=r,"no"===a&&"fbo"===PRODUCT_CODE&&(f+=-1===f.indexOf("?")?"?noview=true":"&noview=true");let v=f;w.length>0&&(v+="#"+w);const I=t.g.document.createElement("div");for(let t=0,h=e.attributes.length;t0?L.src=this._getPublicationThumbLink(x):L.src=this._getSelfhostPublicationThumbLink(x,u,r),L.onload=function(){const t=L.naturalWidth,e=L.naturalHeight,o=A.getBoundingClientRect(),s=o.width/o.height,n=t/e;t>0&&e>0&&o.height>0&&o.width>0&&(L.style.height=s>n?o.height:e*o.width/t,L.style.width=s>n?t*o.height/e:o.width),i.embeds[l].id&&!i.embeds[l].throttled&&(L.style.opacity="1",E.style.display="initial",setTimeout((()=>{E.style.opacity="0.8"}),10))},a.appendChild(L),E=t.g.document.createElement("div"),E.style.width="60px",E.style.height="60px",E.style.position="absolute",E.style.top="0",E.style.left="0",E.style.right="0",E.style.bottom="0",E.style.margin="auto",E.style.backgroundImage="url('"+this._getPublicationThumbIcon()+"')",E.style.backgroundPosition="center",E.style.transition="transform .3s ease, opacity .3s ease",E.style.transform="scale(0.9)",E.style["will-change"]="transform",E.style.borderRadius="100%",E.style.backgroundColor="rgba(0,0,0,0.7)",E.style.opacity="0",E.style.display="none";const d=function(){E.style.transform="scale(1)",E.style.backgroundColor="rgba(0,0,0,0.66)",E.style.opacity="1"};L.addEventListener("mouseenter",d),E.addEventListener("mouseenter",d);const c=function(){E.style.transform="scale(0.9)",E.style.opacity="0.8",E.style.backgroundColor="rgba(0,0,0,0.7)"};if(L.addEventListener("mouseleave",c),E.addEventListener("mouseleave",c),a.appendChild(E),o||(o=this._getEmbedDefaultWidth()+"px"),s||(s=this._getEmbedDefaultHeight()+"px"),k){const t=n.split(":");_=t[0]/t[1]}k&&_&&(C=(100/_).toFixed(2)+"%",e.style.position="relative"),e.style.width||(e.style.width=o+(h(o)?"px":"")),e.style.height||(e.style.height=s+(h(s)?"px":"")),"auto"===s&&(e.style.minHeight=this._getPayloadMinHeight()+"px")}let M=!1;"fbc"===PRODUCT_CODE&&this.PROTECTION_API_URL&&"mobile"===this.version?this._ajax(this.PROTECTION_API_URL,(function(t,o){if(200!==o.status)return void console.log(o.status,o.statusText);const s=JSON.parse(t);s.d&&(null===s.d.Errors?(M=s.d.Success,i.storeEmbed({elementId:l,element:e,embedPublicationUrl:f,linkElement:A,image:L,icon:E,method:d,analytics:a,isProtected:M,wheel:c,urlHash:w,thumbnailUrl:u,ratioPadding:C,showLightbox:b,caption:y})):console.log(s.d.Errors))}),'{"url": "'+x+'"}',5e3):"fbo"===PRODUCT_CODE&&this.PROTECTION_API_URL&&"mobile"===this.version?this._ajax(this.PROTECTION_API_URL+x,(function(t,o){if(200!==o.status)return void console.log(o.status,o.statusText);const s=JSON.parse(t);"boolean"==typeof s?(M=s,i.storeEmbed({elementId:l,element:e,embedPublicationUrl:f,linkElement:A,image:L,icon:E,method:d,analytics:a,isProtected:M,wheel:c,urlHash:w,thumbnailUrl:u,ratioPadding:C,showLightbox:b,caption:y})):console.log("Protection check error")}),null,5e3):this.storeEmbed({elementId:l,element:e,embedPublicationUrl:f,linkElement:A,image:L,icon:E,method:d,analytics:a,isProtected:M,wheel:c,urlHash:w,thumbnailUrl:u,ratioPadding:C,showLightbox:b,caption:y})},c.prototype.storeEmbed=function(e){const i=this;"fbo"!==PRODUCT_CODE&&"fbc"!==PRODUCT_CODE||!e.isProtected||"mobile"!==this.version?new a(e.linkElement,(function(){return.8*i._getWindowWidth()>i._getPayloadMinWidth()&&.8*i._getWindowHeight()>i._getPayloadMinHeight()&&!0===i.userAgentDetector.device.desktop&&e.showLightbox}),(function(t){i.embeds[e.elementId].lightboxWindow=t.contentWindow})):e.linkElement.addEventListener("click",(function(t){t.preventDefault(),i.openMobileLightbox(e.elementId)}));const o=t.g.document.createElement("div");e.element.appendChild(o),this.embeds[e.elementId]={id:e.elementId,url:e.embedPublicationUrl,element:e.element,container:o,link:e.linkElement,image:e.image,icon:e.icon,isProtected:e.isProtected,wheel:e.wheel,urlHash:e.urlHash,thumbnailUrl:e.thumbnailUrl,ratioPadding:e.ratioPadding,showLightbox:e.showLightbox,caption:e.caption},this._throttleEmbedInit(e,o),t.g.addEventListener("resize",(function(){i.embeds[e.elementId]&&i._resizeEmbed({element:e.element,payloadContainer:o,linkElement:e.linkElement,publicationUrl:e.embedPublicationUrl,embedId:e.elementId,ratioPadding:e.ratioPadding,image:e.image,icon:e.icon})})),this._doResize=function(){i.embeds[e.elementId]&&i._resizeEmbed({element:e.element,payloadContainer:o,linkElement:e.linkElement,publicationUrl:e.embedPublicationUrl,embedId:e.elementId,ratioPadding:e.ratioPadding,image:e.image,icon:e.icon})},this.API_URL.length>0&&"no"!==e.analytics&&this._sendAnalytics(this.API_URL,e.embedPublicationUrl,e.method)},c.prototype._shouldThrottleInit=function(t){let e=!0;if(t){const i=this._getBoundingClientRect(t);e=this._shouldRunPayload(i)}return e&&("fbo"===PRODUCT_CODE||"fbc"===PRODUCT_CODE)},c.prototype._throttleEmbedInit=function(t,e){if(Date.now()-this.lastRequestTime{this._throttleEmbedInit(t,e)}),100);this.lastRequestTime=Date.now(),this._resizeEmbed({element:t.element,payloadContainer:e,linkElement:t.linkElement,publicationUrl:t.embedPublicationUrl,embedId:t.elementId,ratioPadding:t.ratioPadding,image:t.image,icon:t.icon})},c.prototype.setEmbedPropertyById=function(t,e){if(!this.embeds.hasOwnProperty(t))return!1;const i=this.embeds[t];for(const o in e){if(!i.element)return;e.hasOwnProperty(o)&&i.element.hasAttribute("data-"+PRODUCT_CODE+"-"+o)&&("lightbox"===o&&"boolean"==typeof e[o]&&(e[o]=e[o]?"yes":"no"),i.element.setAttribute("data-"+PRODUCT_CODE+"-"+o,e[o]),"width"!==o&&"height"!==o||(i.element.style[o]=e[o]))}this._resizeEmbed({element:i.element,payloadContainer:i.container,linkElement:i.link,publicationUrl:i.url,embedId:t,ratioPadding:i.ratioPadding,image:i.image,icon:i.icon})},c.prototype._getPublicationThumbLink=function(t){return this.THUMBNAIL_URL+encodeURIComponent(t)+"&size=400"},c.prototype._getSelfhostPublicationThumbLink=function(t,e,i){let o=t.split("#")[0].split("?")[0];return i&&(o=t.split(i)[0]),o.lastIndexOf("/")===o.length-1&&(o=o.slice(0,o.length-1)),o+"/"+(e||("fbs"===PRODUCT_CODE?"files/cover300.jpg":"files/assets/cover300.jpg"))},c.prototype._sendAnalytics=function(e,i,o){this._ajax(e,(function(t,e){200!==e.status&&console.log(e)}),'{"RecordOnly":true,"Url":"'+i+'","EmbedDomain":"'+t.g.location.hostname+'"'+(o?',"EmbedMethod":"'+o+'"':"")+"}")},c.prototype._ajax=function(t,e,i,o){if(Date.now()-this.lastRequestTime{this._ajax(t,e,i,o)}),100);this.lastRequestTime=Date.now();const s=new XMLHttpRequest;try{s.open(i?"POST":"GET",t,1),s.setRequestHeader("X-Requested-With","XMLHttpRequest"),s.setRequestHeader("Content-type","application/json"),o&&(s.timeout=o),s.onreadystatechange=function(){s.readyState>3&&e&&e(s.responseText,s)},s.send(i)}catch(n){window.console&&console.error(n)}},c.prototype._receiveMessage=function(t){if(!t.data)return;const{fbPublicationUrl:e,action:i,localStorageFallback:o}=t.data;if(e&&e.includes(t.origin))for(const s in this.embeds){if(!this.embeds.hasOwnProperty(s))continue;const{contentWindow:e,lightboxWindow:n,url:l}=this.embeds[s];if([e,n].includes(t.source))switch(i){case"getLocalStorageFallback":const t={action:"localStorageFallback",localStorageFallback:JSON.parse(localStorage.getItem(`localStorageFallback-${s}`))};e&&e.postMessage(t,l),n&&n.postMessage(t,l);break;case"saveLocalStorageFallback":localStorage.setItem(`localStorageFallback-${s}`,JSON.stringify(o));break;case"openMobileLightbox":this.openMobileLightbox(s);break;case"closeLightbox":this.closeMobileLightbox(s);break;default:e&&e.postMessage("auth",l),n&&n.postMessage("auth",l)}}},c.prototype.openMobileLightbox=function(e){const i=this;let o=this.embeds[e].url+(-1===this.embeds[e].url.indexOf("?")?"?lightbox=true":"&lightbox=true");this.embeds[e].urlHash&&(o+="#"+this.embeds[e].urlHash),this.lightbox=t.g.document.createElement("div"),this.lightbox.style.position="fixed",this.lightbox.style.zIndex="9999",this.lightbox.style.top="0",this.lightbox.style.left="0",this.lightbox.style.width="100%",this.lightbox.style.height="100%",this.lightbox.style.opacity="0",this.lightbox.style.backgroundColor="#aaaaaa",this.lightbox.style.transition="opacity .5s ease-in-out",this.iframe=t.g.document.createElement("iframe"),this.iframe.style.width="100%",this.iframe.style.height="100%",this.iframe.setAttribute("type","text/html"),this.iframe.setAttribute("scrolling","no"),this.iframe.setAttribute("frameborder","0"),this.iframe.setAttribute("allowfullscreen","allowfullscreen"),this.iframe.setAttribute("allow","accelerometer; autoplay; encrypted-media; fullscreen *; gyroscope; picture-in-picture;"),this.iframe.setAttribute("src",o),this.setViewport(!1),this.lightbox.appendChild(this.iframe),setTimeout((function(){i.embeds[e].lightboxWindow=i.iframe.contentWindow}),10),t.g.document.body.appendChild(this.lightbox),t.g.scrollTo(0,-1),setTimeout((function(){const o=t.g.document.body.clientWidth/window.innerWidth;1!==o?(i.scale=o,t.g.scrollTo(0,-1),setTimeout((function(){t.g.scrollTo(0,-1),setTimeout((function(){i.lightbox.style.transformOrigin="top left",i.lightbox.style.transform="scale("+1/o+","+1/o+")",i.lightbox.style.height=t.g.innerHeight*o+"px",i.lightbox.style.width=t.g.innerWidth*o+"px",i.lightbox.style.opacity="1"}),100)}),200)):(i.lightbox.style.opacity="1",i.lightbox.style.height=t.g.innerHeight+"px",i.lightbox.style.width=t.g.innerWidth+"px"),i.mobileLightboxOpened=!0,t.g.addEventListener("resize",i.onMobileResizeBound),i.currentLigtboxId=e,t.g.history&&t.g.history.pushState&&(t.g.history.pushState({lightbox:!0},null,t.g.location.href),addEventListener("popstate",i.closeMobileLightboxBound))}),500)},c.prototype.closeMobileLightbox=function(e){e=e||this.currentLigtboxId;const i=this;t.g.history&&t.g.history.pushState&&removeEventListener("popstate",this.closeMobileLightboxBound),this.mobileLightboxOpened=!1,this.lightbox&&(i.setViewport(!0),setTimeout((function(){i.lightbox.style.opacity="0",setTimeout((function(){t.g.document.body.removeChild(i.lightbox),t.g.removeEventListener("resize",this.onMobileResizeBound),delete i.lightbox,delete i.iframe,delete i.currentLigtboxId,i.embeds[e].lightboxWindow=null,i.mobileLightboxOpened=!1}),1e3)}),0))},c.prototype.setViewport=function(t){let e=document.querySelector('meta[name="viewport"]');if(e)t||(this.savedViewport=e.content);else{if(!document.head||t)return;e=document.createElement("meta"),e.name="viewport",document.head.appendChild(e)}t?this.savedViewport?e.setAttribute("content",this.savedViewport):e&&document.head.removeChild(e):e.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, viewport-fit=cover")},c.prototype.onMobileResize=function(){if(!this.mobileLightboxOpened)return;const e=this,i=this.userAgentDetector.os.ios&&(736===t.g.innerWidth||414===t.g.innerWidth);this.lightbox.style.width="100%",this.lightbox.style.height=t.g.innerHeight+"px",clearTimeout(this.resizeTimer),t.g.scrollTo(0,-1),this.resizeTimer=setTimeout((function(){const o=t.g.document.body.clientWidth/window.innerWidth;1!==e.scale||1!==o?(e.scale=o,e.lightbox.style.transformOrigin="top left",e.lightbox.style.transform="scale("+1/o+","+1/o+")",e.lightbox.style.height=t.g.innerHeight*o+"px",e.lightbox.style.width=t.g.innerWidth*o+"px"):(i&&t.g.scrollTo(0,-1),e.lightbox.style.height=t.g.innerHeight+"px",e.lightbox.style.width=t.g.innerWidth+"px",e.lightbox.style.transform="initial",e.lightbox.style.transformOrigin="initial")}),500)},c.prototype._runPayload=function(e,i,o){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(i+=-1===i.indexOf("?")?"?embed=true":"&embed=true",i+=`&embedId=${o}`,this.embeds[o].isProtected&&(i+="&protected=true"),"true"!==this.embeds[o].wheel&&"yes"!==this.embeds[o].wheel||(i+="&wheel=true"),this.embeds[o].urlHash&&(i+="#"+this.embeds[o].urlHash),this._shouldShowPayload()&&!e.hasChildNodes()){const n=t.g.document.createElement("iframe");n.style.width="100%",n.style.height="100%",s&&(n.style.position="absolute",n.style.top=0,n.style.left=0),n.setAttribute("type","text/html"),n.setAttribute("scrolling","no"),n.setAttribute("frameborder","0"),n.setAttribute("loading","lazy"),n.setAttribute("allowfullscreen","allowfullscreen"),n.setAttribute("allow","accelerometer; autoplay; encrypted-media; fullscreen *; gyroscope; picture-in-picture;"),n.setAttribute("src",i),n.setAttribute("title",this.embeds[o].caption),n.addEventListener("load",(()=>{this.embeds[o].contentWindow=n.contentWindow})),e.appendChild(n),this.embeds[o].iframe=n}},c.prototype._removePayload=function(t,e,i,o){let s=t.firstChild;for(;s;)t.removeChild(s),s=t.firstChild;i&&i.complete&&0!==i.naturalHeight&&(i.style.opacity="1",o.style.display="initial",setTimeout((()=>{o.style.opacity="0.8"}),10)),window.removeEventListener("message",this._receiveMessage,!1)},c.prototype._resizeEmbed=function(t){let{element:e,payloadContainer:i,linkElement:o,publicationUrl:s,embedId:n,ratioPadding:l,image:r,icon:a}=t;const h=this,d=this._getBoundingClientRect(e);if(0!==d.width&&0!==d.height){if(i.style.width=o.style.width=d.width+"px",i.style.height=o.style.height=d.height+"px",this._shouldRunPayload(d)){if(this.mobileLightboxOpened)return;this._runPayload(i,s,n,!!l),l?(i.style.position="relative",i.style.display="inline-block",i.style.paddingTop=l,i.style.height=0):i.style.display="inline",o.style.display="none"}else if(this._removePayload(i,n,r,a),e.style.minHeight=null,i.style.display="none",l?(o.style.position="relative",o.style.display="inline-block",o.style.paddingTop=l,o.style.height=0):o.style.display="block",this.embeds[n].image){const t=this.embeds[n].image,e=t.naturalWidth,i=t.naturalHeight,s=o.getBoundingClientRect(),l=s.width/s.height,r=e/i;e>0&&i>0&&s.height>0&&s.width>0&&(t.style.height=l>r?s.height:i*s.width/e,t.style.width=l>r?e*s.height/i:s.width)}}else setTimeout((function(){h._resizeEmbed({element:e,payloadContainer:i,linkElement:o,publicationUrl:s,embedId:n,ratioPadding:l,image:r,icon:a})}),200)},c.prototype._getPayloadMinWidth=function(){return 400},c.prototype._getPayloadMinHeight=function(){return 200},c.prototype._getEmbedDefaultWidth=function(){return 250},c.prototype._getEmbedDefaultHeight=function(){return 150},c.prototype._shouldRunPayload=function(t){return t.width>=this._getPayloadMinWidth()&&t.height>=this._getPayloadMinHeight()&&this._shouldShowPayload()},c.prototype._shouldShowPayload=function(){return!!this.version},c.prototype._getPublicationThumbIcon=function(){return"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIxLjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MCA1MCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNTAgNTA7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7b3BhY2l0eTowLjk7fQoJLnN0MXtmaWxsOm5vbmU7c3Ryb2tlOiNGRkZGRkY7c3Ryb2tlLXdpZHRoOjI7fQo8L3N0eWxlPgo8ZyBpZD0iUGFnZS0xIj4KCTxnIGlkPSJWaWV3LUljb24iIHRyYW5zZm9ybT0idHJhbnNsYXRlKC02NC4wMDAwMDAsIC04NS4wMDAwMDApIj4KCQk8ZyBpZD0iX3gzMV8uLXZpZXciIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIwLjAwMDAwMCwgMjAuMDAwMDAwKSI+CgkJCTxnIGlkPSJHcm91cC00IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg0NC4wMDAwMDAsIDY1LjAwMDAwMCkiPgoJCQkJPGcgaWQ9Ikdyb3VwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMS4wMDAwMDAsIDkuMDAwMDAwKSIgY2xhc3M9InN0MCI+CgkJCQkJPHBhdGggaWQ9IlJlY3RhbmdsZV8yXyIgY2xhc3M9InN0MSIgZD0iTTEzLDdIMkMxLjQsNywxLDcuNCwxLDh2MThjMCwwLjYsMC40LDEsMSwxaDI1YzAuNiwwLDEtMC40LDEtMVY4YzAtMC42LTAuNC0xLTEtMWgtMi43CgkJCQkJCSIvPgoJCQkJCTxwYXRoIGlkPSJSZWN0YW5nbGVfMV8iIGNsYXNzPSJzdDEiIGQ9Ik0xNCw2LjZ2MTkuOGwxMC01VjEuNkwxNCw2LjZ6Ii8+CgkJCQk8L2c+CgkJCTwvZz4KCQk8L2c+Cgk8L2c+CjwvZz4KPC9zdmc+Cg=="},c.prototype._getWindowWidth=function(){return t.g.innerWidth||t.g.document.documentElement.clientWidth||t.g.document.body.clientWidth},c.prototype._getWindowHeight=function(){return t.g.innerHeight||t.g.document.documentElement.clientHeight||t.g.document.body.clientHeight},c.prototype._getBoundingClientRect=function(t){const e=t.getBoundingClientRect();return{width:e.width||e.right-e.left,height:e.height||e.bottom-e.top,left:e.left,right:e.right,top:e.top,bottom:e.bottom}},c.prototype._getElementsByClass=function(e,i){if(void 0===i&&(i=t.g.document),"function"==typeof i.getElementsByClassName)return i.getElementsByClassName(e);{const t=[],o=i.getElementsByTagName("*");for(const i in o)if(Object.prototype.hasOwnProperty.call(o,i)&&"object"==typeof o[i]){const s=Object.prototype.hasOwnProperty.call(o[i],"className")?o[i].className:o[i].getAttribute("className"),n=null===s?[]:s.split(" ");-1!==this._indexOf(n,e)&&t.push(o[i])}return t}},c.prototype._indexOf=function(t,e){if(null===t)return-1;const i=t.length;for(let o=0;o