@surfside/ads-core 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -0
- package/lib/index.js +1 -0
- package/lib/types/constant-values/index.d.ts +46 -0
- package/lib/types/errors/index.d.ts +3 -0
- package/lib/types/helpers/generators/CollectN.d.ts +2 -0
- package/lib/types/helpers/generators/index.d.ts +1 -0
- package/lib/types/helpers/handlebars/index.d.ts +119 -0
- package/lib/types/helpers/index.d.ts +4 -0
- package/lib/types/helpers/requests/RequestBuilder.d.ts +124 -0
- package/lib/types/helpers/requests/SimpleBannerRequest.d.ts +26 -0
- package/lib/types/helpers/requests/index.d.ts +2 -0
- package/lib/types/helpers/responses/BuildBannerResponse.d.ts +10 -0
- package/lib/types/helpers/responses/BuildNativeResponse.d.ts +21 -0
- package/lib/types/helpers/responses/BuildVideoResponse.d.ts +0 -0
- package/lib/types/helpers/responses/ClickthroughHelpers.d.ts +2 -0
- package/lib/types/helpers/responses/VastHelpers.d.ts +4 -0
- package/lib/types/helpers/responses/index.d.ts +4 -0
- package/lib/types/index.d.ts +19 -0
- package/lib/types/middleware/DeviceMiddleware.d.ts +3 -0
- package/lib/types/middleware/GeoMiddleware.d.ts +3 -0
- package/lib/types/middleware/IdentityMiddleware.d.ts +4 -0
- package/lib/types/middleware/index.d.ts +3 -0
- package/lib/types/models/index.d.ts +4 -0
- package/lib/types/models/retail/IProductInformation.d.ts +37 -0
- package/lib/types/models/retail/IPublisherConfiguration.d.ts +64 -0
- package/lib/types/models/retail/IRecommenderResponse.d.ts +10 -0
- package/lib/types/models/retail/index.d.ts +3 -0
- package/lib/types/models/rtb/IBidRequest.d.ts +399 -0
- package/lib/types/models/rtb/IBidResponse.d.ts +47 -0
- package/lib/types/models/rtb/index.d.ts +3 -0
- package/lib/types/models/rtb/native/Constants.d.ts +60 -0
- package/lib/types/models/rtb/native/INativeRequest.d.ts +54 -0
- package/lib/types/models/rtb/native/INativeResponse.d.ts +60 -0
- package/lib/types/models/rtb/native/NativeConstants.d.ts +120 -0
- package/lib/types/models/rtb/native/NativeRequestBuilder.d.ts +158 -0
- package/lib/types/models/rtb/native/index.d.ts +4 -0
- package/lib/types/models/tracking/IEvents.d.ts +82 -0
- package/lib/types/models/tracking/IGeoContext.d.ts +14 -0
- package/lib/types/models/tracking/IUserID.d.ts +1 -0
- package/lib/types/models/tracking/index.d.ts +3 -0
- package/lib/types/models/vast/Vast.d.ts +50 -0
- package/lib/types/models/vast/index.d.ts +1 -0
- package/lib/types/services/OverrideService.d.ts +10 -0
- package/lib/types/services/index.d.ts +5 -0
- package/lib/types/services/logger/ILoggerService.d.ts +39 -0
- package/lib/types/services/logger/LocalLoggerService.d.ts +19 -0
- package/lib/types/services/logger/index.d.ts +2 -0
- package/lib/types/services/product-feed/IProductFeedService.d.ts +5 -0
- package/lib/types/services/product-feed/SurfsideProductFeedService.d.ts +11 -0
- package/lib/types/services/product-feed/index.d.ts +2 -0
- package/lib/types/services/recommender/IRecommenderService.d.ts +47 -0
- package/lib/types/services/recommender/SurfsideRecommenderService.d.ts +31 -0
- package/lib/types/services/recommender/index.d.ts +2 -0
- package/lib/types/services/rtb/bidder/IBidderService.d.ts +12 -0
- package/lib/types/services/rtb/bidder/SurfsideBidderService.d.ts +28 -0
- package/lib/types/services/rtb/bidder/index.d.ts +2 -0
- package/lib/types/services/rtb/configuration/IConfigurationService.d.ts +14 -0
- package/lib/types/services/rtb/configuration/SurfsideConfigurationService.d.ts +29 -0
- package/lib/types/services/rtb/configuration/index.d.ts +2 -0
- package/lib/types/services/rtb/index.d.ts +2 -0
- package/lib/types/services/tracking/device/DeviceOverrideService.d.ts +8 -0
- package/lib/types/services/tracking/device/IDeviceService.d.ts +4 -0
- package/lib/types/services/tracking/device/SurfsideDeviceService.d.ts +16 -0
- package/lib/types/services/tracking/device/index.d.ts +3 -0
- package/lib/types/services/tracking/events/IEventService.d.ts +5 -0
- package/lib/types/services/tracking/events/SurfsideEventService.d.ts +42 -0
- package/lib/types/services/tracking/events/index.d.ts +2 -0
- package/lib/types/services/tracking/geo/GeoOverrideService.d.ts +8 -0
- package/lib/types/services/tracking/geo/IGeoService.d.ts +12 -0
- package/lib/types/services/tracking/geo/SurfsideGeoService.d.ts +7 -0
- package/lib/types/services/tracking/geo/index.d.ts +3 -0
- package/lib/types/services/tracking/index.d.ts +4 -0
- package/lib/types/services/tracking/user/IUserIDService.d.ts +4 -0
- package/lib/types/services/tracking/user/SurfsideUserIDService.d.ts +7 -0
- package/lib/types/services/tracking/user/UserOverrideService.d.ts +8 -0
- package/lib/types/services/tracking/user/index.d.ts +3 -0
- package/lib/types/utils/Protocol.d.ts +1 -0
- package/lib/types/utils/Rendering.d.ts +44 -0
- package/lib/types/utils/index.d.ts +2 -0
- package/package.json +47 -0
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Surfside Ads Core
|
|
2
|
+
|
|
3
|
+
Surfside Ads Core is a headless SDK designed to seamlessly integrate ad-serving capabilities into your web applications. Unlike Surfside Ads, this SDK focuses solely on the backend processes related to advertising, without including any code for rendering banners, videos, or products on the frontend. It gives you complete control over how ads are displayed while handling the communication with Surfside's ad-serving and data services.
|
|
4
|
+
|
|
5
|
+
## Key Features
|
|
6
|
+
* **Ad Requests**: Fetch relevant ads for your users by sending requests to Surfside's ad services.
|
|
7
|
+
* **Product Information**: Retrieve detailed information on products linked to ads.
|
|
8
|
+
* **Logging & Event Tracking**: Integrate with built-in services to log important events and track user interactions, ensuring you're capturing engagement metrics.
|
|
9
|
+
* **Enhanced Data Requests**: Use additional services for IP-geolocation, user identification, and cookie management to enrich your ad targeting capabilities.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
Surfside Ads Core exposes a set of service classes for communicating with Surfside's backend services. For example, to send a bid request to the Surfside bidder, instantiate a SurfsideBidder and send an [OpenRTB 2.6](https://iabtechlab.com/blog/openrtb-2-6-is-ready-for-implementation/) bid request:
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
const bidder = new SurfsideBidder;
|
|
16
|
+
const response = await bidder.requestBids(new BannerRequest(800, 600, 'abcdefg'));
|
|
17
|
+
/* Bid responses can contain multiple bids */
|
|
18
|
+
document.querySelector('#my-ad').innerHTML = response.seatbid[0].bids[0].adm;
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
SurfsideBidder will automatically look up Geo information, User ID information, and surfside Context (account ID, location ID, etc) from the Surfside Digital SDK and append it to the bid request. The `adm` field contains all the HTML required for a renderable ad creative, including tracking pixels.
|
|
22
|
+
|
|
23
|
+
More complicated requests can be built using the Request builder:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
const response = await bidder.requestBids((new RequestBuilder)
|
|
27
|
+
.addBanner(800, 600, 'abcdefg')
|
|
28
|
+
.addBanner(728, 90, '123456', { /* Add multiple banners to the request */
|
|
29
|
+
keywords: ['Auto parts'], /* Optional keywords for targeting */
|
|
30
|
+
bcat: [AdProduct2.Gambling] /* Other OpenRTB fields, like blocked categories */
|
|
31
|
+
})
|
|
32
|
+
.build());
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The bidder also supports native ads requests:
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
const response = await bidder.requestBid(
|
|
39
|
+
new NativeRequest() /* Default native request includes all default OpenRTB asset fields,
|
|
40
|
+
* such as title and image */
|
|
41
|
+
);
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Which can be customized as well:
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
const response = await bidder.requestBid(
|
|
48
|
+
(new RequestBuilder)
|
|
49
|
+
.addNative(
|
|
50
|
+
(new NativeBuilder)
|
|
51
|
+
.withTitle(120, true) /* Optional "length" and "required" fields */
|
|
52
|
+
.withDescription(300, false)
|
|
53
|
+
.withImage(
|
|
54
|
+
200, 200, /* Width, Height */
|
|
55
|
+
64, 64 /* min width, min height */
|
|
56
|
+
)
|
|
57
|
+
.build()
|
|
58
|
+
)
|
|
59
|
+
)
|
|
60
|
+
.build()
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
console.log(JSON.parse(response.seatbid[0].bid[0].adm)); /* Adm for a native response is JSON */
|
|
64
|
+
```
|
package/lib/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SurfAdsCore=t():e.SurfAdsCore=t()}(self,(()=>(()=>{var e={261:(e,t,i)=>{"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}t.__esModule=!0;var n=o(i(2871)),l=r(i(9613)),s=r(i(3769)),u=o(i(2849)),a=o(i(7624)),d=r(i(1148));function c(){var e=new n.HandlebarsEnvironment;return u.extend(e,n),e.SafeString=l.default,e.Exception=s.default,e.Utils=u,e.escapeExpression=u.escapeExpression,e.VM=a,e.template=function(t){return a.template(t,e)},e}var v=c();v.create=c,d.default(v),v.default=v,t.default=v,e.exports=t.default},2871:(e,t,i)=>{"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.HandlebarsEnvironment=c;var o=i(2849),n=r(i(3769)),l=i(2277),s=i(5940),u=r(i(566)),a=i(3865);t.VERSION="4.7.8";t.COMPILER_REVISION=8;t.LAST_COMPATIBLE_COMPILER_REVISION=7;t.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};var d="[object Object]";function c(e,t,i){this.helpers=e||{},this.partials=t||{},this.decorators=i||{},l.registerDefaultHelpers(this),s.registerDefaultDecorators(this)}c.prototype={constructor:c,logger:u.default,log:u.default.log,registerHelper:function(e,t){if(o.toString.call(e)===d){if(t)throw new n.default("Arg not supported with multiple helpers");o.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if(o.toString.call(e)===d)o.extend(this.partials,e);else{if(void 0===t)throw new n.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if(o.toString.call(e)===d){if(t)throw new n.default("Arg not supported with multiple decorators");o.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]},resetLoggedPropertyAccesses:function(){a.resetLoggedProperties()}};var v=u.default.log;t.log=v,t.createFrame=o.createFrame,t.logger=u.default},5940:(e,t,i)=>{"use strict";t.__esModule=!0,t.registerDefaultDecorators=function(e){n.default(e)};var r,o=i(7430),n=(r=o)&&r.__esModule?r:{default:r}},7430:(e,t,i)=>{"use strict";t.__esModule=!0;var r=i(2849);t.default=function(e){e.registerDecorator("inline",(function(e,t,i,o){var n=e;return t.partials||(t.partials={},n=function(o,n){var l=i.partials;i.partials=r.extend({},l,t.partials);var s=e(o,n);return i.partials=l,s}),t.partials[o.args[0]]=o.fn,n}))},e.exports=t.default},3769:(e,t)=>{"use strict";t.__esModule=!0;var i=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function r(e,t){var o=t&&t.loc,n=void 0,l=void 0,s=void 0,u=void 0;o&&(n=o.start.line,l=o.end.line,s=o.start.column,u=o.end.column,e+=" - "+n+":"+s);for(var a=Error.prototype.constructor.call(this,e),d=0;d<i.length;d++)this[i[d]]=a[i[d]];Error.captureStackTrace&&Error.captureStackTrace(this,r);try{o&&(this.lineNumber=n,this.endLineNumber=l,Object.defineProperty?(Object.defineProperty(this,"column",{value:s,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:u,enumerable:!0})):(this.column=s,this.endColumn=u))}catch(e){}}r.prototype=new Error,t.default=r,e.exports=t.default},2277:(e,t,i)=>{"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.registerDefaultHelpers=function(e){o.default(e),n.default(e),l.default(e),s.default(e),u.default(e),a.default(e),d.default(e)},t.moveHelperToHooks=function(e,t,i){e.helpers[t]&&(e.hooks[t]=e.helpers[t],i||delete e.helpers[t])};var o=r(i(6097)),n=r(i(6785)),l=r(i(4353)),s=r(i(2355)),u=r(i(5300)),a=r(i(7466)),d=r(i(908))},6097:(e,t,i)=>{"use strict";t.__esModule=!0;var r=i(2849);t.default=function(e){e.registerHelper("blockHelperMissing",(function(t,i){var o=i.inverse,n=i.fn;if(!0===t)return n(this);if(!1===t||null==t)return o(this);if(r.isArray(t))return t.length>0?(i.ids&&(i.ids=[i.name]),e.helpers.each(t,i)):o(this);if(i.data&&i.ids){var l=r.createFrame(i.data);l.contextPath=r.appendContextPath(i.data.contextPath,i.name),i={data:l}}return n(t,i)}))},e.exports=t.default},6785:(e,t,i)=>{"use strict";t.__esModule=!0;var r,o=i(2849),n=i(3769),l=(r=n)&&r.__esModule?r:{default:r};t.default=function(e){e.registerHelper("each",(function(e,t){if(!t)throw new l.default("Must pass iterator to #each");var i,r=t.fn,n=t.inverse,s=0,u="",a=void 0,d=void 0;function c(t,i,n){a&&(a.key=t,a.index=i,a.first=0===i,a.last=!!n,d&&(a.contextPath=d+t)),u+=r(e[t],{data:a,blockParams:o.blockParams([e[t],t],[d+t,null])})}if(t.data&&t.ids&&(d=o.appendContextPath(t.data.contextPath,t.ids[0])+"."),o.isFunction(e)&&(e=e.call(this)),t.data&&(a=o.createFrame(t.data)),e&&"object"==typeof e)if(o.isArray(e))for(var v=e.length;s<v;s++)s in e&&c(s,s,s===e.length-1);else if("function"==typeof Symbol&&e[Symbol.iterator]){for(var h=[],f=e[Symbol.iterator](),p=f.next();!p.done;p=f.next())h.push(p.value);for(v=(e=h).length;s<v;s++)c(s,s,s===e.length-1)}else i=void 0,Object.keys(e).forEach((function(e){void 0!==i&&c(i,s-1),i=e,s++})),void 0!==i&&c(i,s-1,!0);return 0===s&&(u=n(this)),u}))},e.exports=t.default},4353:(e,t,i)=>{"use strict";t.__esModule=!0;var r,o=i(3769),n=(r=o)&&r.__esModule?r:{default:r};t.default=function(e){e.registerHelper("helperMissing",(function(){if(1!==arguments.length)throw new n.default('Missing helper: "'+arguments[arguments.length-1].name+'"')}))},e.exports=t.default},2355:(e,t,i)=>{"use strict";t.__esModule=!0;var r,o=i(2849),n=i(3769),l=(r=n)&&r.__esModule?r:{default:r};t.default=function(e){e.registerHelper("if",(function(e,t){if(2!=arguments.length)throw new l.default("#if requires exactly one argument");return o.isFunction(e)&&(e=e.call(this)),!t.hash.includeZero&&!e||o.isEmpty(e)?t.inverse(this):t.fn(this)})),e.registerHelper("unless",(function(t,i){if(2!=arguments.length)throw new l.default("#unless requires exactly one argument");return e.helpers.if.call(this,t,{fn:i.inverse,inverse:i.fn,hash:i.hash})}))},e.exports=t.default},5300:(e,t)=>{"use strict";t.__esModule=!0,t.default=function(e){e.registerHelper("log",(function(){for(var t=[void 0],i=arguments[arguments.length-1],r=0;r<arguments.length-1;r++)t.push(arguments[r]);var o=1;null!=i.hash.level?o=i.hash.level:i.data&&null!=i.data.level&&(o=i.data.level),t[0]=o,e.log.apply(e,t)}))},e.exports=t.default},7466:(e,t)=>{"use strict";t.__esModule=!0,t.default=function(e){e.registerHelper("lookup",(function(e,t,i){return e?i.lookupProperty(e,t):e}))},e.exports=t.default},908:(e,t,i)=>{"use strict";t.__esModule=!0;var r,o=i(2849),n=i(3769),l=(r=n)&&r.__esModule?r:{default:r};t.default=function(e){e.registerHelper("with",(function(e,t){if(2!=arguments.length)throw new l.default("#with requires exactly one argument");o.isFunction(e)&&(e=e.call(this));var i=t.fn;if(o.isEmpty(e))return t.inverse(this);var r=t.data;return t.data&&t.ids&&((r=o.createFrame(t.data)).contextPath=o.appendContextPath(t.data.contextPath,t.ids[0])),i(e,{data:r,blockParams:o.blockParams([e],[r&&r.contextPath])})}))},e.exports=t.default},9726:(e,t,i)=>{"use strict";t.__esModule=!0,t.createNewLookupObject=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return r.extend.apply(void 0,[Object.create(null)].concat(t))};var r=i(2849)},3865:(e,t,i)=>{"use strict";t.__esModule=!0,t.createProtoAccessControl=function(e){var t=Object.create(null);t.constructor=!1,t.__defineGetter__=!1,t.__defineSetter__=!1,t.__lookupGetter__=!1;var i=Object.create(null);return i.__proto__=!1,{properties:{whitelist:o.createNewLookupObject(i,e.allowedProtoProperties),defaultValue:e.allowProtoPropertiesByDefault},methods:{whitelist:o.createNewLookupObject(t,e.allowedProtoMethods),defaultValue:e.allowProtoMethodsByDefault}}},t.resultIsAllowed=function(e,t,i){return u("function"==typeof e?t.methods:t.properties,i)},t.resetLoggedProperties=function(){Object.keys(s).forEach((function(e){delete s[e]}))};var r,o=i(9726),n=i(566),l=(r=n)&&r.__esModule?r:{default:r},s=Object.create(null);function u(e,t){return void 0!==e.whitelist[t]?!0===e.whitelist[t]:void 0!==e.defaultValue?e.defaultValue:(function(e){!0!==s[e]&&(s[e]=!0,l.default.log("error",'Handlebars: Access has been denied to resolve the property "'+e+'" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details'))}(t),!1)}},2614:(e,t)=>{"use strict";t.__esModule=!0,t.wrapHelper=function(e,t){if("function"!=typeof e)return e;return function(){return arguments[arguments.length-1]=t(arguments[arguments.length-1]),e.apply(this,arguments)}}},566:(e,t,i)=>{"use strict";t.__esModule=!0;var r=i(2849),o={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if("string"==typeof e){var t=r.indexOf(o.methodMap,e.toLowerCase());e=t>=0?t:parseInt(e,10)}return e},log:function(e){if(e=o.lookupLevel(e),"undefined"!=typeof console&&o.lookupLevel(o.level)<=e){var t=o.methodMap[e];console[t]||(t="log");for(var i=arguments.length,r=Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];console[t].apply(console,r)}}};t.default=o,e.exports=t.default},1148:(e,t)=>{"use strict";t.__esModule=!0,t.default=function(e){"object"!=typeof globalThis&&(Object.prototype.__defineGetter__("__magic__",(function(){return this})),__magic__.globalThis=__magic__,delete Object.prototype.__magic__);var t=globalThis.Handlebars;e.noConflict=function(){return globalThis.Handlebars===e&&(globalThis.Handlebars=t),e}},e.exports=t.default},7624:(e,t,i)=>{"use strict";t.__esModule=!0,t.checkRevision=function(e){var t=e&&e[0]||1,i=s.COMPILER_REVISION;if(t>=s.LAST_COMPATIBLE_COMPILER_REVISION&&t<=s.COMPILER_REVISION)return;if(t<s.LAST_COMPATIBLE_COMPILER_REVISION){var r=s.REVISION_CHANGES[i],o=s.REVISION_CHANGES[t];throw new l.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+r+") or downgrade your runtime to an older version ("+o+").")}throw new l.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+e[1]+").")},t.template=function(e,t){if(!t)throw new l.default("No environment passed to template");if(!e||!e.main)throw new l.default("Unknown template object: "+typeof e);e.main.decorator=e.main_d,t.VM.checkRevision(e.compiler);var i=e.compiler&&7===e.compiler[0];var r={strict:function(e,t,i){if(!e||!(t in e))throw new l.default('"'+t+'" not defined in '+e,{loc:i});return r.lookupProperty(e,t)},lookupProperty:function(e,t){var i=e[t];return null==i||Object.prototype.hasOwnProperty.call(e,t)||d.resultIsAllowed(i,r.protoAccessControl,t)?i:void 0},lookup:function(e,t){for(var i=e.length,o=0;o<i;o++){if(null!=(e[o]&&r.lookupProperty(e[o],t)))return e[o][t]}},lambda:function(e,t){return"function"==typeof e?e.call(t):e},escapeExpression:o.escapeExpression,invokePartial:function(i,r,n){n.hash&&(r=o.extend({},r,n.hash),n.ids&&(n.ids[0]=!0)),i=t.VM.resolvePartial.call(this,i,r,n);var s=o.extend({},n,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),u=t.VM.invokePartial.call(this,i,r,s);if(null==u&&t.compile&&(n.partials[n.name]=t.compile(i,e.compilerOptions,t),u=n.partials[n.name](r,s)),null!=u){if(n.indent){for(var a=u.split("\n"),d=0,c=a.length;d<c&&(a[d]||d+1!==c);d++)a[d]=n.indent+a[d];u=a.join("\n")}return u}throw new l.default("The partial "+n.name+" could not be compiled when running in runtime-only mode")},fn:function(t){var i=e[t];return i.decorator=e[t+"_d"],i},programs:[],program:function(e,t,i,r,o){var n=this.programs[e],l=this.fn(e);return t||o||r||i?n=c(this,e,l,t,i,r,o):n||(n=this.programs[e]=c(this,e,l)),n},data:function(e,t){for(;e&&t--;)e=e._parent;return e},mergeIfNeeded:function(e,t){var i=e||t;return e&&t&&e!==t&&(i=o.extend({},t,e)),i},nullContext:Object.seal({}),noop:t.VM.noop,compilerInfo:e.compiler};function n(t){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=i.data;n._setup(i),!i.partial&&e.useData&&(o=function(e,t){t&&"root"in t||((t=t?s.createFrame(t):{}).root=e);return t}(t,o));var l=void 0,u=e.useBlockParams?[]:void 0;function a(t){return""+e.main(r,t,r.helpers,r.partials,o,u,l)}return e.useDepths&&(l=i.depths?t!=i.depths[0]?[t].concat(i.depths):i.depths:[t]),(a=h(e.main,a,r,i.depths||[],o,u))(t,i)}return n.isTop=!0,n._setup=function(n){if(n.partial)r.protoAccessControl=n.protoAccessControl,r.helpers=n.helpers,r.partials=n.partials,r.decorators=n.decorators,r.hooks=n.hooks;else{var l=o.extend({},t.helpers,n.helpers);!function(e,t){Object.keys(e).forEach((function(i){var r=e[i];e[i]=function(e,t){var i=t.lookupProperty;return a.wrapHelper(e,(function(e){return o.extend({lookupProperty:i},e)}))}(r,t)}))}(l,r),r.helpers=l,e.usePartial&&(r.partials=r.mergeIfNeeded(n.partials,t.partials)),(e.usePartial||e.useDecorators)&&(r.decorators=o.extend({},t.decorators,n.decorators)),r.hooks={},r.protoAccessControl=d.createProtoAccessControl(n);var s=n.allowCallsToHelperMissing||i;u.moveHelperToHooks(r,"helperMissing",s),u.moveHelperToHooks(r,"blockHelperMissing",s)}},n._child=function(t,i,o,n){if(e.useBlockParams&&!o)throw new l.default("must pass block params");if(e.useDepths&&!n)throw new l.default("must pass parent depths");return c(r,t,e[t],i,0,o,n)},n},t.wrapProgram=c,t.resolvePartial=function(e,t,i){e?e.call||i.name||(i.name=e,e=i.partials[e]):e="@partial-block"===i.name?i.data["partial-block"]:i.partials[i.name];return e},t.invokePartial=function(e,t,i){var r=i.data&&i.data["partial-block"];i.partial=!0,i.ids&&(i.data.contextPath=i.ids[0]||i.data.contextPath);var n=void 0;i.fn&&i.fn!==v&&function(){i.data=s.createFrame(i.data);var e=i.fn;n=i.data["partial-block"]=function(t){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return i.data=s.createFrame(i.data),i.data["partial-block"]=r,e(t,i)},e.partials&&(i.partials=o.extend({},i.partials,e.partials))}();void 0===e&&n&&(e=n);if(void 0===e)throw new l.default("The partial "+i.name+" could not be found");if(e instanceof Function)return e(t,i)},t.noop=v;var r,o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}(i(2849)),n=i(3769),l=(r=n)&&r.__esModule?r:{default:r},s=i(2871),u=i(2277),a=i(2614),d=i(3865);function c(e,t,i,r,o,n,l){function s(t){var o=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],s=l;return!l||t==l[0]||t===e.nullContext&&null===l[0]||(s=[t].concat(l)),i(e,t,e.helpers,e.partials,o.data||r,n&&[o.blockParams].concat(n),s)}return(s=h(i,s,e,l,r,n)).program=t,s.depth=l?l.length:0,s.blockParams=o||0,s}function v(){return""}function h(e,t,i,r,n,l){if(e.decorator){var s={};t=e.decorator(t,s,i,r&&r[0],n,l,r),o.extend(t,s)}return t}},9613:(e,t)=>{"use strict";function i(e){this.string=e}t.__esModule=!0,i.prototype.toString=i.prototype.toHTML=function(){return""+this.string},t.default=i,e.exports=t.default},2849:(e,t)=>{"use strict";t.__esModule=!0,t.extend=l,t.indexOf=function(e,t){for(var i=0,r=e.length;i<r;i++)if(e[i]===t)return i;return-1},t.escapeExpression=function(e){if("string"!=typeof e){if(e&&e.toHTML)return e.toHTML();if(null==e)return"";if(!e)return e+"";e=""+e}if(!o.test(e))return e;return e.replace(r,n)},t.isEmpty=function(e){return!e&&0!==e||!(!a(e)||0!==e.length)},t.createFrame=function(e){var t=l({},e);return t._parent=e,t},t.blockParams=function(e,t){return e.path=t,e},t.appendContextPath=function(e,t){return(e?e+".":"")+t};var i={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},r=/[&<>"'`=]/g,o=/[&<>"'`=]/;function n(e){return i[e]}function l(e){for(var t=1;t<arguments.length;t++)for(var i in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],i)&&(e[i]=arguments[t][i]);return e}var s=Object.prototype.toString;t.toString=s;var u=function(e){return"function"==typeof e};u(/x/)&&(t.isFunction=u=function(e){return"function"==typeof e&&"[object Function]"===s.call(e)}),t.isFunction=u;var a=Array.isArray||function(e){return!(!e||"object"!=typeof e)&&"[object Array]"===s.call(e)};t.isArray=a},3633:(e,t,i)=>{e.exports=i(261).default},8658:(e,t,i)=>{"use strict";var r,o,n,l,s,u;i.d(t,{$J:()=>n,DH:()=>o,Ev:()=>l,OH:()=>u,iF:()=>s,t3:()=>r}),function(e){e[e.OK=200]="OK",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.FORBIDDEN=403]="FORBIDDEN"}(r||(r={})),function(e){e[e.SUCCESS=2]="SUCCESS",e[e.CLIENT_ERROR=4]="CLIENT_ERROR",e[e.SERVER_ERROR=5]="SERVER_ERROR"}(o||(o={})),function(e){e.INDIGO="#331c7a",e.ULTRAMARINE="#1f69ff",e.AQUAMARINE="#4ceaaa",e.ELECTRIC_LIME="#c5f700",e.CRAYOLA="#f7a800",e.ORANGE="#f66d18",e.RED="#e72024",e.LAVENDER="#c0abff",e.ULTRA_RED="#f97585",e.SOFT_GOLD="#f4bd5d",e.MAGIC_MINT="#baf7db",e.SKY_BLUE="#7eceeb",e.CARIBBEAN_GREN="#0dcc91",e.LAVENDER_GRAY="#d3d3e0"}(n||(n={})),function(e){e[e.IP2LOCATION=1]="IP2LOCATION",e[e.NEUSTAR=2]="NEUSTAR",e[e.MAXMIND=3]="MAXMIND",e[e.NETACUITY=4]="NETACUITY"}(l||(l={})),function(e){e[e.GPS=1]="GPS",e[e.IP=2]="IP",e[e.USER=3]="USER"}(s||(s={})),function(e){e.PROD="PROD",e.STAGING="STAGING",e.LOCAL="LOCAL",e.MOCK="MOCK"}(u||(u={}))},110:(e,t,i)=>{"use strict";i.d(t,{e:()=>r});class r extends Error{constructor(e){super(`No bid response. Got "${e}"`),this.name="NoBidResponseError"}}},4041:(e,t,i)=>{"use strict";function r(e,t){const i=[];for(let r=0;r<t;r++){const t=e.next();if(!0===t.done)break;i.push(t.value)}return i}async function o(e,t){const i=[];for(let r=0;r<t;r++){const t=await e.next();if(!0===t.done)break;i.push(t.value)}return i}i.d(t,{D:()=>r,J:()=>o})},545:(e,t,i)=>{"use strict";i.d(t,{D:()=>r.D,J:()=>r.J});var r=i(4041)},4051:(e,t,i)=>{"use strict";i.d(t,{$P:()=>d,Ae:()=>l,Hr:()=>h,S1:()=>m,Sf:()=>s,Uo:()=>g,YO:()=>_,Yc:()=>c,eq:()=>f,fj:()=>v,hl:()=>u,ib:()=>n,or:()=>p,yR:()=>o});const r=5;function o(e,t){var i;if(null==e||"string"!=typeof e)return"";const o=void 0!==t.hash.hyphenate?new RegExp(t.hash.hyphenate,"ig"):/[\s_\-,]/gi,n=void 0!==t.hash.drop?new RegExp(t.hash.drop,"ig"):/[^A-Za-z0-9-]/gi,l=null!==(i=t.hash.length)&&void 0!==i?i:r;return e.replace(o,"-").replace(n,"").toLowerCase().split("-").slice(0,l).join("-")}function n(e){return null==e||"string"!=typeof e?"":e.toLowerCase()}function l(e){if(0===e||null==e)return"";const t=window.location.pathname.split("/");return t.length<=e?"":t[e]}function s(){let e=window;const t=[...arguments];for(;t.length>0&&void 0!==e;){const i=t.shift();if(void 0===i||"string"!=typeof i)break;e=e[i]}return e}function u(e,t,i){return e.replace(new RegExp(t),((...e)=>{const t=e.slice(1,-2);let r=i;return r=r.replace(/\\(\d+)/g,((e,i)=>{var r;return null!==(r=t[i-1])&&void 0!==r?r:""})),r=r.replace(/\\U(\d+)/g,((e,i)=>{var r;return(null!==(r=t[i-1])&&void 0!==r?r:"").toUpperCase()})),r=a(r,"U",t,(e=>e.toUpperCase())),r=a(r,"L",t,(e=>e.toLowerCase())),r=a(r,"I",t,(e=>e[0])),r}))}function a(e,t,i,r){return e.replace(new RegExp(`\\\\${t}(\\d+)`,"g"),((e,t)=>{var o;return r(null!==(o=i[t-1])&&void 0!==o?o:"")}))}function d(e){var t;if(void 0===(null==e?void 0:e.length)||0===e.length)return"";const i=window.location.search;if(0===i.length)return"";return null!==(t=new URLSearchParams(i).get(e))&&void 0!==t?t:""}function c(){for(let e=0;e<arguments.length-1;e++){const t=arguments[e];if(null!=t&&""!==t&&!1!==t)return t}return""}function v(){var e;const t=[...arguments].slice(0,arguments.length-1),i=null!==(e=arguments[arguments.length-1].hash.separator)&&void 0!==e?e:"/";return t.filter((e=>null!=e&&""!==e)).join(i)}function h(e){if(void 0===(null==e?void 0:e.length)||0===e.length)return"";return encodeURIComponent(e).replaceAll("'","%27")}function f(e,t){return e===t}function p(e,t){return Boolean(e)||Boolean(t)}function g(e,t){return Boolean(e)&&Boolean(t)}function m(e,t){return void 0!==(null==t?void 0:t.length)&&0!==t.length&&t.includes(e)}function _(){return Array.from(arguments).slice(0,-1)}},9730:(e,t,i)=>{"use strict";i.r(t),i.d(t,{BuildBanner:()=>o.Vq,BuildBannerFromBid:()=>o.kH,BuildClickThroughUrl:()=>o.He,BuildNativeResponse:()=>o.l7,BuildProductInfoFromElement:()=>o.Od,CollectN:()=>l.D,CollectNAsync:()=>l.J,DeserializeVast:()=>o.Kr,DeserializeVideo:()=>o.rS,RequestBuilder:()=>r.t,SimpleBannerRequest:()=>r.Y,and:()=>n.Uo,array:()=>n.YO,coalesce:()=>n.Yc,eq:()=>n.eq,global:()=>n.Sf,isIn:()=>n.S1,join:()=>n.fj,lower:()=>n.ib,or:()=>n.or,path:()=>n.Ae,search:()=>n.$P,sed:()=>n.hl,slug:()=>n.yR,uri:()=>n.Hr});var r=i(3569),o=i(5509),n=i(4051),l=i(545)},3641:(e,t,i)=>{"use strict";var r;i.d(t,{t:()=>o}),function(e){e[e.BANNER=0]="BANNER",e[e.VIDEO=1]="VIDEO",e[e.NATIVE=2]="NATIVE"}(r||(r={}));class o{constructor(e){this._builderState=void 0,this._request={id:null!=e?e:this._generateId(),imp:[]}}build(){this._appendBuilderState();for(const e of this._request.imp)e.ext=this._request.ext;return this._request.app={name:window.location.hostname,domain:window.location.hostname,id:window.location.hostname},this._request.site={name:window.location.hostname,domain:window.location.hostname,id:window.location.hostname},this._request}withSurfContext(e,t,i,r,o,n){return this._request.ext={accountId:e,siteId:t,channelId:o,zoneId:r,locationId:i,storeId:i,keywords:n},this}withBanner(e,t,i){return this._appendBuilderState(),this._builderState={type:r.BANNER,imp:{id:this._generateId()},currentCreative:{w:e,h:t,...i}},this}withVideo(e,t,i,o,n=["video/mp4","video/webm"],l){return this._appendBuilderState(),this._builderState={type:r.VIDEO,imp:{id:this._generateId()},currentCreative:{w:e,h:t,minduration:i,maxduration:o,mimes:n,...l}},this}withNative(e,t){return this._appendBuilderState(),this._builderState={type:r.NATIVE,imp:{id:this._generateId()},currentCreative:{request:e,ver:"1.2",...t}},this}withBidFloor(e,t="USD"){if(void 0===this._builderState)throw new Error("Invalid state");return this._builderState.imp.bidfloor=e,this._builderState.imp.bidfloorcur=t,this}withImpExt(e){if(void 0===this._builderState)throw new Error("Invalid state");return this._builderState.imp.ext=e,this}withSite(e){return this._request.site=null!=e?e:{name:window.location.hostname,domain:window.location.hostname},this}withApp(e){return this._request.app=null!=e?e:{name:window.location.hostname,domain:window.location.hostname},this}withDevice(e){return this._request.device=e,this}withUser(e){return this._request.user=e,this}withRegulations(e){return this._request.regs=e,this}_appendBuilderState(){if(void 0!==this._builderState){switch(this._builderState.type){case r.BANNER:this._builderState.imp.banner=this._builderState.currentCreative;break;case r.NATIVE:this._builderState.imp.native=this._builderState.currentCreative;break;case r.VIDEO:this._builderState.imp.video=this._builderState.currentCreative}this._appendImpression()}}_appendImpression(){var e;void 0!==this._builderState&&(this._request.imp=null!==(e=this._request.imp)&&void 0!==e?e:[],this._request.imp.push(this._builderState.imp))}_generateId(){return crypto.randomUUID()}}},1892:(e,t,i)=>{"use strict";i.d(t,{Y:()=>r});class r{constructor(e,t,i){const r=crypto.randomUUID();this.id=e,this.imp=[{id:r,banner:{w:t,h:i}}]}}},3569:(e,t,i)=>{"use strict";i.d(t,{Y:()=>r.Y,t:()=>o.t});var r=i(1892),o=i(3641)},8624:(e,t,i)=>{"use strict";i.d(t,{Od:()=>l,Vq:()=>o,kH:()=>n});var r=i(1191);function o(e,t){var i,o,s;if(null===e)return{element:null,product:null,clickThrough:null};const u=null===(s=null===(o=null===(i=null==e?void 0:e.seatbid)||void 0===i?void 0:i[0])||void 0===o?void 0:o.bid)||void 0===s?void 0:s[0];if(void 0===u)return{element:null,product:null,clickThrough:null};const a=n(u);if(null===a)return{element:null,product:null,clickThrough:null};if(void 0===t)return{element:a,product:null,clickThrough:null};const d=l(a);let c=null;if(null!==d&&(c=(0,r.H)(t,d,{image:null,price:null,salePrice:null,thc:null,strain:null,cbd:null,name:null,brand_name:null,brandName:null,productType:null,details:null,cta:null,clickthroughUrl:null,winUrl:null,pixelUrl:null}),null!==c)){const e=a.querySelectorAll("a[href*=\\{SURF_COMMERCE_URL\\}]"),t=c;e.forEach((e=>{const i=e.getAttribute("href");if(null===i)return;const r=i.replace("{SURF_COMMERCE_URL}",t);e.setAttribute("href",r)}))}return{element:a,product:l(a),clickThrough:c}}function n(e){if(void 0===e.adm)return null;const t=document.createElement("div");if(t.innerHTML=e.adm,void 0!==e.nurl){const i=new Image(1,1);i.src=e.nurl,i.style.display="none",t.appendChild(i)}return t}function l(e){var t,i,r,o,n,l,s,u,a,d,c,v,h,f,p;const g=e.querySelector("#surf-product-info");if(null===g)return null;const m=g.dataset;return{image:null!==(t=m.image)&&void 0!==t?t:null,price:null!==(i=m.price)&&void 0!==i?i:null,salePrice:null!==(r=m.saleprice)&&void 0!==r?r:null,thc:null!==(o=m.thc)&&void 0!==o?o:null,strain:null!==(n=m.strain)&&void 0!==n?n:null,cbd:null!==(l=m.cbd)&&void 0!==l?l:null,name:null!==(s=m.name)&&void 0!==s?s:null,brand_name:null!==(u=m.brandname)&&void 0!==u?u:null,brandName:null!==(a=m.brandname)&&void 0!==a?a:null,productType:null!==(d=m.producttype)&&void 0!==d?d:null,details:null!==(c=m.details)&&void 0!==c?c:null,cta:null!==(v=m.cta)&&void 0!==v?v:null,clickthroughUrl:null!==(h=m.clickthroughurl)&&void 0!==h?h:null,winUrl:null!==(f=m.winurl)&&void 0!==f?f:null,pixelUrl:null!==(p=m.pixelurl)&&void 0!==p?p:null,ext:m}}},6577:(e,t,i)=>{"use strict";i.d(t,{l:()=>l});var r=i(6131),o=i(1191),n=i(4842);async function l(e,t,i){var l,s,u,a,d,c,v,h,f,p;const g=null===(s=null===(l=null==e?void 0:e.seatbid)||void 0===l?void 0:l[0])||void 0===s?void 0:s.bid;if(void 0===g||0===g.length)return null==i||i.error("BuildNativeResponse No bids"),[];const m=[];for(const e of g){const l=e.adm;if(void 0===l||0===l.length){null==i||i.warn("BuildNativeResponse no adm in bid");continue}let s;try{s=JSON.parse(decodeURIComponent(null!=l?l:"").replaceAll(/\\"/gi,'"'))}catch(e){try{s=JSON.parse(l)}catch(e){null==i||i.warn("BuildNativeResponse failed to deserialized adm data");continue}}const g=e.nurl;if(void 0===g){null==i||i.warn("BuildNativeResponse failed to load winUrl");continue}const _=[],S=[];for(const e of null!==(u=s.native.eventtrackers)&&void 0!==u?u:[])e.event===r.wf.IMP&&void 0!==e.url&&(e.method===r.i_.IMG?_.push(e.url):e.method===r.i_.JS&&S.push(e.url));let w,E=s.native.link.url,b=null;if(void 0!==t){const e=(0,r.LO)(s),l=null===(c=null===(d=null===(a=s.native.assets)||void 0===a?void 0:a.find((e=>e.id===r.vU.SURF_META_PRODUCT)))||void 0===d?void 0:d.data)||void 0===c?void 0:c.value;let u;if(void 0===l)u={image:null,price:null,salePrice:null,thc:null,strain:null,cbd:null,name:null,brand_name:null,brandName:null,productType:null,details:null,cta:null,clickthroughUrl:null,winUrl:null,pixelUrl:null};else{if(b=await t.productService.getNativeProduct(t.accountId,t.siteId,t.locationId,l),null===b){console.warn("catalog response is null");continue}u=b}E.includes("{SURF_COMMERCE_URL}")&&(E=E.replace("{SURF_COMMERCE_URL}",(0,o.H)(t.config,e,u,b)));const m=(0,n.N7)(t.config.templates.productCardTemplate,e,t.config,E,u);if(w=document.createElement("div"),w.attachShadow({mode:"open"}),null===w.shadowRoot){null==i||i.warn("BuildNativeResponse failed to load shadow room of built element");continue}const _=document.createElement("style");_.innerHTML=t.config.templates.productCardStylesheet,w.shadowRoot.appendChild(_),w.shadowRoot.appendChild(m);const S=null!==(h=null===(v=s.native.eventtrackers)||void 0===v?void 0:v.filter((e=>e.method===r.i_.IMG&&e.event===r.wf.IMP&&void 0!==e.url)).map((e=>`${e.url}`)))&&void 0!==h?h:[];S.push(g);const I=null!==(p=null===(f=s.native.eventtrackers)||void 0===f?void 0:f.filter((e=>e.method===r.i_.JS&&e.event===r.wf.IMP&&void 0!==e.url)).map((e=>`<script type="text/javascript" src="${e.url}"><\/script>`)))&&void 0!==p?p:[];for(const e of S){const t=document.createElement("img");t.width=1,t.height=1,t.src=e,w.shadowRoot.appendChild(t)}for(const e of I)w.shadowRoot.innerHTML+=e}m.push({data:s,clickThrough:E,winUrl:g,trackers:{pixels:_,js:S},element:w})}return m}},1191:(e,t,i)=>{"use strict";i.d(t,{H:()=>o});var r=i(9730);function o(e,t,i,o){return e.templates.clickThroughUrlTemplate({product:t,catalog:i,window:{origin:window.location.origin,port:window.location.port,path:window.location.pathname,host:window.location.host,host_name:window.location.hostname,search:window.location.search,hash:window.location.hash,protocol:window.location.protocol},publisher:e,ext:o},{helpers:r})}},5306:(e,t,i)=>{"use strict";function r(e,t,i){null==e||e.debug("getOrThrow name",i);const r=t.querySelector(i);if(null===r)throw new Error(`No ${i} tag found`);return null==e||e.debug("getOrThrow child "+i,r),r}function o(e,t,i){null==e||e.debug("getAttributeOrThrow name",i);const r=t.getAttribute(i);if(null===r)throw new Error(`No ${i} attribute found`);return null==e||e.debug("getAttributeOrThrow attribute "+i,r),r}function n(e,t,i){const r=o(e,t,i),n=Number(r);if(isNaN(n))throw new Error(`${i} is not a number`);return n}function l(e,t){var i,r;const o=null===(r=null===(i=e.seatbid)||void 0===i?void 0:i[0].bid)||void 0===r?void 0:r[0].adm;return void 0===o?null:s(t,o)}function s(e,t){null==e||e.debug("DeserializeVast adm",t);const i=(new DOMParser).parseFromString(t,"text/xml");null==e||e.debug("DeserializeVast doc",i);const r=i.querySelector("VAST");if(null===r)throw new Error("No VAST tag found");null==e||e.debug("DeserializeVast root",r);const n=o(e,r,"version"),l=Array.from(r.querySelectorAll("Ad")).map(u.bind(null,e));return null==e||e.debug("DeserializeVast ads",l),{version:n,ads:l}}function u(e,t){null==e||e.debug("deserializeAd element",t);const i=t.getAttribute("id"),n=function(e,t){var i,n,l,s,u,d,c,v,h,f,p,g,m,_,S,w,E,b,I,R,T,O,C,y;null==e||e.debug("deserializeInline element",t);const N=null===(i=t.querySelector("AdSystem"))||void 0===i?void 0:i.textContent;if(null==N)throw new Error("No AdSystem tag found in InLine");null==e||e.debug("deserializeInline adSystem",N);const D=null===(n=t.querySelector("AdTitle"))||void 0===n?void 0:n.textContent;if(null==D)throw new Error("No AdTitle tag found in InLine");null==e||e.debug("deserializeInline adTitle",D);const A=r(e,t,"Impression"),P=function(e,t){null==e||e.debug("deserializeImpression element",t);const i=o(e,t,"id"),r=t.textContent;if(null===r)throw new Error("No value found on Impression");return null==e||e.debug("deserializeImpression value",r),{id:i,value:r}}(e,A),U=Array.from(t.querySelectorAll("Linear")).map(a.bind(null,e)),x=Array.from(t.querySelectorAll("Extensions Extension"));let M;if(x.length>0){const e=x[0],t=null!==(s=null===(l=e.querySelector("Image"))||void 0===l?void 0:l.textContent)&&void 0!==s?s:null,i=null!==(d=null===(u=e.querySelector("Price"))||void 0===u?void 0:u.textContent)&&void 0!==d?d:null,r=null!==(v=null===(c=e.querySelector("SalePrice"))||void 0===c?void 0:c.textContent)&&void 0!==v?v:null,o=null!==(f=null===(h=e.querySelector("THC"))||void 0===h?void 0:h.textContent)&&void 0!==f?f:null,n=null!==(g=null===(p=e.querySelector("Strain"))||void 0===p?void 0:p.textContent)&&void 0!==g?g:null,a=null!==(_=null===(m=e.querySelector("CBD"))||void 0===m?void 0:m.textContent)&&void 0!==_?_:null,N=null!==(w=null===(S=e.querySelector("Name"))||void 0===S?void 0:S.textContent)&&void 0!==w?w:null,D=null!==(b=null===(E=e.querySelector("BrandName"))||void 0===E?void 0:E.textContent)&&void 0!==b?b:null;M={image:t,price:i,salePrice:r,thc:o,strain:n,cbd:a,name:N,brandName:D,brand_name:D,productType:null!==(R=null===(I=e.querySelector("ProductType"))||void 0===I?void 0:I.textContent)&&void 0!==R?R:null,details:null!==(O=null===(T=e.querySelector("Details"))||void 0===T?void 0:T.textContent)&&void 0!==O?O:null,cta:null!==(y=null===(C=e.querySelector("CTA"))||void 0===C?void 0:C.textContent)&&void 0!==y?y:null,clickthroughUrl:null,winUrl:null,pixelUrl:null}}return{impression:P,adSystem:N,adTitle:D,creatives:U,product:M}}(e,r(e,t,"InLine"));return{id:i,inline:n}}function a(e,t){var i;null==e||e.debug("deserializeLinear element",t);const r=null===(i=t.querySelector("Duration"))||void 0===i?void 0:i.textContent;if(null==r)throw new Error("No Duration tag found in Linear");null==e||e.debug("deserializeLinear duration",r);const o=Array.from(t.querySelectorAll("TrackingEvents Tracking")).map(d.bind(null,e));null==e||e.debug("deserializeLinear trackingEvents",o);const n=Array.from(t.querySelectorAll("MediaFiles MediaFile")).map(c.bind(null,e));null==e||e.debug("deserializeLinear mediaFiles",n);const l=Array.from(t.querySelectorAll("VideoClicks ClickThrough")).map(v.bind(null,e));return null==e||e.debug("deserializeLinear videoClicks",l),{duration:r,trackingEvents:o,mediaFiles:n,videoClicks:l}}function d(e,t){null==e||e.debug("deserializeTrackingEvent element",t);const i=o(e,t,"event"),r=t.textContent;if(null===r)throw new Error("No url found on Tracking");return null==e||e.debug("deserializeTrackingEvent url",r),{event:i,url:r}}function c(e,t){null==e||e.debug("deserializeMediaFile element",t);const i=t.getAttribute("id");null==e||e.debug("deserializeMediaFile id",i);const r=o(e,t,"delivery"),l=o(e,t,"type"),s=n(e,t,"width"),u=n(e,t,"height"),a=function(e,t,i){null==e||e.debug("getAttribute name",i);const r=t.getAttribute(i);return null==e||e.debug("getAttribute attribute "+i,r),r}(e,t,"bitrate"),d=t.textContent;if(null===d)throw new Error("No url found on MediaFile");return null==e||e.debug("deserializeMediaFile url",d),{id:i,delivery:r,type:l,width:s,height:u,bitrate:a,url:d}}function v(e,t){null==e||e.debug("deserializeVideoClick element",t);const i=t.getAttribute("id");null==e||e.debug("deserializeVideoClick id",i);const r=t.textContent;if(null===r)throw new Error("No url found on Clickthrough");return null==e||e.debug("deserializeVideoClick url",r),{id:i,url:r}}i.d(t,{K:()=>s,r:()=>l})},5509:(e,t,i)=>{"use strict";i.d(t,{He:()=>n.H,Kr:()=>l.K,Od:()=>r.Od,Vq:()=>r.Vq,kH:()=>r.kH,l7:()=>o.l,rS:()=>l.r});var r=i(8624),o=i(6577),n=i(1191),l=i(5306)},8971:(e,t,i)=>{"use strict";async function r(e,t,i){null==e||e.info("DeviceMiddleware.intercept",i);const r=await(null==t?void 0:t.getDeviceInfo());return i.device={...i.device,...r},i}i.d(t,{t:()=>r})},7308:(e,t,i)=>{"use strict";i.d(t,{F:()=>o});var r=i(8658);async function o(e,t,i,o,n){const l=await e.getGeo();return null!==l?(null==t||t.debug("GeoMiddleware.intercept found geocontext",l),void 0===i.device&&(i.device={}),o&&(i.device.geo={lat:l.coords.latitude,lon:l.coords.longitude,city:l.city,region:l.region,country:l.country,zip:l.zip,type:r.iF.IP,accuracy:l.coords.accuracy,utcoffset:l.utcoffset,ipservice:r.Ev.MAXMIND}),n&&(i.device.ip=l.ip)):null==t||t.warn("GeoMiddleware.intercept did not find geocontext"),null==t||t.debug("GeoMiddleware.intercept returning",i),i}},4723:(e,t,i)=>{"use strict";i.d(t,{N:()=>n,T:()=>o});var r=i(6131);async function o(e,t,i){null==t||t.info("IdentityMiddleware.intercept",i);const o=await e.getUserId();if(null==t||t.debug("IdentityMiddleware.intercept userId",o),null!==o){const e={source:"surf-domain-id",uids:[{id:o,atype:r.ZV.SESSION}]};void 0!==i.user?i.user.eids=[e]:i.user={eids:[e]}}return null==t||t.debug("IdentityMiddleware.intercept returning",i),i}const n=(e,t)=>async i=>await o(e,t,i)},3957:(e,t,i)=>{"use strict";i.d(t,{Fp:()=>r.F,NW:()=>n.N,Tw:()=>n.T,tX:()=>o.t});var r=i(7308),o=i(8971),n=i(4723)},6131:(e,t,i)=>{"use strict";i.d(t,{Bz:()=>r.Bz,Im:()=>r.Im,JQ:()=>r.JQ,JY:()=>r.JY,LO:()=>r.LO,Lp:()=>r.Lp,Ph:()=>r.Ph,V5:()=>r.V5,ZV:()=>r.ZV,bU:()=>r.bU,i_:()=>r.i_,qU:()=>r.qU,vU:()=>r.vU,wf:()=>r.wf});var r=i(2160)},4231:(e,t,i)=>{"use strict";var r,o;i.d(t,{V:()=>o,Z:()=>r}),function(e){e[e.SESSION=1]="SESSION",e[e.DEVICE=2]="DEVICE",e[e.USER=3]="USER"}(r||(r={})),function(e){e[e.MOBILE=1]="MOBILE",e[e.PC=2]="PC",e[e.CTV=3]="CTV",e[e.PHONE=4]="PHONE",e[e.TABLET=5]="TABLET",e[e.CONNECTED=6]="CONNECTED",e[e.SET_TOP=7]="SET_TOP",e[e.OOH=8]="OOH"}(o||(o={}))},2160:(e,t,i)=>{"use strict";i.d(t,{Bz:()=>o.Bz,Im:()=>o.Im,JQ:()=>o.JQ,JY:()=>o.JY,LO:()=>o.LO,Lp:()=>o.Lp,Ph:()=>o.Ph,V5:()=>r.V,ZV:()=>r.Z,bU:()=>o.bU,i_:()=>o.i_,qU:()=>o.qU,vU:()=>o.vU,wf:()=>o.wf});var r=i(4231),o=i(8906)},7973:(e,t,i)=>{"use strict";i.d(t,{L:()=>n});var r=i(6131);function o(e,t){var i,r,o;return null!==(o=null===(r=null===(i=null==e?void 0:e.find((e=>e.id===t)))||void 0===i?void 0:i.data)||void 0===r?void 0:r.value)&&void 0!==o?o:null}function n(e){var t,i,n,l,s,u,a,d,c,v,h,f,p,g,m,_;const S=o(e.native.assets,r.vU.SPONSORED);return{image:null!==(l=null===(n=null===(i=null===(t=e.native.assets)||void 0===t?void 0:t.find((e=>{var t;return(null===(t=e.img)||void 0===t?void 0:t.type)===r.qU.MAIN})))||void 0===i?void 0:i.img)||void 0===n?void 0:n.url)&&void 0!==l?l:null,name:null!==(d=null===(a=null===(u=null===(s=e.native.assets)||void 0===s?void 0:s.find((e=>void 0!==e.title)))||void 0===u?void 0:u.title)||void 0===a?void 0:a.text)&&void 0!==d?d:null,price:o(e.native.assets,r.vU.PRICE),salePrice:o(e.native.assets,r.vU.SALEPRICE),thc:o(e.native.assets,r.vU.SURF_THC),cbd:o(e.native.assets,r.vU.SURF_CBD),strain:o(e.native.assets,r.vU.SURF_STRAIN),brand_name:S,brandName:S,productType:o(e.native.assets,r.vU.SURF_CATEGORY),details:o(e.native.assets,r.vU.DESC),cta:o(e.native.assets,r.vU.CTATEXT),clickthroughUrl:null!==(v=null===(c=e.native.link)||void 0===c?void 0:c.url)&&void 0!==v?v:null,winUrl:null!==(p=null===(f=null===(h=e.native.eventtrackers)||void 0===h?void 0:h.find((e=>e.event===r.wf.SURF_WIN)))||void 0===f?void 0:f.url)&&void 0!==p?p:null,pixelUrl:null!==(_=null===(m=null===(g=e.native.eventtrackers)||void 0===g?void 0:g.find((e=>e.event===r.wf.IMP)))||void 0===m?void 0:m.url)&&void 0!==_?_:null}}},9946:(e,t,i)=>{"use strict";var r,o,n,l,s,u,a,d,c,v;i.d(t,{Bz:()=>n,JQ:()=>r,JY:()=>c,Lp:()=>u,Ph:()=>d,bU:()=>a,i_:()=>v,qU:()=>o,vU:()=>l,wf:()=>s}),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.ABOVE_THE_FOLD=1]="ABOVE_THE_FOLD",e[e.BELOW_THE_FOLD=3]="BELOW_THE_FOLD",e[e.HEADER=4]="HEADER",e[e.FOOTER=5]="FOOTER",e[e.SIDEBAR=6]="SIDEBAR",e[e.FULL_SCREN=7]="FULL_SCREN"}(r||(r={})),function(e){e[e.ICON=1]="ICON",e[e.MAIN=3]="MAIN"}(o||(o={})),function(e){e[e.SPONSORED=1]="SPONSORED",e[e.DESC=2]="DESC",e[e.RATING=3]="RATING",e[e.LIKES=4]="LIKES",e[e.DOWNLOADS=5]="DOWNLOADS",e[e.PRICE=6]="PRICE",e[e.SALEPRICE=7]="SALEPRICE",e[e.PHONE=8]="PHONE",e[e.ADDRESS=9]="ADDRESS",e[e.DESC2=10]="DESC2",e[e.DISPLAYURL=11]="DISPLAYURL",e[e.CTATEXT=12]="CTATEXT",e[e.SURF_STRAIN=500]="SURF_STRAIN",e[e.SURF_THC=501]="SURF_THC",e[e.SURF_CBD=502]="SURF_CBD",e[e.SURF_CATEGORY=503]="SURF_CATEGORY",e[e.SURF_META_PRODUCT=599]="SURF_META_PRODUCT"}(n||(n={})),function(e){e[e.TITLE=0]="TITLE",e[e.IMAGE=1]="IMAGE",e[e.SPONSORED=2]="SPONSORED",e[e.DESC=3]="DESC",e[e.RATING=4]="RATING",e[e.PRICE=5]="PRICE",e[e.SALEPRICE=6]="SALEPRICE",e[e.DISPLAYURL=7]="DISPLAYURL",e[e.CTATEXT=8]="CTATEXT",e[e.SURF_STRAIN=500]="SURF_STRAIN",e[e.SURF_THC=501]="SURF_THC",e[e.SURF_CBD=502]="SURF_CBD",e[e.SURF_CATEGORY=503]="SURF_CATEGORY",e[e.SURF_META_PRODUCT=599]="SURF_META_PRODUCT"}(l||(l={})),function(e){e[e.IMP=1]="IMP",e[e.VIEWABLE_MRC50=2]="VIEWABLE_MRC50",e[e.VIEWABLE_MRC100=3]="VIEWABLE_MRC100",e[e.VIEWABLE_VIDEO50=4]="VIEWABLE_VIDEO50",e[e.SURF_WIN=500]="SURF_WIN",e[e.SURF_CLICK=501]="SURF_CLICK"}(s||(s={})),function(e){e[e.CONTENT=1]="CONTENT",e[e.SOCIAL=2]="SOCIAL",e[e.PRODUCT=3]="PRODUCT"}(u||(u={})),function(e){e[e.GENERAL=10]="GENERAL",e[e.ARTICLE=11]="ARTICLE",e[e.VIDEO=12]="VIDEO",e[e.AUDIO=13]="AUDIO",e[e.IMAGE=14]="IMAGE",e[e.USER_GENERATED=15]="USER_GENERATED",e[e.GENERAL_SOCIAL=20]="GENERAL_SOCIAL",e[e.EMAIL=21]="EMAIL",e[e.CHAT=22]="CHAT",e[e.PRODUCT=30]="PRODUCT",e[e.APPLICATION=31]="APPLICATION",e[e.PRODUCT_REVIEWS=32]="PRODUCT_REVIEWS"}(a||(a={})),function(e){e[e.IN_FEED=1]="IN_FEED",e[e.ATOMIC=2]="ATOMIC",e[e.OUTSIDE_CORE=3]="OUTSIDE_CORE",e[e.RECOMMENDATION=4]="RECOMMENDATION"}(d||(d={})),function(e){e.MP4="video/mp4",e.WEBM="video/webm"}(c||(c={})),function(e){e[e.IMG=1]="IMG",e[e.JS=2]="JS"}(v||(v={}))},3839:(e,t,i)=>{"use strict";i.d(t,{I:()=>o});var r=i(6131);class o{constructor(){this._request={ver:"1.2",context:r.Lp.PRODUCT,contextsubtype:r.bU.PRODUCT,plcmttype:r.Ph.RECOMMENDATION,assets:[],eventtrackers:[{event:r.wf.IMP,methods:[r.i_.IMG]},{event:r.wf.SURF_CLICK,methods:[r.i_.IMG]},{event:r.wf.IMP,methods:[r.i_.JS]}]}}withVer(e){return this._request.ver=e,this}withContext(e){return this._request.context=e,this}withTitle(e=80,t=!0){return void 0===this._request.assets&&(this._request.assets=[]),this._request.assets.push({id:0,required:t?1:0,title:{len:e}}),this}withImage(e,t,i,r,o=!0){return void 0===this._request.assets&&(this._request.assets=[]),this._request.assets.push({id:0,required:o?1:0,img:{w:e,wmin:i,h:t,hmin:r}}),this}withVideo(e,t,i,r=!0){return void 0===this._request.assets&&(this._request.assets=[]),this._request.assets.push({id:0,required:r?1:0,video:{mimes:e,minduration:t,maxduration:i,protocols:[3]}}),this}withData(e,t,i=80,r=!0){return void 0===this._request.assets&&(this._request.assets=[]),this._request.assets.push({id:t,required:r?1:0,data:{type:e,len:i}}),this}withSponsored(e=80,t=!0){return this.withData(r.Bz.SPONSORED,r.vU.SPONSORED,e,t)}withDescription(e=80,t=!0){return this.withData(r.Bz.DESC,r.vU.DESC,e,t)}withRating(e=80,t=!0){return this.withData(r.Bz.RATING,r.vU.RATING,e,t)}withPrice(e=80,t=!0){return this.withData(r.Bz.PRICE,r.vU.PRICE,e,t)}withSalePrice(e=80,t=!0){return this.withData(r.Bz.SALEPRICE,r.vU.SALEPRICE,e,t)}withDisplayUrl(e=80,t=!0){return this.withData(r.Bz.DISPLAYURL,r.vU.DISPLAYURL,e,t)}withCtaText(e=80,t=!0){return this.withData(r.Bz.CTATEXT,r.vU.CTATEXT,e,t)}withCategory(e=80,t=!0){return this.withData(r.Bz.SURF_CATEGORY,r.vU.SURF_CATEGORY,e,t)}withTHC(e=80,t=!0){return this.withData(r.Bz.SURF_THC,r.vU.SURF_THC,e,t)}withCBD(e=80,t=!0){return this.withData(r.Bz.SURF_CBD,r.vU.SURF_CBD,e,t)}withStrain(e=80,t=!0){return this.withData(r.Bz.SURF_STRAIN,r.vU.SURF_STRAIN,e,t)}withMetaProduct(e=80,t=!0){return this.withData(r.Bz.SURF_META_PRODUCT,r.vU.SURF_META_PRODUCT,e,t)}withEventTracker(e,t){return void 0===this._request.eventtrackers&&(this._request.eventtrackers=[]),this._request.eventtrackers.push({event:e,methods:t}),this}build(){return this._request}}},8906:(e,t,i)=>{"use strict";i.d(t,{Bz:()=>n.Bz,Im:()=>o.I,JQ:()=>n.JQ,JY:()=>n.JY,LO:()=>r.L,Lp:()=>n.Lp,Ph:()=>n.Ph,bU:()=>n.bU,i_:()=>n.i_,qU:()=>n.qU,vU:()=>n.vU,wf:()=>n.wf});var r=i(7973),o=i(3839),n=i(9946)},102:(e,t,i)=>{"use strict";i.d(t,{S:()=>r});class r{constructor(e,t){var i;this._selector=e,this.logger=t,null===(i=this.logger)||void 0===i||i.info("OverrideService.constructor"),this.overrideNode=this.getOverrideNode(),null!==this.overrideNode?this.overrideData=this.mapDataSetToData(this.overrideNode.dataset):this.overrideData=null}getOverrideNode(){return document.querySelector(this._selector)}}},4545:(e,t,i)=>{"use strict";i.d(t,{$9:()=>s.$9,$b:()=>r.$,Dj:()=>s.Dj,EJ:()=>s.EJ,I:()=>s.I,L8:()=>r.L,MM:()=>s.MM,N8:()=>s.N8,RT:()=>s.RT,Vh:()=>o.V,WX:()=>n.W,j8:()=>o.j,td:()=>s.td,wh:()=>l.w});var r=i(3642),o=i(6458),n=i(7327),l=i(220),s=i(9955)},386:(e,t,i)=>{"use strict";var r;i.d(t,{$:()=>r}),function(e){e[e.NONE=0]="NONE",e[e.ERRORS=1]="ERRORS",e[e.INFO=2]="INFO",e[e.DEBUG=3]="DEBUG"}(r||(r={}))},8382:(e,t,i)=>{"use strict";i.d(t,{L:()=>n});var r=i(8658),o=i(4545);class n{constructor(e){this._logLevel=e,this.debug("Logging enabled")}debug(...e){this._logLevel>=o.$b.DEBUG&&this._log(console.log,e,r.$J.MAGIC_MINT)}info(...e){this._logLevel>=o.$b.INFO&&this._log(console.log,e,r.$J.LAVENDER)}warn(...e){this._logLevel>=o.$b.INFO&&this._log(console.warn,e,r.$J.SOFT_GOLD)}error(...e){this._logLevel>=o.$b.ERRORS&&this._log(console.error,e,r.$J.ULTRA_RED)}_log(e,t,i){t.unshift(`border-radius: 3px; margin-left: 10px; background: ${i}; font-size: 12px; font-weight: bold;`),t.unshift("%c [SURF] "),e.apply(console,t)}}},3642:(e,t,i)=>{"use strict";i.d(t,{$:()=>r.$,L:()=>o.L});var r=i(386),o=i(8382)},4227:(e,t,i)=>{"use strict";i.d(t,{w:()=>n});var r=i(9266),o=i(8658);class n{constructor(e,t){var i;this._logger=t,null===(i=this._logger)||void 0===i||i.info("SurfsideProductFeedService.constructor initialized",this),this._url=(0,r.r)(e)}async getProduct(e,t,i,r){var n,l,s,u,a;try{null===(n=this._logger)||void 0===n||n.info("SurfsideProductFeedService.getProduct request",e,t,i,r);const a=await fetch(`${this._url}product/${e}/${i}/${r}.json`);if(a.status!==o.t3.OK)return null;const d=await a.json();if(void 0!==d.quantity&&0===d.quantity)return null===(l=this._logger)||void 0===l||l.warn("SurfsideProductFeedService.getProduct quantity is 0; skipping.",d),null;null===(s=this._logger)||void 0===s||s.debug("SurfsideProductFeedService.getProduct response",d);const c=this._mapResponseToProductInformation(d);return null===(u=this._logger)||void 0===u||u.debug("SurfsideProductFeedService.getProduct mapped",c),c}catch(e){return null===(a=this._logger)||void 0===a||a.warn("SurfsideProductFeedService.getProduct Failed to get product! got",e),null}}async getNativeProduct(e,t,i,r){var n,l,s,u;null===(n=this._logger)||void 0===n||n.info("SurfsideProductFeedService.getProduct request",e,t,i,r);try{const t=await fetch(`${this._url}native/${e}/${i}/${r}.json`);if(t.status!==o.t3.OK)return null;const n=await t.json();null===(l=this._logger)||void 0===l||l.debug("SurfsideProductFeedService.getProduct response",n);const u=this._mapResponseToProductInformation(n);return null===(s=this._logger)||void 0===s||s.debug("SurfsideProductFeedService.getProduct mapped",u),u}catch(e){return null===(u=this._logger)||void 0===u||u.warn("SurfsideProductFeedService.getNativeProduct Failed to get product! got",e),null}}_mapResponseToProductInformation(e){return{image:this._getFieldOrNull(e,"image_link"),price:this._getFieldOrNull(e,"price"),salePrice:this._getFieldOrNull(e,"sale_price"),thc:this._getFieldOrNull(e,"thc"),cbd:this._getFieldOrNull(e,"cbd"),strain:this._getFieldOrNull(e,"strain"),name:this._getFieldOrNull(e,"name"),brand_name:this._getFieldOrNull(e,"brand"),brandName:this._getFieldOrNull(e,"brand"),productType:this._getFieldOrNull(e,"productType"),details:this._getFieldOrNull(e,"details"),cta:this._getFieldOrNull(e,"cta"),clickthroughUrl:this._getFieldOrNull(e,"clickthroughUrl"),winUrl:this._getFieldOrNull(e,"winUrl"),pixelUrl:this._getFieldOrNull(e,"pixelUrl"),ext:e}}_getFieldOrNull(e,t){return t in e?String(e[t]):null}}},220:(e,t,i)=>{"use strict";i.d(t,{w:()=>r.w});var r=i(4227)},3e3:(e,t,i)=>{"use strict";i.d(t,{W:()=>n});var r,o=i(9266);!function(e){e.TOP_ALL="top-products",e.FOR_YOU="for-you",e.PAST_PURCHASE="buy-again"}(r||(r={}));class n{constructor(e,t,i){var r;this._productFeedService=t,this._logger=i,this._cache=new Map,null===(r=this._logger)||void 0===r||r.info("SurfsideRecommenderService.constructor initialized",this),this._url=(0,o.r)(e)}async getTopProducts(e,t,i,o){var n;return null===(n=this._logger)||void 0===n||n.info("SurfsideRecommenderService.getTopProducts request",e,t,i),await this._fetchRecommendations(e,t,i,null,r.TOP_ALL,o)}async*generateTopProduct(e,t,i){var o;null===(o=this._logger)||void 0===o||o.info("SurfsideRecommenderService.generateTopProduct request",e,t,i),yield*this._generateProductRecommendation(e,t,i,null,r.TOP_ALL)}async getForYou(e,t,i,o,n){var l;return null===(l=this._logger)||void 0===l||l.info("SurfsideRecommenderService.getForYou request",e,t,i,o),await this._fetchRecommendations(e,t,i,o,r.FOR_YOU,n)}async*generateForYou(e,t,i,o){var n;null===(n=this._logger)||void 0===n||n.info("SurfsideRecommenderService.generateForYou request",e,t,i,o),yield*this._generateProductRecommendation(e,t,i,o,r.FOR_YOU)}async getPreviousPurchases(e,t,i,o,n){var l;return null===(l=this._logger)||void 0===l||l.info("SurfsideRecommenderService.getPreviousPurchases request",e,t,i,o),await this._fetchRecommendations(e,t,i,o,r.PAST_PURCHASE,n)}async*generatePreviousPurchase(e,t,i,o){var n;null===(n=this._logger)||void 0===n||n.info("SurfsideRecommenderService.generatePreviousPurchase request",e,t,i,o),yield*this._generateProductRecommendation(e,t,i,o,r.PAST_PURCHASE)}async*_generateProductRecommendation(e,t,i,r,o){var n,l,s;null===(n=this._logger)||void 0===n||n.info("SurfsideRecommenderService._generateProductRecommendation request",e,t,i,r,o);const u=await this._fetchRecommendationList(e,t,i,r,o);null!==u?(yield*this._generateProduct(e,t,i,u),null===(s=this._logger)||void 0===s||s.debug("SurfsideRecommenderService._generateProductRecommendation No more products, exiting",e,t,i,r,o)):null===(l=this._logger)||void 0===l||l.warn("SurfsideRecommenderService._generateProductRecommendation No recommendations available",e,t,i,r,o)}async _fetchRecommendations(e,t,i,r,o,n){var l,s;null===(l=this._logger)||void 0===l||l.debug("SurfsideRecommenderService._fetchRecommendations request",e,t,i,r,o);const u=`accountId=${e}&siteId=${t}&locationId=${i}&userId=${null!=r?r:"null"}&type=${o}`,a=this._cache.get(u);if(void 0!==a){const[e,t]=a,i=[];let r=t;for(r=t;r<t+n;r++)i.push(e[r%e.length]);return r%=e.length,this._cache.set(u,[e,r]),i}const d=await(await fetch(`${this._url.toString()}r/${o}/?accountId=${e}&siteId=${t}&locationId=${i}&user=${r}&limit=100`+(null===r?"":`&userId=${r}`))).json();if(void 0!==d.error)return null===(s=this._logger)||void 0===s||s.warn("SurfsideRecommenderService._fetchRecommendations no results",d),null;{const e=d;return this._cache.set(u,[e,n]),e.splice(0,n)}}async _fetchRecommendationList(e,t,i,r,o){var n,l,s;null===(n=this._logger)||void 0===n||n.debug("SurfsideRecommenderService._fetchRecommendations request",e,t,i,r,o);try{const n=await(await fetch(`${this._url.toString()}r/${o}/?accountId=${e}&siteId=${t}&locationId=${i}&user=${r}&limit=100`+(null===r?"":`&userId=${r}`))).json();return void 0!==n.error?(null===(l=this._logger)||void 0===l||l.warn("SurfsideRecommenderService._fetchRecommendations no results",n),null):n}catch(e){return null===(s=this._logger)||void 0===s||s.error(e),null}}async*_generateProduct(e,t,i,r){var o,n,l,s,u,a,d;null===(o=this._logger)||void 0===o||o.info("SurfsideRecommenderService._generateProduct entering generation request",e,t,i,r);for(const o of r){const r=o.item_id;try{null===(n=this._logger)||void 0===n||n.debug("SurfsideRecommenderService._generateProduct itemId",r,e,t,i);const o=await this._productFeedService.getProduct(e,t,i,r);if(null===(l=this._logger)||void 0===l||l.debug("SurfsideRecommenderService._generateProduct product",o,e,t,i),null===o){null===(u=this._logger)||void 0===u||u.warn("SurfsideRecommenderService._generateProduct product is null",e,t,i);continue}null===(s=this._logger)||void 0===s||s.debug("SurfsideRecommenderService._generateProduct product is not null",e,t,i),yield o}catch(e){null===(a=this._logger)||void 0===a||a.warn("SurfsideRecommenderService._generateProduct Missing product from recommender: ",r);continue}}null===(d=this._logger)||void 0===d||d.debug("SurfsideRecommenderService._generateProduct no more products, exiting",e,t,i)}}},7327:(e,t,i)=>{"use strict";i.d(t,{W:()=>r.W});var r=i(3e3)},2961:(e,t,i)=>{"use strict";i.d(t,{j:()=>a});var r=i(8658),o=i(110),n=i(9266),l=i(3957);const s=/(?:\$|%24)?(?:\{|%7b)auction_price(?:\}|%7d)/gi,u=/(?:\$|%24)?(?:\{|%7b)location_id(?:\}|%7d)/gi;class a{constructor(e,t,i,r,o,l){var s;this._configService=t,this._geoService=i,this._deviceService=r,this._userService=o,this._logger=l,null===(s=this._logger)||void 0===s||s.info("SurfsideBidderService.constructor initialized",this),this._url=(0,n.r)(e)}async requestBids(e){var t,i,n,a,d,c,v,h,f,p,g,m,_,S,w,E;null===(t=this._logger)||void 0===t||t.info("SurfsideBidderService.bid request",e);const b=null===(i=e.ext)||void 0===i?void 0:i.accountId,I=null===(n=e.ext)||void 0===n?void 0:n.siteId;if(void 0!==b&&void 0!==I){const t=await this._configService.getConfiguration(b,I);null!==t&&(e=await(0,l.Fp)(this._geoService,this._logger,e,t.settings.geoTargetingEnabled,t.settings.ipTargetingEnabled),e=await(0,l.tX)(this._logger,this._deviceService,e),e=await(0,l.Tw)(this._userService,this._logger,e))}const R=await fetch(this._url,{method:"POST",body:JSON.stringify(e)});if(null===(a=this._logger)||void 0===a||a.debug("SurfsideBidderService.bid response",R),null===(d=this._logger)||void 0===d||d.debug("SurfsideBidderService.bid response status",R.status),R.status!==r.t3.OK){const e=null!==(c=R.status===r.t3.NO_CONTENT?R.headers.get("X-REASON"):await R.text())&&void 0!==c?c:`${R.status} - ${R.statusText}`;throw null===(v=this._logger)||void 0===v||v.debug("SurfsideBidderService.bid response no-bid reason:",e),new o.e(e)}const T=await R.json();for(let t=0;t<(null!==(f=null===(h=T.seatbid)||void 0===h?void 0:h.length)&&void 0!==f?f:0);t++){const i=null===(p=T.seatbid)||void 0===p?void 0:p[t];for(let t=0;t<(null!==(g=null==i?void 0:i.bid.length)&&void 0!==g?g:0);t++){const r=null==i?void 0:i.bid[t];if(void 0!==r)try{r.adm=decodeURIComponent(null!==(m=null==r?void 0:r.adm)&&void 0!==m?m:"").replaceAll(/\\"/gi,'"'),r.nurl=null===(_=r.nurl)||void 0===_?void 0:_.replace(s,r.price.toString()),r.adm=r.adm.replaceAll(s,r.price.toString());const t=e.ext.locationId;void 0===t?null===(S=this._logger)||void 0===S||S.warn("Location ID missing from bid request"):(r.adm=r.adm.replaceAll(u,t),r.nurl=null===(w=r.nurl)||void 0===w?void 0:w.replace(u,t))}catch(e){continue}}}return null===(E=this._logger)||void 0===E||E.debug("SurfsideBidderService.bid bidResponse",T),T}}},785:(e,t,i)=>{"use strict";i.d(t,{j:()=>r.j});var r=i(2961)},7797:(e,t,i)=>{"use strict";i.d(t,{V:()=>o});var r=i(9266);class o{constructor(e,t,i){var o;this._handlebars=t,this._logger=i,null===(o=this._logger)||void 0===o||o.info("SurfsideConfigurationService.constructor initialized",this),this._url=(0,r.r)(e)}async getConfiguration(e,t){var i,r,o,n;null===(i=this._logger)||void 0===i||i.info("SurfsideConfigurationService.getConfiguration request",e,t);const l=await fetch(this._url+`${e}/${t}/config.json`);if(!l.ok)return null===(r=this._logger)||void 0===r||r.error("SurfsideConfigurationService.getConfiguration failed to fetch",l),null;const s=await l.json();return void 0===s.settings||void 0===s.templates?(null===(o=this._logger)||void 0===o||o.debug("SurfsideConfigurationService.getConfiguration response was invalid format!",s),null):(null===(n=this._logger)||void 0===n||n.debug("SurfsideConfigurationService.getConfiguration response",s),await this._mapConfig(s))}async _mapConfig(e){var t,i,r,o,n,l,s,u,a;return null===(t=this._logger)||void 0===t||t.debug("IConfigurationService.mapConfig mapping:",e),{settings:e.settings,templates:{clickThroughUrlTemplate:this._handlebars.template((await this._importModule(`export default ${null!==(r=null===(i=e.templates)||void 0===i?void 0:i.clickThroughUrlTemplate)&&void 0!==r?r:""}`)).default),productCardTemplate:this._handlebars.template((await this._importModule(`export default ${null!==(n=null===(o=e.templates)||void 0===o?void 0:o.productCardTemplate)&&void 0!==n?n:""}`)).default),javascriptCallbacks:await this._importModule(null!==(s=null===(l=e.templates)||void 0===l?void 0:l.javascriptCallbacks)&&void 0!==s?s:""),productCardStylesheet:null===(u=e.templates)||void 0===u?void 0:u.productCardStylesheet,carouselStylesheet:null===(a=e.templates)||void 0===a?void 0:a.carouselStylesheet}}}async _importModule(e){var t,i,r;null===(t=this._logger)||void 0===t||t.debug("IConfigurationService.importDynamicModule importing:",e);const o=new Blob([e],{type:"text/javascript"}),n=URL.createObjectURL(o);null===(i=this._logger)||void 0===i||i.debug("IConfigurationService.importDynamicModule moduleUrl",n);const l=await import(/* webpackIgnore: true */n);return null===(r=this._logger)||void 0===r||r.debug("IConfigurationService.importDynamicModule module:",l),l}}},2551:(e,t,i)=>{"use strict";i.d(t,{V:()=>r.V});var r=i(7797)},6458:(e,t,i)=>{"use strict";i.d(t,{V:()=>o.V,j:()=>r.j});var r=i(785),o=i(2551)},4423:(e,t,i)=>{"use strict";i.d(t,{M:()=>o});var r=i(102);class o extends r.S{constructor(e){var t;super("div#surf-device-override",e),null===(t=this.logger)||void 0===t||t.info("DeviceOverrideService.constructor")}async getDeviceInfo(){const e=this.getOverrideNode();return void 0===(null==e?void 0:e.dataset)||(this.overrideData=this.mapDataSetToData(e.dataset)),this.overrideData}mapDataSetToData(e){var t,i,r,o,l;const{ua:s,dnt:u,ip:a,ipv6:d,devicetype:c,make:v,model:h,os:f,osv:p,h:g,w:m,language:_}=e,S={ua:s,dnt:"true"===(null==u?void 0:u.toLowerCase())?1:0,ip:a,ipv6:d,devicetype:n(c),make:v,model:h,os:f,osv:p,h:n(g),w:n(m),language:_},w=null!==(i=null===(t=this.overrideNode)||void 0===t?void 0:t.querySelector("div#surf-device-sua-override"))&&void 0!==i?i:null;if(null===w)return S;const{mobile:E,architecture:b,bitness:I,useragentmodel:R,source:T}=w.dataset,O="true"===(null==E?void 0:E.toLowerCase())?1:0,C="true"===(null==T?void 0:T.toLowerCase())?1:0;let y;const N=[...w.querySelectorAll("div.surf-device-sua-browser-override")];if(N.length>0){y=[];for(const e of N){const{brand:t,version:i}=e.dataset;void 0!==t?y.push({brand:t,version:null==i?void 0:i.split(",")}):null===(r=this.logger)||void 0===r||r.warn("DeviceOverrideService.mapDataSetToData Browser brandInfo is missing brand field. Skipping browser override")}}let D;const A=null!==(o=w.querySelector("div#surf-device-sua-platform-override"))&&void 0!==o?o:null;if(null!==A){const{brand:e,version:t}=A.dataset;void 0===e?null===(l=this.logger)||void 0===l||l.warn("DeviceOverrideService.mapDataSetToData Platform brandinfo is missing brand field. Skipping platform override"):D={brand:e,version:null==t?void 0:t.split(",")}}const P={mobile:O,architecture:b,bitness:I,model:R,source:C,browsers:y,platform:D};return S.sua=P,S}}function n(e){if(void 0===e)return;const t=Number(e);return isNaN(t)?void 0:t}},5550:(e,t,i)=>{"use strict";i.d(t,{E:()=>a,t:()=>n});var r=i(4423),o=i(6131);class n extends r.M{constructor(e){super(e),null==e||e.info("SurfsideDeviceService.constructor")}async getDeviceInfo(){var e,t;const i=await super.getDeviceInfo();if(null!==i)return i;const r=l()?1:0,o=a();null!==o&&(null===(e=this.logger)||void 0===e||e.warn("SurfsideDeviceService.getDeviceInfo failure; TryGetDeviceInfo() returned null"));const n={model:null==o?void 0:o.model,mobile:r,browsers:void 0!==(null==o?void 0:o.browser)?[o.browser]:void 0,platform:void 0!==(null==o?void 0:o.os)?{brand:null==o?void 0:o.os,version:null===(t=null==o?void 0:o.osv)||void 0===t?void 0:t.split(".")}:void 0,architecture:u(navigator.userAgent),source:3};return{make:null==o?void 0:o.make,model:null==o?void 0:o.model,w:screen.width,h:screen.height,language:navigator.language,ua:navigator.userAgent,devicetype:s(),os:null==o?void 0:o.os,osv:null==o?void 0:o.osv,sua:n}}}function l(){return void 0!==window.ontouchstart}function s(){const e=l();if(!e)return o.V5.PC;const t=window.screen.width,i=window.screen.height,[r,n]=[t,i].sort(((e,t)=>e-t));return e&&r>=600&&n>=960?o.V5.TABLET:o.V5.MOBILE}function u(e){return/Win64|x64|x86_64|WOW64/.test(e)?"x64":/Win32|x86/.test(e)?"x86":/aarch64|arm64/.test(e)?"ARM64":/armv\d+/.test(e)||l()?"ARM":void 0}function a(){var e,t,i,r,o,n;const l=navigator.userAgent,s=l.toLowerCase();let u={};return s.includes("android")?u={...d(l)}:s.includes("iphone")||s.includes("ipad")?u={...c(l)}:s.includes("windows nt")?u={make:"Microsoft",model:"Windows",os:"Windows",osv:null===(t=null===(e=/Windows NT (?<osv>[0-9.]+)/gi.exec(l))||void 0===e?void 0:e.groups)||void 0===t?void 0:t.osv}:s.includes("macintosh")&&(u={make:"Apple",model:"Macintosh",os:"MacOS",osv:null===(o=null===(r=null===(i=/Mac OS X (?<osv>[0-9_]+)/gi.exec(l))||void 0===i?void 0:i.groups)||void 0===r?void 0:r.osv)||void 0===o?void 0:o.replaceAll("_",".")}),u.browser=null!==(n=function(e){var t,i,r;try{let o,n;if(e.includes("Firefox/"))o=e.split("Firefox/")[1],n="Firefox";else if(e.includes("Chrome/"))o=null===(t=e.split("Chrome/")[1])||void 0===t?void 0:t.split(" ")[0],n="Chrome";else if(e.includes("CriOS"))o=null===(i=e.split("CriOS/")[1])||void 0===i?void 0:i.split(" ")[0],n="Chrome";else if(e.includes("Safari/")&&!e.includes("Chrome"))o=null===(r=e.split("Version/")[1])||void 0===r?void 0:r.split(" ")[0],n="Safari";else{if(!e.includes("Edg/"))return null;o=e.split("Edg/")[1],n="Edge"}return{brand:n,version:o.split(".")}}catch(e){return null}}(navigator.userAgent))&&void 0!==n?n:void 0,u}function d(e){var t,i;const r=/^[^\s]+\s\((?<Linux>.*);\s*(?<osv>[^)]+);\s*(?<Model>[^)]+)\)/gi.exec(e),o=null===(t=null==r?void 0:r.groups)||void 0===t?void 0:t.osv,n=null===(i=null==r?void 0:r.groups)||void 0===i?void 0:i.Model;let l;return void 0!==n&&(l=n.includes("Pixel")?"Google":n.includes("SM-")?"Samsung":n.startsWith("LG-")?"LG":n.startsWith("moto")?"Motorola":n.startsWith("Redmi")?"Xiaomi":"Android"),{os:"Android",osv:o,model:n,make:l}}function c(e){var t,i,r,o;const n=/^[^\s]+\s*\((?<Device>[^;]+);\s(?<Model>[^;)]+[;)])\s(?<ModelExt>[^;)]+[;)])?/gi.exec(e),l=null===(t=null==n?void 0:n.groups)||void 0===t?void 0:t.Device;let s;void 0!==l&&(s=l.toLowerCase().includes("ipad")?"iPad":"iPhone");let u,a=null===(i=null==n?void 0:n.groups)||void 0===i?void 0:i.Model;if("U"===a&&(a=null===(r=null==n?void 0:n.groups)||void 0===r?void 0:r.ModelExt),void 0!==a){const e=/OS (?<ver>[0-9_]+)/gi.exec(a);u=null===(o=null==e?void 0:e.groups)||void 0===o?void 0:o.ver}return{make:"Apple",model:s,os:"iOS",osv:u}}},9442:(e,t,i)=>{"use strict";i.d(t,{EJ:()=>o.E,MM:()=>r.M,td:()=>o.t});var r=i(4423),o=i(5550)},9225:(e,t,i)=>{"use strict";i.d(t,{N:()=>s});var r,o=i(9266);!function(e){e.NEW_TRACKER="newTracker",e.BID_REQUESTED="bidRequested",e.BIDDER_DONE="bidderDone"}(r||(r={}));const n="ads",l="surf";class s{constructor(e={lazyLoad:!1,appId:n},t){var i,s,u,a,d,c,v,h;if(this._logger=t,null===(i=this._logger)||void 0===i||i.info("SurfsideEventService.constructor"),this._appId=null!==(s=e.appId)&&void 0!==s?s:n,this._collectorUrl=(0,o.r)(null!==(u=e.collectorUrl)&&void 0!==u?u:"//col.surfside.io"),e.lazyLoad&&void 0===window.surf){this._src=(0,o.r)(e.src),window.surfContext=null!==(a=window.surfContext)&&void 0!==a?a:[],window.surfContext.push("surf"),window.surf=function(){var e;void 0!==window.surf&&(window.surf.q=null!==(e=window.surf.q)&&void 0!==e?e:[]).push(arguments)},this._surf=window.surf,window.surf.q=null!==(d=window.surf.q)&&void 0!==d?d:[];const t=document.createElement("script");t.src=this._src,t.async=!0,t.onload=()=>{var t,i,o,s;null===(t=this._logger)||void 0===t||t.info("SurfsideEventService script loaded"),this._surf=window.surf,this._surf(`${r.NEW_TRACKER}:${this._appId}`,null!==(i=e.appId)&&void 0!==i?i:n,this._collectorUrl,{appId:null!==(o=e.appId)&&void 0!==o?o:n,cookieName:null!==(s=e.cookieName)&&void 0!==s?s:l,discoverRootDomain:!0,cookieSameSite:"Lax"})},document.head.appendChild(t)}else this._surf=window.surf,this._surf(`${r.NEW_TRACKER}:${this._appId}`,null!==(c=e.appId)&&void 0!==c?c:n,this._collectorUrl,{appId:null!==(v=e.appId)&&void 0!==v?v:n,cookieName:null!==(h=e.cookieName)&&void 0!==h?h:l,discoverRootDomain:!0,cookieSameSite:"Lax"})}async raiseBidRequested(e){var t,i,o,n,l;null===(t=this._logger)||void 0===t||t.info("SurfsideEventService.raiseBidRequested"),null===(i=this._logger)||void 0===i||i.debug("SurfsideEventService.raiseBidRequested",e);const s=e.id;null===(o=this._logger)||void 0===o||o.info("SurfsideEventService.raiseBidRequested requestId",s);const u={auctionId:s,bidderRequestId:s,bids:null===(n=e.imp)||void 0===n?void 0:n.map((t=>{var i,r,o,n,l,s,u,a,d,c,v,h,f,p,g,m,_,S,w,E,b,I;return{params:{accountId:null!==(r=null===(i=e.ext)||void 0===i?void 0:i.accountId)&&void 0!==r?r:null,channelId:null!==(n=null===(o=e.ext)||void 0===o?void 0:o.channelId)&&void 0!==n?n:null,siteId:null!==(s=null===(l=e.ext)||void 0===l?void 0:l.siteId)&&void 0!==s?s:null,placementId:null!==(a=null===(u=e.ext)||void 0===u?void 0:u.zoneId)&&void 0!==a?a:null,zone:null!==(c=null===(d=e.ext)||void 0===d?void 0:d.zone)&&void 0!==c?c:null,type:null!==(h=null===(v=e.ext)||void 0===v?void 0:v.type)&&void 0!==h?h:null,storeId:null!==(p=null===(f=e.ext)||void 0===f?void 0:f.storeId)&&void 0!==p?p:null},user:void 0!==(null===(g=null==e?void 0:e.user)||void 0===g?void 0:g.geo)?{geo:e.user.geo}:void 0,ortb2Imp:{ext:{tid:void 0!==(null===(m=null==e?void 0:e.source)||void 0===m?void 0:m.tid)?e.source.tid:""}},mediaTypes:{banner:void 0!==(null===(_=null==t?void 0:t.banner)||void 0===_?void 0:_.w)&&void 0!==(null===(S=null==t?void 0:t.banner)||void 0===S?void 0:S.h)?{sizes:[[t.banner.w,t.banner.h]]}:void 0},transactionId:null!==(E=null===(w=null==e?void 0:e.source)||void 0===w?void 0:w.tid)&&void 0!==E?E:"",sizes:void 0!==(null===(b=null==t?void 0:t.banner)||void 0===b?void 0:b.w)&&void 0!==(null===(I=null==t?void 0:t.banner)||void 0===I?void 0:I.h)?[[t.banner.w,t.banner.h]]:[[0,0]],bidId:t.id,ortb2:{site:{domain:window.location.hostname,page:window.location.pathname},device:{w:window.screen.width,h:window.screen.height,dnt:0,ua:window.navigator.userAgent,language:window.navigator.language}}}})),auctionStart:Date.now(),timeout:0,refererInfo:{stack:[document.referrer],location:window.location.href,page:window.location.href,domain:window.location.hostname},start:Date.now()};null===(l=this._logger)||void 0===l||l.debug("SurfsideEventService.raiseBidRequested snowplowBidRequestPayload",u),this._surf(`${r.BID_REQUESTED}:${this._appId}`,u)}async raiseBidResponded(e,t){var i,o,n,l;null===(i=this._logger)||void 0===i||i.info("SurfsideEventService.raiseBidderDone"),null===(o=this._logger)||void 0===o||o.debug("SurfsideEventService.raiseBidderDone",e);const s=void 0!==(null==e?void 0:e.seatbid)?null===(n=e.seatbid[0])||void 0===n?void 0:n.bid:[],u={auctionId:t.id,bidderRequestId:t.id,bids:s.map((i=>{var r,o,n,l,s,u,a,d,c,v,h,f,p,g,m,_,S,w,E,b,I,R,T,O,C,y,N,D;return{params:{accountId:null!==(l=null!==(o=null===(r=e.ext)||void 0===r?void 0:r.accountId)&&void 0!==o?o:null===(n=t.ext)||void 0===n?void 0:n.accountId)&&void 0!==l?l:null,channelId:null!==(d=null!==(u=null===(s=e.ext)||void 0===s?void 0:s.channelId)&&void 0!==u?u:null===(a=t.ext)||void 0===a?void 0:a.channelId)&&void 0!==d?d:null,siteId:null!==(f=null!==(v=null===(c=e.ext)||void 0===c?void 0:c.siteId)&&void 0!==v?v:null===(h=t.ext)||void 0===h?void 0:h.siteId)&&void 0!==f?f:null,placementId:null!==(_=null!==(g=null===(p=e.ext)||void 0===p?void 0:p.zoneId)&&void 0!==g?g:null===(m=t.ext)||void 0===m?void 0:m.zoneId)&&void 0!==_?_:null,zone:null!==(b=null!==(w=null===(S=e.ext)||void 0===S?void 0:S.zone)&&void 0!==w?w:null===(E=t.ext)||void 0===E?void 0:E.zone)&&void 0!==b?b:null,type:null!==(O=null!==(R=null===(I=e.ext)||void 0===I?void 0:I.type)&&void 0!==R?R:null===(T=t.ext)||void 0===T?void 0:T.type)&&void 0!==O?O:null,storeId:null!==(D=null!==(y=null===(C=e.ext)||void 0===C?void 0:C.storeId)&&void 0!==y?y:null===(N=t.ext)||void 0===N?void 0:N.storeId)&&void 0!==D?D:null},bidId:i.id,transactionId:i.impid,ortb2:{site:{domain:window.location.hostname,page:window.location.pathname},device:{w:window.screen.width,h:window.screen.height,dnt:0,ua:window.navigator.userAgent,language:window.navigator.language}},ortb2Imp:{},sizes:void 0!==i.w&&void 0!==i.h?[[i.w,i.h]]:[[0,0]],mediaTypes:void 0!==i.w&&void 0!==i.h?{banner:{sizes:[[i.w,i.h]]}}:{}}})),auctionStart:0,refererInfo:{stack:[document.referrer],location:window.location.href,page:window.location.href,domain:window.location.hostname},timeout:0,start:Date.now()};null===(l=this._logger)||void 0===l||l.debug("SurfsideEventService.raiseBidderDone snowplowBidderDoneEvent",u),this._surf(`${r.BIDDER_DONE}:${this._appId}`,u)}}},4305:(e,t,i)=>{"use strict";i.d(t,{N:()=>r.N});var r=i(9225)},2781:(e,t,i)=>{"use strict";i.d(t,{D:()=>o});var r=i(102);class o extends r.S{constructor(e){super("div#surf-geo-override",e)}mapDataSetToData(e){var t,i,r,o,n;null===(t=this.logger)||void 0===t||t.info("GeoOverrideService.mapDataSetToData");const{country:l,region:s,city:u,zip:a,coords:d,utcoffset:c,ip:v}=e;if(void 0===c||void 0===l||void 0===d||void 0===s||void 0===u||void 0===a||void 0===v)return null===(i=this.logger)||void 0===i||i.warn("GeoOverrideService.mapDataSetToData missing a value in geo override, returning null"),null;const h=Number(c);if(isNaN(h))return null===(r=this.logger)||void 0===r||r.warn("GeoOverrideService.mapDataSetToData utcOffset is not a number, returning null"),null;const[f,p,g]=d.split(",").map((e=>Number(e)));if(void 0===f||isNaN(f)||void 0===p||isNaN(p)||void 0===g||isNaN(g))return null===(o=this.logger)||void 0===o||o.warn("GeoOverrideService.mapDataSetToData coords string is malformed, returning null"),null;const m={country:l,region:s,city:u,zip:a,coords:{latitude:f,longitude:p,accuracy:g},utcoffset:h,ip:v};return null===(n=this.logger)||void 0===n||n.warn("GeoOverrideService.mapDataSetToData override success",m),m}async getGeo(){const e=this.getOverrideNode();return void 0===(null==e?void 0:e.dataset)||(this.overrideData=this.mapDataSetToData(e.dataset)),this.overrideData}}},9058:(e,t,i)=>{"use strict";i.d(t,{I:()=>o});var r=i(2781);class o extends r.D{constructor(e){var t;super(e),null===(t=this.logger)||void 0===t||t.info("SurfsideGeoService.constructor initialized",this)}async getGeo(){var e,t,i;null===(e=this.logger)||void 0===e||e.info("SurfsideGeoService.getGeo");const r=await super.getGeo();if(null!==r)return r;try{const e=await fetch("https://g.surfside.io/enrich");return null===(t=this.logger)||void 0===t||t.debug("SurfsideGeoService.getGeo response",e),await e.json()}catch(e){return null===(i=this.logger)||void 0===i||i.error("Failed to get geolocation information",e),null}}}},6181:(e,t,i)=>{"use strict";i.d(t,{D:()=>o.D,I:()=>r.I});var r=i(9058),o=i(2781)},9955:(e,t,i)=>{"use strict";i.d(t,{$9:()=>o.$,Dj:()=>r.D,EJ:()=>l.EJ,I:()=>r.I,MM:()=>l.MM,N8:()=>n.N,RT:()=>o.R,td:()=>l.td});var r=i(6181),o=i(4831),n=i(4305),l=i(9442)},8831:(e,t,i)=>{"use strict";i.d(t,{R:()=>n});var r=i(1133);const o=/surfid.(?<site_hash>[a-z0-9]+)=(?<domain_userid>[^.]+).*/gi;class n extends r.${constructor(e){var t;super(e),null===(t=this.logger)||void 0===t||t.info("SurfsideUserIDService.constructor initialized")}async getUserId(){var e,t,i,r,n,l,s,u;null===(e=this.logger)||void 0===e||e.info("SurfsideUserIDService.getUserId");const a=null!==(s=null!==(t=await super.getUserId())&&void 0!==t?t:null===(l=null===(n=null===(r=null===(i=document.cookie.split(";").map((e=>e.trim())).filter((e=>e.startsWith("surfid."))).map((e=>e.matchAll(o))).map((e=>[...e])))||void 0===i?void 0:i[0])||void 0===r?void 0:r[0])||void 0===n?void 0:n.groups)||void 0===l?void 0:l.domain_userid)&&void 0!==s?s:null;return null===(u=this.logger)||void 0===u||u.debug("SurfsideUserIDService.getUserId userId",a),a}}},1133:(e,t,i)=>{"use strict";i.d(t,{$:()=>o});var r=i(102);class o extends r.S{constructor(e){var t;super("div#surf-user-override",e),null===(t=this.logger)||void 0===t||t.info("UserOverrideService.constructor initialized UserOverrideService")}async getUserId(){const e=this.getOverrideNode();return void 0===(null==e?void 0:e.dataset)||(this.overrideData=this.mapDataSetToData(e.dataset)),this.overrideData}mapDataSetToData(e){var t,i;return void 0===e.userid?(null===(t=this.logger)||void 0===t||t.warn("UserOverrideService.getUserId found userId Div block, but no userId was set.Hint: it needs dataset - userid"),null):(null===(i=this.logger)||void 0===i||i.debug(`UserOverrideService.getUserId found userId: ${e.userid}`),e.userid)}}},4831:(e,t,i)=>{"use strict";i.d(t,{$:()=>o.$,R:()=>r.R});var r=i(8831),o=i(1133)},7836:(e,t,i)=>{"use strict";function r(e){if(e.includes("://"))return e;const t=e.startsWith("//")?"":"//";let i=window.location.protocol;return i.startsWith("http")||(i="https:"),`${i}${t}${e}`}i.d(t,{r:()=>r})},4842:(e,t,i)=>{"use strict";i.d(t,{N7:()=>s,TT:()=>l,V0:()=>a,fc:()=>o});var r=i(9730);function o(e,t){null==t||t.info("InitHandlebars initializing"),n("slug",e,r.slug,t),n("lower",e,r.lower,t),n("path",e,r.path,t),n("search",e,r.search,t),n("coalesce",e,r.coalesce,t),n("sed",e,r.sed,t),n("join",e,r.join,t),n("uri",e,r.uri,t),n("eq",e,r.eq,t),n("or",e,r.or,t),n("and",e,r.and,t),n("in",e,r.isIn,t),n("array",e,r.array,t),n("global",e,r.global,t)}function n(e,t,i,r){null==r||r.debug(`Registering Handlebars Helper ${e}`),t.registerHelper(e,i)}function l(){const e=window.location;return{origin:e.origin,port:e.port,path:e.pathname,host:e.host,host_name:e.hostname,search:e.search,hash:e.hash,protocol:e.protocol}}function s(e,t,i,r,o={image:null,price:null,salePrice:null,thc:null,cbd:null,strain:null,name:null,brand_name:null,brandName:null,productType:null,details:null,cta:null,clickthroughUrl:null,winUrl:null,pixelUrl:null,ext:null}){return a(e,{product:null!=t?t:{},window:l(),catalog:o,publisher:i,ext:null==t?void 0:t.ext,clickthrough:r})}function u(e,t,i){const r=Array.from(e.querySelectorAll(`[_${i}_]`));for(const e of r){const r=t[e.getAttribute(`_${i}_`)];e.addEventListener(i,r)}}function a(e,t){const i=e(t,{helpers:{slug:r.slug,lower:r.lower,path:r.path,search:r.search,coalesce:r.coalesce,join:r.join,uri:r.uri,sed:r.sed,eq:r.eq,or:r.or,and:r.and,isIn:r.isIn,array:r.array}}),o=document.createElement("div");return o.innerHTML=i,u(o,t,"click"),u(o,t,"mousedown"),u(o,t,"loadeddata"),u(o,t,"error"),u(o,t,"touchend"),u(o,t,"touchstart"),u(o,t,"touchmove"),o}},9266:(e,t,i)=>{"use strict";i.d(t,{N7:()=>o.N7,TT:()=>o.TT,V0:()=>o.V0,fc:()=>o.fc,r:()=>r.r});var r=i(7836),o=i(4842)}},t={};function i(r){var o=t[r];if(void 0!==o)return o.exports;var n=t[r]={exports:{}};return e[r](n,n.exports,i),n.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";i.r(r),i.d(r,{AdCom10DeviceTypes:()=>n.V5,AgentTypes:()=>n.ZV,BuildBanner:()=>u.BuildBanner,BuildBannerFromBid:()=>u.BuildBannerFromBid,BuildClickThroughUrl:()=>u.BuildClickThroughUrl,BuildNativeResponse:()=>u.BuildNativeResponse,BuildProductInfoFromElement:()=>u.BuildProductInfoFromElement,CollectN:()=>u.CollectN,CollectNAsync:()=>u.CollectNAsync,ContextSubTypes:()=>n.bU,ContextTypes:()=>n.Lp,DeserializeVast:()=>u.DeserializeVast,DeserializeVideo:()=>u.DeserializeVideo,DeviceMiddleware:()=>d.tX,DeviceOverrideService:()=>e.MM,Environment:()=>s.OH,EventTrackingMethods:()=>n.i_,EventTypes:()=>n.wf,GeoMiddlewareImmediate:()=>d.Fp,GeoOverrideService:()=>e.Dj,GetSafeUrl:()=>a.r,HttpStatus:()=>s.t3,HttpStatusClass:()=>s.DH,IPServices:()=>s.Ev,IdentityMiddleware:()=>d.Tw,LocalLoggerService:()=>e.L8,LocationType:()=>s.iF,LogLevel:()=>e.$b,NativeAssetId:()=>n.vU,NativeDataTypes:()=>n.Bz,NativeImageTypes:()=>n.qU,NativePosition:()=>n.JQ,NativeRequestBuilder:()=>n.Im,NativeResponseToProductInformation:()=>n.LO,NoBidResponseError:()=>l.e,PlacementTypes:()=>n.Ph,RenderAndBind:()=>a.V0,RenderTemplate:()=>a.N7,RequestBuilder:()=>u.RequestBuilder,SimpleBannerRequest:()=>u.SimpleBannerRequest,SurfColors:()=>s.$J,SurfsideBidderService:()=>e.j8,SurfsideConfigurationService:()=>e.Vh,SurfsideDeviceService:()=>e.td,SurfsideEventService:()=>e.N8,SurfsideGeoService:()=>e.I,SurfsideProductFeedService:()=>e.wh,SurfsideRecommenderService:()=>e.WX,SurfsideUserIDService:()=>e.RT,TryGetDeviceInfo:()=>e.EJ,UserOverrideService:()=>e.$9,VideoMimes:()=>n.JY,and:()=>u.and,array:()=>u.array,buildIdentityMiddleware:()=>d.NW,coalesce:()=>u.coalesce,eq:()=>u.eq,getNativeTemplateDelegateWindow:()=>a.TT,global:()=>u.global,initHandlebars:()=>a.fc,initSurfsideCore:()=>c,isIn:()=>u.isIn,join:()=>u.join,lower:()=>u.lower,or:()=>u.or,path:()=>u.path,search:()=>u.search,sed:()=>u.sed,slug:()=>u.slug,uri:()=>u.uri});var e=i(4545),t=i(3633),o=i.n(t),n=i(6131),l=i(110),s=i(8658),u=i(9730),a=i(9266),d=i(3957);function c(){const t=o().create(),i="true"===(r="surf_debug",null===(n=window.location.search.replace("?","").split("&").map((e=>e.split("="))).filter((e=>e[0]===r)).map((e=>e.length>1?e[1]:"true")))||void 0===n?void 0:n[0])?new e.L8(e.$b.DEBUG):void 0;var r,n;const l=new e.Vh("//r.surfside.io/",t,i),s=new e.I(i),u=new e.td(i),a=new e.RT(i),d=new e.j8("//bid.surfside.io/rtb/bids/surfside",l,s,u,a,i),c=new e.wh("//creative.surfside.io/",i);return{bidder:d,config:l,geo:s,productFeed:c,userId:a,recommender:new e.WX("//t.surfside.io/",c,i),events:new e.N8({lazyLoad:!0,src:"//cdn.surfside.io/sdk/1.0.0/edge.js"},i),device:u}}})(),r})()));
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export declare enum HttpStatus {
|
|
2
|
+
OK = 200,
|
|
3
|
+
NO_CONTENT = 204,
|
|
4
|
+
BAD_REQUEST = 400,
|
|
5
|
+
NOT_FOUND = 404,
|
|
6
|
+
UNAUTHORIZED = 401,
|
|
7
|
+
FORBIDDEN = 403
|
|
8
|
+
}
|
|
9
|
+
export declare enum HttpStatusClass {
|
|
10
|
+
SUCCESS = 2,
|
|
11
|
+
CLIENT_ERROR = 4,
|
|
12
|
+
SERVER_ERROR = 5
|
|
13
|
+
}
|
|
14
|
+
export declare enum SurfColors {
|
|
15
|
+
INDIGO = "#331c7a",
|
|
16
|
+
ULTRAMARINE = "#1f69ff",
|
|
17
|
+
AQUAMARINE = "#4ceaaa",
|
|
18
|
+
ELECTRIC_LIME = "#c5f700",
|
|
19
|
+
CRAYOLA = "#f7a800",
|
|
20
|
+
ORANGE = "#f66d18",
|
|
21
|
+
RED = "#e72024",
|
|
22
|
+
LAVENDER = "#c0abff",
|
|
23
|
+
ULTRA_RED = "#f97585",
|
|
24
|
+
SOFT_GOLD = "#f4bd5d",
|
|
25
|
+
MAGIC_MINT = "#baf7db",
|
|
26
|
+
SKY_BLUE = "#7eceeb",
|
|
27
|
+
CARIBBEAN_GREN = "#0dcc91",
|
|
28
|
+
LAVENDER_GRAY = "#d3d3e0"
|
|
29
|
+
}
|
|
30
|
+
export declare enum IPServices {
|
|
31
|
+
IP2LOCATION = 1,
|
|
32
|
+
NEUSTAR = 2,
|
|
33
|
+
MAXMIND = 3,
|
|
34
|
+
NETACUITY = 4
|
|
35
|
+
}
|
|
36
|
+
export declare enum LocationType {
|
|
37
|
+
GPS = 1,
|
|
38
|
+
IP = 2,
|
|
39
|
+
USER = 3
|
|
40
|
+
}
|
|
41
|
+
export declare enum Environment {
|
|
42
|
+
PROD = "PROD",
|
|
43
|
+
STAGING = "STAGING",
|
|
44
|
+
LOCAL = "LOCAL",
|
|
45
|
+
MOCK = "MOCK"
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CollectN';
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts the passed string to a slug with the specified options. By default, the slug is hyphenated and only
|
|
3
|
+
* contains alphanumeric characters. You can pass a different hyphenation regex and a different drop regex to
|
|
4
|
+
* customize the slug. For example, {{slug "My Product Name"}} will return "my-product-name".
|
|
5
|
+
*
|
|
6
|
+
* To change which characters are converted to hyphens, you can pass a regular expression to the hyphenate option.
|
|
7
|
+
* For example, {{slug "My Product's Name" hyphenate="[\s']"}} will return "my-product-s-name".
|
|
8
|
+
* The default hyphenate regex is /[\s_\-,]/ig.
|
|
9
|
+
*
|
|
10
|
+
* To remove characters instead of hyphenate them, you can pass a regular expression to the drop option.
|
|
11
|
+
* For example, {{slug "My Product's Name" drop="[^A-Za-z0-9\s']"}} will return "my-product's-name".
|
|
12
|
+
* The default drop regex is /[^A-Za-z0-9\-]/ig.
|
|
13
|
+
*
|
|
14
|
+
* To limit the max number of hyphenated slug components returned, you can pass a length option.
|
|
15
|
+
* For example, {{slug "My Product's Name" length=2}} will return "my-product".
|
|
16
|
+
* The default length is 5.
|
|
17
|
+
*
|
|
18
|
+
* @param name The string to be slugified
|
|
19
|
+
* @param options The options object. Can take "hypenate", "drop", and "length" options.
|
|
20
|
+
* @returns The slugified string
|
|
21
|
+
*/
|
|
22
|
+
export declare function slug(name: string, options: {
|
|
23
|
+
hash: {
|
|
24
|
+
hyphenate: string | undefined;
|
|
25
|
+
drop: string | undefined;
|
|
26
|
+
length: number | undefined;
|
|
27
|
+
};
|
|
28
|
+
}): string;
|
|
29
|
+
/**
|
|
30
|
+
* Converts the passed string to lowercase. For example, {{lower "My Product Name"}} will return "my product name".
|
|
31
|
+
*
|
|
32
|
+
* @param name The string to be converted to lowercase
|
|
33
|
+
* @returns A lowercase version of the passed string
|
|
34
|
+
*/
|
|
35
|
+
export declare function lower(name: string): string;
|
|
36
|
+
/**
|
|
37
|
+
* Returns the path component of the URL at the specified position, 1-indexed
|
|
38
|
+
* For example, if the URL is "https://example.com/foo/bar", {{path 1}} will return "foo".
|
|
39
|
+
*
|
|
40
|
+
* @param position The position of the path component to return, 1-indexed
|
|
41
|
+
* @returns The path component at the specified position
|
|
42
|
+
*/
|
|
43
|
+
export declare function path(position: number): string;
|
|
44
|
+
export declare function global(): any;
|
|
45
|
+
export declare function sed(input: string, searchRegex: string, replacement: string): string;
|
|
46
|
+
/**
|
|
47
|
+
* Returns the value of the specified query parameter from the URL, specified by key.
|
|
48
|
+
* For example, if the URL is "https://example.com?foo=bar", {{search "foo"}} will return "bar".
|
|
49
|
+
*
|
|
50
|
+
* @param name The name of the query parameter to return
|
|
51
|
+
* @returns The value of the query parameter, or an empty string if the parameter is not found
|
|
52
|
+
*/
|
|
53
|
+
export declare function search(name: string): string;
|
|
54
|
+
/**
|
|
55
|
+
* Returns the first truthy argument, or an empty string if all arguments are falsy. Returns false for empty strings
|
|
56
|
+
* For example, {{coalesce false (eq "b" "d") c}} will return "c", because false is falsy, "b" is not equal to "d",
|
|
57
|
+
* and c is truthy.
|
|
58
|
+
*
|
|
59
|
+
* @returns The first truthy argument, or an empty string if all arguments are falsy
|
|
60
|
+
*/
|
|
61
|
+
export declare function coalesce(): string;
|
|
62
|
+
/**
|
|
63
|
+
* Joins the passed arguments with the specified separator.
|
|
64
|
+
* For example, {{join "foo" "bar" "baz"}} will return "foo/bar/baz"..
|
|
65
|
+
*
|
|
66
|
+
* There is an optional "separator" argument that can be passed to change the separator. For example,
|
|
67
|
+
* {{join "foo" "bar" "baz" separator=","}} will return "foo,bar,baz".
|
|
68
|
+
*
|
|
69
|
+
* @returns The joined string
|
|
70
|
+
*/
|
|
71
|
+
export declare function join(): string;
|
|
72
|
+
/**
|
|
73
|
+
* Encodes the passed string for use in a URI component.
|
|
74
|
+
*
|
|
75
|
+
* @param component The string to encode
|
|
76
|
+
* @returns The encoded string, or an empty string if the component is falsy
|
|
77
|
+
*/
|
|
78
|
+
export declare function uri(component: string): string;
|
|
79
|
+
/**
|
|
80
|
+
* Returns true if the two passed arguments are equal (using javascript ===), false otherwise.
|
|
81
|
+
*
|
|
82
|
+
* @param a The first argument
|
|
83
|
+
* @param b The second argument
|
|
84
|
+
* @returns True if the two arguments are equal, false otherwise
|
|
85
|
+
*/
|
|
86
|
+
export declare function eq(a: any, b: any): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Returns true if either of the passed arguments are truthy, false otherwise.
|
|
89
|
+
*
|
|
90
|
+
* @param a The first argument
|
|
91
|
+
* @param b The second argument
|
|
92
|
+
* @returns True if either of the arguments are truthy, false otherwise
|
|
93
|
+
*/
|
|
94
|
+
export declare function or(a: any, b: any): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Returns true if both of the passed arguments are truthy, false otherwise.
|
|
97
|
+
*
|
|
98
|
+
* @param a The first argument
|
|
99
|
+
* @param b The second argument
|
|
100
|
+
* @returns True if both of the arguments are truthy, false otherwise
|
|
101
|
+
*/
|
|
102
|
+
export declare function and(a: any, b: any): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Returns true if the first argument is in the second argument (an array). Otherwise, returns false.
|
|
105
|
+
* If the second argument is not an array, or the array is empty, this will return false.
|
|
106
|
+
*
|
|
107
|
+
* The name of the helper is "in" but the name of the function is "isIn" because "in" is a reserved word in javascript.
|
|
108
|
+
*
|
|
109
|
+
* @param a The value to check
|
|
110
|
+
* @param b The array to check against
|
|
111
|
+
* @returns True if the value is in the array, false otherwise
|
|
112
|
+
*/
|
|
113
|
+
export declare function isIn(a: any, b: any[]): boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Returns an array of the passed arguments. Useful with the "in" helper
|
|
116
|
+
*
|
|
117
|
+
* @returns An array of the passed arguments
|
|
118
|
+
*/
|
|
119
|
+
export declare function array(): any[];
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { IApp, IBanner, IBidRequest, IDevice, IImp, INative, IRegs, ISite, IUser, IVideo } from '../../models';
|
|
2
|
+
declare enum BuilderCreativeType {
|
|
3
|
+
BANNER = 0,
|
|
4
|
+
VIDEO = 1,
|
|
5
|
+
NATIVE = 2
|
|
6
|
+
}
|
|
7
|
+
interface IBuilderState<T, U> {
|
|
8
|
+
currentCreative: T;
|
|
9
|
+
type: U;
|
|
10
|
+
imp: IImp;
|
|
11
|
+
}
|
|
12
|
+
export interface IBannerBuilderState extends IBuilderState<IBanner, BuilderCreativeType.BANNER> {
|
|
13
|
+
}
|
|
14
|
+
export interface IVideoBuilderState extends IBuilderState<IVideo, BuilderCreativeType.VIDEO> {
|
|
15
|
+
}
|
|
16
|
+
export interface INativeBuilderState extends IBuilderState<INative, BuilderCreativeType.NATIVE> {
|
|
17
|
+
}
|
|
18
|
+
/** Builds an OpenRTB 2.6 bid request */
|
|
19
|
+
export declare class RequestBuilder {
|
|
20
|
+
private readonly _request;
|
|
21
|
+
private _builderState;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param id The ID of the request. If not provided, a random ID will be generated.
|
|
25
|
+
*/
|
|
26
|
+
constructor(id?: string);
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @returns The built bid request
|
|
30
|
+
*/
|
|
31
|
+
build(): IBidRequest;
|
|
32
|
+
/**
|
|
33
|
+
* Adds surfside-specific information to the top level bid request and all subsequent impression objects
|
|
34
|
+
* @param accountId The account ID of the current store
|
|
35
|
+
* @param siteId The site ID of the current store
|
|
36
|
+
* @param locationId The location ID of the current store (i.e: the ID of the specific brick and mortar store)
|
|
37
|
+
* @param zoneId The ID for the zone on the advertisement
|
|
38
|
+
* @param channelId The channel ID being advertised on
|
|
39
|
+
* @param keywords A set of keywords describing the content of the page.
|
|
40
|
+
* @returns The builder instance
|
|
41
|
+
*/
|
|
42
|
+
withSurfContext(accountId: string, siteId: string, locationId: string, zoneId: string, channelId?: string, keywords?: string[]): this;
|
|
43
|
+
/**
|
|
44
|
+
* Adds a banner impression to the request. If a creative is already being built,
|
|
45
|
+
* it will be appended to the request.
|
|
46
|
+
* @param w The width of the banner being requested
|
|
47
|
+
* @param h The height of the banner being requested
|
|
48
|
+
* @param options Other OpenRTB fields to include in the banner object.
|
|
49
|
+
* @returns The builder instance
|
|
50
|
+
*/
|
|
51
|
+
withBanner(w: number, h: number, options?: Partial<IBanner>): this;
|
|
52
|
+
/**
|
|
53
|
+
* Adds a video impression to the request. If a create is already being built,
|
|
54
|
+
* it will be appended to the request
|
|
55
|
+
* @param w The width of the video being requested
|
|
56
|
+
* @param h The height of the video being requested
|
|
57
|
+
* @param minduration The minimum duration of the video, in seconds
|
|
58
|
+
* @param maxduration The maximum duration of the video, in seconds
|
|
59
|
+
* @param mimes A list of MIME types supported by the video. Defaults to ['video/mp4', 'video/webm']
|
|
60
|
+
* @param options Other OpenRTB fields to include in the video object
|
|
61
|
+
* @returns The builder instance
|
|
62
|
+
*/
|
|
63
|
+
withVideo(w: number, h: number, minduration: number, maxduration: number, mimes?: string[], options?: Partial<IVideo>): this;
|
|
64
|
+
/**
|
|
65
|
+
* Adds a native impression to the request. If a creative is already being built,
|
|
66
|
+
* it will be appended to the request. Native requests are stringified JSON objects
|
|
67
|
+
* in the OpenRTB Native 1.2 format. Use the NativeRequestBuilder to build these objects.
|
|
68
|
+
* @param request The native request object, as a stringified JSON object
|
|
69
|
+
* @param options Other OpenRTB fields to include in the native object
|
|
70
|
+
* @returns The builder instance
|
|
71
|
+
*/
|
|
72
|
+
withNative(request: string, options?: Partial<INative>): this;
|
|
73
|
+
/**
|
|
74
|
+
* Sets the bid floor on the current impression. This operates on each impression,
|
|
75
|
+
* so it needs to be called again for each impression if multiple are present.
|
|
76
|
+
* @param bidfloor The bid floor to set
|
|
77
|
+
* @param bidfloorcur The currency of the bid floor. Defaults to 'USD'
|
|
78
|
+
* @returns The builder instance
|
|
79
|
+
*/
|
|
80
|
+
withBidFloor(bidfloor: number, bidfloorcur?: string): this;
|
|
81
|
+
/**
|
|
82
|
+
* Adds an extension to the current impression. Extensions are dynamically typed dictionaries
|
|
83
|
+
* with options that are specific to the bidder. This operates on each impression, so it needs
|
|
84
|
+
* to be called again for each impression if multiple are present.
|
|
85
|
+
* @param ext The extension to add
|
|
86
|
+
* @returns The builder instance
|
|
87
|
+
*/
|
|
88
|
+
withImpExt(ext: any): this;
|
|
89
|
+
/**
|
|
90
|
+
* The site that the ad appears on.
|
|
91
|
+
* @param site The site object. If not provided, a default site object will be created using the current hostname.
|
|
92
|
+
* @returns The builder instance
|
|
93
|
+
*/
|
|
94
|
+
withSite(site?: ISite): this;
|
|
95
|
+
/**
|
|
96
|
+
* The app that the ad appears in.
|
|
97
|
+
* @param app The app object. If not provided, a default app object will be created using the current hostname.
|
|
98
|
+
* @returns The builder instance
|
|
99
|
+
*/
|
|
100
|
+
withApp(app?: IApp): this;
|
|
101
|
+
/**
|
|
102
|
+
* Information about the current user's device, including useragent, IP, make and model as well as geo information.
|
|
103
|
+
* @param device The device object
|
|
104
|
+
* @returns The builder instance
|
|
105
|
+
*/
|
|
106
|
+
withDevice(device: IDevice): this;
|
|
107
|
+
/**
|
|
108
|
+
* Information about the current user. Geo information can be included here, but is different
|
|
109
|
+
* from the device's geo information; this is the user's home location.
|
|
110
|
+
* @param user The user object
|
|
111
|
+
* @returns The builder instance
|
|
112
|
+
*/
|
|
113
|
+
withUser(user: IUser): this;
|
|
114
|
+
/**
|
|
115
|
+
* Used if any data privacy regulations are relevant to the request (i.e: COPPA, GDPR, etc.)
|
|
116
|
+
* @param regs The regs object
|
|
117
|
+
* @returns The builder instance
|
|
118
|
+
*/
|
|
119
|
+
withRegulations(regs: IRegs): this;
|
|
120
|
+
private _appendBuilderState;
|
|
121
|
+
private _appendImpression;
|
|
122
|
+
private _generateId;
|
|
123
|
+
}
|
|
124
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { IApp, IBidRequest, IDevice, IImp, IRegs, ISite, ISource, IUser } from '../../models';
|
|
2
|
+
export declare class SimpleBannerRequest implements IBidRequest {
|
|
3
|
+
id: string;
|
|
4
|
+
imp: IImp[];
|
|
5
|
+
site?: ISite | undefined;
|
|
6
|
+
app?: IApp | undefined;
|
|
7
|
+
device?: IDevice | undefined;
|
|
8
|
+
user?: IUser | undefined;
|
|
9
|
+
test?: number | undefined;
|
|
10
|
+
at?: number | undefined;
|
|
11
|
+
tmax?: number | undefined;
|
|
12
|
+
wseat?: string[] | undefined;
|
|
13
|
+
bseat?: string[] | undefined;
|
|
14
|
+
allimps?: number | undefined;
|
|
15
|
+
cur?: string[] | undefined;
|
|
16
|
+
wlang?: string[] | undefined;
|
|
17
|
+
wlangb?: string[] | undefined;
|
|
18
|
+
bcat?: string[] | undefined;
|
|
19
|
+
cattax?: number[] | undefined;
|
|
20
|
+
badv?: string[] | undefined;
|
|
21
|
+
bapp?: string[] | undefined;
|
|
22
|
+
source?: ISource | undefined;
|
|
23
|
+
regs?: IRegs | undefined;
|
|
24
|
+
ext?: any;
|
|
25
|
+
constructor(id: string, w: number, h: number);
|
|
26
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IBid, IBidResponse, ICompiledPublisherConfiguration, IProductInformation } from '../../models';
|
|
2
|
+
interface IBuiltBanner {
|
|
3
|
+
element: HTMLDivElement | null;
|
|
4
|
+
product: IProductInformation | null;
|
|
5
|
+
clickThrough: string | null;
|
|
6
|
+
}
|
|
7
|
+
export declare function BuildBanner(response: IBidResponse | null, config?: ICompiledPublisherConfiguration): IBuiltBanner;
|
|
8
|
+
export declare function BuildBannerFromBid(bid: IBid): HTMLDivElement | null;
|
|
9
|
+
export declare function BuildProductInfoFromElement(element: HTMLDivElement): IProductInformation | null;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type IBidResponse, type ICompiledPublisherConfiguration, type INativeResponse } from '../../models';
|
|
2
|
+
import { ILoggerService, type IProductFeedService } from '../../services';
|
|
3
|
+
export interface ITrackers {
|
|
4
|
+
pixels: string[];
|
|
5
|
+
js: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface IBuiltNative {
|
|
8
|
+
data: INativeResponse;
|
|
9
|
+
clickThrough: string;
|
|
10
|
+
winUrl: string;
|
|
11
|
+
trackers: ITrackers;
|
|
12
|
+
element?: Element;
|
|
13
|
+
}
|
|
14
|
+
export interface IPublisherContext {
|
|
15
|
+
config: ICompiledPublisherConfiguration;
|
|
16
|
+
productService: IProductFeedService;
|
|
17
|
+
accountId: string;
|
|
18
|
+
siteId: string;
|
|
19
|
+
locationId: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function BuildNativeResponse(response: IBidResponse | null, context?: IPublisherContext, logger?: ILoggerService): Promise<IBuiltNative[]>;
|
|
File without changes
|