@brainfish-ai/widgets-initiator 1.22.2 → 1.23.0
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.
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type UserIdentifyPayload = {
|
|
2
|
+
userId: string;
|
|
3
|
+
firstName?: string;
|
|
4
|
+
lastName?: string;
|
|
5
|
+
email?: string;
|
|
6
|
+
phone?: string;
|
|
7
|
+
avatar?: string;
|
|
8
|
+
properties?: Record<string, unknown>;
|
|
9
|
+
};
|
|
10
|
+
export declare function registerWidgetHost(widgetHost: string): void;
|
|
11
|
+
export declare function pushUserIdentifyToIframes(payload: UserIdentifyPayload): void;
|
|
12
|
+
/**
|
|
13
|
+
* Register an agent iframe created during widget init. Identity is pushed on
|
|
14
|
+
* load and on every subsequent identify() call until the registration is removed.
|
|
15
|
+
*/
|
|
16
|
+
export declare function registerBrainfishIframe(iframe: HTMLIFrameElement, widgetHost: string, options?: {
|
|
17
|
+
signal?: AbortSignal;
|
|
18
|
+
}): void;
|
|
19
|
+
export declare function unregisterBrainfishIframe(iframe: HTMLIFrameElement): void;
|
|
20
|
+
export declare function ensureIdentityListener(): void;
|
|
21
|
+
export declare function normalizeIdentifyPayload(userData: Record<string, unknown>): UserIdentifyPayload | null;
|
|
22
|
+
/**
|
|
23
|
+
* Stores identity on the host page and delivers it to agent iframes.
|
|
24
|
+
* Returns the normalized payload for analytics, or null if invalid.
|
|
25
|
+
*/
|
|
26
|
+
export declare function setUserIdentity(userData: Record<string, unknown>): UserIdentifyPayload | null;
|
|
27
|
+
export declare function getLatestIdentifyPayload(): UserIdentifyPayload | null;
|
|
28
|
+
/**
|
|
29
|
+
* Wraps window.BrainfishAnalytics so direct callers of
|
|
30
|
+
* BrainfishAnalytics('identify', payload) also deliver identity to agent
|
|
31
|
+
* iframes. The wrapper re-applies whenever the global is reassigned (the
|
|
32
|
+
* web-tracker CDN script replaces the bootstrap queue function on load).
|
|
33
|
+
*/
|
|
34
|
+
export declare function installBrainfishAnalyticsIdentityHook(): void;
|
|
35
|
+
/** @internal Test helper */
|
|
36
|
+
export declare function resetUserIdentityState(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/web.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,a=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,s=(e,t)=>{for(var n in t||(t={}))i.call(t,n)&&a(e,n,t[n]);if(o)for(var n of o(t))r.call(t,n)&&a(e,n,t[n]);return e},c=(e,o)=>t(e,n(o)),l=(e,t,n)=>a(e,"symbol"!=typeof t?t+"":t,n),d=(e,t,n)=>new Promise((o,i)=>{var r=e=>{try{s(n.next(e))}catch(t){i(t)}},a=e=>{try{s(n.throw(e))}catch(t){i(t)}},s=e=>e.done?o(e.value):Promise.resolve(e.value).then(r,a);s((n=n.apply(e,t)).next())});!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a4b092d2-8912-46d2-86e8-cdff75106526",e._sentryDebugIdIdentifier="sentry-dbid-a4b092d2-8912-46d2-86e8-cdff75106526")}catch(n){}}(),Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),new TextEncoder;const u=new TextDecoder;const f=e=>{let t=e;t instanceof Uint8Array&&(t=u.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n})(t)}catch(n){throw new TypeError("The input to be decoded is not correctly encoded.")}};function p(e){let t;if("string"==typeof e){const n=e.split(".");3!==n.length&&5!==n.length||([t]=n)}else if("object"==typeof e&&e){if(!("protected"in e))throw new TypeError("Token does not contain a Protected Header");t=e.protected}try{if("string"!=typeof t||!t)throw new Error;const e=JSON.parse(u.decode(f(t)));if(!function(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}(e))throw new Error;return e}catch(n){throw new TypeError("Invalid Token or Protected Header formatting")}}var h,g,m,b;("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"web-widget@1.22.2"},(g=h||(h={})).Sidebar="sidebar",g.Searchbar="searchbar",g.Popup="popup",h.Sidebar,h.Searchbar,h.Popup;class y extends Error{constructor(e,t){super(e,t),l(this,"cause"),this.name="BrainfishWidgetError",this.cause=null==t?void 0:t.cause,Error.captureStackTrace&&Error.captureStackTrace(this,y),this.cause instanceof Error&&this.cause.stack&&(this.stack=this.stack+"\nCaused by: "+this.cause.stack)}toJSON(){return{name:this.name,message:this.message,stack:this.stack,cause:this.cause instanceof Error?{name:this.cause.name,message:this.cause.message,stack:this.cause.stack}:this.cause}}}(b=m||(m={})).LINK="link",b.CALLBACK="callback",b.EMAIL="email",b.PHONE="phone";const v=(e,t,n,o)=>{let i=n,r={};if(t instanceof Error)try{r=JSON.parse(t.message),i+=` - ${r.message||t.message}`}catch(a){i+=` - ${t.message}`}else i+=` - ${String(t)}`;((e,t,n)=>{if(!navigator||navigator.userAgent.toLowerCase().includes("headless"))return;const o=t.toJSON(),i=e||"https://app.brainfi.sh",r={error:`WebWidgetVersion: 1.22.2. ${t.message}`,stack:t.stack,cause:{message:o.message,stack:o.stack,cause:o.cause}};fetch(`${i}/api/trackError.widget.create`,{method:"POST",headers:{"Content-Type":"application/json","api-key":n},body:JSON.stringify(r)})})(e,new y(i,{cause:r}),o)};const w=e=>d(null,[e],function*({widgetKey:e,apiHost:t}){return function(e,t,n){return d(this,null,function*(){let o,i=0;for(;i<3;)try{const o=yield fetch(`${e}${t}`,{method:"POST",headers:{"Content-Type":"application/json","api-key":n}});if(!o.ok)throw new Error(`API call failed with status: ${o.status}`);const i=yield o.json();if(!i)throw new Error("Error loading config: empty response");return i}catch(r){if(o=r,i++,i>=3)throw v(e,r,"Error fetching config",n),o;yield new Promise(e=>setTimeout(e,500))}})}(t,"/api/searchWidgets.getConfigByKey",e)}),x=({config:e,apiKey:t,apiHost:n})=>{const o=e.settings||{};return["bodyActionButtons","footerActionButtons","nextBestActions"].forEach(e=>{o[e]&&(o[e]=o[e].map(e=>e.type===m.CALLBACK&&e.value?c(s({},e),{value:new Function(`return ${e.value}`)()}):e))}),c(s({},e),{settings:o,apiHost:n,widgetMode:e.widgetType,apiKey:t})},S=e=>(null==e?void 0:e.apiHost)||"https://app.brainfi.sh",C=e=>d(null,[e],function*({apiHost:e,widgetKey:t,version:n}){try{const e=`https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${n}/dist/web.js`,t=yield(e=>d(null,null,function*(){return document.getElementById("brainfish-widget")?window.Brainfish:new Promise((t,n)=>{const o=document.createElement("script");o.id="brainfish-widget",o.src=e,o.type="module",o.async=!0,o.crossOrigin="anonymous",o.onload=()=>{setTimeout(()=>{const e=window.Brainfish;e?t(e):n(new Error("Failed to load Brainfish module"))},200)},o.onerror=t=>{const o=t,i={message:`Failed to load script: ${e}`,type:o.type,fileName:o.filename,lineNumber:o.lineno,columnNumber:o.colno,error:o.error?o.error.toString():"Unknown error"};n(new Error(JSON.stringify(i)))},document.head.appendChild(o)})}))(e);return{widget:t}}catch(o){Math.random()<.05&&v(e,o,o.message,t)}});const k=new Set,E=(e,t)=>d(null,null,function*(){const n=S(e.overrides);try{if(k.has(e.widgetKey))return;const o=yield C({apiHost:n,widgetKey:e.widgetKey,version:t.version||"latest"});if(o){const{widget:i}=o,r=x({config:t,apiKey:e.widgetKey,apiHost:n});return e.overrides&&t.settings&&Object.entries(e.overrides).forEach(([e,n])=>{t.settings&&e in t.settings&&(t.settings[e]=((e=[],t)=>{const n=new Map(e.map(e=>[e.label,e]));return t.forEach(e=>n.set(e.label,e)),Array.from(n.values())})(t.settings[e],n))}),function(e,t){t.widgetType===h.Searchbar||"Search"===t.widgetType?e.SearchWidget.initStandard(t):e.HelpWidget.initPopup(t)}(i,r),k.add(e.widgetKey),i}}catch(o){v(n,o,o.message,e.widgetKey)}}),I=()=>{try{if("undefined"==typeof window||!("localStorage"in window)||null===window.localStorage)return!1;const e="__brainfish_storage_test__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&"QuotaExceededError"===e.name}},L=e=>{try{if(I())return window.localStorage.getItem(e)}catch(t){}return null},W=e=>{try{I()&&window.localStorage.removeItem(e)}catch(t){}};let T=!1;const M=(e,t,n,...o)=>d(null,[e,t,n,...o],function*(e,t,n,o="",i=!1,r){if(t||void 0!==console.warn&&console.warn("[Brainfish] BrainfishAnalytics not initialized. Access key is required."),!T)try{const a=(()=>{if("undefined"==typeof window||"undefined"==typeof navigator)return!1;const e=navigator,t=window,n=(e.doNotTrack||t.doNotTrack||e.msDoNotTrack||"0").toString().toLowerCase();return["1","yes","true"].includes(n)})(),s="true"===L("bf_tracking_disabled"),c=a||s;window.BrainfishAnalytics("init",{apiUrl:o,accessKey:t,trackScreenViews:!0,trackAttributes:!c,trackOutgoingLinks:!c,enableRecording:!c&&i,recordingOptions:r}),T=!0,yield((e,t)=>d(null,null,function*(){return document.getElementById("brainfish-analytics")?window.BrainfishAnalytics:new Promise(n=>{const o=document.createElement("script");o.id="brainfish-analytics",o.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/web-tracker@latest/dist/tracker.js",o.type="module",o.async=!0,o.crossOrigin="anonymous",o.onload=()=>{setTimeout(()=>{n(window.BrainfishAnalytics)},200)},o.onerror=()=>{Math.random()<.05&&v(e,new Error(`Failed to load script: ${o.src}`),`Failed to load script: ${o.src}`,t),n(void 0)},document.head.appendChild(o)})}))(n,e)}catch(a){v(n,a,"Failed to initialize BrainfishAnalytics",e)}});function _(e){const t=(new TextEncoder).encode(e);if("undefined"!=typeof window&&"function"==typeof window.btoa){const e=Array.from(t,e=>String.fromCharCode(e)).join("");return btoa(e)}if("undefined"!=typeof Buffer)return Buffer.from(t).toString("base64");throw new Error("[utils.base64Encode]: Unsupported environment")}const A=e=>{if("undefined"!=typeof window&&"function"==typeof window.atob){const t=atob(e),n=t.length,o=new Uint8Array(n);for(let e=0;e<n;e++)o[e]=t.charCodeAt(e);return(new TextDecoder).decode(o)}if("undefined"!=typeof Buffer)return Buffer.from(e,"base64").toString("utf-8");throw new Error("[utils.base64Decode]: Unsupported environment")};function O(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var P,R={exports:{}},B={exports:{}},F={exports:{}};function V(){return P||(P=1,function(e,t){function n(e){return Math.round(255*e)}function o(e,t,o){return n(e)+","+n(t)+","+n(o)}t.__esModule=!0,t.default=void 0,t.default=function(e,t,n,i){if(void 0===i&&(i=o),0===t)return i(n,n,n);var r=(e%360+360)%360/60,a=(1-Math.abs(2*n-1))*t,s=a*(1-Math.abs(r%2-1)),c=0,l=0,d=0;r>=0&&r<1?(c=a,l=s):r>=1&&r<2?(c=s,l=a):r>=2&&r<3?(l=a,d=s):r>=3&&r<4?(l=s,d=a):r>=4&&r<5?(c=s,d=a):r>=5&&r<6&&(c=a,d=s);var u=n-a/2;return i(c+u,l+u,d+u)},e.exports=t.default}(F,F.exports)),F.exports}var j,N={exports:{}};function H(){return j||(j=1,function(e,t){t.__esModule=!0,t.default=void 0;var n={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};t.default=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return n[t]?"#"+n[t]:e},e.exports=t.default}(N,N.exports)),N.exports}var Z,D,G,z={exports:{}};function Y(){return Z||(Z=1,function(e,t){function n(e){var t="function"==typeof Map?new Map:void 0;return n=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(o())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var a=new(e.bind.apply(e,r));return n&&i(a,n.prototype),a}(e,arguments,r(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),i(n,e)},n(e)}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!e})()}function i(e,t){return(i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}t.__esModule=!0,t.default=void 0;var a={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found and no default was provided.\n\n",75:"important requires a valid style object, got a %s instead.\n\n",76:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",77:'remToPx expects a value in "rem" but you provided it in "%s".\n\n',78:'base must be set in "px" or "%" but you set it in "%s".\n'};function s(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o,i=t[0],r=[];for(o=1;o<t.length;o+=1)r.push(t[o]);return r.forEach(function(e){i=i.replace(/%[a-z]/,e)}),i}t.default=function(e){var t,n;function o(t){var n;if("production"===process.env.NODE_ENV)n=e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+t+" for more information.")||this;else{for(var o=arguments.length,i=new Array(o>1?o-1:0),r=1;r<o;r++)i[r-1]=arguments[r];n=e.call(this,s.apply(void 0,[a[t]].concat(i)))||this}return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n)}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,i(t,n),o}(n(Error)),e.exports=t.default}(z,z.exports)),z.exports}function $(){return D||(D=1,function(e,t){t.__esModule=!0,t.default=function(e){if("string"!=typeof e)throw new i.default(3);var t=(0,o.default)(e);if(t.match(a))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(s)){var r=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:r}}if(t.match(c))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(l)){var h=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:h}}var g=d.exec(t);if(g)return{red:parseInt(""+g[1],10),green:parseInt(""+g[2],10),blue:parseInt(""+g[3],10)};var m=u.exec(t.substring(0,50));if(m)return{red:parseInt(""+m[1],10),green:parseInt(""+m[2],10),blue:parseInt(""+m[3],10),alpha:parseFloat(""+m[4])>1?parseFloat(""+m[4])/100:parseFloat(""+m[4])};var b=f.exec(t);if(b){var y=parseInt(""+b[1],10),v=parseInt(""+b[2],10)/100,w=parseInt(""+b[3],10)/100,x="rgb("+(0,n.default)(y,v,w)+")",S=d.exec(x);if(!S)throw new i.default(4,t,x);return{red:parseInt(""+S[1],10),green:parseInt(""+S[2],10),blue:parseInt(""+S[3],10)}}var C=p.exec(t.substring(0,50));if(C){var k=parseInt(""+C[1],10),E=parseInt(""+C[2],10)/100,I=parseInt(""+C[3],10)/100,L="rgb("+(0,n.default)(k,E,I)+")",W=d.exec(L);if(!W)throw new i.default(4,t,L);return{red:parseInt(""+W[1],10),green:parseInt(""+W[2],10),blue:parseInt(""+W[3],10),alpha:parseFloat(""+C[4])>1?parseFloat(""+C[4])/100:parseFloat(""+C[4])}}throw new i.default(5)};var n=r(V()),o=r(H()),i=r(Y());function r(e){return e&&e.__esModule?e:{default:e}}var a=/^#[a-fA-F0-9]{6}$/,s=/^#[a-fA-F0-9]{8}$/,c=/^#[a-fA-F0-9]{3}$/,l=/^#[a-fA-F0-9]{4}$/,d=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,u=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,f=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,p=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;e.exports=t.default}(B,B.exports)),B.exports}function X(){return G||(G=1,function(e,t){t.__esModule=!0,t.default=function(e){if("transparent"===e)return 0;var t=(0,o.default)(e),n=Object.keys(t).map(function(e){var n=t[e]/255;return n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}),i=n[0],r=n[1],a=n[2];return parseFloat((.2126*i+.7152*r+.0722*a).toFixed(3))};var n,o=(n=$())&&n.__esModule?n:{default:n};e.exports=t.default}(R,R.exports)),R.exports}const J=O(X());var K,U={exports:{}},q={exports:{}};function Q(){return K||(K=1,function(e,t){function n(e,t,o){return function(){var i=o.concat(Array.prototype.slice.call(arguments));return i.length>=t?e.apply(this,i):n(e,t,i)}}t.__esModule=!0,t.default=function(e){return n(e,e.length,[])},e.exports=t.default}(q,q.exports)),q.exports}var ee,te={exports:{}};function ne(){return ee||(ee=1,e=te,(t=te.exports).__esModule=!0,t.default=void 0,t.default=function(e,t,n){return Math.max(e,Math.min(t,n))},e.exports=t.default),te.exports;var e,t}var oe,ie,re={exports:{}},ae={exports:{}};function se(){return oe||(oe=1,e=ae,(t=ae.exports).__esModule=!0,t.default=void 0,t.default=function(e){var t,n=e.red/255,o=e.green/255,i=e.blue/255,r=Math.max(n,o,i),a=Math.min(n,o,i),s=(r+a)/2;if(r===a)return void 0!==e.alpha?{hue:0,saturation:0,lightness:s,alpha:e.alpha}:{hue:0,saturation:0,lightness:s};var c=r-a,l=s>.5?c/(2-r-a):c/(r+a);switch(r){case n:t=(o-i)/c+(o<i?6:0);break;case o:t=(i-n)/c+2;break;default:t=(n-o)/c+4}return t*=60,void 0!==e.alpha?{hue:t,saturation:l,lightness:s,alpha:e.alpha}:{hue:t,saturation:l,lightness:s}},e.exports=t.default),ae.exports;var e,t}function ce(){return ie||(ie=1,function(e,t){t.__esModule=!0,t.default=function(e){return(0,o.default)((0,n.default)(e))};var n=i($()),o=i(se());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(re,re.exports)),re.exports}var le,de={exports:{}},ue={exports:{}},fe={exports:{}},pe={exports:{}};function he(){return le||(le=1,function(e,t){t.__esModule=!0,t.default=void 0;t.default=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e},e.exports=t.default}(pe,pe.exports)),pe.exports}var ge,me,be,ye={exports:{}};function ve(){return ge||(ge=1,e=ye,(t=ye.exports).__esModule=!0,t.default=void 0,t.default=function(e){var t=e.toString(16);return 1===t.length?"0"+t:t},e.exports=t.default),ye.exports;var e,t}function we(){return me||(me=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=r(V()),o=r(he()),i=r(ve());function r(e){return e&&e.__esModule?e:{default:e}}function a(e){return(0,i.default)(Math.round(255*e))}function s(e,t,n){return(0,o.default)("#"+a(e)+a(t)+a(n))}t.default=function(e,t,o){return(0,n.default)(e,t,o,s)},e.exports=t.default}(fe,fe.exports)),fe.exports}function xe(){return be||(be=1,function(e,t){t.__esModule=!0,t.default=function(e,t,i){if("number"==typeof e&&"number"==typeof t&&"number"==typeof i)return(0,n.default)(e,t,i);if("object"==typeof e&&void 0===t&&void 0===i)return(0,n.default)(e.hue,e.saturation,e.lightness);throw new o.default(1)};var n=i(we()),o=i(Y());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(ue,ue.exports)),ue.exports}var Se,Ce={exports:{}};function ke(){return Se||(Se=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r,a){if("number"==typeof e&&"number"==typeof t&&"number"==typeof r&&"number"==typeof a)return a>=1?(0,n.default)(e,t,r):"rgba("+(0,o.default)(e,t,r)+","+a+")";if("object"==typeof e&&void 0===t&&void 0===r&&void 0===a)return e.alpha>=1?(0,n.default)(e.hue,e.saturation,e.lightness):"rgba("+(0,o.default)(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new i.default(2)};var n=r(we()),o=r(V()),i=r(Y());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ce,Ce.exports)),Ce.exports}var Ee,Ie={exports:{}};function Le(){return Ee||(Ee=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r){if("number"==typeof e&&"number"==typeof t&&"number"==typeof r)return(0,n.default)("#"+(0,o.default)(e)+(0,o.default)(t)+(0,o.default)(r));if("object"==typeof e&&void 0===t&&void 0===r)return(0,n.default)("#"+(0,o.default)(e.red)+(0,o.default)(e.green)+(0,o.default)(e.blue));throw new i.default(6)};var n=r(he()),o=r(ve()),i=r(Y());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ie,Ie.exports)),Ie.exports}var We,Te,Me,_e={exports:{}};function Ae(){return We||(We=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r,a){if("string"==typeof e&&"number"==typeof t){var s=(0,n.default)(e);return"rgba("+s.red+","+s.green+","+s.blue+","+t+")"}if("number"==typeof e&&"number"==typeof t&&"number"==typeof r&&"number"==typeof a)return a>=1?(0,o.default)(e,t,r):"rgba("+e+","+t+","+r+","+a+")";if("object"==typeof e&&void 0===t&&void 0===r&&void 0===a)return e.alpha>=1?(0,o.default)(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new i.default(7)};var n=r($()),o=r(Le()),i=r(Y());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(_e,_e.exports)),_e.exports}function Oe(){return Te||(Te=1,function(e,t){t.__esModule=!0,t.default=function(e){if("object"!=typeof e)throw new a.default(8);if(l(e))return(0,r.default)(e);if(c(e))return(0,i.default)(e);if(u(e))return(0,o.default)(e);if(d(e))return(0,n.default)(e);throw new a.default(8)};var n=s(xe()),o=s(ke()),i=s(Le()),r=s(Ae()),a=s(Y());function s(e){return e&&e.__esModule?e:{default:e}}var c=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)},l=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha},d=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)},u=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha};e.exports=t.default}(de,de.exports)),de.exports}function Pe(){return Me||(Me=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(Q()),o=a(ne()),i=a(ce()),r=a(Oe());function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}var c=(0,n.default)(function(e,t){if("transparent"===t)return t;var n=(0,i.default)(t);return(0,r.default)(s({},n,{lightness:(0,o.default)(0,1,n.lightness-parseFloat(e))}))});t.default=c,e.exports=t.default}(U,U.exports)),U.exports}const Re=O(Pe());var Be,Fe={exports:{}};function Ve(){return Be||(Be=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(Q()),o=a(ne()),i=a(ce()),r=a(Oe());function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}var c=(0,n.default)(function(e,t){if("transparent"===t)return t;var n=(0,i.default)(t);return(0,r.default)(s({},n,{lightness:(0,o.default)(0,1,n.lightness+parseFloat(e))}))});t.default=c,e.exports=t.default}(Fe,Fe.exports)),Fe.exports}const je=O(Ve()),Ne="bf-iframe-container",He="bf-trigger-button",Ze="bf-search-bar-iframe-container",De="bf-search-bar-iframe-backdrop";function Ge(e){var t,n;if(!document.querySelector("style[data-widget-styles]")){!function(e="#000",t="FFF"){const n=document.createElement("style");n.attributes.setNamedItem(document.createAttribute("data-widget-styles"));const o=J(e)>.5;n.textContent=`\n .bf-trigger-button{position:fixed;bottom:16px;right:16px;width:36px;height:36px;border-radius:50%;border:none;box-shadow:0 1px 6px #0000000f,0 2px 32px #00000029;transition:transform 167ms cubic-bezier(.33,0,0,1);box-sizing:content-box;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:1000;padding:12px;gap:10px;overflow:hidden}.bf-trigger-button.hidden{display:none}.trigger-button-icon{display:flex;align-items:center;justify-content:center;width:36px;height:36px;position:relative}.trigger-button-icon svg{width:100%;height:100%;position:absolute;inset:0}.trigger-button-icon>svg>path{transition:transform .3s ease,opacity .3s ease;transform:scale(.5);transform-origin:center;opacity:0}.trigger-button-icon .fish-icon{display:none}.trigger-button-icon .fish-icon.visible{display:block;max-width:36px;max-height:36px}.trigger-button-icon svg.visible{display:block}.trigger-button-icon>svg.visible>path{opacity:1;transform:scale(1)}.trigger-iframe{position:relative;width:100%;height:100%;border:none;outline:none;transform:translateZ(0);overflow:hidden}.bf-iframe-container{visibility:hidden;position:fixed;z-index:2147483000000;background-color:#fff;bottom:0;right:0;width:100vw;height:calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));border:none;overflow:hidden;opacity:0;pointer-events:none;transform:translateY(20px);transition:opacity .3s ease,transform .3s ease,width .2s ease-in-out,height .2s ease-in-out,visibility 0s .3s}.bf-iframe-container.open{visibility:visible;opacity:1;transform:translateY(0);pointer-events:auto;top:env(safe-area-inset-top);left:0;transition-delay:0s}@media (min-width: 576px){.bf-iframe-container{bottom:80px;right:24px;width:448px;height:min(750px,calc(100vh - 80px));border-radius:8px;border:1px solid var(--Dark-300, #d4d4d4);box-shadow:0 20px 25px -5px #1212171a,0 10px 10px -5px #1212170a}.bf-iframe-container.open{top:unset;left:unset}.bf-iframe-container.position-bottom-left{right:auto;left:24px}.bf-iframe-container.position-top-left{inset:80px auto auto 24px}.bf-iframe-container.position-top-right{bottom:auto;top:80px;right:24px}.bf-iframe-container.expanded{width:min(calc(448px * 1.35),calc(100vw - 16px));height:min(calc(750px * 1.35),calc(100vh - 80px))}}.bf-search-bar-iframe-container{position:relative;width:100%;min-height:200px;background-color:#fff;border:1px solid var(--dark-300, #d4d4d4);border-radius:8px;overflow:hidden;pointer-events:auto;transition:height .2s ease-in-out}.iframe-loading-indicator{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;z-index:10}.spinner{width:24px;height:24px;border:2px solid rgba(0,0,0,.1);border-radius:50%;border-top-color:#3498db;animation:spin 1s ease-in-out infinite}@keyframes spin{to{transform:rotate(360deg)}}.loading-error{width:24px;height:24px;position:relative;display:flex;align-items:center;justify-content:center}.loading-error:before,.loading-error:after{content:"";position:absolute;width:16px;height:2px;background-color:#e74c3c;border-radius:2px}.loading-error:before{transform:rotate(45deg)}.loading-error:after{transform:rotate(-45deg)}\n .${He} { background: ${e}; }\n .${He}:hover {\n background: ${o?Re(.05,e):je(.05,e)};\n }\n .trigger-button-icon { color: ${t}; }\n `,document.head.appendChild(n)}((null==(t=null==e?void 0:e.theme)?void 0:t.inputButtonBgColor)||"#007bff",(null==(n=null==e?void 0:e.theme)?void 0:n.textBaseColor)||"#ffffff")}}class ze{constructor(e,t){l(this,"isOpen",!1),this.widgetKey=e,this.widgetType=t}get isWidgetOpen(){return this.isOpen}openWidget(){this.isOpen=!0}closeWidget(){this.isOpen=!1}toggleWidget(){return this.isOpen=!this.isOpen,this.isOpen}}function Ye(e,t,n={}){const o=document.createElement(e);return o.className=t,Object.entries(n).forEach(([e,t])=>{o.setAttribute(e,t)}),o}const $e="brainfish-search-widget";class Xe{constructor(e){l(this,"button",null),l(this,"icon",null),l(this,"closeCallback",null),this.widgetType=e}setCloseCallback(e){this.closeCallback=e}get containerClass(){return this.widgetType===h.Searchbar?Ze:Ne}get container(){return document.querySelector(`.${this.containerClass}`)}get iframe(){var e;return null==(e=this.container)?void 0:e.querySelector("iframe")}get backdrop(){return document.querySelector(`.${De}`)}setElements(e,t){this.button=e||null,this.icon=t||null}openWidget(e={}){var t,n,o;const i=document.querySelector(`.${this.containerClass}`),r=null==i?void 0:i.querySelector("iframe");if(e.newConversation&&e.contextualQuestion?null==(t=null==r?void 0:r.contentWindow)||t.postMessage({type:"CONTEXTUAL_QUESTION",question:e.contextualQuestion},"*"):e.newConversation&&(null==(n=null==r?void 0:r.contentWindow)||n.postMessage({type:"NEW_CONVERSATION"},"*")),null==(o=null==r?void 0:r.contentWindow)||o.postMessage({type:"FOCUS_SEARCH_FIELD"},"*"),this.widgetType!==h.Searchbar&&(null==i||i.classList.add("open"),e.position&&(null==i||i.classList.add(`position-${e.position}`),null==i||i.setAttribute("data-current-position",e.position))),null==i||i.setAttribute("aria-hidden","false"),this.widgetType!==h.Searchbar&&document.body.clientWidth>=962&&null===this.backdrop){const e=Ye("div",De);this.closeCallback&&e.addEventListener("click",this.closeCallback),document.body.appendChild(e)}this.updateButtonForOpen()}focusNextElement(){const e=document.querySelector($e);if(e){const t=Array.from(document.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(e=>!e.hasAttribute("disabled")),n=t.indexOf(e);if(-1!==n){const e=t[n+1];e&&e.focus()}}}closeWidget(){const e=this.container;if(!e)return;const t=e.dataset.currentPosition;if(t){const n=()=>{e.dataset.currentPosition===t&&(e.classList.remove(`position-${t}`),delete e.dataset.currentPosition)};e.addEventListener("transitionend",n,{once:!0})}e.classList.remove("open"),e.setAttribute("aria-hidden","true"),this.backdrop&&(this.backdrop.remove(),this.focusNextElement()),this.updateButtonForClose()}updateButtonForOpen(){if(!this.button||!this.icon)return;const e=this.icon.querySelector(".fish-icon"),t=this.icon.querySelector(".close-icon");this.button.setAttribute("aria-expanded","true"),null==e||e.classList.remove("visible"),null==t||t.classList.add("visible"),this.isMobile()&&this.hideTriggerButton()}updateButtonForClose(){if(!this.button||!this.icon)return;const e=this.icon.querySelector(".fish-icon"),t=this.icon.querySelector(".close-icon");this.button.setAttribute("aria-expanded","false"),null==e||e.classList.add("visible"),null==t||t.classList.remove("visible"),this.isMobile()&&this.showTriggerButton()}showTriggerButton(){var e;null==(e=this.button)||e.classList.remove("hidden")}hideTriggerButton(){var e;null==(e=this.button)||e.classList.add("hidden")}resizeContainer(e){if(this.widgetType!==h.Searchbar)return;if(!this.container||!this.iframe)return;const t=Math.max(e,200);this.container.style.height=`${t}px`,this.iframe.style.height=`${t}px`}isMobile(){return document.body.clientWidth<=576}setupButtonClickListener(e){this.button&&this.button.addEventListener("click",e)}static isWidgetDOMExisting(e,t){const n=document.querySelector(`.${Ze}[data-widget-key="${e}"]`);if(n){const e=document.querySelector("brainfish-search-widget");return!e||e.contains(n)}if(document.getElementById(`trigger-button-${e}`))return!0;if("Search"!==t.widgetType){if(document.querySelector(`.${Ne}`))return!0}return!1}}class Je{static register(e,t){this.instances.set(e,t)}static getInstance(e){return this.instances.get(e)}static unregister(e){this.instances.delete(e)}static getAllInstances(){return Array.from(this.instances.values())}static getOpenInstance(){return this.getAllInstances().find(e=>e.isWidgetOpen)}static getClosedPopupInstance(){return this.getAllInstances().find(e=>!e.isWidgetOpen&&e.widgetType===h.Popup)}static clear(){this.instances.clear()}}l(Je,"instances",new Map);const Ke=({formUrl:e,width:t="500px",height:n="600px"})=>{const o=document.createElement("div");o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("tabindex","-1"),o.style.cssText="\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: white;\n padding: 20px;\n border-radius: 8px;\n box-shadow: 0 2px 10px rgba(0,0,0,0.1);\n z-index: 300000000;\n ";const i=document.createElement("button");i.innerHTML="×",i.style.cssText="\n position: absolute;\n right: -16px;\n top: -16px;\n width: 32px;\n height: 32px;\n border: 2px solid #666;\n border-radius: 50%;\n background: #FFF;\n font-size: 20px;\n cursor: pointer;\n ";const r=document.createElement("iframe");r.src=e,r.style.cssText=`width: ${t}; height: ${n}; border: none;`;const a=document.activeElement,s=e=>{if("Tab"===e.key){const t=[i,r],n=document.activeElement,o=n?t.indexOf(n):-1;e.preventDefault(),e.shiftKey?o<=0?t[t.length-1].focus():t[o-1].focus():o>=t.length-1?t[0].focus():t[o+1].focus()}else"Escape"===e.key&&c()},c=()=>{o.remove(),l.remove(),document.removeEventListener("keydown",s),null==a||a.focus()},l=document.createElement("div");l.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0,0,0,0.5);\n z-index: 299999999;\n ",i.onclick=c,l.onclick=c,document.addEventListener("keydown",s),o.appendChild(i),o.appendChild(r),document.body.appendChild(l),document.body.appendChild(o),o.focus(),r.onload=()=>{r.setAttribute("tabindex","0"),i.focus()}},Ue=e=>`brainfish_conversation_${e}`,qe={save(e,t){if(t){const o=L(Ue(e));let i=Date.now();if(o)try{const e=JSON.parse(o);e.conversationId===t&&(i=e.persistedAt)}catch(n){}const r={conversationId:t,persistedAt:i};((e,t)=>{try{I()&&window.localStorage.setItem(e,t)}catch(n){}})(Ue(e),JSON.stringify(r))}else W(Ue(e))},load(e){const t=L(Ue(e));if(!t)return null;try{const n=JSON.parse(t);return Date.now()-n.persistedAt>72e5?(W(Ue(e)),null):n.conversationId}catch(n){return W(Ue(e)),null}},clear(e){W(Ue(e))}};class Qe{static getIframeForInstance(e){var t,n;const o=e.widgetType===h.Searchbar?Ze:Ne,i=e.widgetType===h.Searchbar?`.${o}[data-widget-key="${e.widgetKey}"]`:`.${o}`;return null!=(n=null==(t=document.querySelector(i))?void 0:t.querySelector("iframe"))?n:null}static postMessageToInstance(e,t){var n,o;null==(o=null==(n=this.getIframeForInstance(e))?void 0:n.contentWindow)||o.postMessage(t,"*")}static initialize(){this.isInitialized||(this.setupDeprecatedAPI(),this.setupNewAPI(),this.isInitialized=!0)}static setupDeprecatedAPI(){var e;(null==(e=window.Brainfish)?void 0:e.HelpWidget)&&(window.Brainfish.HelpWidget.close=e=>this.closeCurrentlyOpenWidget(),window.Brainfish.HelpWidget.open=e=>this.openCurrentlyClosedPopupWidget(e))}static setupNewAPI(){var e;(null==(e=window.Brainfish)?void 0:e.Widgets)&&(window.Brainfish.Widgets.open=e=>this.openCurrentlyClosedPopupWidget(e),window.Brainfish.Widgets.close=()=>this.closeCurrentlyOpenWidget(),window.Brainfish.Widgets.createNewThread=()=>this.createNewThread(),window.Brainfish.Widgets.openModalForm=Ke,window.Brainfish.Widgets.onContextHelp=(e,t)=>this.openContextualHelp(e,t),window.Brainfish.Widgets.restoreConversation=e=>this.restoreConversation(e),window.Brainfish.Widgets.clearConversation=()=>this.clearConversation())}static closeCurrentlyOpenWidget(){const e=Je.getOpenInstance();e&&e.closeWidget()}static openCurrentlyClosedPopupWidget(e){const t=Je.getClosedPopupInstance();if(t){const n="string"==typeof e?{trigger:e}:e,o={};(!0===(null==n?void 0:n.newConversation)||(null==n?void 0:n.trigger))&&(o.newConversation=!0),(null==n?void 0:n.trigger)&&(o.trigger=n.trigger),(null==n?void 0:n.position)&&(o.position=n.position),t.openWidget(o)}}static createNewThread(){const e=Je.getOpenInstance();if(e)return void this.postMessageToInstance(e,{type:"NEW_CONVERSATION"});const t=Je.getClosedPopupInstance();t&&t.openWidget({newConversation:!0})}static openContextualHelp(e,t={}){if(!e||"string"!=typeof e||0===e.trim().length)return void console.warn("Brainfish.Widgets.onContextHelp: Invalid question provided");let n=Je.getOpenInstance();if(n||(n=Je.getClosedPopupInstance()),!n)return void console.warn("Brainfish.Widgets.onContextHelp: No popup widget available");const o=c(s({},t),{newConversation:!0,trigger:"contextual-help",contextualQuestion:e.trim()});n.openWidget(o)}static restoreConversation(e){if(!e||"string"!=typeof e)return void console.warn("Brainfish.Widgets.restoreConversation: Invalid conversationId provided");let t=Je.getOpenInstance();const n=!!t;t||(t=Je.getClosedPopupInstance()),t?(n||t.openWidget({newConversation:!1}),this.postMessageToInstance(t,{type:"RESTORE_CONVERSATION",conversationId:e})):console.warn("Brainfish.Widgets.restoreConversation: No popup widget available")}static clearConversation(){var e;const t=null!=(e=Je.getOpenInstance())?e:Je.getClosedPopupInstance();t?(qe.clear(t.widgetKey),this.postMessageToInstance(t,{type:"NEW_CONVERSATION"})):console.warn("Brainfish.Widgets.clearConversation: No popup widget available")}}l(Qe,"isInitialized",!1);class et{constructor(e,t){this.widgetType=e,this.widgetKey=t}trackOpenWidget(e,t){this.dispatchEvent("onBrainfishWidgetOpen"),"contextual-help"===e?this.trackAnalytics("Open Widget - Contextual Help",{trigger:e,question:t}):e?this.trackAnalytics("Open Widget - Custom Trigger",{trigger:e}):this.trackAnalytics("Open Widget")}trackCloseWidget(){this.dispatchEvent("onBrainfishWidgetClose"),this.trackAnalytics("Close Widget")}trackCustomEvent(e,t={}){this.trackAnalytics(e,t)}dispatchEvent(e){window.dispatchEvent(new Event(e))}trackAnalytics(e,t={}){if(window.BrainfishAnalytics){let n;switch(this.widgetType){case h.Searchbar:n="searchbar_widget";break;case h.Sidebar:default:n="search_widget"}window.BrainfishAnalytics("track",e,c(s({},t),{widgetKey:this.widgetKey}),{source:n,widgetKey:this.widgetKey})}}}class tt{constructor(e,t){l(this,"state"),l(this,"domController"),l(this,"analyticsTracker"),this.state=new ze(e,t),this.domController=new Xe(t),this.domController.setCloseCallback(()=>this.closeWidget()),this.analyticsTracker=new et(t,e)}static getInstance(e){return Je.getInstance(e)}get widgetKey(){return this.state.widgetKey}get widgetType(){return this.state.widgetType}get isWidgetOpen(){return this.state.isWidgetOpen}get containerClass(){return this.domController.containerClass}initialize({button:e,icon:t,isButtonHidden:n}){this.domController.setElements(e,t),this.domController.setupButtonClickListener(()=>this.toggleIframeVisibility()),Je.register(this.widgetKey,this),Qe.initialize()}toggleIframeVisibility(){this.state.toggleWidget()?this.openWidget():this.closeWidget()}openWidget(e={}){var t,n;if(this.state.openWidget(),this.domController.openWidget(e),void 0===(null==e?void 0:e.newConversation)){const e=qe.load(this.widgetKey);e&&(null==(n=null==(t=this.domController.iframe)?void 0:t.contentWindow)||n.postMessage({type:"RESTORE_CONVERSATION",conversationId:e},"*"))}this.analyticsTracker.trackOpenWidget(e.trigger,e.contextualQuestion)}closeWidget(){this.state.closeWidget(),this.domController.closeWidget(),this.analyticsTracker.trackCloseWidget()}showTriggerButton(){this.domController.showTriggerButton()}hideTriggerButton(){this.domController.hideTriggerButton()}resizeContainer(e){this.domController.resizeContainer(e)}trackCustomEvent(e,t={}){this.analyticsTracker.trackCustomEvent(e,t)}destroy(){Je.unregister(this.widgetKey)}static initialize(e){const t=new tt(e.widgetKey,e.widgetType);return t.initialize(e),t}}function nt({widgetUrl:e,widgetType:t,props:n}){const o=t===h.Searchbar?Ze:Ne,i=Ye("div",o,s({id:o,"aria-live":"polite","aria-hidden":t===h.Searchbar?"false":"true"},n||{})),r=Ye("div","iframe-loading-indicator"),a=Ye("div","spinner");r.setAttribute("aria-label","Loading content"),r.setAttribute("role","status"),r.appendChild(a),i.appendChild(r);const c=Ye("iframe","trigger-iframe",{src:e,sandbox:"allow-scripts allow-same-origin allow-popups allow-forms",allow:"clipboard-write",role:"dialog"});return c.style.opacity="0",c.addEventListener("load",()=>{r.style.display="none",c.style.opacity="1"}),c.addEventListener("error",e=>{console.error("Error loading iframe:",e),r.innerHTML="";const t=Ye("div","loading-error");r.appendChild(t),r.setAttribute("aria-label","Failed to load content")}),i.appendChild(c),{iframeContainer:i,iframe:c}}function ot(e,t){const n=()=>{(t=>{var n;null==(n=e.contentWindow)||n.postMessage({type:"UPDATE_BODY_CLASS",isDarkMode:t},"*")})(document.body.classList.contains("dark"))};n(),(()=>{const e=new MutationObserver(n);e.observe(document.body,{attributes:!0,attributeFilter:["class"]}),t.addEventListener("abort",()=>e.disconnect())})()}const it=new Map,rt=(e,t)=>`Error executing Client Action with key ${e}. Details: ${t instanceof Error?t.message:String(t)}`,at=(e,t)=>d(null,null,function*(){if(it.has(e)){const i=it.get(e);if("function"!=typeof i)return{success:!1,reason:`Client Action registered with key ${e} is not a function`};try{const e=yield i(t);if(n=e,"[object Object]"!==Object.prototype.toString.call(n))throw new TypeError("Invalid result, expecting object type");return{success:!0,data:e}}catch(o){return{success:!1,reason:rt(e,o)}}}var n;return{success:!1,reason:`No Client Action registered with key ${e}`}}),st=new Map,ct=new Set;function lt(e,{widgetHost:t,apiHost:n,widgetKey:o,widgetType:i,signal:r,stateManager:a}){window.addEventListener("message",r=>d(null,null,function*(){var s,c;if(r.origin!==t)return;const{type:l,widgetKey:d}=r.data;if(!d||d===o){if("TOGGLE_WIDGET_SIZE"===l&&function(){const e=document.querySelector(`.${Ne}`);e.classList.contains("expanded")?e.classList.remove("expanded"):e.classList.add("expanded")}(),"RESIZE_IFRAME"===l){const{height:e}=r.data;a.resizeContainer(e)}if("TRACK_EVENT"===l){const{messageId:e,eventName:t,data:n}=r.data;if(e){if(ct.has(e))return void console.warn(`[Brainfish] Duplicate TRACK_EVENT suppressed for "${t}" (messageId: ${e})`);ct.add(e),setTimeout(()=>ct.delete(e),5e3)}a.trackCustomEvent(t,n)}if("CLOSE_WIDGET"===l&&a.closeWidget(),"NEXT_BEST_ACTION_CLICKED"===l){const{action:e,searchQueryId:t,query:i,answer:a,conversation:s}=r.data;if(!["function","callback"].includes(e.type))return void console.error("[Brainfish] Invalid action type:",e);const c=st.get(e.id);if(c&&Date.now()-c<1e3)return void console.warn(`[Brainfish] Duplicate NEXT_BEST_ACTION_CLICKED suppressed for action "${e.id}" (fired ${Date.now()-c}ms ago)`);st.set(e.id,Date.now()),setTimeout(()=>st.delete(e.id),1e3),qe.clear(o);const l={query:i,answer:a,searchIntentId:e.searchIntentId,actionId:e.id,conversationId:(null==s?void 0:s.conversationId)||"",searchQueryId:t,metadata:e.metadata||{},conversation:s||null};try{if(window.__bfCallbacks=window.__bfCallbacks||{},window.__bfCallbacks[e.id])return void window.__bfCallbacks[e.id](i,a,l);const t=new URL(`${n}/api/searchWidgets.callback.codeblocks`);t.searchParams.set("apiKey",o),t.searchParams.set("codeblockId",e.id),l.searchIntentId&&t.searchParams.set("searchIntentId",l.searchIntentId);const r=document.createElement("script");r.src=t.toString(),document.head.appendChild(r),r.onload=()=>{window.__bfCallbacks[e.id](i,a,l),setTimeout(()=>{document.head.removeChild(r)},300)},r.onerror=()=>{console.error("[Brainfish] Failed to load callback script from server")}}catch(u){console.error("[Brainfish] Error executing callback:",u)}}if("CLIENT_EXECUTION"===l){const{actionKey:t,inputs:n,messageId:o}=r.data,i=yield at(t,n);null==(s=e.contentWindow)||s.postMessage({type:"CLIENT_EXECUTION_RESULT",messageId:o,result:i},"*")}if("CONVERSATION_CHANGED"===l){const{conversationId:e}=r.data;i!==h.Searchbar&&qe.save(o,e)}if("REQUEST_USER_IDENTITY"===l&&r.source===e.contentWindow&&i===h.Popup){const t=qe.load(o);t&&(null==(c=e.contentWindow)||c.postMessage({type:"RESTORE_CONVERSATION",conversationId:t},"*"))}}}),{signal:r})}function dt(e,t,n){let o;const i=()=>{(t=>{var o;const i={type:"UPDATE_BODY_CLASS",isMobile:t};null==(o=e.contentWindow)||o.postMessage(i,"*"),t&&(n.isWidgetOpen?n.hideTriggerButton():n.showTriggerButton())})(document.body.clientWidth<=576)},r=()=>{o&&clearTimeout(o),o=window.setTimeout(i,300)};i(),(()=>{const e=new ResizeObserver(r);e.observe(document.body),t.addEventListener("abort",()=>e.disconnect())})()}const ut=new Set;function ft(e,t,{isButtonHidden:n,triggerButtonIcon:o}){const i=document.createDocumentFragment();let r;if(n)r=tt.initialize({isButtonHidden:n,widgetType:h.Popup,widgetKey:e});else{const{button:t,icon:n}=function(e,t){const n=Ye("button",He,{id:`trigger-button-${e}`,"aria-controls":Ne,"aria-expanded":"false","data-name":He}),o=Ye("div","trigger-button-icon",{"aria-hidden":"true"});return o.innerHTML=t?`\n <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">\n <path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"></path>\n </svg>\n <img src="${t}" class="fish-icon visible" alt="Trigger button icon" aria-hidden="true" aria-label="help button icon" />\n `:'\n <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">\n <path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"></path>\n </svg>\n <svg width="24" height="14" viewBox="0 0 24 14" fill="none" xmlns="http://www.w3.org/2000/svg" class="fish-icon visible">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M1.71844 10.3882L4.60606 6.98384L1.71844 3.58375C1.4014 3.21362 1.44424 2.65841 1.81269 2.33993C1.97978 2.1979 2.65242 1.98701 3.04657 2.43461L5.78425 5.65824C6.14281 5.29523 6.51693 4.95924 6.90479 4.65114C8.88976 3.07437 11.2345 2.22803 13.6931 2.22803C16.9492 2.22803 20.0039 3.71718 22.2917 6.41142C22.5702 6.74282 22.5702 7.22916 22.2917 7.56056C20.0039 10.2591 16.9492 11.744 13.6931 11.744C11.2348 11.744 8.89035 10.8948 6.90554 9.31995C6.51741 9.01199 6.14304 8.67628 5.78425 8.31374L3.04657 11.5374C2.72953 11.9075 2.18114 11.9505 1.81269 11.632C1.44852 11.3179 1.40568 10.7584 1.71844 10.3882ZM5.93026 10.4683C8.17161 12.2599 10.8546 13.25 13.6931 13.25C17.4881 13.25 21.019 11.4034 23.4447 8.52942C24.1873 7.64571 24.1843 6.31801 23.4397 5.43663C20.8944 2.43919 17.4337 0.722025 13.6931 0.722025C10.8555 0.722025 8.17194 1.70845 5.92952 3.50276L4.17682 1.43933C3.57943 0.760929 2.79325 0.630009 2.25286 0.662947C1.98116 0.679506 1.73125 0.736852 1.51895 0.811846C1.26839 0.900352 1.03017 1.02718 0.827835 1.20058C-0.165283 2.05903 -0.283916 3.561 0.574656 4.56345L2.63075 6.98445L0.568104 9.41623C-0.272133 10.4106 -0.166523 11.9125 0.827835 12.7714C1.81372 13.6243 3.34308 13.5062 4.19036 12.5171L5.93026 10.4683Z" fill="currentColor"/>\n </svg>\n ',n.setAttribute("aria-label","Open Brainfish widget"),n.appendChild(o),{button:n,icon:o}}(e,o);i.appendChild(t),r=tt.initialize({button:t,icon:n,widgetType:h.Popup,widgetKey:e})}const{iframeContainer:a,iframe:s}=nt({widgetUrl:t,widgetType:h.Popup});return i.appendChild(a),{fragment:i,iframe:s,stateManager:r}}const pt=({config:e,widgetUrl:t,apiHost:n,widgetHost:o,widgetKey:i,hideTriggerButton:r})=>{const{settings:a}=e,s=null!=r?r:null==a?void 0:a.hideTriggerButton,c=null==a?void 0:a.triggerButtonIcon;try{if(function(e){return ut.has(e)}(i))return;if(function(e){return!!document.getElementById(`trigger-button-${e}`)}(i))return;Ge(e);const{fragment:r,iframe:a,stateManager:l}=ft(i,t,{isButtonHidden:s||!1,triggerButtonIcon:c||""}),d=new AbortController,{signal:u}=d;a.onload=()=>{setTimeout(()=>{var e;ot(a,u),lt(a,{widgetHost:o,apiHost:n,widgetKey:i,widgetType:h.Popup,signal:u,stateManager:l}),dt(a,u,l);const r=qe.load(i),s=new URL(t).searchParams.has("conversation");r&&!s&&(null==(e=a.contentWindow)||e.postMessage({type:"RESTORE_CONVERSATION",conversationId:r},"*"))},0)},document.body?document.body.appendChild(r):(console.warn("[Brainfish] document.body not ready. Widget initialization deferred."),document.addEventListener("DOMContentLoaded",()=>{document.body.appendChild(r)},{once:!0})),ut.add(i);const f=()=>{d.abort(),window.removeEventListener("beforeunload",f)};return void window.addEventListener("beforeunload",f)}catch(l){!function(e,t,n){v(e,t,t.message,n)}(n,l,i)}},ht=new Map;const gt=({config:e,widgetUrl:t,apiHost:n,widgetHost:o,widgetKey:i})=>{var r,a,s,c;const{settings:l}=e;let d=tt.getInstance(i);null==(r=ht.get(i))||r.abort();const u=new AbortController;ht.set(i,u),Ge(e);try{const e=document.querySelector(`.${Ze}[data-widget-key="${i}"]`),r=document.querySelector($e);e&&r&&!r.contains(e)&&(r.appendChild(e),0===r.getBoundingClientRect().width&&(null==(a=r.parentElement)||a.style.setProperty("width","100%"))),d||(d=tt.initialize({isButtonHidden:!0,widgetType:h.Searchbar,widgetKey:i}));const{signal:l}=u,f=e=>{ot(e,l),lt(e,{widgetHost:o,apiHost:n,widgetKey:i,widgetType:h.Searchbar,signal:l,stateManager:d}),dt(e,l,d)};if(e){const t=e.querySelector("iframe");t&&("complete"===(null==(c=t.contentDocument)?void 0:c.readyState)?setTimeout(()=>{f(t)},0):t.onload=()=>{setTimeout(()=>{f(t)},0)})}else{const e=document.createDocumentFragment(),{iframeContainer:n,iframe:o}=nt({widgetUrl:t,widgetType:h.Searchbar,props:{"data-widget-type":"searchbar","data-widget-key":i}});o.onload=()=>{setTimeout(()=>{f(o)},0)},e.appendChild(n),r?(r.appendChild(e),0===r.getBoundingClientRect().width&&(null==(s=r.parentElement)||s.style.setProperty("width","100%"))):document.body.appendChild(e)}const p=()=>{u.abort(),ht.delete(i),window.removeEventListener("beforeunload",p)};return void window.addEventListener("beforeunload",p)}catch(f){!function(e,t,n){v(e,t,t.message,n)}(n,f,i)}},mt=(e,t,n)=>{var a;const c=S(e.overrides),l=(null==(d=e.overrides)?void 0:d.widgetHost)||"https://agent.brainfi.sh";var d;const u=null==(a=e.overrides)?void 0:a.hideTriggerButton,{theme:f,settings:p}=t,h=e.overrides||{},{theme:g,redirectRules:m,regions:b,customCss:y}=h,v=((e,t)=>{var n={};for(var a in e)i.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&o)for(var a of o(e))t.indexOf(a)<0&&r.call(e,a)&&(n[a]=e[a]);return n})(h,["theme","redirectRules","regions","customCss"]),w=s(s({},f),g),x=s(s({},p),v),C=_(JSON.stringify(m)),k={theme:_(JSON.stringify(w)),settings:_(JSON.stringify(x)),redirectRules:C};b&&(k.regions=_(JSON.stringify(b))),y&&(k.customCss=_(y)),n&&(k.fingerprint=_(n));const E=`${l}/?widgetKey=${e.widgetKey}#${new URLSearchParams(k).toString()}`;"Search"===t.widgetType?gt({config:t,widgetUrl:E,apiHost:c,widgetHost:l,widgetKey:e.widgetKey}):pt({config:t,widgetUrl:E,apiHost:c,widgetHost:l,widgetKey:e.widgetKey,hideTriggerButton:u})};var bt=(e=>(e.FRESHCHAT="freshchat",e.INTERCOM="intercom",e.ZENDESK="zendesk",e.HELPSCOUT="helpscout",e))(bt||{});const yt=e=>d(null,null,function*(){if(e.widgetType===h.Popup){const e=window.fcWidget?bt.FRESHCHAT:null;e&&e===bt.FRESHCHAT&&(yield d(null,null,function*(){window.fcWidget||(yield new Promise(e=>setTimeout(e,100))),window.fcWidget.hide(),window.fcWidget.on("widget:closed",()=>{window.fcWidget.hide()})}))}}),vt="brainfish-nudges",wt=(e,t)=>d(null,null,function*(){try{yield d(null,null,function*(){if(!document.getElementById(vt))return new Promise(e=>{const t=document.createElement("script");t.id=vt,t.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/nudge-widget@latest/dist/index.es.js",t.type="module",t.async=!0,t.crossOrigin="anonymous",t.onerror=()=>{Math.random()<.05&&void 0!==console.warn&&console.warn("[Brainfish] Nudge widget failed to load. This may be due to CSP or network restrictions."),e(void 0)},t.onload=()=>{setTimeout(()=>{e(!0)},200)},document.head.appendChild(t)})})}catch(n){v(e,n,"Failed to initialize Nudge widget",t)}});let xt,St,Ct,kt=!1;const Et=e=>{null==xt||xt.abort(),xt=new AbortController;const{signal:t}=xt;let n=window.location.pathname;const o=()=>{if(t.aborted)return;const o=window.location.pathname;o!==n&&(n=o,e())};window.addEventListener("popstate",o,{signal:t}),kt||(St=history.pushState,Ct=history.replaceState,history.pushState=function(...e){St.apply(this,e),setTimeout(o,0)},history.replaceState=function(...e){Ct.apply(this,e),setTimeout(o,0)},kt=!0),t.addEventListener("abort",()=>{kt&&(history.pushState=St,history.replaceState=Ct,kt=!1)})};var It="5.2.0";function Lt(e,t){return new Promise(n=>setTimeout(n,e,t))}function Wt(){return new Promise(e=>{const t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(null)})}function Tt(e){return!!e&&"function"==typeof e.then}function Mt(e,t){try{const n=e();Tt(n)?n.then(e=>t(!0,e),e=>t(!1,e)):t(!0,n)}catch(n){t(!1,n)}}function _t(e,t,n=16){return d(this,null,function*(){const o=Array(e.length);let i=Date.now();for(let r=0;r<e.length;++r){o[r]=t(e[r],r);const a=Date.now();a>=i+n&&(i=a,yield Wt())}return o})}function At(e){return e.then(void 0,()=>{}),e}function Ot(e){return parseInt(e)}function Pt(e){return parseFloat(e)}function Rt(e,t){return"number"==typeof e&&isNaN(e)?t:e}function Bt(e){return e.reduce((e,t)=>e+(t?1:0),0)}function Ft(e,t=1){if(Math.abs(t)>=1)return Math.round(e/t)*t;{const n=1/t;return Math.round(e*n)/n}}function Vt(e,t){const n=e[0]>>>16,o=65535&e[0],i=e[1]>>>16,r=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16;let l=0,d=0,u=0,f=0;f+=r+(65535&t[1]),u+=f>>>16,f&=65535,u+=i+c,d+=u>>>16,u&=65535,d+=o+s,l+=d>>>16,d&=65535,l+=n+a,l&=65535,e[0]=l<<16|d,e[1]=u<<16|f}function jt(e,t){const n=e[0]>>>16,o=65535&e[0],i=e[1]>>>16,r=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16,l=65535&t[1];let d=0,u=0,f=0,p=0;p+=r*l,f+=p>>>16,p&=65535,f+=i*l,u+=f>>>16,f&=65535,f+=r*c,u+=f>>>16,f&=65535,u+=o*l,d+=u>>>16,u&=65535,u+=i*c,d+=u>>>16,u&=65535,u+=r*s,d+=u>>>16,u&=65535,d+=n*l+o*c+i*s+r*a,d&=65535,e[0]=d<<16|u,e[1]=f<<16|p}function Nt(e,t){const n=e[0];32===(t%=64)?(e[0]=e[1],e[1]=n):t<32?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(t-=32,e[0]=e[1]<<t|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function Ht(e,t){0!==(t%=64)&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function Zt(e,t){e[0]^=t[0],e[1]^=t[1]}const Dt=[4283543511,3981806797],Gt=[3301882366,444984403];function zt(e){const t=[0,e[0]>>>1];Zt(e,t),jt(e,Dt),t[1]=e[0]>>>1,Zt(e,t),jt(e,Gt),t[1]=e[0]>>>1,Zt(e,t)}const Yt=[2277735313,289559509],$t=[1291169091,658871167],Xt=[0,5],Jt=[0,1390208809],Kt=[0,944331445];function Ut(e,t){const n=function(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);if(o>127)return(new TextEncoder).encode(e);t[n]=o}return t}(e);t=t||0;const o=[0,n.length],i=o[1]%16,r=o[1]-i,a=[0,t],s=[0,t],c=[0,0],l=[0,0];let d;for(d=0;d<r;d+=16)c[0]=n[d+4]|n[d+5]<<8|n[d+6]<<16|n[d+7]<<24,c[1]=n[d]|n[d+1]<<8|n[d+2]<<16|n[d+3]<<24,l[0]=n[d+12]|n[d+13]<<8|n[d+14]<<16|n[d+15]<<24,l[1]=n[d+8]|n[d+9]<<8|n[d+10]<<16|n[d+11]<<24,jt(c,Yt),Nt(c,31),jt(c,$t),Zt(a,c),Nt(a,27),Vt(a,s),jt(a,Xt),Vt(a,Jt),jt(l,$t),Nt(l,33),jt(l,Yt),Zt(s,l),Nt(s,31),Vt(s,a),jt(s,Xt),Vt(s,Kt);c[0]=0,c[1]=0,l[0]=0,l[1]=0;const u=[0,0];switch(i){case 15:u[1]=n[d+14],Ht(u,48),Zt(l,u);case 14:u[1]=n[d+13],Ht(u,40),Zt(l,u);case 13:u[1]=n[d+12],Ht(u,32),Zt(l,u);case 12:u[1]=n[d+11],Ht(u,24),Zt(l,u);case 11:u[1]=n[d+10],Ht(u,16),Zt(l,u);case 10:u[1]=n[d+9],Ht(u,8),Zt(l,u);case 9:u[1]=n[d+8],Zt(l,u),jt(l,$t),Nt(l,33),jt(l,Yt),Zt(s,l);case 8:u[1]=n[d+7],Ht(u,56),Zt(c,u);case 7:u[1]=n[d+6],Ht(u,48),Zt(c,u);case 6:u[1]=n[d+5],Ht(u,40),Zt(c,u);case 5:u[1]=n[d+4],Ht(u,32),Zt(c,u);case 4:u[1]=n[d+3],Ht(u,24),Zt(c,u);case 3:u[1]=n[d+2],Ht(u,16),Zt(c,u);case 2:u[1]=n[d+1],Ht(u,8),Zt(c,u);case 1:u[1]=n[d],Zt(c,u),jt(c,Yt),Nt(c,31),jt(c,$t),Zt(a,c)}return Zt(a,o),Zt(s,o),Vt(a,s),Vt(s,a),zt(a),zt(s),Vt(a,s),Vt(s,a),("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)+("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)}function qt(e,t,n,o){const i=Object.keys(e).filter(e=>!function(e,t){for(let n=0,o=e.length;n<o;++n)if(e[n]===t)return!0;return!1}(n,e)),r=At(_t(i,n=>function(e,t){const n=At(new Promise(n=>{const o=Date.now();Mt(e.bind(null,t),(...e)=>{const t=Date.now()-o;if(!e[0])return n(()=>({error:e[1],duration:t}));const i=e[1];if(function(e){return"function"!=typeof e}(i))return n(()=>({value:i,duration:t}));n(()=>new Promise(e=>{const n=Date.now();Mt(i,(...o)=>{const i=t+Date.now()-n;if(!o[0])return e({error:o[1],duration:i});e({value:o[1],duration:i})})}))})}));return function(){return n.then(e=>e())}}(e[n],t),o));return function(){return d(this,null,function*(){const e=yield r,t=yield _t(e,e=>At(e()),o),n=yield Promise.all(t),a={};for(let o=0;o<i.length;++o)a[i[o]]=n[o];return a})}}function Qt(){const e=window,t=navigator;return Bt(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function en(){const e=window,t=navigator;return Bt(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===(t.vendor||"").indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function tn(){const e=window;return Bt(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===navigator.vendor.indexOf("Apple"),"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function nn(){const e=window,{HTMLElement:t,Document:n}=e;return Bt(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function on(){const e=window;return t=e.print,/^function\s.*?\{\s*\[native code]\s*}$/.test(String(t))&&"[object WebPageNamespace]"===String(e.browser);var t}function rn(){var e,t;const n=window;return Bt(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function an(){const{CSS:e}=window;return Bt([e.supports("selector(::details-content)"),e.supports("selector(::before::marker)"),e.supports("selector(::after::marker)"),!("locale"in CompositionEvent.prototype)])>=3}function sn(){const e=window,t=navigator,{CSS:n,HTMLButtonElement:o}=e;return Bt([!("getStorageUpdates"in t),o&&"popover"in o.prototype,"CSSCounterStyleRule"in e,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function cn(){const e=en(),t=rn(),n=window,o=navigator,i="connection";return e?Bt([!("SharedWorker"in n),o[i]&&"ontypechange"in o[i],!("sinkId"in new Audio)])>=2:!!t&&Bt(["onorientationchange"in n,"orientation"in n,/android/i.test(o.appVersion)])>=2}function ln(e){const t=new Error(e);return t.name=e,t}function dn(e,t,n=50){return d(this,null,function*(){var o,i,r;const a=document;for(;!a.body;)yield Lt(n);const s=a.createElement("iframe");try{for((yield new Promise((e,n)=>{let o=!1;const i=()=>{o=!0,e()};s.onload=i,s.onerror=e=>{o=!0,n(e)};const{style:r}=s;r.setProperty("display","block","important"),r.position="absolute",r.top="0",r.left="0",r.visibility="hidden",t&&"srcdoc"in s?s.srcdoc=t:s.src="about:blank",a.body.appendChild(s);const c=()=>{var e,t;o||("complete"===(null===(t=null===(e=s.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.readyState)?i():setTimeout(c,10))};c()}));!(null===(i=null===(o=s.contentWindow)||void 0===o?void 0:o.document)||void 0===i?void 0:i.body);)yield Lt(n);return yield e(s,s.contentWindow)}finally{null===(r=s.parentNode)||void 0===r||r.removeChild(s)}})}function un(e){const[t,n]=function(e){var t,n;const o=`Unexpected syntax '${e}'`,i=/^\s*([a-z-]*)(.*)$/i.exec(e),r=i[1]||void 0,a={},s=/([.:#][\w-]+|\[.+?\])/gi,c=(e,t)=>{a[e]=a[e]||[],a[e].push(t)};for(;;){const e=s.exec(i[2]);if(!e)break;const r=e[0];switch(r[0]){case".":c("class",r.slice(1));break;case"#":c("id",r.slice(1));break;case"[":{const e=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(r);if(!e)throw new Error(o);c(e[1],null!==(n=null!==(t=e[4])&&void 0!==t?t:e[5])&&void 0!==n?n:"");break}default:throw new Error(o)}}return[r,a]}(e),o=document.createElement(null!=t?t:"div");for(const i of Object.keys(n)){const e=n[i].join(" ");"style"===i?fn(o.style,e):o.setAttribute(i,e)}return o}function fn(e,t){for(const n of t.split(";")){const t=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(n);if(t){const[,n,o,,i]=t;e.setProperty(n,o,i||"")}}}const pn=["monospace","sans-serif","serif"],hn=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function gn(e){return e.toDataURL()}let mn,bn;function yn(){return function(){if(void 0!==bn)return;const e=()=>{const t=vn();wn(t)?bn=setTimeout(e,2500):(mn=t,bn=void 0)};e()}(),()=>d(null,null,function*(){let e=vn();if(wn(e)){if(mn)return[...mn];(function(){const e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null})()&&(yield function(){const e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}(),e=vn())}return wn(e)||(mn=e),e})}function vn(){const e=screen;return[Rt(Pt(e.availTop),null),Rt(Pt(e.width)-Pt(e.availWidth)-Rt(Pt(e.availLeft),0),null),Rt(Pt(e.height)-Pt(e.availHeight)-Rt(Pt(e.availTop),0),null),Rt(Pt(e.availLeft),null)]}function wn(e){for(let t=0;t<4;++t)if(e[t])return!1;return!0}function xn(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function Sn(e){return matchMedia(`(inverted-colors: ${e})`).matches}function Cn(e){return matchMedia(`(forced-colors: ${e})`).matches}function kn(e){return matchMedia(`(prefers-contrast: ${e})`).matches}function En(e){return matchMedia(`(prefers-reduced-motion: ${e})`).matches}function In(e){return matchMedia(`(prefers-reduced-transparency: ${e})`).matches}function Ln(e){return matchMedia(`(dynamic-range: ${e})`).matches}const Wn=Math,Tn=()=>0;const Mn="mmMwWLliI0fiflO&1",_n={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function An(e){const t=cn()?0:3,n=Math.pow(10,t);return Math.floor(e*n)/n}const On=function(){let e=window;for(;;){const n=e.parent;if(!n||n===e)return!1;try{if(n.location.origin!==e.location.origin)return!0}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return!0;throw t}e=n}};const Pn=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),Rn=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),Bn=["FRAGMENT_SHADER","VERTEX_SHADER"],Fn=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],Vn="WEBGL_debug_renderer_info";function jn(e){if(e.webgl)return e.webgl.context;const t=document.createElement("canvas");let n;t.addEventListener("webglCreateContextError",()=>n=void 0);for(const i of["webgl","experimental-webgl"]){try{n=t.getContext(i)}catch(o){}if(n)break}return e.webgl={context:n},n}function Nn(e,t,n){const o=e.getShaderPrecisionFormat(e[t],e[n]);return o?[o.rangeMin,o.rangeMax,o.precision]:[]}function Hn(e){return Object.keys(e.__proto__).filter(Zn)}function Zn(e){return"string"==typeof e&&!e.match(/[^A-Z0-9_x]/)}function Dn(){return rn()}function Gn(){return en()||tn()}function zn(e){return"function"==typeof e.getParameter}const Yn={userAgentData:function(){return d(this,null,function*(){const e=navigator.userAgentData;if(!e)return;const t=e.brands.filter(({brand:e})=>!function(e){return/not/i.test(e)}(e)).map(({brand:e})=>e),n={brands:t.length>1?t.filter(e=>"Chromium"!==e):t,mobile:e.mobile,platform:e.platform};if(e.getHighEntropyValues)try{const t=yield e.getHighEntropyValues(["architecture","bitness","model","platformVersion"]);n.architecture=t.architecture,n.bitness=t.bitness,n.model=t.model,n.platformVersion=t.platformVersion}catch(o){if(!(o instanceof DOMException&&"NotAllowedError"===o.name))throw o;n.highEntropyStatus="not_allowed"}return n})},fonts:function(){return dn((e,t)=>d(null,[e,t],function*(e,{document:t}){const n=t.body;n.style.fontSize="48px";const o=t.createElement("div");o.style.setProperty("visibility","hidden","important");const i={},r={},a=e=>{const n=t.createElement("span"),{style:i}=n;return i.position="absolute",i.top="0",i.left="0",i.fontFamily=e,n.textContent="mmMwWLliI0O&1",o.appendChild(n),n},s=(e,t)=>a(`'${e}',${t}`),c=pn.map(a),l=(()=>{const e={};for(const t of hn)e[t]=pn.map(e=>s(t,e));return e})();n.appendChild(o);for(let d=0;d<pn.length;d++)i[pn[d]]=c[d].offsetWidth,r[pn[d]]=c[d].offsetHeight;return hn.filter(e=>{return t=l[e],pn.some((e,n)=>t[n].offsetWidth!==i[e]||t[n].offsetHeight!==r[e]);var t})}))},domBlockers:function(){return d(this,arguments,function*({debug:e}={}){if(!tn()&&!cn())return;const t=function(){const e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}(),n=Object.keys(t),o=[].concat(...n.map(e=>t[e])),i=yield function(e){return d(this,null,function*(){var t;const n=document,o=n.createElement("div"),i=new Array(e.length),r={};xn(o);for(let a=0;a<e.length;++a){const t=un(e[a]);"DIALOG"===t.tagName&&t.show();const r=n.createElement("div");xn(r),r.appendChild(t),o.appendChild(r),i[a]=t}for(;!n.body;)yield Lt(50);n.body.appendChild(o);try{for(let t=0;t<e.length;++t)i[t].offsetParent||(r[e[t]]=!0)}finally{null===(t=o.parentNode)||void 0===t||t.removeChild(o)}return r})}(o);e&&function(e,t){let n="DOM blockers debug:\n```";for(const o of Object.keys(e)){n+=`\n${o}:`;for(const i of e[o])n+=`\n ${t[i]?"🚫":"➡️"} ${i}`}console.log(`${n}\n\`\`\``)}(t,i);const r=n.filter(e=>{const n=t[e];return Bt(n.map(e=>i[e]))>.6*n.length});return r.sort(),r})},fontPreferences:function(){return function(e,t=4e3){return dn((n,o)=>{const i=o.document,r=i.body,a=r.style;a.width=`${t}px`,a.webkitTextSizeAdjust=a.textSizeAdjust="none",en()?r.style.zoom=""+1/o.devicePixelRatio:tn()&&(r.style.zoom="reset");const s=i.createElement("div");return s.textContent=[...Array(t/20|0)].map(()=>"word").join(" "),r.appendChild(s),e(i,r,o)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}((e,t,n)=>{const o={},i={};for(const a of Object.keys(_n)){const[n={},i=Mn]=_n[a],r=e.createElement("span");r.textContent=i,r.style.whiteSpace="nowrap";for(const e of Object.keys(n)){const t=n[e];void 0!==t&&(r.style[e]=t)}o[a]=r,t.append(e.createElement("br"),r)}const r=en()&&function(){const e=window,t=document,{CSS:n,Promise:o,AudioContext:i}=e;return Bt([o&&"try"in o,"caretPositionFromPoint"in t,i&&"onerror"in i.prototype,n.supports("ruby-align","space-around")])>=3}();for(const a of Object.keys(_n)){const e=o[a].getBoundingClientRect().width;i[a]=r?An(e*n.devicePixelRatio):e}return i})},audio:function(){return tn()&&sn()&&on()||en()&&function(){const e=navigator,t=window,n=Audio.prototype,{visualViewport:o}=t;return Bt(["srLatency"in n,"srChannelCount"in n,"devicePosture"in e,o&&"segments"in o,"getTextInformation"in Image.prototype])>=3}()&&function(){const e=window,{URLPattern:t}=e;return Bt(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}()?-4:function(){const e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(tn()&&!nn()&&!function(){const e=window;return Bt(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}())return-1;const n=4500,o=new t(1,5e3,44100),i=o.createOscillator();i.type="triangle",i.frequency.value=1e4;const r=o.createDynamicsCompressor();r.threshold.value=-50,r.knee.value=40,r.ratio.value=12,r.attack.value=0,r.release.value=.25,i.connect(r),r.connect(o.destination),i.start(0);const[a,s]=function(e){const t=3,n=500,o=500,i=5e3;let r=()=>{};const a=new Promise((a,s)=>{let c=!1,l=0,d=0;e.oncomplete=e=>a(e.renderedBuffer);const u=()=>{setTimeout(()=>s(ln("timeout")),Math.min(o,d+i-Date.now()))},f=()=>{try{const o=e.startRendering();switch(Tt(o)&&At(o),e.state){case"running":d=Date.now(),c&&u();break;case"suspended":document.hidden||l++,c&&l>=t?s(ln("suspended")):setTimeout(f,n)}}catch(o){s(o)}};f(),r=()=>{c||(c=!0,d>0&&u())}});return[a,r]}(o),c=At(a.then(e=>function(e){let t=0;for(let n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}(e.getChannelData(0).subarray(n)),e=>{if("timeout"===e.name||"suspended"===e.name)return-3;throw e}));return()=>(s(),c)}()},screenFrame:function(){const e=tn()&&sn()&&on(),t=rn()&&an();if(e||t)return()=>Promise.resolve(void 0);const n=yn();return()=>d(null,null,function*(){const e=yield n(),t=e=>null===e?null:Ft(e,10);return[t(e[0]),t(e[1]),t(e[2]),t(e[3])]})},canvas:function(){return function(e){let t,n,o=!1;const[i,r]=function(){const e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}();!function(e,t){return!(!t||!e.toDataURL)}(i,r)?t=n="unsupported":(o=function(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}(r),e?t=n="skipped":[t,n]=function(e,t){!function(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';const n=`Cwm fjordbank gly ${String.fromCharCode(55357,56835)}`;t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45)}(e,t);const n=gn(e),o=gn(e);if(n!==o)return["unstable","unstable"];!function(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(const[n,o,i]of[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]])t.fillStyle=n,t.beginPath(),t.arc(o,i,40,0,2*Math.PI,!0),t.closePath(),t.fill();t.fillStyle="#f9c",t.arc(60,60,60,0,2*Math.PI,!0),t.arc(60,60,20,0,2*Math.PI,!0),t.fill("evenodd")}(e,t);const i=gn(e);return[i,n]}(i,r));return{winding:o,geometry:t,text:n}}(function(){const e=tn()&&sn()&&on(),t=rn()&&function(){const e=window,t=navigator,{CSS:n}=e;return Bt(["userActivation"in t,n.supports("color","light-dark(#000, #fff)"),n.supports("height","1lh"),"globalPrivacyControl"in t])>=3}();return e||t}())},osCpu:function(){return navigator.oscpu},languages:function(){const e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(void 0!==n&&t.push([n]),Array.isArray(e.languages))en()&&function(){const e=window;return Bt([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}()||t.push(e.languages);else if("string"==typeof e.languages){const n=e.languages;n&&t.push(n.split(","))}return t},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return Rt(Pt(navigator.deviceMemory),void 0)},screenResolution:function(){if(!(tn()&&sn()&&on()))return function(){const e=screen,t=e=>Rt(Ot(e),null),n=[t(e.width),t(e.height)];return n.sort().reverse(),n}()},hardwareConcurrency:function(){const e=Rt(Ot(navigator.hardwareConcurrency),void 0);return void 0!==e&&rn()&&an()?e>=8?8:4:e},timezone:function(){var e;const t=null===(e=window.Intl)||void 0===e?void 0:e.DateTimeFormat;if(t){const e=(new t).resolvedOptions().timeZone;if(e)return e}const n=-function(){const e=(new Date).getFullYear();return Math.max(Pt(new Date(e,0,1).getTimezoneOffset()),Pt(new Date(e,6,1).getTimezoneOffset()))}();return`UTC${n>=0?"+":""}${n}`},sessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},localStorage:function(){try{return!!window.localStorage}catch(e){return!0}},indexedDB:function(){if(!Qt()&&!function(){const e=window,t=navigator;return Bt(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Qt()}())try{return!!window.indexedDB}catch(e){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){const{platform:e}=navigator;return"MacIntel"===e&&tn()&&!nn()?function(){if("iPad"===navigator.platform)return!0;const e=screen,t=e.width/e.height;return Bt(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}()?"iPad":"iPhone":e},plugins:function(){const e=navigator.plugins;if(!e)return;const t=[];for(let n=0;n<e.length;++n){const o=e[n];if(!o)continue;const i=[];for(let e=0;e<o.length;++e){const t=o[e];i.push({type:t.type,suffixes:t.suffixes})}t.push({name:o.name,description:o.description,mimeTypes:i})}return t},touchSupport:function(){const e=navigator;let t,n=0;void 0!==e.maxTouchPoints?n=Ot(e.maxTouchPoints):void 0!==e.msMaxTouchPoints&&(n=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),t=!0}catch(o){t=!1}return{maxTouchPoints:n,touchEvent:t,touchStart:"ontouchstart"in window}},vendor:function(){return navigator.vendor||""},vendorFlavors:function(){const e=[];for(const t of["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"]){const n=window[t];n&&"object"==typeof n&&e.push(t)}return e.sort()},cookiesEnabled:function(){const e=document;try{e.cookie="cookietest=1; SameSite=Strict;";const t=-1!==e.cookie.indexOf("cookietest=");return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch(t){return!1}},colorGamut:function(){for(const e of["rec2020","p3","srgb"])if(matchMedia(`(color-gamut: ${e})`).matches)return e},invertedColors:function(){return!!Sn("inverted")||!Sn("none")&&void 0},forcedColors:function(){return!!Cn("active")||!Cn("none")&&void 0},monochrome:function(){if(matchMedia("(min-monochrome: 0)").matches){for(let e=0;e<=100;++e)if(matchMedia(`(max-monochrome: ${e})`).matches)return e;throw new Error("Too high value")}},contrast:function(){return kn("no-preference")?0:kn("high")||kn("more")?1:kn("low")||kn("less")?-1:kn("forced")?10:void 0},reducedMotion:function(){return!!En("reduce")||!En("no-preference")&&void 0},reducedTransparency:function(){return!!In("reduce")||!In("no-preference")&&void 0},hdr:function(){return!!Ln("high")||!Ln("standard")&&void 0},math:function(){const e=Wn.acos||Tn,t=Wn.acosh||Tn,n=Wn.asin||Tn,o=Wn.asinh||Tn,i=Wn.atanh||Tn,r=Wn.atan||Tn,a=Wn.sin||Tn,s=Wn.sinh||Tn,c=Wn.cos||Tn,l=Wn.cosh||Tn,d=Wn.tan||Tn,u=Wn.tanh||Tn,f=Wn.exp||Tn,p=Wn.expm1||Tn,h=Wn.log1p||Tn;return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:(g=1e154,Wn.log(g+Wn.sqrt(g*g-1))),asin:n(.12312423423423424),asinh:o(1),asinhPf:(e=>Wn.log(e+Wn.sqrt(e*e+1)))(1),atanh:i(.5),atanhPf:(e=>Wn.log((1+e)/(1-e))/2)(.5),atan:r(.5),sin:a(-1e300),sinh:s(1),sinhPf:(e=>Wn.exp(e)-1/Wn.exp(e)/2)(1),cos:c(10.000000000123),cosh:l(1),coshPf:(e=>(Wn.exp(e)+1/Wn.exp(e))/2)(1),tan:d(-1e300),tanh:u(1),tanhPf:(e=>(Wn.exp(2*e)-1)/(Wn.exp(2*e)+1))(1),exp:f(1),expm1:p(1),expm1Pf:(e=>Wn.exp(e)-1)(1),log1p:h(10),log1pPf:(e=>Wn.log(1+e))(10),powPI:(e=>Wn.pow(Wn.PI,e))(-100)};var g},pdfViewerEnabled:function(){return navigator.pdfViewerEnabled},architecture:function(){const e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]},applePay:function(){const{ApplePaySession:e}=window;if("function"!=typeof(null==e?void 0:e.canMakePayments))return-1;if(On())return-3;try{return e.canMakePayments()?1:0}catch(t){return function(e){if(e instanceof Error&&"InvalidAccessError"===e.name&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}(t)}},privateClickMeasurement:function(){var e;const t=document.createElement("a"),n=null!==(e=t.attributionSourceId)&&void 0!==e?e:t.attributionsourceid;return void 0===n?void 0:String(n)},audioBaseLatency:function(){if(!(cn()||tn()))return-2;if(!window.AudioContext)return-1;const e=(new AudioContext).baseLatency;return null==e?-1:isFinite(e)?e:-3},dateTimeLocale:function(){if(!window.Intl)return-1;const e=window.Intl.DateTimeFormat;if(!e)return-2;const t=e().resolvedOptions().locale;return t||""===t?t:-3},webGlBasics:function({cache:e}){var t,n,o,i,r,a;const s=jn(e);if(!s)return-1;if(!zn(s))return-2;const c=Dn()?null:s.getExtension(Vn);return{version:(null===(t=s.getParameter(s.VERSION))||void 0===t?void 0:t.toString())||"",vendor:(null===(n=s.getParameter(s.VENDOR))||void 0===n?void 0:n.toString())||"",vendorUnmasked:c?null===(o=s.getParameter(c.UNMASKED_VENDOR_WEBGL))||void 0===o?void 0:o.toString():"",renderer:(null===(i=s.getParameter(s.RENDERER))||void 0===i?void 0:i.toString())||"",rendererUnmasked:c?null===(r=s.getParameter(c.UNMASKED_RENDERER_WEBGL))||void 0===r?void 0:r.toString():"",shadingLanguageVersion:(null===(a=s.getParameter(s.SHADING_LANGUAGE_VERSION))||void 0===a?void 0:a.toString())||""}},webGlExtensions:function({cache:e}){const t=jn(e);if(!t)return-1;if(!zn(t))return-2;const n=t.getSupportedExtensions(),o=t.getContextAttributes(),i=[],r=[],a=[],s=[],c=[];if(o)for(const d of Object.keys(o))r.push(`${d}=${o[d]}`);const l=Hn(t);for(const d of l){const e=t[d];a.push(`${d}=${e}${Pn.has(e)?`=${t.getParameter(e)}`:""}`)}if(n)for(const d of n){if(d===Vn&&Dn()||"WEBGL_polygon_mode"===d&&Gn())continue;const e=t.getExtension(d);if(e)for(const n of Hn(e)){const o=e[n];s.push(`${n}=${o}${Rn.has(o)?`=${t.getParameter(o)}`:""}`)}else i.push(d)}for(const d of Bn)for(const e of Fn){const n=Nn(t,d,e);c.push(`${d}.${e}=${n.join(",")}`)}return s.sort(),a.sort(),{contextAttributes:r,parameters:a,shaderPrecisions:c,extensions:n,extensionParameters:s,unsupportedExtensions:i}}};function $n(e){const t=function(e){if(cn())return.4;if(tn())return!nn()||sn()&&on()?.3:.5;const t="value"in e.platform?e.platform.value:"";if(/^Win/.test(t))return.6;if(/^Mac/.test(t))return.5;return.7}(e),n=function(e){return Ft(.99+.01*e,1e-4)}(t);return{score:t,comment:"$ if upgrade to Pro: https://fingerprint.com/github/?utm_source=oss&utm_medium=referral&utm_campaign=confidence_score".replace(/\$/g,`${n}`)}}function Xn(e){return JSON.stringify(e,(e,t)=>{return t instanceof Error?s({name:(n=t).name,message:n.message,stack:null===(o=n.stack)||void 0===o?void 0:o.split("\n")},n):t;var n,o},2)}function Jn(e){return Ut(function(e){let t="";for(const n of Object.keys(e).sort()){const o=e[n],i="error"in o?"error":JSON.stringify(o.value);t+=`${t?"|":""}${n.replace(/([:|\\])/g,"\\$1")}:${i}`}return t}(e))}function Kn(e=50){return function(e,t=1/0){const{requestIdleCallback:n}=window;return n?new Promise(e=>n.call(window,()=>e(),{timeout:t})):Lt(Math.min(e,t))}(e,2*e)}function Un(e,t){const n=Date.now();return{get(o){return d(this,null,function*(){const i=Date.now(),r=yield e(),a=function(e){let t;const n=$n(e);return{get visitorId(){return void 0===t&&(t=Jn(this.components)),t},set visitorId(e){t=e},confidence:n,components:e,version:It}}(r);return(t||(null==o?void 0:o.debug))&&console.log(`Copy the text below to get the debug data:\n\n\`\`\`\nversion: ${a.version}\nuserAgent: ${navigator.userAgent}\ntimeBetweenLoadAndGet: ${i-n}\nvisitorId: ${a.visitorId}\ncomponents: ${Xn(r)}\n\`\`\``),a})}}}var qn={load:function(){return d(this,arguments,function*(e={}){const{delayFallback:t,debug:n,monitoring:o=!0}=e;o&&function(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{const e=new XMLHttpRequest;e.open("get",`https://m1.openfpcdn.io/fingerprintjs/v${It}/npm-monitoring`,!0),e.send()}catch(e){console.error(e)}}(),yield Kn(t);const i=function(e){return qt(Yn,e,[])}({cache:{},debug:n});return Un(i,n)})},hashComponents:Jn,componentsToDebugString:Xn};let Qn=null;const eo="undefined"!=typeof window&&window.Brainfish?window.Brainfish:(Qn||(Qn=function(){const e=[];let t=null;function n(n,o){if(t){const e=n.split(".");let i=t;for(let t=0;t<e.length-1;t++)i=i[e[t]];const r=i[e[e.length-1]];if("function"==typeof r)return r.apply(i,o)}else e.push([n,o])}return{Widgets:{init:(...e)=>n("Widgets.init",e),setTheme:(...e)=>n("Widgets.setTheme",e),identify:(...e)=>n("Widgets.identify",e),setSecretAttributes:(...e)=>n("Widgets.setSecretAttributes",e),open:()=>n("Widgets.open",[]),close:()=>n("Widgets.close",[]),createNewThread:()=>n("Widgets.createNewThread",[]),openModalForm:({formUrl:e,width:t,height:o})=>n("Widgets.openModalForm",[{formUrl:e,width:t,height:o}]),registerClientActionHandler:(...e)=>n("Widgets.registerClientActionHandler",e),onContextHelp:(...e)=>n("Widgets.onContextHelp",e),restoreConversation:(...e)=>n("Widgets.restoreConversation",e),clearConversation:()=>n("Widgets.clearConversation",[]),isReady:!1},SearchWidget:{initStandard:(...e)=>n("SearchWidget.initStandard",e)},HelpWidget:{initPopup:(...e)=>n("HelpWidget.initPopup",e),close:(...e)=>n("HelpWidget.close",e),open:(...e)=>n("HelpWidget.open",e),toggle:(...e)=>n("HelpWidget.toggle",e)},_setRealBrainfish(o){for(t=o;e.length>0;){const[t,o]=e.shift();n(t,o)}}}}(),"undefined"!=typeof window&&(window.Brainfish=Qn)),Qn),to=new Map,no=new Map;let oo=!1;function io(e,t,n,o,i){return d(this,null,function*(){var r,a,s,c,l,d,u;const f=(null==(r=e.overrides)?void 0:r.enableRecording)||(null==(a=null==t?void 0:t.settings)?void 0:a.enableRecording)||!1,p=(null==(s=e.overrides)?void 0:s.version)||(null==t?void 0:t.version);no.set(e.widgetKey,{options:e,config:t,apiHost:n,analyticsApiHost:o,fingerprint:i});const h=[];(null==p?void 0:p.startsWith("2."))?(mt(e,t,i),oo||(oo=!0,Et(()=>{no.forEach(({options:e,config:t,fingerprint:n})=>{var o;const i=(null==(o=e.overrides)?void 0:o.version)||(null==t?void 0:t.version);(null==i?void 0:i.startsWith("2."))&&mt(e,t,n)})}))):h.push(E(e,t)),h.push(M(e.widgetKey,t.trackingToken||"",n,o,f,{blocklist:null==(c=null==t?void 0:t.settings)?void 0:c.recordingBlocklist,sampleRate:null==(d=null==(l=null==t?void 0:t.settings)?void 0:l.ambientSettings)?void 0:d.sampleRate,_allowLocalhostRecording:null==(u=null==t?void 0:t.settings)?void 0:u._allowLocalhostRecording})),h.push(wt(n,e.widgetKey));const[g]=yield Promise.allSettled(h);g&&"fulfilled"===g.status&&g.value&&eo._setRealBrainfish(g.value)})}eo.Widgets.isReady=!1,eo.Widgets.identify=e=>{window.BrainfishAnalytics("identify",e)},eo.Widgets.setSecretAttributes=e=>{try{const{alg:t}=p(e);if("dir"!==t)throw new Error("Invalid algorithm")}catch(n){return void console.error("[Brainfish] Invalid JWE provided to setSecretAttributes:",n)}const t=document.querySelector("#bf-iframe-container .trigger-iframe");if(t){const n=()=>{t.contentWindow&&t.contentWindow.postMessage({type:"SET_SECRET_ATTRIBUTES",secretAttributes:e},"*")};t.contentWindow&&n(),t.addEventListener("load",n)}},eo.Widgets.init=e=>d(null,null,function*(){window&&(window.BrainfishAnalytics=window.BrainfishAnalytics||function(...e){(window.BrainfishAnalytics.q=window.BrainfishAnalytics.q||[]).push(e)});const t=S(e.overrides),n=(null==(o=e.overrides)?void 0:o.analyticsApiHost)||"";var o;let i,r;try{const e=yield qn.load();i=(yield e.get()).visitorId}catch(s){console.warn("[Brainfish] Error loading fingerprint:",s)}if(e.config)r=JSON.parse(A(e.config));else{const{config:n}=yield w({widgetKey:e.widgetKey,apiHost:t});r=n}let a=to.get(e.widgetKey);if(a||(a=io(e,r,t,n,i),to.set(e.widgetKey,a)),yield a,!Xe.isWidgetDOMExisting(e.widgetKey,r)){to.delete(e.widgetKey);const o=io(e,r,t,n,i);to.set(e.widgetKey,o),yield o}yield yt(r),eo.Widgets.isReady=!0,window.dispatchEvent(new Event("onBrainfishReady"))}),eo.Widgets.setTheme=e=>{var t;const n=document.querySelector("#bf-iframe-container .trigger-iframe");if(n){const o=new URL(n.src),i=new URLSearchParams(o.hash.substring(1)),r=i.get("theme");let a;r&&(a=JSON.parse(A(r)));const c=s(s({},a),e);null==(t=n.contentWindow)||t.postMessage({type:"SET_THEME",theme:c},"*");const l=_(JSON.stringify(c));i.set("theme",l),o.hash=`#${i.toString()}`,n.src=o.toString()}},eo.Widgets.registerClientActionHandler=(e,t)=>{((e,t)=>{it.set(e,t)})(e,t)};exports.BrainfishAnalytics=(...e)=>{"undefined"!=typeof window&&window.BrainfishAnalytics&&window.BrainfishAnalytics(...e)},exports.default=eo;
|
|
1
|
+
"use strict";var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,a=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,s=(e,t)=>{for(var n in t||(t={}))i.call(t,n)&&a(e,n,t[n]);if(o)for(var n of o(t))r.call(t,n)&&a(e,n,t[n]);return e},c=(e,o)=>t(e,n(o)),l=(e,t,n)=>a(e,"symbol"!=typeof t?t+"":t,n),d=(e,t,n)=>new Promise((o,i)=>{var r=e=>{try{s(n.next(e))}catch(t){i(t)}},a=e=>{try{s(n.throw(e))}catch(t){i(t)}},s=e=>e.done?o(e.value):Promise.resolve(e.value).then(r,a);s((n=n.apply(e,t)).next())});!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f7149b48-e38f-433c-ae02-425000419f3f",e._sentryDebugIdIdentifier="sentry-dbid-f7149b48-e38f-433c-ae02-425000419f3f")}catch(n){}}(),Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),new TextEncoder;const u=new TextDecoder;const f=e=>{let t=e;t instanceof Uint8Array&&(t=u.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n})(t)}catch(n){throw new TypeError("The input to be decoded is not correctly encoded.")}};function p(e){let t;if("string"==typeof e){const n=e.split(".");3!==n.length&&5!==n.length||([t]=n)}else if("object"==typeof e&&e){if(!("protected"in e))throw new TypeError("Token does not contain a Protected Header");t=e.protected}try{if("string"!=typeof t||!t)throw new Error;const e=JSON.parse(u.decode(f(t)));if(!function(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}(e))throw new Error;return e}catch(n){throw new TypeError("Invalid Token or Protected Header formatting")}}var h,g,m,b;("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"web-widget@1.23.0"},(g=h||(h={})).Sidebar="sidebar",g.Searchbar="searchbar",g.Popup="popup",h.Sidebar,h.Searchbar,h.Popup;class y extends Error{constructor(e,t){super(e,t),l(this,"cause"),this.name="BrainfishWidgetError",this.cause=null==t?void 0:t.cause,Error.captureStackTrace&&Error.captureStackTrace(this,y),this.cause instanceof Error&&this.cause.stack&&(this.stack=this.stack+"\nCaused by: "+this.cause.stack)}toJSON(){return{name:this.name,message:this.message,stack:this.stack,cause:this.cause instanceof Error?{name:this.cause.name,message:this.cause.message,stack:this.cause.stack}:this.cause}}}(b=m||(m={})).LINK="link",b.CALLBACK="callback",b.EMAIL="email",b.PHONE="phone";const w=(e,t,n,o)=>{let i=n,r={};if(t instanceof Error)try{r=JSON.parse(t.message),i+=` - ${r.message||t.message}`}catch(a){i+=` - ${t.message}`}else i+=` - ${String(t)}`;((e,t,n)=>{if(!navigator||navigator.userAgent.toLowerCase().includes("headless"))return;const o=t.toJSON(),i=e||"https://app.brainfi.sh",r={error:`WebWidgetVersion: 1.23.0. ${t.message}`,stack:t.stack,cause:{message:o.message,stack:o.stack,cause:o.cause}};fetch(`${i}/api/trackError.widget.create`,{method:"POST",headers:{"Content-Type":"application/json","api-key":n},body:JSON.stringify(r)})})(e,new y(i,{cause:r}),o)};const v=e=>d(null,[e],function*({widgetKey:e,apiHost:t}){return function(e,t,n){return d(this,null,function*(){let o,i=0;for(;i<3;)try{const o=yield fetch(`${e}${t}`,{method:"POST",headers:{"Content-Type":"application/json","api-key":n}});if(!o.ok)throw new Error(`API call failed with status: ${o.status}`);const i=yield o.json();if(!i)throw new Error("Error loading config: empty response");return i}catch(r){if(o=r,i++,i>=3)throw w(e,r,"Error fetching config",n),o;yield new Promise(e=>setTimeout(e,500))}})}(t,"/api/searchWidgets.getConfigByKey",e)}),x=({config:e,apiKey:t,apiHost:n})=>{const o=e.settings||{};return["bodyActionButtons","footerActionButtons","nextBestActions"].forEach(e=>{o[e]&&(o[e]=o[e].map(e=>e.type===m.CALLBACK&&e.value?c(s({},e),{value:new Function(`return ${e.value}`)()}):e))}),c(s({},e),{settings:o,apiHost:n,widgetMode:e.widgetType,apiKey:t})},S=e=>(null==e?void 0:e.apiHost)||"https://app.brainfi.sh",C=e=>d(null,[e],function*({apiHost:e,widgetKey:t,version:n}){try{const e=`https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${n}/dist/web.js`,t=yield(e=>d(null,null,function*(){return document.getElementById("brainfish-widget")?window.Brainfish:new Promise((t,n)=>{const o=document.createElement("script");o.id="brainfish-widget",o.src=e,o.type="module",o.async=!0,o.crossOrigin="anonymous",o.onload=()=>{setTimeout(()=>{const e=window.Brainfish;e?t(e):n(new Error("Failed to load Brainfish module"))},200)},o.onerror=t=>{const o=t,i={message:`Failed to load script: ${e}`,type:o.type,fileName:o.filename,lineNumber:o.lineno,columnNumber:o.colno,error:o.error?o.error.toString():"Unknown error"};n(new Error(JSON.stringify(i)))},document.head.appendChild(o)})}))(e);return{widget:t}}catch(o){Math.random()<.05&&w(e,o,o.message,t)}});const k=new Set,E=(e,t)=>d(null,null,function*(){const n=S(e.overrides);try{if(k.has(e.widgetKey))return;const o=yield C({apiHost:n,widgetKey:e.widgetKey,version:t.version||"latest"});if(o){const{widget:i}=o,r=x({config:t,apiKey:e.widgetKey,apiHost:n});return e.overrides&&t.settings&&Object.entries(e.overrides).forEach(([e,n])=>{t.settings&&e in t.settings&&(t.settings[e]=((e=[],t)=>{const n=new Map(e.map(e=>[e.label,e]));return t.forEach(e=>n.set(e.label,e)),Array.from(n.values())})(t.settings[e],n))}),function(e,t){t.widgetType===h.Searchbar||"Search"===t.widgetType?e.SearchWidget.initStandard(t):e.HelpWidget.initPopup(t)}(i,r),k.add(e.widgetKey),i}}catch(o){w(n,o,o.message,e.widgetKey)}}),I=()=>{try{if("undefined"==typeof window||!("localStorage"in window)||null===window.localStorage)return!1;const e="__brainfish_storage_test__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&"QuotaExceededError"===e.name}},L=e=>{try{if(I())return window.localStorage.getItem(e)}catch(t){}return null},W=e=>{try{I()&&window.localStorage.removeItem(e)}catch(t){}};let T=!1;const _=(e,t,n,...o)=>d(null,[e,t,n,...o],function*(e,t,n,o="",i=!1,r){if(t||void 0!==console.warn&&console.warn("[Brainfish] BrainfishAnalytics not initialized. Access key is required."),!T)try{const a=(()=>{if("undefined"==typeof window||"undefined"==typeof navigator)return!1;const e=navigator,t=window,n=(e.doNotTrack||t.doNotTrack||e.msDoNotTrack||"0").toString().toLowerCase();return["1","yes","true"].includes(n)})(),s="true"===L("bf_tracking_disabled"),c=a||s;window.BrainfishAnalytics("init",{apiUrl:o,accessKey:t,trackScreenViews:!0,trackAttributes:!c,trackOutgoingLinks:!c,enableRecording:!c&&i,recordingOptions:r}),T=!0,yield((e,t)=>d(null,null,function*(){return document.getElementById("brainfish-analytics")?window.BrainfishAnalytics:new Promise(n=>{const o=document.createElement("script");o.id="brainfish-analytics",o.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/web-tracker@latest/dist/tracker.js",o.type="module",o.async=!0,o.crossOrigin="anonymous",o.onload=()=>{setTimeout(()=>{n(window.BrainfishAnalytics)},200)},o.onerror=()=>{Math.random()<.05&&w(e,new Error(`Failed to load script: ${o.src}`),`Failed to load script: ${o.src}`,t),n(void 0)},document.head.appendChild(o)})}))(n,e)}catch(a){w(n,a,"Failed to initialize BrainfishAnalytics",e)}});function M(e){const t=(new TextEncoder).encode(e);if("undefined"!=typeof window&&"function"==typeof window.btoa){const e=Array.from(t,e=>String.fromCharCode(e)).join("");return btoa(e)}if("undefined"!=typeof Buffer)return Buffer.from(t).toString("base64");throw new Error("[utils.base64Encode]: Unsupported environment")}const A=e=>{if("undefined"!=typeof window&&"function"==typeof window.atob){const t=atob(e),n=t.length,o=new Uint8Array(n);for(let e=0;e<n;e++)o[e]=t.charCodeAt(e);return(new TextDecoder).decode(o)}if("undefined"!=typeof Buffer)return Buffer.from(e,"base64").toString("utf-8");throw new Error("[utils.base64Decode]: Unsupported environment")},O="USER_IDENTIFY";let P=null;const R=new Set,B=new Map;let F=!1;function j(e){try{return new URL(e).origin}catch(t){return e}}function N(e){R.add(j(e))}function V(e,t,n){var o;const i=function(e,t){try{return new URL(e.src).origin}catch(n){if(t)return j(t)}return"*"}(e,n);null==(o=e.contentWindow)||o.postMessage({type:O,payload:t},i)}function H(e,t,n){var o;N(t),B.set(e,{widgetHost:t});const i=()=>{P&&V(e,P,t)};e.addEventListener("load",i,(null==n?void 0:n.signal)?{signal:n.signal}:void 0),null==(o=null==n?void 0:n.signal)||o.addEventListener("abort",()=>{B.delete(e)},{once:!0}),e.contentWindow&&i()}function Z(e){var t;"REQUEST_USER_IDENTITY"===(null==(t=e.data)?void 0:t.type)&&P&&e.source&&function(e){if(R.has(e))return!0;for(const n of B.keys())try{if(new URL(n.src).origin===e)return!0}catch(t){}return!1}(e.origin)&&(!function(e){if(!e)return!1;for(const t of B.keys())if(t.contentWindow===e)return!0;return!1}(e.source)?console.warn("[Brainfish] Rejected REQUEST_USER_IDENTITY from untrusted iframe source:",e.origin):e.source.postMessage({type:O,payload:P},e.origin))}function D(){F||"undefined"==typeof window||(F=!0,window.addEventListener("message",Z))}const G=new Set(["userId","firstName","lastName","email","phone","avatar","properties"]);function z(e){D();const t=function(e){const t=e.userId,n="string"==typeof t?t:"number"==typeof t&&Number.isFinite(t)?String(t):"";if(!n)return console.warn("[Brainfish] Widgets.identify requires a non-empty userId (string or finite number)."),null;const o={userId:n};"string"==typeof e.firstName&&(o.firstName=e.firstName),"string"==typeof e.lastName&&(o.lastName=e.lastName),"string"==typeof e.email&&(o.email=e.email),"string"==typeof e.phone&&(o.phone=e.phone),"string"==typeof e.avatar&&(o.avatar=e.avatar);const i={};for(const a of Object.keys(e))G.has(a)||(i[a]=e[a]);const r=e.properties&&"object"==typeof e.properties&&!Array.isArray(e.properties)?e.properties:void 0;return(Object.keys(i).length>0||r)&&(o.properties=s(s({},i),r)),o}(e);return t?(t.phone&&!/^\+[1-9]\d{1,14}$/.test(t.phone)&&console.warn("[Brainfish] phone should be in E.164 format (e.g., +14155552671)."),P=t,function(e){for(const[t,{widgetHost:n}]of B)V(t,e,n)}(t),t):null}function Y(e){if(e.__bfIdentityWrapped)return e;const t=(t,...n)=>{if("identify"===t&&n[0]&&"object"==typeof n[0]&&!Array.isArray(n[0])){const o=z(n[0]);if(o)return e(t,o,...n.slice(1))}return e(t,...n)};return t.__bfIdentityWrapped=!0,e.q&&(t.q=e.q),t}let $=!1;function X(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var J,K={exports:{}},U={exports:{}},q={exports:{}};function Q(){return J||(J=1,function(e,t){function n(e){return Math.round(255*e)}function o(e,t,o){return n(e)+","+n(t)+","+n(o)}t.__esModule=!0,t.default=void 0,t.default=function(e,t,n,i){if(void 0===i&&(i=o),0===t)return i(n,n,n);var r=(e%360+360)%360/60,a=(1-Math.abs(2*n-1))*t,s=a*(1-Math.abs(r%2-1)),c=0,l=0,d=0;r>=0&&r<1?(c=a,l=s):r>=1&&r<2?(c=s,l=a):r>=2&&r<3?(l=a,d=s):r>=3&&r<4?(l=s,d=a):r>=4&&r<5?(c=s,d=a):r>=5&&r<6&&(c=a,d=s);var u=n-a/2;return i(c+u,l+u,d+u)},e.exports=t.default}(q,q.exports)),q.exports}var ee,te={exports:{}};function ne(){return ee||(ee=1,function(e,t){t.__esModule=!0,t.default=void 0;var n={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};t.default=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return n[t]?"#"+n[t]:e},e.exports=t.default}(te,te.exports)),te.exports}var oe,ie,re,ae={exports:{}};function se(){return oe||(oe=1,function(e,t){function n(e){var t="function"==typeof Map?new Map:void 0;return n=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(o())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var a=new(e.bind.apply(e,r));return n&&i(a,n.prototype),a}(e,arguments,r(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),i(n,e)},n(e)}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!e})()}function i(e,t){return(i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}t.__esModule=!0,t.default=void 0;var a={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found and no default was provided.\n\n",75:"important requires a valid style object, got a %s instead.\n\n",76:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",77:'remToPx expects a value in "rem" but you provided it in "%s".\n\n',78:'base must be set in "px" or "%" but you set it in "%s".\n'};function s(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o,i=t[0],r=[];for(o=1;o<t.length;o+=1)r.push(t[o]);return r.forEach(function(e){i=i.replace(/%[a-z]/,e)}),i}t.default=function(e){var t,n;function o(t){var n;if("production"===process.env.NODE_ENV)n=e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+t+" for more information.")||this;else{for(var o=arguments.length,i=new Array(o>1?o-1:0),r=1;r<o;r++)i[r-1]=arguments[r];n=e.call(this,s.apply(void 0,[a[t]].concat(i)))||this}return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n)}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,i(t,n),o}(n(Error)),e.exports=t.default}(ae,ae.exports)),ae.exports}function ce(){return ie||(ie=1,function(e,t){t.__esModule=!0,t.default=function(e){if("string"!=typeof e)throw new i.default(3);var t=(0,o.default)(e);if(t.match(a))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(s)){var r=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:r}}if(t.match(c))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(l)){var h=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:h}}var g=d.exec(t);if(g)return{red:parseInt(""+g[1],10),green:parseInt(""+g[2],10),blue:parseInt(""+g[3],10)};var m=u.exec(t.substring(0,50));if(m)return{red:parseInt(""+m[1],10),green:parseInt(""+m[2],10),blue:parseInt(""+m[3],10),alpha:parseFloat(""+m[4])>1?parseFloat(""+m[4])/100:parseFloat(""+m[4])};var b=f.exec(t);if(b){var y=parseInt(""+b[1],10),w=parseInt(""+b[2],10)/100,v=parseInt(""+b[3],10)/100,x="rgb("+(0,n.default)(y,w,v)+")",S=d.exec(x);if(!S)throw new i.default(4,t,x);return{red:parseInt(""+S[1],10),green:parseInt(""+S[2],10),blue:parseInt(""+S[3],10)}}var C=p.exec(t.substring(0,50));if(C){var k=parseInt(""+C[1],10),E=parseInt(""+C[2],10)/100,I=parseInt(""+C[3],10)/100,L="rgb("+(0,n.default)(k,E,I)+")",W=d.exec(L);if(!W)throw new i.default(4,t,L);return{red:parseInt(""+W[1],10),green:parseInt(""+W[2],10),blue:parseInt(""+W[3],10),alpha:parseFloat(""+C[4])>1?parseFloat(""+C[4])/100:parseFloat(""+C[4])}}throw new i.default(5)};var n=r(Q()),o=r(ne()),i=r(se());function r(e){return e&&e.__esModule?e:{default:e}}var a=/^#[a-fA-F0-9]{6}$/,s=/^#[a-fA-F0-9]{8}$/,c=/^#[a-fA-F0-9]{3}$/,l=/^#[a-fA-F0-9]{4}$/,d=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,u=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,f=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,p=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;e.exports=t.default}(U,U.exports)),U.exports}function le(){return re||(re=1,function(e,t){t.__esModule=!0,t.default=function(e){if("transparent"===e)return 0;var t=(0,o.default)(e),n=Object.keys(t).map(function(e){var n=t[e]/255;return n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}),i=n[0],r=n[1],a=n[2];return parseFloat((.2126*i+.7152*r+.0722*a).toFixed(3))};var n,o=(n=ce())&&n.__esModule?n:{default:n};e.exports=t.default}(K,K.exports)),K.exports}const de=X(le());var ue,fe={exports:{}},pe={exports:{}};function he(){return ue||(ue=1,function(e,t){function n(e,t,o){return function(){var i=o.concat(Array.prototype.slice.call(arguments));return i.length>=t?e.apply(this,i):n(e,t,i)}}t.__esModule=!0,t.default=function(e){return n(e,e.length,[])},e.exports=t.default}(pe,pe.exports)),pe.exports}var ge,me={exports:{}};function be(){return ge||(ge=1,e=me,(t=me.exports).__esModule=!0,t.default=void 0,t.default=function(e,t,n){return Math.max(e,Math.min(t,n))},e.exports=t.default),me.exports;var e,t}var ye,we,ve={exports:{}},xe={exports:{}};function Se(){return ye||(ye=1,e=xe,(t=xe.exports).__esModule=!0,t.default=void 0,t.default=function(e){var t,n=e.red/255,o=e.green/255,i=e.blue/255,r=Math.max(n,o,i),a=Math.min(n,o,i),s=(r+a)/2;if(r===a)return void 0!==e.alpha?{hue:0,saturation:0,lightness:s,alpha:e.alpha}:{hue:0,saturation:0,lightness:s};var c=r-a,l=s>.5?c/(2-r-a):c/(r+a);switch(r){case n:t=(o-i)/c+(o<i?6:0);break;case o:t=(i-n)/c+2;break;default:t=(n-o)/c+4}return t*=60,void 0!==e.alpha?{hue:t,saturation:l,lightness:s,alpha:e.alpha}:{hue:t,saturation:l,lightness:s}},e.exports=t.default),xe.exports;var e,t}function Ce(){return we||(we=1,function(e,t){t.__esModule=!0,t.default=function(e){return(0,o.default)((0,n.default)(e))};var n=i(ce()),o=i(Se());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(ve,ve.exports)),ve.exports}var ke,Ee={exports:{}},Ie={exports:{}},Le={exports:{}},We={exports:{}};function Te(){return ke||(ke=1,function(e,t){t.__esModule=!0,t.default=void 0;t.default=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e},e.exports=t.default}(We,We.exports)),We.exports}var _e,Me,Ae,Oe={exports:{}};function Pe(){return _e||(_e=1,e=Oe,(t=Oe.exports).__esModule=!0,t.default=void 0,t.default=function(e){var t=e.toString(16);return 1===t.length?"0"+t:t},e.exports=t.default),Oe.exports;var e,t}function Re(){return Me||(Me=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=r(Q()),o=r(Te()),i=r(Pe());function r(e){return e&&e.__esModule?e:{default:e}}function a(e){return(0,i.default)(Math.round(255*e))}function s(e,t,n){return(0,o.default)("#"+a(e)+a(t)+a(n))}t.default=function(e,t,o){return(0,n.default)(e,t,o,s)},e.exports=t.default}(Le,Le.exports)),Le.exports}function Be(){return Ae||(Ae=1,function(e,t){t.__esModule=!0,t.default=function(e,t,i){if("number"==typeof e&&"number"==typeof t&&"number"==typeof i)return(0,n.default)(e,t,i);if("object"==typeof e&&void 0===t&&void 0===i)return(0,n.default)(e.hue,e.saturation,e.lightness);throw new o.default(1)};var n=i(Re()),o=i(se());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ie,Ie.exports)),Ie.exports}var Fe,je={exports:{}};function Ne(){return Fe||(Fe=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r,a){if("number"==typeof e&&"number"==typeof t&&"number"==typeof r&&"number"==typeof a)return a>=1?(0,n.default)(e,t,r):"rgba("+(0,o.default)(e,t,r)+","+a+")";if("object"==typeof e&&void 0===t&&void 0===r&&void 0===a)return e.alpha>=1?(0,n.default)(e.hue,e.saturation,e.lightness):"rgba("+(0,o.default)(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new i.default(2)};var n=r(Re()),o=r(Q()),i=r(se());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(je,je.exports)),je.exports}var Ve,He={exports:{}};function Ze(){return Ve||(Ve=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r){if("number"==typeof e&&"number"==typeof t&&"number"==typeof r)return(0,n.default)("#"+(0,o.default)(e)+(0,o.default)(t)+(0,o.default)(r));if("object"==typeof e&&void 0===t&&void 0===r)return(0,n.default)("#"+(0,o.default)(e.red)+(0,o.default)(e.green)+(0,o.default)(e.blue));throw new i.default(6)};var n=r(Te()),o=r(Pe()),i=r(se());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(He,He.exports)),He.exports}var De,Ge,ze,Ye={exports:{}};function $e(){return De||(De=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r,a){if("string"==typeof e&&"number"==typeof t){var s=(0,n.default)(e);return"rgba("+s.red+","+s.green+","+s.blue+","+t+")"}if("number"==typeof e&&"number"==typeof t&&"number"==typeof r&&"number"==typeof a)return a>=1?(0,o.default)(e,t,r):"rgba("+e+","+t+","+r+","+a+")";if("object"==typeof e&&void 0===t&&void 0===r&&void 0===a)return e.alpha>=1?(0,o.default)(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new i.default(7)};var n=r(ce()),o=r(Ze()),i=r(se());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ye,Ye.exports)),Ye.exports}function Xe(){return Ge||(Ge=1,function(e,t){t.__esModule=!0,t.default=function(e){if("object"!=typeof e)throw new a.default(8);if(l(e))return(0,r.default)(e);if(c(e))return(0,i.default)(e);if(u(e))return(0,o.default)(e);if(d(e))return(0,n.default)(e);throw new a.default(8)};var n=s(Be()),o=s(Ne()),i=s(Ze()),r=s($e()),a=s(se());function s(e){return e&&e.__esModule?e:{default:e}}var c=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)},l=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha},d=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)},u=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha};e.exports=t.default}(Ee,Ee.exports)),Ee.exports}function Je(){return ze||(ze=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(he()),o=a(be()),i=a(Ce()),r=a(Xe());function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}var c=(0,n.default)(function(e,t){if("transparent"===t)return t;var n=(0,i.default)(t);return(0,r.default)(s({},n,{lightness:(0,o.default)(0,1,n.lightness-parseFloat(e))}))});t.default=c,e.exports=t.default}(fe,fe.exports)),fe.exports}const Ke=X(Je());var Ue,qe={exports:{}};function Qe(){return Ue||(Ue=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(he()),o=a(be()),i=a(Ce()),r=a(Xe());function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}var c=(0,n.default)(function(e,t){if("transparent"===t)return t;var n=(0,i.default)(t);return(0,r.default)(s({},n,{lightness:(0,o.default)(0,1,n.lightness+parseFloat(e))}))});t.default=c,e.exports=t.default}(qe,qe.exports)),qe.exports}const et=X(Qe()),tt="bf-iframe-container",nt="bf-trigger-button",ot="bf-search-bar-iframe-container",it="bf-search-bar-iframe-backdrop";function rt(e){var t,n;if(!document.querySelector("style[data-widget-styles]")){!function(e="#000",t="FFF"){const n=document.createElement("style");n.attributes.setNamedItem(document.createAttribute("data-widget-styles"));const o=de(e)>.5;n.textContent=`\n .bf-trigger-button{position:fixed;bottom:16px;right:16px;width:36px;height:36px;border-radius:50%;border:none;box-shadow:0 1px 6px #0000000f,0 2px 32px #00000029;transition:transform 167ms cubic-bezier(.33,0,0,1);box-sizing:content-box;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:1000;padding:12px;gap:10px;overflow:hidden}.bf-trigger-button.hidden{display:none}.trigger-button-icon{display:flex;align-items:center;justify-content:center;width:36px;height:36px;position:relative}.trigger-button-icon svg{width:100%;height:100%;position:absolute;inset:0}.trigger-button-icon>svg>path{transition:transform .3s ease,opacity .3s ease;transform:scale(.5);transform-origin:center;opacity:0}.trigger-button-icon .fish-icon{display:none}.trigger-button-icon .fish-icon.visible{display:block;max-width:36px;max-height:36px}.trigger-button-icon svg.visible{display:block}.trigger-button-icon>svg.visible>path{opacity:1;transform:scale(1)}.trigger-iframe{position:relative;width:100%;height:100%;border:none;outline:none;transform:translateZ(0);overflow:hidden}.bf-iframe-container{visibility:hidden;position:fixed;z-index:2147483000000;background-color:#fff;bottom:0;right:0;width:100vw;height:calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));border:none;overflow:hidden;opacity:0;pointer-events:none;transform:translateY(20px);transition:opacity .3s ease,transform .3s ease,width .2s ease-in-out,height .2s ease-in-out,visibility 0s .3s}.bf-iframe-container.open{visibility:visible;opacity:1;transform:translateY(0);pointer-events:auto;top:env(safe-area-inset-top);left:0;transition-delay:0s}@media (min-width: 576px){.bf-iframe-container{bottom:80px;right:24px;width:448px;height:min(750px,calc(100vh - 80px));border-radius:8px;border:1px solid var(--Dark-300, #d4d4d4);box-shadow:0 20px 25px -5px #1212171a,0 10px 10px -5px #1212170a}.bf-iframe-container.open{top:unset;left:unset}.bf-iframe-container.position-bottom-left{right:auto;left:24px}.bf-iframe-container.position-top-left{inset:80px auto auto 24px}.bf-iframe-container.position-top-right{bottom:auto;top:80px;right:24px}.bf-iframe-container.expanded{width:min(calc(448px * 1.35),calc(100vw - 16px));height:min(calc(750px * 1.35),calc(100vh - 80px))}}.bf-search-bar-iframe-container{position:relative;width:100%;min-height:200px;background-color:#fff;border:1px solid var(--dark-300, #d4d4d4);border-radius:8px;overflow:hidden;pointer-events:auto;transition:height .2s ease-in-out}.iframe-loading-indicator{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;z-index:10}.spinner{width:24px;height:24px;border:2px solid rgba(0,0,0,.1);border-radius:50%;border-top-color:#3498db;animation:spin 1s ease-in-out infinite}@keyframes spin{to{transform:rotate(360deg)}}.loading-error{width:24px;height:24px;position:relative;display:flex;align-items:center;justify-content:center}.loading-error:before,.loading-error:after{content:"";position:absolute;width:16px;height:2px;background-color:#e74c3c;border-radius:2px}.loading-error:before{transform:rotate(45deg)}.loading-error:after{transform:rotate(-45deg)}\n .${nt} { background: ${e}; }\n .${nt}:hover {\n background: ${o?Ke(.05,e):et(.05,e)};\n }\n .trigger-button-icon { color: ${t}; }\n `,document.head.appendChild(n)}((null==(t=null==e?void 0:e.theme)?void 0:t.inputButtonBgColor)||"#007bff",(null==(n=null==e?void 0:e.theme)?void 0:n.textBaseColor)||"#ffffff")}}class at{constructor(e,t){l(this,"isOpen",!1),this.widgetKey=e,this.widgetType=t}get isWidgetOpen(){return this.isOpen}openWidget(){this.isOpen=!0}closeWidget(){this.isOpen=!1}toggleWidget(){return this.isOpen=!this.isOpen,this.isOpen}}function st(e,t,n={}){const o=document.createElement(e);return o.className=t,Object.entries(n).forEach(([e,t])=>{o.setAttribute(e,t)}),o}const ct="brainfish-search-widget";class lt{constructor(e){l(this,"button",null),l(this,"icon",null),l(this,"closeCallback",null),this.widgetType=e}setCloseCallback(e){this.closeCallback=e}get containerClass(){return this.widgetType===h.Searchbar?ot:tt}get container(){return document.querySelector(`.${this.containerClass}`)}get iframe(){var e;return null==(e=this.container)?void 0:e.querySelector("iframe")}get backdrop(){return document.querySelector(`.${it}`)}setElements(e,t){this.button=e||null,this.icon=t||null}openWidget(e={}){var t,n,o;const i=document.querySelector(`.${this.containerClass}`),r=null==i?void 0:i.querySelector("iframe");if(e.newConversation&&e.contextualQuestion?null==(t=null==r?void 0:r.contentWindow)||t.postMessage({type:"CONTEXTUAL_QUESTION",question:e.contextualQuestion},"*"):e.newConversation&&(null==(n=null==r?void 0:r.contentWindow)||n.postMessage({type:"NEW_CONVERSATION"},"*")),null==(o=null==r?void 0:r.contentWindow)||o.postMessage({type:"FOCUS_SEARCH_FIELD"},"*"),this.widgetType!==h.Searchbar&&(null==i||i.classList.add("open"),e.position&&(null==i||i.classList.add(`position-${e.position}`),null==i||i.setAttribute("data-current-position",e.position))),null==i||i.setAttribute("aria-hidden","false"),this.widgetType!==h.Searchbar&&document.body.clientWidth>=962&&null===this.backdrop){const e=st("div",it);this.closeCallback&&e.addEventListener("click",this.closeCallback),document.body.appendChild(e)}this.updateButtonForOpen()}focusNextElement(){const e=document.querySelector(ct);if(e){const t=Array.from(document.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(e=>!e.hasAttribute("disabled")),n=t.indexOf(e);if(-1!==n){const e=t[n+1];e&&e.focus()}}}closeWidget(){const e=this.container;if(!e)return;const t=e.dataset.currentPosition;if(t){const n=()=>{e.dataset.currentPosition===t&&(e.classList.remove(`position-${t}`),delete e.dataset.currentPosition)};e.addEventListener("transitionend",n,{once:!0})}e.classList.remove("open"),e.setAttribute("aria-hidden","true"),this.backdrop&&(this.backdrop.remove(),this.focusNextElement()),this.updateButtonForClose()}updateButtonForOpen(){if(!this.button||!this.icon)return;const e=this.icon.querySelector(".fish-icon"),t=this.icon.querySelector(".close-icon");this.button.setAttribute("aria-expanded","true"),null==e||e.classList.remove("visible"),null==t||t.classList.add("visible"),this.isMobile()&&this.hideTriggerButton()}updateButtonForClose(){if(!this.button||!this.icon)return;const e=this.icon.querySelector(".fish-icon"),t=this.icon.querySelector(".close-icon");this.button.setAttribute("aria-expanded","false"),null==e||e.classList.add("visible"),null==t||t.classList.remove("visible"),this.isMobile()&&this.showTriggerButton()}showTriggerButton(){var e;null==(e=this.button)||e.classList.remove("hidden")}hideTriggerButton(){var e;null==(e=this.button)||e.classList.add("hidden")}resizeContainer(e){if(this.widgetType!==h.Searchbar)return;if(!this.container||!this.iframe)return;const t=Math.max(e,200);this.container.style.height=`${t}px`,this.iframe.style.height=`${t}px`}isMobile(){return document.body.clientWidth<=576}setupButtonClickListener(e){this.button&&this.button.addEventListener("click",e)}static isWidgetDOMExisting(e,t){const n=document.querySelector(`.${ot}[data-widget-key="${e}"]`);if(n){const e=document.querySelector("brainfish-search-widget");return!e||e.contains(n)}if(document.getElementById(`trigger-button-${e}`))return!0;if("Search"!==t.widgetType){if(document.querySelector(`.${tt}`))return!0}return!1}}class dt{static register(e,t){this.instances.set(e,t)}static getInstance(e){return this.instances.get(e)}static unregister(e){this.instances.delete(e)}static getAllInstances(){return Array.from(this.instances.values())}static getOpenInstance(){return this.getAllInstances().find(e=>e.isWidgetOpen)}static getClosedPopupInstance(){return this.getAllInstances().find(e=>!e.isWidgetOpen&&e.widgetType===h.Popup)}static clear(){this.instances.clear()}}l(dt,"instances",new Map);const ut=({formUrl:e,width:t="500px",height:n="600px"})=>{const o=document.createElement("div");o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("tabindex","-1"),o.style.cssText="\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: white;\n padding: 20px;\n border-radius: 8px;\n box-shadow: 0 2px 10px rgba(0,0,0,0.1);\n z-index: 300000000;\n ";const i=document.createElement("button");i.innerHTML="×",i.style.cssText="\n position: absolute;\n right: -16px;\n top: -16px;\n width: 32px;\n height: 32px;\n border: 2px solid #666;\n border-radius: 50%;\n background: #FFF;\n font-size: 20px;\n cursor: pointer;\n ";const r=document.createElement("iframe");r.src=e,r.style.cssText=`width: ${t}; height: ${n}; border: none;`;const a=document.activeElement,s=e=>{if("Tab"===e.key){const t=[i,r],n=document.activeElement,o=n?t.indexOf(n):-1;e.preventDefault(),e.shiftKey?o<=0?t[t.length-1].focus():t[o-1].focus():o>=t.length-1?t[0].focus():t[o+1].focus()}else"Escape"===e.key&&c()},c=()=>{o.remove(),l.remove(),document.removeEventListener("keydown",s),null==a||a.focus()},l=document.createElement("div");l.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0,0,0,0.5);\n z-index: 299999999;\n ",i.onclick=c,l.onclick=c,document.addEventListener("keydown",s),o.appendChild(i),o.appendChild(r),document.body.appendChild(l),document.body.appendChild(o),o.focus(),r.onload=()=>{r.setAttribute("tabindex","0"),i.focus()}},ft=e=>`brainfish_conversation_${e}`,pt={save(e,t){if(t){const o=L(ft(e));let i=Date.now();if(o)try{const e=JSON.parse(o);e.conversationId===t&&(i=e.persistedAt)}catch(n){}const r={conversationId:t,persistedAt:i};((e,t)=>{try{I()&&window.localStorage.setItem(e,t)}catch(n){}})(ft(e),JSON.stringify(r))}else W(ft(e))},load(e){const t=L(ft(e));if(!t)return null;try{const n=JSON.parse(t);return Date.now()-n.persistedAt>72e5?(W(ft(e)),null):n.conversationId}catch(n){return W(ft(e)),null}},clear(e){W(ft(e))}};class ht{static getIframeForInstance(e){var t,n;const o=e.widgetType===h.Searchbar?ot:tt,i=e.widgetType===h.Searchbar?`.${o}[data-widget-key="${e.widgetKey}"]`:`.${o}`;return null!=(n=null==(t=document.querySelector(i))?void 0:t.querySelector("iframe"))?n:null}static postMessageToInstance(e,t){var n,o;null==(o=null==(n=this.getIframeForInstance(e))?void 0:n.contentWindow)||o.postMessage(t,"*")}static initialize(){this.isInitialized||(this.setupDeprecatedAPI(),this.setupNewAPI(),this.isInitialized=!0)}static setupDeprecatedAPI(){var e;(null==(e=window.Brainfish)?void 0:e.HelpWidget)&&(window.Brainfish.HelpWidget.close=e=>this.closeCurrentlyOpenWidget(),window.Brainfish.HelpWidget.open=e=>this.openCurrentlyClosedPopupWidget(e))}static setupNewAPI(){var e;(null==(e=window.Brainfish)?void 0:e.Widgets)&&(window.Brainfish.Widgets.open=e=>this.openCurrentlyClosedPopupWidget(e),window.Brainfish.Widgets.close=()=>this.closeCurrentlyOpenWidget(),window.Brainfish.Widgets.createNewThread=()=>this.createNewThread(),window.Brainfish.Widgets.openModalForm=ut,window.Brainfish.Widgets.onContextHelp=(e,t)=>this.openContextualHelp(e,t),window.Brainfish.Widgets.restoreConversation=e=>this.restoreConversation(e),window.Brainfish.Widgets.clearConversation=()=>this.clearConversation())}static closeCurrentlyOpenWidget(){const e=dt.getOpenInstance();e&&e.closeWidget()}static openCurrentlyClosedPopupWidget(e){const t=dt.getClosedPopupInstance();if(t){const n="string"==typeof e?{trigger:e}:e,o={};(!0===(null==n?void 0:n.newConversation)||(null==n?void 0:n.trigger))&&(o.newConversation=!0),(null==n?void 0:n.trigger)&&(o.trigger=n.trigger),(null==n?void 0:n.position)&&(o.position=n.position),t.openWidget(o)}}static createNewThread(){const e=dt.getOpenInstance();if(e)return void this.postMessageToInstance(e,{type:"NEW_CONVERSATION"});const t=dt.getClosedPopupInstance();t&&t.openWidget({newConversation:!0})}static openContextualHelp(e,t={}){if(!e||"string"!=typeof e||0===e.trim().length)return void console.warn("Brainfish.Widgets.onContextHelp: Invalid question provided");let n=dt.getOpenInstance();if(n||(n=dt.getClosedPopupInstance()),!n)return void console.warn("Brainfish.Widgets.onContextHelp: No popup widget available");const o=c(s({},t),{newConversation:!0,trigger:"contextual-help",contextualQuestion:e.trim()});n.openWidget(o)}static restoreConversation(e){if(!e||"string"!=typeof e)return void console.warn("Brainfish.Widgets.restoreConversation: Invalid conversationId provided");let t=dt.getOpenInstance();const n=!!t;t||(t=dt.getClosedPopupInstance()),t?(n||t.openWidget({newConversation:!1}),this.postMessageToInstance(t,{type:"RESTORE_CONVERSATION",conversationId:e})):console.warn("Brainfish.Widgets.restoreConversation: No popup widget available")}static clearConversation(){var e;const t=null!=(e=dt.getOpenInstance())?e:dt.getClosedPopupInstance();t?(pt.clear(t.widgetKey),this.postMessageToInstance(t,{type:"NEW_CONVERSATION"})):console.warn("Brainfish.Widgets.clearConversation: No popup widget available")}}l(ht,"isInitialized",!1);class gt{constructor(e,t){this.widgetType=e,this.widgetKey=t}trackOpenWidget(e,t){this.dispatchEvent("onBrainfishWidgetOpen"),"contextual-help"===e?this.trackAnalytics("Open Widget - Contextual Help",{trigger:e,question:t}):e?this.trackAnalytics("Open Widget - Custom Trigger",{trigger:e}):this.trackAnalytics("Open Widget")}trackCloseWidget(){this.dispatchEvent("onBrainfishWidgetClose"),this.trackAnalytics("Close Widget")}trackCustomEvent(e,t={}){this.trackAnalytics(e,t)}dispatchEvent(e){window.dispatchEvent(new Event(e))}trackAnalytics(e,t={}){if(window.BrainfishAnalytics){let n;switch(this.widgetType){case h.Searchbar:n="searchbar_widget";break;case h.Sidebar:default:n="search_widget"}window.BrainfishAnalytics("track",e,c(s({},t),{widgetKey:this.widgetKey}),{source:n,widgetKey:this.widgetKey})}}}class mt{constructor(e,t){l(this,"state"),l(this,"domController"),l(this,"analyticsTracker"),this.state=new at(e,t),this.domController=new lt(t),this.domController.setCloseCallback(()=>this.closeWidget()),this.analyticsTracker=new gt(t,e)}static getInstance(e){return dt.getInstance(e)}get widgetKey(){return this.state.widgetKey}get widgetType(){return this.state.widgetType}get isWidgetOpen(){return this.state.isWidgetOpen}get containerClass(){return this.domController.containerClass}initialize({button:e,icon:t,isButtonHidden:n}){this.domController.setElements(e,t),this.domController.setupButtonClickListener(()=>this.toggleIframeVisibility()),dt.register(this.widgetKey,this),ht.initialize()}toggleIframeVisibility(){this.state.toggleWidget()?this.openWidget():this.closeWidget()}openWidget(e={}){var t,n;if(this.state.openWidget(),this.domController.openWidget(e),void 0===(null==e?void 0:e.newConversation)){const e=pt.load(this.widgetKey);e&&(null==(n=null==(t=this.domController.iframe)?void 0:t.contentWindow)||n.postMessage({type:"RESTORE_CONVERSATION",conversationId:e},"*"))}this.analyticsTracker.trackOpenWidget(e.trigger,e.contextualQuestion)}closeWidget(){this.state.closeWidget(),this.domController.closeWidget(),this.analyticsTracker.trackCloseWidget()}showTriggerButton(){this.domController.showTriggerButton()}hideTriggerButton(){this.domController.hideTriggerButton()}resizeContainer(e){this.domController.resizeContainer(e)}trackCustomEvent(e,t={}){this.analyticsTracker.trackCustomEvent(e,t)}destroy(){dt.unregister(this.widgetKey)}static initialize(e){const t=new mt(e.widgetKey,e.widgetType);return t.initialize(e),t}}function bt({widgetUrl:e,widgetType:t,props:n}){const o=t===h.Searchbar?ot:tt,i=st("div",o,s({id:o,"aria-live":"polite","aria-hidden":t===h.Searchbar?"false":"true"},n||{})),r=st("div","iframe-loading-indicator"),a=st("div","spinner");r.setAttribute("aria-label","Loading content"),r.setAttribute("role","status"),r.appendChild(a),i.appendChild(r);const c=st("iframe","trigger-iframe",{src:e,sandbox:"allow-scripts allow-same-origin allow-popups allow-forms",allow:"clipboard-write",role:"dialog"});return c.style.opacity="0",c.addEventListener("load",()=>{r.style.display="none",c.style.opacity="1"}),c.addEventListener("error",e=>{console.error("Error loading iframe:",e),r.innerHTML="";const t=st("div","loading-error");r.appendChild(t),r.setAttribute("aria-label","Failed to load content")}),i.appendChild(c),{iframeContainer:i,iframe:c}}function yt(e,t){const n=()=>{(t=>{var n;null==(n=e.contentWindow)||n.postMessage({type:"UPDATE_BODY_CLASS",isDarkMode:t},"*")})(document.body.classList.contains("dark"))};n(),(()=>{const e=new MutationObserver(n);e.observe(document.body,{attributes:!0,attributeFilter:["class"]}),t.addEventListener("abort",()=>e.disconnect())})()}const wt=new Map,vt=(e,t)=>`Error executing Client Action with key ${e}. Details: ${t instanceof Error?t.message:String(t)}`,xt=(e,t)=>d(null,null,function*(){if(wt.has(e)){const i=wt.get(e);if("function"!=typeof i)return{success:!1,reason:`Client Action registered with key ${e} is not a function`};try{const e=yield i(t);if(n=e,"[object Object]"!==Object.prototype.toString.call(n))throw new TypeError("Invalid result, expecting object type");return{success:!0,data:e}}catch(o){return{success:!1,reason:vt(e,o)}}}var n;return{success:!1,reason:`No Client Action registered with key ${e}`}}),St=new Map,Ct=new Set;function kt(e,{widgetHost:t,apiHost:n,widgetKey:o,widgetType:i,signal:r,stateManager:a}){window.addEventListener("message",r=>d(null,null,function*(){var s,c;if(r.origin!==t)return;const{type:l,widgetKey:d}=r.data;if(!d||d===o){if("TOGGLE_WIDGET_SIZE"===l&&function(){const e=document.querySelector(`.${tt}`);e.classList.contains("expanded")?e.classList.remove("expanded"):e.classList.add("expanded")}(),"RESIZE_IFRAME"===l){const{height:e}=r.data;a.resizeContainer(e)}if("TRACK_EVENT"===l){const{messageId:e,eventName:t,data:n}=r.data;if(e){if(Ct.has(e))return void console.warn(`[Brainfish] Duplicate TRACK_EVENT suppressed for "${t}" (messageId: ${e})`);Ct.add(e),setTimeout(()=>Ct.delete(e),5e3)}a.trackCustomEvent(t,n)}if("CLOSE_WIDGET"===l&&a.closeWidget(),"NEXT_BEST_ACTION_CLICKED"===l){const{action:e,searchQueryId:t,query:i,answer:a,conversation:s}=r.data;if(!["function","callback"].includes(e.type))return void console.error("[Brainfish] Invalid action type:",e);const c=St.get(e.id);if(c&&Date.now()-c<1e3)return void console.warn(`[Brainfish] Duplicate NEXT_BEST_ACTION_CLICKED suppressed for action "${e.id}" (fired ${Date.now()-c}ms ago)`);St.set(e.id,Date.now()),setTimeout(()=>St.delete(e.id),1e3),pt.clear(o);const l={query:i,answer:a,searchIntentId:e.searchIntentId,actionId:e.id,conversationId:(null==s?void 0:s.conversationId)||"",searchQueryId:t,metadata:e.metadata||{},conversation:s||null};try{if(window.__bfCallbacks=window.__bfCallbacks||{},window.__bfCallbacks[e.id])return void window.__bfCallbacks[e.id](i,a,l);const t=new URL(`${n}/api/searchWidgets.callback.codeblocks`);t.searchParams.set("apiKey",o),t.searchParams.set("codeblockId",e.id),l.searchIntentId&&t.searchParams.set("searchIntentId",l.searchIntentId);const r=document.createElement("script");r.src=t.toString(),document.head.appendChild(r),r.onload=()=>{window.__bfCallbacks[e.id](i,a,l),setTimeout(()=>{document.head.removeChild(r)},300)},r.onerror=()=>{console.error("[Brainfish] Failed to load callback script from server")}}catch(u){console.error("[Brainfish] Error executing callback:",u)}}if("CLIENT_EXECUTION"===l){const{actionKey:t,inputs:n,messageId:o}=r.data,i=yield xt(t,n);null==(s=e.contentWindow)||s.postMessage({type:"CLIENT_EXECUTION_RESULT",messageId:o,result:i},"*")}if("CONVERSATION_CHANGED"===l){const{conversationId:e}=r.data;i!==h.Searchbar&&pt.save(o,e)}if("REQUEST_USER_IDENTITY"===l&&r.source===e.contentWindow&&i===h.Popup){const t=pt.load(o);t&&(null==(c=e.contentWindow)||c.postMessage({type:"RESTORE_CONVERSATION",conversationId:t},"*"))}}}),{signal:r})}function Et(e,t,n){let o;const i=()=>{(t=>{var o;const i={type:"UPDATE_BODY_CLASS",isMobile:t};null==(o=e.contentWindow)||o.postMessage(i,"*"),t&&(n.isWidgetOpen?n.hideTriggerButton():n.showTriggerButton())})(document.body.clientWidth<=576)},r=()=>{o&&clearTimeout(o),o=window.setTimeout(i,300)};i(),(()=>{const e=new ResizeObserver(r);e.observe(document.body),t.addEventListener("abort",()=>e.disconnect())})()}const It=new Set;function Lt(e,t,{isButtonHidden:n,triggerButtonIcon:o}){const i=document.createDocumentFragment();let r;if(n)r=mt.initialize({isButtonHidden:n,widgetType:h.Popup,widgetKey:e});else{const{button:t,icon:n}=function(e,t){const n=st("button",nt,{id:`trigger-button-${e}`,"aria-controls":tt,"aria-expanded":"false","data-name":nt}),o=st("div","trigger-button-icon",{"aria-hidden":"true"});return o.innerHTML=t?`\n <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">\n <path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"></path>\n </svg>\n <img src="${t}" class="fish-icon visible" alt="Trigger button icon" aria-hidden="true" aria-label="help button icon" />\n `:'\n <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">\n <path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"></path>\n </svg>\n <svg width="24" height="14" viewBox="0 0 24 14" fill="none" xmlns="http://www.w3.org/2000/svg" class="fish-icon visible">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M1.71844 10.3882L4.60606 6.98384L1.71844 3.58375C1.4014 3.21362 1.44424 2.65841 1.81269 2.33993C1.97978 2.1979 2.65242 1.98701 3.04657 2.43461L5.78425 5.65824C6.14281 5.29523 6.51693 4.95924 6.90479 4.65114C8.88976 3.07437 11.2345 2.22803 13.6931 2.22803C16.9492 2.22803 20.0039 3.71718 22.2917 6.41142C22.5702 6.74282 22.5702 7.22916 22.2917 7.56056C20.0039 10.2591 16.9492 11.744 13.6931 11.744C11.2348 11.744 8.89035 10.8948 6.90554 9.31995C6.51741 9.01199 6.14304 8.67628 5.78425 8.31374L3.04657 11.5374C2.72953 11.9075 2.18114 11.9505 1.81269 11.632C1.44852 11.3179 1.40568 10.7584 1.71844 10.3882ZM5.93026 10.4683C8.17161 12.2599 10.8546 13.25 13.6931 13.25C17.4881 13.25 21.019 11.4034 23.4447 8.52942C24.1873 7.64571 24.1843 6.31801 23.4397 5.43663C20.8944 2.43919 17.4337 0.722025 13.6931 0.722025C10.8555 0.722025 8.17194 1.70845 5.92952 3.50276L4.17682 1.43933C3.57943 0.760929 2.79325 0.630009 2.25286 0.662947C1.98116 0.679506 1.73125 0.736852 1.51895 0.811846C1.26839 0.900352 1.03017 1.02718 0.827835 1.20058C-0.165283 2.05903 -0.283916 3.561 0.574656 4.56345L2.63075 6.98445L0.568104 9.41623C-0.272133 10.4106 -0.166523 11.9125 0.827835 12.7714C1.81372 13.6243 3.34308 13.5062 4.19036 12.5171L5.93026 10.4683Z" fill="currentColor"/>\n </svg>\n ',n.setAttribute("aria-label","Open Brainfish widget"),n.appendChild(o),{button:n,icon:o}}(e,o);i.appendChild(t),r=mt.initialize({button:t,icon:n,widgetType:h.Popup,widgetKey:e})}const{iframeContainer:a,iframe:s}=bt({widgetUrl:t,widgetType:h.Popup});return i.appendChild(a),{fragment:i,iframe:s,stateManager:r}}const Wt=({config:e,widgetUrl:t,apiHost:n,widgetHost:o,widgetKey:i,hideTriggerButton:r})=>{const{settings:a}=e,s=null!=r?r:null==a?void 0:a.hideTriggerButton,c=null==a?void 0:a.triggerButtonIcon;try{if(function(e){return It.has(e)}(i))return;if(function(e){return!!document.getElementById(`trigger-button-${e}`)}(i))return;rt(e);const{fragment:r,iframe:a,stateManager:l}=Lt(i,t,{isButtonHidden:s||!1,triggerButtonIcon:c||""}),d=new AbortController,{signal:u}=d;H(a,o,{signal:u}),a.onload=()=>{setTimeout(()=>{var e;yt(a,u),kt(a,{widgetHost:o,apiHost:n,widgetKey:i,widgetType:h.Popup,signal:u,stateManager:l}),Et(a,u,l);const r=pt.load(i),s=new URL(t).searchParams.has("conversation");r&&!s&&(null==(e=a.contentWindow)||e.postMessage({type:"RESTORE_CONVERSATION",conversationId:r},"*"))},0)},document.body?document.body.appendChild(r):(console.warn("[Brainfish] document.body not ready. Widget initialization deferred."),document.addEventListener("DOMContentLoaded",()=>{document.body.appendChild(r)},{once:!0})),It.add(i);const f=()=>{d.abort(),window.removeEventListener("beforeunload",f)};return void window.addEventListener("beforeunload",f)}catch(l){!function(e,t,n){w(e,t,t.message,n)}(n,l,i)}},Tt=new Map;const _t=({config:e,widgetUrl:t,apiHost:n,widgetHost:o,widgetKey:i})=>{var r,a,s,c;const{settings:l}=e;let d=mt.getInstance(i);null==(r=Tt.get(i))||r.abort();const u=new AbortController;Tt.set(i,u),rt(e);try{const e=document.querySelector(`.${ot}[data-widget-key="${i}"]`),r=document.querySelector(ct);e&&r&&!r.contains(e)&&(r.appendChild(e),0===r.getBoundingClientRect().width&&(null==(a=r.parentElement)||a.style.setProperty("width","100%"))),d||(d=mt.initialize({isButtonHidden:!0,widgetType:h.Searchbar,widgetKey:i}));const{signal:l}=u,f=e=>{H(e,o,{signal:l}),yt(e,l),kt(e,{widgetHost:o,apiHost:n,widgetKey:i,widgetType:h.Searchbar,signal:l,stateManager:d}),Et(e,l,d)};if(e){const t=e.querySelector("iframe");t&&("complete"===(null==(c=t.contentDocument)?void 0:c.readyState)?setTimeout(()=>{f(t)},0):t.onload=()=>{setTimeout(()=>{f(t)},0)})}else{const e=document.createDocumentFragment(),{iframeContainer:n,iframe:o}=bt({widgetUrl:t,widgetType:h.Searchbar,props:{"data-widget-type":"searchbar","data-widget-key":i}});o.onload=()=>{setTimeout(()=>{f(o)},0)},e.appendChild(n),r?(r.appendChild(e),0===r.getBoundingClientRect().width&&(null==(s=r.parentElement)||s.style.setProperty("width","100%"))):document.body.appendChild(e)}const p=()=>{u.abort(),Tt.delete(i),window.removeEventListener("beforeunload",p)};return void window.addEventListener("beforeunload",p)}catch(f){!function(e,t,n){w(e,t,t.message,n)}(n,f,i)}},Mt=(e,t,n)=>{var a;const c=S(e.overrides),l=(null==(d=e.overrides)?void 0:d.widgetHost)||"https://agent.brainfi.sh";var d;N(l);const u=null==(a=e.overrides)?void 0:a.hideTriggerButton,{theme:f,settings:p}=t,h=e.overrides||{},{theme:g,redirectRules:m,regions:b,customCss:y}=h,w=((e,t)=>{var n={};for(var a in e)i.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&o)for(var a of o(e))t.indexOf(a)<0&&r.call(e,a)&&(n[a]=e[a]);return n})(h,["theme","redirectRules","regions","customCss"]),v=s(s({},f),g),x=s(s({},p),w),C=M(JSON.stringify(m)),k={theme:M(JSON.stringify(v)),settings:M(JSON.stringify(x)),redirectRules:C};b&&(k.regions=M(JSON.stringify(b))),y&&(k.customCss=M(y)),n&&(k.fingerprint=M(n));const E=`${l}/?widgetKey=${e.widgetKey}#${new URLSearchParams(k).toString()}`;"Search"===t.widgetType?_t({config:t,widgetUrl:E,apiHost:c,widgetHost:l,widgetKey:e.widgetKey}):Wt({config:t,widgetUrl:E,apiHost:c,widgetHost:l,widgetKey:e.widgetKey,hideTriggerButton:u})};var At=(e=>(e.FRESHCHAT="freshchat",e.INTERCOM="intercom",e.ZENDESK="zendesk",e.HELPSCOUT="helpscout",e))(At||{});const Ot=e=>d(null,null,function*(){if(e.widgetType===h.Popup){const e=window.fcWidget?At.FRESHCHAT:null;e&&e===At.FRESHCHAT&&(yield d(null,null,function*(){window.fcWidget||(yield new Promise(e=>setTimeout(e,100))),window.fcWidget.hide(),window.fcWidget.on("widget:closed",()=>{window.fcWidget.hide()})}))}}),Pt="brainfish-nudges",Rt=(e,t)=>d(null,null,function*(){try{yield d(null,null,function*(){if(!document.getElementById(Pt))return new Promise(e=>{const t=document.createElement("script");t.id=Pt,t.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/nudge-widget@latest/dist/index.es.js",t.type="module",t.async=!0,t.crossOrigin="anonymous",t.onerror=()=>{Math.random()<.05&&void 0!==console.warn&&console.warn("[Brainfish] Nudge widget failed to load. This may be due to CSP or network restrictions."),e(void 0)},t.onload=()=>{setTimeout(()=>{e(!0)},200)},document.head.appendChild(t)})})}catch(n){w(e,n,"Failed to initialize Nudge widget",t)}});let Bt,Ft,jt,Nt=!1;const Vt=e=>{null==Bt||Bt.abort(),Bt=new AbortController;const{signal:t}=Bt;let n=window.location.pathname;const o=()=>{if(t.aborted)return;const o=window.location.pathname;o!==n&&(n=o,e())};window.addEventListener("popstate",o,{signal:t}),Nt||(Ft=history.pushState,jt=history.replaceState,history.pushState=function(...e){Ft.apply(this,e),setTimeout(o,0)},history.replaceState=function(...e){jt.apply(this,e),setTimeout(o,0)},Nt=!0),t.addEventListener("abort",()=>{Nt&&(history.pushState=Ft,history.replaceState=jt,Nt=!1)})};var Ht="5.2.0";function Zt(e,t){return new Promise(n=>setTimeout(n,e,t))}function Dt(){return new Promise(e=>{const t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(null)})}function Gt(e){return!!e&&"function"==typeof e.then}function zt(e,t){try{const n=e();Gt(n)?n.then(e=>t(!0,e),e=>t(!1,e)):t(!0,n)}catch(n){t(!1,n)}}function Yt(e,t,n=16){return d(this,null,function*(){const o=Array(e.length);let i=Date.now();for(let r=0;r<e.length;++r){o[r]=t(e[r],r);const a=Date.now();a>=i+n&&(i=a,yield Dt())}return o})}function $t(e){return e.then(void 0,()=>{}),e}function Xt(e){return parseInt(e)}function Jt(e){return parseFloat(e)}function Kt(e,t){return"number"==typeof e&&isNaN(e)?t:e}function Ut(e){return e.reduce((e,t)=>e+(t?1:0),0)}function qt(e,t=1){if(Math.abs(t)>=1)return Math.round(e/t)*t;{const n=1/t;return Math.round(e*n)/n}}function Qt(e,t){const n=e[0]>>>16,o=65535&e[0],i=e[1]>>>16,r=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16;let l=0,d=0,u=0,f=0;f+=r+(65535&t[1]),u+=f>>>16,f&=65535,u+=i+c,d+=u>>>16,u&=65535,d+=o+s,l+=d>>>16,d&=65535,l+=n+a,l&=65535,e[0]=l<<16|d,e[1]=u<<16|f}function en(e,t){const n=e[0]>>>16,o=65535&e[0],i=e[1]>>>16,r=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16,l=65535&t[1];let d=0,u=0,f=0,p=0;p+=r*l,f+=p>>>16,p&=65535,f+=i*l,u+=f>>>16,f&=65535,f+=r*c,u+=f>>>16,f&=65535,u+=o*l,d+=u>>>16,u&=65535,u+=i*c,d+=u>>>16,u&=65535,u+=r*s,d+=u>>>16,u&=65535,d+=n*l+o*c+i*s+r*a,d&=65535,e[0]=d<<16|u,e[1]=f<<16|p}function tn(e,t){const n=e[0];32===(t%=64)?(e[0]=e[1],e[1]=n):t<32?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(t-=32,e[0]=e[1]<<t|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function nn(e,t){0!==(t%=64)&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function on(e,t){e[0]^=t[0],e[1]^=t[1]}const rn=[4283543511,3981806797],an=[3301882366,444984403];function sn(e){const t=[0,e[0]>>>1];on(e,t),en(e,rn),t[1]=e[0]>>>1,on(e,t),en(e,an),t[1]=e[0]>>>1,on(e,t)}const cn=[2277735313,289559509],ln=[1291169091,658871167],dn=[0,5],un=[0,1390208809],fn=[0,944331445];function pn(e,t){const n=function(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);if(o>127)return(new TextEncoder).encode(e);t[n]=o}return t}(e);t=t||0;const o=[0,n.length],i=o[1]%16,r=o[1]-i,a=[0,t],s=[0,t],c=[0,0],l=[0,0];let d;for(d=0;d<r;d+=16)c[0]=n[d+4]|n[d+5]<<8|n[d+6]<<16|n[d+7]<<24,c[1]=n[d]|n[d+1]<<8|n[d+2]<<16|n[d+3]<<24,l[0]=n[d+12]|n[d+13]<<8|n[d+14]<<16|n[d+15]<<24,l[1]=n[d+8]|n[d+9]<<8|n[d+10]<<16|n[d+11]<<24,en(c,cn),tn(c,31),en(c,ln),on(a,c),tn(a,27),Qt(a,s),en(a,dn),Qt(a,un),en(l,ln),tn(l,33),en(l,cn),on(s,l),tn(s,31),Qt(s,a),en(s,dn),Qt(s,fn);c[0]=0,c[1]=0,l[0]=0,l[1]=0;const u=[0,0];switch(i){case 15:u[1]=n[d+14],nn(u,48),on(l,u);case 14:u[1]=n[d+13],nn(u,40),on(l,u);case 13:u[1]=n[d+12],nn(u,32),on(l,u);case 12:u[1]=n[d+11],nn(u,24),on(l,u);case 11:u[1]=n[d+10],nn(u,16),on(l,u);case 10:u[1]=n[d+9],nn(u,8),on(l,u);case 9:u[1]=n[d+8],on(l,u),en(l,ln),tn(l,33),en(l,cn),on(s,l);case 8:u[1]=n[d+7],nn(u,56),on(c,u);case 7:u[1]=n[d+6],nn(u,48),on(c,u);case 6:u[1]=n[d+5],nn(u,40),on(c,u);case 5:u[1]=n[d+4],nn(u,32),on(c,u);case 4:u[1]=n[d+3],nn(u,24),on(c,u);case 3:u[1]=n[d+2],nn(u,16),on(c,u);case 2:u[1]=n[d+1],nn(u,8),on(c,u);case 1:u[1]=n[d],on(c,u),en(c,cn),tn(c,31),en(c,ln),on(a,c)}return on(a,o),on(s,o),Qt(a,s),Qt(s,a),sn(a),sn(s),Qt(a,s),Qt(s,a),("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)+("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)}function hn(e,t,n,o){const i=Object.keys(e).filter(e=>!function(e,t){for(let n=0,o=e.length;n<o;++n)if(e[n]===t)return!0;return!1}(n,e)),r=$t(Yt(i,n=>function(e,t){const n=$t(new Promise(n=>{const o=Date.now();zt(e.bind(null,t),(...e)=>{const t=Date.now()-o;if(!e[0])return n(()=>({error:e[1],duration:t}));const i=e[1];if(function(e){return"function"!=typeof e}(i))return n(()=>({value:i,duration:t}));n(()=>new Promise(e=>{const n=Date.now();zt(i,(...o)=>{const i=t+Date.now()-n;if(!o[0])return e({error:o[1],duration:i});e({value:o[1],duration:i})})}))})}));return function(){return n.then(e=>e())}}(e[n],t),o));return function(){return d(this,null,function*(){const e=yield r,t=yield Yt(e,e=>$t(e()),o),n=yield Promise.all(t),a={};for(let o=0;o<i.length;++o)a[i[o]]=n[o];return a})}}function gn(){const e=window,t=navigator;return Ut(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function mn(){const e=window,t=navigator;return Ut(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===(t.vendor||"").indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function bn(){const e=window;return Ut(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===navigator.vendor.indexOf("Apple"),"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function yn(){const e=window,{HTMLElement:t,Document:n}=e;return Ut(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function wn(){const e=window;return t=e.print,/^function\s.*?\{\s*\[native code]\s*}$/.test(String(t))&&"[object WebPageNamespace]"===String(e.browser);var t}function vn(){var e,t;const n=window;return Ut(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function xn(){const{CSS:e}=window;return Ut([e.supports("selector(::details-content)"),e.supports("selector(::before::marker)"),e.supports("selector(::after::marker)"),!("locale"in CompositionEvent.prototype)])>=3}function Sn(){const e=window,t=navigator,{CSS:n,HTMLButtonElement:o}=e;return Ut([!("getStorageUpdates"in t),o&&"popover"in o.prototype,"CSSCounterStyleRule"in e,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function Cn(){const e=mn(),t=vn(),n=window,o=navigator,i="connection";return e?Ut([!("SharedWorker"in n),o[i]&&"ontypechange"in o[i],!("sinkId"in new Audio)])>=2:!!t&&Ut(["onorientationchange"in n,"orientation"in n,/android/i.test(o.appVersion)])>=2}function kn(e){const t=new Error(e);return t.name=e,t}function En(e,t,n=50){return d(this,null,function*(){var o,i,r;const a=document;for(;!a.body;)yield Zt(n);const s=a.createElement("iframe");try{for((yield new Promise((e,n)=>{let o=!1;const i=()=>{o=!0,e()};s.onload=i,s.onerror=e=>{o=!0,n(e)};const{style:r}=s;r.setProperty("display","block","important"),r.position="absolute",r.top="0",r.left="0",r.visibility="hidden",t&&"srcdoc"in s?s.srcdoc=t:s.src="about:blank",a.body.appendChild(s);const c=()=>{var e,t;o||("complete"===(null===(t=null===(e=s.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.readyState)?i():setTimeout(c,10))};c()}));!(null===(i=null===(o=s.contentWindow)||void 0===o?void 0:o.document)||void 0===i?void 0:i.body);)yield Zt(n);return yield e(s,s.contentWindow)}finally{null===(r=s.parentNode)||void 0===r||r.removeChild(s)}})}function In(e){const[t,n]=function(e){var t,n;const o=`Unexpected syntax '${e}'`,i=/^\s*([a-z-]*)(.*)$/i.exec(e),r=i[1]||void 0,a={},s=/([.:#][\w-]+|\[.+?\])/gi,c=(e,t)=>{a[e]=a[e]||[],a[e].push(t)};for(;;){const e=s.exec(i[2]);if(!e)break;const r=e[0];switch(r[0]){case".":c("class",r.slice(1));break;case"#":c("id",r.slice(1));break;case"[":{const e=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(r);if(!e)throw new Error(o);c(e[1],null!==(n=null!==(t=e[4])&&void 0!==t?t:e[5])&&void 0!==n?n:"");break}default:throw new Error(o)}}return[r,a]}(e),o=document.createElement(null!=t?t:"div");for(const i of Object.keys(n)){const e=n[i].join(" ");"style"===i?Ln(o.style,e):o.setAttribute(i,e)}return o}function Ln(e,t){for(const n of t.split(";")){const t=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(n);if(t){const[,n,o,,i]=t;e.setProperty(n,o,i||"")}}}const Wn=["monospace","sans-serif","serif"],Tn=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function _n(e){return e.toDataURL()}let Mn,An;function On(){return function(){if(void 0!==An)return;const e=()=>{const t=Pn();Rn(t)?An=setTimeout(e,2500):(Mn=t,An=void 0)};e()}(),()=>d(null,null,function*(){let e=Pn();if(Rn(e)){if(Mn)return[...Mn];(function(){const e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null})()&&(yield function(){const e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}(),e=Pn())}return Rn(e)||(Mn=e),e})}function Pn(){const e=screen;return[Kt(Jt(e.availTop),null),Kt(Jt(e.width)-Jt(e.availWidth)-Kt(Jt(e.availLeft),0),null),Kt(Jt(e.height)-Jt(e.availHeight)-Kt(Jt(e.availTop),0),null),Kt(Jt(e.availLeft),null)]}function Rn(e){for(let t=0;t<4;++t)if(e[t])return!1;return!0}function Bn(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function Fn(e){return matchMedia(`(inverted-colors: ${e})`).matches}function jn(e){return matchMedia(`(forced-colors: ${e})`).matches}function Nn(e){return matchMedia(`(prefers-contrast: ${e})`).matches}function Vn(e){return matchMedia(`(prefers-reduced-motion: ${e})`).matches}function Hn(e){return matchMedia(`(prefers-reduced-transparency: ${e})`).matches}function Zn(e){return matchMedia(`(dynamic-range: ${e})`).matches}const Dn=Math,Gn=()=>0;const zn="mmMwWLliI0fiflO&1",Yn={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function $n(e){const t=Cn()?0:3,n=Math.pow(10,t);return Math.floor(e*n)/n}const Xn=function(){let e=window;for(;;){const n=e.parent;if(!n||n===e)return!1;try{if(n.location.origin!==e.location.origin)return!0}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return!0;throw t}e=n}};const Jn=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),Kn=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),Un=["FRAGMENT_SHADER","VERTEX_SHADER"],qn=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],Qn="WEBGL_debug_renderer_info";function eo(e){if(e.webgl)return e.webgl.context;const t=document.createElement("canvas");let n;t.addEventListener("webglCreateContextError",()=>n=void 0);for(const i of["webgl","experimental-webgl"]){try{n=t.getContext(i)}catch(o){}if(n)break}return e.webgl={context:n},n}function to(e,t,n){const o=e.getShaderPrecisionFormat(e[t],e[n]);return o?[o.rangeMin,o.rangeMax,o.precision]:[]}function no(e){return Object.keys(e.__proto__).filter(oo)}function oo(e){return"string"==typeof e&&!e.match(/[^A-Z0-9_x]/)}function io(){return vn()}function ro(){return mn()||bn()}function ao(e){return"function"==typeof e.getParameter}const so={userAgentData:function(){return d(this,null,function*(){const e=navigator.userAgentData;if(!e)return;const t=e.brands.filter(({brand:e})=>!function(e){return/not/i.test(e)}(e)).map(({brand:e})=>e),n={brands:t.length>1?t.filter(e=>"Chromium"!==e):t,mobile:e.mobile,platform:e.platform};if(e.getHighEntropyValues)try{const t=yield e.getHighEntropyValues(["architecture","bitness","model","platformVersion"]);n.architecture=t.architecture,n.bitness=t.bitness,n.model=t.model,n.platformVersion=t.platformVersion}catch(o){if(!(o instanceof DOMException&&"NotAllowedError"===o.name))throw o;n.highEntropyStatus="not_allowed"}return n})},fonts:function(){return En((e,t)=>d(null,[e,t],function*(e,{document:t}){const n=t.body;n.style.fontSize="48px";const o=t.createElement("div");o.style.setProperty("visibility","hidden","important");const i={},r={},a=e=>{const n=t.createElement("span"),{style:i}=n;return i.position="absolute",i.top="0",i.left="0",i.fontFamily=e,n.textContent="mmMwWLliI0O&1",o.appendChild(n),n},s=(e,t)=>a(`'${e}',${t}`),c=Wn.map(a),l=(()=>{const e={};for(const t of Tn)e[t]=Wn.map(e=>s(t,e));return e})();n.appendChild(o);for(let d=0;d<Wn.length;d++)i[Wn[d]]=c[d].offsetWidth,r[Wn[d]]=c[d].offsetHeight;return Tn.filter(e=>{return t=l[e],Wn.some((e,n)=>t[n].offsetWidth!==i[e]||t[n].offsetHeight!==r[e]);var t})}))},domBlockers:function(){return d(this,arguments,function*({debug:e}={}){if(!bn()&&!Cn())return;const t=function(){const e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}(),n=Object.keys(t),o=[].concat(...n.map(e=>t[e])),i=yield function(e){return d(this,null,function*(){var t;const n=document,o=n.createElement("div"),i=new Array(e.length),r={};Bn(o);for(let a=0;a<e.length;++a){const t=In(e[a]);"DIALOG"===t.tagName&&t.show();const r=n.createElement("div");Bn(r),r.appendChild(t),o.appendChild(r),i[a]=t}for(;!n.body;)yield Zt(50);n.body.appendChild(o);try{for(let t=0;t<e.length;++t)i[t].offsetParent||(r[e[t]]=!0)}finally{null===(t=o.parentNode)||void 0===t||t.removeChild(o)}return r})}(o);e&&function(e,t){let n="DOM blockers debug:\n```";for(const o of Object.keys(e)){n+=`\n${o}:`;for(const i of e[o])n+=`\n ${t[i]?"🚫":"➡️"} ${i}`}console.log(`${n}\n\`\`\``)}(t,i);const r=n.filter(e=>{const n=t[e];return Ut(n.map(e=>i[e]))>.6*n.length});return r.sort(),r})},fontPreferences:function(){return function(e,t=4e3){return En((n,o)=>{const i=o.document,r=i.body,a=r.style;a.width=`${t}px`,a.webkitTextSizeAdjust=a.textSizeAdjust="none",mn()?r.style.zoom=""+1/o.devicePixelRatio:bn()&&(r.style.zoom="reset");const s=i.createElement("div");return s.textContent=[...Array(t/20|0)].map(()=>"word").join(" "),r.appendChild(s),e(i,r,o)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}((e,t,n)=>{const o={},i={};for(const a of Object.keys(Yn)){const[n={},i=zn]=Yn[a],r=e.createElement("span");r.textContent=i,r.style.whiteSpace="nowrap";for(const e of Object.keys(n)){const t=n[e];void 0!==t&&(r.style[e]=t)}o[a]=r,t.append(e.createElement("br"),r)}const r=mn()&&function(){const e=window,t=document,{CSS:n,Promise:o,AudioContext:i}=e;return Ut([o&&"try"in o,"caretPositionFromPoint"in t,i&&"onerror"in i.prototype,n.supports("ruby-align","space-around")])>=3}();for(const a of Object.keys(Yn)){const e=o[a].getBoundingClientRect().width;i[a]=r?$n(e*n.devicePixelRatio):e}return i})},audio:function(){return bn()&&Sn()&&wn()||mn()&&function(){const e=navigator,t=window,n=Audio.prototype,{visualViewport:o}=t;return Ut(["srLatency"in n,"srChannelCount"in n,"devicePosture"in e,o&&"segments"in o,"getTextInformation"in Image.prototype])>=3}()&&function(){const e=window,{URLPattern:t}=e;return Ut(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}()?-4:function(){const e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(bn()&&!yn()&&!function(){const e=window;return Ut(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}())return-1;const n=4500,o=new t(1,5e3,44100),i=o.createOscillator();i.type="triangle",i.frequency.value=1e4;const r=o.createDynamicsCompressor();r.threshold.value=-50,r.knee.value=40,r.ratio.value=12,r.attack.value=0,r.release.value=.25,i.connect(r),r.connect(o.destination),i.start(0);const[a,s]=function(e){const t=3,n=500,o=500,i=5e3;let r=()=>{};const a=new Promise((a,s)=>{let c=!1,l=0,d=0;e.oncomplete=e=>a(e.renderedBuffer);const u=()=>{setTimeout(()=>s(kn("timeout")),Math.min(o,d+i-Date.now()))},f=()=>{try{const o=e.startRendering();switch(Gt(o)&&$t(o),e.state){case"running":d=Date.now(),c&&u();break;case"suspended":document.hidden||l++,c&&l>=t?s(kn("suspended")):setTimeout(f,n)}}catch(o){s(o)}};f(),r=()=>{c||(c=!0,d>0&&u())}});return[a,r]}(o),c=$t(a.then(e=>function(e){let t=0;for(let n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}(e.getChannelData(0).subarray(n)),e=>{if("timeout"===e.name||"suspended"===e.name)return-3;throw e}));return()=>(s(),c)}()},screenFrame:function(){const e=bn()&&Sn()&&wn(),t=vn()&&xn();if(e||t)return()=>Promise.resolve(void 0);const n=On();return()=>d(null,null,function*(){const e=yield n(),t=e=>null===e?null:qt(e,10);return[t(e[0]),t(e[1]),t(e[2]),t(e[3])]})},canvas:function(){return function(e){let t,n,o=!1;const[i,r]=function(){const e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}();!function(e,t){return!(!t||!e.toDataURL)}(i,r)?t=n="unsupported":(o=function(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}(r),e?t=n="skipped":[t,n]=function(e,t){!function(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';const n=`Cwm fjordbank gly ${String.fromCharCode(55357,56835)}`;t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45)}(e,t);const n=_n(e),o=_n(e);if(n!==o)return["unstable","unstable"];!function(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(const[n,o,i]of[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]])t.fillStyle=n,t.beginPath(),t.arc(o,i,40,0,2*Math.PI,!0),t.closePath(),t.fill();t.fillStyle="#f9c",t.arc(60,60,60,0,2*Math.PI,!0),t.arc(60,60,20,0,2*Math.PI,!0),t.fill("evenodd")}(e,t);const i=_n(e);return[i,n]}(i,r));return{winding:o,geometry:t,text:n}}(function(){const e=bn()&&Sn()&&wn(),t=vn()&&function(){const e=window,t=navigator,{CSS:n}=e;return Ut(["userActivation"in t,n.supports("color","light-dark(#000, #fff)"),n.supports("height","1lh"),"globalPrivacyControl"in t])>=3}();return e||t}())},osCpu:function(){return navigator.oscpu},languages:function(){const e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(void 0!==n&&t.push([n]),Array.isArray(e.languages))mn()&&function(){const e=window;return Ut([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}()||t.push(e.languages);else if("string"==typeof e.languages){const n=e.languages;n&&t.push(n.split(","))}return t},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return Kt(Jt(navigator.deviceMemory),void 0)},screenResolution:function(){if(!(bn()&&Sn()&&wn()))return function(){const e=screen,t=e=>Kt(Xt(e),null),n=[t(e.width),t(e.height)];return n.sort().reverse(),n}()},hardwareConcurrency:function(){const e=Kt(Xt(navigator.hardwareConcurrency),void 0);return void 0!==e&&vn()&&xn()?e>=8?8:4:e},timezone:function(){var e;const t=null===(e=window.Intl)||void 0===e?void 0:e.DateTimeFormat;if(t){const e=(new t).resolvedOptions().timeZone;if(e)return e}const n=-function(){const e=(new Date).getFullYear();return Math.max(Jt(new Date(e,0,1).getTimezoneOffset()),Jt(new Date(e,6,1).getTimezoneOffset()))}();return`UTC${n>=0?"+":""}${n}`},sessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},localStorage:function(){try{return!!window.localStorage}catch(e){return!0}},indexedDB:function(){if(!gn()&&!function(){const e=window,t=navigator;return Ut(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!gn()}())try{return!!window.indexedDB}catch(e){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){const{platform:e}=navigator;return"MacIntel"===e&&bn()&&!yn()?function(){if("iPad"===navigator.platform)return!0;const e=screen,t=e.width/e.height;return Ut(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}()?"iPad":"iPhone":e},plugins:function(){const e=navigator.plugins;if(!e)return;const t=[];for(let n=0;n<e.length;++n){const o=e[n];if(!o)continue;const i=[];for(let e=0;e<o.length;++e){const t=o[e];i.push({type:t.type,suffixes:t.suffixes})}t.push({name:o.name,description:o.description,mimeTypes:i})}return t},touchSupport:function(){const e=navigator;let t,n=0;void 0!==e.maxTouchPoints?n=Xt(e.maxTouchPoints):void 0!==e.msMaxTouchPoints&&(n=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),t=!0}catch(o){t=!1}return{maxTouchPoints:n,touchEvent:t,touchStart:"ontouchstart"in window}},vendor:function(){return navigator.vendor||""},vendorFlavors:function(){const e=[];for(const t of["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"]){const n=window[t];n&&"object"==typeof n&&e.push(t)}return e.sort()},cookiesEnabled:function(){const e=document;try{e.cookie="cookietest=1; SameSite=Strict;";const t=-1!==e.cookie.indexOf("cookietest=");return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch(t){return!1}},colorGamut:function(){for(const e of["rec2020","p3","srgb"])if(matchMedia(`(color-gamut: ${e})`).matches)return e},invertedColors:function(){return!!Fn("inverted")||!Fn("none")&&void 0},forcedColors:function(){return!!jn("active")||!jn("none")&&void 0},monochrome:function(){if(matchMedia("(min-monochrome: 0)").matches){for(let e=0;e<=100;++e)if(matchMedia(`(max-monochrome: ${e})`).matches)return e;throw new Error("Too high value")}},contrast:function(){return Nn("no-preference")?0:Nn("high")||Nn("more")?1:Nn("low")||Nn("less")?-1:Nn("forced")?10:void 0},reducedMotion:function(){return!!Vn("reduce")||!Vn("no-preference")&&void 0},reducedTransparency:function(){return!!Hn("reduce")||!Hn("no-preference")&&void 0},hdr:function(){return!!Zn("high")||!Zn("standard")&&void 0},math:function(){const e=Dn.acos||Gn,t=Dn.acosh||Gn,n=Dn.asin||Gn,o=Dn.asinh||Gn,i=Dn.atanh||Gn,r=Dn.atan||Gn,a=Dn.sin||Gn,s=Dn.sinh||Gn,c=Dn.cos||Gn,l=Dn.cosh||Gn,d=Dn.tan||Gn,u=Dn.tanh||Gn,f=Dn.exp||Gn,p=Dn.expm1||Gn,h=Dn.log1p||Gn;return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:(g=1e154,Dn.log(g+Dn.sqrt(g*g-1))),asin:n(.12312423423423424),asinh:o(1),asinhPf:(e=>Dn.log(e+Dn.sqrt(e*e+1)))(1),atanh:i(.5),atanhPf:(e=>Dn.log((1+e)/(1-e))/2)(.5),atan:r(.5),sin:a(-1e300),sinh:s(1),sinhPf:(e=>Dn.exp(e)-1/Dn.exp(e)/2)(1),cos:c(10.000000000123),cosh:l(1),coshPf:(e=>(Dn.exp(e)+1/Dn.exp(e))/2)(1),tan:d(-1e300),tanh:u(1),tanhPf:(e=>(Dn.exp(2*e)-1)/(Dn.exp(2*e)+1))(1),exp:f(1),expm1:p(1),expm1Pf:(e=>Dn.exp(e)-1)(1),log1p:h(10),log1pPf:(e=>Dn.log(1+e))(10),powPI:(e=>Dn.pow(Dn.PI,e))(-100)};var g},pdfViewerEnabled:function(){return navigator.pdfViewerEnabled},architecture:function(){const e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]},applePay:function(){const{ApplePaySession:e}=window;if("function"!=typeof(null==e?void 0:e.canMakePayments))return-1;if(Xn())return-3;try{return e.canMakePayments()?1:0}catch(t){return function(e){if(e instanceof Error&&"InvalidAccessError"===e.name&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}(t)}},privateClickMeasurement:function(){var e;const t=document.createElement("a"),n=null!==(e=t.attributionSourceId)&&void 0!==e?e:t.attributionsourceid;return void 0===n?void 0:String(n)},audioBaseLatency:function(){if(!(Cn()||bn()))return-2;if(!window.AudioContext)return-1;const e=(new AudioContext).baseLatency;return null==e?-1:isFinite(e)?e:-3},dateTimeLocale:function(){if(!window.Intl)return-1;const e=window.Intl.DateTimeFormat;if(!e)return-2;const t=e().resolvedOptions().locale;return t||""===t?t:-3},webGlBasics:function({cache:e}){var t,n,o,i,r,a;const s=eo(e);if(!s)return-1;if(!ao(s))return-2;const c=io()?null:s.getExtension(Qn);return{version:(null===(t=s.getParameter(s.VERSION))||void 0===t?void 0:t.toString())||"",vendor:(null===(n=s.getParameter(s.VENDOR))||void 0===n?void 0:n.toString())||"",vendorUnmasked:c?null===(o=s.getParameter(c.UNMASKED_VENDOR_WEBGL))||void 0===o?void 0:o.toString():"",renderer:(null===(i=s.getParameter(s.RENDERER))||void 0===i?void 0:i.toString())||"",rendererUnmasked:c?null===(r=s.getParameter(c.UNMASKED_RENDERER_WEBGL))||void 0===r?void 0:r.toString():"",shadingLanguageVersion:(null===(a=s.getParameter(s.SHADING_LANGUAGE_VERSION))||void 0===a?void 0:a.toString())||""}},webGlExtensions:function({cache:e}){const t=eo(e);if(!t)return-1;if(!ao(t))return-2;const n=t.getSupportedExtensions(),o=t.getContextAttributes(),i=[],r=[],a=[],s=[],c=[];if(o)for(const d of Object.keys(o))r.push(`${d}=${o[d]}`);const l=no(t);for(const d of l){const e=t[d];a.push(`${d}=${e}${Jn.has(e)?`=${t.getParameter(e)}`:""}`)}if(n)for(const d of n){if(d===Qn&&io()||"WEBGL_polygon_mode"===d&&ro())continue;const e=t.getExtension(d);if(e)for(const n of no(e)){const o=e[n];s.push(`${n}=${o}${Kn.has(o)?`=${t.getParameter(o)}`:""}`)}else i.push(d)}for(const d of Un)for(const e of qn){const n=to(t,d,e);c.push(`${d}.${e}=${n.join(",")}`)}return s.sort(),a.sort(),{contextAttributes:r,parameters:a,shaderPrecisions:c,extensions:n,extensionParameters:s,unsupportedExtensions:i}}};function co(e){const t=function(e){if(Cn())return.4;if(bn())return!yn()||Sn()&&wn()?.3:.5;const t="value"in e.platform?e.platform.value:"";if(/^Win/.test(t))return.6;if(/^Mac/.test(t))return.5;return.7}(e),n=function(e){return qt(.99+.01*e,1e-4)}(t);return{score:t,comment:"$ if upgrade to Pro: https://fingerprint.com/github/?utm_source=oss&utm_medium=referral&utm_campaign=confidence_score".replace(/\$/g,`${n}`)}}function lo(e){return JSON.stringify(e,(e,t)=>{return t instanceof Error?s({name:(n=t).name,message:n.message,stack:null===(o=n.stack)||void 0===o?void 0:o.split("\n")},n):t;var n,o},2)}function uo(e){return pn(function(e){let t="";for(const n of Object.keys(e).sort()){const o=e[n],i="error"in o?"error":JSON.stringify(o.value);t+=`${t?"|":""}${n.replace(/([:|\\])/g,"\\$1")}:${i}`}return t}(e))}function fo(e=50){return function(e,t=1/0){const{requestIdleCallback:n}=window;return n?new Promise(e=>n.call(window,()=>e(),{timeout:t})):Zt(Math.min(e,t))}(e,2*e)}function po(e,t){const n=Date.now();return{get(o){return d(this,null,function*(){const i=Date.now(),r=yield e(),a=function(e){let t;const n=co(e);return{get visitorId(){return void 0===t&&(t=uo(this.components)),t},set visitorId(e){t=e},confidence:n,components:e,version:Ht}}(r);return(t||(null==o?void 0:o.debug))&&console.log(`Copy the text below to get the debug data:\n\n\`\`\`\nversion: ${a.version}\nuserAgent: ${navigator.userAgent}\ntimeBetweenLoadAndGet: ${i-n}\nvisitorId: ${a.visitorId}\ncomponents: ${lo(r)}\n\`\`\``),a})}}}var ho={load:function(){return d(this,arguments,function*(e={}){const{delayFallback:t,debug:n,monitoring:o=!0}=e;o&&function(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{const e=new XMLHttpRequest;e.open("get",`https://m1.openfpcdn.io/fingerprintjs/v${Ht}/npm-monitoring`,!0),e.send()}catch(e){console.error(e)}}(),yield fo(t);const i=function(e){return hn(so,e,[])}({cache:{},debug:n});return po(i,n)})},hashComponents:uo,componentsToDebugString:lo};D(),function(){if($||"undefined"==typeof window)return;$=!0;const e=window;let t=e.BrainfishAnalytics?Y(e.BrainfishAnalytics):void 0;try{Object.defineProperty(window,"BrainfishAnalytics",{configurable:!0,get:()=>t,set(e){t=e?Y(e):e}})}catch(n){e.BrainfishAnalytics&&(e.BrainfishAnalytics=Y(e.BrainfishAnalytics))}}();let go=null;const mo="undefined"!=typeof window&&window.Brainfish?window.Brainfish:(go||(go=function(){const e=[];let t=null;function n(n,o){if(t){const e=n.split(".");let i=t;for(let t=0;t<e.length-1;t++)i=i[e[t]];const r=i[e[e.length-1]];if("function"==typeof r)return r.apply(i,o)}else e.push([n,o])}return{Widgets:{init:(...e)=>n("Widgets.init",e),setTheme:(...e)=>n("Widgets.setTheme",e),identify:(...e)=>n("Widgets.identify",e),setSecretAttributes:(...e)=>n("Widgets.setSecretAttributes",e),open:()=>n("Widgets.open",[]),close:()=>n("Widgets.close",[]),createNewThread:()=>n("Widgets.createNewThread",[]),openModalForm:({formUrl:e,width:t,height:o})=>n("Widgets.openModalForm",[{formUrl:e,width:t,height:o}]),registerClientActionHandler:(...e)=>n("Widgets.registerClientActionHandler",e),onContextHelp:(...e)=>n("Widgets.onContextHelp",e),restoreConversation:(...e)=>n("Widgets.restoreConversation",e),clearConversation:()=>n("Widgets.clearConversation",[]),isReady:!1},SearchWidget:{initStandard:(...e)=>n("SearchWidget.initStandard",e)},HelpWidget:{initPopup:(...e)=>n("HelpWidget.initPopup",e),close:(...e)=>n("HelpWidget.close",e),open:(...e)=>n("HelpWidget.open",e),toggle:(...e)=>n("HelpWidget.toggle",e)},_setRealBrainfish(o){for(t=o;e.length>0;){const[t,o]=e.shift();n(t,o)}}}}(),"undefined"!=typeof window&&(window.Brainfish=go)),go),bo=new Map,yo=new Map;let wo=!1;function vo(e,t,n,o,i){return d(this,null,function*(){var r,a,s,c,l,d,u;const f=(null==(r=e.overrides)?void 0:r.enableRecording)||(null==(a=null==t?void 0:t.settings)?void 0:a.enableRecording)||!1,p=(null==(s=e.overrides)?void 0:s.version)||(null==t?void 0:t.version);yo.set(e.widgetKey,{options:e,config:t,apiHost:n,analyticsApiHost:o,fingerprint:i});const h=[];(null==p?void 0:p.startsWith("2."))?(Mt(e,t,i),wo||(wo=!0,Vt(()=>{yo.forEach(({options:e,config:t,fingerprint:n})=>{var o;const i=(null==(o=e.overrides)?void 0:o.version)||(null==t?void 0:t.version);(null==i?void 0:i.startsWith("2."))&&Mt(e,t,n)})}))):h.push(E(e,t)),h.push(_(e.widgetKey,t.trackingToken||"",n,o,f,{blocklist:null==(c=null==t?void 0:t.settings)?void 0:c.recordingBlocklist,sampleRate:null==(d=null==(l=null==t?void 0:t.settings)?void 0:l.ambientSettings)?void 0:d.sampleRate,_allowLocalhostRecording:null==(u=null==t?void 0:t.settings)?void 0:u._allowLocalhostRecording})),h.push(Rt(n,e.widgetKey));const[g]=yield Promise.allSettled(h);g&&"fulfilled"===g.status&&g.value&&mo._setRealBrainfish(g.value)})}mo.Widgets.isReady=!1,mo.Widgets.identify=e=>{"undefined"!=typeof window&&window.BrainfishAnalytics?window.BrainfishAnalytics("identify",e):z(e)},mo.Widgets.setSecretAttributes=e=>{try{const{alg:t}=p(e);if("dir"!==t)throw new Error("Invalid algorithm")}catch(n){return void console.error("[Brainfish] Invalid JWE provided to setSecretAttributes:",n)}const t=document.querySelector("#bf-iframe-container .trigger-iframe");if(t){const n=()=>{t.contentWindow&&t.contentWindow.postMessage({type:"SET_SECRET_ATTRIBUTES",secretAttributes:e},"*")};t.contentWindow&&n(),t.addEventListener("load",n)}},mo.Widgets.init=e=>d(null,null,function*(){window&&(window.BrainfishAnalytics=window.BrainfishAnalytics||function(...e){(window.BrainfishAnalytics.q=window.BrainfishAnalytics.q||[]).push(e)});const t=S(e.overrides),n=(null==(o=e.overrides)?void 0:o.analyticsApiHost)||"";var o;let i,r;try{const e=yield ho.load();i=(yield e.get()).visitorId}catch(s){console.warn("[Brainfish] Error loading fingerprint:",s)}if(e.config)r=JSON.parse(A(e.config));else{const{config:n}=yield v({widgetKey:e.widgetKey,apiHost:t});r=n}let a=bo.get(e.widgetKey);if(a||(a=vo(e,r,t,n,i),bo.set(e.widgetKey,a)),yield a,!lt.isWidgetDOMExisting(e.widgetKey,r)){bo.delete(e.widgetKey);const o=vo(e,r,t,n,i);bo.set(e.widgetKey,o),yield o}yield Ot(r),mo.Widgets.isReady=!0,window.dispatchEvent(new Event("onBrainfishReady"))}),mo.Widgets.setTheme=e=>{var t;const n=document.querySelector("#bf-iframe-container .trigger-iframe");if(n){const o=new URL(n.src),i=new URLSearchParams(o.hash.substring(1)),r=i.get("theme");let a;r&&(a=JSON.parse(A(r)));const c=s(s({},a),e);null==(t=n.contentWindow)||t.postMessage({type:"SET_THEME",theme:c},"*");const l=M(JSON.stringify(c));i.set("theme",l),o.hash=`#${i.toString()}`,n.src=o.toString()}},mo.Widgets.registerClientActionHandler=(e,t)=>{((e,t)=>{wt.set(e,t)})(e,t)};exports.BrainfishAnalytics=(...e)=>{"undefined"!=typeof window&&window.BrainfishAnalytics&&window.BrainfishAnalytics(...e)},exports.default=mo;
|
|
2
2
|
//# sourceMappingURL=web.cjs.js.map
|
package/dist/web.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,a=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,s=(e,t)=>{for(var n in t||(t={}))i.call(t,n)&&a(e,n,t[n]);if(o)for(var n of o(t))r.call(t,n)&&a(e,n,t[n]);return e},c=(e,o)=>t(e,n(o)),l=(e,t,n)=>a(e,"symbol"!=typeof t?t+"":t,n),d=(e,t,n)=>new Promise((o,i)=>{var r=e=>{try{s(n.next(e))}catch(t){i(t)}},a=e=>{try{s(n.throw(e))}catch(t){i(t)}},s=e=>e.done?o(e.value):Promise.resolve(e.value).then(r,a);s((n=n.apply(e,t)).next())});!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="88a84a17-6636-42b8-9f9b-95cdc7673f78",e._sentryDebugIdIdentifier="sentry-dbid-88a84a17-6636-42b8-9f9b-95cdc7673f78")}catch(n){}}(),new TextEncoder;const u=new TextDecoder;const f=e=>{let t=e;t instanceof Uint8Array&&(t=u.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n})(t)}catch(n){throw new TypeError("The input to be decoded is not correctly encoded.")}};function p(e){let t;if("string"==typeof e){const n=e.split(".");3!==n.length&&5!==n.length||([t]=n)}else if("object"==typeof e&&e){if(!("protected"in e))throw new TypeError("Token does not contain a Protected Header");t=e.protected}try{if("string"!=typeof t||!t)throw new Error;const e=JSON.parse(u.decode(f(t)));if(!function(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}(e))throw new Error;return e}catch(n){throw new TypeError("Invalid Token or Protected Header formatting")}}var h,g,m,b;("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"web-widget@1.22.2"},(g=h||(h={})).Sidebar="sidebar",g.Searchbar="searchbar",g.Popup="popup",h.Sidebar,h.Searchbar,h.Popup;class y extends Error{constructor(e,t){super(e,t),l(this,"cause"),this.name="BrainfishWidgetError",this.cause=null==t?void 0:t.cause,Error.captureStackTrace&&Error.captureStackTrace(this,y),this.cause instanceof Error&&this.cause.stack&&(this.stack=this.stack+"\nCaused by: "+this.cause.stack)}toJSON(){return{name:this.name,message:this.message,stack:this.stack,cause:this.cause instanceof Error?{name:this.cause.name,message:this.cause.message,stack:this.cause.stack}:this.cause}}}(b=m||(m={})).LINK="link",b.CALLBACK="callback",b.EMAIL="email",b.PHONE="phone";const w=(e,t,n,o)=>{let i=n,r={};if(t instanceof Error)try{r=JSON.parse(t.message),i+=` - ${r.message||t.message}`}catch(a){i+=` - ${t.message}`}else i+=` - ${String(t)}`;((e,t,n)=>{if(!navigator||navigator.userAgent.toLowerCase().includes("headless"))return;const o=t.toJSON(),i=e||"https://app.brainfi.sh",r={error:`WebWidgetVersion: 1.22.2. ${t.message}`,stack:t.stack,cause:{message:o.message,stack:o.stack,cause:o.cause}};fetch(`${i}/api/trackError.widget.create`,{method:"POST",headers:{"Content-Type":"application/json","api-key":n},body:JSON.stringify(r)})})(e,new y(i,{cause:r}),o)};const v=e=>d(null,[e],function*({widgetKey:e,apiHost:t}){return function(e,t,n){return d(this,null,function*(){let o,i=0;for(;i<3;)try{const o=yield fetch(`${e}${t}`,{method:"POST",headers:{"Content-Type":"application/json","api-key":n}});if(!o.ok)throw new Error(`API call failed with status: ${o.status}`);const i=yield o.json();if(!i)throw new Error("Error loading config: empty response");return i}catch(r){if(o=r,i++,i>=3)throw w(e,r,"Error fetching config",n),o;yield new Promise(e=>setTimeout(e,500))}})}(t,"/api/searchWidgets.getConfigByKey",e)}),x=({config:e,apiKey:t,apiHost:n})=>{const o=e.settings||{};return["bodyActionButtons","footerActionButtons","nextBestActions"].forEach(e=>{o[e]&&(o[e]=o[e].map(e=>e.type===m.CALLBACK&&e.value?c(s({},e),{value:new Function(`return ${e.value}`)()}):e))}),c(s({},e),{settings:o,apiHost:n,widgetMode:e.widgetType,apiKey:t})},S=e=>(null==e?void 0:e.apiHost)||"https://app.brainfi.sh",C=e=>d(null,[e],function*({apiHost:e,widgetKey:t,version:n}){try{const e=`https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${n}/dist/web.js`,t=yield(e=>d(null,null,function*(){return document.getElementById("brainfish-widget")?window.Brainfish:new Promise((t,n)=>{const o=document.createElement("script");o.id="brainfish-widget",o.src=e,o.type="module",o.async=!0,o.crossOrigin="anonymous",o.onload=()=>{setTimeout(()=>{const e=window.Brainfish;e?t(e):n(new Error("Failed to load Brainfish module"))},200)},o.onerror=t=>{const o=t,i={message:`Failed to load script: ${e}`,type:o.type,fileName:o.filename,lineNumber:o.lineno,columnNumber:o.colno,error:o.error?o.error.toString():"Unknown error"};n(new Error(JSON.stringify(i)))},document.head.appendChild(o)})}))(e);return{widget:t}}catch(o){Math.random()<.05&&w(e,o,o.message,t)}});const k=/* @__PURE__ */new Set,E=(e,t)=>d(null,null,function*(){const n=S(e.overrides);try{if(k.has(e.widgetKey))return;const o=yield C({apiHost:n,widgetKey:e.widgetKey,version:t.version||"latest"});if(o){const{widget:i}=o,r=x({config:t,apiKey:e.widgetKey,apiHost:n});return e.overrides&&t.settings&&Object.entries(e.overrides).forEach(([e,n])=>{t.settings&&e in t.settings&&(t.settings[e]=((e=[],t)=>{const n=new Map(e.map(e=>[e.label,e]));return t.forEach(e=>n.set(e.label,e)),Array.from(n.values())})(t.settings[e],n))}),function(e,t){t.widgetType===h.Searchbar||"Search"===t.widgetType?e.SearchWidget.initStandard(t):e.HelpWidget.initPopup(t)}(i,r),k.add(e.widgetKey),i}}catch(o){w(n,o,o.message,e.widgetKey)}}),I=()=>{try{if("undefined"==typeof window||!("localStorage"in window)||null===window.localStorage)return!1;const e="__brainfish_storage_test__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&"QuotaExceededError"===e.name}},L=e=>{try{if(I())return window.localStorage.getItem(e)}catch(t){}return null},W=e=>{try{I()&&window.localStorage.removeItem(e)}catch(t){}};let T=!1;const M=(e,t,n,...o)=>d(null,[e,t,n,...o],function*(e,t,n,o="",i=!1,r){if(t||void 0!==console.warn&&console.warn("[Brainfish] BrainfishAnalytics not initialized. Access key is required."),!T)try{const a=(()=>{if("undefined"==typeof window||"undefined"==typeof navigator)return!1;const e=navigator,t=window,n=(e.doNotTrack||t.doNotTrack||e.msDoNotTrack||"0").toString().toLowerCase();return["1","yes","true"].includes(n)})(),s="true"===L("bf_tracking_disabled"),c=a||s;window.BrainfishAnalytics("init",{apiUrl:o,accessKey:t,trackScreenViews:!0,trackAttributes:!c,trackOutgoingLinks:!c,enableRecording:!c&&i,recordingOptions:r}),T=!0,yield((e,t)=>d(null,null,function*(){return document.getElementById("brainfish-analytics")?window.BrainfishAnalytics:new Promise(n=>{const o=document.createElement("script");o.id="brainfish-analytics",o.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/web-tracker@latest/dist/tracker.js",o.type="module",o.async=!0,o.crossOrigin="anonymous",o.onload=()=>{setTimeout(()=>{n(window.BrainfishAnalytics)},200)},o.onerror=()=>{Math.random()<.05&&w(e,new Error(`Failed to load script: ${o.src}`),`Failed to load script: ${o.src}`,t),n(void 0)},document.head.appendChild(o)})}))(n,e)}catch(a){w(n,a,"Failed to initialize BrainfishAnalytics",e)}});function _(e){const t=(new TextEncoder).encode(e);if("undefined"!=typeof window&&"function"==typeof window.btoa){const e=Array.from(t,e=>String.fromCharCode(e)).join("");return btoa(e)}if("undefined"!=typeof Buffer)return Buffer.from(t).toString("base64");throw new Error("[utils.base64Encode]: Unsupported environment")}const A=e=>{if("undefined"!=typeof window&&"function"==typeof window.atob){const t=atob(e),n=t.length,o=new Uint8Array(n);for(let e=0;e<n;e++)o[e]=t.charCodeAt(e);return(new TextDecoder).decode(o)}if("undefined"!=typeof Buffer)return Buffer.from(e,"base64").toString("utf-8");throw new Error("[utils.base64Decode]: Unsupported environment")};function O(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var P,R={exports:{}},F={exports:{}},B={exports:{}};function V(){return P||(P=1,function(e,t){function n(e){return Math.round(255*e)}function o(e,t,o){return n(e)+","+n(t)+","+n(o)}t.__esModule=!0,t.default=void 0,t.default=function(e,t,n,i){if(void 0===i&&(i=o),0===t)return i(n,n,n);var r=(e%360+360)%360/60,a=(1-Math.abs(2*n-1))*t,s=a*(1-Math.abs(r%2-1)),c=0,l=0,d=0;r>=0&&r<1?(c=a,l=s):r>=1&&r<2?(c=s,l=a):r>=2&&r<3?(l=a,d=s):r>=3&&r<4?(l=s,d=a):r>=4&&r<5?(c=s,d=a):r>=5&&r<6&&(c=a,d=s);var u=n-a/2;return i(c+u,l+u,d+u)},e.exports=t.default}(B,B.exports)),B.exports}var j,N={exports:{}};function H(){return j||(j=1,function(e,t){t.__esModule=!0,t.default=void 0;var n={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};t.default=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return n[t]?"#"+n[t]:e},e.exports=t.default}(N,N.exports)),N.exports}var Z,D,G,z={exports:{}};function Y(){return Z||(Z=1,function(e,t){function n(e){var t="function"==typeof Map?/* @__PURE__ */new Map:void 0;return n=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(o())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var a=new(e.bind.apply(e,r));return n&&i(a,n.prototype),a}(e,arguments,r(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),i(n,e)},n(e)}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!e})()}function i(e,t){return(i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}t.__esModule=!0,t.default=void 0;var a={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found and no default was provided.\n\n",75:"important requires a valid style object, got a %s instead.\n\n",76:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",77:'remToPx expects a value in "rem" but you provided it in "%s".\n\n',78:'base must be set in "px" or "%" but you set it in "%s".\n'};function s(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o,i=t[0],r=[];for(o=1;o<t.length;o+=1)r.push(t[o]);return r.forEach(function(e){i=i.replace(/%[a-z]/,e)}),i}t.default=/* @__PURE__ */function(e){var t,n;function o(t){var n;if("production"===process.env.NODE_ENV)n=e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+t+" for more information.")||this;else{for(var o=arguments.length,i=new Array(o>1?o-1:0),r=1;r<o;r++)i[r-1]=arguments[r];n=e.call(this,s.apply(void 0,[a[t]].concat(i)))||this}return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n)}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,i(t,n),o}(/* @__PURE__ */n(Error)),e.exports=t.default}(z,z.exports)),z.exports}function $(){return D||(D=1,function(e,t){t.__esModule=!0,t.default=function(e){if("string"!=typeof e)throw new i.default(3);var t=(0,o.default)(e);if(t.match(a))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(s)){var r=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:r}}if(t.match(c))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(l)){var h=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:h}}var g=d.exec(t);if(g)return{red:parseInt(""+g[1],10),green:parseInt(""+g[2],10),blue:parseInt(""+g[3],10)};var m=u.exec(t.substring(0,50));if(m)return{red:parseInt(""+m[1],10),green:parseInt(""+m[2],10),blue:parseInt(""+m[3],10),alpha:parseFloat(""+m[4])>1?parseFloat(""+m[4])/100:parseFloat(""+m[4])};var b=f.exec(t);if(b){var y=parseInt(""+b[1],10),w=parseInt(""+b[2],10)/100,v=parseInt(""+b[3],10)/100,x="rgb("+(0,n.default)(y,w,v)+")",S=d.exec(x);if(!S)throw new i.default(4,t,x);return{red:parseInt(""+S[1],10),green:parseInt(""+S[2],10),blue:parseInt(""+S[3],10)}}var C=p.exec(t.substring(0,50));if(C){var k=parseInt(""+C[1],10),E=parseInt(""+C[2],10)/100,I=parseInt(""+C[3],10)/100,L="rgb("+(0,n.default)(k,E,I)+")",W=d.exec(L);if(!W)throw new i.default(4,t,L);return{red:parseInt(""+W[1],10),green:parseInt(""+W[2],10),blue:parseInt(""+W[3],10),alpha:parseFloat(""+C[4])>1?parseFloat(""+C[4])/100:parseFloat(""+C[4])}}throw new i.default(5)};var n=r(/* @__PURE__ */V()),o=r(/* @__PURE__ */H()),i=r(/* @__PURE__ */Y());function r(e){return e&&e.__esModule?e:{default:e}}var a=/^#[a-fA-F0-9]{6}$/,s=/^#[a-fA-F0-9]{8}$/,c=/^#[a-fA-F0-9]{3}$/,l=/^#[a-fA-F0-9]{4}$/,d=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,u=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,f=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,p=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;e.exports=t.default}(F,F.exports)),F.exports}function X(){return G||(G=1,function(e,t){t.__esModule=!0,t.default=function(e){if("transparent"===e)return 0;var t=(0,o.default)(e),n=Object.keys(t).map(function(e){var n=t[e]/255;return n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}),i=n[0],r=n[1],a=n[2];return parseFloat((.2126*i+.7152*r+.0722*a).toFixed(3))};var n,o=(n=/* @__PURE__ */$())&&n.__esModule?n:{default:n};e.exports=t.default}(R,R.exports)),R.exports}const J=/* @__PURE__ */O(/* @__PURE__ */X());var K,U={exports:{}},q={exports:{}};function Q(){return K||(K=1,function(e,t){function n(e,t,o){return function(){var i=o.concat(Array.prototype.slice.call(arguments));return i.length>=t?e.apply(this,i):n(e,t,i)}}t.__esModule=!0,t.default=function(e){return n(e,e.length,[])},e.exports=t.default}(q,q.exports)),q.exports}var ee,te={exports:{}};function ne(){return ee||(ee=1,e=te,(t=te.exports).__esModule=!0,t.default=void 0,t.default=function(e,t,n){return Math.max(e,Math.min(t,n))},e.exports=t.default),te.exports;var e,t}var oe,ie,re={exports:{}},ae={exports:{}};function se(){return oe||(oe=1,e=ae,(t=ae.exports).__esModule=!0,t.default=void 0,t.default=function(e){var t,n=e.red/255,o=e.green/255,i=e.blue/255,r=Math.max(n,o,i),a=Math.min(n,o,i),s=(r+a)/2;if(r===a)return void 0!==e.alpha?{hue:0,saturation:0,lightness:s,alpha:e.alpha}:{hue:0,saturation:0,lightness:s};var c=r-a,l=s>.5?c/(2-r-a):c/(r+a);switch(r){case n:t=(o-i)/c+(o<i?6:0);break;case o:t=(i-n)/c+2;break;default:t=(n-o)/c+4}return t*=60,void 0!==e.alpha?{hue:t,saturation:l,lightness:s,alpha:e.alpha}:{hue:t,saturation:l,lightness:s}},e.exports=t.default),ae.exports;var e,t}function ce(){return ie||(ie=1,function(e,t){t.__esModule=!0,t.default=function(e){return(0,o.default)((0,n.default)(e))};var n=i(/* @__PURE__ */$()),o=i(/* @__PURE__ */se());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(re,re.exports)),re.exports}var le,de={exports:{}},ue={exports:{}},fe={exports:{}},pe={exports:{}};function he(){return le||(le=1,function(e,t){t.__esModule=!0,t.default=void 0;t.default=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e},e.exports=t.default}(pe,pe.exports)),pe.exports}var ge,me,be,ye={exports:{}};function we(){return ge||(ge=1,e=ye,(t=ye.exports).__esModule=!0,t.default=void 0,t.default=function(e){var t=e.toString(16);return 1===t.length?"0"+t:t},e.exports=t.default),ye.exports;var e,t}function ve(){return me||(me=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=r(/* @__PURE__ */V()),o=r(/* @__PURE__ */he()),i=r(/* @__PURE__ */we());function r(e){return e&&e.__esModule?e:{default:e}}function a(e){return(0,i.default)(Math.round(255*e))}function s(e,t,n){return(0,o.default)("#"+a(e)+a(t)+a(n))}t.default=function(e,t,o){return(0,n.default)(e,t,o,s)},e.exports=t.default}(fe,fe.exports)),fe.exports}function xe(){return be||(be=1,function(e,t){t.__esModule=!0,t.default=function(e,t,i){if("number"==typeof e&&"number"==typeof t&&"number"==typeof i)return(0,n.default)(e,t,i);if("object"==typeof e&&void 0===t&&void 0===i)return(0,n.default)(e.hue,e.saturation,e.lightness);throw new o.default(1)};var n=i(/* @__PURE__ */ve()),o=i(/* @__PURE__ */Y());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(ue,ue.exports)),ue.exports}var Se,Ce={exports:{}};function ke(){return Se||(Se=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r,a){if("number"==typeof e&&"number"==typeof t&&"number"==typeof r&&"number"==typeof a)return a>=1?(0,n.default)(e,t,r):"rgba("+(0,o.default)(e,t,r)+","+a+")";if("object"==typeof e&&void 0===t&&void 0===r&&void 0===a)return e.alpha>=1?(0,n.default)(e.hue,e.saturation,e.lightness):"rgba("+(0,o.default)(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new i.default(2)};var n=r(/* @__PURE__ */ve()),o=r(/* @__PURE__ */V()),i=r(/* @__PURE__ */Y());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ce,Ce.exports)),Ce.exports}var Ee,Ie={exports:{}};function Le(){return Ee||(Ee=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r){if("number"==typeof e&&"number"==typeof t&&"number"==typeof r)return(0,n.default)("#"+(0,o.default)(e)+(0,o.default)(t)+(0,o.default)(r));if("object"==typeof e&&void 0===t&&void 0===r)return(0,n.default)("#"+(0,o.default)(e.red)+(0,o.default)(e.green)+(0,o.default)(e.blue));throw new i.default(6)};var n=r(/* @__PURE__ */he()),o=r(/* @__PURE__ */we()),i=r(/* @__PURE__ */Y());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ie,Ie.exports)),Ie.exports}var We,Te,Me,_e={exports:{}};function Ae(){return We||(We=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r,a){if("string"==typeof e&&"number"==typeof t){var s=(0,n.default)(e);return"rgba("+s.red+","+s.green+","+s.blue+","+t+")"}if("number"==typeof e&&"number"==typeof t&&"number"==typeof r&&"number"==typeof a)return a>=1?(0,o.default)(e,t,r):"rgba("+e+","+t+","+r+","+a+")";if("object"==typeof e&&void 0===t&&void 0===r&&void 0===a)return e.alpha>=1?(0,o.default)(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new i.default(7)};var n=r(/* @__PURE__ */$()),o=r(/* @__PURE__ */Le()),i=r(/* @__PURE__ */Y());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(_e,_e.exports)),_e.exports}function Oe(){return Te||(Te=1,function(e,t){t.__esModule=!0,t.default=function(e){if("object"!=typeof e)throw new a.default(8);if(l(e))return(0,r.default)(e);if(c(e))return(0,i.default)(e);if(u(e))return(0,o.default)(e);if(d(e))return(0,n.default)(e);throw new a.default(8)};var n=s(/* @__PURE__ */xe()),o=s(/* @__PURE__ */ke()),i=s(/* @__PURE__ */Le()),r=s(/* @__PURE__ */Ae()),a=s(/* @__PURE__ */Y());function s(e){return e&&e.__esModule?e:{default:e}}var c=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)},l=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha},d=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)},u=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha};e.exports=t.default}(de,de.exports)),de.exports}function Pe(){return Me||(Me=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(/* @__PURE__ */Q()),o=a(/* @__PURE__ */ne()),i=a(/* @__PURE__ */ce()),r=a(/* @__PURE__ */Oe());function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}var c=(0,n.default)(function(e,t){if("transparent"===t)return t;var n=(0,i.default)(t);return(0,r.default)(s({},n,{lightness:(0,o.default)(0,1,n.lightness-parseFloat(e))}))});t.default=c,e.exports=t.default}(U,U.exports)),U.exports}const Re=/* @__PURE__ */O(/* @__PURE__ */Pe());var Fe,Be={exports:{}};function Ve(){return Fe||(Fe=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(/* @__PURE__ */Q()),o=a(/* @__PURE__ */ne()),i=a(/* @__PURE__ */ce()),r=a(/* @__PURE__ */Oe());function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}var c=(0,n.default)(function(e,t){if("transparent"===t)return t;var n=(0,i.default)(t);return(0,r.default)(s({},n,{lightness:(0,o.default)(0,1,n.lightness+parseFloat(e))}))});t.default=c,e.exports=t.default}(Be,Be.exports)),Be.exports}const je=/* @__PURE__ */O(/* @__PURE__ */Ve()),Ne="bf-iframe-container",He="bf-trigger-button",Ze="bf-search-bar-iframe-container",De="bf-search-bar-iframe-backdrop";function Ge(e){var t,n;if(!document.querySelector("style[data-widget-styles]")){!function(e="#000",t="FFF"){const n=document.createElement("style");n.attributes.setNamedItem(document.createAttribute("data-widget-styles"));const o=J(e)>.5;n.textContent=`\n .bf-trigger-button{position:fixed;bottom:16px;right:16px;width:36px;height:36px;border-radius:50%;border:none;box-shadow:0 1px 6px #0000000f,0 2px 32px #00000029;transition:transform 167ms cubic-bezier(.33,0,0,1);box-sizing:content-box;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:1000;padding:12px;gap:10px;overflow:hidden}.bf-trigger-button.hidden{display:none}.trigger-button-icon{display:flex;align-items:center;justify-content:center;width:36px;height:36px;position:relative}.trigger-button-icon svg{width:100%;height:100%;position:absolute;inset:0}.trigger-button-icon>svg>path{transition:transform .3s ease,opacity .3s ease;transform:scale(.5);transform-origin:center;opacity:0}.trigger-button-icon .fish-icon{display:none}.trigger-button-icon .fish-icon.visible{display:block;max-width:36px;max-height:36px}.trigger-button-icon svg.visible{display:block}.trigger-button-icon>svg.visible>path{opacity:1;transform:scale(1)}.trigger-iframe{position:relative;width:100%;height:100%;border:none;outline:none;transform:translateZ(0);overflow:hidden}.bf-iframe-container{visibility:hidden;position:fixed;z-index:2147483000000;background-color:#fff;bottom:0;right:0;width:100vw;height:calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));border:none;overflow:hidden;opacity:0;pointer-events:none;transform:translateY(20px);transition:opacity .3s ease,transform .3s ease,width .2s ease-in-out,height .2s ease-in-out,visibility 0s .3s}.bf-iframe-container.open{visibility:visible;opacity:1;transform:translateY(0);pointer-events:auto;top:env(safe-area-inset-top);left:0;transition-delay:0s}@media (min-width: 576px){.bf-iframe-container{bottom:80px;right:24px;width:448px;height:min(750px,calc(100vh - 80px));border-radius:8px;border:1px solid var(--Dark-300, #d4d4d4);box-shadow:0 20px 25px -5px #1212171a,0 10px 10px -5px #1212170a}.bf-iframe-container.open{top:unset;left:unset}.bf-iframe-container.position-bottom-left{right:auto;left:24px}.bf-iframe-container.position-top-left{inset:80px auto auto 24px}.bf-iframe-container.position-top-right{bottom:auto;top:80px;right:24px}.bf-iframe-container.expanded{width:min(calc(448px * 1.35),calc(100vw - 16px));height:min(calc(750px * 1.35),calc(100vh - 80px))}}.bf-search-bar-iframe-container{position:relative;width:100%;min-height:200px;background-color:#fff;border:1px solid var(--dark-300, #d4d4d4);border-radius:8px;overflow:hidden;pointer-events:auto;transition:height .2s ease-in-out}.iframe-loading-indicator{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;z-index:10}.spinner{width:24px;height:24px;border:2px solid rgba(0,0,0,.1);border-radius:50%;border-top-color:#3498db;animation:spin 1s ease-in-out infinite}@keyframes spin{to{transform:rotate(360deg)}}.loading-error{width:24px;height:24px;position:relative;display:flex;align-items:center;justify-content:center}.loading-error:before,.loading-error:after{content:"";position:absolute;width:16px;height:2px;background-color:#e74c3c;border-radius:2px}.loading-error:before{transform:rotate(45deg)}.loading-error:after{transform:rotate(-45deg)}\n .${He} { background: ${e}; }\n .${He}:hover {\n background: ${o?Re(.05,e):je(.05,e)};\n }\n .trigger-button-icon { color: ${t}; }\n `,document.head.appendChild(n)}((null==(t=null==e?void 0:e.theme)?void 0:t.inputButtonBgColor)||"#007bff",(null==(n=null==e?void 0:e.theme)?void 0:n.textBaseColor)||"#ffffff")}}class ze{constructor(e,t){l(this,"isOpen",!1),this.widgetKey=e,this.widgetType=t}get isWidgetOpen(){return this.isOpen}openWidget(){this.isOpen=!0}closeWidget(){this.isOpen=!1}toggleWidget(){return this.isOpen=!this.isOpen,this.isOpen}}function Ye(e,t,n={}){const o=document.createElement(e);return o.className=t,Object.entries(n).forEach(([e,t])=>{o.setAttribute(e,t)}),o}const $e="brainfish-search-widget";class Xe{constructor(e){l(this,"button",null),l(this,"icon",null),l(this,"closeCallback",null),this.widgetType=e}setCloseCallback(e){this.closeCallback=e}get containerClass(){return this.widgetType===h.Searchbar?Ze:Ne}get container(){return document.querySelector(`.${this.containerClass}`)}get iframe(){var e;return null==(e=this.container)?void 0:e.querySelector("iframe")}get backdrop(){return document.querySelector(`.${De}`)}setElements(e,t){this.button=e||null,this.icon=t||null}openWidget(e={}){var t,n,o;const i=document.querySelector(`.${this.containerClass}`),r=null==i?void 0:i.querySelector("iframe");if(e.newConversation&&e.contextualQuestion?null==(t=null==r?void 0:r.contentWindow)||t.postMessage({type:"CONTEXTUAL_QUESTION",question:e.contextualQuestion},"*"):e.newConversation&&(null==(n=null==r?void 0:r.contentWindow)||n.postMessage({type:"NEW_CONVERSATION"},"*")),null==(o=null==r?void 0:r.contentWindow)||o.postMessage({type:"FOCUS_SEARCH_FIELD"},"*"),this.widgetType!==h.Searchbar&&(null==i||i.classList.add("open"),e.position&&(null==i||i.classList.add(`position-${e.position}`),null==i||i.setAttribute("data-current-position",e.position))),null==i||i.setAttribute("aria-hidden","false"),this.widgetType!==h.Searchbar&&document.body.clientWidth>=962&&null===this.backdrop){const e=Ye("div",De);this.closeCallback&&e.addEventListener("click",this.closeCallback),document.body.appendChild(e)}this.updateButtonForOpen()}focusNextElement(){const e=document.querySelector($e);if(e){const t=Array.from(document.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(e=>!e.hasAttribute("disabled")),n=t.indexOf(e);if(-1!==n){const e=t[n+1];e&&e.focus()}}}closeWidget(){const e=this.container;if(!e)return;const t=e.dataset.currentPosition;if(t){const n=()=>{e.dataset.currentPosition===t&&(e.classList.remove(`position-${t}`),delete e.dataset.currentPosition)};e.addEventListener("transitionend",n,{once:!0})}e.classList.remove("open"),e.setAttribute("aria-hidden","true"),this.backdrop&&(this.backdrop.remove(),this.focusNextElement()),this.updateButtonForClose()}updateButtonForOpen(){if(!this.button||!this.icon)return;const e=this.icon.querySelector(".fish-icon"),t=this.icon.querySelector(".close-icon");this.button.setAttribute("aria-expanded","true"),null==e||e.classList.remove("visible"),null==t||t.classList.add("visible"),this.isMobile()&&this.hideTriggerButton()}updateButtonForClose(){if(!this.button||!this.icon)return;const e=this.icon.querySelector(".fish-icon"),t=this.icon.querySelector(".close-icon");this.button.setAttribute("aria-expanded","false"),null==e||e.classList.add("visible"),null==t||t.classList.remove("visible"),this.isMobile()&&this.showTriggerButton()}showTriggerButton(){var e;null==(e=this.button)||e.classList.remove("hidden")}hideTriggerButton(){var e;null==(e=this.button)||e.classList.add("hidden")}resizeContainer(e){if(this.widgetType!==h.Searchbar)return;if(!this.container||!this.iframe)return;const t=Math.max(e,200);this.container.style.height=`${t}px`,this.iframe.style.height=`${t}px`}isMobile(){return document.body.clientWidth<=576}setupButtonClickListener(e){this.button&&this.button.addEventListener("click",e)}static isWidgetDOMExisting(e,t){const n=document.querySelector(`.${Ze}[data-widget-key="${e}"]`);if(n){const e=document.querySelector("brainfish-search-widget");return!e||e.contains(n)}if(document.getElementById(`trigger-button-${e}`))return!0;if("Search"!==t.widgetType){if(document.querySelector(`.${Ne}`))return!0}return!1}}class Je{static register(e,t){this.instances.set(e,t)}static getInstance(e){return this.instances.get(e)}static unregister(e){this.instances.delete(e)}static getAllInstances(){return Array.from(this.instances.values())}static getOpenInstance(){return this.getAllInstances().find(e=>e.isWidgetOpen)}static getClosedPopupInstance(){return this.getAllInstances().find(e=>!e.isWidgetOpen&&e.widgetType===h.Popup)}static clear(){this.instances.clear()}}l(Je,"instances",/* @__PURE__ */new Map);const Ke=({formUrl:e,width:t="500px",height:n="600px"})=>{const o=document.createElement("div");o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("tabindex","-1"),o.style.cssText="\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: white;\n padding: 20px;\n border-radius: 8px;\n box-shadow: 0 2px 10px rgba(0,0,0,0.1);\n z-index: 300000000;\n ";const i=document.createElement("button");i.innerHTML="×",i.style.cssText="\n position: absolute;\n right: -16px;\n top: -16px;\n width: 32px;\n height: 32px;\n border: 2px solid #666;\n border-radius: 50%;\n background: #FFF;\n font-size: 20px;\n cursor: pointer;\n ";const r=document.createElement("iframe");r.src=e,r.style.cssText=`width: ${t}; height: ${n}; border: none;`;const a=document.activeElement,s=e=>{if("Tab"===e.key){const t=[i,r],n=document.activeElement,o=n?t.indexOf(n):-1;e.preventDefault(),e.shiftKey?o<=0?t[t.length-1].focus():t[o-1].focus():o>=t.length-1?t[0].focus():t[o+1].focus()}else"Escape"===e.key&&c()},c=()=>{o.remove(),l.remove(),document.removeEventListener("keydown",s),null==a||a.focus()},l=document.createElement("div");l.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0,0,0,0.5);\n z-index: 299999999;\n ",i.onclick=c,l.onclick=c,document.addEventListener("keydown",s),o.appendChild(i),o.appendChild(r),document.body.appendChild(l),document.body.appendChild(o),o.focus(),r.onload=()=>{r.setAttribute("tabindex","0"),i.focus()}},Ue=e=>`brainfish_conversation_${e}`,qe={save(e,t){if(t){const o=L(Ue(e));let i=Date.now();if(o)try{const e=JSON.parse(o);e.conversationId===t&&(i=e.persistedAt)}catch(n){}const r={conversationId:t,persistedAt:i};((e,t)=>{try{I()&&window.localStorage.setItem(e,t)}catch(n){}})(Ue(e),JSON.stringify(r))}else W(Ue(e))},load(e){const t=L(Ue(e));if(!t)return null;try{const n=JSON.parse(t);return Date.now()-n.persistedAt>72e5?(W(Ue(e)),null):n.conversationId}catch(n){return W(Ue(e)),null}},clear(e){W(Ue(e))}};class Qe{static getIframeForInstance(e){var t,n;const o=e.widgetType===h.Searchbar?Ze:Ne,i=e.widgetType===h.Searchbar?`.${o}[data-widget-key="${e.widgetKey}"]`:`.${o}`;return null!=(n=null==(t=document.querySelector(i))?void 0:t.querySelector("iframe"))?n:null}static postMessageToInstance(e,t){var n,o;null==(o=null==(n=this.getIframeForInstance(e))?void 0:n.contentWindow)||o.postMessage(t,"*")}static initialize(){this.isInitialized||(this.setupDeprecatedAPI(),this.setupNewAPI(),this.isInitialized=!0)}static setupDeprecatedAPI(){var e;(null==(e=window.Brainfish)?void 0:e.HelpWidget)&&(window.Brainfish.HelpWidget.close=e=>this.closeCurrentlyOpenWidget(),window.Brainfish.HelpWidget.open=e=>this.openCurrentlyClosedPopupWidget(e))}static setupNewAPI(){var e;(null==(e=window.Brainfish)?void 0:e.Widgets)&&(window.Brainfish.Widgets.open=e=>this.openCurrentlyClosedPopupWidget(e),window.Brainfish.Widgets.close=()=>this.closeCurrentlyOpenWidget(),window.Brainfish.Widgets.createNewThread=()=>this.createNewThread(),window.Brainfish.Widgets.openModalForm=Ke,window.Brainfish.Widgets.onContextHelp=(e,t)=>this.openContextualHelp(e,t),window.Brainfish.Widgets.restoreConversation=e=>this.restoreConversation(e),window.Brainfish.Widgets.clearConversation=()=>this.clearConversation())}static closeCurrentlyOpenWidget(){const e=Je.getOpenInstance();e&&e.closeWidget()}static openCurrentlyClosedPopupWidget(e){const t=Je.getClosedPopupInstance();if(t){const n="string"==typeof e?{trigger:e}:e,o={};(!0===(null==n?void 0:n.newConversation)||(null==n?void 0:n.trigger))&&(o.newConversation=!0),(null==n?void 0:n.trigger)&&(o.trigger=n.trigger),(null==n?void 0:n.position)&&(o.position=n.position),t.openWidget(o)}}static createNewThread(){const e=Je.getOpenInstance();if(e)return void this.postMessageToInstance(e,{type:"NEW_CONVERSATION"});const t=Je.getClosedPopupInstance();t&&t.openWidget({newConversation:!0})}static openContextualHelp(e,t={}){if(!e||"string"!=typeof e||0===e.trim().length)return void console.warn("Brainfish.Widgets.onContextHelp: Invalid question provided");let n=Je.getOpenInstance();if(n||(n=Je.getClosedPopupInstance()),!n)return void console.warn("Brainfish.Widgets.onContextHelp: No popup widget available");const o=c(s({},t),{newConversation:!0,trigger:"contextual-help",contextualQuestion:e.trim()});n.openWidget(o)}static restoreConversation(e){if(!e||"string"!=typeof e)return void console.warn("Brainfish.Widgets.restoreConversation: Invalid conversationId provided");let t=Je.getOpenInstance();const n=!!t;t||(t=Je.getClosedPopupInstance()),t?(n||t.openWidget({newConversation:!1}),this.postMessageToInstance(t,{type:"RESTORE_CONVERSATION",conversationId:e})):console.warn("Brainfish.Widgets.restoreConversation: No popup widget available")}static clearConversation(){var e;const t=null!=(e=Je.getOpenInstance())?e:Je.getClosedPopupInstance();t?(qe.clear(t.widgetKey),this.postMessageToInstance(t,{type:"NEW_CONVERSATION"})):console.warn("Brainfish.Widgets.clearConversation: No popup widget available")}}l(Qe,"isInitialized",!1);class et{constructor(e,t){this.widgetType=e,this.widgetKey=t}trackOpenWidget(e,t){this.dispatchEvent("onBrainfishWidgetOpen"),"contextual-help"===e?this.trackAnalytics("Open Widget - Contextual Help",{trigger:e,question:t}):e?this.trackAnalytics("Open Widget - Custom Trigger",{trigger:e}):this.trackAnalytics("Open Widget")}trackCloseWidget(){this.dispatchEvent("onBrainfishWidgetClose"),this.trackAnalytics("Close Widget")}trackCustomEvent(e,t={}){this.trackAnalytics(e,t)}dispatchEvent(e){window.dispatchEvent(new Event(e))}trackAnalytics(e,t={}){if(window.BrainfishAnalytics){let n;switch(this.widgetType){case h.Searchbar:n="searchbar_widget";break;case h.Sidebar:default:n="search_widget"}window.BrainfishAnalytics("track",e,c(s({},t),{widgetKey:this.widgetKey}),{source:n,widgetKey:this.widgetKey})}}}class tt{constructor(e,t){l(this,"state"),l(this,"domController"),l(this,"analyticsTracker"),this.state=new ze(e,t),this.domController=new Xe(t),this.domController.setCloseCallback(()=>this.closeWidget()),this.analyticsTracker=new et(t,e)}static getInstance(e){return Je.getInstance(e)}get widgetKey(){return this.state.widgetKey}get widgetType(){return this.state.widgetType}get isWidgetOpen(){return this.state.isWidgetOpen}get containerClass(){return this.domController.containerClass}initialize({button:e,icon:t,isButtonHidden:n}){this.domController.setElements(e,t),this.domController.setupButtonClickListener(()=>this.toggleIframeVisibility()),Je.register(this.widgetKey,this),Qe.initialize()}toggleIframeVisibility(){this.state.toggleWidget()?this.openWidget():this.closeWidget()}openWidget(e={}){var t,n;if(this.state.openWidget(),this.domController.openWidget(e),void 0===(null==e?void 0:e.newConversation)){const e=qe.load(this.widgetKey);e&&(null==(n=null==(t=this.domController.iframe)?void 0:t.contentWindow)||n.postMessage({type:"RESTORE_CONVERSATION",conversationId:e},"*"))}this.analyticsTracker.trackOpenWidget(e.trigger,e.contextualQuestion)}closeWidget(){this.state.closeWidget(),this.domController.closeWidget(),this.analyticsTracker.trackCloseWidget()}showTriggerButton(){this.domController.showTriggerButton()}hideTriggerButton(){this.domController.hideTriggerButton()}resizeContainer(e){this.domController.resizeContainer(e)}trackCustomEvent(e,t={}){this.analyticsTracker.trackCustomEvent(e,t)}destroy(){Je.unregister(this.widgetKey)}static initialize(e){const t=new tt(e.widgetKey,e.widgetType);return t.initialize(e),t}}function nt({widgetUrl:e,widgetType:t,props:n}){const o=t===h.Searchbar?Ze:Ne,i=Ye("div",o,s({id:o,"aria-live":"polite","aria-hidden":t===h.Searchbar?"false":"true"},n||{})),r=Ye("div","iframe-loading-indicator"),a=Ye("div","spinner");r.setAttribute("aria-label","Loading content"),r.setAttribute("role","status"),r.appendChild(a),i.appendChild(r);const c=Ye("iframe","trigger-iframe",{src:e,sandbox:"allow-scripts allow-same-origin allow-popups allow-forms",allow:"clipboard-write",role:"dialog"});return c.style.opacity="0",c.addEventListener("load",()=>{r.style.display="none",c.style.opacity="1"}),c.addEventListener("error",e=>{console.error("Error loading iframe:",e),r.innerHTML="";const t=Ye("div","loading-error");r.appendChild(t),r.setAttribute("aria-label","Failed to load content")}),i.appendChild(c),{iframeContainer:i,iframe:c}}function ot(e,t){const n=()=>{(t=>{var n;null==(n=e.contentWindow)||n.postMessage({type:"UPDATE_BODY_CLASS",isDarkMode:t},"*")})(document.body.classList.contains("dark"))};n(),(()=>{const e=new MutationObserver(n);e.observe(document.body,{attributes:!0,attributeFilter:["class"]}),t.addEventListener("abort",()=>e.disconnect())})()}const it=/* @__PURE__ */new Map,rt=(e,t)=>`Error executing Client Action with key ${e}. Details: ${t instanceof Error?t.message:String(t)}`,at=(e,t)=>d(null,null,function*(){if(it.has(e)){const i=it.get(e);if("function"!=typeof i)return{success:!1,reason:`Client Action registered with key ${e} is not a function`};try{const e=yield i(t);if(n=e,"[object Object]"!==Object.prototype.toString.call(n))throw new TypeError("Invalid result, expecting object type");return{success:!0,data:e}}catch(o){return{success:!1,reason:rt(e,o)}}}var n;return{success:!1,reason:`No Client Action registered with key ${e}`}}),st=/* @__PURE__ */new Map,ct=/* @__PURE__ */new Set;function lt(e,{widgetHost:t,apiHost:n,widgetKey:o,widgetType:i,signal:r,stateManager:a}){window.addEventListener("message",r=>d(null,null,function*(){var s,c;if(r.origin!==t)return;const{type:l,widgetKey:d}=r.data;if(!d||d===o){if("TOGGLE_WIDGET_SIZE"===l&&function(){const e=document.querySelector(`.${Ne}`);e.classList.contains("expanded")?e.classList.remove("expanded"):e.classList.add("expanded")}(),"RESIZE_IFRAME"===l){const{height:e}=r.data;a.resizeContainer(e)}if("TRACK_EVENT"===l){const{messageId:e,eventName:t,data:n}=r.data;if(e){if(ct.has(e))return void console.warn(`[Brainfish] Duplicate TRACK_EVENT suppressed for "${t}" (messageId: ${e})`);ct.add(e),setTimeout(()=>ct.delete(e),5e3)}a.trackCustomEvent(t,n)}if("CLOSE_WIDGET"===l&&a.closeWidget(),"NEXT_BEST_ACTION_CLICKED"===l){const{action:e,searchQueryId:t,query:i,answer:a,conversation:s}=r.data;if(!["function","callback"].includes(e.type))return void console.error("[Brainfish] Invalid action type:",e);const c=st.get(e.id);if(c&&Date.now()-c<1e3)return void console.warn(`[Brainfish] Duplicate NEXT_BEST_ACTION_CLICKED suppressed for action "${e.id}" (fired ${Date.now()-c}ms ago)`);st.set(e.id,Date.now()),setTimeout(()=>st.delete(e.id),1e3),qe.clear(o);const l={query:i,answer:a,searchIntentId:e.searchIntentId,actionId:e.id,conversationId:(null==s?void 0:s.conversationId)||"",searchQueryId:t,metadata:e.metadata||{},conversation:s||null};try{if(window.__bfCallbacks=window.__bfCallbacks||{},window.__bfCallbacks[e.id])return void window.__bfCallbacks[e.id](i,a,l);const t=new URL(`${n}/api/searchWidgets.callback.codeblocks`);t.searchParams.set("apiKey",o),t.searchParams.set("codeblockId",e.id),l.searchIntentId&&t.searchParams.set("searchIntentId",l.searchIntentId);const r=document.createElement("script");r.src=t.toString(),document.head.appendChild(r),r.onload=()=>{window.__bfCallbacks[e.id](i,a,l),setTimeout(()=>{document.head.removeChild(r)},300)},r.onerror=()=>{console.error("[Brainfish] Failed to load callback script from server")}}catch(u){console.error("[Brainfish] Error executing callback:",u)}}if("CLIENT_EXECUTION"===l){const{actionKey:t,inputs:n,messageId:o}=r.data,i=yield at(t,n);null==(s=e.contentWindow)||s.postMessage({type:"CLIENT_EXECUTION_RESULT",messageId:o,result:i},"*")}if("CONVERSATION_CHANGED"===l){const{conversationId:e}=r.data;i!==h.Searchbar&&qe.save(o,e)}if("REQUEST_USER_IDENTITY"===l&&r.source===e.contentWindow&&i===h.Popup){const t=qe.load(o);t&&(null==(c=e.contentWindow)||c.postMessage({type:"RESTORE_CONVERSATION",conversationId:t},"*"))}}}),{signal:r})}function dt(e,t,n){let o;const i=()=>{(t=>{var o;const i={type:"UPDATE_BODY_CLASS",isMobile:t};null==(o=e.contentWindow)||o.postMessage(i,"*"),t&&(n.isWidgetOpen?n.hideTriggerButton():n.showTriggerButton())})(document.body.clientWidth<=576)},r=()=>{o&&clearTimeout(o),o=window.setTimeout(i,300)};i(),(()=>{const e=new ResizeObserver(r);e.observe(document.body),t.addEventListener("abort",()=>e.disconnect())})()}const ut=/* @__PURE__ */new Set;function ft(e,t,{isButtonHidden:n,triggerButtonIcon:o}){const i=document.createDocumentFragment();let r;if(n)r=tt.initialize({isButtonHidden:n,widgetType:h.Popup,widgetKey:e});else{const{button:t,icon:n}=function(e,t){const n=Ye("button",He,{id:`trigger-button-${e}`,"aria-controls":Ne,"aria-expanded":"false","data-name":He}),o=Ye("div","trigger-button-icon",{"aria-hidden":"true"});return o.innerHTML=t?`\n <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">\n <path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"></path>\n </svg>\n <img src="${t}" class="fish-icon visible" alt="Trigger button icon" aria-hidden="true" aria-label="help button icon" />\n `:'\n <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">\n <path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"></path>\n </svg>\n <svg width="24" height="14" viewBox="0 0 24 14" fill="none" xmlns="http://www.w3.org/2000/svg" class="fish-icon visible">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M1.71844 10.3882L4.60606 6.98384L1.71844 3.58375C1.4014 3.21362 1.44424 2.65841 1.81269 2.33993C1.97978 2.1979 2.65242 1.98701 3.04657 2.43461L5.78425 5.65824C6.14281 5.29523 6.51693 4.95924 6.90479 4.65114C8.88976 3.07437 11.2345 2.22803 13.6931 2.22803C16.9492 2.22803 20.0039 3.71718 22.2917 6.41142C22.5702 6.74282 22.5702 7.22916 22.2917 7.56056C20.0039 10.2591 16.9492 11.744 13.6931 11.744C11.2348 11.744 8.89035 10.8948 6.90554 9.31995C6.51741 9.01199 6.14304 8.67628 5.78425 8.31374L3.04657 11.5374C2.72953 11.9075 2.18114 11.9505 1.81269 11.632C1.44852 11.3179 1.40568 10.7584 1.71844 10.3882ZM5.93026 10.4683C8.17161 12.2599 10.8546 13.25 13.6931 13.25C17.4881 13.25 21.019 11.4034 23.4447 8.52942C24.1873 7.64571 24.1843 6.31801 23.4397 5.43663C20.8944 2.43919 17.4337 0.722025 13.6931 0.722025C10.8555 0.722025 8.17194 1.70845 5.92952 3.50276L4.17682 1.43933C3.57943 0.760929 2.79325 0.630009 2.25286 0.662947C1.98116 0.679506 1.73125 0.736852 1.51895 0.811846C1.26839 0.900352 1.03017 1.02718 0.827835 1.20058C-0.165283 2.05903 -0.283916 3.561 0.574656 4.56345L2.63075 6.98445L0.568104 9.41623C-0.272133 10.4106 -0.166523 11.9125 0.827835 12.7714C1.81372 13.6243 3.34308 13.5062 4.19036 12.5171L5.93026 10.4683Z" fill="currentColor"/>\n </svg>\n ',n.setAttribute("aria-label","Open Brainfish widget"),n.appendChild(o),{button:n,icon:o}}(e,o);i.appendChild(t),r=tt.initialize({button:t,icon:n,widgetType:h.Popup,widgetKey:e})}const{iframeContainer:a,iframe:s}=nt({widgetUrl:t,widgetType:h.Popup});return i.appendChild(a),{fragment:i,iframe:s,stateManager:r}}const pt=({config:e,widgetUrl:t,apiHost:n,widgetHost:o,widgetKey:i,hideTriggerButton:r})=>{const{settings:a}=e,s=null!=r?r:null==a?void 0:a.hideTriggerButton,c=null==a?void 0:a.triggerButtonIcon;try{if(function(e){return ut.has(e)}(i))return;if(function(e){return!!document.getElementById(`trigger-button-${e}`)}(i))return;Ge(e);const{fragment:r,iframe:a,stateManager:l}=ft(i,t,{isButtonHidden:s||!1,triggerButtonIcon:c||""}),d=new AbortController,{signal:u}=d;a.onload=()=>{setTimeout(()=>{var e;ot(a,u),lt(a,{widgetHost:o,apiHost:n,widgetKey:i,widgetType:h.Popup,signal:u,stateManager:l}),dt(a,u,l);const r=qe.load(i),s=new URL(t).searchParams.has("conversation");r&&!s&&(null==(e=a.contentWindow)||e.postMessage({type:"RESTORE_CONVERSATION",conversationId:r},"*"))},0)},document.body?document.body.appendChild(r):(console.warn("[Brainfish] document.body not ready. Widget initialization deferred."),document.addEventListener("DOMContentLoaded",()=>{document.body.appendChild(r)},{once:!0})),ut.add(i);const f=()=>{d.abort(),window.removeEventListener("beforeunload",f)};return void window.addEventListener("beforeunload",f)}catch(l){!function(e,t,n){w(e,t,t.message,n)}(n,l,i)}},ht=/* @__PURE__ */new Map;const gt=({config:e,widgetUrl:t,apiHost:n,widgetHost:o,widgetKey:i})=>{var r,a,s,c;const{settings:l}=e;let d=tt.getInstance(i);null==(r=ht.get(i))||r.abort();const u=new AbortController;ht.set(i,u),Ge(e);try{const e=document.querySelector(`.${Ze}[data-widget-key="${i}"]`),r=document.querySelector($e);e&&r&&!r.contains(e)&&(r.appendChild(e),0===r.getBoundingClientRect().width&&(null==(a=r.parentElement)||a.style.setProperty("width","100%"))),d||(d=tt.initialize({isButtonHidden:!0,widgetType:h.Searchbar,widgetKey:i}));const{signal:l}=u,f=e=>{ot(e,l),lt(e,{widgetHost:o,apiHost:n,widgetKey:i,widgetType:h.Searchbar,signal:l,stateManager:d}),dt(e,l,d)};if(e){const t=e.querySelector("iframe");t&&("complete"===(null==(c=t.contentDocument)?void 0:c.readyState)?setTimeout(()=>{f(t)},0):t.onload=()=>{setTimeout(()=>{f(t)},0)})}else{const e=document.createDocumentFragment(),{iframeContainer:n,iframe:o}=nt({widgetUrl:t,widgetType:h.Searchbar,props:{"data-widget-type":"searchbar","data-widget-key":i}});o.onload=()=>{setTimeout(()=>{f(o)},0)},e.appendChild(n),r?(r.appendChild(e),0===r.getBoundingClientRect().width&&(null==(s=r.parentElement)||s.style.setProperty("width","100%"))):document.body.appendChild(e)}const p=()=>{u.abort(),ht.delete(i),window.removeEventListener("beforeunload",p)};return void window.addEventListener("beforeunload",p)}catch(f){!function(e,t,n){w(e,t,t.message,n)}(n,f,i)}},mt=(e,t,n)=>{var a;const c=S(e.overrides),l=(null==(d=e.overrides)?void 0:d.widgetHost)||"https://agent.brainfi.sh";var d;const u=null==(a=e.overrides)?void 0:a.hideTriggerButton,{theme:f,settings:p}=t,h=e.overrides||{},{theme:g,redirectRules:m,regions:b,customCss:y}=h,w=((e,t)=>{var n={};for(var a in e)i.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&o)for(var a of o(e))t.indexOf(a)<0&&r.call(e,a)&&(n[a]=e[a]);return n})(h,["theme","redirectRules","regions","customCss"]),v=s(s({},f),g),x=s(s({},p),w),C=_(JSON.stringify(m)),k={theme:_(JSON.stringify(v)),settings:_(JSON.stringify(x)),redirectRules:C};b&&(k.regions=_(JSON.stringify(b))),y&&(k.customCss=_(y)),n&&(k.fingerprint=_(n));const E=`${l}/?widgetKey=${e.widgetKey}#${new URLSearchParams(k).toString()}`;"Search"===t.widgetType?gt({config:t,widgetUrl:E,apiHost:c,widgetHost:l,widgetKey:e.widgetKey}):pt({config:t,widgetUrl:E,apiHost:c,widgetHost:l,widgetKey:e.widgetKey,hideTriggerButton:u})};var bt=/* @__PURE__ */(e=>(e.FRESHCHAT="freshchat",e.INTERCOM="intercom",e.ZENDESK="zendesk",e.HELPSCOUT="helpscout",e))(bt||{});const yt=e=>d(null,null,function*(){if(e.widgetType===h.Popup){const e=window.fcWidget?bt.FRESHCHAT:null;e&&e===bt.FRESHCHAT&&(yield d(null,null,function*(){window.fcWidget||(yield new Promise(e=>setTimeout(e,100))),window.fcWidget.hide(),window.fcWidget.on("widget:closed",()=>{window.fcWidget.hide()})}))}}),wt="brainfish-nudges",vt=(e,t)=>d(null,null,function*(){try{yield d(null,null,function*(){if(!document.getElementById(wt))return new Promise(e=>{const t=document.createElement("script");t.id=wt,t.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/nudge-widget@latest/dist/index.es.js",t.type="module",t.async=!0,t.crossOrigin="anonymous",t.onerror=()=>{Math.random()<.05&&void 0!==console.warn&&console.warn("[Brainfish] Nudge widget failed to load. This may be due to CSP or network restrictions."),e(void 0)},t.onload=()=>{setTimeout(()=>{e(!0)},200)},document.head.appendChild(t)})})}catch(n){w(e,n,"Failed to initialize Nudge widget",t)}});let xt,St,Ct,kt=!1;const Et=e=>{null==xt||xt.abort(),xt=new AbortController;const{signal:t}=xt;let n=window.location.pathname;const o=()=>{if(t.aborted)return;const o=window.location.pathname;o!==n&&(n=o,e())};window.addEventListener("popstate",o,{signal:t}),kt||(St=history.pushState,Ct=history.replaceState,history.pushState=function(...e){St.apply(this,e),setTimeout(o,0)},history.replaceState=function(...e){Ct.apply(this,e),setTimeout(o,0)},kt=!0),t.addEventListener("abort",()=>{kt&&(history.pushState=St,history.replaceState=Ct,kt=!1)})};var It="5.2.0";function Lt(e,t){return new Promise(n=>setTimeout(n,e,t))}function Wt(){return new Promise(e=>{const t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(null)})}function Tt(e){return!!e&&"function"==typeof e.then}function Mt(e,t){try{const n=e();Tt(n)?n.then(e=>t(!0,e),e=>t(!1,e)):t(!0,n)}catch(n){t(!1,n)}}function _t(e,t,n=16){return d(this,null,function*(){const o=Array(e.length);let i=Date.now();for(let r=0;r<e.length;++r){o[r]=t(e[r],r);const a=Date.now();a>=i+n&&(i=a,yield Wt())}return o})}function At(e){return e.then(void 0,()=>{}),e}function Ot(e){return parseInt(e)}function Pt(e){return parseFloat(e)}function Rt(e,t){return"number"==typeof e&&isNaN(e)?t:e}function Ft(e){return e.reduce((e,t)=>e+(t?1:0),0)}function Bt(e,t=1){if(Math.abs(t)>=1)return Math.round(e/t)*t;{const n=1/t;return Math.round(e*n)/n}}function Vt(e,t){const n=e[0]>>>16,o=65535&e[0],i=e[1]>>>16,r=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16;let l=0,d=0,u=0,f=0;f+=r+(65535&t[1]),u+=f>>>16,f&=65535,u+=i+c,d+=u>>>16,u&=65535,d+=o+s,l+=d>>>16,d&=65535,l+=n+a,l&=65535,e[0]=l<<16|d,e[1]=u<<16|f}function jt(e,t){const n=e[0]>>>16,o=65535&e[0],i=e[1]>>>16,r=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16,l=65535&t[1];let d=0,u=0,f=0,p=0;p+=r*l,f+=p>>>16,p&=65535,f+=i*l,u+=f>>>16,f&=65535,f+=r*c,u+=f>>>16,f&=65535,u+=o*l,d+=u>>>16,u&=65535,u+=i*c,d+=u>>>16,u&=65535,u+=r*s,d+=u>>>16,u&=65535,d+=n*l+o*c+i*s+r*a,d&=65535,e[0]=d<<16|u,e[1]=f<<16|p}function Nt(e,t){const n=e[0];32===(t%=64)?(e[0]=e[1],e[1]=n):t<32?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(t-=32,e[0]=e[1]<<t|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function Ht(e,t){0!==(t%=64)&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function Zt(e,t){e[0]^=t[0],e[1]^=t[1]}const Dt=[4283543511,3981806797],Gt=[3301882366,444984403];function zt(e){const t=[0,e[0]>>>1];Zt(e,t),jt(e,Dt),t[1]=e[0]>>>1,Zt(e,t),jt(e,Gt),t[1]=e[0]>>>1,Zt(e,t)}const Yt=[2277735313,289559509],$t=[1291169091,658871167],Xt=[0,5],Jt=[0,1390208809],Kt=[0,944331445];function Ut(e,t){const n=function(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);if(o>127)return(new TextEncoder).encode(e);t[n]=o}return t}(e);t=t||0;const o=[0,n.length],i=o[1]%16,r=o[1]-i,a=[0,t],s=[0,t],c=[0,0],l=[0,0];let d;for(d=0;d<r;d+=16)c[0]=n[d+4]|n[d+5]<<8|n[d+6]<<16|n[d+7]<<24,c[1]=n[d]|n[d+1]<<8|n[d+2]<<16|n[d+3]<<24,l[0]=n[d+12]|n[d+13]<<8|n[d+14]<<16|n[d+15]<<24,l[1]=n[d+8]|n[d+9]<<8|n[d+10]<<16|n[d+11]<<24,jt(c,Yt),Nt(c,31),jt(c,$t),Zt(a,c),Nt(a,27),Vt(a,s),jt(a,Xt),Vt(a,Jt),jt(l,$t),Nt(l,33),jt(l,Yt),Zt(s,l),Nt(s,31),Vt(s,a),jt(s,Xt),Vt(s,Kt);c[0]=0,c[1]=0,l[0]=0,l[1]=0;const u=[0,0];switch(i){case 15:u[1]=n[d+14],Ht(u,48),Zt(l,u);case 14:u[1]=n[d+13],Ht(u,40),Zt(l,u);case 13:u[1]=n[d+12],Ht(u,32),Zt(l,u);case 12:u[1]=n[d+11],Ht(u,24),Zt(l,u);case 11:u[1]=n[d+10],Ht(u,16),Zt(l,u);case 10:u[1]=n[d+9],Ht(u,8),Zt(l,u);case 9:u[1]=n[d+8],Zt(l,u),jt(l,$t),Nt(l,33),jt(l,Yt),Zt(s,l);case 8:u[1]=n[d+7],Ht(u,56),Zt(c,u);case 7:u[1]=n[d+6],Ht(u,48),Zt(c,u);case 6:u[1]=n[d+5],Ht(u,40),Zt(c,u);case 5:u[1]=n[d+4],Ht(u,32),Zt(c,u);case 4:u[1]=n[d+3],Ht(u,24),Zt(c,u);case 3:u[1]=n[d+2],Ht(u,16),Zt(c,u);case 2:u[1]=n[d+1],Ht(u,8),Zt(c,u);case 1:u[1]=n[d],Zt(c,u),jt(c,Yt),Nt(c,31),jt(c,$t),Zt(a,c)}return Zt(a,o),Zt(s,o),Vt(a,s),Vt(s,a),zt(a),zt(s),Vt(a,s),Vt(s,a),("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)+("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)}function qt(e,t,n,o){const i=Object.keys(e).filter(e=>!function(e,t){for(let n=0,o=e.length;n<o;++n)if(e[n]===t)return!0;return!1}(n,e)),r=At(_t(i,n=>function(e,t){const n=At(new Promise(n=>{const o=Date.now();Mt(e.bind(null,t),(...e)=>{const t=Date.now()-o;if(!e[0])return n(()=>({error:e[1],duration:t}));const i=e[1];if(function(e){return"function"!=typeof e}(i))return n(()=>({value:i,duration:t}));n(()=>new Promise(e=>{const n=Date.now();Mt(i,(...o)=>{const i=t+Date.now()-n;if(!o[0])return e({error:o[1],duration:i});e({value:o[1],duration:i})})}))})}));return function(){return n.then(e=>e())}}(e[n],t),o));return function(){return d(this,null,function*(){const e=yield r,t=yield _t(e,e=>At(e()),o),n=yield Promise.all(t),a={};for(let o=0;o<i.length;++o)a[i[o]]=n[o];return a})}}function Qt(){const e=window,t=navigator;return Ft(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function en(){const e=window,t=navigator;return Ft(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===(t.vendor||"").indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function tn(){const e=window;return Ft(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===navigator.vendor.indexOf("Apple"),"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function nn(){const e=window,{HTMLElement:t,Document:n}=e;return Ft(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function on(){const e=window;return t=e.print,/^function\s.*?\{\s*\[native code]\s*}$/.test(String(t))&&"[object WebPageNamespace]"===String(e.browser);var t}function rn(){var e,t;const n=window;return Ft(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function an(){const{CSS:e}=window;return Ft([e.supports("selector(::details-content)"),e.supports("selector(::before::marker)"),e.supports("selector(::after::marker)"),!("locale"in CompositionEvent.prototype)])>=3}function sn(){const e=window,t=navigator,{CSS:n,HTMLButtonElement:o}=e;return Ft([!("getStorageUpdates"in t),o&&"popover"in o.prototype,"CSSCounterStyleRule"in e,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function cn(){const e=en(),t=rn(),n=window,o=navigator,i="connection";return e?Ft([!("SharedWorker"in n),o[i]&&"ontypechange"in o[i],!("sinkId"in new Audio)])>=2:!!t&&Ft(["onorientationchange"in n,"orientation"in n,/android/i.test(o.appVersion)])>=2}function ln(e){const t=new Error(e);return t.name=e,t}function dn(e,t,n=50){return d(this,null,function*(){var o,i,r;const a=document;for(;!a.body;)yield Lt(n);const s=a.createElement("iframe");try{for((yield new Promise((e,n)=>{let o=!1;const i=()=>{o=!0,e()};s.onload=i,s.onerror=e=>{o=!0,n(e)};const{style:r}=s;r.setProperty("display","block","important"),r.position="absolute",r.top="0",r.left="0",r.visibility="hidden",t&&"srcdoc"in s?s.srcdoc=t:s.src="about:blank",a.body.appendChild(s);const c=()=>{var e,t;o||("complete"===(null===(t=null===(e=s.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.readyState)?i():setTimeout(c,10))};c()}));!(null===(i=null===(o=s.contentWindow)||void 0===o?void 0:o.document)||void 0===i?void 0:i.body);)yield Lt(n);return yield e(s,s.contentWindow)}finally{null===(r=s.parentNode)||void 0===r||r.removeChild(s)}})}function un(e){const[t,n]=function(e){var t,n;const o=`Unexpected syntax '${e}'`,i=/^\s*([a-z-]*)(.*)$/i.exec(e),r=i[1]||void 0,a={},s=/([.:#][\w-]+|\[.+?\])/gi,c=(e,t)=>{a[e]=a[e]||[],a[e].push(t)};for(;;){const e=s.exec(i[2]);if(!e)break;const r=e[0];switch(r[0]){case".":c("class",r.slice(1));break;case"#":c("id",r.slice(1));break;case"[":{const e=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(r);if(!e)throw new Error(o);c(e[1],null!==(n=null!==(t=e[4])&&void 0!==t?t:e[5])&&void 0!==n?n:"");break}default:throw new Error(o)}}return[r,a]}(e),o=document.createElement(null!=t?t:"div");for(const i of Object.keys(n)){const e=n[i].join(" ");"style"===i?fn(o.style,e):o.setAttribute(i,e)}return o}function fn(e,t){for(const n of t.split(";")){const t=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(n);if(t){const[,n,o,,i]=t;e.setProperty(n,o,i||"")}}}const pn=["monospace","sans-serif","serif"],hn=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function gn(e){return e.toDataURL()}let mn,bn;function yn(){return function(){if(void 0!==bn)return;const e=()=>{const t=wn();vn(t)?bn=setTimeout(e,2500):(mn=t,bn=void 0)};e()}(),()=>d(null,null,function*(){let e=wn();if(vn(e)){if(mn)return[...mn];(function(){const e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null})()&&(yield function(){const e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}(),e=wn())}return vn(e)||(mn=e),e})}function wn(){const e=screen;return[Rt(Pt(e.availTop),null),Rt(Pt(e.width)-Pt(e.availWidth)-Rt(Pt(e.availLeft),0),null),Rt(Pt(e.height)-Pt(e.availHeight)-Rt(Pt(e.availTop),0),null),Rt(Pt(e.availLeft),null)]}function vn(e){for(let t=0;t<4;++t)if(e[t])return!1;return!0}function xn(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function Sn(e){return matchMedia(`(inverted-colors: ${e})`).matches}function Cn(e){return matchMedia(`(forced-colors: ${e})`).matches}function kn(e){return matchMedia(`(prefers-contrast: ${e})`).matches}function En(e){return matchMedia(`(prefers-reduced-motion: ${e})`).matches}function In(e){return matchMedia(`(prefers-reduced-transparency: ${e})`).matches}function Ln(e){return matchMedia(`(dynamic-range: ${e})`).matches}const Wn=Math,Tn=()=>0;const Mn="mmMwWLliI0fiflO&1",_n={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function An(e){const t=cn()?0:3,n=Math.pow(10,t);return Math.floor(e*n)/n}const On=function(){let e=window;for(;;){const n=e.parent;if(!n||n===e)return!1;try{if(n.location.origin!==e.location.origin)return!0}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return!0;throw t}e=n}};const Pn=/* @__PURE__ */new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),Rn=/* @__PURE__ */new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),Fn=["FRAGMENT_SHADER","VERTEX_SHADER"],Bn=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],Vn="WEBGL_debug_renderer_info";function jn(e){if(e.webgl)return e.webgl.context;const t=document.createElement("canvas");let n;t.addEventListener("webglCreateContextError",()=>n=void 0);for(const i of["webgl","experimental-webgl"]){try{n=t.getContext(i)}catch(o){}if(n)break}return e.webgl={context:n},n}function Nn(e,t,n){const o=e.getShaderPrecisionFormat(e[t],e[n]);return o?[o.rangeMin,o.rangeMax,o.precision]:[]}function Hn(e){return Object.keys(e.__proto__).filter(Zn)}function Zn(e){return"string"==typeof e&&!e.match(/[^A-Z0-9_x]/)}function Dn(){return rn()}function Gn(){return en()||tn()}function zn(e){return"function"==typeof e.getParameter}const Yn={userAgentData:function(){return d(this,null,function*(){const e=navigator.userAgentData;if(!e)return;const t=e.brands.filter(({brand:e})=>!function(e){return/not/i.test(e)}(e)).map(({brand:e})=>e),n={brands:t.length>1?t.filter(e=>"Chromium"!==e):t,mobile:e.mobile,platform:e.platform};if(e.getHighEntropyValues)try{const t=yield e.getHighEntropyValues(["architecture","bitness","model","platformVersion"]);n.architecture=t.architecture,n.bitness=t.bitness,n.model=t.model,n.platformVersion=t.platformVersion}catch(o){if(!(o instanceof DOMException&&"NotAllowedError"===o.name))throw o;n.highEntropyStatus="not_allowed"}return n})},fonts:function(){return dn((e,t)=>d(null,[e,t],function*(e,{document:t}){const n=t.body;n.style.fontSize="48px";const o=t.createElement("div");o.style.setProperty("visibility","hidden","important");const i={},r={},a=e=>{const n=t.createElement("span"),{style:i}=n;return i.position="absolute",i.top="0",i.left="0",i.fontFamily=e,n.textContent="mmMwWLliI0O&1",o.appendChild(n),n},s=(e,t)=>a(`'${e}',${t}`),c=pn.map(a),l=(()=>{const e={};for(const t of hn)e[t]=pn.map(e=>s(t,e));return e})();n.appendChild(o);for(let d=0;d<pn.length;d++)i[pn[d]]=c[d].offsetWidth,r[pn[d]]=c[d].offsetHeight;return hn.filter(e=>{return t=l[e],pn.some((e,n)=>t[n].offsetWidth!==i[e]||t[n].offsetHeight!==r[e]);var t})}))},domBlockers:function(){return d(this,arguments,function*({debug:e}={}){if(!tn()&&!cn())return;const t=function(){const e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}(),n=Object.keys(t),o=[].concat(...n.map(e=>t[e])),i=yield function(e){return d(this,null,function*(){var t;const n=document,o=n.createElement("div"),i=new Array(e.length),r={};xn(o);for(let a=0;a<e.length;++a){const t=un(e[a]);"DIALOG"===t.tagName&&t.show();const r=n.createElement("div");xn(r),r.appendChild(t),o.appendChild(r),i[a]=t}for(;!n.body;)yield Lt(50);n.body.appendChild(o);try{for(let t=0;t<e.length;++t)i[t].offsetParent||(r[e[t]]=!0)}finally{null===(t=o.parentNode)||void 0===t||t.removeChild(o)}return r})}(o);e&&function(e,t){let n="DOM blockers debug:\n```";for(const o of Object.keys(e)){n+=`\n${o}:`;for(const i of e[o])n+=`\n ${t[i]?"🚫":"➡️"} ${i}`}console.log(`${n}\n\`\`\``)}(t,i);const r=n.filter(e=>{const n=t[e];return Ft(n.map(e=>i[e]))>.6*n.length});return r.sort(),r})},fontPreferences:function(){return function(e,t=4e3){return dn((n,o)=>{const i=o.document,r=i.body,a=r.style;a.width=`${t}px`,a.webkitTextSizeAdjust=a.textSizeAdjust="none",en()?r.style.zoom=""+1/o.devicePixelRatio:tn()&&(r.style.zoom="reset");const s=i.createElement("div");return s.textContent=[...Array(t/20|0)].map(()=>"word").join(" "),r.appendChild(s),e(i,r,o)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}((e,t,n)=>{const o={},i={};for(const a of Object.keys(_n)){const[n={},i=Mn]=_n[a],r=e.createElement("span");r.textContent=i,r.style.whiteSpace="nowrap";for(const e of Object.keys(n)){const t=n[e];void 0!==t&&(r.style[e]=t)}o[a]=r,t.append(e.createElement("br"),r)}const r=en()&&function(){const e=window,t=document,{CSS:n,Promise:o,AudioContext:i}=e;return Ft([o&&"try"in o,"caretPositionFromPoint"in t,i&&"onerror"in i.prototype,n.supports("ruby-align","space-around")])>=3}();for(const a of Object.keys(_n)){const e=o[a].getBoundingClientRect().width;i[a]=r?An(e*n.devicePixelRatio):e}return i})},audio:function(){return tn()&&sn()&&on()||en()&&function(){const e=navigator,t=window,n=Audio.prototype,{visualViewport:o}=t;return Ft(["srLatency"in n,"srChannelCount"in n,"devicePosture"in e,o&&"segments"in o,"getTextInformation"in Image.prototype])>=3}()&&function(){const e=window,{URLPattern:t}=e;return Ft(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}()?-4:function(){const e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(tn()&&!nn()&&!function(){const e=window;return Ft(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}())return-1;const n=4500,o=new t(1,5e3,44100),i=o.createOscillator();i.type="triangle",i.frequency.value=1e4;const r=o.createDynamicsCompressor();r.threshold.value=-50,r.knee.value=40,r.ratio.value=12,r.attack.value=0,r.release.value=.25,i.connect(r),r.connect(o.destination),i.start(0);const[a,s]=function(e){const t=3,n=500,o=500,i=5e3;let r=()=>{};const a=new Promise((a,s)=>{let c=!1,l=0,d=0;e.oncomplete=e=>a(e.renderedBuffer);const u=()=>{setTimeout(()=>s(ln("timeout")),Math.min(o,d+i-Date.now()))},f=()=>{try{const o=e.startRendering();switch(Tt(o)&&At(o),e.state){case"running":d=Date.now(),c&&u();break;case"suspended":document.hidden||l++,c&&l>=t?s(ln("suspended")):setTimeout(f,n)}}catch(o){s(o)}};f(),r=()=>{c||(c=!0,d>0&&u())}});return[a,r]}(o),c=At(a.then(e=>function(e){let t=0;for(let n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}(e.getChannelData(0).subarray(n)),e=>{if("timeout"===e.name||"suspended"===e.name)return-3;throw e}));return()=>(s(),c)}()},screenFrame:function(){const e=tn()&&sn()&&on(),t=rn()&&an();if(e||t)return()=>Promise.resolve(void 0);const n=yn();return()=>d(null,null,function*(){const e=yield n(),t=e=>null===e?null:Bt(e,10);return[t(e[0]),t(e[1]),t(e[2]),t(e[3])]})},canvas:function(){return function(e){let t,n,o=!1;const[i,r]=function(){const e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}();!function(e,t){return!(!t||!e.toDataURL)}(i,r)?t=n="unsupported":(o=function(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}(r),e?t=n="skipped":[t,n]=function(e,t){!function(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';const n=`Cwm fjordbank gly ${String.fromCharCode(55357,56835)}`;t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45)}(e,t);const n=gn(e),o=gn(e);if(n!==o)return["unstable","unstable"];!function(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(const[n,o,i]of[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]])t.fillStyle=n,t.beginPath(),t.arc(o,i,40,0,2*Math.PI,!0),t.closePath(),t.fill();t.fillStyle="#f9c",t.arc(60,60,60,0,2*Math.PI,!0),t.arc(60,60,20,0,2*Math.PI,!0),t.fill("evenodd")}(e,t);const i=gn(e);return[i,n]}(i,r));return{winding:o,geometry:t,text:n}}(function(){const e=tn()&&sn()&&on(),t=rn()&&function(){const e=window,t=navigator,{CSS:n}=e;return Ft(["userActivation"in t,n.supports("color","light-dark(#000, #fff)"),n.supports("height","1lh"),"globalPrivacyControl"in t])>=3}();return e||t}())},osCpu:function(){return navigator.oscpu},languages:function(){const e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(void 0!==n&&t.push([n]),Array.isArray(e.languages))en()&&function(){const e=window;return Ft([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}()||t.push(e.languages);else if("string"==typeof e.languages){const n=e.languages;n&&t.push(n.split(","))}return t},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return Rt(Pt(navigator.deviceMemory),void 0)},screenResolution:function(){if(!(tn()&&sn()&&on()))return function(){const e=screen,t=e=>Rt(Ot(e),null),n=[t(e.width),t(e.height)];return n.sort().reverse(),n}()},hardwareConcurrency:function(){const e=Rt(Ot(navigator.hardwareConcurrency),void 0);return void 0!==e&&rn()&&an()?e>=8?8:4:e},timezone:function(){var e;const t=null===(e=window.Intl)||void 0===e?void 0:e.DateTimeFormat;if(t){const e=(new t).resolvedOptions().timeZone;if(e)return e}const n=-function(){const e=/* @__PURE__ */(new Date).getFullYear();return Math.max(Pt(new Date(e,0,1).getTimezoneOffset()),Pt(new Date(e,6,1).getTimezoneOffset()))}();return`UTC${n>=0?"+":""}${n}`},sessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},localStorage:function(){try{return!!window.localStorage}catch(e){return!0}},indexedDB:function(){if(!Qt()&&!function(){const e=window,t=navigator;return Ft(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Qt()}())try{return!!window.indexedDB}catch(e){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){const{platform:e}=navigator;return"MacIntel"===e&&tn()&&!nn()?function(){if("iPad"===navigator.platform)return!0;const e=screen,t=e.width/e.height;return Ft(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}()?"iPad":"iPhone":e},plugins:function(){const e=navigator.plugins;if(!e)return;const t=[];for(let n=0;n<e.length;++n){const o=e[n];if(!o)continue;const i=[];for(let e=0;e<o.length;++e){const t=o[e];i.push({type:t.type,suffixes:t.suffixes})}t.push({name:o.name,description:o.description,mimeTypes:i})}return t},touchSupport:function(){const e=navigator;let t,n=0;void 0!==e.maxTouchPoints?n=Ot(e.maxTouchPoints):void 0!==e.msMaxTouchPoints&&(n=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),t=!0}catch(o){t=!1}return{maxTouchPoints:n,touchEvent:t,touchStart:"ontouchstart"in window}},vendor:function(){return navigator.vendor||""},vendorFlavors:function(){const e=[];for(const t of["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"]){const n=window[t];n&&"object"==typeof n&&e.push(t)}return e.sort()},cookiesEnabled:function(){const e=document;try{e.cookie="cookietest=1; SameSite=Strict;";const t=-1!==e.cookie.indexOf("cookietest=");return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch(t){return!1}},colorGamut:function(){for(const e of["rec2020","p3","srgb"])if(matchMedia(`(color-gamut: ${e})`).matches)return e},invertedColors:function(){return!!Sn("inverted")||!Sn("none")&&void 0},forcedColors:function(){return!!Cn("active")||!Cn("none")&&void 0},monochrome:function(){if(matchMedia("(min-monochrome: 0)").matches){for(let e=0;e<=100;++e)if(matchMedia(`(max-monochrome: ${e})`).matches)return e;throw new Error("Too high value")}},contrast:function(){return kn("no-preference")?0:kn("high")||kn("more")?1:kn("low")||kn("less")?-1:kn("forced")?10:void 0},reducedMotion:function(){return!!En("reduce")||!En("no-preference")&&void 0},reducedTransparency:function(){return!!In("reduce")||!In("no-preference")&&void 0},hdr:function(){return!!Ln("high")||!Ln("standard")&&void 0},math:function(){const e=Wn.acos||Tn,t=Wn.acosh||Tn,n=Wn.asin||Tn,o=Wn.asinh||Tn,i=Wn.atanh||Tn,r=Wn.atan||Tn,a=Wn.sin||Tn,s=Wn.sinh||Tn,c=Wn.cos||Tn,l=Wn.cosh||Tn,d=Wn.tan||Tn,u=Wn.tanh||Tn,f=Wn.exp||Tn,p=Wn.expm1||Tn,h=Wn.log1p||Tn;return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:(g=1e154,Wn.log(g+Wn.sqrt(g*g-1))),asin:n(.12312423423423424),asinh:o(1),asinhPf:(e=>Wn.log(e+Wn.sqrt(e*e+1)))(1),atanh:i(.5),atanhPf:(e=>Wn.log((1+e)/(1-e))/2)(.5),atan:r(.5),sin:a(-1e300),sinh:s(1),sinhPf:(e=>Wn.exp(e)-1/Wn.exp(e)/2)(1),cos:c(10.000000000123),cosh:l(1),coshPf:(e=>(Wn.exp(e)+1/Wn.exp(e))/2)(1),tan:d(-1e300),tanh:u(1),tanhPf:(e=>(Wn.exp(2*e)-1)/(Wn.exp(2*e)+1))(1),exp:f(1),expm1:p(1),expm1Pf:(e=>Wn.exp(e)-1)(1),log1p:h(10),log1pPf:(e=>Wn.log(1+e))(10),powPI:(e=>Wn.pow(Wn.PI,e))(-100)};var g},pdfViewerEnabled:function(){return navigator.pdfViewerEnabled},architecture:function(){const e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]},applePay:function(){const{ApplePaySession:e}=window;if("function"!=typeof(null==e?void 0:e.canMakePayments))return-1;if(On())return-3;try{return e.canMakePayments()?1:0}catch(t){return function(e){if(e instanceof Error&&"InvalidAccessError"===e.name&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}(t)}},privateClickMeasurement:function(){var e;const t=document.createElement("a"),n=null!==(e=t.attributionSourceId)&&void 0!==e?e:t.attributionsourceid;return void 0===n?void 0:String(n)},audioBaseLatency:function(){if(!(cn()||tn()))return-2;if(!window.AudioContext)return-1;const e=(new AudioContext).baseLatency;return null==e?-1:isFinite(e)?e:-3},dateTimeLocale:function(){if(!window.Intl)return-1;const e=window.Intl.DateTimeFormat;if(!e)return-2;const t=e().resolvedOptions().locale;return t||""===t?t:-3},webGlBasics:function({cache:e}){var t,n,o,i,r,a;const s=jn(e);if(!s)return-1;if(!zn(s))return-2;const c=Dn()?null:s.getExtension(Vn);return{version:(null===(t=s.getParameter(s.VERSION))||void 0===t?void 0:t.toString())||"",vendor:(null===(n=s.getParameter(s.VENDOR))||void 0===n?void 0:n.toString())||"",vendorUnmasked:c?null===(o=s.getParameter(c.UNMASKED_VENDOR_WEBGL))||void 0===o?void 0:o.toString():"",renderer:(null===(i=s.getParameter(s.RENDERER))||void 0===i?void 0:i.toString())||"",rendererUnmasked:c?null===(r=s.getParameter(c.UNMASKED_RENDERER_WEBGL))||void 0===r?void 0:r.toString():"",shadingLanguageVersion:(null===(a=s.getParameter(s.SHADING_LANGUAGE_VERSION))||void 0===a?void 0:a.toString())||""}},webGlExtensions:function({cache:e}){const t=jn(e);if(!t)return-1;if(!zn(t))return-2;const n=t.getSupportedExtensions(),o=t.getContextAttributes(),i=[],r=[],a=[],s=[],c=[];if(o)for(const d of Object.keys(o))r.push(`${d}=${o[d]}`);const l=Hn(t);for(const d of l){const e=t[d];a.push(`${d}=${e}${Pn.has(e)?`=${t.getParameter(e)}`:""}`)}if(n)for(const d of n){if(d===Vn&&Dn()||"WEBGL_polygon_mode"===d&&Gn())continue;const e=t.getExtension(d);if(e)for(const n of Hn(e)){const o=e[n];s.push(`${n}=${o}${Rn.has(o)?`=${t.getParameter(o)}`:""}`)}else i.push(d)}for(const d of Fn)for(const e of Bn){const n=Nn(t,d,e);c.push(`${d}.${e}=${n.join(",")}`)}return s.sort(),a.sort(),{contextAttributes:r,parameters:a,shaderPrecisions:c,extensions:n,extensionParameters:s,unsupportedExtensions:i}}};function $n(e){const t=function(e){if(cn())return.4;if(tn())return!nn()||sn()&&on()?.3:.5;const t="value"in e.platform?e.platform.value:"";if(/^Win/.test(t))return.6;if(/^Mac/.test(t))return.5;return.7}(e),n=function(e){return Bt(.99+.01*e,1e-4)}(t);return{score:t,comment:"$ if upgrade to Pro: https://fingerprint.com/github/?utm_source=oss&utm_medium=referral&utm_campaign=confidence_score".replace(/\$/g,`${n}`)}}function Xn(e){return JSON.stringify(e,(e,t)=>{return t instanceof Error?s({name:(n=t).name,message:n.message,stack:null===(o=n.stack)||void 0===o?void 0:o.split("\n")},n):t;var n,o},2)}function Jn(e){return Ut(function(e){let t="";for(const n of Object.keys(e).sort()){const o=e[n],i="error"in o?"error":JSON.stringify(o.value);t+=`${t?"|":""}${n.replace(/([:|\\])/g,"\\$1")}:${i}`}return t}(e))}function Kn(e=50){return function(e,t=1/0){const{requestIdleCallback:n}=window;return n?new Promise(e=>n.call(window,()=>e(),{timeout:t})):Lt(Math.min(e,t))}(e,2*e)}function Un(e,t){const n=Date.now();return{get(o){return d(this,null,function*(){const i=Date.now(),r=yield e(),a=function(e){let t;const n=$n(e);return{get visitorId(){return void 0===t&&(t=Jn(this.components)),t},set visitorId(e){t=e},confidence:n,components:e,version:It}}(r);return(t||(null==o?void 0:o.debug))&&console.log(`Copy the text below to get the debug data:\n\n\`\`\`\nversion: ${a.version}\nuserAgent: ${navigator.userAgent}\ntimeBetweenLoadAndGet: ${i-n}\nvisitorId: ${a.visitorId}\ncomponents: ${Xn(r)}\n\`\`\``),a})}}}var qn={load:function(){return d(this,arguments,function*(e={}){const{delayFallback:t,debug:n,monitoring:o=!0}=e;o&&function(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{const e=new XMLHttpRequest;e.open("get",`https://m1.openfpcdn.io/fingerprintjs/v${It}/npm-monitoring`,!0),e.send()}catch(e){console.error(e)}}(),yield Kn(t);const i=function(e){return qt(Yn,e,[])}({cache:{},debug:n});return Un(i,n)})},hashComponents:Jn,componentsToDebugString:Xn};let Qn=null;const eo="undefined"!=typeof window&&window.Brainfish?window.Brainfish:(Qn||(Qn=function(){const e=[];let t=null;function n(n,o){if(t){const e=n.split(".");let i=t;for(let t=0;t<e.length-1;t++)i=i[e[t]];const r=i[e[e.length-1]];if("function"==typeof r)return r.apply(i,o)}else e.push([n,o])}return{Widgets:{init:(...e)=>n("Widgets.init",e),setTheme:(...e)=>n("Widgets.setTheme",e),identify:(...e)=>n("Widgets.identify",e),setSecretAttributes:(...e)=>n("Widgets.setSecretAttributes",e),open:()=>n("Widgets.open",[]),close:()=>n("Widgets.close",[]),createNewThread:()=>n("Widgets.createNewThread",[]),openModalForm:({formUrl:e,width:t,height:o})=>n("Widgets.openModalForm",[{formUrl:e,width:t,height:o}]),registerClientActionHandler:(...e)=>n("Widgets.registerClientActionHandler",e),onContextHelp:(...e)=>n("Widgets.onContextHelp",e),restoreConversation:(...e)=>n("Widgets.restoreConversation",e),clearConversation:()=>n("Widgets.clearConversation",[]),isReady:!1},SearchWidget:{initStandard:(...e)=>n("SearchWidget.initStandard",e)},HelpWidget:{initPopup:(...e)=>n("HelpWidget.initPopup",e),close:(...e)=>n("HelpWidget.close",e),open:(...e)=>n("HelpWidget.open",e),toggle:(...e)=>n("HelpWidget.toggle",e)},_setRealBrainfish(o){for(t=o;e.length>0;){const[t,o]=e.shift();n(t,o)}}}}(),"undefined"!=typeof window&&(window.Brainfish=Qn)),Qn),to=/* @__PURE__ */new Map,no=/* @__PURE__ */new Map;let oo=!1;function io(e,t,n,o,i){return d(this,null,function*(){var r,a,s,c,l,d,u;const f=(null==(r=e.overrides)?void 0:r.enableRecording)||(null==(a=null==t?void 0:t.settings)?void 0:a.enableRecording)||!1,p=(null==(s=e.overrides)?void 0:s.version)||(null==t?void 0:t.version);no.set(e.widgetKey,{options:e,config:t,apiHost:n,analyticsApiHost:o,fingerprint:i});const h=[];(null==p?void 0:p.startsWith("2."))?(mt(e,t,i),oo||(oo=!0,Et(()=>{no.forEach(({options:e,config:t,fingerprint:n})=>{var o;const i=(null==(o=e.overrides)?void 0:o.version)||(null==t?void 0:t.version);(null==i?void 0:i.startsWith("2."))&&mt(e,t,n)})}))):h.push(E(e,t)),h.push(M(e.widgetKey,t.trackingToken||"",n,o,f,{blocklist:null==(c=null==t?void 0:t.settings)?void 0:c.recordingBlocklist,sampleRate:null==(d=null==(l=null==t?void 0:t.settings)?void 0:l.ambientSettings)?void 0:d.sampleRate,_allowLocalhostRecording:null==(u=null==t?void 0:t.settings)?void 0:u._allowLocalhostRecording})),h.push(vt(n,e.widgetKey));const[g]=yield Promise.allSettled(h);g&&"fulfilled"===g.status&&g.value&&eo._setRealBrainfish(g.value)})}eo.Widgets.isReady=!1,eo.Widgets.identify=e=>{window.BrainfishAnalytics("identify",e)},eo.Widgets.setSecretAttributes=e=>{try{const{alg:t}=p(e);if("dir"!==t)throw new Error("Invalid algorithm")}catch(n){return void console.error("[Brainfish] Invalid JWE provided to setSecretAttributes:",n)}const t=document.querySelector("#bf-iframe-container .trigger-iframe");if(t){const n=()=>{t.contentWindow&&t.contentWindow.postMessage({type:"SET_SECRET_ATTRIBUTES",secretAttributes:e},"*")};t.contentWindow&&n(),t.addEventListener("load",n)}},eo.Widgets.init=e=>d(null,null,function*(){window&&(window.BrainfishAnalytics=window.BrainfishAnalytics||function(...e){(window.BrainfishAnalytics.q=window.BrainfishAnalytics.q||[]).push(e)});const t=S(e.overrides),n=(null==(o=e.overrides)?void 0:o.analyticsApiHost)||"";var o;let i,r;try{const e=yield qn.load();i=(yield e.get()).visitorId}catch(s){console.warn("[Brainfish] Error loading fingerprint:",s)}if(e.config)r=JSON.parse(A(e.config));else{const{config:n}=yield v({widgetKey:e.widgetKey,apiHost:t});r=n}let a=to.get(e.widgetKey);if(a||(a=io(e,r,t,n,i),to.set(e.widgetKey,a)),yield a,!Xe.isWidgetDOMExisting(e.widgetKey,r)){to.delete(e.widgetKey);const o=io(e,r,t,n,i);to.set(e.widgetKey,o),yield o}yield yt(r),eo.Widgets.isReady=!0,window.dispatchEvent(new Event("onBrainfishReady"))}),eo.Widgets.setTheme=e=>{var t;const n=document.querySelector("#bf-iframe-container .trigger-iframe");if(n){const o=new URL(n.src),i=new URLSearchParams(o.hash.substring(1)),r=i.get("theme");let a;r&&(a=JSON.parse(A(r)));const c=s(s({},a),e);null==(t=n.contentWindow)||t.postMessage({type:"SET_THEME",theme:c},"*");const l=_(JSON.stringify(c));i.set("theme",l),o.hash=`#${i.toString()}`,n.src=o.toString()}},eo.Widgets.registerClientActionHandler=(e,t)=>{((e,t)=>{it.set(e,t)})(e,t)};const ro=(...e)=>{"undefined"!=typeof window&&window.BrainfishAnalytics&&window.BrainfishAnalytics(...e)};export{ro as BrainfishAnalytics,eo as default};
|
|
1
|
+
var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,a=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,s=(e,t)=>{for(var n in t||(t={}))i.call(t,n)&&a(e,n,t[n]);if(o)for(var n of o(t))r.call(t,n)&&a(e,n,t[n]);return e},c=(e,o)=>t(e,n(o)),l=(e,t,n)=>a(e,"symbol"!=typeof t?t+"":t,n),d=(e,t,n)=>new Promise((o,i)=>{var r=e=>{try{s(n.next(e))}catch(t){i(t)}},a=e=>{try{s(n.throw(e))}catch(t){i(t)}},s=e=>e.done?o(e.value):Promise.resolve(e.value).then(r,a);s((n=n.apply(e,t)).next())});!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8754439f-d54e-4747-b58f-74128c2e21b9",e._sentryDebugIdIdentifier="sentry-dbid-8754439f-d54e-4747-b58f-74128c2e21b9")}catch(n){}}(),new TextEncoder;const u=new TextDecoder;const f=e=>{let t=e;t instanceof Uint8Array&&(t=u.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n})(t)}catch(n){throw new TypeError("The input to be decoded is not correctly encoded.")}};function p(e){let t;if("string"==typeof e){const n=e.split(".");3!==n.length&&5!==n.length||([t]=n)}else if("object"==typeof e&&e){if(!("protected"in e))throw new TypeError("Token does not contain a Protected Header");t=e.protected}try{if("string"!=typeof t||!t)throw new Error;const e=JSON.parse(u.decode(f(t)));if(!function(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}(e))throw new Error;return e}catch(n){throw new TypeError("Invalid Token or Protected Header formatting")}}var h,g,m,b;("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"web-widget@1.23.0"},(g=h||(h={})).Sidebar="sidebar",g.Searchbar="searchbar",g.Popup="popup",h.Sidebar,h.Searchbar,h.Popup;class y extends Error{constructor(e,t){super(e,t),l(this,"cause"),this.name="BrainfishWidgetError",this.cause=null==t?void 0:t.cause,Error.captureStackTrace&&Error.captureStackTrace(this,y),this.cause instanceof Error&&this.cause.stack&&(this.stack=this.stack+"\nCaused by: "+this.cause.stack)}toJSON(){return{name:this.name,message:this.message,stack:this.stack,cause:this.cause instanceof Error?{name:this.cause.name,message:this.cause.message,stack:this.cause.stack}:this.cause}}}(b=m||(m={})).LINK="link",b.CALLBACK="callback",b.EMAIL="email",b.PHONE="phone";const w=(e,t,n,o)=>{let i=n,r={};if(t instanceof Error)try{r=JSON.parse(t.message),i+=` - ${r.message||t.message}`}catch(a){i+=` - ${t.message}`}else i+=` - ${String(t)}`;((e,t,n)=>{if(!navigator||navigator.userAgent.toLowerCase().includes("headless"))return;const o=t.toJSON(),i=e||"https://app.brainfi.sh",r={error:`WebWidgetVersion: 1.23.0. ${t.message}`,stack:t.stack,cause:{message:o.message,stack:o.stack,cause:o.cause}};fetch(`${i}/api/trackError.widget.create`,{method:"POST",headers:{"Content-Type":"application/json","api-key":n},body:JSON.stringify(r)})})(e,new y(i,{cause:r}),o)};const v=e=>d(null,[e],function*({widgetKey:e,apiHost:t}){return function(e,t,n){return d(this,null,function*(){let o,i=0;for(;i<3;)try{const o=yield fetch(`${e}${t}`,{method:"POST",headers:{"Content-Type":"application/json","api-key":n}});if(!o.ok)throw new Error(`API call failed with status: ${o.status}`);const i=yield o.json();if(!i)throw new Error("Error loading config: empty response");return i}catch(r){if(o=r,i++,i>=3)throw w(e,r,"Error fetching config",n),o;yield new Promise(e=>setTimeout(e,500))}})}(t,"/api/searchWidgets.getConfigByKey",e)}),x=({config:e,apiKey:t,apiHost:n})=>{const o=e.settings||{};return["bodyActionButtons","footerActionButtons","nextBestActions"].forEach(e=>{o[e]&&(o[e]=o[e].map(e=>e.type===m.CALLBACK&&e.value?c(s({},e),{value:new Function(`return ${e.value}`)()}):e))}),c(s({},e),{settings:o,apiHost:n,widgetMode:e.widgetType,apiKey:t})},S=e=>(null==e?void 0:e.apiHost)||"https://app.brainfi.sh",C=e=>d(null,[e],function*({apiHost:e,widgetKey:t,version:n}){try{const e=`https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${n}/dist/web.js`,t=yield(e=>d(null,null,function*(){return document.getElementById("brainfish-widget")?window.Brainfish:new Promise((t,n)=>{const o=document.createElement("script");o.id="brainfish-widget",o.src=e,o.type="module",o.async=!0,o.crossOrigin="anonymous",o.onload=()=>{setTimeout(()=>{const e=window.Brainfish;e?t(e):n(new Error("Failed to load Brainfish module"))},200)},o.onerror=t=>{const o=t,i={message:`Failed to load script: ${e}`,type:o.type,fileName:o.filename,lineNumber:o.lineno,columnNumber:o.colno,error:o.error?o.error.toString():"Unknown error"};n(new Error(JSON.stringify(i)))},document.head.appendChild(o)})}))(e);return{widget:t}}catch(o){Math.random()<.05&&w(e,o,o.message,t)}});const k=/* @__PURE__ */new Set,E=(e,t)=>d(null,null,function*(){const n=S(e.overrides);try{if(k.has(e.widgetKey))return;const o=yield C({apiHost:n,widgetKey:e.widgetKey,version:t.version||"latest"});if(o){const{widget:i}=o,r=x({config:t,apiKey:e.widgetKey,apiHost:n});return e.overrides&&t.settings&&Object.entries(e.overrides).forEach(([e,n])=>{t.settings&&e in t.settings&&(t.settings[e]=((e=[],t)=>{const n=new Map(e.map(e=>[e.label,e]));return t.forEach(e=>n.set(e.label,e)),Array.from(n.values())})(t.settings[e],n))}),function(e,t){t.widgetType===h.Searchbar||"Search"===t.widgetType?e.SearchWidget.initStandard(t):e.HelpWidget.initPopup(t)}(i,r),k.add(e.widgetKey),i}}catch(o){w(n,o,o.message,e.widgetKey)}}),I=()=>{try{if("undefined"==typeof window||!("localStorage"in window)||null===window.localStorage)return!1;const e="__brainfish_storage_test__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&"QuotaExceededError"===e.name}},L=e=>{try{if(I())return window.localStorage.getItem(e)}catch(t){}return null},W=e=>{try{I()&&window.localStorage.removeItem(e)}catch(t){}};let T=!1;const _=(e,t,n,...o)=>d(null,[e,t,n,...o],function*(e,t,n,o="",i=!1,r){if(t||void 0!==console.warn&&console.warn("[Brainfish] BrainfishAnalytics not initialized. Access key is required."),!T)try{const a=(()=>{if("undefined"==typeof window||"undefined"==typeof navigator)return!1;const e=navigator,t=window,n=(e.doNotTrack||t.doNotTrack||e.msDoNotTrack||"0").toString().toLowerCase();return["1","yes","true"].includes(n)})(),s="true"===L("bf_tracking_disabled"),c=a||s;window.BrainfishAnalytics("init",{apiUrl:o,accessKey:t,trackScreenViews:!0,trackAttributes:!c,trackOutgoingLinks:!c,enableRecording:!c&&i,recordingOptions:r}),T=!0,yield((e,t)=>d(null,null,function*(){return document.getElementById("brainfish-analytics")?window.BrainfishAnalytics:new Promise(n=>{const o=document.createElement("script");o.id="brainfish-analytics",o.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/web-tracker@latest/dist/tracker.js",o.type="module",o.async=!0,o.crossOrigin="anonymous",o.onload=()=>{setTimeout(()=>{n(window.BrainfishAnalytics)},200)},o.onerror=()=>{Math.random()<.05&&w(e,new Error(`Failed to load script: ${o.src}`),`Failed to load script: ${o.src}`,t),n(void 0)},document.head.appendChild(o)})}))(n,e)}catch(a){w(n,a,"Failed to initialize BrainfishAnalytics",e)}});function M(e){const t=(new TextEncoder).encode(e);if("undefined"!=typeof window&&"function"==typeof window.btoa){const e=Array.from(t,e=>String.fromCharCode(e)).join("");return btoa(e)}if("undefined"!=typeof Buffer)return Buffer.from(t).toString("base64");throw new Error("[utils.base64Encode]: Unsupported environment")}const A=e=>{if("undefined"!=typeof window&&"function"==typeof window.atob){const t=atob(e),n=t.length,o=new Uint8Array(n);for(let e=0;e<n;e++)o[e]=t.charCodeAt(e);return(new TextDecoder).decode(o)}if("undefined"!=typeof Buffer)return Buffer.from(e,"base64").toString("utf-8");throw new Error("[utils.base64Decode]: Unsupported environment")},O="USER_IDENTIFY";let P=null;const R=/* @__PURE__ */new Set,B=/* @__PURE__ */new Map;let F=!1;function j(e){try{return new URL(e).origin}catch(t){return e}}function N(e){R.add(j(e))}function V(e,t,n){var o;const i=function(e,t){try{return new URL(e.src).origin}catch(n){if(t)return j(t)}return"*"}(e,n);null==(o=e.contentWindow)||o.postMessage({type:O,payload:t},i)}function H(e,t,n){var o;N(t),B.set(e,{widgetHost:t});const i=()=>{P&&V(e,P,t)};e.addEventListener("load",i,(null==n?void 0:n.signal)?{signal:n.signal}:void 0),null==(o=null==n?void 0:n.signal)||o.addEventListener("abort",()=>{B.delete(e)},{once:!0}),e.contentWindow&&i()}function Z(e){var t;"REQUEST_USER_IDENTITY"===(null==(t=e.data)?void 0:t.type)&&P&&e.source&&function(e){if(R.has(e))return!0;for(const n of B.keys())try{if(new URL(n.src).origin===e)return!0}catch(t){}return!1}(e.origin)&&(!function(e){if(!e)return!1;for(const t of B.keys())if(t.contentWindow===e)return!0;return!1}(e.source)?console.warn("[Brainfish] Rejected REQUEST_USER_IDENTITY from untrusted iframe source:",e.origin):e.source.postMessage({type:O,payload:P},e.origin))}function D(){F||"undefined"==typeof window||(F=!0,window.addEventListener("message",Z))}const G=/* @__PURE__ */new Set(["userId","firstName","lastName","email","phone","avatar","properties"]);function z(e){D();const t=function(e){const t=e.userId,n="string"==typeof t?t:"number"==typeof t&&Number.isFinite(t)?String(t):"";if(!n)return console.warn("[Brainfish] Widgets.identify requires a non-empty userId (string or finite number)."),null;const o={userId:n};"string"==typeof e.firstName&&(o.firstName=e.firstName),"string"==typeof e.lastName&&(o.lastName=e.lastName),"string"==typeof e.email&&(o.email=e.email),"string"==typeof e.phone&&(o.phone=e.phone),"string"==typeof e.avatar&&(o.avatar=e.avatar);const i={};for(const a of Object.keys(e))G.has(a)||(i[a]=e[a]);const r=e.properties&&"object"==typeof e.properties&&!Array.isArray(e.properties)?e.properties:void 0;return(Object.keys(i).length>0||r)&&(o.properties=s(s({},i),r)),o}(e);return t?(t.phone&&!/^\+[1-9]\d{1,14}$/.test(t.phone)&&console.warn("[Brainfish] phone should be in E.164 format (e.g., +14155552671)."),P=t,function(e){for(const[t,{widgetHost:n}]of B)V(t,e,n)}(t),t):null}function Y(e){if(e.__bfIdentityWrapped)return e;const t=(t,...n)=>{if("identify"===t&&n[0]&&"object"==typeof n[0]&&!Array.isArray(n[0])){const o=z(n[0]);if(o)return e(t,o,...n.slice(1))}return e(t,...n)};return t.__bfIdentityWrapped=!0,e.q&&(t.q=e.q),t}let $=!1;function X(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var J,K={exports:{}},U={exports:{}},q={exports:{}};function Q(){return J||(J=1,function(e,t){function n(e){return Math.round(255*e)}function o(e,t,o){return n(e)+","+n(t)+","+n(o)}t.__esModule=!0,t.default=void 0,t.default=function(e,t,n,i){if(void 0===i&&(i=o),0===t)return i(n,n,n);var r=(e%360+360)%360/60,a=(1-Math.abs(2*n-1))*t,s=a*(1-Math.abs(r%2-1)),c=0,l=0,d=0;r>=0&&r<1?(c=a,l=s):r>=1&&r<2?(c=s,l=a):r>=2&&r<3?(l=a,d=s):r>=3&&r<4?(l=s,d=a):r>=4&&r<5?(c=s,d=a):r>=5&&r<6&&(c=a,d=s);var u=n-a/2;return i(c+u,l+u,d+u)},e.exports=t.default}(q,q.exports)),q.exports}var ee,te={exports:{}};function ne(){return ee||(ee=1,function(e,t){t.__esModule=!0,t.default=void 0;var n={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};t.default=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return n[t]?"#"+n[t]:e},e.exports=t.default}(te,te.exports)),te.exports}var oe,ie,re,ae={exports:{}};function se(){return oe||(oe=1,function(e,t){function n(e){var t="function"==typeof Map?/* @__PURE__ */new Map:void 0;return n=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(o())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var a=new(e.bind.apply(e,r));return n&&i(a,n.prototype),a}(e,arguments,r(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),i(n,e)},n(e)}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!e})()}function i(e,t){return(i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}t.__esModule=!0,t.default=void 0;var a={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found and no default was provided.\n\n",75:"important requires a valid style object, got a %s instead.\n\n",76:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",77:'remToPx expects a value in "rem" but you provided it in "%s".\n\n',78:'base must be set in "px" or "%" but you set it in "%s".\n'};function s(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o,i=t[0],r=[];for(o=1;o<t.length;o+=1)r.push(t[o]);return r.forEach(function(e){i=i.replace(/%[a-z]/,e)}),i}t.default=/* @__PURE__ */function(e){var t,n;function o(t){var n;if("production"===process.env.NODE_ENV)n=e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+t+" for more information.")||this;else{for(var o=arguments.length,i=new Array(o>1?o-1:0),r=1;r<o;r++)i[r-1]=arguments[r];n=e.call(this,s.apply(void 0,[a[t]].concat(i)))||this}return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n)}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,i(t,n),o}(/* @__PURE__ */n(Error)),e.exports=t.default}(ae,ae.exports)),ae.exports}function ce(){return ie||(ie=1,function(e,t){t.__esModule=!0,t.default=function(e){if("string"!=typeof e)throw new i.default(3);var t=(0,o.default)(e);if(t.match(a))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(s)){var r=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:r}}if(t.match(c))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(l)){var h=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:h}}var g=d.exec(t);if(g)return{red:parseInt(""+g[1],10),green:parseInt(""+g[2],10),blue:parseInt(""+g[3],10)};var m=u.exec(t.substring(0,50));if(m)return{red:parseInt(""+m[1],10),green:parseInt(""+m[2],10),blue:parseInt(""+m[3],10),alpha:parseFloat(""+m[4])>1?parseFloat(""+m[4])/100:parseFloat(""+m[4])};var b=f.exec(t);if(b){var y=parseInt(""+b[1],10),w=parseInt(""+b[2],10)/100,v=parseInt(""+b[3],10)/100,x="rgb("+(0,n.default)(y,w,v)+")",S=d.exec(x);if(!S)throw new i.default(4,t,x);return{red:parseInt(""+S[1],10),green:parseInt(""+S[2],10),blue:parseInt(""+S[3],10)}}var C=p.exec(t.substring(0,50));if(C){var k=parseInt(""+C[1],10),E=parseInt(""+C[2],10)/100,I=parseInt(""+C[3],10)/100,L="rgb("+(0,n.default)(k,E,I)+")",W=d.exec(L);if(!W)throw new i.default(4,t,L);return{red:parseInt(""+W[1],10),green:parseInt(""+W[2],10),blue:parseInt(""+W[3],10),alpha:parseFloat(""+C[4])>1?parseFloat(""+C[4])/100:parseFloat(""+C[4])}}throw new i.default(5)};var n=r(/* @__PURE__ */Q()),o=r(/* @__PURE__ */ne()),i=r(/* @__PURE__ */se());function r(e){return e&&e.__esModule?e:{default:e}}var a=/^#[a-fA-F0-9]{6}$/,s=/^#[a-fA-F0-9]{8}$/,c=/^#[a-fA-F0-9]{3}$/,l=/^#[a-fA-F0-9]{4}$/,d=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,u=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,f=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,p=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;e.exports=t.default}(U,U.exports)),U.exports}function le(){return re||(re=1,function(e,t){t.__esModule=!0,t.default=function(e){if("transparent"===e)return 0;var t=(0,o.default)(e),n=Object.keys(t).map(function(e){var n=t[e]/255;return n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}),i=n[0],r=n[1],a=n[2];return parseFloat((.2126*i+.7152*r+.0722*a).toFixed(3))};var n,o=(n=/* @__PURE__ */ce())&&n.__esModule?n:{default:n};e.exports=t.default}(K,K.exports)),K.exports}const de=/* @__PURE__ */X(/* @__PURE__ */le());var ue,fe={exports:{}},pe={exports:{}};function he(){return ue||(ue=1,function(e,t){function n(e,t,o){return function(){var i=o.concat(Array.prototype.slice.call(arguments));return i.length>=t?e.apply(this,i):n(e,t,i)}}t.__esModule=!0,t.default=function(e){return n(e,e.length,[])},e.exports=t.default}(pe,pe.exports)),pe.exports}var ge,me={exports:{}};function be(){return ge||(ge=1,e=me,(t=me.exports).__esModule=!0,t.default=void 0,t.default=function(e,t,n){return Math.max(e,Math.min(t,n))},e.exports=t.default),me.exports;var e,t}var ye,we,ve={exports:{}},xe={exports:{}};function Se(){return ye||(ye=1,e=xe,(t=xe.exports).__esModule=!0,t.default=void 0,t.default=function(e){var t,n=e.red/255,o=e.green/255,i=e.blue/255,r=Math.max(n,o,i),a=Math.min(n,o,i),s=(r+a)/2;if(r===a)return void 0!==e.alpha?{hue:0,saturation:0,lightness:s,alpha:e.alpha}:{hue:0,saturation:0,lightness:s};var c=r-a,l=s>.5?c/(2-r-a):c/(r+a);switch(r){case n:t=(o-i)/c+(o<i?6:0);break;case o:t=(i-n)/c+2;break;default:t=(n-o)/c+4}return t*=60,void 0!==e.alpha?{hue:t,saturation:l,lightness:s,alpha:e.alpha}:{hue:t,saturation:l,lightness:s}},e.exports=t.default),xe.exports;var e,t}function Ce(){return we||(we=1,function(e,t){t.__esModule=!0,t.default=function(e){return(0,o.default)((0,n.default)(e))};var n=i(/* @__PURE__ */ce()),o=i(/* @__PURE__ */Se());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(ve,ve.exports)),ve.exports}var ke,Ee={exports:{}},Ie={exports:{}},Le={exports:{}},We={exports:{}};function Te(){return ke||(ke=1,function(e,t){t.__esModule=!0,t.default=void 0;t.default=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e},e.exports=t.default}(We,We.exports)),We.exports}var _e,Me,Ae,Oe={exports:{}};function Pe(){return _e||(_e=1,e=Oe,(t=Oe.exports).__esModule=!0,t.default=void 0,t.default=function(e){var t=e.toString(16);return 1===t.length?"0"+t:t},e.exports=t.default),Oe.exports;var e,t}function Re(){return Me||(Me=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=r(/* @__PURE__ */Q()),o=r(/* @__PURE__ */Te()),i=r(/* @__PURE__ */Pe());function r(e){return e&&e.__esModule?e:{default:e}}function a(e){return(0,i.default)(Math.round(255*e))}function s(e,t,n){return(0,o.default)("#"+a(e)+a(t)+a(n))}t.default=function(e,t,o){return(0,n.default)(e,t,o,s)},e.exports=t.default}(Le,Le.exports)),Le.exports}function Be(){return Ae||(Ae=1,function(e,t){t.__esModule=!0,t.default=function(e,t,i){if("number"==typeof e&&"number"==typeof t&&"number"==typeof i)return(0,n.default)(e,t,i);if("object"==typeof e&&void 0===t&&void 0===i)return(0,n.default)(e.hue,e.saturation,e.lightness);throw new o.default(1)};var n=i(/* @__PURE__ */Re()),o=i(/* @__PURE__ */se());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ie,Ie.exports)),Ie.exports}var Fe,je={exports:{}};function Ne(){return Fe||(Fe=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r,a){if("number"==typeof e&&"number"==typeof t&&"number"==typeof r&&"number"==typeof a)return a>=1?(0,n.default)(e,t,r):"rgba("+(0,o.default)(e,t,r)+","+a+")";if("object"==typeof e&&void 0===t&&void 0===r&&void 0===a)return e.alpha>=1?(0,n.default)(e.hue,e.saturation,e.lightness):"rgba("+(0,o.default)(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new i.default(2)};var n=r(/* @__PURE__ */Re()),o=r(/* @__PURE__ */Q()),i=r(/* @__PURE__ */se());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(je,je.exports)),je.exports}var Ve,He={exports:{}};function Ze(){return Ve||(Ve=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r){if("number"==typeof e&&"number"==typeof t&&"number"==typeof r)return(0,n.default)("#"+(0,o.default)(e)+(0,o.default)(t)+(0,o.default)(r));if("object"==typeof e&&void 0===t&&void 0===r)return(0,n.default)("#"+(0,o.default)(e.red)+(0,o.default)(e.green)+(0,o.default)(e.blue));throw new i.default(6)};var n=r(/* @__PURE__ */Te()),o=r(/* @__PURE__ */Pe()),i=r(/* @__PURE__ */se());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(He,He.exports)),He.exports}var De,Ge,ze,Ye={exports:{}};function $e(){return De||(De=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r,a){if("string"==typeof e&&"number"==typeof t){var s=(0,n.default)(e);return"rgba("+s.red+","+s.green+","+s.blue+","+t+")"}if("number"==typeof e&&"number"==typeof t&&"number"==typeof r&&"number"==typeof a)return a>=1?(0,o.default)(e,t,r):"rgba("+e+","+t+","+r+","+a+")";if("object"==typeof e&&void 0===t&&void 0===r&&void 0===a)return e.alpha>=1?(0,o.default)(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new i.default(7)};var n=r(/* @__PURE__ */ce()),o=r(/* @__PURE__ */Ze()),i=r(/* @__PURE__ */se());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ye,Ye.exports)),Ye.exports}function Xe(){return Ge||(Ge=1,function(e,t){t.__esModule=!0,t.default=function(e){if("object"!=typeof e)throw new a.default(8);if(l(e))return(0,r.default)(e);if(c(e))return(0,i.default)(e);if(u(e))return(0,o.default)(e);if(d(e))return(0,n.default)(e);throw new a.default(8)};var n=s(/* @__PURE__ */Be()),o=s(/* @__PURE__ */Ne()),i=s(/* @__PURE__ */Ze()),r=s(/* @__PURE__ */$e()),a=s(/* @__PURE__ */se());function s(e){return e&&e.__esModule?e:{default:e}}var c=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)},l=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha},d=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)},u=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha};e.exports=t.default}(Ee,Ee.exports)),Ee.exports}function Je(){return ze||(ze=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(/* @__PURE__ */he()),o=a(/* @__PURE__ */be()),i=a(/* @__PURE__ */Ce()),r=a(/* @__PURE__ */Xe());function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}var c=(0,n.default)(function(e,t){if("transparent"===t)return t;var n=(0,i.default)(t);return(0,r.default)(s({},n,{lightness:(0,o.default)(0,1,n.lightness-parseFloat(e))}))});t.default=c,e.exports=t.default}(fe,fe.exports)),fe.exports}const Ke=/* @__PURE__ */X(/* @__PURE__ */Je());var Ue,qe={exports:{}};function Qe(){return Ue||(Ue=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(/* @__PURE__ */he()),o=a(/* @__PURE__ */be()),i=a(/* @__PURE__ */Ce()),r=a(/* @__PURE__ */Xe());function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}var c=(0,n.default)(function(e,t){if("transparent"===t)return t;var n=(0,i.default)(t);return(0,r.default)(s({},n,{lightness:(0,o.default)(0,1,n.lightness+parseFloat(e))}))});t.default=c,e.exports=t.default}(qe,qe.exports)),qe.exports}const et=/* @__PURE__ */X(/* @__PURE__ */Qe()),tt="bf-iframe-container",nt="bf-trigger-button",ot="bf-search-bar-iframe-container",it="bf-search-bar-iframe-backdrop";function rt(e){var t,n;if(!document.querySelector("style[data-widget-styles]")){!function(e="#000",t="FFF"){const n=document.createElement("style");n.attributes.setNamedItem(document.createAttribute("data-widget-styles"));const o=de(e)>.5;n.textContent=`\n .bf-trigger-button{position:fixed;bottom:16px;right:16px;width:36px;height:36px;border-radius:50%;border:none;box-shadow:0 1px 6px #0000000f,0 2px 32px #00000029;transition:transform 167ms cubic-bezier(.33,0,0,1);box-sizing:content-box;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:1000;padding:12px;gap:10px;overflow:hidden}.bf-trigger-button.hidden{display:none}.trigger-button-icon{display:flex;align-items:center;justify-content:center;width:36px;height:36px;position:relative}.trigger-button-icon svg{width:100%;height:100%;position:absolute;inset:0}.trigger-button-icon>svg>path{transition:transform .3s ease,opacity .3s ease;transform:scale(.5);transform-origin:center;opacity:0}.trigger-button-icon .fish-icon{display:none}.trigger-button-icon .fish-icon.visible{display:block;max-width:36px;max-height:36px}.trigger-button-icon svg.visible{display:block}.trigger-button-icon>svg.visible>path{opacity:1;transform:scale(1)}.trigger-iframe{position:relative;width:100%;height:100%;border:none;outline:none;transform:translateZ(0);overflow:hidden}.bf-iframe-container{visibility:hidden;position:fixed;z-index:2147483000000;background-color:#fff;bottom:0;right:0;width:100vw;height:calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));border:none;overflow:hidden;opacity:0;pointer-events:none;transform:translateY(20px);transition:opacity .3s ease,transform .3s ease,width .2s ease-in-out,height .2s ease-in-out,visibility 0s .3s}.bf-iframe-container.open{visibility:visible;opacity:1;transform:translateY(0);pointer-events:auto;top:env(safe-area-inset-top);left:0;transition-delay:0s}@media (min-width: 576px){.bf-iframe-container{bottom:80px;right:24px;width:448px;height:min(750px,calc(100vh - 80px));border-radius:8px;border:1px solid var(--Dark-300, #d4d4d4);box-shadow:0 20px 25px -5px #1212171a,0 10px 10px -5px #1212170a}.bf-iframe-container.open{top:unset;left:unset}.bf-iframe-container.position-bottom-left{right:auto;left:24px}.bf-iframe-container.position-top-left{inset:80px auto auto 24px}.bf-iframe-container.position-top-right{bottom:auto;top:80px;right:24px}.bf-iframe-container.expanded{width:min(calc(448px * 1.35),calc(100vw - 16px));height:min(calc(750px * 1.35),calc(100vh - 80px))}}.bf-search-bar-iframe-container{position:relative;width:100%;min-height:200px;background-color:#fff;border:1px solid var(--dark-300, #d4d4d4);border-radius:8px;overflow:hidden;pointer-events:auto;transition:height .2s ease-in-out}.iframe-loading-indicator{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;z-index:10}.spinner{width:24px;height:24px;border:2px solid rgba(0,0,0,.1);border-radius:50%;border-top-color:#3498db;animation:spin 1s ease-in-out infinite}@keyframes spin{to{transform:rotate(360deg)}}.loading-error{width:24px;height:24px;position:relative;display:flex;align-items:center;justify-content:center}.loading-error:before,.loading-error:after{content:"";position:absolute;width:16px;height:2px;background-color:#e74c3c;border-radius:2px}.loading-error:before{transform:rotate(45deg)}.loading-error:after{transform:rotate(-45deg)}\n .${nt} { background: ${e}; }\n .${nt}:hover {\n background: ${o?Ke(.05,e):et(.05,e)};\n }\n .trigger-button-icon { color: ${t}; }\n `,document.head.appendChild(n)}((null==(t=null==e?void 0:e.theme)?void 0:t.inputButtonBgColor)||"#007bff",(null==(n=null==e?void 0:e.theme)?void 0:n.textBaseColor)||"#ffffff")}}class at{constructor(e,t){l(this,"isOpen",!1),this.widgetKey=e,this.widgetType=t}get isWidgetOpen(){return this.isOpen}openWidget(){this.isOpen=!0}closeWidget(){this.isOpen=!1}toggleWidget(){return this.isOpen=!this.isOpen,this.isOpen}}function st(e,t,n={}){const o=document.createElement(e);return o.className=t,Object.entries(n).forEach(([e,t])=>{o.setAttribute(e,t)}),o}const ct="brainfish-search-widget";class lt{constructor(e){l(this,"button",null),l(this,"icon",null),l(this,"closeCallback",null),this.widgetType=e}setCloseCallback(e){this.closeCallback=e}get containerClass(){return this.widgetType===h.Searchbar?ot:tt}get container(){return document.querySelector(`.${this.containerClass}`)}get iframe(){var e;return null==(e=this.container)?void 0:e.querySelector("iframe")}get backdrop(){return document.querySelector(`.${it}`)}setElements(e,t){this.button=e||null,this.icon=t||null}openWidget(e={}){var t,n,o;const i=document.querySelector(`.${this.containerClass}`),r=null==i?void 0:i.querySelector("iframe");if(e.newConversation&&e.contextualQuestion?null==(t=null==r?void 0:r.contentWindow)||t.postMessage({type:"CONTEXTUAL_QUESTION",question:e.contextualQuestion},"*"):e.newConversation&&(null==(n=null==r?void 0:r.contentWindow)||n.postMessage({type:"NEW_CONVERSATION"},"*")),null==(o=null==r?void 0:r.contentWindow)||o.postMessage({type:"FOCUS_SEARCH_FIELD"},"*"),this.widgetType!==h.Searchbar&&(null==i||i.classList.add("open"),e.position&&(null==i||i.classList.add(`position-${e.position}`),null==i||i.setAttribute("data-current-position",e.position))),null==i||i.setAttribute("aria-hidden","false"),this.widgetType!==h.Searchbar&&document.body.clientWidth>=962&&null===this.backdrop){const e=st("div",it);this.closeCallback&&e.addEventListener("click",this.closeCallback),document.body.appendChild(e)}this.updateButtonForOpen()}focusNextElement(){const e=document.querySelector(ct);if(e){const t=Array.from(document.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(e=>!e.hasAttribute("disabled")),n=t.indexOf(e);if(-1!==n){const e=t[n+1];e&&e.focus()}}}closeWidget(){const e=this.container;if(!e)return;const t=e.dataset.currentPosition;if(t){const n=()=>{e.dataset.currentPosition===t&&(e.classList.remove(`position-${t}`),delete e.dataset.currentPosition)};e.addEventListener("transitionend",n,{once:!0})}e.classList.remove("open"),e.setAttribute("aria-hidden","true"),this.backdrop&&(this.backdrop.remove(),this.focusNextElement()),this.updateButtonForClose()}updateButtonForOpen(){if(!this.button||!this.icon)return;const e=this.icon.querySelector(".fish-icon"),t=this.icon.querySelector(".close-icon");this.button.setAttribute("aria-expanded","true"),null==e||e.classList.remove("visible"),null==t||t.classList.add("visible"),this.isMobile()&&this.hideTriggerButton()}updateButtonForClose(){if(!this.button||!this.icon)return;const e=this.icon.querySelector(".fish-icon"),t=this.icon.querySelector(".close-icon");this.button.setAttribute("aria-expanded","false"),null==e||e.classList.add("visible"),null==t||t.classList.remove("visible"),this.isMobile()&&this.showTriggerButton()}showTriggerButton(){var e;null==(e=this.button)||e.classList.remove("hidden")}hideTriggerButton(){var e;null==(e=this.button)||e.classList.add("hidden")}resizeContainer(e){if(this.widgetType!==h.Searchbar)return;if(!this.container||!this.iframe)return;const t=Math.max(e,200);this.container.style.height=`${t}px`,this.iframe.style.height=`${t}px`}isMobile(){return document.body.clientWidth<=576}setupButtonClickListener(e){this.button&&this.button.addEventListener("click",e)}static isWidgetDOMExisting(e,t){const n=document.querySelector(`.${ot}[data-widget-key="${e}"]`);if(n){const e=document.querySelector("brainfish-search-widget");return!e||e.contains(n)}if(document.getElementById(`trigger-button-${e}`))return!0;if("Search"!==t.widgetType){if(document.querySelector(`.${tt}`))return!0}return!1}}class dt{static register(e,t){this.instances.set(e,t)}static getInstance(e){return this.instances.get(e)}static unregister(e){this.instances.delete(e)}static getAllInstances(){return Array.from(this.instances.values())}static getOpenInstance(){return this.getAllInstances().find(e=>e.isWidgetOpen)}static getClosedPopupInstance(){return this.getAllInstances().find(e=>!e.isWidgetOpen&&e.widgetType===h.Popup)}static clear(){this.instances.clear()}}l(dt,"instances",/* @__PURE__ */new Map);const ut=({formUrl:e,width:t="500px",height:n="600px"})=>{const o=document.createElement("div");o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("tabindex","-1"),o.style.cssText="\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: white;\n padding: 20px;\n border-radius: 8px;\n box-shadow: 0 2px 10px rgba(0,0,0,0.1);\n z-index: 300000000;\n ";const i=document.createElement("button");i.innerHTML="×",i.style.cssText="\n position: absolute;\n right: -16px;\n top: -16px;\n width: 32px;\n height: 32px;\n border: 2px solid #666;\n border-radius: 50%;\n background: #FFF;\n font-size: 20px;\n cursor: pointer;\n ";const r=document.createElement("iframe");r.src=e,r.style.cssText=`width: ${t}; height: ${n}; border: none;`;const a=document.activeElement,s=e=>{if("Tab"===e.key){const t=[i,r],n=document.activeElement,o=n?t.indexOf(n):-1;e.preventDefault(),e.shiftKey?o<=0?t[t.length-1].focus():t[o-1].focus():o>=t.length-1?t[0].focus():t[o+1].focus()}else"Escape"===e.key&&c()},c=()=>{o.remove(),l.remove(),document.removeEventListener("keydown",s),null==a||a.focus()},l=document.createElement("div");l.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0,0,0,0.5);\n z-index: 299999999;\n ",i.onclick=c,l.onclick=c,document.addEventListener("keydown",s),o.appendChild(i),o.appendChild(r),document.body.appendChild(l),document.body.appendChild(o),o.focus(),r.onload=()=>{r.setAttribute("tabindex","0"),i.focus()}},ft=e=>`brainfish_conversation_${e}`,pt={save(e,t){if(t){const o=L(ft(e));let i=Date.now();if(o)try{const e=JSON.parse(o);e.conversationId===t&&(i=e.persistedAt)}catch(n){}const r={conversationId:t,persistedAt:i};((e,t)=>{try{I()&&window.localStorage.setItem(e,t)}catch(n){}})(ft(e),JSON.stringify(r))}else W(ft(e))},load(e){const t=L(ft(e));if(!t)return null;try{const n=JSON.parse(t);return Date.now()-n.persistedAt>72e5?(W(ft(e)),null):n.conversationId}catch(n){return W(ft(e)),null}},clear(e){W(ft(e))}};class ht{static getIframeForInstance(e){var t,n;const o=e.widgetType===h.Searchbar?ot:tt,i=e.widgetType===h.Searchbar?`.${o}[data-widget-key="${e.widgetKey}"]`:`.${o}`;return null!=(n=null==(t=document.querySelector(i))?void 0:t.querySelector("iframe"))?n:null}static postMessageToInstance(e,t){var n,o;null==(o=null==(n=this.getIframeForInstance(e))?void 0:n.contentWindow)||o.postMessage(t,"*")}static initialize(){this.isInitialized||(this.setupDeprecatedAPI(),this.setupNewAPI(),this.isInitialized=!0)}static setupDeprecatedAPI(){var e;(null==(e=window.Brainfish)?void 0:e.HelpWidget)&&(window.Brainfish.HelpWidget.close=e=>this.closeCurrentlyOpenWidget(),window.Brainfish.HelpWidget.open=e=>this.openCurrentlyClosedPopupWidget(e))}static setupNewAPI(){var e;(null==(e=window.Brainfish)?void 0:e.Widgets)&&(window.Brainfish.Widgets.open=e=>this.openCurrentlyClosedPopupWidget(e),window.Brainfish.Widgets.close=()=>this.closeCurrentlyOpenWidget(),window.Brainfish.Widgets.createNewThread=()=>this.createNewThread(),window.Brainfish.Widgets.openModalForm=ut,window.Brainfish.Widgets.onContextHelp=(e,t)=>this.openContextualHelp(e,t),window.Brainfish.Widgets.restoreConversation=e=>this.restoreConversation(e),window.Brainfish.Widgets.clearConversation=()=>this.clearConversation())}static closeCurrentlyOpenWidget(){const e=dt.getOpenInstance();e&&e.closeWidget()}static openCurrentlyClosedPopupWidget(e){const t=dt.getClosedPopupInstance();if(t){const n="string"==typeof e?{trigger:e}:e,o={};(!0===(null==n?void 0:n.newConversation)||(null==n?void 0:n.trigger))&&(o.newConversation=!0),(null==n?void 0:n.trigger)&&(o.trigger=n.trigger),(null==n?void 0:n.position)&&(o.position=n.position),t.openWidget(o)}}static createNewThread(){const e=dt.getOpenInstance();if(e)return void this.postMessageToInstance(e,{type:"NEW_CONVERSATION"});const t=dt.getClosedPopupInstance();t&&t.openWidget({newConversation:!0})}static openContextualHelp(e,t={}){if(!e||"string"!=typeof e||0===e.trim().length)return void console.warn("Brainfish.Widgets.onContextHelp: Invalid question provided");let n=dt.getOpenInstance();if(n||(n=dt.getClosedPopupInstance()),!n)return void console.warn("Brainfish.Widgets.onContextHelp: No popup widget available");const o=c(s({},t),{newConversation:!0,trigger:"contextual-help",contextualQuestion:e.trim()});n.openWidget(o)}static restoreConversation(e){if(!e||"string"!=typeof e)return void console.warn("Brainfish.Widgets.restoreConversation: Invalid conversationId provided");let t=dt.getOpenInstance();const n=!!t;t||(t=dt.getClosedPopupInstance()),t?(n||t.openWidget({newConversation:!1}),this.postMessageToInstance(t,{type:"RESTORE_CONVERSATION",conversationId:e})):console.warn("Brainfish.Widgets.restoreConversation: No popup widget available")}static clearConversation(){var e;const t=null!=(e=dt.getOpenInstance())?e:dt.getClosedPopupInstance();t?(pt.clear(t.widgetKey),this.postMessageToInstance(t,{type:"NEW_CONVERSATION"})):console.warn("Brainfish.Widgets.clearConversation: No popup widget available")}}l(ht,"isInitialized",!1);class gt{constructor(e,t){this.widgetType=e,this.widgetKey=t}trackOpenWidget(e,t){this.dispatchEvent("onBrainfishWidgetOpen"),"contextual-help"===e?this.trackAnalytics("Open Widget - Contextual Help",{trigger:e,question:t}):e?this.trackAnalytics("Open Widget - Custom Trigger",{trigger:e}):this.trackAnalytics("Open Widget")}trackCloseWidget(){this.dispatchEvent("onBrainfishWidgetClose"),this.trackAnalytics("Close Widget")}trackCustomEvent(e,t={}){this.trackAnalytics(e,t)}dispatchEvent(e){window.dispatchEvent(new Event(e))}trackAnalytics(e,t={}){if(window.BrainfishAnalytics){let n;switch(this.widgetType){case h.Searchbar:n="searchbar_widget";break;case h.Sidebar:default:n="search_widget"}window.BrainfishAnalytics("track",e,c(s({},t),{widgetKey:this.widgetKey}),{source:n,widgetKey:this.widgetKey})}}}class mt{constructor(e,t){l(this,"state"),l(this,"domController"),l(this,"analyticsTracker"),this.state=new at(e,t),this.domController=new lt(t),this.domController.setCloseCallback(()=>this.closeWidget()),this.analyticsTracker=new gt(t,e)}static getInstance(e){return dt.getInstance(e)}get widgetKey(){return this.state.widgetKey}get widgetType(){return this.state.widgetType}get isWidgetOpen(){return this.state.isWidgetOpen}get containerClass(){return this.domController.containerClass}initialize({button:e,icon:t,isButtonHidden:n}){this.domController.setElements(e,t),this.domController.setupButtonClickListener(()=>this.toggleIframeVisibility()),dt.register(this.widgetKey,this),ht.initialize()}toggleIframeVisibility(){this.state.toggleWidget()?this.openWidget():this.closeWidget()}openWidget(e={}){var t,n;if(this.state.openWidget(),this.domController.openWidget(e),void 0===(null==e?void 0:e.newConversation)){const e=pt.load(this.widgetKey);e&&(null==(n=null==(t=this.domController.iframe)?void 0:t.contentWindow)||n.postMessage({type:"RESTORE_CONVERSATION",conversationId:e},"*"))}this.analyticsTracker.trackOpenWidget(e.trigger,e.contextualQuestion)}closeWidget(){this.state.closeWidget(),this.domController.closeWidget(),this.analyticsTracker.trackCloseWidget()}showTriggerButton(){this.domController.showTriggerButton()}hideTriggerButton(){this.domController.hideTriggerButton()}resizeContainer(e){this.domController.resizeContainer(e)}trackCustomEvent(e,t={}){this.analyticsTracker.trackCustomEvent(e,t)}destroy(){dt.unregister(this.widgetKey)}static initialize(e){const t=new mt(e.widgetKey,e.widgetType);return t.initialize(e),t}}function bt({widgetUrl:e,widgetType:t,props:n}){const o=t===h.Searchbar?ot:tt,i=st("div",o,s({id:o,"aria-live":"polite","aria-hidden":t===h.Searchbar?"false":"true"},n||{})),r=st("div","iframe-loading-indicator"),a=st("div","spinner");r.setAttribute("aria-label","Loading content"),r.setAttribute("role","status"),r.appendChild(a),i.appendChild(r);const c=st("iframe","trigger-iframe",{src:e,sandbox:"allow-scripts allow-same-origin allow-popups allow-forms",allow:"clipboard-write",role:"dialog"});return c.style.opacity="0",c.addEventListener("load",()=>{r.style.display="none",c.style.opacity="1"}),c.addEventListener("error",e=>{console.error("Error loading iframe:",e),r.innerHTML="";const t=st("div","loading-error");r.appendChild(t),r.setAttribute("aria-label","Failed to load content")}),i.appendChild(c),{iframeContainer:i,iframe:c}}function yt(e,t){const n=()=>{(t=>{var n;null==(n=e.contentWindow)||n.postMessage({type:"UPDATE_BODY_CLASS",isDarkMode:t},"*")})(document.body.classList.contains("dark"))};n(),(()=>{const e=new MutationObserver(n);e.observe(document.body,{attributes:!0,attributeFilter:["class"]}),t.addEventListener("abort",()=>e.disconnect())})()}const wt=/* @__PURE__ */new Map,vt=(e,t)=>`Error executing Client Action with key ${e}. Details: ${t instanceof Error?t.message:String(t)}`,xt=(e,t)=>d(null,null,function*(){if(wt.has(e)){const i=wt.get(e);if("function"!=typeof i)return{success:!1,reason:`Client Action registered with key ${e} is not a function`};try{const e=yield i(t);if(n=e,"[object Object]"!==Object.prototype.toString.call(n))throw new TypeError("Invalid result, expecting object type");return{success:!0,data:e}}catch(o){return{success:!1,reason:vt(e,o)}}}var n;return{success:!1,reason:`No Client Action registered with key ${e}`}}),St=/* @__PURE__ */new Map,Ct=/* @__PURE__ */new Set;function kt(e,{widgetHost:t,apiHost:n,widgetKey:o,widgetType:i,signal:r,stateManager:a}){window.addEventListener("message",r=>d(null,null,function*(){var s,c;if(r.origin!==t)return;const{type:l,widgetKey:d}=r.data;if(!d||d===o){if("TOGGLE_WIDGET_SIZE"===l&&function(){const e=document.querySelector(`.${tt}`);e.classList.contains("expanded")?e.classList.remove("expanded"):e.classList.add("expanded")}(),"RESIZE_IFRAME"===l){const{height:e}=r.data;a.resizeContainer(e)}if("TRACK_EVENT"===l){const{messageId:e,eventName:t,data:n}=r.data;if(e){if(Ct.has(e))return void console.warn(`[Brainfish] Duplicate TRACK_EVENT suppressed for "${t}" (messageId: ${e})`);Ct.add(e),setTimeout(()=>Ct.delete(e),5e3)}a.trackCustomEvent(t,n)}if("CLOSE_WIDGET"===l&&a.closeWidget(),"NEXT_BEST_ACTION_CLICKED"===l){const{action:e,searchQueryId:t,query:i,answer:a,conversation:s}=r.data;if(!["function","callback"].includes(e.type))return void console.error("[Brainfish] Invalid action type:",e);const c=St.get(e.id);if(c&&Date.now()-c<1e3)return void console.warn(`[Brainfish] Duplicate NEXT_BEST_ACTION_CLICKED suppressed for action "${e.id}" (fired ${Date.now()-c}ms ago)`);St.set(e.id,Date.now()),setTimeout(()=>St.delete(e.id),1e3),pt.clear(o);const l={query:i,answer:a,searchIntentId:e.searchIntentId,actionId:e.id,conversationId:(null==s?void 0:s.conversationId)||"",searchQueryId:t,metadata:e.metadata||{},conversation:s||null};try{if(window.__bfCallbacks=window.__bfCallbacks||{},window.__bfCallbacks[e.id])return void window.__bfCallbacks[e.id](i,a,l);const t=new URL(`${n}/api/searchWidgets.callback.codeblocks`);t.searchParams.set("apiKey",o),t.searchParams.set("codeblockId",e.id),l.searchIntentId&&t.searchParams.set("searchIntentId",l.searchIntentId);const r=document.createElement("script");r.src=t.toString(),document.head.appendChild(r),r.onload=()=>{window.__bfCallbacks[e.id](i,a,l),setTimeout(()=>{document.head.removeChild(r)},300)},r.onerror=()=>{console.error("[Brainfish] Failed to load callback script from server")}}catch(u){console.error("[Brainfish] Error executing callback:",u)}}if("CLIENT_EXECUTION"===l){const{actionKey:t,inputs:n,messageId:o}=r.data,i=yield xt(t,n);null==(s=e.contentWindow)||s.postMessage({type:"CLIENT_EXECUTION_RESULT",messageId:o,result:i},"*")}if("CONVERSATION_CHANGED"===l){const{conversationId:e}=r.data;i!==h.Searchbar&&pt.save(o,e)}if("REQUEST_USER_IDENTITY"===l&&r.source===e.contentWindow&&i===h.Popup){const t=pt.load(o);t&&(null==(c=e.contentWindow)||c.postMessage({type:"RESTORE_CONVERSATION",conversationId:t},"*"))}}}),{signal:r})}function Et(e,t,n){let o;const i=()=>{(t=>{var o;const i={type:"UPDATE_BODY_CLASS",isMobile:t};null==(o=e.contentWindow)||o.postMessage(i,"*"),t&&(n.isWidgetOpen?n.hideTriggerButton():n.showTriggerButton())})(document.body.clientWidth<=576)},r=()=>{o&&clearTimeout(o),o=window.setTimeout(i,300)};i(),(()=>{const e=new ResizeObserver(r);e.observe(document.body),t.addEventListener("abort",()=>e.disconnect())})()}const It=/* @__PURE__ */new Set;function Lt(e,t,{isButtonHidden:n,triggerButtonIcon:o}){const i=document.createDocumentFragment();let r;if(n)r=mt.initialize({isButtonHidden:n,widgetType:h.Popup,widgetKey:e});else{const{button:t,icon:n}=function(e,t){const n=st("button",nt,{id:`trigger-button-${e}`,"aria-controls":tt,"aria-expanded":"false","data-name":nt}),o=st("div","trigger-button-icon",{"aria-hidden":"true"});return o.innerHTML=t?`\n <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">\n <path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"></path>\n </svg>\n <img src="${t}" class="fish-icon visible" alt="Trigger button icon" aria-hidden="true" aria-label="help button icon" />\n `:'\n <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">\n <path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"></path>\n </svg>\n <svg width="24" height="14" viewBox="0 0 24 14" fill="none" xmlns="http://www.w3.org/2000/svg" class="fish-icon visible">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M1.71844 10.3882L4.60606 6.98384L1.71844 3.58375C1.4014 3.21362 1.44424 2.65841 1.81269 2.33993C1.97978 2.1979 2.65242 1.98701 3.04657 2.43461L5.78425 5.65824C6.14281 5.29523 6.51693 4.95924 6.90479 4.65114C8.88976 3.07437 11.2345 2.22803 13.6931 2.22803C16.9492 2.22803 20.0039 3.71718 22.2917 6.41142C22.5702 6.74282 22.5702 7.22916 22.2917 7.56056C20.0039 10.2591 16.9492 11.744 13.6931 11.744C11.2348 11.744 8.89035 10.8948 6.90554 9.31995C6.51741 9.01199 6.14304 8.67628 5.78425 8.31374L3.04657 11.5374C2.72953 11.9075 2.18114 11.9505 1.81269 11.632C1.44852 11.3179 1.40568 10.7584 1.71844 10.3882ZM5.93026 10.4683C8.17161 12.2599 10.8546 13.25 13.6931 13.25C17.4881 13.25 21.019 11.4034 23.4447 8.52942C24.1873 7.64571 24.1843 6.31801 23.4397 5.43663C20.8944 2.43919 17.4337 0.722025 13.6931 0.722025C10.8555 0.722025 8.17194 1.70845 5.92952 3.50276L4.17682 1.43933C3.57943 0.760929 2.79325 0.630009 2.25286 0.662947C1.98116 0.679506 1.73125 0.736852 1.51895 0.811846C1.26839 0.900352 1.03017 1.02718 0.827835 1.20058C-0.165283 2.05903 -0.283916 3.561 0.574656 4.56345L2.63075 6.98445L0.568104 9.41623C-0.272133 10.4106 -0.166523 11.9125 0.827835 12.7714C1.81372 13.6243 3.34308 13.5062 4.19036 12.5171L5.93026 10.4683Z" fill="currentColor"/>\n </svg>\n ',n.setAttribute("aria-label","Open Brainfish widget"),n.appendChild(o),{button:n,icon:o}}(e,o);i.appendChild(t),r=mt.initialize({button:t,icon:n,widgetType:h.Popup,widgetKey:e})}const{iframeContainer:a,iframe:s}=bt({widgetUrl:t,widgetType:h.Popup});return i.appendChild(a),{fragment:i,iframe:s,stateManager:r}}const Wt=({config:e,widgetUrl:t,apiHost:n,widgetHost:o,widgetKey:i,hideTriggerButton:r})=>{const{settings:a}=e,s=null!=r?r:null==a?void 0:a.hideTriggerButton,c=null==a?void 0:a.triggerButtonIcon;try{if(function(e){return It.has(e)}(i))return;if(function(e){return!!document.getElementById(`trigger-button-${e}`)}(i))return;rt(e);const{fragment:r,iframe:a,stateManager:l}=Lt(i,t,{isButtonHidden:s||!1,triggerButtonIcon:c||""}),d=new AbortController,{signal:u}=d;H(a,o,{signal:u}),a.onload=()=>{setTimeout(()=>{var e;yt(a,u),kt(a,{widgetHost:o,apiHost:n,widgetKey:i,widgetType:h.Popup,signal:u,stateManager:l}),Et(a,u,l);const r=pt.load(i),s=new URL(t).searchParams.has("conversation");r&&!s&&(null==(e=a.contentWindow)||e.postMessage({type:"RESTORE_CONVERSATION",conversationId:r},"*"))},0)},document.body?document.body.appendChild(r):(console.warn("[Brainfish] document.body not ready. Widget initialization deferred."),document.addEventListener("DOMContentLoaded",()=>{document.body.appendChild(r)},{once:!0})),It.add(i);const f=()=>{d.abort(),window.removeEventListener("beforeunload",f)};return void window.addEventListener("beforeunload",f)}catch(l){!function(e,t,n){w(e,t,t.message,n)}(n,l,i)}},Tt=/* @__PURE__ */new Map;const _t=({config:e,widgetUrl:t,apiHost:n,widgetHost:o,widgetKey:i})=>{var r,a,s,c;const{settings:l}=e;let d=mt.getInstance(i);null==(r=Tt.get(i))||r.abort();const u=new AbortController;Tt.set(i,u),rt(e);try{const e=document.querySelector(`.${ot}[data-widget-key="${i}"]`),r=document.querySelector(ct);e&&r&&!r.contains(e)&&(r.appendChild(e),0===r.getBoundingClientRect().width&&(null==(a=r.parentElement)||a.style.setProperty("width","100%"))),d||(d=mt.initialize({isButtonHidden:!0,widgetType:h.Searchbar,widgetKey:i}));const{signal:l}=u,f=e=>{H(e,o,{signal:l}),yt(e,l),kt(e,{widgetHost:o,apiHost:n,widgetKey:i,widgetType:h.Searchbar,signal:l,stateManager:d}),Et(e,l,d)};if(e){const t=e.querySelector("iframe");t&&("complete"===(null==(c=t.contentDocument)?void 0:c.readyState)?setTimeout(()=>{f(t)},0):t.onload=()=>{setTimeout(()=>{f(t)},0)})}else{const e=document.createDocumentFragment(),{iframeContainer:n,iframe:o}=bt({widgetUrl:t,widgetType:h.Searchbar,props:{"data-widget-type":"searchbar","data-widget-key":i}});o.onload=()=>{setTimeout(()=>{f(o)},0)},e.appendChild(n),r?(r.appendChild(e),0===r.getBoundingClientRect().width&&(null==(s=r.parentElement)||s.style.setProperty("width","100%"))):document.body.appendChild(e)}const p=()=>{u.abort(),Tt.delete(i),window.removeEventListener("beforeunload",p)};return void window.addEventListener("beforeunload",p)}catch(f){!function(e,t,n){w(e,t,t.message,n)}(n,f,i)}},Mt=(e,t,n)=>{var a;const c=S(e.overrides),l=(null==(d=e.overrides)?void 0:d.widgetHost)||"https://agent.brainfi.sh";var d;N(l);const u=null==(a=e.overrides)?void 0:a.hideTriggerButton,{theme:f,settings:p}=t,h=e.overrides||{},{theme:g,redirectRules:m,regions:b,customCss:y}=h,w=((e,t)=>{var n={};for(var a in e)i.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&o)for(var a of o(e))t.indexOf(a)<0&&r.call(e,a)&&(n[a]=e[a]);return n})(h,["theme","redirectRules","regions","customCss"]),v=s(s({},f),g),x=s(s({},p),w),C=M(JSON.stringify(m)),k={theme:M(JSON.stringify(v)),settings:M(JSON.stringify(x)),redirectRules:C};b&&(k.regions=M(JSON.stringify(b))),y&&(k.customCss=M(y)),n&&(k.fingerprint=M(n));const E=`${l}/?widgetKey=${e.widgetKey}#${new URLSearchParams(k).toString()}`;"Search"===t.widgetType?_t({config:t,widgetUrl:E,apiHost:c,widgetHost:l,widgetKey:e.widgetKey}):Wt({config:t,widgetUrl:E,apiHost:c,widgetHost:l,widgetKey:e.widgetKey,hideTriggerButton:u})};var At=/* @__PURE__ */(e=>(e.FRESHCHAT="freshchat",e.INTERCOM="intercom",e.ZENDESK="zendesk",e.HELPSCOUT="helpscout",e))(At||{});const Ot=e=>d(null,null,function*(){if(e.widgetType===h.Popup){const e=window.fcWidget?At.FRESHCHAT:null;e&&e===At.FRESHCHAT&&(yield d(null,null,function*(){window.fcWidget||(yield new Promise(e=>setTimeout(e,100))),window.fcWidget.hide(),window.fcWidget.on("widget:closed",()=>{window.fcWidget.hide()})}))}}),Pt="brainfish-nudges",Rt=(e,t)=>d(null,null,function*(){try{yield d(null,null,function*(){if(!document.getElementById(Pt))return new Promise(e=>{const t=document.createElement("script");t.id=Pt,t.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/nudge-widget@latest/dist/index.es.js",t.type="module",t.async=!0,t.crossOrigin="anonymous",t.onerror=()=>{Math.random()<.05&&void 0!==console.warn&&console.warn("[Brainfish] Nudge widget failed to load. This may be due to CSP or network restrictions."),e(void 0)},t.onload=()=>{setTimeout(()=>{e(!0)},200)},document.head.appendChild(t)})})}catch(n){w(e,n,"Failed to initialize Nudge widget",t)}});let Bt,Ft,jt,Nt=!1;const Vt=e=>{null==Bt||Bt.abort(),Bt=new AbortController;const{signal:t}=Bt;let n=window.location.pathname;const o=()=>{if(t.aborted)return;const o=window.location.pathname;o!==n&&(n=o,e())};window.addEventListener("popstate",o,{signal:t}),Nt||(Ft=history.pushState,jt=history.replaceState,history.pushState=function(...e){Ft.apply(this,e),setTimeout(o,0)},history.replaceState=function(...e){jt.apply(this,e),setTimeout(o,0)},Nt=!0),t.addEventListener("abort",()=>{Nt&&(history.pushState=Ft,history.replaceState=jt,Nt=!1)})};var Ht="5.2.0";function Zt(e,t){return new Promise(n=>setTimeout(n,e,t))}function Dt(){return new Promise(e=>{const t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(null)})}function Gt(e){return!!e&&"function"==typeof e.then}function zt(e,t){try{const n=e();Gt(n)?n.then(e=>t(!0,e),e=>t(!1,e)):t(!0,n)}catch(n){t(!1,n)}}function Yt(e,t,n=16){return d(this,null,function*(){const o=Array(e.length);let i=Date.now();for(let r=0;r<e.length;++r){o[r]=t(e[r],r);const a=Date.now();a>=i+n&&(i=a,yield Dt())}return o})}function $t(e){return e.then(void 0,()=>{}),e}function Xt(e){return parseInt(e)}function Jt(e){return parseFloat(e)}function Kt(e,t){return"number"==typeof e&&isNaN(e)?t:e}function Ut(e){return e.reduce((e,t)=>e+(t?1:0),0)}function qt(e,t=1){if(Math.abs(t)>=1)return Math.round(e/t)*t;{const n=1/t;return Math.round(e*n)/n}}function Qt(e,t){const n=e[0]>>>16,o=65535&e[0],i=e[1]>>>16,r=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16;let l=0,d=0,u=0,f=0;f+=r+(65535&t[1]),u+=f>>>16,f&=65535,u+=i+c,d+=u>>>16,u&=65535,d+=o+s,l+=d>>>16,d&=65535,l+=n+a,l&=65535,e[0]=l<<16|d,e[1]=u<<16|f}function en(e,t){const n=e[0]>>>16,o=65535&e[0],i=e[1]>>>16,r=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16,l=65535&t[1];let d=0,u=0,f=0,p=0;p+=r*l,f+=p>>>16,p&=65535,f+=i*l,u+=f>>>16,f&=65535,f+=r*c,u+=f>>>16,f&=65535,u+=o*l,d+=u>>>16,u&=65535,u+=i*c,d+=u>>>16,u&=65535,u+=r*s,d+=u>>>16,u&=65535,d+=n*l+o*c+i*s+r*a,d&=65535,e[0]=d<<16|u,e[1]=f<<16|p}function tn(e,t){const n=e[0];32===(t%=64)?(e[0]=e[1],e[1]=n):t<32?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(t-=32,e[0]=e[1]<<t|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function nn(e,t){0!==(t%=64)&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function on(e,t){e[0]^=t[0],e[1]^=t[1]}const rn=[4283543511,3981806797],an=[3301882366,444984403];function sn(e){const t=[0,e[0]>>>1];on(e,t),en(e,rn),t[1]=e[0]>>>1,on(e,t),en(e,an),t[1]=e[0]>>>1,on(e,t)}const cn=[2277735313,289559509],ln=[1291169091,658871167],dn=[0,5],un=[0,1390208809],fn=[0,944331445];function pn(e,t){const n=function(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);if(o>127)return(new TextEncoder).encode(e);t[n]=o}return t}(e);t=t||0;const o=[0,n.length],i=o[1]%16,r=o[1]-i,a=[0,t],s=[0,t],c=[0,0],l=[0,0];let d;for(d=0;d<r;d+=16)c[0]=n[d+4]|n[d+5]<<8|n[d+6]<<16|n[d+7]<<24,c[1]=n[d]|n[d+1]<<8|n[d+2]<<16|n[d+3]<<24,l[0]=n[d+12]|n[d+13]<<8|n[d+14]<<16|n[d+15]<<24,l[1]=n[d+8]|n[d+9]<<8|n[d+10]<<16|n[d+11]<<24,en(c,cn),tn(c,31),en(c,ln),on(a,c),tn(a,27),Qt(a,s),en(a,dn),Qt(a,un),en(l,ln),tn(l,33),en(l,cn),on(s,l),tn(s,31),Qt(s,a),en(s,dn),Qt(s,fn);c[0]=0,c[1]=0,l[0]=0,l[1]=0;const u=[0,0];switch(i){case 15:u[1]=n[d+14],nn(u,48),on(l,u);case 14:u[1]=n[d+13],nn(u,40),on(l,u);case 13:u[1]=n[d+12],nn(u,32),on(l,u);case 12:u[1]=n[d+11],nn(u,24),on(l,u);case 11:u[1]=n[d+10],nn(u,16),on(l,u);case 10:u[1]=n[d+9],nn(u,8),on(l,u);case 9:u[1]=n[d+8],on(l,u),en(l,ln),tn(l,33),en(l,cn),on(s,l);case 8:u[1]=n[d+7],nn(u,56),on(c,u);case 7:u[1]=n[d+6],nn(u,48),on(c,u);case 6:u[1]=n[d+5],nn(u,40),on(c,u);case 5:u[1]=n[d+4],nn(u,32),on(c,u);case 4:u[1]=n[d+3],nn(u,24),on(c,u);case 3:u[1]=n[d+2],nn(u,16),on(c,u);case 2:u[1]=n[d+1],nn(u,8),on(c,u);case 1:u[1]=n[d],on(c,u),en(c,cn),tn(c,31),en(c,ln),on(a,c)}return on(a,o),on(s,o),Qt(a,s),Qt(s,a),sn(a),sn(s),Qt(a,s),Qt(s,a),("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)+("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)}function hn(e,t,n,o){const i=Object.keys(e).filter(e=>!function(e,t){for(let n=0,o=e.length;n<o;++n)if(e[n]===t)return!0;return!1}(n,e)),r=$t(Yt(i,n=>function(e,t){const n=$t(new Promise(n=>{const o=Date.now();zt(e.bind(null,t),(...e)=>{const t=Date.now()-o;if(!e[0])return n(()=>({error:e[1],duration:t}));const i=e[1];if(function(e){return"function"!=typeof e}(i))return n(()=>({value:i,duration:t}));n(()=>new Promise(e=>{const n=Date.now();zt(i,(...o)=>{const i=t+Date.now()-n;if(!o[0])return e({error:o[1],duration:i});e({value:o[1],duration:i})})}))})}));return function(){return n.then(e=>e())}}(e[n],t),o));return function(){return d(this,null,function*(){const e=yield r,t=yield Yt(e,e=>$t(e()),o),n=yield Promise.all(t),a={};for(let o=0;o<i.length;++o)a[i[o]]=n[o];return a})}}function gn(){const e=window,t=navigator;return Ut(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function mn(){const e=window,t=navigator;return Ut(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===(t.vendor||"").indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function bn(){const e=window;return Ut(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===navigator.vendor.indexOf("Apple"),"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function yn(){const e=window,{HTMLElement:t,Document:n}=e;return Ut(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function wn(){const e=window;return t=e.print,/^function\s.*?\{\s*\[native code]\s*}$/.test(String(t))&&"[object WebPageNamespace]"===String(e.browser);var t}function vn(){var e,t;const n=window;return Ut(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function xn(){const{CSS:e}=window;return Ut([e.supports("selector(::details-content)"),e.supports("selector(::before::marker)"),e.supports("selector(::after::marker)"),!("locale"in CompositionEvent.prototype)])>=3}function Sn(){const e=window,t=navigator,{CSS:n,HTMLButtonElement:o}=e;return Ut([!("getStorageUpdates"in t),o&&"popover"in o.prototype,"CSSCounterStyleRule"in e,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function Cn(){const e=mn(),t=vn(),n=window,o=navigator,i="connection";return e?Ut([!("SharedWorker"in n),o[i]&&"ontypechange"in o[i],!("sinkId"in new Audio)])>=2:!!t&&Ut(["onorientationchange"in n,"orientation"in n,/android/i.test(o.appVersion)])>=2}function kn(e){const t=new Error(e);return t.name=e,t}function En(e,t,n=50){return d(this,null,function*(){var o,i,r;const a=document;for(;!a.body;)yield Zt(n);const s=a.createElement("iframe");try{for((yield new Promise((e,n)=>{let o=!1;const i=()=>{o=!0,e()};s.onload=i,s.onerror=e=>{o=!0,n(e)};const{style:r}=s;r.setProperty("display","block","important"),r.position="absolute",r.top="0",r.left="0",r.visibility="hidden",t&&"srcdoc"in s?s.srcdoc=t:s.src="about:blank",a.body.appendChild(s);const c=()=>{var e,t;o||("complete"===(null===(t=null===(e=s.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.readyState)?i():setTimeout(c,10))};c()}));!(null===(i=null===(o=s.contentWindow)||void 0===o?void 0:o.document)||void 0===i?void 0:i.body);)yield Zt(n);return yield e(s,s.contentWindow)}finally{null===(r=s.parentNode)||void 0===r||r.removeChild(s)}})}function In(e){const[t,n]=function(e){var t,n;const o=`Unexpected syntax '${e}'`,i=/^\s*([a-z-]*)(.*)$/i.exec(e),r=i[1]||void 0,a={},s=/([.:#][\w-]+|\[.+?\])/gi,c=(e,t)=>{a[e]=a[e]||[],a[e].push(t)};for(;;){const e=s.exec(i[2]);if(!e)break;const r=e[0];switch(r[0]){case".":c("class",r.slice(1));break;case"#":c("id",r.slice(1));break;case"[":{const e=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(r);if(!e)throw new Error(o);c(e[1],null!==(n=null!==(t=e[4])&&void 0!==t?t:e[5])&&void 0!==n?n:"");break}default:throw new Error(o)}}return[r,a]}(e),o=document.createElement(null!=t?t:"div");for(const i of Object.keys(n)){const e=n[i].join(" ");"style"===i?Ln(o.style,e):o.setAttribute(i,e)}return o}function Ln(e,t){for(const n of t.split(";")){const t=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(n);if(t){const[,n,o,,i]=t;e.setProperty(n,o,i||"")}}}const Wn=["monospace","sans-serif","serif"],Tn=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function _n(e){return e.toDataURL()}let Mn,An;function On(){return function(){if(void 0!==An)return;const e=()=>{const t=Pn();Rn(t)?An=setTimeout(e,2500):(Mn=t,An=void 0)};e()}(),()=>d(null,null,function*(){let e=Pn();if(Rn(e)){if(Mn)return[...Mn];(function(){const e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null})()&&(yield function(){const e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}(),e=Pn())}return Rn(e)||(Mn=e),e})}function Pn(){const e=screen;return[Kt(Jt(e.availTop),null),Kt(Jt(e.width)-Jt(e.availWidth)-Kt(Jt(e.availLeft),0),null),Kt(Jt(e.height)-Jt(e.availHeight)-Kt(Jt(e.availTop),0),null),Kt(Jt(e.availLeft),null)]}function Rn(e){for(let t=0;t<4;++t)if(e[t])return!1;return!0}function Bn(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function Fn(e){return matchMedia(`(inverted-colors: ${e})`).matches}function jn(e){return matchMedia(`(forced-colors: ${e})`).matches}function Nn(e){return matchMedia(`(prefers-contrast: ${e})`).matches}function Vn(e){return matchMedia(`(prefers-reduced-motion: ${e})`).matches}function Hn(e){return matchMedia(`(prefers-reduced-transparency: ${e})`).matches}function Zn(e){return matchMedia(`(dynamic-range: ${e})`).matches}const Dn=Math,Gn=()=>0;const zn="mmMwWLliI0fiflO&1",Yn={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function $n(e){const t=Cn()?0:3,n=Math.pow(10,t);return Math.floor(e*n)/n}const Xn=function(){let e=window;for(;;){const n=e.parent;if(!n||n===e)return!1;try{if(n.location.origin!==e.location.origin)return!0}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return!0;throw t}e=n}};const Jn=/* @__PURE__ */new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),Kn=/* @__PURE__ */new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),Un=["FRAGMENT_SHADER","VERTEX_SHADER"],qn=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],Qn="WEBGL_debug_renderer_info";function eo(e){if(e.webgl)return e.webgl.context;const t=document.createElement("canvas");let n;t.addEventListener("webglCreateContextError",()=>n=void 0);for(const i of["webgl","experimental-webgl"]){try{n=t.getContext(i)}catch(o){}if(n)break}return e.webgl={context:n},n}function to(e,t,n){const o=e.getShaderPrecisionFormat(e[t],e[n]);return o?[o.rangeMin,o.rangeMax,o.precision]:[]}function no(e){return Object.keys(e.__proto__).filter(oo)}function oo(e){return"string"==typeof e&&!e.match(/[^A-Z0-9_x]/)}function io(){return vn()}function ro(){return mn()||bn()}function ao(e){return"function"==typeof e.getParameter}const so={userAgentData:function(){return d(this,null,function*(){const e=navigator.userAgentData;if(!e)return;const t=e.brands.filter(({brand:e})=>!function(e){return/not/i.test(e)}(e)).map(({brand:e})=>e),n={brands:t.length>1?t.filter(e=>"Chromium"!==e):t,mobile:e.mobile,platform:e.platform};if(e.getHighEntropyValues)try{const t=yield e.getHighEntropyValues(["architecture","bitness","model","platformVersion"]);n.architecture=t.architecture,n.bitness=t.bitness,n.model=t.model,n.platformVersion=t.platformVersion}catch(o){if(!(o instanceof DOMException&&"NotAllowedError"===o.name))throw o;n.highEntropyStatus="not_allowed"}return n})},fonts:function(){return En((e,t)=>d(null,[e,t],function*(e,{document:t}){const n=t.body;n.style.fontSize="48px";const o=t.createElement("div");o.style.setProperty("visibility","hidden","important");const i={},r={},a=e=>{const n=t.createElement("span"),{style:i}=n;return i.position="absolute",i.top="0",i.left="0",i.fontFamily=e,n.textContent="mmMwWLliI0O&1",o.appendChild(n),n},s=(e,t)=>a(`'${e}',${t}`),c=Wn.map(a),l=(()=>{const e={};for(const t of Tn)e[t]=Wn.map(e=>s(t,e));return e})();n.appendChild(o);for(let d=0;d<Wn.length;d++)i[Wn[d]]=c[d].offsetWidth,r[Wn[d]]=c[d].offsetHeight;return Tn.filter(e=>{return t=l[e],Wn.some((e,n)=>t[n].offsetWidth!==i[e]||t[n].offsetHeight!==r[e]);var t})}))},domBlockers:function(){return d(this,arguments,function*({debug:e}={}){if(!bn()&&!Cn())return;const t=function(){const e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}(),n=Object.keys(t),o=[].concat(...n.map(e=>t[e])),i=yield function(e){return d(this,null,function*(){var t;const n=document,o=n.createElement("div"),i=new Array(e.length),r={};Bn(o);for(let a=0;a<e.length;++a){const t=In(e[a]);"DIALOG"===t.tagName&&t.show();const r=n.createElement("div");Bn(r),r.appendChild(t),o.appendChild(r),i[a]=t}for(;!n.body;)yield Zt(50);n.body.appendChild(o);try{for(let t=0;t<e.length;++t)i[t].offsetParent||(r[e[t]]=!0)}finally{null===(t=o.parentNode)||void 0===t||t.removeChild(o)}return r})}(o);e&&function(e,t){let n="DOM blockers debug:\n```";for(const o of Object.keys(e)){n+=`\n${o}:`;for(const i of e[o])n+=`\n ${t[i]?"🚫":"➡️"} ${i}`}console.log(`${n}\n\`\`\``)}(t,i);const r=n.filter(e=>{const n=t[e];return Ut(n.map(e=>i[e]))>.6*n.length});return r.sort(),r})},fontPreferences:function(){return function(e,t=4e3){return En((n,o)=>{const i=o.document,r=i.body,a=r.style;a.width=`${t}px`,a.webkitTextSizeAdjust=a.textSizeAdjust="none",mn()?r.style.zoom=""+1/o.devicePixelRatio:bn()&&(r.style.zoom="reset");const s=i.createElement("div");return s.textContent=[...Array(t/20|0)].map(()=>"word").join(" "),r.appendChild(s),e(i,r,o)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}((e,t,n)=>{const o={},i={};for(const a of Object.keys(Yn)){const[n={},i=zn]=Yn[a],r=e.createElement("span");r.textContent=i,r.style.whiteSpace="nowrap";for(const e of Object.keys(n)){const t=n[e];void 0!==t&&(r.style[e]=t)}o[a]=r,t.append(e.createElement("br"),r)}const r=mn()&&function(){const e=window,t=document,{CSS:n,Promise:o,AudioContext:i}=e;return Ut([o&&"try"in o,"caretPositionFromPoint"in t,i&&"onerror"in i.prototype,n.supports("ruby-align","space-around")])>=3}();for(const a of Object.keys(Yn)){const e=o[a].getBoundingClientRect().width;i[a]=r?$n(e*n.devicePixelRatio):e}return i})},audio:function(){return bn()&&Sn()&&wn()||mn()&&function(){const e=navigator,t=window,n=Audio.prototype,{visualViewport:o}=t;return Ut(["srLatency"in n,"srChannelCount"in n,"devicePosture"in e,o&&"segments"in o,"getTextInformation"in Image.prototype])>=3}()&&function(){const e=window,{URLPattern:t}=e;return Ut(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}()?-4:function(){const e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(bn()&&!yn()&&!function(){const e=window;return Ut(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}())return-1;const n=4500,o=new t(1,5e3,44100),i=o.createOscillator();i.type="triangle",i.frequency.value=1e4;const r=o.createDynamicsCompressor();r.threshold.value=-50,r.knee.value=40,r.ratio.value=12,r.attack.value=0,r.release.value=.25,i.connect(r),r.connect(o.destination),i.start(0);const[a,s]=function(e){const t=3,n=500,o=500,i=5e3;let r=()=>{};const a=new Promise((a,s)=>{let c=!1,l=0,d=0;e.oncomplete=e=>a(e.renderedBuffer);const u=()=>{setTimeout(()=>s(kn("timeout")),Math.min(o,d+i-Date.now()))},f=()=>{try{const o=e.startRendering();switch(Gt(o)&&$t(o),e.state){case"running":d=Date.now(),c&&u();break;case"suspended":document.hidden||l++,c&&l>=t?s(kn("suspended")):setTimeout(f,n)}}catch(o){s(o)}};f(),r=()=>{c||(c=!0,d>0&&u())}});return[a,r]}(o),c=$t(a.then(e=>function(e){let t=0;for(let n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}(e.getChannelData(0).subarray(n)),e=>{if("timeout"===e.name||"suspended"===e.name)return-3;throw e}));return()=>(s(),c)}()},screenFrame:function(){const e=bn()&&Sn()&&wn(),t=vn()&&xn();if(e||t)return()=>Promise.resolve(void 0);const n=On();return()=>d(null,null,function*(){const e=yield n(),t=e=>null===e?null:qt(e,10);return[t(e[0]),t(e[1]),t(e[2]),t(e[3])]})},canvas:function(){return function(e){let t,n,o=!1;const[i,r]=function(){const e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}();!function(e,t){return!(!t||!e.toDataURL)}(i,r)?t=n="unsupported":(o=function(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}(r),e?t=n="skipped":[t,n]=function(e,t){!function(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';const n=`Cwm fjordbank gly ${String.fromCharCode(55357,56835)}`;t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45)}(e,t);const n=_n(e),o=_n(e);if(n!==o)return["unstable","unstable"];!function(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(const[n,o,i]of[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]])t.fillStyle=n,t.beginPath(),t.arc(o,i,40,0,2*Math.PI,!0),t.closePath(),t.fill();t.fillStyle="#f9c",t.arc(60,60,60,0,2*Math.PI,!0),t.arc(60,60,20,0,2*Math.PI,!0),t.fill("evenodd")}(e,t);const i=_n(e);return[i,n]}(i,r));return{winding:o,geometry:t,text:n}}(function(){const e=bn()&&Sn()&&wn(),t=vn()&&function(){const e=window,t=navigator,{CSS:n}=e;return Ut(["userActivation"in t,n.supports("color","light-dark(#000, #fff)"),n.supports("height","1lh"),"globalPrivacyControl"in t])>=3}();return e||t}())},osCpu:function(){return navigator.oscpu},languages:function(){const e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(void 0!==n&&t.push([n]),Array.isArray(e.languages))mn()&&function(){const e=window;return Ut([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}()||t.push(e.languages);else if("string"==typeof e.languages){const n=e.languages;n&&t.push(n.split(","))}return t},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return Kt(Jt(navigator.deviceMemory),void 0)},screenResolution:function(){if(!(bn()&&Sn()&&wn()))return function(){const e=screen,t=e=>Kt(Xt(e),null),n=[t(e.width),t(e.height)];return n.sort().reverse(),n}()},hardwareConcurrency:function(){const e=Kt(Xt(navigator.hardwareConcurrency),void 0);return void 0!==e&&vn()&&xn()?e>=8?8:4:e},timezone:function(){var e;const t=null===(e=window.Intl)||void 0===e?void 0:e.DateTimeFormat;if(t){const e=(new t).resolvedOptions().timeZone;if(e)return e}const n=-function(){const e=/* @__PURE__ */(new Date).getFullYear();return Math.max(Jt(new Date(e,0,1).getTimezoneOffset()),Jt(new Date(e,6,1).getTimezoneOffset()))}();return`UTC${n>=0?"+":""}${n}`},sessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},localStorage:function(){try{return!!window.localStorage}catch(e){return!0}},indexedDB:function(){if(!gn()&&!function(){const e=window,t=navigator;return Ut(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!gn()}())try{return!!window.indexedDB}catch(e){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){const{platform:e}=navigator;return"MacIntel"===e&&bn()&&!yn()?function(){if("iPad"===navigator.platform)return!0;const e=screen,t=e.width/e.height;return Ut(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}()?"iPad":"iPhone":e},plugins:function(){const e=navigator.plugins;if(!e)return;const t=[];for(let n=0;n<e.length;++n){const o=e[n];if(!o)continue;const i=[];for(let e=0;e<o.length;++e){const t=o[e];i.push({type:t.type,suffixes:t.suffixes})}t.push({name:o.name,description:o.description,mimeTypes:i})}return t},touchSupport:function(){const e=navigator;let t,n=0;void 0!==e.maxTouchPoints?n=Xt(e.maxTouchPoints):void 0!==e.msMaxTouchPoints&&(n=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),t=!0}catch(o){t=!1}return{maxTouchPoints:n,touchEvent:t,touchStart:"ontouchstart"in window}},vendor:function(){return navigator.vendor||""},vendorFlavors:function(){const e=[];for(const t of["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"]){const n=window[t];n&&"object"==typeof n&&e.push(t)}return e.sort()},cookiesEnabled:function(){const e=document;try{e.cookie="cookietest=1; SameSite=Strict;";const t=-1!==e.cookie.indexOf("cookietest=");return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch(t){return!1}},colorGamut:function(){for(const e of["rec2020","p3","srgb"])if(matchMedia(`(color-gamut: ${e})`).matches)return e},invertedColors:function(){return!!Fn("inverted")||!Fn("none")&&void 0},forcedColors:function(){return!!jn("active")||!jn("none")&&void 0},monochrome:function(){if(matchMedia("(min-monochrome: 0)").matches){for(let e=0;e<=100;++e)if(matchMedia(`(max-monochrome: ${e})`).matches)return e;throw new Error("Too high value")}},contrast:function(){return Nn("no-preference")?0:Nn("high")||Nn("more")?1:Nn("low")||Nn("less")?-1:Nn("forced")?10:void 0},reducedMotion:function(){return!!Vn("reduce")||!Vn("no-preference")&&void 0},reducedTransparency:function(){return!!Hn("reduce")||!Hn("no-preference")&&void 0},hdr:function(){return!!Zn("high")||!Zn("standard")&&void 0},math:function(){const e=Dn.acos||Gn,t=Dn.acosh||Gn,n=Dn.asin||Gn,o=Dn.asinh||Gn,i=Dn.atanh||Gn,r=Dn.atan||Gn,a=Dn.sin||Gn,s=Dn.sinh||Gn,c=Dn.cos||Gn,l=Dn.cosh||Gn,d=Dn.tan||Gn,u=Dn.tanh||Gn,f=Dn.exp||Gn,p=Dn.expm1||Gn,h=Dn.log1p||Gn;return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:(g=1e154,Dn.log(g+Dn.sqrt(g*g-1))),asin:n(.12312423423423424),asinh:o(1),asinhPf:(e=>Dn.log(e+Dn.sqrt(e*e+1)))(1),atanh:i(.5),atanhPf:(e=>Dn.log((1+e)/(1-e))/2)(.5),atan:r(.5),sin:a(-1e300),sinh:s(1),sinhPf:(e=>Dn.exp(e)-1/Dn.exp(e)/2)(1),cos:c(10.000000000123),cosh:l(1),coshPf:(e=>(Dn.exp(e)+1/Dn.exp(e))/2)(1),tan:d(-1e300),tanh:u(1),tanhPf:(e=>(Dn.exp(2*e)-1)/(Dn.exp(2*e)+1))(1),exp:f(1),expm1:p(1),expm1Pf:(e=>Dn.exp(e)-1)(1),log1p:h(10),log1pPf:(e=>Dn.log(1+e))(10),powPI:(e=>Dn.pow(Dn.PI,e))(-100)};var g},pdfViewerEnabled:function(){return navigator.pdfViewerEnabled},architecture:function(){const e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]},applePay:function(){const{ApplePaySession:e}=window;if("function"!=typeof(null==e?void 0:e.canMakePayments))return-1;if(Xn())return-3;try{return e.canMakePayments()?1:0}catch(t){return function(e){if(e instanceof Error&&"InvalidAccessError"===e.name&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}(t)}},privateClickMeasurement:function(){var e;const t=document.createElement("a"),n=null!==(e=t.attributionSourceId)&&void 0!==e?e:t.attributionsourceid;return void 0===n?void 0:String(n)},audioBaseLatency:function(){if(!(Cn()||bn()))return-2;if(!window.AudioContext)return-1;const e=(new AudioContext).baseLatency;return null==e?-1:isFinite(e)?e:-3},dateTimeLocale:function(){if(!window.Intl)return-1;const e=window.Intl.DateTimeFormat;if(!e)return-2;const t=e().resolvedOptions().locale;return t||""===t?t:-3},webGlBasics:function({cache:e}){var t,n,o,i,r,a;const s=eo(e);if(!s)return-1;if(!ao(s))return-2;const c=io()?null:s.getExtension(Qn);return{version:(null===(t=s.getParameter(s.VERSION))||void 0===t?void 0:t.toString())||"",vendor:(null===(n=s.getParameter(s.VENDOR))||void 0===n?void 0:n.toString())||"",vendorUnmasked:c?null===(o=s.getParameter(c.UNMASKED_VENDOR_WEBGL))||void 0===o?void 0:o.toString():"",renderer:(null===(i=s.getParameter(s.RENDERER))||void 0===i?void 0:i.toString())||"",rendererUnmasked:c?null===(r=s.getParameter(c.UNMASKED_RENDERER_WEBGL))||void 0===r?void 0:r.toString():"",shadingLanguageVersion:(null===(a=s.getParameter(s.SHADING_LANGUAGE_VERSION))||void 0===a?void 0:a.toString())||""}},webGlExtensions:function({cache:e}){const t=eo(e);if(!t)return-1;if(!ao(t))return-2;const n=t.getSupportedExtensions(),o=t.getContextAttributes(),i=[],r=[],a=[],s=[],c=[];if(o)for(const d of Object.keys(o))r.push(`${d}=${o[d]}`);const l=no(t);for(const d of l){const e=t[d];a.push(`${d}=${e}${Jn.has(e)?`=${t.getParameter(e)}`:""}`)}if(n)for(const d of n){if(d===Qn&&io()||"WEBGL_polygon_mode"===d&&ro())continue;const e=t.getExtension(d);if(e)for(const n of no(e)){const o=e[n];s.push(`${n}=${o}${Kn.has(o)?`=${t.getParameter(o)}`:""}`)}else i.push(d)}for(const d of Un)for(const e of qn){const n=to(t,d,e);c.push(`${d}.${e}=${n.join(",")}`)}return s.sort(),a.sort(),{contextAttributes:r,parameters:a,shaderPrecisions:c,extensions:n,extensionParameters:s,unsupportedExtensions:i}}};function co(e){const t=function(e){if(Cn())return.4;if(bn())return!yn()||Sn()&&wn()?.3:.5;const t="value"in e.platform?e.platform.value:"";if(/^Win/.test(t))return.6;if(/^Mac/.test(t))return.5;return.7}(e),n=function(e){return qt(.99+.01*e,1e-4)}(t);return{score:t,comment:"$ if upgrade to Pro: https://fingerprint.com/github/?utm_source=oss&utm_medium=referral&utm_campaign=confidence_score".replace(/\$/g,`${n}`)}}function lo(e){return JSON.stringify(e,(e,t)=>{return t instanceof Error?s({name:(n=t).name,message:n.message,stack:null===(o=n.stack)||void 0===o?void 0:o.split("\n")},n):t;var n,o},2)}function uo(e){return pn(function(e){let t="";for(const n of Object.keys(e).sort()){const o=e[n],i="error"in o?"error":JSON.stringify(o.value);t+=`${t?"|":""}${n.replace(/([:|\\])/g,"\\$1")}:${i}`}return t}(e))}function fo(e=50){return function(e,t=1/0){const{requestIdleCallback:n}=window;return n?new Promise(e=>n.call(window,()=>e(),{timeout:t})):Zt(Math.min(e,t))}(e,2*e)}function po(e,t){const n=Date.now();return{get(o){return d(this,null,function*(){const i=Date.now(),r=yield e(),a=function(e){let t;const n=co(e);return{get visitorId(){return void 0===t&&(t=uo(this.components)),t},set visitorId(e){t=e},confidence:n,components:e,version:Ht}}(r);return(t||(null==o?void 0:o.debug))&&console.log(`Copy the text below to get the debug data:\n\n\`\`\`\nversion: ${a.version}\nuserAgent: ${navigator.userAgent}\ntimeBetweenLoadAndGet: ${i-n}\nvisitorId: ${a.visitorId}\ncomponents: ${lo(r)}\n\`\`\``),a})}}}var ho={load:function(){return d(this,arguments,function*(e={}){const{delayFallback:t,debug:n,monitoring:o=!0}=e;o&&function(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{const e=new XMLHttpRequest;e.open("get",`https://m1.openfpcdn.io/fingerprintjs/v${Ht}/npm-monitoring`,!0),e.send()}catch(e){console.error(e)}}(),yield fo(t);const i=function(e){return hn(so,e,[])}({cache:{},debug:n});return po(i,n)})},hashComponents:uo,componentsToDebugString:lo};D(),function(){if($||"undefined"==typeof window)return;$=!0;const e=window;let t=e.BrainfishAnalytics?Y(e.BrainfishAnalytics):void 0;try{Object.defineProperty(window,"BrainfishAnalytics",{configurable:!0,get:()=>t,set(e){t=e?Y(e):e}})}catch(n){e.BrainfishAnalytics&&(e.BrainfishAnalytics=Y(e.BrainfishAnalytics))}}();let go=null;const mo="undefined"!=typeof window&&window.Brainfish?window.Brainfish:(go||(go=function(){const e=[];let t=null;function n(n,o){if(t){const e=n.split(".");let i=t;for(let t=0;t<e.length-1;t++)i=i[e[t]];const r=i[e[e.length-1]];if("function"==typeof r)return r.apply(i,o)}else e.push([n,o])}return{Widgets:{init:(...e)=>n("Widgets.init",e),setTheme:(...e)=>n("Widgets.setTheme",e),identify:(...e)=>n("Widgets.identify",e),setSecretAttributes:(...e)=>n("Widgets.setSecretAttributes",e),open:()=>n("Widgets.open",[]),close:()=>n("Widgets.close",[]),createNewThread:()=>n("Widgets.createNewThread",[]),openModalForm:({formUrl:e,width:t,height:o})=>n("Widgets.openModalForm",[{formUrl:e,width:t,height:o}]),registerClientActionHandler:(...e)=>n("Widgets.registerClientActionHandler",e),onContextHelp:(...e)=>n("Widgets.onContextHelp",e),restoreConversation:(...e)=>n("Widgets.restoreConversation",e),clearConversation:()=>n("Widgets.clearConversation",[]),isReady:!1},SearchWidget:{initStandard:(...e)=>n("SearchWidget.initStandard",e)},HelpWidget:{initPopup:(...e)=>n("HelpWidget.initPopup",e),close:(...e)=>n("HelpWidget.close",e),open:(...e)=>n("HelpWidget.open",e),toggle:(...e)=>n("HelpWidget.toggle",e)},_setRealBrainfish(o){for(t=o;e.length>0;){const[t,o]=e.shift();n(t,o)}}}}(),"undefined"!=typeof window&&(window.Brainfish=go)),go),bo=/* @__PURE__ */new Map,yo=/* @__PURE__ */new Map;let wo=!1;function vo(e,t,n,o,i){return d(this,null,function*(){var r,a,s,c,l,d,u;const f=(null==(r=e.overrides)?void 0:r.enableRecording)||(null==(a=null==t?void 0:t.settings)?void 0:a.enableRecording)||!1,p=(null==(s=e.overrides)?void 0:s.version)||(null==t?void 0:t.version);yo.set(e.widgetKey,{options:e,config:t,apiHost:n,analyticsApiHost:o,fingerprint:i});const h=[];(null==p?void 0:p.startsWith("2."))?(Mt(e,t,i),wo||(wo=!0,Vt(()=>{yo.forEach(({options:e,config:t,fingerprint:n})=>{var o;const i=(null==(o=e.overrides)?void 0:o.version)||(null==t?void 0:t.version);(null==i?void 0:i.startsWith("2."))&&Mt(e,t,n)})}))):h.push(E(e,t)),h.push(_(e.widgetKey,t.trackingToken||"",n,o,f,{blocklist:null==(c=null==t?void 0:t.settings)?void 0:c.recordingBlocklist,sampleRate:null==(d=null==(l=null==t?void 0:t.settings)?void 0:l.ambientSettings)?void 0:d.sampleRate,_allowLocalhostRecording:null==(u=null==t?void 0:t.settings)?void 0:u._allowLocalhostRecording})),h.push(Rt(n,e.widgetKey));const[g]=yield Promise.allSettled(h);g&&"fulfilled"===g.status&&g.value&&mo._setRealBrainfish(g.value)})}mo.Widgets.isReady=!1,mo.Widgets.identify=e=>{"undefined"!=typeof window&&window.BrainfishAnalytics?window.BrainfishAnalytics("identify",e):z(e)},mo.Widgets.setSecretAttributes=e=>{try{const{alg:t}=p(e);if("dir"!==t)throw new Error("Invalid algorithm")}catch(n){return void console.error("[Brainfish] Invalid JWE provided to setSecretAttributes:",n)}const t=document.querySelector("#bf-iframe-container .trigger-iframe");if(t){const n=()=>{t.contentWindow&&t.contentWindow.postMessage({type:"SET_SECRET_ATTRIBUTES",secretAttributes:e},"*")};t.contentWindow&&n(),t.addEventListener("load",n)}},mo.Widgets.init=e=>d(null,null,function*(){window&&(window.BrainfishAnalytics=window.BrainfishAnalytics||function(...e){(window.BrainfishAnalytics.q=window.BrainfishAnalytics.q||[]).push(e)});const t=S(e.overrides),n=(null==(o=e.overrides)?void 0:o.analyticsApiHost)||"";var o;let i,r;try{const e=yield ho.load();i=(yield e.get()).visitorId}catch(s){console.warn("[Brainfish] Error loading fingerprint:",s)}if(e.config)r=JSON.parse(A(e.config));else{const{config:n}=yield v({widgetKey:e.widgetKey,apiHost:t});r=n}let a=bo.get(e.widgetKey);if(a||(a=vo(e,r,t,n,i),bo.set(e.widgetKey,a)),yield a,!lt.isWidgetDOMExisting(e.widgetKey,r)){bo.delete(e.widgetKey);const o=vo(e,r,t,n,i);bo.set(e.widgetKey,o),yield o}yield Ot(r),mo.Widgets.isReady=!0,window.dispatchEvent(new Event("onBrainfishReady"))}),mo.Widgets.setTheme=e=>{var t;const n=document.querySelector("#bf-iframe-container .trigger-iframe");if(n){const o=new URL(n.src),i=new URLSearchParams(o.hash.substring(1)),r=i.get("theme");let a;r&&(a=JSON.parse(A(r)));const c=s(s({},a),e);null==(t=n.contentWindow)||t.postMessage({type:"SET_THEME",theme:c},"*");const l=M(JSON.stringify(c));i.set("theme",l),o.hash=`#${i.toString()}`,n.src=o.toString()}},mo.Widgets.registerClientActionHandler=(e,t)=>{((e,t)=>{wt.set(e,t)})(e,t)};const xo=(...e)=>{"undefined"!=typeof window&&window.BrainfishAnalytics&&window.BrainfishAnalytics(...e)};export{xo as BrainfishAnalytics,mo as default};
|
|
2
2
|
//# sourceMappingURL=web.js.map
|