(()=>{var _rediadsConfig$biddin,_rediadsConfig$biddin2,_window$location,_window$top2,_window$location2,_window$top3,_window$location3,_rediadsConfig$publis;function ownKeys(e,i){var d=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);i&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),d.push.apply(d,n)}return d}function _objectSpread(e){for(var i=1;i<arguments.length;i++){var d=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(d),!0).forEach(function(i){_defineProperty(e,i,d[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(d)):ownKeys(Object(d)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(d,i))})}return e}function _defineProperty(e,i,d){return(i=_toPropertyKey(i))in e?Object.defineProperty(e,i,{value:d,enumerable:!0,configurable:!0,writable:!0}):e[i]=d,e}function _toPropertyKey(e){var i=_toPrimitive(e,"string");return"symbol"==typeof i?i:i+""}function _toPrimitive(e,i){if("object"!=typeof e||!e)return e;var d=e[Symbol.toPrimitive];if(void 0!==d){var n=d.call(e,i||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===i?String:Number)(e)}function asyncGeneratorStep(e,i,d,n,o,t,a){try{var r=e[t](a),s=r.value}catch(e){return void d(e)}r.done?i(s):Promise.resolve(s).then(n,o)}function _asyncToGenerator(e){return function(){var i=this,d=arguments;return new Promise(function(n,o){var t=e.apply(i,d);function a(e){asyncGeneratorStep(t,n,o,a,r,"next",e)}function r(e){asyncGeneratorStep(t,n,o,a,r,"throw",e)}a(void 0)})}}var rediadsConfig={"version":"1.3.1","prebidNamespace":"rediads_pbjs","scripts":{"prebid":"https://cdn.rediads.com/prebid/common/prebid.js"},"publisher":{"id":"260304","name":"rappler","domain":{"iab":{"category":["IAB4"],"sectionCategory":["IAB4-11"],"pageCategory":["IAB4-11"]},"baseURL":"https://www.rappler.com/"}},"bidding":{"flags":{"disablePrebid":false,"disableAmazon":true},"constants":{"SECONDS_TO_WAIT_AFTER_VIEWABILITY":35,"REFRESH_INTERVAL_RANDOMIZER_CONSTANT":6,"PREBID_TIMEOUT":1200,"LOCATION_API_TIMEOUT":300,"AMAZON_BID_TIMEOUT":1200,"BIDS_FAILSAFE_TIMEOUT":2000,"INIT_CHECK_INTERVAL_DURATION":200,"BID_WON_POST_INERVAL":2000},"prebidConfig":{"useBidCache":true,"deviceAccess":true,"enableTIDs":true,"floors":{"enforcement":{"floorDeals":false},"auctionDelay":100,"endpoint":{"url":"https://cdn.ortbx.com/floors/rediads.json"}}},"prebidConditions":{"schain":true,"granularityCurrency":"USD","CMPRequired":false,"userId":true},"prebidConditionalConfigs":{"granularityCurrency":{"USD":{"priceGranularity":"high"},"INR":{"currency":{"adServerCurrency":"INR","conversionRateFile":"https://cdn.jsdelivr.net/gh/prebid/currency-file@1/latest.json","defaultRates":{"USD":{"INR":80}}},"priceGranularity":{"buckets":[{"precision":2,"min":0.1,"max":190,"increment":0.1},{"min":200,"max":500,"increment":0.2},{"min":500.2,"max":1500,"increment":0.4}]}}},"CMPRequired":{"consentManagement":{"gdpr":{"cmpApi":"iab","timeout":500,"actionTimeout":10000,"defaultGdprScope":true,"allowAuctionWithoutConsent":false}}},"schain":{"validation":"strict","config":{"ver":"1.0","complete":1,"nodes":[{"asi":"rediads.com","hp":1}]}},"userSync":{"syncDelay":3000,"auctionDelay":500,"aliasSyncEnabled":true,"filterSettings":{"iframe":{"bidders":"*","filter":"include"}},"userIds":[{"name":"sharedId","storage":{"type":"cookie","name":"sharedid","expires":365},"params":{"syncTime":60}},{"name":"id5Id","storage":{"name":"id5Id","expires":90,"type":"html5","refreshInSeconds":28800},"params":{"partner":1426}},{"name":"criteo"},{"name":"pairId"}]}},"adUnitConfig":{"bids":[{"bidder":"pubmatic","rs":0.75,"params":{"publisherId":"162837"},"allowAdjustment":true,"bidAdjustmentFactor":0.25},{"sizeBasedParams":["inventoryCode"],"bidder":"triplelift","params":{"inventoryCode":{"300_250":"afkgaming_RSB_1_300x250","336_280":"afkgaming_BottomOverlay_336x280","728_90":"afkgaming_MTF_3_728x90","320_50":"afkgaming_Leaderboard_320x50","300_100":"afkgaming_Leaderboard_320x50","970_250":"afkgaming_MTF_3_728x90","300_600":"afkgaming_RSB_1_300x250"}},"allowAdjustment":true}]},"adUnitConditions":{"cbNotificationRequired":false},"adUnitConditionalConfigs":{"mediaTypes":[{"config":{"api":[1,2],"mimes":["video/x-ms-wmv","video/mp4","video/3gpp","application/javascript"],"protocols":[2,3,5,6,7,8],"playbackmethod":[2],"context":"outstream","placement":3,"plcmt":4,"minduration":5,"maxduration":60,"linearity":2},"renderer":{"backupOnly":true,"options":{"playVideoVisibleThreshold":0,"nonViewableBehavior":"pause","disableCollapse":true}},"type":"video"},{"type":"native","title":{"required":true},"image":{"required":true},"sponsoredBy":{"required":true}}],"videoBidRenderer":{"url":"https://cdn.rediads.com/renderer/bundle.js","namespace":"ANOutstreamVideo","fn":"renderAd"}},"partners":[{"id":"5d8ed25e-57cc-441a-b62a-127b34faae4e","adServer":"googletag","name":"amazon"}],"analytics":{"enabled":false,"api":{"url":"https://bid-won-jtcjgcejcq-em.a.run.app"}}},"postBid":{"enabled":true,"mustMatchRegexString":"21855545885","partners":[{"adClient":"ca-pub-1403967326020386","adSlot":"8337317800","minAutoFormatHeight":100,"name":"adsense"}],"bidding":{"bids":[{"bidder":"pubmatic","rs":0.75,"params":{"publisherId":"162837"},"allowAdjustment":true,"bidAdjustmentFactor":0.25},{"sizeBasedParams":["inventoryCode"],"bidder":"triplelift","params":{"inventoryCode":{"300_250":"afkgaming_RSB_1_300x250","336_280":"afkgaming_BottomOverlay_336x280","728_90":"afkgaming_MTF_3_728x90","320_50":"afkgaming_Leaderboard_320x50","300_100":"afkgaming_Leaderboard_320x50","970_250":"afkgaming_MTF_3_728x90","300_600":"afkgaming_RSB_1_300x250"}},"allowAdjustment":true},{"sizeBasedParams":["crid"],"bidder":"medianet","params":{"crid":{"300_250":"770128287","336_280":"770128287","728_90":"770128287","320_50":"770128287","970_250":"770128287","default":"770128287"},"cid":"8CUTB3DRR"},"rs":0.7,"allowAdjustment":true}]},"constants":{"POSTBID_TIMEOUT_DURATION":1000,"ADSENSE_STATUS_CHECK_TIMEOUT":0},"fallbackWidgets":[{"conditions":{"sizes":["300_250","336_280","320_50","300_50","320_250"]},"config":{"user":"common","slot":"postbid","skipIframe":true,"addSizeSuffix":true},"type":"library"},{"conditions":{"sizes":["336_280","320_480","300_600","728_90","970_250","160_600","120_600","320_100","300_100"]},"type":"inline","config":{"type":"image_link","image":"https://cdn.ortbx.com/public/images/pivaura/$size$.webp","url":"https://pivaura.com/shop/ols/categories/Scented-Candles?utm_source=web_banner&utm_medium=Rediads_pbs&utm_campaign=pivaura_ads&utm_id=rediads","sizePattern":"$size$"}}]},"ins":{"enabled":false,"lsk":"__lsv__","sessionMinutes":15,"excludedRegions":["."],"excludedCountries":["."],"pIns":"/21855545885/majhinaukri.in/intersitial","rIns":"/21855545885/majhinaukri.in/intersitial"},"reIns":{"hours":0.98,"executions":1,"targetPageViews":0,"showDelaySeconds":0,"excludedRegions":["."],"excludedCountries":["."],"organicRestriction":false,"targetUserPercent":100,"enabled":false,"adPath":"/21855545885/majhinaukri.in/rewarded_interstitial"},"customViews":{"test":"16"},"coreServices":{"enabled":false,"anlytc":"https://openfpcdn.io/fingerprintjs/v4/iife.min.js"}},rediAdsIsIframe=window.top!==window,targetingKeyValues=[],rediAdsIsSafeFrame=!1,rediAdsTopHref,rediAdsGeoPromise;if(rediAdsIsIframe)try{var _window$top;rediAdsTopHref=null===(_window$top=window.top)||void 0===_window$top||null===(_window$top=_window$top.location)||void 0===_window$top?void 0:_window$top.href}catch(e){rediAdsIsSafeFrame=!0}var rediAdsPrebidDisabled=(null===(_rediadsConfig$biddin=rediadsConfig.bidding)||void 0===_rediadsConfig$biddin||null===(_rediadsConfig$biddin=_rediadsConfig$biddin.flags)||void 0===_rediadsConfig$biddin?void 0:_rediadsConfig$biddin.disablePrebid)||!!document.querySelector("[data-disable-prebid-bidding]"),rediAdsAmazonDisabled=(null===(_rediadsConfig$biddin2=rediadsConfig.bidding)||void 0===_rediadsConfig$biddin2||null===(_rediadsConfig$biddin2=_rediadsConfig$biddin2.flags)||void 0===_rediadsConfig$biddin2?void 0:_rediadsConfig$biddin2.disableAmazon)||!!document.querySelector("[data-disable-amazon-bidding]"),isRediAdsDebugOn="undefined"==typeof window||(null===(_window$location=window.location)||void 0===_window$location?void 0:_window$location.hash.includes("symplor_debug"))||rediAdsIsIframe&&!rediAdsIsSafeFrame&&(null===(_window$top2=window.top)||void 0===_window$top2||null===(_window$top2=_window$top2.location)||void 0===_window$top2?void 0:_window$top2.hash.includes("symplor_debug")),isRediAdsStagingOn="undefined"==typeof window||(null===(_window$location2=window.location)||void 0===_window$location2?void 0:_window$location2.hash.includes("symplor_staging"))||rediAdsIsIframe&&!rediAdsIsSafeFrame&&(null===(_window$top3=window.top)||void 0===_window$top3||null===(_window$top3=_window$top3.location)||void 0===_window$top3?void 0:_window$top3.hash.includes("symplor_staging")),isRediAdsHighlightOn=!rediAdsIsIframe&&(null===(_window$location3=window.location)||void 0===_window$location3?void 0:_window$location3.hash.includes("rediads")),REDIADS_LOG_PREFIX="SYMPLOR Prebid Wrapper :: ",rediAdsPageURL=rediAdsIsIframe&&rediAdsIsSafeFrame?null===(_rediadsConfig$publis=rediadsConfig.publisher)||void 0===_rediadsConfig$publis||null===(_rediadsConfig$publis=_rediadsConfig$publis.domain)||void 0===_rediadsConfig$publis?void 0:_rediadsConfig$publis.baseURL:window.location.href,rediAdsPageHostname=new URL(rediAdsPageURL).hostname,adsensePartnerConfig,mgidPartnerConfig,rediAdsLogger={log:function(){if(isRediAdsDebugOn){for(var e=arguments.length,i=new Array(e),d=0;d<e;d++)i[d]=arguments[d];console.log(REDIADS_LOG_PREFIX,...i)}},error:function(){if(isRediAdsDebugOn){for(var e=arguments.length,i=new Array(e),d=0;d<e;d++)i[d]=arguments[d];console.error(REDIADS_LOG_PREFIX,"Error:",...i)}},warn:function(){if(isRediAdsDebugOn){for(var e=arguments.length,i=new Array(e),d=0;d<e;d++)i[d]=arguments[d];console.warn(REDIADS_LOG_PREFIX,"Warning:",...i)}}},d,n;function rediAdsLoadScript(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return rediAdsLogger.log("Load Script: Script src not passed in params"),!1;window.symplor=window.symplor||{components:{},variables:{}},window.rediadsLegacy.scriptPromises=window.rediadsLegacy.scriptPromises||{},window.symplor.variables=window.symplor.variables||{},window.symplor.variables.pageUrl=rediAdsPageURL;var d=window.rediadsLegacy.scriptPromises[e];if(d)return d;var n=new Promise((d,n)=>{var o=document.createElement("script");o.src=e,o.id=e,i.defer?o.defer=!0:o.async=!0,i.crossorigin&&(o.crossOrigin=i.crossorigin),o.addEventListener("load",()=>{setTimeout(()=>{d()})}),o.addEventListener("error",e=>{n(e)}),document.head.appendChild(o)});return window.rediadsLegacy.scriptPromises[e]=n,n}window.rediadsLegacy=window.rediadsLegacy||{},window.rediadsLegacy.adSlotOverrideRenderCount=window.rediadsLegacy.adSlotOverrideRenderCount||{},function(e,i){function d(d,n){i[e]._Q.push([d,n])}i[e]&&i[e].init||rediAdsAmazonDisabled||(i[e]={init:function(){d("i",arguments)},fetchBids:function(){d("f",arguments)},setDisplayBids:function(){},targetingKeys:function(){return[]},_Q:[]},rediAdsLoadScript("https://c.amazon-adsystem.com/aax2/apstag.js"))}("apstag",window,document),d=document,n="googletag",window[n]&&window[n].cmd||d.getElementById("rediads_gpt")||rediAdsLoadScript("https://securepubads.g.doubleclick.net/tag/js/gpt.js"),function(e,i,d,n){rediAdsPrebidDisabled||window.rediads_pbjs||e.getElementById("rediads_prebid")||rediAdsLoadScript(null==rediadsConfig||null===(n=rediadsConfig.scripts)||void 0===n?void 0:n.prebid)}(document),function(e){if(null!==(e=rediadsConfig.bidding)&&void 0!==e&&null!==(e=e.prebidConditions)&&void 0!==e&&e.CMPRequired){var i=document.createElement("script"),d=document.getElementsByTagName("script")[0],n="https://cmp.inmobi.com".concat("/choice/","GLPjaeK0kbHd8","/",rediAdsPageHostname,"/choice.js?tag_version=V3"),o=0;i.async=!0,i.type="text/javascript",i.src=n,d.parentNode.insertBefore(i,d),function(){for(var e,i="__tcfapiLocator",d=[],n=window;n;){try{if(n.frames[i]){e=n;break}}catch(e){}if(n===window.top)break;n=n.parent}e||(function e(){var d=n.document,o=!!n.frames[i];if(!o)if(d.body){var t=d.createElement("iframe");t.style.cssText="display:none",t.name=i,d.body.appendChild(t)}else setTimeout(e,5);return!o}(),n.__tcfapi=function(){var e,i=arguments;if(!i.length)return d;if("setGdprApplies"===i[0])i.length>3&&2===i[2]&&"boolean"==typeof i[3]&&(e=i[3],"function"==typeof i[2]&&i[2]("set",!0));else if("ping"===i[0]){var n={gdprApplies:e,cmpLoaded:!1,cmpStatus:"stub"};"function"==typeof i[2]&&i[2](n)}else"init"===i[0]&&"object"==typeof i[3]&&(i[3]=Object.assign(i[3],{tag_version:"V3"})),d.push(i)},n.addEventListener("message",function(e){var i="string"==typeof e.data,d={};try{d=i?JSON.parse(e.data):e.data}catch(e){}var n=d.__tcfapiCall;n&&window.__tcfapi(n.command,n.version,function(d,o){var t={__tcfapiReturn:{returnValue:d,success:o,callId:n.callId}};i&&(t=JSON.stringify(t)),e&&e.source&&e.source.postMessage&&e.source.postMessage(t,"*")},n.parameter)},!1))}();var t=function(){var e=arguments;typeof window.__uspapi!==t&&setTimeout(function(){void 0!==window.__uspapi&&window.__uspapi.apply(window.__uspapi,e)},500)};if(void 0===window.__uspapi){window.__uspapi=t;var a=setInterval(function(){o++,window.__uspapi===t&&o<3?rediAdsLogger.warn("USP is not accessible"):clearInterval(a)},6e3)}}}(),rediAdsGeoPromise=fetch("https://pro.ip-api.com/json?key=yjfBZPLkt6Kkl3h&fields=17526783").then(function(e){return e.json()}),function(_bidding$adUnitConfig){var{publisher,bidding,postBid,coreServices}=rediadsConfig,isUserDataSent=!1,isMobile=window.matchMedia("only screen and (max-width: 767px)").matches,lazyInViewObserver,refreshInViewObserver,prebidConfigrations,bidTimeout=bidding.constants.PREBID_TIMEOUT,apiTimeout=bidding.constants.LOCATION_API_TIMEOUT,sid_value=publisher.id,prebidCommonBidders=null===(_bidding$adUnitConfig=bidding.adUnitConfig)||void 0===_bidding$adUnitConfig?void 0:_bidding$adUnitConfig.bids,postBidHandlingEnabled=postBid.enabled,adObjs={},rawUserData,processedUserData;function sendDataToBidWon(){var e,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];window.rediadsLegacy.bidWonQueue.length>0&&postData(null===(e=bidding.analytics)||void 0===e||null===(e=e.api)||void 0===e?void 0:e.url,window.rediadsLegacy.bidWonQueue,i).then(e=>{rediAdsLogger.log("bidWon anlytics-- success :",e),window.rediadsLegacy.bidWonQueue=[]}).catch(e=>{rediAdsLogger.log("bidWon anlytics -- error :",e)})}function getGlobalVariable(e){return rediAdsIsIframe&&!rediAdsIsSafeFrame?(window.top.rediadsLegacy=window.top.rediadsLegacy||{},window.top.rediadsLegacy[e]):window.rediadsLegacy[e]}function setGlobalVariable(e,i){rediAdsIsIframe&&!rediAdsIsSafeFrame&&(window.top.rediadsLegacy=window.top.rediadsLegacy||{},window.top.rediadsLegacy[e]=i),window.rediadsLegacy[e]=i}function getPrebid(){return window[rediadsConfig.prebidNamespace]}function setPrebid(){window[rediadsConfig.prebidNamespace]=getPrebid()||{que:[]}}function getDeviceObject(){var e={};e.ua=navigator.userAgent,e.dnt="1"==navigator.doNotTrack?1:0,e.lmt=0,e.devicetype=isMobile?1:2,e.js=1,e.h=window.screen.height,e.w=window.screen.width,e.ppi=96*window.devicePixelRatio,e.pxratio=window.devicePixelRatio,e.language=navigator.language,"geolocation"in navigator?e.geofetch=1:e.geofetch=0;var i="0,0,0";try{i=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/WIN/g,"").replace(/,/g,".")}catch(e){void 0!==navigator.mimeTypes["application/x-shockwave-flash"]&&(i=navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin.description)}return e.flashver=i,e.ext={},e}function createCompleteMetadataObject(){var e,i,d,n=document.title,o=document.referrer,t=document.documentElement.lang||"en",a="",r="";try{a=document.querySelector('meta[name="description"]').getAttribute("content"),r=document.querySelector('meta[name="keywords"]').getAttribute("content")}catch(e){rediAdsLogger.log("Error while reading meta description and keywords")}var s=(null===(e=publisher.domain)||void 0===e?void 0:e.iab)||{};return i={page:rediAdsPageURL,cat:s.category,sectioncat:s.sectionCategory,pagecat:s.pageCategory,mobile:isMobile,privacypolicy:1},rediAdsIsIframe||(i.name=n,r&&(i.keywords=r),a&&(i.description=a)),o&&(i.ref=o),d={url:rediAdsPageURL,cat:s.category,context:5,language:t,embeddable:0},rediAdsIsIframe||(d.title=n,r&&(d.keywords=r)),{site:i,content:d,publisher:{cat:s.category},device:getDeviceObject()}}function getDeviceType(){var e=navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(e)?"tablet":/Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(e)?"mobile":"desktop"}function executeParallelAuctions(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];try{var n={adserverRequestSent:!1,aps:!1,prebid:!1};function o(){try{return void((n.aps&&n.prebid||rediAdsPrebidDisabled&&!rediAdsAmazonDisabled&&n.aps||rediAdsAmazonDisabled&&!rediAdsPrebidDisabled&&n.prebid)&&t())}catch(e){rediAdsLogger.log("Error in biddersBack: ",e)}}function t(){try{if(!0===n.adserverRequestSent)return;n.adserverRequestSent=!0,e.length&&googletag.cmd.push(function(){googletag.pubads().refresh(e)})}catch(e){rediAdsLogger.log("Error in sendAdserverRequest: ",e)}}rediAdsAmazonDisabled&&rediAdsPrebidDisabled?t():(function(){try{if(rediAdsAmazonDisabled||d.length&&apstag.fetchBids({slots:d},function(){googletag.cmd.push(function(){apstag.setDisplayBids(),n.aps=!0,o()})}),!rediAdsPrebidDisabled){var e=getPrebid();i.length&&e.que.push(function(){e.requestBids({adUnits:i,bidsBackHandler:function(){googletag.cmd.push(function(){e.setTargetingForGPTAsync(),n.prebid=!0,o()})}})})}}catch(e){rediAdsLogger.log("Error in requestHeaderBids: ",e)}}(),window.setTimeout(function(){t()},bidTimeout))}catch(a){rediAdsLogger.log("Error in executeParallelAuctions: ",a)}}function handleMediaTypes(e,i){var d,n,o=!1;if((document.getElementById(e.divId).getAttribute("data-ad-media-types")||"").split(",").includes("video")&&(o=!0,rediAdsLogger.log("Mediatypes video enabled via data-attribute for ",e.adSlot," ",e.divId)),null!==(d=bidding.adUnitConditions)&&void 0!==d&&null!==(d=d.videoValidations)&&void 0!==d&&d.slotRegex&&new RegExp(bidding.adUnitConditions.videoValidations.slotRegex).test(e.adSlot)&&(o=!0,rediAdsLogger.log("Mediatypes video enabled via slotRegex for ",e.adSlot," ",e.divId)),null!==(n=bidding.adUnitConditions)&&void 0!==n&&null!==(n=n.videoValidations)&&void 0!==n&&n.adSlots&&bidding.adUnitConditions.videoValidations.adSlots.length&&bidding.adUnitConditions.videoValidations.adSlots.includes(e.adSlot)&&(o=!0,rediAdsLogger.log("Mediatypes video enabled via adSlots for ",e.adSlot," ",e.divId)),o){var t,a=bidding.adUnitConditionalConfigs.mediaTypes.find(e=>"video"===e.type);i.mediaTypes.video=a.config,i.mediaTypes.video.w=e.adSize[0][0],i.mediaTypes.video.h=e.adSize[0][1],i.mediaTypes.video.playerSize=e.adSize[0],i.mediaTypes.video.renderer={url:bidding.adUnitConditionalConfigs.videoBidRenderer.url,render:function(e){var i={ad:{video:{content:e.vastXml,player_height:e.height,player_width:e.width}}};e.renderer.push(()=>{var d,n;window[null===(d=bidding.adUnitConditionalConfigs)||void 0===d||null===(d=d.videoBidRenderer)||void 0===d?void 0:d.namespace][null===(n=bidding.adUnitConditionalConfigs)||void 0===n||null===(n=n.videoBidRenderer)||void 0===n?void 0:n.fn]({targetId:e.adUnitCode,adResponse:i})})},options:a.renderer.options},null!==(t=bidding.adUnitConditions)&&void 0!==t&&t.cbNotificationRequired&&(i.mediaTypes.video.renderer.cbNotification=function(e,i,d,n){rediAdsLogger.log("Video Bid - eventType: ",e),rediAdsLogger.log("Video Bid - eventName: ",i),rediAdsLogger.log("Video Bid - adId: ",d),rediAdsLogger.log("Video Bid - eventData: ",n)})}}function getProcessedClonedBidder(e,i){try{var d={params:{}};return rediAdsLogger.log("processing ".concat(e.bidder,"'s sizedBasedParams for size ").concat(i)),Object.keys(e).forEach(n=>{"params"===n?Object.keys(e.params).forEach(n=>{var o;null!==(o=e.sizeBasedParams)&&void 0!==o&&o.includes(n)?(d.params[n]=e.params[n][i]||e.params[n].default||"",""===d.params[n]?rediAdsLogger.log("no valid/default value found for sizeBasedParam ".concat(n," for bidder ").concat(e.bidder," ")):rediAdsLogger.log("value ".concat(d.params[n]," ").concat(e.bidder,"'s sizedBasedParam ").concat(n," for size ").concat(i))):d.params[n]=e.params[n]}):d[n]=e[n]}),d}catch(i){rediAdsLogger.log(" Error while processing ".concat(e.bidder,"'s sizedBasedParams"))}}function isBidderGeoValid(e){var i,d,n,o=!0;if(null!=e&&null!==(i=e.geo)&&void 0!==i&&i.countries&&(null!=e&&null!==(d=e.geo)&&void 0!==d&&d.countries.in||null!=e&&null!==(n=e.geo)&&void 0!==n&&n.countries.ex)){var t,a,r,s,l=(null==e||null===(t=e.geo)||void 0===t||null===(t=t.countries)||void 0===t?void 0:t.ex)||[],c=(null==e||null===(a=e.geo)||void 0===a||null===(a=a.countries)||void 0===a?void 0:a.in)||[],g=(null===(r=prebidConfigrations)||void 0===r||null===(r=r.ortb2)||void 0===r||null===(r=r.device)||void 0===r||null===(r=r.geo)||void 0===r?void 0:r.country)||"";g?l.length&&l.includes(g.toLowerCase())?(o=!1,sendGA("ads",{category:"bidder_excluded_by_geo",action:"excluded_for_country_".concat(g.toLowerCase()),label:null==e?void 0:e.bidder})):c.length&&!c.includes(g.toLowerCase())&&(o=!1,sendGA("ads",{category:"bidder_excluded_by_geo",action:"does_not_included_country_".concat(g.toLowerCase()),label:null==e?void 0:e.bidder})):null!=e&&null!==(s=e.geo)&&void 0!==s&&null!==(s=s.countries)&&void 0!==s&&s.allowUnknown?(o=!0,sendGA("ads",{category:"bidder_included_by_geo_unknown_allowed",action:"country_not_available",label:null==e?void 0:e.bidder})):(o=!1,sendGA("ads",{category:"bidder_excluded_by_geo",action:"country_not_available",label:null==e?void 0:e.bidder}))}return o}function getMassagedBidders(e,i){try{var d=[];if("object"==typeof i&&i.length>0)for(var n=0;n<i.length;n+=1)if(isBidderGeoValid(i[n]))if(i[n].sizeBasedParams&&i[n].sizeBasedParams.length){var o=getProcessedClonedBidder(i[n],e);o&&d.push(o)}else d.push(i[n]);return d}catch(e){rediAdsLogger.log("Error in getMassagedBidders function while processing bidders.")}}function getAdSlot(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.adSlot;try{var d,n,o=null===(d=e.keyValues)||void 0===d?void 0:d.ad_unit;if((null==o?void 0:o.indexOf("/"))>-1&&null!=rediadsConfig&&null!==(n=rediadsConfig.algo)&&void 0!==n&&n.id){var t,a,r,s=o.split("/");s[1]="".concat(null==rediadsConfig||null===(t=rediadsConfig.algo)||void 0===t?void 0:t.id).concat(null!=rediadsConfig&&null!==(a=rediadsConfig.algo)&&void 0!==a&&a.prefix?"/".concat(null==rediadsConfig||null===(r=rediadsConfig.algo)||void 0===r?void 0:r.prefix):""),i=s.join("/")}}catch(e){rediAdsLogger.log("Error while processing custom adslot.")}return i}function bidAndRenderSlots(e){var i=[],d=[],n=[];e.forEach(function(e){var o="".concat(e.adSize[0][0],"_").concat(e.adSize[0][1]),t={code:e.divId,mediaTypes:{banner:{sizes:e.adSize}},bids:getMassagedBidders(o,prebidCommonBidders)},a="1_1"===o;rediAdsLogger.log("Handling Mediatypes for ",e.adSlot," ",e.divId),handleMediaTypes(e,t),e.divId&&e.adSlot&&e.adSize?(rediAdsPrebidDisabled||a||(rediAdsLogger.log("Pushing ",e.adSlot," ",e.divId," into prebidSlotObjs"),i.push(t)),rediAdsAmazonDisabled||a||d.push({slotID:e.divId,sizes:e.adSize,slotName:e.adSlot}),adObjs[e.divId]&&adObjs[e.divId].slot?n.push(adObjs[e.divId].slot):googletag.cmd.push(function(){var i=googletag.defineSlot(getAdSlot(e),e.adSize,e.divId);i.setCollapseEmptyDiv(!1),targetingKeyValues.forEach(e=>{e&&i.setTargeting(e.key,e.value)}),e.refresh&&(i.setTargeting("ad_refresh","true"),i.setTargeting("lazy_value",e.lazyValue));try{"object"==typeof e.keyValues&&Object.keys(e.keyValues).forEach(d=>{var n=e.keyValues[d];if("ad_unit"===d){var o=e.keyValues[d].split("/");n=o[o.length-1]}i.setTargeting(d,n)})}catch(e){rediAdsLogger.log("Error while processing key values set targetting")}i.addService(googletag.pubads()),n.push(i),adObjs[e.divId].slot=i,googletag.display(e.divId)})):rediAdsLogger.log("Error : ad details not availale")}),setTimeout(function(){executeParallelAuctions(n,i,d)},0)}function sha256(e){return _sha.apply(this,arguments)}function _sha(){return(_sha=_asyncToGenerator(function*(e){var i=(new TextEncoder).encode(e),d=yield crypto.subtle.digest("SHA-256",i);return Array.from(new Uint8Array(d)).map(e=>e.toString(16).padStart(2,"0")).join("")})).apply(this,arguments)}function dotsReplacer(e){return e.length>1?e:""}function normalizeEmail(e,i){var d=e.split("@"),n=d.pop(),o=[d.join("@"),n];return o[1]=o[1].toLowerCase(),o[0]=o[0].split("+")[0],o[0]=o[0].replace(/\.+/g,dotsReplacer),o[0]=o[0].toLowerCase(),o.join("@")}function updateID5IDConfigWithPD(e){return _updateID5IDConfigWithPD.apply(this,arguments)}function _updateID5IDConfigWithPD(){return(_updateID5IDConfigWithPD=_asyncToGenerator(function*(e){var i,d=null===(i=prebidConfigrations)||void 0===i||null===(i=i.ortb2)||void 0===i||null===(i=i.device)||void 0===i?void 0:i.ip,n=window.navigator.userAgent,o=null==processUserData?void 0:processUserData.uemail,t={12:encodeURIComponent(n),9:encodeURIComponent(rediAdsPageHostname),8:encodeURIComponent(rediAdsPageURL)};o&&(t[1]=yield sha256(normalizeEmail(o))),d&&(t[10]=encodeURIComponent(d));var a=Object.keys(t).map(e=>e+"="+t[e]).join("&");e.params.pd=btoa(a)})).apply(this,arguments)}function updateUserIds(){return _updateUserIds.apply(this,arguments)}function _updateUserIds(){return _updateUserIds=_asyncToGenerator(function*(){var e;null!==(e=bidding.prebidConditions)&&void 0!==e&&e.userId&&(yield prebidConfigrations.userSync.userIds.forEach(function(){var e=_asyncToGenerator(function*(e){"id5Id"===e.name&&(yield updateID5IDConfigWithPD(e))});return function(i){return e.apply(this,arguments)}}()))}),_updateUserIds.apply(this,arguments)}function getUpdatedMetadataPromise(){return new Promise(function(e,i){var d=!1,n=!1;try{rediAdsGeoPromise.then(function(i){prebidConfigrations.ortb2.device.ip=i.query,prebidConfigrations.ortb2.device.geo={country:i.country,region:i.regionName,city:i.city,timezone:i.timezone};try{prebidConfigrations.ortb2.device.geo.lat=parseFloat(i.lat),prebidConfigrations.ortb2.device.geo.lon=parseFloat(i.lon)}catch(e){rediAdsLogger.log("Error while processing lat/long")}prebidConfigrations.ortb2.device.carrier=i.isp,n=!0,d||e()}).catch(function(i){n=!0,e(),rediAdsLogger.log("Error fetching data from the geo API:",i)}),setTimeout(function(){n||(d=!0,e(),rediAdsLogger.log("geo API timed out"))},apiTimeout)}catch(i){rediAdsLogger.log("Error fetching data from the geo API:",i),n=!0,e()}})}function postData(){return _postData.apply(this,arguments)}function _postData(){return _postData=_asyncToGenerator(function*(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(arguments.length>2&&void 0!==arguments[2]&&arguments[2]))return fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});var d=new Blob([JSON.stringify(i)],{type:"text/plain; charset=UTF-8"});navigator.sendBeacon(e,d)}),_postData.apply(this,arguments)}function registerPrebidConfig(){return _registerPrebidConfig.apply(this,arguments)}function _registerPrebidConfig(){return(_registerPrebidConfig=_asyncToGenerator(function*(){if(!rediAdsPrebidDisabled&&!window.rediadsLegacy.prebidConfigrations){yield getUpdatedMetadataPromise(),yield updateUserIds(),window.rediadsLegacy.prebidConfigrations=prebidConfigrations;var e=getPrebid();e.que.push(function(){var i;e.setConfig(prebidConfigrations),e.bidderSettings=e.bidderSettings||{},e.bidderSettings.standard=e.bidderSettings.standard||{},e.bidderSettings.standard.storageAllowed=!0,null!=bidding&&null!==(i=bidding.analytics)&&void 0!==i&&i.enabled&&!window.rediadsLegacy.isBidWonEventHandled&&(e.onEvent("bidWon",function(e){var i,d={date:(new Date).toISOString(),domain:rediAdsPageHostname,demand_channel:e.bidder,device:getDeviceType(),ad_type:e.mediaType,ecpm:e.cpm,country:null===(i=prebidConfigrations)||void 0===i||null===(i=i.ortb2)||void 0===i||null===(i=i.device)||void 0===i||null===(i=i.geo)||void 0===i?void 0:i.country};window.rediadsLegacy.bidWonQueue.push(d)}),window.rediadsLegacy.isBidWonEventHandled=!0),prebidCommonBidders.forEach(i=>{(i.rs||i.bidAdjustmentFactor)&&(e.bidderSettings[i.bidder]={bidCpmAdjustment:function(e,d){return rediAdsLogger.log("Adjusting, Bidder is: "+d.bidderCode),e*(i.bidAdjustmentFactor?1-i.bidAdjustmentFactor:i.rs)}}),i.schain&&e.setBidderConfig({bidders:[i.bidder],config:{schain:i.schain}})})})}})).apply(this,arguments)}function processAds(e){return _processAds.apply(this,arguments)}function _processAds(){return(_processAds=_asyncToGenerator(function*(e){try{yield registerPrebidConfig(),bidAndRenderSlots(e)}catch(e){rediAdsLogger.log("error while processing ads:"+e)}})).apply(this,arguments)}window.rediadsLegacy.bidWonQueue=[];var resetSession=function(){setDataToLocalStorageWithExpiry((arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).adSlot,0,sessionDuration,0)};function handleAdSlotOverride(e,i){var d;if(null!=rediadsConfig&&null!==(d=rediadsConfig.bidding)&&void 0!==d&&null!==(d=d.adUnitOverrides)&&void 0!==d&&d.length){var n=rediadsConfig.bidding.adUnitOverrides.find(e=>{var d,n,o,{session:{hour:t=0,frequency:a}={}}=e||{},r=6e4*t,s=localStorage.getItem(e.adSlot);if(s)try{var l=JSON.parse(s),{expiry:c,value:g}=l||{};if(o=l.sessionRenderCount||0,Date.now()<c){if(o>=a)return!1;if(g>=e.maxRenderCount)return!1}else resetSession(e)}catch(e){}o++;var u=window.rediadsLegacy.adSlotOverrideRenderCount[e.adSlot]||0;if(e.maxRenderCount=e.maxRenderCount||1,u>=e.maxRenderCount)return!1;setDataToLocalStorageWithExpiry(e.adSlot,u+1,r,o),window.rediadsLegacy.adSlotOverrideRenderCount[e.adSlot]=u+1;var p,f;return p=null===(d=e.sizes)||void 0===d||!d.length||e.sizes.includes("".concat(i[0][0],"_").concat(i[0][1])),f=null===(n=e.timeRanges)||void 0===n||!n.length||e.timeRanges.find(e=>isTimeRangeValid(e)),p&&f});return(null==n?void 0:n.adSlot)||e}return e}function createAdObjectsFromHTML(e){var i=[];return(e||document.querySelectorAll("div[data-adslot]:not([data-ad-processed])")||[]).forEach(function(e){var d,n=(Math.random()+1).toString(36).substring(7),o=e.getAttribute("data-adslot"),t=isMobile?e.getAttribute("data-size-mobile"):e.getAttribute("data-size-desktop")||e.getAttribute("data-size"),a="true"===e.getAttribute("data-ad-refresh"),r="true"===e.getAttribute("data-ad-lazyloading"),s=e.getAttribute("data-viewport-away")||1,l={};try{var c;null!==(c=l=JSON.parse(e.getAttribute("data-key-values")||"{}"))&&void 0!==c&&c.ad_unit&&sendGA("ads",{category:"backfill_parent_ad_unit",action:l.ad_unit})}catch(e){rediAdsLogger.log("Error while processing data-key-values for divId ".concat(n," and adSlot ").concat(o))}e.setAttribute("id",n);try{t=JSON.parse(t)}catch(e){rediAdsLogger.log("Error while parsing ad size : "+e)}t&&(d={divId:n,adSlot:o=handleAdSlotOverride(o,t),adSize:t,refresh:a,lazyValue:s,keyValues:l},adObjs[n]=d,r&&lazyInViewObserver?lazyInViewObserver.observe(e):i.push(d)),e.setAttribute("data-ad-processed","yes"),isRediAdsHighlightOn&&(e.style.background="url('https://blog.rediads.com/wp-content/uploads/2023/09/Rediads_Logo-2.png') center/contain no-repeat #ff7722",e.style.border="12px solid #ff7722",e.style.boxShadow="0 -20px 10px rgba(0, 0, 0, 0.2)")}),i}function initAPSTag(){var e=bidding.partners.find(e=>"amazon"===e.name);e&&(apstag.init({pubID:e.id,adServer:e.adServer,bidTimeout:bidding.constants.AMAZON_BID_TIMEOUT}),window.rediadsLegacy.apstagInitialised=!0)}function processPostBidAds(e){return _processPostBidAds.apply(this,arguments)}function _processPostBidAds(){return(_processPostBidAds=_asyncToGenerator(function*(e){yield registerPrebidConfig(),e.forEach(e=>{var i=randomIntFromInterval(1,1e7);sendGA("ads",{category:"postbid",action:"triggered",label:e.adSlot}),createPostbidIframe(e.divId,i,e.adSize,e.adSlot),setupPostbidAuction(e.divId,i,e.adSize,e.adSlot,!0)})})).apply(this,arguments)}function checkAndProcessAds(e){for(var i=[],d=[],n=0;n<e.length;n+=1){var o,t,a,r,s;null!=rediadsConfig&&null!==(o=rediadsConfig.includeInDefaultFlow)&&void 0!==o&&o.length?null!=rediadsConfig&&rediadsConfig.includeInDefaultFlow.includes(e[n].adSlot)||null!=rediadsConfig&&rediadsConfig.includeInDefaultFlow.includes(null===(t=e[n])||void 0===t||null===(t=t.keyValues)||void 0===t?void 0:t.ad_unit)?i.push(e[n]):d.push(e[n]):null!=rediadsConfig&&null!==(a=rediadsConfig.excludeFromDefaultFlow)&&void 0!==a&&a.includes(e[n].adSlot)||null!=rediadsConfig&&null!==(r=rediadsConfig.excludeFromDefaultFlow)&&void 0!==r&&r.includes(null===(s=e[n])||void 0===s||null===(s=s.keyValues)||void 0===s?void 0:s.ad_unit)?d.push(e[n]):i.push(e[n])}return!("undefined"==typeof googletag||!googletag.apiReady||!rediAdsPrebidDisabled&&void 0===getPrebid()||!rediAdsAmazonDisabled&&void 0===window.apstag||(i.length>0&&(rediAdsLogger.log("ads that need to start with default flow",i),processAds(i)),d.length>0&&(rediAdsLogger.log("ads that need to start with postbid flow",d),processPostBidAds(d)),0))}function bindHandleLazyAdsEvent(){window.IntersectionObserver&&(lazyInViewObserver=new IntersectionObserver(function(e){e.forEach(e=>{if(e.intersectionRatio>0){var i=e.target.getAttribute("id");checkAndProcessAds([adObjs[i]]),lazyInViewObserver.unobserve(e.target)}})},{rootMargin:"800px"}))}function handleRefreshableAds(){window.IntersectionObserver&&(refreshInViewObserver=new IntersectionObserver(function(e){e.forEach(e=>{if(e.intersectionRatio>0){var i=e.target.getAttribute("id");checkAndProcessAds([adObjs[i]]),refreshInViewObserver.unobserve(e.target)}})},{rootMargin:"800px"})),googletag.cmd.push(function(){googletag.pubads().addEventListener("impressionViewable",function(e){var i=e.slot,d=e.slot.getSlotElementId();"true"===i.getTargeting("ad_refresh")[0]&&setTimeout(function(){var e=document.getElementById(d);e&&refreshInViewObserver.observe(e)},1e3*(Math.floor(bidding.constants.REFRESH_INTERVAL_RANDOMIZER_CONSTANT*Math.random())+bidding.constants.SECONDS_TO_WAIT_AFTER_VIEWABILITY))})})}function initGPT(){window.googletag=window.googletag||{cmd:[]},window.googletag.cmd=window.googletag.cmd||[],googletag.cmd.push(function(){var e;googletag.pubads().isInitialLoadDisabled()||googletag.pubads().disableInitialLoad(),rediAdsIsIframe&&rediAdsIsSafeFrame&&googletag.pubads().set("page_url",null===(e=publisher.domain)||void 0===e?void 0:e.baseURL),googletag.enableServices()}),window.rediadsLegacy.gptInitialsed=!0}function getFallBackWidgetPlaceHolder(e){var i,{widgetConfig:d,slotSize:n}=e;return'<div data-symplor-widget="yes"\n    data-symplor-user="'.concat(d.user,'"\n    data-symplor-slot="').concat(d.slot).concat(d.addSizeSuffix?"_".concat(n):"",'"\n    data-symplor-skip-iframe="').concat(d.skipIframe?"yes":"no",'"\n    data-symplor-domain="').concat(null===(i=publisher.domain)||void 0===i?void 0:i.baseURL,'"\n    >\n  </div>')}function getInlineFallBackWidgetHTML(e,i){var d="",n=e.image;switch(e.sizePattern&&(n=n.replace(e.sizePattern,i)),e.type){case"image_link":d='<div style="width:100%;height:100%;overflow:hidden;" data-symplor-inilne-widget="yes" data-symplor-type="'.concat(e.type,'">\n                      <a target="_blank" href="').concat(e.url,'" style="display:block; width: 100%; height:100%;">\n                        <img src="').concat(n,'" style="display:block; width: 100%; height:100%;object-fit:contain;"/>\n                      </a>\n                      </div>');break;case"default":d=""}return d}function isCurrentTimeInRange(e,i){var d=(new Date).getHours();return e<0||e>23||i<0||i>23?(rediAdsLogger.log("Time Range Error: Hours must be between 0 and 23"),!1):e<=i?d>=e&&d<=i:d>=e||d<i}function isTimeRangeValid(e){return!(e&&(null!=e&&e.startHour||0===(null==e?void 0:e.startHour))&&null!=e&&e.endHour&&!isCurrentTimeInRange(e.startHour,e.endHour))}function areWidgetConditionsValid(e,i,d){var n,o,t,a,r=!1,s=!1,l=!1,c=isTimeRangeValid(null==e||null===(n=e.conditions)||void 0===n?void 0:n.timeRange);if(null==e||null===(o=e.conditions)||void 0===o||!o.sizes.includes(i))return!1;if(e.conditions.maxConcurrency){var g=getGlobalVariable("symplorPFWCC")||{},u=g[d]||0;if(!(u<e.conditions.maxConcurrency))return!1;s=!0,u+=1,g[d]=u,setGlobalVariable("symplorPFWCC",g)}else s=!0;if(null!=e&&null!==(t=e.conditions)&&void 0!==t&&t.countries&&null!=e&&null!==(a=e.conditions)&&void 0!==a&&a.countries.length){var p,f,v=(null===(p=prebidConfigrations)||void 0===p||null===(p=p.ortb2)||void 0===p||null===(p=p.device)||void 0===p||null===(p=p.geo)||void 0===p?void 0:p.country)||"";l=!(null==e||null===(f=e.conditions)||void 0===f||!f.countries.includes(v))}else l=!0;return s&&l&&c&&(r=!0),r}function fallbackToSymplorWidget(e,i,d,n,o){var t,a,r;e.insertAdjacentHTML("beforeend",'<div data-symplor-fallback-widget="yes"></div>'),rediAdsLogger.log("falling back to symplor widget for path: ".concat(d,", div ID : ").concat(n,", iframe id : postbid_iframe ").concat(o,"."));for(var s=e.querySelector('[data-symplor-fallback-widget="yes"]'),l=i[0][0]+"_"+i[0][1],c=postBid.fallbackWidgets||[],g=-1,u=0;u<c.length;u++){if(areWidgetConditionsValid(c[u],l,u)){g=u,rediAdsLogger.log("fallback widget conditions valid for path: ".concat(d,", slotSize : ").concat(l," and fallbackwidget index : ").concat(u," "));break}rediAdsLogger.log("fallback widget conditions NOT valid for path: ".concat(d,", slotSize : ").concat(l," and fallbackwidget index : ").concat(u," "))}if(-1===g)return sendGA("ads",{category:"postbid",action:"fallback_widget_invalid_".concat(l),label:d}),void rediAdsLogger.log("no valid fallback widget found for path: ".concat(d,", slotSize : ").concat(l," "));var p,f,{config:v,type:b,widgets:m,conditions:w}=c[g];if("one_of_list"===b){var h=parseInt((100*Math.random()).toFixed());if(rediAdsLogger.log("Handling one_of_list. View Range Number: ".concat(h)),validWidget=m.find(e=>{var i,d,n=null==e||null===(i=e.conditions)||void 0===i?void 0:i.viewRange[0],o=null==e||null===(d=e.conditions)||void 0===d?void 0:d.viewRange[1];return n<=h&&o>=h}),!validWidget)return rediAdsLogger.log("No valid widgets found in one_of_list. Please check conditions."),void sendGA("ads",{category:"postbid",action:"fallback_widget_invalid_one_of_list_".concat(l),label:d});v=validWidget.config,b=validWidget.type,w=validWidget.conditions,rediAdsLogger.log("Valid widget found in one_of_list. view Range : ".concat(w.viewRange))}if(isMobile&&null!==(t=v)&&void 0!==t&&t.responsive?(s.style.minHeight=i[0][1]+"px",s.style.width="100vw",s.style.height="auto",s.style["margin-left"]="-".concat(s.getBoundingClientRect().x,"px")):null!==(a=v)&&void 0!==a&&a.responsive?(s.style.width="100%",s.style.minHeight=i[0][1]+"px"):(s.style.height=i[0][1]+"px",s.style.width=i[0][0]+"px",s.style.margin="0 auto"),v.restrictions&&(null!==(p=v.restrictions)&&void 0!==p&&p.maxWidth&&(s.style.maxWidth=v.restrictions.maxWidth+"px"),null!==(f=v.restrictions)&&void 0!==f&&f.maxHeight&&(s.style.maxHeight=v.restrictions.maxHeight+"px")),"inline"===b||null!==(r=v)&&void 0!==r&&r.isInline){var y;s.innerHTML=getInlineFallBackWidgetHTML(v,l);try{s.querySelector("a").addEventListener("click",e=>{var i,d;sendGA("widgets",{widget_type:"inline_".concat(null===(i=v)||void 0===i?void 0:i.type),action:"click",link:null==e||null===(d=e.target)||void 0===d?void 0:d.closest("a").getAttribute("href"),widget_size:l})})}catch(e){rediAdsLogger.log("Error while inline widget GA handling")}sendGA("ads",{category:"postbid",action:"fallback_inline_widget_loaded",label:d,widget_type:null===(y=v)||void 0===y?void 0:y.type,widget_size:l})}else{var A;s.innerHTML=getFallBackWidgetPlaceHolder({widgetConfig:v,slotSize:l}),null!==(A=window.symplor)&&void 0!==A&&null!==(A=A.sdk)&&void 0!==A&&A.initWidgets?(rediAdsLogger.log("symplor sdk already loaded, calling initwidgets for path: ".concat(d,", div ID : ").concat(n,", iframe id : postbid_iframe ").concat(o,".")),window.symplor.sdk.initWidgets(),sendGA("ads",{category:"postbid",action:"fallback_widget_loaded",label:d,widget_type:"".concat(v.user,"_").concat(v.slot),widget_size:l})):(rediAdsLogger.log("loading symplor sdk for path: ".concat(d,", div ID : ").concat(n,", iframe id : postbid_iframe ").concat(o,".")),rediAdsLoadScript(rediadsConfig.sdkPath||"https://cdn.ortbx.com/widgets/sdk/v1.js").then(function(){rediAdsLogger.log("Symplor SDK loaded successfully for postbid fallback widget"),sendGA("ads",{category:"postbid",action:"fallback_widget_loaded",label:d,widget_type:"".concat(v.user,"_").concat(v.slot),widget_size:l})}))}}function fallbackPostAdsense(e,i,d,n,o){var t,a=null===(t=postBid.partners)||void 0===t?void 0:t.find(e=>"adgebra"===e.name);a&&a.enabled?fallbackToAdgebra(n,d,o,a,e):fallbackToMGID(e,i,d,n,o)}function fallbackToAdgebra(e,i,d,n,o){var t;rediAdsLogger.log("falling Back to Adgebra, for path: ".concat(i,", div ID : ").concat(e,", iframe id : postbid_iframe ").concat(d,"."));var a=document.createElement("div"),r="rediads_postbid_adgebra_"+d;a.id=r;var s=document.createElement("script");s.setAttribute("data-cfasync","false"),s.innerHTML='\n              var domain = "'.concat(null===(t=publisher.domain)||void 0===t?void 0:t.baseURL,'";\n              (function(){\n                var scpt = document.createElement("script");\n                var GetAttribute = "afpftpPixel_" + Math.floor(Math.random() * 500 + 1)+"_"+Date.now();\n                scpt.src = "//adgebra.co.in/afpf/GetAfpftpJs?parentAttribute="+GetAttribute;\n                scpt.id = GetAttribute;\n                scpt.setAttribute("data-pubid", "6592");\n                scpt.setAttribute("data-slotId", "1");\n                scpt.setAttribute("data-templateId", "6723");\n                scpt.setAttribute("data-accessMode", "0");\n                scpt.setAttribute("data-domain", "').concat(n.dataDomain,'");\n                scpt.setAttribute("data-divId", "').concat(r,'");\n                document.getElementById("').concat(r,'").appendChild(scpt);\n              })();'),o.appendChild(a),a.appendChild(s)}function fallbackToMGID(e,i,d,n,o){var t,a;rediAdsLogger.log("falling back to mgid widget for path: ".concat(d,", div ID : ").concat(n,", iframe id : postbid_iframe ").concat(o,".")),mgidPartnerConfig||(mgidPartnerConfig=null===(a=postBid.partners)||void 0===a?void 0:a.find(e=>"mgid"===e.name));var r,s,l=i[0][0]+"_"+i[0][1],c=null===(t=mgidPartnerConfig)||void 0===t||null===(t=t.widgets)||void 0===t?void 0:t[l];c?(rediAdsLoadScript("https://jsc.mgid.com/site/".concat(mgidPartnerConfig.scriptId,".js")),e.insertAdjacentHTML("beforeend",'<div data-type="_mgwidget" data-widget-id="'.concat(c,'"></div>')),(r=window)[s="_mgq"]=r[s]||[],r[s].push(["_mgc.load"]),sendGA("ads",{category:"mgid_widget_loaded",action:c,label:l}),rediAdsLogger.log("starting monitoring for mgid widget fill, for path: ".concat(d,", div ID : ").concat(n,", iframe id : postbid_iframe ").concat(o,"."))):(rediAdsLogger.log("mgid widget ID not found for size ".concat(l,", for path: ").concat(d,", div ID : ").concat(n,", iframe id : postbid_iframe ").concat(o,".")),fallbackToSymplorWidget(e,i,d,n,o))}function monitorAdSenseFill(e,i,d,n,o,t){var a,r,s,l=e.querySelector(".adsbygoogle"),c=()=>{a&&window.clearTimeout(a),r&&r.disconnect(),s&&s.disconnect(),l.setAttribute("style","display: none!important"),rediAdsLogger.log("adsense fill FAILURE for path: ".concat(d,", div ID : ").concat(n,", iframe id : postbid_iframe ").concat(o,".")),fallbackPostAdsense(e,i,d,n,o)};if(rediAdsIsIframe&&rediAdsIsSafeFrame||!window.MutationObserver){var g=l.getAttribute("data-ad-client"),u=l.getAttribute("data-ad-slot");(s=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{e.name.includes("ads?")&&e.name.includes(g)&&e.name.includes(u)&&(e.decodedBodySize<(t.minFilledResponseSize||1024)?(rediAdsLogger.log("ad sense found unfilled using response size, for path: ".concat(d,", div ID : ").concat(n,", iframe id : postbid_iframe ").concat(o,".")),c()):(rediAdsLogger.log("adsense fill SUCCESS based on response size, for path: ".concat(d,", div ID : ").concat(n,", iframe id : postbid_iframe ").concat(o,".")),s.disconnect()))})})).observe({type:"resource",buffered:!0}),rediAdsLogger.log("ad sense fill monitoring started using Response Size for path: ".concat(d,", div ID : ").concat(n,", iframe id : postbid_iframe ").concat(o,"."))}else(r=new MutationObserver(e=>{for(var i of e)if("attributes"===i.type){var t=l.getAttribute("data-ad-status");"filled"===t?(a&&window.clearTimeout(a),rediAdsLogger.log("adsense fil SUCCESS for path: ".concat(d,", div ID : ").concat(n,", iframe id : postbid_iframe ").concat(o,".")),sendGA("ads",{category:"postbid",action:"adsense_filled",label:d}),r.disconnect()):"unfilled"===t&&(c(),rediAdsLogger.log("ad sense found unfilled using Mutation Observer size, for path: ".concat(d,", div ID : ").concat(n,", iframe id : postbid_iframe ").concat(o,".")))}})).observe(l,{attributes:!0}),rediAdsLogger.log("ad sense fill monitoring started using Mutation observer for path: ".concat(d,", div ID : ").concat(n,", iframe id : postbid_iframe ").concat(o,"."));postBid.constants.ADSENSE_STATUS_CHECK_TIMEOUT&&(a=setTimeout(()=>{rediAdsLogger.log("adsense fill FAILURE by TIMEOUT after ".concat(postBid.constants.ADSENSE_STATUS_CHECK_TIMEOUT/1e3," seconds, for path: ").concat(d,", div ID : ").concat(n,", iframe id : postbid_iframe ").concat(o,".")),c()},postBid.constants.ADSENSE_STATUS_CHECK_TIMEOUT))}function fallbackToAdSense(e,i,d,n){var o,t,a,r=document.getElementById(e);if(adsensePartnerConfig)rediAdsLogger.log("valid adsense config already set");else{var s;rediAdsLogger.log("Finding valid adsense config");var l,c=parseInt((100*Math.random()).toFixed());(adsensePartnerConfig=null===(s=postBid.partners)||void 0===s?void 0:s.find(e=>{if("adsense"===e.name){var i,d,n=null==e||null===(i=e.validRange)||void 0===i?void 0:i[0],o=null==e||null===(d=e.validRange)||void 0===d?void 0:d[1];return void 0===n||void 0===o||n<=c&&o>=c}return!1}))||(adsensePartnerConfig=null===(l=postBid.partners)||void 0===l?void 0:l.find(e=>"adsense"===e.name))}if(null===(o=adsensePartnerConfig)||void 0===o||!o.adClient||null===(t=adsensePartnerConfig)||void 0===t||!t.adSlot)return fallbackPostAdsense(r,n,i,e,d),void rediAdsLogger.log("Ad sense config not available, for path: ".concat(i,", div ID : ").concat(e,", iframe id : postbid_iframe ").concat(d,"."));rediAdsLogger.log("falling back to ad sense ".concat(adsensePartnerConfig.adClient,", for path: ").concat(i,", div ID : ").concat(e,", iframe id : postbid_iframe ").concat(d,"."));var g=r.getAttribute("data-adslot"),u=adsensePartnerConfig.allowDFPSlot,p=u?"":"data-full-width-responsive=".concat(!adsensePartnerConfig.disableResponsive&&isMobile?"true":"false");r.innerHTML='<ins class="adsbygoogle"\n                          style="background:transparent!important;display:inline-block;width:'.concat(n[0][0],"px;height:").concat(n[0][1],'px;"\n                          ').concat(p,'\n                          data-page-url="').concat(null===(a=rediadsConfig.publisher)||void 0===a||null===(a=a.domain)||void 0===a?void 0:a.baseURL,'"\n                          data-ad-client="').concat(adsensePartnerConfig.adClient,'"\n                          data-ad-slot="').concat(u?g:adsensePartnerConfig.adSlot,'"\n                          ').concat(!u&&!adsensePartnerConfig.disableResponsive&&n[0][1]>(adsensePartnerConfig.minAutoFormatHeight||100)?'data-ad-format="auto"':"","\n                          >\n                      </ins>"),window.adsbygoogle?(window.adsbygoogle.push({}),rediAdsLogger.log("adsense script already loaded, continuing with adsense push for path: ".concat(i,", div ID : ").concat(e,", iframe id : postbid_iframe ").concat(d,".")),monitorAdSenseFill(r,n,i,e,d,adsensePartnerConfig)):(rediAdsLogger.log("adsense script NOT loaded, loading script for path: ".concat(i,", div ID : ").concat(e,", iframe id : postbid_iframe ").concat(d,".")),rediAdsLoadScript("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=".concat(adsensePartnerConfig.adClient),{async:!0,crossorigin:"anonymous"}).then(function(){window.adsbygoogle=window.adsbygoogle||[],window.adsbygoogle.push({}),rediAdsLogger.log("adsense script loaded successfully, continuing with adsense push for path: ".concat(i,", div ID : ").concat(e,", iframe id : postbid_iframe ").concat(d,".")),monitorAdSenseFill(r,n,i,e,d,adsensePartnerConfig)}).catch(()=>{r.querySelector(".adsbygoogle").setAttribute("style","display: none!important"),fallbackPostAdsense(r,n,i,e,d)}))}function setupPostbidAuction(e,i,d,n,o){var t="".concat(d[0][0],"_").concat(d[0][1]);rediAdsLogger.log("starting post bid auction for path: ".concat(n,", div ID : ").concat(e,", iframe id : postbid_iframe ").concat(i,". Excluded from Default flow : ").concat(!!o));var a=()=>{document.getElementById(e).innerHTML="",fallbackToAdSense(e,n,i,d)};if(rediAdsPrebidDisabled)a();else{var r,s,l=getPrebid(),c=[{code:"postbid_iframe"+i,mediaTypes:{banner:{sizes:d}},bids:getMassagedBidders(t,o?null==rediadsConfig||null===(r=rediadsConfig.bidding)||void 0===r||null===(r=r.adUnitConfig)||void 0===r?void 0:r.bids:null===(s=postBid.bidding)||void 0===s?void 0:s.bids)}];l.que.push(function(){rediAdsLogger.log("post bid auction function executed by ".concat(rediadsConfig.prebidNamespace," for path: ").concat(n,", div ID : ").concat(e,", iframe id : postbid_iframe ").concat(i,".")),l.requestBids({adUnits:c,timeout:postBid.constants.POSTBID_TIMEOUT_DURATION,bidsBackHandler:function(){var d=document.getElementById("postbid_iframe"+i).contentWindow.document,o=l.getAdserverTargetingForAdUnitCode("postbid_iframe"+i);rediAdsLogger.log("post bid bids back handler called for path: ".concat(n,", div ID : ").concat(e,", iframe id : postbid_iframe ").concat(i,".")),o&&o.hb_adid?(rediAdsLogger.log("post bid bids back handler, bids successfully received for path: ".concat(n,", div ID : ").concat(e,", iframe id : postbid_iframe ").concat(i,".")),l.renderAd(d,o.hb_adid),sendGA("ads",{category:"postbid",action:"rendered_via_prebid",label:n})):(rediAdsLogger.log("post bid bids back handler, NO bids received for path: ".concat(n,", div ID : ").concat(e,", iframe id : postbid_iframe ").concat(i,".")),a())}})})}}function createPostbidIframe(e,i,d,n){var o=document.createElement("iframe");o.id="postbid_iframe"+i,o.frameBorder="0",o.scrolling="no",o.marginHeight="0",o.marginWidth="0",o.style.marginTop="0",o.style.marginLeft="0",o.allowTransparency="true",o.width=d[0][0],o.height=d[0][1],document.getElementById(e).appendChild(o),rediAdsLogger.log("post bid iframe created for path: ".concat(n,", div ID : ").concat(e,"."))}function randomIntFromInterval(e,i){return Math.floor(Math.random()*(i-e+1)+e)}function enablePostBidHandling(){rediAdsLogger.log("Enabling Post Bid handling."),googletag.pubads().addEventListener("slotRenderEnded",function(e){var i,d=e.slot,n=d.getAdUnitPath(),o=new RegExp(postBid.mustMatchRegexString),t=d.getSizes().some(e=>1===e.width||1===e.height),a=(null===(i=postBid.excludeAdPaths)||void 0===i?void 0:i.includes(n))||!1,r=o.test(n),s=d.getSlotElementId();if(rediAdsLogger.log("slotRenderEnded called for path: ".concat(n,", div ID : ").concat(s,".")),!e.isEmpty||d.processed||!r||a||t)rediAdsLogger.log("post bid conditions DO NOT match for path: ".concat(n,", div ID : ").concat(s,". Skipping Post Bid Flow"));else{sendGA("ads",{category:"postbid",action:"triggered",label:n}),rediAdsLogger.log("post bid conditions matches for path: ".concat(n,", div ID : ").concat(s,".")),d.processed=!0;var l=d.getSizes().map(e=>[e.width,e.height]),c=randomIntFromInterval(1,1e7);window.googletag.destroySlots([d]),document.getElementById(s).innerHTML="",createPostbidIframe(s,c,l,n),setupPostbidAuction(s,c,l,n)}})}function sendGA(e,i){setTimeout(()=>{window.gtag&&window.gtag("event",e,_objectSpread({send_to:"G-M9SNMLX6QM",pp_url:rediAdsPageURL},i))})}function setupGA(){var e=document.createElement("script"),i="";window.gtag||(rediAdsLogger.log("GA4 tag not found. Loading script"),rediAdsLoadScript("https://www.googletagmanager.com/gtag/js?id=G-M9SNMLX6QM"),i="window.dataLayer = window.dataLayer || [];\n              function gtag(){window.dataLayer.push(arguments);}\n              gtag('js', new Date());"),i+=";gtag('config', 'G-M9SNMLX6QM');gtag(\"config\", \"G-M7CBJBVGTQ\")",e.innerHTML=i,document.head.appendChild(e),rediAdsLogger.log("GA4 config set"),window.rediadsLegacy.gaSetupDone=!0;try{var{customViews:{items:d=[]}={}}=rediadsConfig;d.length&&(rediAdsLogger.log("Custom PVs found, setting up GA4 config"),d.forEach(e=>{var i,d,n=!1,o=()=>{var i;if(!n){if(n=!0,null!=e&&null!==(i=e.pages)&&void 0!==i&&i.length){var d,o=document.createElement("script"),t="",a=e.pages[Math.floor(Math.random()*(null===(d=e.pages)||void 0===d?void 0:d.length))];a.url&&(t+=';gtag("config", "'.concat(e.id,"\", {\n                  'page_location': '").concat(a.url,"',\n                  'page_referrer': '").concat(a.url,"',\n                  'page_title': '").concat(a.title||"","',\n                  'campaign_source': '").concat(a.utm_source||"rediads","',\n                  'campaign_medium': '").concat(a.utm_medium||"rediads","',\n                  'campaign_name': '").concat(a.utm_campaign||"rediads","'\n                });"),o.innerHTML=t,document.head.appendChild(o))}if(e.tracker&&(rediAdsLogger.log("Custom Trackers found, ready to add"),document.body.insertAdjacentHTML("beforeend",'<img src="'.concat(e.tracker,'" width="1" height="1" style="opacity: 0; position: absolute; left: -9999px;"/>'))),null!=e&&e.campaign_id){var r=document.createElement("iframe");r.src="https://cdn.rediads.com/ucu.html#campaign_id=".concat(e.campaign_id),r.width="1",r.height="1",r.style.cssText="position: absolute; left: -9999px; opacity: 0; border: none;",r.setAttribute("aria-hidden","true"),r.setAttribute("tabindex","-1"),document.body.appendChild(r),rediAdsLogger.log("UCU iframe loaded for campaign_id: ".concat(e.campaign_id))}}},t=(null==e||null===(i=e.geo)||void 0===i?void 0:i.include)||[],a=(null==e||null===(d=e.geo)||void 0===d?void 0:d.exclude)||[];t.length||a.length?rediAdsGeoPromise.then(function(e){if(e&&!(null!=e&&e.hosting||null!=e&&e.proxy)){var i=i=>!(null!=i&&i.country&&i.country!==(null==e?void 0:e.countryCode)||null!=i&&i.region&&i.region!==(null==e?void 0:e.region)||null!=i&&i.city&&i.city!==(null==e?void 0:e.city)),d=!t.length||t.some(i),n=a.some(i);d&&!n&&o()}}):o()}))}catch(e){}}var handleInterstitial=()=>{rediAdsLogger.log("Ins: Inside handler"),window.rediadsLegacy.rediAdsInsHandled=!0;var{pIns:e,lsk:i,rIns:d,sessionMinutes:n,excludedRegions:o,excludedCountries:t,timeRange:a,onlyOnParentUnfilled:r}=rediadsConfig.ins;if(getDataFromLocalStorageWithExpiry("__ri__"))rediAdsLogger.log("Ins: Session check invalid");else{var s=()=>{googletag.cmd.push(()=>{var o=googletag.pubads().getSlots().find(i=>i.getAdUnitPath()===e),t=!1;if(r?o&&!o.getResponseInformation()&&(t=!0):o&&o.getResponseInformation()||(t=!0),t){rediAdsLogger.log("ins conditions matched, proceeding");var a=!1;if(o&&(a=googletag.destroySlots([o])),!o||a){rediAdsLogger.log("pIns handled, proceeding"),localStorage.removeItem(i);var s=googletag.defineOutOfPageSlot(d,googletag.enums.OutOfPageFormat.INTERSTITIAL);s&&(s.addService(googletag.pubads()).setConfig({interstitial:{triggers:{navBar:!0,unhideWindow:!0}}}),googletag.pubads().refresh([s]),setDataToLocalStorageWithExpiry("__ri__",1,60*n*1e3),rediAdsLogger.log("Ins: triggered"))}}else rediAdsLogger.log("Ins: conditions not matched")})};isTimeRangeValid(a)?(null==o?void 0:o.length)>0||(null==t?void 0:t.length)>0?rediAdsGeoPromise.then(function(){var e,i,d,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};rediAdsLogger.log("Ins: after geo promise"),e=n.regionName,i=n.country,d=!0,(null==o?void 0:o.length)>0&&o.includes(e.toLowerCase())&&(d=!1),(null==t?void 0:t.length)>0&&t.includes(i.toLowerCase())&&(d=!1),d?s():rediAdsLogger.log("Ins: geo conditions not matched")}):(rediAdsLogger.log("Ins: proceeding without geo restrictions"),s()):rediAdsLogger.log("Ins: Time Range does not match")}},handleRewardedInterstitial=()=>{var{hours:e,executions:i,targetPageViews:d,showDelaySeconds:n,adPath:o,excludedRegions:t,targetUserPercent:a,excludedCountries:r,organicRestriction:s,timeRange:l}=rediadsConfig.reIns;function c(){var e;rediAdsLogger.log("Re Ins: executing re ins after all checks"),googletag.cmd.push(()=>{(e=googletag.defineOutOfPageSlot(o,googletag.enums.OutOfPageFormat.REWARDED))&&(window.rediadsLegacy.dismissRewardedAd=function(){googletag.destroySlots([e])},e.addService(googletag.pubads()),googletag.pubads().addEventListener("rewardedSlotReady",e=>{setTimeout(()=>{var i;e.makeRewardedVisible(),i=(new Date).getTime(),localStorage.setItem("rediads_lastExecutionTime",i)},1e3*n)}),googletag.pubads().addEventListener("rewardedSlotClosed",window.rediadsLegacy.dismissRewardedAd),googletag.enableServices(),googletag.display(e),googletag.pubads().isInitialLoadDisabled()&&googletag.pubads().refresh([e]),googletag.pubads().addEventListener("slotRenderEnded",i=>{var d=i.slot;if(d===e)if(!0==!i.isEmpty){rediAdsLogger.log("Re Ins: fill received");var n=d.getSlotElementId();document.getElementById(n).style.cssText+="background: linear-gradient(180deg, #0F0F0F 0%, rgba(15, 15, 15, 0) 100%)!important;"}else rediAdsLogger.log("Re Ins: no fill")}))})}function g(){return parseInt(localStorage.getItem("rediads_pageViews"))||0}rediAdsLogger.log("Re Ins: Inside handler"),window.rediadsLegacy.rediAdsReInsHandled=!0;var u,p=function(e,i){return 60*e*60*1e3/i}(e,i);u=g()+1,localStorage.setItem("rediads_pageViews",u),function(e,i){(!s||!document.referrer.includes("google"))&&function(e){var i=localStorage.getItem("rediads_lastExecutionTime");return!i||(new Date).getTime()-parseInt(i)>=e}(e)&&function(e){return g()>=e}(i)&&100*Math.random()<=a&&isTimeRangeValid(l)?(rediAdsLogger.log("Re Ins: conditions matched"),(null==t?void 0:t.length)>0||(null==r?void 0:r.length)>0?rediAdsGeoPromise.then(function(){var e,i,d,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};rediAdsLogger.log("Re Ins: after geo promise"),e=n.regionName,i=n.country,d=!0,(null==t?void 0:t.length)>0&&t.includes(e.toLowerCase())&&(d=!1),(null==r?void 0:r.length)>0&&r.includes(i.toLowerCase())&&(d=!1),d?c():rediAdsLogger.log("Re Ins: geo conditions not matched")}):(rediAdsLogger.log("Re Ins: proceeding without geo restrictions"),c()),localStorage.setItem("rediads_pageViews",0)):rediAdsLogger.log("re Ins conditions not matched")}(p,d)},handleCodeParamsForBidders=()=>{var _rediadsConfig$biddin6,_postBid$bidding2,hbBidders=(null==rediadsConfig||null===(_rediadsConfig$biddin6=rediadsConfig.bidding)||void 0===_rediadsConfig$biddin6||null===(_rediadsConfig$biddin6=_rediadsConfig$biddin6.adUnitConfig)||void 0===_rediadsConfig$biddin6?void 0:_rediadsConfig$biddin6.bids)||[],postBidBidders=(null==postBid||null===(_postBid$bidding2=postBid.bidding)||void 0===_postBid$bidding2?void 0:_postBid$bidding2.bids)||[];try{hbBidders.forEach(bidder=>{var _bidder$codeParams;null!=bidder&&null!==(_bidder$codeParams=bidder.codeParams)&&void 0!==_bidder$codeParams&&_bidder$codeParams.length&&(null==bidder||bidder.codeParams.forEach(codeParam=>{bidder.params[codeParam]=eval(bidder.params[codeParam])}))}),postBidBidders.forEach(bidder=>{var _bidder$codeParams2;null!=bidder&&null!==(_bidder$codeParams2=bidder.codeParams)&&void 0!==_bidder$codeParams2&&_bidder$codeParams2.length&&(null==bidder||bidder.codeParams.forEach(codeParam=>{bidder.params[codeParam]=eval(bidder.params[codeParam])}))})}catch(e){rediAdsLogger.log("Error while handling code based params for bidders.")}window.rediadsLegacy.biddersCodeParamsHandled=!0},_rediadsConfig$publis3;function init(e){var i,d,n,o=!1;window.rediadsLegacy.gptInitialsed||initGPT(),window.rediadsLegacy.rediAdsInsHandled||null===(i=rediadsConfig.ins)||void 0===i||!i.enabled||!isMobile||rediAdsIsIframe||rediAdsIsSafeFrame||setTimeout(()=>{handleInterstitial()}),window.rediadsLegacy.rediAdsReInsHandled||null===(d=rediadsConfig.reIns)||void 0===d||!d.enabled||!isMobile||rediAdsIsIframe||rediAdsIsSafeFrame||handleRewardedInterstitial(),setPrebid(),window.rediadsLegacy.gaSetupDone||setupGA(),rediAdsAmazonDisabled||window.rediadsLegacy.apstagInitialised||initAPSTag(),lazyInViewObserver||bindHandleLazyAdsEvent(),window.rediadsLegacy.biddersCodeParamsHandled||handleCodeParamsForBidders();var t=createAdObjectsFromHTML(e);Array.isArray(t)&&t.length>0&&(o=checkAndProcessAds(t)),refreshInViewObserver||handleRefreshableAds(),o?n&&(clearInterval(n),n=void 0):(n=setInterval(function(){!o&&Array.isArray(t)&&t.length>0?o=checkAndProcessAds(t):n&&(clearInterval(n),n=void 0)},bidding.constants.INIT_CHECK_INTERVAL_DURATION),setTimeout(function(){n&&(clearInterval(n),n=void 0)},bidding.constants.BIDS_FAILSAFE_TIMEOUT)),postBidHandlingEnabled&&!window.rediadsLegacy.postbidHandlingDone&&(googletag.cmd.push(function(){enablePostBidHandling()}),window.rediadsLegacy.postbidHandlingDone=!0)}function processUserData(e,i){var d,n,o,t,a,{dps:r}=e,{f:s,l,e:c,dp:g,m:u,g:p}=r,f=_get(i,g)||{},v=(null===(d=f.filter(e=>e.key===s)[0])||void 0===d?void 0:d.value)||"",b=(null===(n=f.filter(e=>e.key===l)[0])||void 0===n?void 0:n.value)||"",m=null===(o=f.filter(e=>e.key===c)[0])||void 0===o?void 0:o.value,w=(null===(t=f.filter(e=>e.key===u)[0])||void 0===t?void 0:t.value)||"",h=(null===(a=f.filter(e=>e.key===p)[0])||void 0===a?void 0:a.value)||"";return m?{ufname:v,ulname:b,uemail:m,ua:window.navigator.userAgent,umobile:w,ugender:h,created_on:(new Date).toISOString(),modified_on:(new Date).toISOString()}:null}function handleUserData(){if(coreServices.enabled){var{u:e}=coreServices,i="".concat(e.k1,"_").concat(e.k2);"l"===e.st&&"json"===e.dt&&(rawUserData=JSON.parse(localStorage.getItem(i)||null))&&(processedUserData=processUserData(e,rawUserData))}}function setDataToLocalStorageWithExpiry(e,i,d){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=new Date,t={value:i,expiry:d?o.getTime()+d:0,sessionRenderCount:n};localStorage.setItem(e,JSON.stringify(t))}function getDataFromLocalStorageWithExpiry(e){var i=localStorage.getItem(e);if(!i)return null;var d=JSON.parse(i),n=new Date;return 0!==d.expiry&&n.getTime()>d.expiry?(localStorage.removeItem(e),null):d.value}function _get(e,i){var d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!e||"object"!=typeof e)return d;"string"==typeof i&&(i=i.split("."));var n=e;for(var o of i){if(!n||!(o in n))return d;n=n[o]}return void 0!==n?n:d}function generateUUID(){return _generateUUID.apply(this,arguments)}function _generateUUID(){return(_generateUUID=_asyncToGenerator(function*(){try{var e;return document.querySelector('script[src="'.concat(coreServices.anlytc,'"]'))||(yield rediAdsLoadScript(coreServices.anlytc,{async:!0})),e=yield window.FingerprintJS.load(),(yield e.get()).visitorId}catch(e){rediAdsLogger.log("error while loading fingerprint js",e)}})).apply(this,arguments)}function sendDataToGCloud(e,i){try{navigator.sendBeacon&&navigator.sendBeacon(e.ep,i)&&(isUserDataSent=!0,setDataToLocalStorageWithExpiry(e.lflg,1,e.ttl),localStorage.removeItem("".concat(e.lflg,"_rts")),rediAdsLogger.log("core service processed."))}catch(e){rediAdsLogger.log("issue while sending data",e)}}function validateAndSendUserData(){return _validateAndSendUserData.apply(this,arguments)}function _validateAndSendUserData(){return(_validateAndSendUserData=_asyncToGenerator(function*(){try{var{u:e}=coreServices,i=getDataFromLocalStorageWithExpiry(e.lflg),d=getDataFromLocalStorageWithExpiry("".concat(e.lflg,"_rts"))||0;if(d>e.mrts&&rediAdsLogger.log("Max retires exceeded for trying to process core service"),!i&&d<=e.mrts&&!isUserDataSent&&rawUserData&&(setDataToLocalStorageWithExpiry("".concat(e.lflg,"_rts"),d+1,e.ttl),processedUserData)){processedUserData.uuid=yield generateUUID(),rediAdsLogger.log(processedUserData);var n=btoa(JSON.stringify(processedUserData));sendDataToGCloud(e,new Blob([n],{type:"text/plain; charset=UTF-8"}))}}catch(e){rediAdsLogger.log("error while vl sd",e)}})).apply(this,arguments)}function setupPrebidConfig(){var e,i,d,n,o,t,a,r,s,l,c,g,u,p,f;prebidConfigrations={priceGranularity:null===(e=bidding.prebidConditionalConfigs)||void 0===e||null===(e=e.granularityCurrency[null===(i=bidding.prebidConditions)||void 0===i?void 0:i.granularityCurrency])||void 0===e?void 0:e.priceGranularity,useBidCache:null===(d=bidding.prebidConfig)||void 0===d?void 0:d.useBidCache,pageUrl:rediAdsPageURL,userSync:null===(n=bidding.prebidConditionalConfigs)||void 0===n?void 0:n.userSync,ortb2:createCompleteMetadataObject(),deviceAccess:null===(o=bidding.prebidConfig)||void 0===o?void 0:o.deviceAccess,enableTIDs:null===(t=bidding.prebidConfig)||void 0===t?void 0:t.enableTIDs,floors:null===(a=bidding.prebidConfig)||void 0===a?void 0:a.floors},"INR"===(null===(r=bidding.prebidConditions)||void 0===r?void 0:r.granularityCurrency)&&(prebidConfigrations.adServerCurrency=null===(c=bidding.prebidConditions)||void 0===c?void 0:c.granularityCurrency,prebidConfigrations.currency=null===(g=bidding.prebidConditionalConfigs)||void 0===g||null===(g=g.granularityCurrency[null===(u=bidding.prebidConditions)||void 0===u?void 0:u.granularityCurrency])||void 0===g?void 0:g.currency),null!==(s=bidding.prebidConditions)&&void 0!==s&&s.schain&&(prebidConfigrations.schain=null===(p=bidding.prebidConditionalConfigs)||void 0===p?void 0:p.schain,prebidConfigrations.schain.config.nodes[0].sid=sid_value),null!==(l=bidding.prebidConditions)&&void 0!==l&&l.CMPRequired&&(prebidConfigrations.consentManagement=null===(f=bidding.prebidConditionalConfigs)||void 0===f||null===(f=f.CMPRequired)||void 0===f?void 0:f.consentManagement)}function handleAnalytics(){var e,i;null!=bidding&&null!==(e=bidding.analytics)&&void 0!==e&&e.enabled&&(window.rediadsLegacy.isBidWonIntervalSet||(setInterval(()=>{window.rediadsLegacy.bidWonQueue.length>0&&sendDataToBidWon()},null==bidding||null===(i=bidding.constants)||void 0===i?void 0:i.BID_WON_POST_INERVAL),window.rediadsLegacy.isBidWonIntervalSet=!0),window.rediadsLegacy.isBidWonVisiblityChangeSet||(document.addEventListener("visibilitychange",function(){window.rediadsLegacy.bidWonQueue.length>0&&sendDataToBidWon(!0)}),window.rediadsLegacy.isBidWonVisiblityChangeSet=!0))}function handleCoreServices(){coreServices.enabled&&(setTimeout(validateAndSendUserData,0),document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState&&validateAndSendUserData()}))}function handleTargetings(){var e,i="",d="";try{var n,o;i=null===(n=document.querySelector('meta[name="keywords"]'))||void 0===n?void 0:n.getAttribute("content"),d=null===(o=document.querySelector('meta[name="description"]'))||void 0===o?void 0:o.getAttribute("content"),e="".concat(i,",").concat(d).split(","),rediadsConfig.targetings&&(targetingKeyValues=rediadsConfig.targetings.map(i=>{if("keywords"===i.type)return i.keywords.some(i=>e.includes(i))?{key:i.key,value:i.value}:null}))}catch(e){rediAdsLogger.log("Error while reading meta description and keywords")}}isRediAdsStagingOn?null!=rediadsConfig&&null!==(_rediadsConfig$publis3=rediadsConfig.publisher)&&void 0!==_rediadsConfig$publis3&&_rediadsConfig$publis3.name?(rediAdsLogger.log("Switching to staging ads JS"),rediAdsLoadScript("https://cdn.rediads.com/".concat(rediadsConfig.publisher.name,"/js/staging/ads.min.js"))):rediAdsLogger.log("Publisher name not found in config. Could not load staging ads JS"):(setupPrebidConfig(),handleAnalytics(),handleUserData(),handleCoreServices(),handleTargetings(),init(),window.displayAds=init)}();try{window.addEventListener("load",function(){isRediAdsStagingOn||window.displayAds()})}catch(e){rediAdsLogger.log("Symplor Prebid Wrapper: Could not bind load eventlistener. Error : ",e)}})();;  
    