@brainfish-ai/widgets-initiator 1.25.0 → 1.25.2
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.
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export declare function validateSecretAttributesJwe(jwe: string): boolean;
|
|
2
|
+
/** Re-deliver stored JWE to an iframe that requested auth context (e.g. identity pull). */
|
|
3
|
+
export declare function replySecretAttributesToSource(source: Window, targetOrigin: string): void;
|
|
2
4
|
export declare function pushSecretAttributesToIframe(iframe: HTMLIFrameElement, widgetHost: string): void;
|
|
3
5
|
export declare function pushSecretAttributesToIframes(): void;
|
|
4
6
|
export declare function setSecretAttributesJwe(jwe: string): boolean;
|
package/dist/web.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e,t,n,o,i=Object.defineProperty,r=Object.defineProperties,a=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,d=(e,t,n)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,u=(e,t)=>{for(var n in t||(t={}))c.call(t,n)&&d(e,n,t[n]);if(s)for(var n of s(t))l.call(t,n)&&d(e,n,t[n]);return e},f=(e,t)=>r(e,a(t)),p=(e,t,n)=>d(e,"symbol"!=typeof t?t+"":t,n),h=(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]="ba0b9cc7-2288-4291-8627-4fc45a7981b0",e._sentryDebugIdIdentifier="sentry-dbid-ba0b9cc7-2288-4291-8627-4fc45a7981b0")}catch(n){}}(),Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"web-widget@1.25.0"},(t=e||(e={})).Sidebar="sidebar",t.Searchbar="searchbar",t.Popup="popup",e.Sidebar,e.Searchbar,e.Popup;class g extends Error{constructor(e,t){super(e,t),p(this,"cause"),this.name="BrainfishWidgetError",this.cause=null==t?void 0:t.cause,Error.captureStackTrace&&Error.captureStackTrace(this,g),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}}}(o=n||(n={})).LINK="link",o.CALLBACK="callback",o.EMAIL="email",o.PHONE="phone";const m=(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.25.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 g(i,{cause:r}),o)};const b=e=>h(null,[e],function*({widgetKey:e,apiHost:t}){return function(e,t,n){return h(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 m(e,r,"Error fetching config",n),o;yield new Promise(e=>setTimeout(e,500))}})}(t,"/api/searchWidgets.getConfigByKey",e)}),y=({config:e,apiKey:t,apiHost:o})=>{const i=e.settings||{};return["bodyActionButtons","footerActionButtons","nextBestActions"].forEach(e=>{i[e]&&(i[e]=i[e].map(e=>e.type===n.CALLBACK&&e.value?f(u({},e),{value:new Function(`return ${e.value}`)()}):e))}),f(u({},e),{settings:i,apiHost:o,widgetMode:e.widgetType,apiKey:t})},w=e=>(null==e?void 0:e.apiHost)||"https://app.brainfi.sh",v=e=>h(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=>h(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&&m(e,o,o.message,t)}});const x=new Set,S=(t,n)=>h(null,null,function*(){const o=w(t.overrides);try{if(x.has(t.widgetKey))return;const i=yield v({apiHost:o,widgetKey:t.widgetKey,version:n.version||"latest"});if(i){const{widget:r}=i,a=y({config:n,apiKey:t.widgetKey,apiHost:o});return t.overrides&&n.settings&&Object.entries(t.overrides).forEach(([e,t])=>{n.settings&&e in n.settings&&(n.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())})(n.settings[e],t))}),function(t,n){n.widgetType===e.Searchbar||"Search"===n.widgetType?t.SearchWidget.initStandard(n):t.HelpWidget.initPopup(n)}(r,a),x.add(t.widgetKey),r}}catch(i){m(o,i,i.message,t.widgetKey)}}),C=()=>{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}},k=e=>{try{if(C())return window.localStorage.getItem(e)}catch(t){}return null},E=e=>{try{C()&&window.localStorage.removeItem(e)}catch(t){}};let I=!1;const L=(e,t,n,...o)=>h(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."),!I)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"===k("bf_tracking_disabled"),c=a||s;window.BrainfishAnalytics("init",{apiUrl:o,accessKey:t,trackScreenViews:!0,trackAttributes:!c,trackOutgoingLinks:!c,enableRecording:!c&&i,recordingOptions:r}),I=!0,yield((e,t)=>h(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&&m(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){m(n,a,"Failed to initialize BrainfishAnalytics",e)}});function T(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 W=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")},_=new Map;function A(e){try{return new URL(e).origin}catch(t){return e}}function M(e,t){try{return new URL(e.src).origin}catch(n){if(t)return A(t)}return"*"}function O(){return Array.from(_,([e,{widgetHost:t}])=>({iframe:e,widgetHost:t}))}new TextEncoder;const P=new TextDecoder;const R=e=>{let t=e;t instanceof Uint8Array&&(t=P.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 B(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(P.decode(R(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")}}let F=null;function j(e,t){F&&function(e,t,n){var o;const i=M(e,n);null==(o=e.contentWindow)||o.postMessage({type:"SET_SECRET_ATTRIBUTES",secretAttributes:t},i)}(e,F,t)}function N(e){return function(e){try{const{alg:t}=B(e);return"dir"===t}catch(t){return!1}}(e)?(F=e,function(){for(const{iframe:e,widgetHost:t}of O())j(e,t)}(),!0):(console.error("[Brainfish] Invalid JWE provided to setSecretAttributes."),!1)}const V="USER_IDENTIFY";let H=null;const Z=new Set;let D=!1;function G(e){Z.add(A(e))}function z(e){return Z.has(e)||function(e){for(const n of _.keys())try{if(new URL(n.src).origin===e)return!0}catch(t){}return!1}(e)}function $(e,t,n){var o;const i=M(e,n);null==(o=e.contentWindow)||o.postMessage({type:V,payload:t},i)}function Y(e,t,n){var o;G(t),function(e,t){_.set(e,{widgetHost:t})}(e,t);const i=()=>{H&&$(e,H,t),j(e,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",()=>{!function(e){_.delete(e)}(e)},{once:!0}),e.contentWindow&&i()}function X(e){var t;"REQUEST_USER_IDENTITY"===(null==(t=e.data)?void 0:t.type)&&H&&e.source&&z(e.origin)&&(!function(e){if(!e)return!1;for(const t of _.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:V,payload:H},e.origin))}function J(){D||"undefined"==typeof window||(D=!0,window.addEventListener("message",X))}const K=new Set(["userId","firstName","lastName","email","phone","avatar","properties"]);function U(e){J();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))K.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=u(u({},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)."),H=t,function(e){for(const{iframe:t,widgetHost:n}of O())$(t,e,n)}(t),t):null}function q(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=U(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 Q=!1;function ee(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var te,ne={exports:{}},oe={exports:{}},ie={exports:{}};function re(){return te||(te=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}(ie,ie.exports)),ie.exports}var ae,se={exports:{}};function ce(){return ae||(ae=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}(se,se.exports)),se.exports}var le,de,ue,fe={exports:{}};function pe(){return le||(le=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}(fe,fe.exports)),fe.exports}function he(){return de||(de=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)+")",T=d.exec(L);if(!T)throw new i.default(4,t,L);return{red:parseInt(""+T[1],10),green:parseInt(""+T[2],10),blue:parseInt(""+T[3],10),alpha:parseFloat(""+C[4])>1?parseFloat(""+C[4])/100:parseFloat(""+C[4])}}throw new i.default(5)};var n=r(re()),o=r(ce()),i=r(pe());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}(oe,oe.exports)),oe.exports}function ge(){return ue||(ue=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=he())&&n.__esModule?n:{default:n};e.exports=t.default}(ne,ne.exports)),ne.exports}const me=ee(ge());var be,ye={exports:{}},we={exports:{}};function ve(){return be||(be=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}(we,we.exports)),we.exports}var xe,Se={exports:{}};function Ce(){return xe||(xe=1,e=Se,(t=Se.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),Se.exports;var e,t}var ke,Ee,Ie={exports:{}},Le={exports:{}};function Te(){return ke||(ke=1,e=Le,(t=Le.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),Le.exports;var e,t}function We(){return Ee||(Ee=1,function(e,t){t.__esModule=!0,t.default=function(e){return(0,o.default)((0,n.default)(e))};var n=i(he()),o=i(Te());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ie,Ie.exports)),Ie.exports}var _e,Ae={exports:{}},Me={exports:{}},Oe={exports:{}},Pe={exports:{}};function Re(){return _e||(_e=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 Be,Fe,je,Ne={exports:{}};function Ve(){return Be||(Be=1,e=Ne,(t=Ne.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),Ne.exports;var e,t}function He(){return Fe||(Fe=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=r(re()),o=r(Re()),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}(Oe,Oe.exports)),Oe.exports}function Ze(){return je||(je=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(He()),o=i(pe());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Me,Me.exports)),Me.exports}var De,Ge={exports:{}};function ze(){return De||(De=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(He()),o=r(re()),i=r(pe());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ge,Ge.exports)),Ge.exports}var $e,Ye={exports:{}};function Xe(){return $e||($e=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(Re()),o=r(Ve()),i=r(pe());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ye,Ye.exports)),Ye.exports}var Je,Ke,Ue,qe={exports:{}};function Qe(){return Je||(Je=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(he()),o=r(Xe()),i=r(pe());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(qe,qe.exports)),qe.exports}function et(){return Ke||(Ke=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(Ze()),o=s(ze()),i=s(Xe()),r=s(Qe()),a=s(pe());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}(Ae,Ae.exports)),Ae.exports}function tt(){return Ue||(Ue=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(ve()),o=a(Ce()),i=a(We()),r=a(et());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}(ye,ye.exports)),ye.exports}const nt=ee(tt());var ot,it={exports:{}};function rt(){return ot||(ot=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(ve()),o=a(Ce()),i=a(We()),r=a(et());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}(it,it.exports)),it.exports}const at=ee(rt()),st="bf-iframe-container",ct="bf-trigger-button",lt="bf-search-bar-iframe-container",dt="bf-search-bar-iframe-backdrop";function ut(e){var t,n;if(!document.querySelector("style[data-widget-styles]")){!function(e="#000",t="FFF"){const n=document.createElement("style");n.setAttribute("data-widget-styles","");const o=me(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 .${ct} { background: ${e}; }\n .${ct}:hover {\n background: ${o?nt(.05,e):at(.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 ft{constructor(e,t){p(this,"widgetKey"),p(this,"widgetType"),p(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 pt(e,t,n={}){const o=document.createElement(e);return o.className=t,Object.entries(n).forEach(([e,t])=>{o.setAttribute(e,t)}),o}const ht="brainfish-search-widget";function gt(e){const t=document.querySelector(e);return t instanceof HTMLElement?t:null}function mt(e){const t=null==e?void 0:e.trim();if(!t)return null;const n=gt(t);return n||console.warn(`[Brainfish] mountTarget "${t}" not found or is not a valid element. Falling back to document.body.`),n}function bt(e,t){const n=function(e){const t=document.getElementById(`trigger-button-${e}`);return t||document.querySelector(`.${st}`)}(e);if(!n)return!1;const o=null==t?void 0:t.trim();if(!o)return!0;const i=gt(o);if(!i)return!1;if(!i.contains(n))return!1;if(document.getElementById(`trigger-button-${e}`)){const e=document.querySelector(`.${st}`);if(e&&!i.contains(e))return!1}return!0}function yt(e,t){const n=()=>{(function(e){var t;return null!=(t=mt(e))?t:document.body})(t).appendChild(e)};if(!document.body)return console.warn("[Brainfish] document.body not ready. Widget initialization deferred."),void document.addEventListener("DOMContentLoaded",n,{once:!0});n()}const wt=["bottom-left","bottom-right","top-left","top-right"];let vt;function xt(e){return wt.includes(e)}class St{constructor(e){p(this,"widgetType"),p(this,"button",null),p(this,"icon",null),p(this,"closeCallback",null),this.widgetType=e}setCloseCallback(e){this.closeCallback=e}get containerClass(){return this.widgetType===e.Searchbar?lt:st}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(`.${dt}`)}setElements(e,t){this.button=e||null,this.icon=t||null}openWidget(t={}){var n,o,i;const r=document.querySelector(`.${this.containerClass}`),a=null==r?void 0:r.querySelector("iframe");if(t.newConversation&&t.contextualQuestion?null==(n=null==a?void 0:a.contentWindow)||n.postMessage({type:"CONTEXTUAL_QUESTION",question:t.contextualQuestion},"*"):t.newConversation&&(null==(o=null==a?void 0:a.contentWindow)||o.postMessage({type:"NEW_CONVERSATION"},"*")),null==(i=null==a?void 0:a.contentWindow)||i.postMessage({type:"FOCUS_SEARCH_FIELD"},"*"),this.widgetType!==e.Searchbar){null==r||r.classList.add("open");const e=xt(s=t.position)?s:vt;e&&(null==r||r.classList.add(`position-${e}`),null==r||r.setAttribute("data-current-position",e))}var s;if(null==r||r.setAttribute("aria-hidden","false"),this.widgetType!==e.Searchbar&&document.body.clientWidth>=962&&null===this.backdrop){const e=pt("div",dt);this.closeCallback&&e.addEventListener("click",this.closeCallback),document.body.appendChild(e)}this.updateButtonForOpen()}focusNextElement(){const e=document.querySelector(ht);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(t){if(this.widgetType!==e.Searchbar)return;if(!this.container||!this.iframe)return;const n=Math.max(t,200);this.container.style.height=`${n}px`,this.iframe.style.height=`${n}px`}isMobile(){return document.body.clientWidth<=576}setupButtonClickListener(e){this.button&&this.button.addEventListener("click",e)}static isWidgetDOMExisting(e,t){var n;const o=document.querySelector(`.${lt}[data-widget-key="${e}"]`);if(o){const e=document.querySelector("brainfish-search-widget");return!e||e.contains(o)}return"Search"!==t.widgetType&&bt(e,null==(n=t.settings)?void 0:n.mountTarget)}}class Ct{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(t=>!t.isWidgetOpen&&t.widgetType===e.Popup)}static clear(){this.instances.clear()}}p(Ct,"instances",new Map);const kt=({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()}},Et=e=>`brainfish_conversation_${e}`,It={save(e,t){if(t){const o=k(Et(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{C()&&window.localStorage.setItem(e,t)}catch(n){}})(Et(e),JSON.stringify(r))}else E(Et(e))},load(e){const t=k(Et(e));if(!t)return null;try{const n=JSON.parse(t);return Date.now()-n.persistedAt>72e5?(E(Et(e)),null):n.conversationId}catch(n){return E(Et(e)),null}},clear(e){E(Et(e))}};class Lt{static getIframeForInstance(t){var n,o;const i=t.widgetType===e.Searchbar?lt:st,r=t.widgetType===e.Searchbar?`.${i}[data-widget-key="${t.widgetKey}"]`:`.${i}`;return null!=(o=null==(n=document.querySelector(r))?void 0:n.querySelector("iframe"))?o: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=kt,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=Ct.getOpenInstance();e&&e.closeWidget()}static openCurrentlyClosedPopupWidget(e){const t=Ct.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=Ct.getOpenInstance();if(e)return void this.postMessageToInstance(e,{type:"NEW_CONVERSATION"});const t=Ct.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=Ct.getOpenInstance();if(n||(n=Ct.getClosedPopupInstance()),!n)return void console.warn("Brainfish.Widgets.onContextHelp: No popup widget available");const o=f(u({},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=Ct.getOpenInstance();const n=!!t;t||(t=Ct.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=Ct.getOpenInstance())?e:Ct.getClosedPopupInstance();t?(It.clear(t.widgetKey),this.postMessageToInstance(t,{type:"NEW_CONVERSATION"})):console.warn("Brainfish.Widgets.clearConversation: No popup widget available")}}p(Lt,"isInitialized",!1);class Tt{constructor(e,t){p(this,"widgetType"),p(this,"widgetKey"),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(t,n={}){if(window.BrainfishAnalytics){let o;switch(this.widgetType){case e.Searchbar:o="searchbar_widget";break;case e.Sidebar:default:o="search_widget"}window.BrainfishAnalytics("track",t,f(u({},n),{widgetKey:this.widgetKey}),{source:o,widgetKey:this.widgetKey})}}}class Wt{constructor(e,t){p(this,"state"),p(this,"domController"),p(this,"analyticsTracker"),this.state=new ft(e,t),this.domController=new St(t),this.domController.setCloseCallback(()=>this.closeWidget()),this.analyticsTracker=new Tt(t,e)}static getInstance(e){return Ct.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()),Ct.register(this.widgetKey,this),Lt.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=It.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(){Ct.unregister(this.widgetKey)}static initialize(e){const t=new Wt(e.widgetKey,e.widgetType);return t.initialize(e),t}}function _t({widgetUrl:t,widgetType:n,props:o}){const i=n===e.Searchbar?lt:st,r=pt("div",i,u({id:i,"aria-live":"polite","aria-hidden":n===e.Searchbar?"false":"true"},o||{})),a=pt("div","iframe-loading-indicator"),s=pt("div","spinner");a.setAttribute("aria-label","Loading content"),a.setAttribute("role","status"),a.appendChild(s),r.appendChild(a);const c=pt("iframe","trigger-iframe",{src:t,sandbox:"allow-scripts allow-same-origin allow-popups allow-forms",allow:"clipboard-write",role:"dialog"});return c.style.opacity="0",c.addEventListener("load",()=>{a.style.display="none",c.style.opacity="1"}),c.addEventListener("error",e=>{console.error("Error loading iframe:",e),a.innerHTML="";const t=pt("div","loading-error");a.appendChild(t),a.setAttribute("aria-label","Failed to load content")}),r.appendChild(c),{iframeContainer:r,iframe:c}}function At(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 Mt=new Map,Ot=(e,t)=>`Error executing Client Action with key ${e}. Details: ${t instanceof Error?t.message:String(t)}`,Pt=(e,t)=>h(null,null,function*(){if(Mt.has(e)){const i=Mt.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:Ot(e,o)}}}var n;return{success:!1,reason:`No Client Action registered with key ${e}`}}),Rt=new Map,Bt=new Set;function Ft(t,{widgetHost:n,apiHost:o,widgetKey:i,widgetType:r,signal:a,stateManager:s}){window.addEventListener("message",a=>h(null,null,function*(){var c,l;if(a.origin!==n)return;const{type:d,widgetKey:u}=a.data;if(!u||u===i){if("TOGGLE_WIDGET_SIZE"===d&&function(){const e=document.querySelector(`.${st}`);e.classList.contains("expanded")?e.classList.remove("expanded"):e.classList.add("expanded")}(),"RESIZE_IFRAME"===d){const{height:e}=a.data;s.resizeContainer(e)}if("TRACK_EVENT"===d){const{messageId:e,eventName:t,data:n}=a.data;if(e){if(Bt.has(e))return void console.warn(`[Brainfish] Duplicate TRACK_EVENT suppressed for "${t}" (messageId: ${e})`);Bt.add(e),setTimeout(()=>Bt.delete(e),5e3)}s.trackCustomEvent(t,n)}if("CLOSE_WIDGET"===d&&s.closeWidget(),"NEXT_BEST_ACTION_CLICKED"===d){const{action:e,searchQueryId:t,query:n,answer:r,conversation:s}=a.data;if(!["function","callback"].includes(e.type))return void console.error("[Brainfish] Invalid action type:",e);const c=Rt.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)`);Rt.set(e.id,Date.now()),setTimeout(()=>Rt.delete(e.id),1e3),It.clear(i);const l={query:n,answer:r,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](n,r,l);const t=new URL(`${o}/api/searchWidgets.callback.codeblocks`);t.searchParams.set("apiKey",i),t.searchParams.set("codeblockId",e.id),l.searchIntentId&&t.searchParams.set("searchIntentId",l.searchIntentId);const a=document.createElement("script");a.src=t.toString(),document.head.appendChild(a),a.onload=()=>{window.__bfCallbacks[e.id](n,r,l),setTimeout(()=>{document.head.removeChild(a)},300)},a.onerror=()=>{console.error("[Brainfish] Failed to load callback script from server")}}catch(f){console.error("[Brainfish] Error executing callback:",f)}}if("CLIENT_EXECUTION"===d){const{actionKey:e,inputs:n,messageId:o}=a.data,i=yield Pt(e,n);null==(c=t.contentWindow)||c.postMessage({type:"CLIENT_EXECUTION_RESULT",messageId:o,result:i},"*")}if("CONVERSATION_CHANGED"===d){const{conversationId:t}=a.data;r!==e.Searchbar&&It.save(i,t)}if("REQUEST_USER_IDENTITY"===d&&a.source===t.contentWindow&&r===e.Popup){const e=It.load(i);e&&(null==(l=t.contentWindow)||l.postMessage({type:"RESTORE_CONVERSATION",conversationId:e},"*"))}}}),{signal:a})}function jt(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 Nt=new Set;function Vt(t,n,{isButtonHidden:o,triggerButtonIcon:i}){const r=document.createDocumentFragment();let a;if(o)a=Wt.initialize({isButtonHidden:o,widgetType:e.Popup,widgetKey:t});else{const{button:n,icon:o}=function(e,t){const n=pt("button",ct,{id:`trigger-button-${e}`,"aria-controls":st,"aria-expanded":"false","data-name":ct}),o=pt("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}}(t,i);r.appendChild(n),a=Wt.initialize({button:n,icon:o,widgetType:e.Popup,widgetKey:t})}const{iframeContainer:s,iframe:c}=_t({widgetUrl:n,widgetType:e.Popup});return r.appendChild(s),{fragment:r,iframe:c,stateManager:a}}const Ht=({config:t,widgetUrl:n,apiHost:o,widgetHost:i,widgetKey:r,hideTriggerButton:a})=>{const{settings:s}=t,c=null!=a?a:null==s?void 0:s.hideTriggerButton,l=null==s?void 0:s.triggerButtonIcon,d=null==s?void 0:s.mountTarget;try{if(u=null==s?void 0:s.popupPosition,vt=xt(u)?u:void 0,function(e,t){const n=mt(t);if(!n)return!1;const o=document.getElementById(`trigger-button-${e}`),i=document.querySelector(`.${st}`);if(!o&&!i)return!1;let r=!1;o&&!n.contains(o)&&(n.appendChild(o),r=!0),i&&!n.contains(i)&&(n.appendChild(i),r=!0)}(r,d),bt(r,d))return void Nt.add(r);if(function(e){return Nt.has(e)}(r))return;ut(t);const{fragment:a,iframe:f,stateManager:p}=Vt(r,n,{isButtonHidden:c||!1,triggerButtonIcon:l||""}),h=new AbortController,{signal:g}=h;Y(f,i,{signal:g}),f.onload=()=>{setTimeout(()=>{var t;At(f,g),Ft(f,{widgetHost:i,apiHost:o,widgetKey:r,widgetType:e.Popup,signal:g,stateManager:p}),jt(f,g,p);const a=It.load(r),s=new URL(n).searchParams.has("conversation");a&&!s&&(null==(t=f.contentWindow)||t.postMessage({type:"RESTORE_CONVERSATION",conversationId:a},"*"))},0)},yt(a,d),Nt.add(r);const m=()=>{h.abort(),window.removeEventListener("beforeunload",m)};return void window.addEventListener("beforeunload",m)}catch(f){!function(e,t,n){m(e,t,t.message,n)}(o,f,r)}var u},Zt=new Map;const Dt=({config:t,widgetUrl:n,apiHost:o,widgetHost:i,widgetKey:r})=>{var a,s,c,l;let d=Wt.getInstance(r);null==(a=Zt.get(r))||a.abort();const u=new AbortController;Zt.set(r,u),ut(t);try{const t=document.querySelector(`.${lt}[data-widget-key="${r}"]`),a=document.querySelector(ht);t&&a&&!a.contains(t)&&(a.appendChild(t),0===a.getBoundingClientRect().width&&(null==(s=a.parentElement)||s.style.setProperty("width","100%"))),d||(d=Wt.initialize({isButtonHidden:!0,widgetType:e.Searchbar,widgetKey:r}));const{signal:f}=u,p=t=>{Y(t,i,{signal:f}),At(t,f),Ft(t,{widgetHost:i,apiHost:o,widgetKey:r,widgetType:e.Searchbar,signal:f,stateManager:d}),jt(t,f,d)};if(t){const e=t.querySelector("iframe");e&&("complete"===(null==(l=e.contentDocument)?void 0:l.readyState)?setTimeout(()=>{p(e)},0):e.onload=()=>{setTimeout(()=>{p(e)},0)})}else{const t=document.createDocumentFragment(),{iframeContainer:o,iframe:i}=_t({widgetUrl:n,widgetType:e.Searchbar,props:{"data-widget-type":"searchbar","data-widget-key":r}});i.onload=()=>{setTimeout(()=>{p(i)},0)},t.appendChild(o),a?(a.appendChild(t),0===a.getBoundingClientRect().width&&(null==(c=a.parentElement)||c.style.setProperty("width","100%"))):document.body.appendChild(t)}const h=()=>{u.abort(),Zt.delete(r),window.removeEventListener("beforeunload",h)};return void window.addEventListener("beforeunload",h)}catch(f){!function(e,t,n){m(e,t,t.message,n)}(o,f,r)}},Gt=(e,t,n)=>{var o;const i=w(e.overrides),r=(null==(a=e.overrides)?void 0:a.widgetHost)||"https://agent.brainfi.sh";var a;G(r);const d=null==(o=e.overrides)?void 0:o.hideTriggerButton,{theme:p,settings:h}=t,g=e.overrides||{},{theme:m,redirectRules:b,regions:y,customCss:v}=g,x=((e,t)=>{var n={};for(var o in e)c.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&s)for(var o of s(e))t.indexOf(o)<0&&l.call(e,o)&&(n[o]=e[o]);return n})(g,["theme","redirectRules","regions","customCss"]),S=u(u({},p),m),C=u(u({},h),x),k=T(JSON.stringify(b)),E={theme:T(JSON.stringify(S)),settings:T(JSON.stringify(C)),redirectRules:k};y&&(E.regions=T(JSON.stringify(y))),v&&(E.customCss=T(v)),n&&(E.fingerprint=T(n));const I=`${r}/?widgetKey=${e.widgetKey}#${new URLSearchParams(E).toString()}`,L=f(u({},t),{theme:S,settings:C});"Search"===t.widgetType?Dt({config:L,widgetUrl:I,apiHost:i,widgetHost:r,widgetKey:e.widgetKey}):Ht({config:L,widgetUrl:I,apiHost:i,widgetHost:r,widgetKey:e.widgetKey,hideTriggerButton:d})};var zt=(e=>(e.FRESHCHAT="freshchat",e.INTERCOM="intercom",e.ZENDESK="zendesk",e.HELPSCOUT="helpscout",e))(zt||{});const $t=t=>h(null,null,function*(){if(t.widgetType===e.Popup){const e=window.fcWidget?zt.FRESHCHAT:null;e&&e===zt.FRESHCHAT&&(yield h(null,null,function*(){window.fcWidget||(yield new Promise(e=>setTimeout(e,100))),window.fcWidget.hide(),window.fcWidget.on("widget:closed",()=>{window.fcWidget.hide()})}))}}),Yt="brainfish-nudges",Xt=(e,t)=>h(null,null,function*(){try{yield h(null,null,function*(){if(!document.getElementById(Yt))return new Promise(e=>{const t=document.createElement("script");t.id=Yt,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){m(e,n,"Failed to initialize Nudge widget",t)}});let Jt,Kt,Ut,qt=!1;const Qt=e=>{null==Jt||Jt.abort(),Jt=new AbortController;const{signal:t}=Jt;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}),qt||(Kt=history.pushState,Ut=history.replaceState,history.pushState=function(...e){Kt.apply(this,e),setTimeout(o,0)},history.replaceState=function(...e){Ut.apply(this,e),setTimeout(o,0)},qt=!0),t.addEventListener("abort",()=>{qt&&(history.pushState=Kt,history.replaceState=Ut,qt=!1)})};var en="5.2.0";function tn(e,t){return new Promise(n=>setTimeout(n,e,t))}function nn(){return new Promise(e=>{const t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(null)})}function on(e){return!!e&&"function"==typeof e.then}function rn(e,t){try{const n=e();on(n)?n.then(e=>t(!0,e),e=>t(!1,e)):t(!0,n)}catch(n){t(!1,n)}}function an(e,t,n=16){return h(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 nn())}return o})}function sn(e){return e.then(void 0,()=>{}),e}function cn(e){return parseInt(e)}function ln(e){return parseFloat(e)}function dn(e,t){return"number"==typeof e&&isNaN(e)?t:e}function un(e){return e.reduce((e,t)=>e+(t?1:0),0)}function fn(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 pn(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 hn(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 gn(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 mn(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 bn(e,t){e[0]^=t[0],e[1]^=t[1]}const yn=[4283543511,3981806797],wn=[3301882366,444984403];function vn(e){const t=[0,e[0]>>>1];bn(e,t),hn(e,yn),t[1]=e[0]>>>1,bn(e,t),hn(e,wn),t[1]=e[0]>>>1,bn(e,t)}const xn=[2277735313,289559509],Sn=[1291169091,658871167],Cn=[0,5],kn=[0,1390208809],En=[0,944331445];function In(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,hn(c,xn),gn(c,31),hn(c,Sn),bn(a,c),gn(a,27),pn(a,s),hn(a,Cn),pn(a,kn),hn(l,Sn),gn(l,33),hn(l,xn),bn(s,l),gn(s,31),pn(s,a),hn(s,Cn),pn(s,En);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],mn(u,48),bn(l,u);case 14:u[1]=n[d+13],mn(u,40),bn(l,u);case 13:u[1]=n[d+12],mn(u,32),bn(l,u);case 12:u[1]=n[d+11],mn(u,24),bn(l,u);case 11:u[1]=n[d+10],mn(u,16),bn(l,u);case 10:u[1]=n[d+9],mn(u,8),bn(l,u);case 9:u[1]=n[d+8],bn(l,u),hn(l,Sn),gn(l,33),hn(l,xn),bn(s,l);case 8:u[1]=n[d+7],mn(u,56),bn(c,u);case 7:u[1]=n[d+6],mn(u,48),bn(c,u);case 6:u[1]=n[d+5],mn(u,40),bn(c,u);case 5:u[1]=n[d+4],mn(u,32),bn(c,u);case 4:u[1]=n[d+3],mn(u,24),bn(c,u);case 3:u[1]=n[d+2],mn(u,16),bn(c,u);case 2:u[1]=n[d+1],mn(u,8),bn(c,u);case 1:u[1]=n[d],bn(c,u),hn(c,xn),gn(c,31),hn(c,Sn),bn(a,c)}return bn(a,o),bn(s,o),pn(a,s),pn(s,a),vn(a),vn(s),pn(a,s),pn(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 Ln(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=sn(an(i,n=>function(e,t){const n=sn(new Promise(n=>{const o=Date.now();rn(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();rn(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 h(this,null,function*(){const e=yield r,t=yield an(e,e=>sn(e()),o),n=yield Promise.all(t),a={};for(let o=0;o<i.length;++o)a[i[o]]=n[o];return a})}}function Tn(){const e=window,t=navigator;return un(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Wn(){const e=window,t=navigator;return un(["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 _n(){const e=window;return un(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===navigator.vendor.indexOf("Apple"),"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function An(){const e=window,{HTMLElement:t,Document:n}=e;return un(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function Mn(){const e=window;return t=e.print,/^function\s.*?\{\s*\[native code]\s*}$/.test(String(t))&&"[object WebPageNamespace]"===String(e.browser);var t}function On(){var e,t;const n=window;return un(["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 Pn(){const{CSS:e}=window;return un([e.supports("selector(::details-content)"),e.supports("selector(::before::marker)"),e.supports("selector(::after::marker)"),!("locale"in CompositionEvent.prototype)])>=3}function Rn(){const e=window,t=navigator,{CSS:n,HTMLButtonElement:o}=e;return un([!("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 Bn(){const e=Wn(),t=On(),n=window,o=navigator,i="connection";return e?un([!("SharedWorker"in n),o[i]&&"ontypechange"in o[i],!("sinkId"in new Audio)])>=2:!!t&&un(["onorientationchange"in n,"orientation"in n,/android/i.test(o.appVersion)])>=2}function Fn(e){const t=new Error(e);return t.name=e,t}function jn(e,t,n=50){return h(this,null,function*(){var o,i,r;const a=document;for(;!a.body;)yield tn(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 tn(n);return yield e(s,s.contentWindow)}finally{null===(r=s.parentNode)||void 0===r||r.removeChild(s)}})}function Nn(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?Vn(o.style,e):o.setAttribute(i,e)}return o}function Vn(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 Hn=["monospace","sans-serif","serif"],Zn=["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 Dn(e){return e.toDataURL()}let Gn,zn;function $n(){return function(){if(void 0!==zn)return;const e=()=>{const t=Yn();Xn(t)?zn=setTimeout(e,2500):(Gn=t,zn=void 0)};e()}(),()=>h(null,null,function*(){let e=Yn();if(Xn(e)){if(Gn)return[...Gn];(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=Yn())}return Xn(e)||(Gn=e),e})}function Yn(){const e=screen;return[dn(ln(e.availTop),null),dn(ln(e.width)-ln(e.availWidth)-dn(ln(e.availLeft),0),null),dn(ln(e.height)-ln(e.availHeight)-dn(ln(e.availTop),0),null),dn(ln(e.availLeft),null)]}function Xn(e){for(let t=0;t<4;++t)if(e[t])return!1;return!0}function Jn(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function Kn(e){return matchMedia(`(inverted-colors: ${e})`).matches}function Un(e){return matchMedia(`(forced-colors: ${e})`).matches}function qn(e){return matchMedia(`(prefers-contrast: ${e})`).matches}function Qn(e){return matchMedia(`(prefers-reduced-motion: ${e})`).matches}function eo(e){return matchMedia(`(prefers-reduced-transparency: ${e})`).matches}function to(e){return matchMedia(`(dynamic-range: ${e})`).matches}const no=Math,oo=()=>0;const io="mmMwWLliI0fiflO&1",ro={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function ao(e){const t=Bn()?0:3,n=Math.pow(10,t);return Math.floor(e*n)/n}const so=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 co=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]),lo=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),uo=["FRAGMENT_SHADER","VERTEX_SHADER"],fo=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],po="WEBGL_debug_renderer_info";function ho(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 go(e,t,n){const o=e.getShaderPrecisionFormat(e[t],e[n]);return o?[o.rangeMin,o.rangeMax,o.precision]:[]}function mo(e){return Object.keys(e.__proto__).filter(bo)}function bo(e){return"string"==typeof e&&!e.match(/[^A-Z0-9_x]/)}function yo(){return On()}function wo(){return Wn()||_n()}function vo(e){return"function"==typeof e.getParameter}const xo={userAgentData:function(){return h(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 jn((e,t)=>h(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=Hn.map(a),l=(()=>{const e={};for(const t of Zn)e[t]=Hn.map(e=>s(t,e));return e})();n.appendChild(o);for(let d=0;d<Hn.length;d++)i[Hn[d]]=c[d].offsetWidth,r[Hn[d]]=c[d].offsetHeight;return Zn.filter(e=>{return t=l[e],Hn.some((e,n)=>t[n].offsetWidth!==i[e]||t[n].offsetHeight!==r[e]);var t})}))},domBlockers:function(){return h(this,arguments,function*({debug:e}={}){if(!_n()&&!Bn())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 h(this,null,function*(){var t;const n=document,o=n.createElement("div"),i=new Array(e.length),r={};Jn(o);for(let a=0;a<e.length;++a){const t=Nn(e[a]);"DIALOG"===t.tagName&&t.show();const r=n.createElement("div");Jn(r),r.appendChild(t),o.appendChild(r),i[a]=t}for(;!n.body;)yield tn(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 un(n.map(e=>i[e]))>.6*n.length});return r.sort(),r})},fontPreferences:function(){return function(e,t=4e3){return jn((n,o)=>{const i=o.document,r=i.body,a=r.style;a.width=`${t}px`,a.webkitTextSizeAdjust=a.textSizeAdjust="none",Wn()?r.style.zoom=""+1/o.devicePixelRatio:_n()&&(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(ro)){const[n={},i=io]=ro[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=Wn()&&function(){const e=window,t=document,{CSS:n,Promise:o,AudioContext:i}=e;return un([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(ro)){const e=o[a].getBoundingClientRect().width;i[a]=r?ao(e*n.devicePixelRatio):e}return i})},audio:function(){return _n()&&Rn()&&Mn()||Wn()&&function(){const e=navigator,t=window,n=Audio.prototype,{visualViewport:o}=t;return un(["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 un(["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(_n()&&!An()&&!function(){const e=window;return un(["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(Fn("timeout")),Math.min(o,d+i-Date.now()))},f=()=>{try{const o=e.startRendering();switch(on(o)&&sn(o),e.state){case"running":d=Date.now(),c&&u();break;case"suspended":document.hidden||l++,c&&l>=t?s(Fn("suspended")):setTimeout(f,n)}}catch(o){s(o)}};f(),r=()=>{c||(c=!0,d>0&&u())}});return[a,r]}(o),c=sn(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=_n()&&Rn()&&Mn(),t=On()&&Pn();if(e||t)return()=>Promise.resolve(void 0);const n=$n();return()=>h(null,null,function*(){const e=yield n(),t=e=>null===e?null:fn(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=Dn(e),o=Dn(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=Dn(e);return[i,n]}(i,r));return{winding:o,geometry:t,text:n}}(function(){const e=_n()&&Rn()&&Mn(),t=On()&&function(){const e=window,t=navigator,{CSS:n}=e;return un(["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))Wn()&&function(){const e=window;return un([!("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 dn(ln(navigator.deviceMemory),void 0)},screenResolution:function(){if(!(_n()&&Rn()&&Mn()))return function(){const e=screen,t=e=>dn(cn(e),null),n=[t(e.width),t(e.height)];return n.sort().reverse(),n}()},hardwareConcurrency:function(){const e=dn(cn(navigator.hardwareConcurrency),void 0);return void 0!==e&&On()&&Pn()?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(ln(new Date(e,0,1).getTimezoneOffset()),ln(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(!Tn()&&!function(){const e=window,t=navigator;return un(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Tn()}())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&&_n()&&!An()?function(){if("iPad"===navigator.platform)return!0;const e=screen,t=e.width/e.height;return un(["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=cn(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!!Kn("inverted")||!Kn("none")&&void 0},forcedColors:function(){return!!Un("active")||!Un("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 qn("no-preference")?0:qn("high")||qn("more")?1:qn("low")||qn("less")?-1:qn("forced")?10:void 0},reducedMotion:function(){return!!Qn("reduce")||!Qn("no-preference")&&void 0},reducedTransparency:function(){return!!eo("reduce")||!eo("no-preference")&&void 0},hdr:function(){return!!to("high")||!to("standard")&&void 0},math:function(){const e=no.acos||oo,t=no.acosh||oo,n=no.asin||oo,o=no.asinh||oo,i=no.atanh||oo,r=no.atan||oo,a=no.sin||oo,s=no.sinh||oo,c=no.cos||oo,l=no.cosh||oo,d=no.tan||oo,u=no.tanh||oo,f=no.exp||oo,p=no.expm1||oo,h=no.log1p||oo;return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:(g=1e154,no.log(g+no.sqrt(g*g-1))),asin:n(.12312423423423424),asinh:o(1),asinhPf:(e=>no.log(e+no.sqrt(e*e+1)))(1),atanh:i(.5),atanhPf:(e=>no.log((1+e)/(1-e))/2)(.5),atan:r(.5),sin:a(-1e300),sinh:s(1),sinhPf:(e=>no.exp(e)-1/no.exp(e)/2)(1),cos:c(10.000000000123),cosh:l(1),coshPf:(e=>(no.exp(e)+1/no.exp(e))/2)(1),tan:d(-1e300),tanh:u(1),tanhPf:(e=>(no.exp(2*e)-1)/(no.exp(2*e)+1))(1),exp:f(1),expm1:p(1),expm1Pf:(e=>no.exp(e)-1)(1),log1p:h(10),log1pPf:(e=>no.log(1+e))(10),powPI:(e=>no.pow(no.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(so())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(!(Bn()||_n()))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=ho(e);if(!s)return-1;if(!vo(s))return-2;const c=yo()?null:s.getExtension(po);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=ho(e);if(!t)return-1;if(!vo(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=mo(t);for(const d of l){const e=t[d];a.push(`${d}=${e}${co.has(e)?`=${t.getParameter(e)}`:""}`)}if(n)for(const d of n){if(d===po&&yo()||"WEBGL_polygon_mode"===d&&wo())continue;const e=t.getExtension(d);if(e)for(const n of mo(e)){const o=e[n];s.push(`${n}=${o}${lo.has(o)?`=${t.getParameter(o)}`:""}`)}else i.push(d)}for(const d of uo)for(const e of fo){const n=go(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 So(e){const t=function(e){if(Bn())return.4;if(_n())return!An()||Rn()&&Mn()?.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 fn(.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 Co(e){return JSON.stringify(e,(e,t)=>{return t instanceof Error?u({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 ko(e){return In(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 Eo(e=50){return function(e,t=1/0){const{requestIdleCallback:n}=window;return n?new Promise(e=>n.call(window,()=>e(),{timeout:t})):tn(Math.min(e,t))}(e,2*e)}function Io(e,t){const n=Date.now();return{get(o){return h(this,null,function*(){const i=Date.now(),r=yield e(),a=function(e){let t;const n=So(e);return{get visitorId(){return void 0===t&&(t=ko(this.components)),t},set visitorId(e){t=e},confidence:n,components:e,version:en}}(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: ${Co(r)}\n\`\`\``),a})}}}var Lo={load:function(){return h(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${en}/npm-monitoring`,!0),e.send()}catch(e){console.error(e)}}(),yield Eo(t);const i=function(e){return Ln(xo,e,[])}({cache:{},debug:n});return Io(i,n)})},hashComponents:ko,componentsToDebugString:Co};J(),function(){if(Q||"undefined"==typeof window)return;Q=!0;const e=window;let t=e.BrainfishAnalytics?q(e.BrainfishAnalytics):void 0;try{Object.defineProperty(window,"BrainfishAnalytics",{configurable:!0,get:()=>t,set(e){t=e?q(e):e}})}catch(n){e.BrainfishAnalytics&&(e.BrainfishAnalytics=q(e.BrainfishAnalytics))}}();let To=null;const Wo="undefined"!=typeof window&&window.Brainfish?window.Brainfish:(To||(To=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),clearSecretAttributes:()=>n("Widgets.clearSecretAttributes",[]),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=To)),To),_o=new Map,Ao=new Map;let Mo=!1;function Oo(e,t,n,o,i){return h(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);Ao.set(e.widgetKey,{options:e,config:t,apiHost:n,analyticsApiHost:o,fingerprint:i});const h=[];(null==p?void 0:p.startsWith("2."))?(Gt(e,t,i),Mo||(Mo=!0,Qt(()=>{Ao.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."))&&Gt(e,t,n)})}))):h.push(S(e,t)),h.push(L(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(Xt(n,e.widgetKey));const[g]=yield Promise.allSettled(h);g&&"fulfilled"===g.status&&g.value&&Wo._setRealBrainfish(g.value)})}Wo.Widgets.isReady=!1,Wo.Widgets.identify=e=>{"undefined"!=typeof window&&window.BrainfishAnalytics?window.BrainfishAnalytics("identify",e):U(e)},Wo.Widgets.setSecretAttributes=e=>{N(e)},Wo.Widgets.clearSecretAttributes=()=>{!function(){var e;F=null;for(const{iframe:t,widgetHost:n}of O()){const o=M(t,n);null==(e=t.contentWindow)||e.postMessage({type:"CLEAR_SECRET_ATTRIBUTES"},o)}}()},Wo.Widgets.init=e=>h(null,null,function*(){window&&(window.BrainfishAnalytics=window.BrainfishAnalytics||function(...e){(window.BrainfishAnalytics.q=window.BrainfishAnalytics.q||[]).push(e)});const t=w(e.overrides),n=(null==(o=e.overrides)?void 0:o.analyticsApiHost)||"";var o;let i,r;try{const e=yield Lo.load();i=(yield e.get()).visitorId}catch(s){console.warn("[Brainfish] Error loading fingerprint:",s)}if(e.config)r=JSON.parse(W(e.config));else{const{config:n}=yield b({widgetKey:e.widgetKey,apiHost:t});r=n}let a=_o.get(e.widgetKey);if(a||(a=Oo(e,r,t,n,i),_o.set(e.widgetKey,a)),yield a,!St.isWidgetDOMExisting(e.widgetKey,r)){_o.delete(e.widgetKey);const o=Oo(e,r,t,n,i);_o.set(e.widgetKey,o),yield o}yield $t(r),Wo.Widgets.isReady=!0,window.dispatchEvent(new Event("onBrainfishReady"))}),Wo.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(W(r)));const s=u(u({},a),e);null==(t=n.contentWindow)||t.postMessage({type:"SET_THEME",theme:s},"*");const c=T(JSON.stringify(s));i.set("theme",c),o.hash=`#${i.toString()}`,n.src=o.toString()}},Wo.Widgets.registerClientActionHandler=(e,t)=>{((e,t)=>{Mt.set(e,t)})(e,t)};exports.BrainfishAnalytics=(...e)=>{"undefined"!=typeof window&&window.BrainfishAnalytics&&window.BrainfishAnalytics(...e)},exports.default=Wo;
|
|
1
|
+
"use strict";var e,t,n,o,i=Object.defineProperty,r=Object.defineProperties,a=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,d=(e,t,n)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,u=(e,t)=>{for(var n in t||(t={}))c.call(t,n)&&d(e,n,t[n]);if(s)for(var n of s(t))l.call(t,n)&&d(e,n,t[n]);return e},f=(e,t)=>r(e,a(t)),p=(e,t,n)=>d(e,"symbol"!=typeof t?t+"":t,n),h=(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]="cfc2a25e-6b36-4f81-b722-748b98c13168",e._sentryDebugIdIdentifier="sentry-dbid-cfc2a25e-6b36-4f81-b722-748b98c13168")}catch(n){}}(),Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"web-widget@1.25.2"},(t=e||(e={})).Sidebar="sidebar",t.Searchbar="searchbar",t.Popup="popup",e.Sidebar,e.Searchbar,e.Popup;class g extends Error{constructor(e,t){super(e,t),p(this,"cause"),this.name="BrainfishWidgetError",this.cause=null==t?void 0:t.cause,Error.captureStackTrace&&Error.captureStackTrace(this,g),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}}}(o=n||(n={})).LINK="link",o.CALLBACK="callback",o.EMAIL="email",o.PHONE="phone";const m=(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.25.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 g(i,{cause:r}),o)};const b=e=>h(null,[e],function*({widgetKey:e,apiHost:t}){return function(e,t,n){return h(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 m(e,r,"Error fetching config",n),o;yield new Promise(e=>setTimeout(e,500))}})}(t,"/api/searchWidgets.getConfigByKey",e)}),y=({config:e,apiKey:t,apiHost:o})=>{const i=e.settings||{};return["bodyActionButtons","footerActionButtons","nextBestActions"].forEach(e=>{i[e]&&(i[e]=i[e].map(e=>e.type===n.CALLBACK&&e.value?f(u({},e),{value:new Function(`return ${e.value}`)()}):e))}),f(u({},e),{settings:i,apiHost:o,widgetMode:e.widgetType,apiKey:t})},w=e=>(null==e?void 0:e.apiHost)||"https://app.brainfi.sh",v=e=>h(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=>h(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&&m(e,o,o.message,t)}});const x=new Set,S=(t,n)=>h(null,null,function*(){const o=w(t.overrides);try{if(x.has(t.widgetKey))return;const i=yield v({apiHost:o,widgetKey:t.widgetKey,version:n.version||"latest"});if(i){const{widget:r}=i,a=y({config:n,apiKey:t.widgetKey,apiHost:o});return t.overrides&&n.settings&&Object.entries(t.overrides).forEach(([e,t])=>{n.settings&&e in n.settings&&(n.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())})(n.settings[e],t))}),function(t,n){n.widgetType===e.Searchbar||"Search"===n.widgetType?t.SearchWidget.initStandard(n):t.HelpWidget.initPopup(n)}(r,a),x.add(t.widgetKey),r}}catch(i){m(o,i,i.message,t.widgetKey)}}),C=()=>{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}},k=e=>{try{if(C())return window.localStorage.getItem(e)}catch(t){}return null},E=e=>{try{C()&&window.localStorage.removeItem(e)}catch(t){}};let I=!1;const L=(e,t,n,...o)=>h(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."),!I)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"===k("bf_tracking_disabled"),c=a||s;window.BrainfishAnalytics("init",{apiUrl:o,accessKey:t,trackScreenViews:!0,trackAttributes:!c,trackOutgoingLinks:!c,enableRecording:!c&&i,recordingOptions:r}),I=!0,yield((e,t)=>h(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&&m(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){m(n,a,"Failed to initialize BrainfishAnalytics",e)}});function T(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 W=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")},_=new Map;function A(e){try{return new URL(e).origin}catch(t){return e}}function M(e,t){try{return new URL(e.src).origin}catch(n){if(t)return A(t)}return"*"}function O(){return Array.from(_,([e,{widgetHost:t}])=>({iframe:e,widgetHost:t}))}new TextEncoder;const P=new TextDecoder;const R=e=>{let t=e;t instanceof Uint8Array&&(t=P.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 B(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(P.decode(R(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")}}let F=null;function j(e,t,n){e.postMessage({type:"SET_SECRET_ATTRIBUTES",secretAttributes:n},t)}function N(e,t){F&&function(e,t,n){const o=M(e,n);e.contentWindow&&j(e.contentWindow,o,t)}(e,F,t)}function V(){for(const{iframe:e,widgetHost:t}of O())N(e,t)}function H(e){return function(e){try{const{alg:t}=B(e);return"dir"===t}catch(t){return!1}}(e)?(F=e,V(),function(){if(!F)return;let e=1;const t=()=>{e>=6||(e+=1,window.setTimeout(()=>{V(),t()},500))};t()}(),!0):(console.error("[Brainfish] Invalid JWE provided to setSecretAttributes."),!1)}const Z="USER_IDENTIFY";let D=null;const G=new Set;let z=!1;function $(e){G.add(A(e))}function Y(e){return G.has(e)||function(e){for(const n of _.keys())try{if(new URL(n.src).origin===e)return!0}catch(t){}return!1}(e)}function X(e,t,n){var o;const i=M(e,n);null==(o=e.contentWindow)||o.postMessage({type:Z,payload:t},i)}function J(e,t,n){var o;$(t),function(e,t){_.set(e,{widgetHost:t})}(e,t);const i=()=>{D&&X(e,D,t),N(e,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",()=>{!function(e){_.delete(e)}(e)},{once:!0}),e.contentWindow&&i()}function K(e){var t,n,o;"REQUEST_USER_IDENTITY"===(null==(t=e.data)?void 0:t.type)&&(D&&e.source&&Y(e.origin)&&(!function(e){if(!e)return!1;for(const t of _.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:Z,payload:D},e.origin),n=e.source,o=e.origin,F&&j(n,o,F))))}function U(){z||"undefined"==typeof window||(z=!0,window.addEventListener("message",K))}const q=new Set(["userId","firstName","lastName","email","phone","avatar","properties"]);function Q(e){U();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))q.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=u(u({},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)."),D=t,function(e){for(const{iframe:t,widgetHost:n}of O())X(t,e,n)}(t),t):null}function ee(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=Q(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 te=!1;function ne(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oe,ie={exports:{}},re={exports:{}},ae={exports:{}};function se(){return oe||(oe=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}(ae,ae.exports)),ae.exports}var ce,le={exports:{}};function de(){return ce||(ce=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}(le,le.exports)),le.exports}var ue,fe,pe,he={exports:{}};function ge(){return ue||(ue=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}(he,he.exports)),he.exports}function me(){return fe||(fe=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)+")",T=d.exec(L);if(!T)throw new i.default(4,t,L);return{red:parseInt(""+T[1],10),green:parseInt(""+T[2],10),blue:parseInt(""+T[3],10),alpha:parseFloat(""+C[4])>1?parseFloat(""+C[4])/100:parseFloat(""+C[4])}}throw new i.default(5)};var n=r(se()),o=r(de()),i=r(ge());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}(re,re.exports)),re.exports}function be(){return pe||(pe=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=me())&&n.__esModule?n:{default:n};e.exports=t.default}(ie,ie.exports)),ie.exports}const ye=ne(be());var we,ve={exports:{}},xe={exports:{}};function Se(){return we||(we=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}(xe,xe.exports)),xe.exports}var Ce,ke={exports:{}};function Ee(){return Ce||(Ce=1,e=ke,(t=ke.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),ke.exports;var e,t}var Ie,Le,Te={exports:{}},We={exports:{}};function _e(){return Ie||(Ie=1,e=We,(t=We.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),We.exports;var e,t}function Ae(){return Le||(Le=1,function(e,t){t.__esModule=!0,t.default=function(e){return(0,o.default)((0,n.default)(e))};var n=i(me()),o=i(_e());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Te,Te.exports)),Te.exports}var Me,Oe={exports:{}},Pe={exports:{}},Re={exports:{}},Be={exports:{}};function Fe(){return Me||(Me=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}(Be,Be.exports)),Be.exports}var je,Ne,Ve,He={exports:{}};function Ze(){return je||(je=1,e=He,(t=He.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),He.exports;var e,t}function De(){return Ne||(Ne=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=r(se()),o=r(Fe()),i=r(Ze());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}(Re,Re.exports)),Re.exports}function Ge(){return Ve||(Ve=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(De()),o=i(ge());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Pe,Pe.exports)),Pe.exports}var ze,$e={exports:{}};function Ye(){return ze||(ze=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(De()),o=r(se()),i=r(ge());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}($e,$e.exports)),$e.exports}var Xe,Je={exports:{}};function Ke(){return Xe||(Xe=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(Fe()),o=r(Ze()),i=r(ge());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Je,Je.exports)),Je.exports}var Ue,qe,Qe,et={exports:{}};function tt(){return Ue||(Ue=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(me()),o=r(Ke()),i=r(ge());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(et,et.exports)),et.exports}function nt(){return qe||(qe=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(Ge()),o=s(Ye()),i=s(Ke()),r=s(tt()),a=s(ge());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}(Oe,Oe.exports)),Oe.exports}function ot(){return Qe||(Qe=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(Se()),o=a(Ee()),i=a(Ae()),r=a(nt());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}(ve,ve.exports)),ve.exports}const it=ne(ot());var rt,at={exports:{}};function st(){return rt||(rt=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(Se()),o=a(Ee()),i=a(Ae()),r=a(nt());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}(at,at.exports)),at.exports}const ct=ne(st()),lt="bf-iframe-container",dt="bf-trigger-button",ut="bf-search-bar-iframe-container",ft="bf-search-bar-iframe-backdrop";function pt(e){var t,n;if(!document.querySelector("style[data-widget-styles]")){!function(e="#000",t="FFF"){const n=document.createElement("style");n.setAttribute("data-widget-styles","");const o=ye(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(100svh - 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 .${dt} { background: ${e}; }\n .${dt}:hover {\n background: ${o?it(.05,e):ct(.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 ht{constructor(e,t){p(this,"widgetKey"),p(this,"widgetType"),p(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 gt(e,t,n={}){const o=document.createElement(e);return o.className=t,Object.entries(n).forEach(([e,t])=>{o.setAttribute(e,t)}),o}const mt="brainfish-search-widget";function bt(e){const t=document.querySelector(e);return t instanceof HTMLElement?t:null}function yt(e){const t=null==e?void 0:e.trim();if(!t)return null;const n=bt(t);return n||console.warn(`[Brainfish] mountTarget "${t}" not found or is not a valid element. Falling back to document.body.`),n}function wt(e,t){const n=function(e){const t=document.getElementById(`trigger-button-${e}`);return t||document.querySelector(`.${lt}`)}(e);if(!n)return!1;const o=null==t?void 0:t.trim();if(!o)return!0;const i=bt(o);if(!i)return!1;if(!i.contains(n))return!1;if(document.getElementById(`trigger-button-${e}`)){const e=document.querySelector(`.${lt}`);if(e&&!i.contains(e))return!1}return!0}function vt(e,t){const n=()=>{(function(e){var t;return null!=(t=yt(e))?t:document.body})(t).appendChild(e)};if(!document.body)return console.warn("[Brainfish] document.body not ready. Widget initialization deferred."),void document.addEventListener("DOMContentLoaded",n,{once:!0});n()}const xt=["bottom-left","bottom-right","top-left","top-right"];let St;function Ct(e){return xt.includes(e)}class kt{constructor(e){p(this,"widgetType"),p(this,"button",null),p(this,"icon",null),p(this,"closeCallback",null),this.widgetType=e}setCloseCallback(e){this.closeCallback=e}get containerClass(){return this.widgetType===e.Searchbar?ut:lt}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(`.${ft}`)}setElements(e,t){this.button=e||null,this.icon=t||null}openWidget(t={}){var n,o,i;const r=document.querySelector(`.${this.containerClass}`),a=null==r?void 0:r.querySelector("iframe");if(t.newConversation&&t.contextualQuestion?null==(n=null==a?void 0:a.contentWindow)||n.postMessage({type:"CONTEXTUAL_QUESTION",question:t.contextualQuestion},"*"):t.newConversation&&(null==(o=null==a?void 0:a.contentWindow)||o.postMessage({type:"NEW_CONVERSATION"},"*")),null==(i=null==a?void 0:a.contentWindow)||i.postMessage({type:"FOCUS_SEARCH_FIELD"},"*"),this.widgetType!==e.Searchbar){null==r||r.classList.add("open");const e=Ct(s=t.position)?s:St;e&&(null==r||r.classList.add(`position-${e}`),null==r||r.setAttribute("data-current-position",e))}var s;if(null==r||r.setAttribute("aria-hidden","false"),this.widgetType!==e.Searchbar&&document.body.clientWidth>=962&&null===this.backdrop){const e=gt("div",ft);this.closeCallback&&e.addEventListener("click",this.closeCallback),document.body.appendChild(e)}this.updateButtonForOpen()}focusNextElement(){const e=document.querySelector(mt);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(t){if(this.widgetType!==e.Searchbar)return;if(!this.container||!this.iframe)return;const n=Math.max(t,200);this.container.style.height=`${n}px`,this.iframe.style.height=`${n}px`}isMobile(){return document.body.clientWidth<=576}setupButtonClickListener(e){this.button&&this.button.addEventListener("click",e)}static isWidgetDOMExisting(e,t){var n;const o=document.querySelector(`.${ut}[data-widget-key="${e}"]`);if(o){const e=document.querySelector("brainfish-search-widget");return!e||e.contains(o)}return"Search"!==t.widgetType&&wt(e,null==(n=t.settings)?void 0:n.mountTarget)}}class Et{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(t=>!t.isWidgetOpen&&t.widgetType===e.Popup)}static clear(){this.instances.clear()}}p(Et,"instances",new Map);const It=({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()}},Lt=e=>`brainfish_conversation_${e}`,Tt={save(e,t){if(t){const o=k(Lt(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{C()&&window.localStorage.setItem(e,t)}catch(n){}})(Lt(e),JSON.stringify(r))}else E(Lt(e))},load(e){const t=k(Lt(e));if(!t)return null;try{const n=JSON.parse(t);return Date.now()-n.persistedAt>72e5?(E(Lt(e)),null):n.conversationId}catch(n){return E(Lt(e)),null}},clear(e){E(Lt(e))}};class Wt{static getIframeForInstance(t){var n,o;const i=t.widgetType===e.Searchbar?ut:lt,r=t.widgetType===e.Searchbar?`.${i}[data-widget-key="${t.widgetKey}"]`:`.${i}`;return null!=(o=null==(n=document.querySelector(r))?void 0:n.querySelector("iframe"))?o: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=It,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=Et.getOpenInstance();e&&e.closeWidget()}static openCurrentlyClosedPopupWidget(e){const t=Et.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=Et.getOpenInstance();if(e)return void this.postMessageToInstance(e,{type:"NEW_CONVERSATION"});const t=Et.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=Et.getOpenInstance();if(n||(n=Et.getClosedPopupInstance()),!n)return void console.warn("Brainfish.Widgets.onContextHelp: No popup widget available");const o=f(u({},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=Et.getOpenInstance();const n=!!t;t||(t=Et.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=Et.getOpenInstance())?e:Et.getClosedPopupInstance();t?(Tt.clear(t.widgetKey),this.postMessageToInstance(t,{type:"NEW_CONVERSATION"})):console.warn("Brainfish.Widgets.clearConversation: No popup widget available")}}p(Wt,"isInitialized",!1);class _t{constructor(e,t){p(this,"widgetType"),p(this,"widgetKey"),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(t,n={}){if(window.BrainfishAnalytics){let o;switch(this.widgetType){case e.Searchbar:o="searchbar_widget";break;case e.Sidebar:default:o="search_widget"}window.BrainfishAnalytics("track",t,f(u({},n),{widgetKey:this.widgetKey}),{source:o,widgetKey:this.widgetKey})}}}class At{constructor(e,t){p(this,"state"),p(this,"domController"),p(this,"analyticsTracker"),this.state=new ht(e,t),this.domController=new kt(t),this.domController.setCloseCallback(()=>this.closeWidget()),this.analyticsTracker=new _t(t,e)}static getInstance(e){return Et.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()),Et.register(this.widgetKey,this),Wt.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=Tt.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(){Et.unregister(this.widgetKey)}static initialize(e){const t=new At(e.widgetKey,e.widgetType);return t.initialize(e),t}}function Mt({widgetUrl:t,widgetType:n,props:o}){const i=n===e.Searchbar?ut:lt,r=gt("div",i,u({id:i,"aria-live":"polite","aria-hidden":n===e.Searchbar?"false":"true"},o||{})),a=gt("div","iframe-loading-indicator"),s=gt("div","spinner");a.setAttribute("aria-label","Loading content"),a.setAttribute("role","status"),a.appendChild(s),r.appendChild(a);const c=gt("iframe","trigger-iframe",{src:t,sandbox:"allow-scripts allow-same-origin allow-popups allow-forms",allow:"clipboard-write",role:"dialog"});return c.style.opacity="0",c.addEventListener("load",()=>{a.style.display="none",c.style.opacity="1"}),c.addEventListener("error",e=>{console.error("Error loading iframe:",e),a.innerHTML="";const t=gt("div","loading-error");a.appendChild(t),a.setAttribute("aria-label","Failed to load content")}),r.appendChild(c),{iframeContainer:r,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 Pt=new Map,Rt=(e,t)=>`Error executing Client Action with key ${e}. Details: ${t instanceof Error?t.message:String(t)}`,Bt=(e,t)=>h(null,null,function*(){if(Pt.has(e)){const i=Pt.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}`}}),Ft=new Map,jt=new Set;function Nt(t,{widgetHost:n,apiHost:o,widgetKey:i,widgetType:r,signal:a,stateManager:s}){window.addEventListener("message",a=>h(null,null,function*(){var c,l;if(a.origin!==n)return;const{type:d,widgetKey:u}=a.data;if(!u||u===i){if("TOGGLE_WIDGET_SIZE"===d&&function(){const e=document.querySelector(`.${lt}`);e.classList.contains("expanded")?e.classList.remove("expanded"):e.classList.add("expanded")}(),"RESIZE_IFRAME"===d){const{height:e}=a.data;s.resizeContainer(e)}if("TRACK_EVENT"===d){const{messageId:e,eventName:t,data:n}=a.data;if(e){if(jt.has(e))return void console.warn(`[Brainfish] Duplicate TRACK_EVENT suppressed for "${t}" (messageId: ${e})`);jt.add(e),setTimeout(()=>jt.delete(e),5e3)}s.trackCustomEvent(t,n)}if("CLOSE_WIDGET"===d&&s.closeWidget(),"NEXT_BEST_ACTION_CLICKED"===d){const{action:e,searchQueryId:t,query:n,answer:r,conversation:s}=a.data;if(!["function","callback"].includes(e.type))return void console.error("[Brainfish] Invalid action type:",e);const c=Ft.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)`);Ft.set(e.id,Date.now()),setTimeout(()=>Ft.delete(e.id),1e3),Tt.clear(i);const l={query:n,answer:r,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](n,r,l);const t=new URL(`${o}/api/searchWidgets.callback.codeblocks`);t.searchParams.set("apiKey",i),t.searchParams.set("codeblockId",e.id),l.searchIntentId&&t.searchParams.set("searchIntentId",l.searchIntentId);const a=document.createElement("script");a.src=t.toString(),document.head.appendChild(a),a.onload=()=>{window.__bfCallbacks[e.id](n,r,l),setTimeout(()=>{document.head.removeChild(a)},300)},a.onerror=()=>{console.error("[Brainfish] Failed to load callback script from server")}}catch(f){console.error("[Brainfish] Error executing callback:",f)}}if("CLIENT_EXECUTION"===d){const{actionKey:e,inputs:n,messageId:o}=a.data,i=yield Bt(e,n);null==(c=t.contentWindow)||c.postMessage({type:"CLIENT_EXECUTION_RESULT",messageId:o,result:i},"*")}if("CONVERSATION_CHANGED"===d){const{conversationId:t}=a.data;r!==e.Searchbar&&Tt.save(i,t)}if("REQUEST_USER_IDENTITY"===d&&a.source===t.contentWindow&&r===e.Popup){const e=Tt.load(i);e&&(null==(l=t.contentWindow)||l.postMessage({type:"RESTORE_CONVERSATION",conversationId:e},"*"))}}}),{signal:a})}function Vt(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 Ht=new Set;function Zt(t,n,{isButtonHidden:o,triggerButtonIcon:i}){const r=document.createDocumentFragment();let a;if(o)a=At.initialize({isButtonHidden:o,widgetType:e.Popup,widgetKey:t});else{const{button:n,icon:o}=function(e,t){const n=gt("button",dt,{id:`trigger-button-${e}`,"aria-controls":lt,"aria-expanded":"false","data-name":dt}),o=gt("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}}(t,i);r.appendChild(n),a=At.initialize({button:n,icon:o,widgetType:e.Popup,widgetKey:t})}const{iframeContainer:s,iframe:c}=Mt({widgetUrl:n,widgetType:e.Popup});return r.appendChild(s),{fragment:r,iframe:c,stateManager:a}}const Dt=({config:t,widgetUrl:n,apiHost:o,widgetHost:i,widgetKey:r,hideTriggerButton:a})=>{const{settings:s}=t,c=null!=a?a:null==s?void 0:s.hideTriggerButton,l=null==s?void 0:s.triggerButtonIcon,d=null==s?void 0:s.mountTarget;try{if(u=null==s?void 0:s.popupPosition,St=Ct(u)?u:void 0,function(e,t){const n=yt(t);if(!n)return!1;const o=document.getElementById(`trigger-button-${e}`),i=document.querySelector(`.${lt}`);if(!o&&!i)return!1;let r=!1;o&&!n.contains(o)&&(n.appendChild(o),r=!0),i&&!n.contains(i)&&(n.appendChild(i),r=!0)}(r,d),wt(r,d))return void Ht.add(r);if(function(e){return Ht.has(e)}(r))return;pt(t);const{fragment:a,iframe:f,stateManager:p}=Zt(r,n,{isButtonHidden:c||!1,triggerButtonIcon:l||""}),h=new AbortController,{signal:g}=h;J(f,i,{signal:g}),f.onload=()=>{setTimeout(()=>{var t;Ot(f,g),Nt(f,{widgetHost:i,apiHost:o,widgetKey:r,widgetType:e.Popup,signal:g,stateManager:p}),Vt(f,g,p);const a=Tt.load(r),s=new URL(n).searchParams.has("conversation");a&&!s&&(null==(t=f.contentWindow)||t.postMessage({type:"RESTORE_CONVERSATION",conversationId:a},"*"))},0)},vt(a,d),Ht.add(r);const m=()=>{h.abort(),window.removeEventListener("beforeunload",m)};return void window.addEventListener("beforeunload",m)}catch(f){!function(e,t,n){m(e,t,t.message,n)}(o,f,r)}var u},Gt=new Map;const zt=({config:t,widgetUrl:n,apiHost:o,widgetHost:i,widgetKey:r})=>{var a,s,c,l;let d=At.getInstance(r);null==(a=Gt.get(r))||a.abort();const u=new AbortController;Gt.set(r,u),pt(t);try{const t=document.querySelector(`.${ut}[data-widget-key="${r}"]`),a=document.querySelector(mt);t&&a&&!a.contains(t)&&(a.appendChild(t),0===a.getBoundingClientRect().width&&(null==(s=a.parentElement)||s.style.setProperty("width","100%"))),d||(d=At.initialize({isButtonHidden:!0,widgetType:e.Searchbar,widgetKey:r}));const{signal:f}=u,p=t=>{J(t,i,{signal:f}),Ot(t,f),Nt(t,{widgetHost:i,apiHost:o,widgetKey:r,widgetType:e.Searchbar,signal:f,stateManager:d}),Vt(t,f,d)};if(t){const e=t.querySelector("iframe");e&&("complete"===(null==(l=e.contentDocument)?void 0:l.readyState)?setTimeout(()=>{p(e)},0):e.onload=()=>{setTimeout(()=>{p(e)},0)})}else{const t=document.createDocumentFragment(),{iframeContainer:o,iframe:i}=Mt({widgetUrl:n,widgetType:e.Searchbar,props:{"data-widget-type":"searchbar","data-widget-key":r}});i.onload=()=>{setTimeout(()=>{p(i)},0)},t.appendChild(o),a?(a.appendChild(t),0===a.getBoundingClientRect().width&&(null==(c=a.parentElement)||c.style.setProperty("width","100%"))):document.body.appendChild(t)}const h=()=>{u.abort(),Gt.delete(r),window.removeEventListener("beforeunload",h)};return void window.addEventListener("beforeunload",h)}catch(f){!function(e,t,n){m(e,t,t.message,n)}(o,f,r)}},$t=(e,t,n)=>{var o;const i=w(e.overrides),r=(null==(a=e.overrides)?void 0:a.widgetHost)||"https://agent.brainfi.sh";var a;$(r);const d=null==(o=e.overrides)?void 0:o.hideTriggerButton,{theme:p,settings:h}=t,g=e.overrides||{},{theme:m,redirectRules:b,regions:y,customCss:v}=g,x=((e,t)=>{var n={};for(var o in e)c.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&s)for(var o of s(e))t.indexOf(o)<0&&l.call(e,o)&&(n[o]=e[o]);return n})(g,["theme","redirectRules","regions","customCss"]),S=u(u({},p),m),C=u(u({},h),x),k=T(JSON.stringify(b)),E={theme:T(JSON.stringify(S)),settings:T(JSON.stringify(C)),redirectRules:k};y&&(E.regions=T(JSON.stringify(y))),v&&(E.customCss=T(v)),n&&(E.fingerprint=T(n));const I=`${r}/?widgetKey=${e.widgetKey}#${new URLSearchParams(E).toString()}`,L=f(u({},t),{theme:S,settings:C});"Search"===t.widgetType?zt({config:L,widgetUrl:I,apiHost:i,widgetHost:r,widgetKey:e.widgetKey}):Dt({config:L,widgetUrl:I,apiHost:i,widgetHost:r,widgetKey:e.widgetKey,hideTriggerButton:d})};var Yt=(e=>(e.FRESHCHAT="freshchat",e.INTERCOM="intercom",e.ZENDESK="zendesk",e.HELPSCOUT="helpscout",e))(Yt||{});const Xt=t=>h(null,null,function*(){if(t.widgetType===e.Popup){const e=window.fcWidget?Yt.FRESHCHAT:null;e&&e===Yt.FRESHCHAT&&(yield h(null,null,function*(){window.fcWidget||(yield new Promise(e=>setTimeout(e,100))),window.fcWidget.hide(),window.fcWidget.on("widget:closed",()=>{window.fcWidget.hide()})}))}}),Jt="brainfish-nudges",Kt=(e,t)=>h(null,null,function*(){try{yield h(null,null,function*(){if(!document.getElementById(Jt))return new Promise(e=>{const t=document.createElement("script");t.id=Jt,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){m(e,n,"Failed to initialize Nudge widget",t)}});let Ut,qt,Qt,en=!1;const tn=e=>{null==Ut||Ut.abort(),Ut=new AbortController;const{signal:t}=Ut;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}),en||(qt=history.pushState,Qt=history.replaceState,history.pushState=function(...e){qt.apply(this,e),setTimeout(o,0)},history.replaceState=function(...e){Qt.apply(this,e),setTimeout(o,0)},en=!0),t.addEventListener("abort",()=>{en&&(history.pushState=qt,history.replaceState=Qt,en=!1)})};var nn="5.2.0";function on(e,t){return new Promise(n=>setTimeout(n,e,t))}function rn(){return new Promise(e=>{const t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(null)})}function an(e){return!!e&&"function"==typeof e.then}function sn(e,t){try{const n=e();an(n)?n.then(e=>t(!0,e),e=>t(!1,e)):t(!0,n)}catch(n){t(!1,n)}}function cn(e,t,n=16){return h(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 rn())}return o})}function ln(e){return e.then(void 0,()=>{}),e}function dn(e){return parseInt(e)}function un(e){return parseFloat(e)}function fn(e,t){return"number"==typeof e&&isNaN(e)?t:e}function pn(e){return e.reduce((e,t)=>e+(t?1:0),0)}function hn(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 gn(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 mn(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 bn(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 yn(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 wn(e,t){e[0]^=t[0],e[1]^=t[1]}const vn=[4283543511,3981806797],xn=[3301882366,444984403];function Sn(e){const t=[0,e[0]>>>1];wn(e,t),mn(e,vn),t[1]=e[0]>>>1,wn(e,t),mn(e,xn),t[1]=e[0]>>>1,wn(e,t)}const Cn=[2277735313,289559509],kn=[1291169091,658871167],En=[0,5],In=[0,1390208809],Ln=[0,944331445];function Tn(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,mn(c,Cn),bn(c,31),mn(c,kn),wn(a,c),bn(a,27),gn(a,s),mn(a,En),gn(a,In),mn(l,kn),bn(l,33),mn(l,Cn),wn(s,l),bn(s,31),gn(s,a),mn(s,En),gn(s,Ln);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],yn(u,48),wn(l,u);case 14:u[1]=n[d+13],yn(u,40),wn(l,u);case 13:u[1]=n[d+12],yn(u,32),wn(l,u);case 12:u[1]=n[d+11],yn(u,24),wn(l,u);case 11:u[1]=n[d+10],yn(u,16),wn(l,u);case 10:u[1]=n[d+9],yn(u,8),wn(l,u);case 9:u[1]=n[d+8],wn(l,u),mn(l,kn),bn(l,33),mn(l,Cn),wn(s,l);case 8:u[1]=n[d+7],yn(u,56),wn(c,u);case 7:u[1]=n[d+6],yn(u,48),wn(c,u);case 6:u[1]=n[d+5],yn(u,40),wn(c,u);case 5:u[1]=n[d+4],yn(u,32),wn(c,u);case 4:u[1]=n[d+3],yn(u,24),wn(c,u);case 3:u[1]=n[d+2],yn(u,16),wn(c,u);case 2:u[1]=n[d+1],yn(u,8),wn(c,u);case 1:u[1]=n[d],wn(c,u),mn(c,Cn),bn(c,31),mn(c,kn),wn(a,c)}return wn(a,o),wn(s,o),gn(a,s),gn(s,a),Sn(a),Sn(s),gn(a,s),gn(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 Wn(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=ln(cn(i,n=>function(e,t){const n=ln(new Promise(n=>{const o=Date.now();sn(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();sn(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 h(this,null,function*(){const e=yield r,t=yield cn(e,e=>ln(e()),o),n=yield Promise.all(t),a={};for(let o=0;o<i.length;++o)a[i[o]]=n[o];return a})}}function _n(){const e=window,t=navigator;return pn(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function An(){const e=window,t=navigator;return pn(["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 Mn(){const e=window;return pn(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===navigator.vendor.indexOf("Apple"),"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function On(){const e=window,{HTMLElement:t,Document:n}=e;return pn(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function Pn(){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 pn(["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 Bn(){const{CSS:e}=window;return pn([e.supports("selector(::details-content)"),e.supports("selector(::before::marker)"),e.supports("selector(::after::marker)"),!("locale"in CompositionEvent.prototype)])>=3}function Fn(){const e=window,t=navigator,{CSS:n,HTMLButtonElement:o}=e;return pn([!("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 jn(){const e=An(),t=Rn(),n=window,o=navigator,i="connection";return e?pn([!("SharedWorker"in n),o[i]&&"ontypechange"in o[i],!("sinkId"in new Audio)])>=2:!!t&&pn(["onorientationchange"in n,"orientation"in n,/android/i.test(o.appVersion)])>=2}function Nn(e){const t=new Error(e);return t.name=e,t}function Vn(e,t,n=50){return h(this,null,function*(){var o,i,r;const a=document;for(;!a.body;)yield on(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 on(n);return yield e(s,s.contentWindow)}finally{null===(r=s.parentNode)||void 0===r||r.removeChild(s)}})}function Hn(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?Zn(o.style,e):o.setAttribute(i,e)}return o}function Zn(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 Dn=["monospace","sans-serif","serif"],Gn=["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 zn(e){return e.toDataURL()}let $n,Yn;function Xn(){return function(){if(void 0!==Yn)return;const e=()=>{const t=Jn();Kn(t)?Yn=setTimeout(e,2500):($n=t,Yn=void 0)};e()}(),()=>h(null,null,function*(){let e=Jn();if(Kn(e)){if($n)return[...$n];(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=Jn())}return Kn(e)||($n=e),e})}function Jn(){const e=screen;return[fn(un(e.availTop),null),fn(un(e.width)-un(e.availWidth)-fn(un(e.availLeft),0),null),fn(un(e.height)-un(e.availHeight)-fn(un(e.availTop),0),null),fn(un(e.availLeft),null)]}function Kn(e){for(let t=0;t<4;++t)if(e[t])return!1;return!0}function Un(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function qn(e){return matchMedia(`(inverted-colors: ${e})`).matches}function Qn(e){return matchMedia(`(forced-colors: ${e})`).matches}function eo(e){return matchMedia(`(prefers-contrast: ${e})`).matches}function to(e){return matchMedia(`(prefers-reduced-motion: ${e})`).matches}function no(e){return matchMedia(`(prefers-reduced-transparency: ${e})`).matches}function oo(e){return matchMedia(`(dynamic-range: ${e})`).matches}const io=Math,ro=()=>0;const ao="mmMwWLliI0fiflO&1",so={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function co(e){const t=jn()?0:3,n=Math.pow(10,t);return Math.floor(e*n)/n}const lo=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 uo=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]),fo=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),po=["FRAGMENT_SHADER","VERTEX_SHADER"],ho=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],go="WEBGL_debug_renderer_info";function mo(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 bo(e,t,n){const o=e.getShaderPrecisionFormat(e[t],e[n]);return o?[o.rangeMin,o.rangeMax,o.precision]:[]}function yo(e){return Object.keys(e.__proto__).filter(wo)}function wo(e){return"string"==typeof e&&!e.match(/[^A-Z0-9_x]/)}function vo(){return Rn()}function xo(){return An()||Mn()}function So(e){return"function"==typeof e.getParameter}const Co={userAgentData:function(){return h(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 Vn((e,t)=>h(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=Dn.map(a),l=(()=>{const e={};for(const t of Gn)e[t]=Dn.map(e=>s(t,e));return e})();n.appendChild(o);for(let d=0;d<Dn.length;d++)i[Dn[d]]=c[d].offsetWidth,r[Dn[d]]=c[d].offsetHeight;return Gn.filter(e=>{return t=l[e],Dn.some((e,n)=>t[n].offsetWidth!==i[e]||t[n].offsetHeight!==r[e]);var t})}))},domBlockers:function(){return h(this,arguments,function*({debug:e}={}){if(!Mn()&&!jn())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 h(this,null,function*(){var t;const n=document,o=n.createElement("div"),i=new Array(e.length),r={};Un(o);for(let a=0;a<e.length;++a){const t=Hn(e[a]);"DIALOG"===t.tagName&&t.show();const r=n.createElement("div");Un(r),r.appendChild(t),o.appendChild(r),i[a]=t}for(;!n.body;)yield on(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 pn(n.map(e=>i[e]))>.6*n.length});return r.sort(),r})},fontPreferences:function(){return function(e,t=4e3){return Vn((n,o)=>{const i=o.document,r=i.body,a=r.style;a.width=`${t}px`,a.webkitTextSizeAdjust=a.textSizeAdjust="none",An()?r.style.zoom=""+1/o.devicePixelRatio:Mn()&&(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(so)){const[n={},i=ao]=so[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=An()&&function(){const e=window,t=document,{CSS:n,Promise:o,AudioContext:i}=e;return pn([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(so)){const e=o[a].getBoundingClientRect().width;i[a]=r?co(e*n.devicePixelRatio):e}return i})},audio:function(){return Mn()&&Fn()&&Pn()||An()&&function(){const e=navigator,t=window,n=Audio.prototype,{visualViewport:o}=t;return pn(["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 pn(["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(Mn()&&!On()&&!function(){const e=window;return pn(["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(Nn("timeout")),Math.min(o,d+i-Date.now()))},f=()=>{try{const o=e.startRendering();switch(an(o)&&ln(o),e.state){case"running":d=Date.now(),c&&u();break;case"suspended":document.hidden||l++,c&&l>=t?s(Nn("suspended")):setTimeout(f,n)}}catch(o){s(o)}};f(),r=()=>{c||(c=!0,d>0&&u())}});return[a,r]}(o),c=ln(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=Mn()&&Fn()&&Pn(),t=Rn()&&Bn();if(e||t)return()=>Promise.resolve(void 0);const n=Xn();return()=>h(null,null,function*(){const e=yield n(),t=e=>null===e?null:hn(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=zn(e),o=zn(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=zn(e);return[i,n]}(i,r));return{winding:o,geometry:t,text:n}}(function(){const e=Mn()&&Fn()&&Pn(),t=Rn()&&function(){const e=window,t=navigator,{CSS:n}=e;return pn(["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))An()&&function(){const e=window;return pn([!("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 fn(un(navigator.deviceMemory),void 0)},screenResolution:function(){if(!(Mn()&&Fn()&&Pn()))return function(){const e=screen,t=e=>fn(dn(e),null),n=[t(e.width),t(e.height)];return n.sort().reverse(),n}()},hardwareConcurrency:function(){const e=fn(dn(navigator.hardwareConcurrency),void 0);return void 0!==e&&Rn()&&Bn()?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(un(new Date(e,0,1).getTimezoneOffset()),un(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(!_n()&&!function(){const e=window,t=navigator;return pn(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!_n()}())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&&Mn()&&!On()?function(){if("iPad"===navigator.platform)return!0;const e=screen,t=e.width/e.height;return pn(["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=dn(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!!qn("inverted")||!qn("none")&&void 0},forcedColors:function(){return!!Qn("active")||!Qn("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 eo("no-preference")?0:eo("high")||eo("more")?1:eo("low")||eo("less")?-1:eo("forced")?10:void 0},reducedMotion:function(){return!!to("reduce")||!to("no-preference")&&void 0},reducedTransparency:function(){return!!no("reduce")||!no("no-preference")&&void 0},hdr:function(){return!!oo("high")||!oo("standard")&&void 0},math:function(){const e=io.acos||ro,t=io.acosh||ro,n=io.asin||ro,o=io.asinh||ro,i=io.atanh||ro,r=io.atan||ro,a=io.sin||ro,s=io.sinh||ro,c=io.cos||ro,l=io.cosh||ro,d=io.tan||ro,u=io.tanh||ro,f=io.exp||ro,p=io.expm1||ro,h=io.log1p||ro;return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:(g=1e154,io.log(g+io.sqrt(g*g-1))),asin:n(.12312423423423424),asinh:o(1),asinhPf:(e=>io.log(e+io.sqrt(e*e+1)))(1),atanh:i(.5),atanhPf:(e=>io.log((1+e)/(1-e))/2)(.5),atan:r(.5),sin:a(-1e300),sinh:s(1),sinhPf:(e=>io.exp(e)-1/io.exp(e)/2)(1),cos:c(10.000000000123),cosh:l(1),coshPf:(e=>(io.exp(e)+1/io.exp(e))/2)(1),tan:d(-1e300),tanh:u(1),tanhPf:(e=>(io.exp(2*e)-1)/(io.exp(2*e)+1))(1),exp:f(1),expm1:p(1),expm1Pf:(e=>io.exp(e)-1)(1),log1p:h(10),log1pPf:(e=>io.log(1+e))(10),powPI:(e=>io.pow(io.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(lo())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(!(jn()||Mn()))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=mo(e);if(!s)return-1;if(!So(s))return-2;const c=vo()?null:s.getExtension(go);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=mo(e);if(!t)return-1;if(!So(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=yo(t);for(const d of l){const e=t[d];a.push(`${d}=${e}${uo.has(e)?`=${t.getParameter(e)}`:""}`)}if(n)for(const d of n){if(d===go&&vo()||"WEBGL_polygon_mode"===d&&xo())continue;const e=t.getExtension(d);if(e)for(const n of yo(e)){const o=e[n];s.push(`${n}=${o}${fo.has(o)?`=${t.getParameter(o)}`:""}`)}else i.push(d)}for(const d of po)for(const e of ho){const n=bo(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 ko(e){const t=function(e){if(jn())return.4;if(Mn())return!On()||Fn()&&Pn()?.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 hn(.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 Eo(e){return JSON.stringify(e,(e,t)=>{return t instanceof Error?u({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 Io(e){return Tn(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 Lo(e=50){return function(e,t=1/0){const{requestIdleCallback:n}=window;return n?new Promise(e=>n.call(window,()=>e(),{timeout:t})):on(Math.min(e,t))}(e,2*e)}function To(e,t){const n=Date.now();return{get(o){return h(this,null,function*(){const i=Date.now(),r=yield e(),a=function(e){let t;const n=ko(e);return{get visitorId(){return void 0===t&&(t=Io(this.components)),t},set visitorId(e){t=e},confidence:n,components:e,version:nn}}(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: ${Eo(r)}\n\`\`\``),a})}}}var Wo={load:function(){return h(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${nn}/npm-monitoring`,!0),e.send()}catch(e){console.error(e)}}(),yield Lo(t);const i=function(e){return Wn(Co,e,[])}({cache:{},debug:n});return To(i,n)})},hashComponents:Io,componentsToDebugString:Eo};U(),function(){if(te||"undefined"==typeof window)return;te=!0;const e=window;let t=e.BrainfishAnalytics?ee(e.BrainfishAnalytics):void 0;try{Object.defineProperty(window,"BrainfishAnalytics",{configurable:!0,get:()=>t,set(e){t=e?ee(e):e}})}catch(n){e.BrainfishAnalytics&&(e.BrainfishAnalytics=ee(e.BrainfishAnalytics))}}();let _o=null;const Ao="undefined"!=typeof window&&window.Brainfish?window.Brainfish:(_o||(_o=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),clearSecretAttributes:()=>n("Widgets.clearSecretAttributes",[]),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=_o)),_o),Mo=new Map,Oo=new Map;let Po=!1;function Ro(e,t,n,o,i){return h(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);Oo.set(e.widgetKey,{options:e,config:t,apiHost:n,analyticsApiHost:o,fingerprint:i});const h=[];(null==p?void 0:p.startsWith("2."))?($t(e,t,i),Po||(Po=!0,tn(()=>{Oo.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."))&&$t(e,t,n)})}))):h.push(S(e,t)),h.push(L(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(Kt(n,e.widgetKey));const[g]=yield Promise.allSettled(h);g&&"fulfilled"===g.status&&g.value&&Ao._setRealBrainfish(g.value)})}Ao.Widgets.isReady=!1,Ao.Widgets.identify=e=>{"undefined"!=typeof window&&window.BrainfishAnalytics?window.BrainfishAnalytics("identify",e):Q(e)},Ao.Widgets.setSecretAttributes=e=>{H(e)},Ao.Widgets.clearSecretAttributes=()=>{!function(){var e;F=null;for(const{iframe:t,widgetHost:n}of O()){const o=M(t,n);null==(e=t.contentWindow)||e.postMessage({type:"CLEAR_SECRET_ATTRIBUTES"},o)}}()},Ao.Widgets.init=e=>h(null,null,function*(){window&&(window.BrainfishAnalytics=window.BrainfishAnalytics||function(...e){(window.BrainfishAnalytics.q=window.BrainfishAnalytics.q||[]).push(e)});const t=w(e.overrides),n=(null==(o=e.overrides)?void 0:o.analyticsApiHost)||"";var o;let i,r;try{const e=yield Wo.load();i=(yield e.get()).visitorId}catch(s){console.warn("[Brainfish] Error loading fingerprint:",s)}if(e.config)r=JSON.parse(W(e.config));else{const{config:n}=yield b({widgetKey:e.widgetKey,apiHost:t});r=n}let a=Mo.get(e.widgetKey);if(a||(a=Ro(e,r,t,n,i),Mo.set(e.widgetKey,a)),yield a,!kt.isWidgetDOMExisting(e.widgetKey,r)){Mo.delete(e.widgetKey);const o=Ro(e,r,t,n,i);Mo.set(e.widgetKey,o),yield o}yield Xt(r),Ao.Widgets.isReady=!0,window.dispatchEvent(new Event("onBrainfishReady"))}),Ao.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(W(r)));const s=u(u({},a),e);null==(t=n.contentWindow)||t.postMessage({type:"SET_THEME",theme:s},"*");const c=T(JSON.stringify(s));i.set("theme",c),o.hash=`#${i.toString()}`,n.src=o.toString()}},Ao.Widgets.registerClientActionHandler=(e,t)=>{((e,t)=>{Pt.set(e,t)})(e,t)};exports.BrainfishAnalytics=(...e)=>{"undefined"!=typeof window&&window.BrainfishAnalytics&&window.BrainfishAnalytics(...e)},exports.default=Ao;
|
|
2
2
|
//# sourceMappingURL=web.cjs.js.map
|
package/dist/web.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e,t,n,o,i=Object.defineProperty,r=Object.defineProperties,a=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,d=(e,t,n)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,u=(e,t)=>{for(var n in t||(t={}))c.call(t,n)&&d(e,n,t[n]);if(s)for(var n of s(t))l.call(t,n)&&d(e,n,t[n]);return e},f=(e,t)=>r(e,a(t)),p=(e,t,n)=>d(e,"symbol"!=typeof t?t+"":t,n),h=(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]="d32061e0-dfbb-444b-8f00-999f6b95a5c6",e._sentryDebugIdIdentifier="sentry-dbid-d32061e0-dfbb-444b-8f00-999f6b95a5c6")}catch(n){}}(),("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"web-widget@1.25.0"},(t=e||(e={})).Sidebar="sidebar",t.Searchbar="searchbar",t.Popup="popup",e.Sidebar,e.Searchbar,e.Popup;class g extends Error{constructor(e,t){super(e,t),p(this,"cause"),this.name="BrainfishWidgetError",this.cause=null==t?void 0:t.cause,Error.captureStackTrace&&Error.captureStackTrace(this,g),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}}}(o=n||(n={})).LINK="link",o.CALLBACK="callback",o.EMAIL="email",o.PHONE="phone";const m=(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.25.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 g(i,{cause:r}),o)};const b=e=>h(null,[e],function*({widgetKey:e,apiHost:t}){return function(e,t,n){return h(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 m(e,r,"Error fetching config",n),o;yield new Promise(e=>setTimeout(e,500))}})}(t,"/api/searchWidgets.getConfigByKey",e)}),y=({config:e,apiKey:t,apiHost:o})=>{const i=e.settings||{};return["bodyActionButtons","footerActionButtons","nextBestActions"].forEach(e=>{i[e]&&(i[e]=i[e].map(e=>e.type===n.CALLBACK&&e.value?f(u({},e),{value:new Function(`return ${e.value}`)()}):e))}),f(u({},e),{settings:i,apiHost:o,widgetMode:e.widgetType,apiKey:t})},w=e=>(null==e?void 0:e.apiHost)||"https://app.brainfi.sh",v=e=>h(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=>h(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&&m(e,o,o.message,t)}});const x=/* @__PURE__ */new Set,S=(t,n)=>h(null,null,function*(){const o=w(t.overrides);try{if(x.has(t.widgetKey))return;const i=yield v({apiHost:o,widgetKey:t.widgetKey,version:n.version||"latest"});if(i){const{widget:r}=i,a=y({config:n,apiKey:t.widgetKey,apiHost:o});return t.overrides&&n.settings&&Object.entries(t.overrides).forEach(([e,t])=>{n.settings&&e in n.settings&&(n.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())})(n.settings[e],t))}),function(t,n){n.widgetType===e.Searchbar||"Search"===n.widgetType?t.SearchWidget.initStandard(n):t.HelpWidget.initPopup(n)}(r,a),x.add(t.widgetKey),r}}catch(i){m(o,i,i.message,t.widgetKey)}}),C=()=>{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}},k=e=>{try{if(C())return window.localStorage.getItem(e)}catch(t){}return null},E=e=>{try{C()&&window.localStorage.removeItem(e)}catch(t){}};let I=!1;const L=(e,t,n,...o)=>h(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."),!I)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"===k("bf_tracking_disabled"),c=a||s;window.BrainfishAnalytics("init",{apiUrl:o,accessKey:t,trackScreenViews:!0,trackAttributes:!c,trackOutgoingLinks:!c,enableRecording:!c&&i,recordingOptions:r}),I=!0,yield((e,t)=>h(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&&m(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){m(n,a,"Failed to initialize BrainfishAnalytics",e)}});function T(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 W=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")},_=/* @__PURE__ */new Map;function A(e){try{return new URL(e).origin}catch(t){return e}}function M(e,t){try{return new URL(e.src).origin}catch(n){if(t)return A(t)}return"*"}function O(){return Array.from(_,([e,{widgetHost:t}])=>({iframe:e,widgetHost:t}))}new TextEncoder;const P=new TextDecoder;const R=e=>{let t=e;t instanceof Uint8Array&&(t=P.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 B(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(P.decode(R(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")}}let F=null;function j(e,t){F&&function(e,t,n){var o;const i=M(e,n);null==(o=e.contentWindow)||o.postMessage({type:"SET_SECRET_ATTRIBUTES",secretAttributes:t},i)}(e,F,t)}function N(e){return function(e){try{const{alg:t}=B(e);return"dir"===t}catch(t){return!1}}(e)?(F=e,function(){for(const{iframe:e,widgetHost:t}of O())j(e,t)}(),!0):(console.error("[Brainfish] Invalid JWE provided to setSecretAttributes."),!1)}const V="USER_IDENTIFY";let H=null;const Z=/* @__PURE__ */new Set;let D=!1;function G(e){Z.add(A(e))}function z(e){return Z.has(e)||function(e){for(const n of _.keys())try{if(new URL(n.src).origin===e)return!0}catch(t){}return!1}(e)}function $(e,t,n){var o;const i=M(e,n);null==(o=e.contentWindow)||o.postMessage({type:V,payload:t},i)}function Y(e,t,n){var o;G(t),function(e,t){_.set(e,{widgetHost:t})}(e,t);const i=()=>{H&&$(e,H,t),j(e,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",()=>{!function(e){_.delete(e)}(e)},{once:!0}),e.contentWindow&&i()}function X(e){var t;"REQUEST_USER_IDENTITY"===(null==(t=e.data)?void 0:t.type)&&H&&e.source&&z(e.origin)&&(!function(e){if(!e)return!1;for(const t of _.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:V,payload:H},e.origin))}function J(){D||"undefined"==typeof window||(D=!0,window.addEventListener("message",X))}const K=/* @__PURE__ */new Set(["userId","firstName","lastName","email","phone","avatar","properties"]);function U(e){J();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))K.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=u(u({},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)."),H=t,function(e){for(const{iframe:t,widgetHost:n}of O())$(t,e,n)}(t),t):null}function q(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=U(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 Q=!1;function ee(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var te,ne={exports:{}},oe={exports:{}},ie={exports:{}};function re(){return te||(te=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}(ie,ie.exports)),ie.exports}var ae,se={exports:{}};function ce(){return ae||(ae=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}(se,se.exports)),se.exports}var le,de,ue,fe={exports:{}};function pe(){return le||(le=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}(fe,fe.exports)),fe.exports}function he(){return de||(de=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)+")",T=d.exec(L);if(!T)throw new i.default(4,t,L);return{red:parseInt(""+T[1],10),green:parseInt(""+T[2],10),blue:parseInt(""+T[3],10),alpha:parseFloat(""+C[4])>1?parseFloat(""+C[4])/100:parseFloat(""+C[4])}}throw new i.default(5)};var n=r(/* @__PURE__ */re()),o=r(/* @__PURE__ */ce()),i=r(/* @__PURE__ */pe());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}(oe,oe.exports)),oe.exports}function ge(){return ue||(ue=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__ */he())&&n.__esModule?n:{default:n};e.exports=t.default}(ne,ne.exports)),ne.exports}const me=/* @__PURE__ */ee(/* @__PURE__ */ge());var be,ye={exports:{}},we={exports:{}};function ve(){return be||(be=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}(we,we.exports)),we.exports}var xe,Se={exports:{}};function Ce(){return xe||(xe=1,e=Se,(t=Se.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),Se.exports;var e,t}var ke,Ee,Ie={exports:{}},Le={exports:{}};function Te(){return ke||(ke=1,e=Le,(t=Le.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),Le.exports;var e,t}function We(){return Ee||(Ee=1,function(e,t){t.__esModule=!0,t.default=function(e){return(0,o.default)((0,n.default)(e))};var n=i(/* @__PURE__ */he()),o=i(/* @__PURE__ */Te());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ie,Ie.exports)),Ie.exports}var _e,Ae={exports:{}},Me={exports:{}},Oe={exports:{}},Pe={exports:{}};function Re(){return _e||(_e=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 Be,Fe,je,Ne={exports:{}};function Ve(){return Be||(Be=1,e=Ne,(t=Ne.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),Ne.exports;var e,t}function He(){return Fe||(Fe=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=r(/* @__PURE__ */re()),o=r(/* @__PURE__ */Re()),i=r(/* @__PURE__ */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}(Oe,Oe.exports)),Oe.exports}function Ze(){return je||(je=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__ */He()),o=i(/* @__PURE__ */pe());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Me,Me.exports)),Me.exports}var De,Ge={exports:{}};function ze(){return De||(De=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__ */He()),o=r(/* @__PURE__ */re()),i=r(/* @__PURE__ */pe());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ge,Ge.exports)),Ge.exports}var $e,Ye={exports:{}};function Xe(){return $e||($e=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__ */Re()),o=r(/* @__PURE__ */Ve()),i=r(/* @__PURE__ */pe());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ye,Ye.exports)),Ye.exports}var Je,Ke,Ue,qe={exports:{}};function Qe(){return Je||(Je=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__ */he()),o=r(/* @__PURE__ */Xe()),i=r(/* @__PURE__ */pe());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(qe,qe.exports)),qe.exports}function et(){return Ke||(Ke=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__ */Ze()),o=s(/* @__PURE__ */ze()),i=s(/* @__PURE__ */Xe()),r=s(/* @__PURE__ */Qe()),a=s(/* @__PURE__ */pe());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}(Ae,Ae.exports)),Ae.exports}function tt(){return Ue||(Ue=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(/* @__PURE__ */ve()),o=a(/* @__PURE__ */Ce()),i=a(/* @__PURE__ */We()),r=a(/* @__PURE__ */et());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}(ye,ye.exports)),ye.exports}const nt=/* @__PURE__ */ee(/* @__PURE__ */tt());var ot,it={exports:{}};function rt(){return ot||(ot=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(/* @__PURE__ */ve()),o=a(/* @__PURE__ */Ce()),i=a(/* @__PURE__ */We()),r=a(/* @__PURE__ */et());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}(it,it.exports)),it.exports}const at=/* @__PURE__ */ee(/* @__PURE__ */rt()),st="bf-iframe-container",ct="bf-trigger-button",lt="bf-search-bar-iframe-container",dt="bf-search-bar-iframe-backdrop";function ut(e){var t,n;if(!document.querySelector("style[data-widget-styles]")){!function(e="#000",t="FFF"){const n=document.createElement("style");n.setAttribute("data-widget-styles","");const o=me(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 .${ct} { background: ${e}; }\n .${ct}:hover {\n background: ${o?nt(.05,e):at(.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 ft{constructor(e,t){p(this,"widgetKey"),p(this,"widgetType"),p(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 pt(e,t,n={}){const o=document.createElement(e);return o.className=t,Object.entries(n).forEach(([e,t])=>{o.setAttribute(e,t)}),o}const ht="brainfish-search-widget";function gt(e){const t=document.querySelector(e);return t instanceof HTMLElement?t:null}function mt(e){const t=null==e?void 0:e.trim();if(!t)return null;const n=gt(t);return n||console.warn(`[Brainfish] mountTarget "${t}" not found or is not a valid element. Falling back to document.body.`),n}function bt(e,t){const n=function(e){const t=document.getElementById(`trigger-button-${e}`);return t||document.querySelector(`.${st}`)}(e);if(!n)return!1;const o=null==t?void 0:t.trim();if(!o)return!0;const i=gt(o);if(!i)return!1;if(!i.contains(n))return!1;if(document.getElementById(`trigger-button-${e}`)){const e=document.querySelector(`.${st}`);if(e&&!i.contains(e))return!1}return!0}function yt(e,t){const n=()=>{(function(e){var t;return null!=(t=mt(e))?t:document.body})(t).appendChild(e)};if(!document.body)return console.warn("[Brainfish] document.body not ready. Widget initialization deferred."),void document.addEventListener("DOMContentLoaded",n,{once:!0});n()}const wt=["bottom-left","bottom-right","top-left","top-right"];let vt;function xt(e){return wt.includes(e)}class St{constructor(e){p(this,"widgetType"),p(this,"button",null),p(this,"icon",null),p(this,"closeCallback",null),this.widgetType=e}setCloseCallback(e){this.closeCallback=e}get containerClass(){return this.widgetType===e.Searchbar?lt:st}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(`.${dt}`)}setElements(e,t){this.button=e||null,this.icon=t||null}openWidget(t={}){var n,o,i;const r=document.querySelector(`.${this.containerClass}`),a=null==r?void 0:r.querySelector("iframe");if(t.newConversation&&t.contextualQuestion?null==(n=null==a?void 0:a.contentWindow)||n.postMessage({type:"CONTEXTUAL_QUESTION",question:t.contextualQuestion},"*"):t.newConversation&&(null==(o=null==a?void 0:a.contentWindow)||o.postMessage({type:"NEW_CONVERSATION"},"*")),null==(i=null==a?void 0:a.contentWindow)||i.postMessage({type:"FOCUS_SEARCH_FIELD"},"*"),this.widgetType!==e.Searchbar){null==r||r.classList.add("open");const e=xt(s=t.position)?s:vt;e&&(null==r||r.classList.add(`position-${e}`),null==r||r.setAttribute("data-current-position",e))}var s;if(null==r||r.setAttribute("aria-hidden","false"),this.widgetType!==e.Searchbar&&document.body.clientWidth>=962&&null===this.backdrop){const e=pt("div",dt);this.closeCallback&&e.addEventListener("click",this.closeCallback),document.body.appendChild(e)}this.updateButtonForOpen()}focusNextElement(){const e=document.querySelector(ht);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(t){if(this.widgetType!==e.Searchbar)return;if(!this.container||!this.iframe)return;const n=Math.max(t,200);this.container.style.height=`${n}px`,this.iframe.style.height=`${n}px`}isMobile(){return document.body.clientWidth<=576}setupButtonClickListener(e){this.button&&this.button.addEventListener("click",e)}static isWidgetDOMExisting(e,t){var n;const o=document.querySelector(`.${lt}[data-widget-key="${e}"]`);if(o){const e=document.querySelector("brainfish-search-widget");return!e||e.contains(o)}return"Search"!==t.widgetType&&bt(e,null==(n=t.settings)?void 0:n.mountTarget)}}class Ct{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(t=>!t.isWidgetOpen&&t.widgetType===e.Popup)}static clear(){this.instances.clear()}}p(Ct,"instances",/* @__PURE__ */new Map);const kt=({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()}},Et=e=>`brainfish_conversation_${e}`,It={save(e,t){if(t){const o=k(Et(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{C()&&window.localStorage.setItem(e,t)}catch(n){}})(Et(e),JSON.stringify(r))}else E(Et(e))},load(e){const t=k(Et(e));if(!t)return null;try{const n=JSON.parse(t);return Date.now()-n.persistedAt>72e5?(E(Et(e)),null):n.conversationId}catch(n){return E(Et(e)),null}},clear(e){E(Et(e))}};class Lt{static getIframeForInstance(t){var n,o;const i=t.widgetType===e.Searchbar?lt:st,r=t.widgetType===e.Searchbar?`.${i}[data-widget-key="${t.widgetKey}"]`:`.${i}`;return null!=(o=null==(n=document.querySelector(r))?void 0:n.querySelector("iframe"))?o: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=kt,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=Ct.getOpenInstance();e&&e.closeWidget()}static openCurrentlyClosedPopupWidget(e){const t=Ct.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=Ct.getOpenInstance();if(e)return void this.postMessageToInstance(e,{type:"NEW_CONVERSATION"});const t=Ct.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=Ct.getOpenInstance();if(n||(n=Ct.getClosedPopupInstance()),!n)return void console.warn("Brainfish.Widgets.onContextHelp: No popup widget available");const o=f(u({},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=Ct.getOpenInstance();const n=!!t;t||(t=Ct.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=Ct.getOpenInstance())?e:Ct.getClosedPopupInstance();t?(It.clear(t.widgetKey),this.postMessageToInstance(t,{type:"NEW_CONVERSATION"})):console.warn("Brainfish.Widgets.clearConversation: No popup widget available")}}p(Lt,"isInitialized",!1);class Tt{constructor(e,t){p(this,"widgetType"),p(this,"widgetKey"),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(t,n={}){if(window.BrainfishAnalytics){let o;switch(this.widgetType){case e.Searchbar:o="searchbar_widget";break;case e.Sidebar:default:o="search_widget"}window.BrainfishAnalytics("track",t,f(u({},n),{widgetKey:this.widgetKey}),{source:o,widgetKey:this.widgetKey})}}}class Wt{constructor(e,t){p(this,"state"),p(this,"domController"),p(this,"analyticsTracker"),this.state=new ft(e,t),this.domController=new St(t),this.domController.setCloseCallback(()=>this.closeWidget()),this.analyticsTracker=new Tt(t,e)}static getInstance(e){return Ct.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()),Ct.register(this.widgetKey,this),Lt.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=It.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(){Ct.unregister(this.widgetKey)}static initialize(e){const t=new Wt(e.widgetKey,e.widgetType);return t.initialize(e),t}}function _t({widgetUrl:t,widgetType:n,props:o}){const i=n===e.Searchbar?lt:st,r=pt("div",i,u({id:i,"aria-live":"polite","aria-hidden":n===e.Searchbar?"false":"true"},o||{})),a=pt("div","iframe-loading-indicator"),s=pt("div","spinner");a.setAttribute("aria-label","Loading content"),a.setAttribute("role","status"),a.appendChild(s),r.appendChild(a);const c=pt("iframe","trigger-iframe",{src:t,sandbox:"allow-scripts allow-same-origin allow-popups allow-forms",allow:"clipboard-write",role:"dialog"});return c.style.opacity="0",c.addEventListener("load",()=>{a.style.display="none",c.style.opacity="1"}),c.addEventListener("error",e=>{console.error("Error loading iframe:",e),a.innerHTML="";const t=pt("div","loading-error");a.appendChild(t),a.setAttribute("aria-label","Failed to load content")}),r.appendChild(c),{iframeContainer:r,iframe:c}}function At(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 Mt=/* @__PURE__ */new Map,Ot=(e,t)=>`Error executing Client Action with key ${e}. Details: ${t instanceof Error?t.message:String(t)}`,Pt=(e,t)=>h(null,null,function*(){if(Mt.has(e)){const i=Mt.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:Ot(e,o)}}}var n;return{success:!1,reason:`No Client Action registered with key ${e}`}}),Rt=/* @__PURE__ */new Map,Bt=/* @__PURE__ */new Set;function Ft(t,{widgetHost:n,apiHost:o,widgetKey:i,widgetType:r,signal:a,stateManager:s}){window.addEventListener("message",a=>h(null,null,function*(){var c,l;if(a.origin!==n)return;const{type:d,widgetKey:u}=a.data;if(!u||u===i){if("TOGGLE_WIDGET_SIZE"===d&&function(){const e=document.querySelector(`.${st}`);e.classList.contains("expanded")?e.classList.remove("expanded"):e.classList.add("expanded")}(),"RESIZE_IFRAME"===d){const{height:e}=a.data;s.resizeContainer(e)}if("TRACK_EVENT"===d){const{messageId:e,eventName:t,data:n}=a.data;if(e){if(Bt.has(e))return void console.warn(`[Brainfish] Duplicate TRACK_EVENT suppressed for "${t}" (messageId: ${e})`);Bt.add(e),setTimeout(()=>Bt.delete(e),5e3)}s.trackCustomEvent(t,n)}if("CLOSE_WIDGET"===d&&s.closeWidget(),"NEXT_BEST_ACTION_CLICKED"===d){const{action:e,searchQueryId:t,query:n,answer:r,conversation:s}=a.data;if(!["function","callback"].includes(e.type))return void console.error("[Brainfish] Invalid action type:",e);const c=Rt.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)`);Rt.set(e.id,Date.now()),setTimeout(()=>Rt.delete(e.id),1e3),It.clear(i);const l={query:n,answer:r,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](n,r,l);const t=new URL(`${o}/api/searchWidgets.callback.codeblocks`);t.searchParams.set("apiKey",i),t.searchParams.set("codeblockId",e.id),l.searchIntentId&&t.searchParams.set("searchIntentId",l.searchIntentId);const a=document.createElement("script");a.src=t.toString(),document.head.appendChild(a),a.onload=()=>{window.__bfCallbacks[e.id](n,r,l),setTimeout(()=>{document.head.removeChild(a)},300)},a.onerror=()=>{console.error("[Brainfish] Failed to load callback script from server")}}catch(f){console.error("[Brainfish] Error executing callback:",f)}}if("CLIENT_EXECUTION"===d){const{actionKey:e,inputs:n,messageId:o}=a.data,i=yield Pt(e,n);null==(c=t.contentWindow)||c.postMessage({type:"CLIENT_EXECUTION_RESULT",messageId:o,result:i},"*")}if("CONVERSATION_CHANGED"===d){const{conversationId:t}=a.data;r!==e.Searchbar&&It.save(i,t)}if("REQUEST_USER_IDENTITY"===d&&a.source===t.contentWindow&&r===e.Popup){const e=It.load(i);e&&(null==(l=t.contentWindow)||l.postMessage({type:"RESTORE_CONVERSATION",conversationId:e},"*"))}}}),{signal:a})}function jt(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 Nt=/* @__PURE__ */new Set;function Vt(t,n,{isButtonHidden:o,triggerButtonIcon:i}){const r=document.createDocumentFragment();let a;if(o)a=Wt.initialize({isButtonHidden:o,widgetType:e.Popup,widgetKey:t});else{const{button:n,icon:o}=function(e,t){const n=pt("button",ct,{id:`trigger-button-${e}`,"aria-controls":st,"aria-expanded":"false","data-name":ct}),o=pt("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}}(t,i);r.appendChild(n),a=Wt.initialize({button:n,icon:o,widgetType:e.Popup,widgetKey:t})}const{iframeContainer:s,iframe:c}=_t({widgetUrl:n,widgetType:e.Popup});return r.appendChild(s),{fragment:r,iframe:c,stateManager:a}}const Ht=({config:t,widgetUrl:n,apiHost:o,widgetHost:i,widgetKey:r,hideTriggerButton:a})=>{const{settings:s}=t,c=null!=a?a:null==s?void 0:s.hideTriggerButton,l=null==s?void 0:s.triggerButtonIcon,d=null==s?void 0:s.mountTarget;try{if(u=null==s?void 0:s.popupPosition,vt=xt(u)?u:void 0,function(e,t){const n=mt(t);if(!n)return!1;const o=document.getElementById(`trigger-button-${e}`),i=document.querySelector(`.${st}`);if(!o&&!i)return!1;let r=!1;o&&!n.contains(o)&&(n.appendChild(o),r=!0),i&&!n.contains(i)&&(n.appendChild(i),r=!0)}(r,d),bt(r,d))return void Nt.add(r);if(function(e){return Nt.has(e)}(r))return;ut(t);const{fragment:a,iframe:f,stateManager:p}=Vt(r,n,{isButtonHidden:c||!1,triggerButtonIcon:l||""}),h=new AbortController,{signal:g}=h;Y(f,i,{signal:g}),f.onload=()=>{setTimeout(()=>{var t;At(f,g),Ft(f,{widgetHost:i,apiHost:o,widgetKey:r,widgetType:e.Popup,signal:g,stateManager:p}),jt(f,g,p);const a=It.load(r),s=new URL(n).searchParams.has("conversation");a&&!s&&(null==(t=f.contentWindow)||t.postMessage({type:"RESTORE_CONVERSATION",conversationId:a},"*"))},0)},yt(a,d),Nt.add(r);const m=()=>{h.abort(),window.removeEventListener("beforeunload",m)};return void window.addEventListener("beforeunload",m)}catch(f){!function(e,t,n){m(e,t,t.message,n)}(o,f,r)}var u},Zt=/* @__PURE__ */new Map;const Dt=({config:t,widgetUrl:n,apiHost:o,widgetHost:i,widgetKey:r})=>{var a,s,c,l;let d=Wt.getInstance(r);null==(a=Zt.get(r))||a.abort();const u=new AbortController;Zt.set(r,u),ut(t);try{const t=document.querySelector(`.${lt}[data-widget-key="${r}"]`),a=document.querySelector(ht);t&&a&&!a.contains(t)&&(a.appendChild(t),0===a.getBoundingClientRect().width&&(null==(s=a.parentElement)||s.style.setProperty("width","100%"))),d||(d=Wt.initialize({isButtonHidden:!0,widgetType:e.Searchbar,widgetKey:r}));const{signal:f}=u,p=t=>{Y(t,i,{signal:f}),At(t,f),Ft(t,{widgetHost:i,apiHost:o,widgetKey:r,widgetType:e.Searchbar,signal:f,stateManager:d}),jt(t,f,d)};if(t){const e=t.querySelector("iframe");e&&("complete"===(null==(l=e.contentDocument)?void 0:l.readyState)?setTimeout(()=>{p(e)},0):e.onload=()=>{setTimeout(()=>{p(e)},0)})}else{const t=document.createDocumentFragment(),{iframeContainer:o,iframe:i}=_t({widgetUrl:n,widgetType:e.Searchbar,props:{"data-widget-type":"searchbar","data-widget-key":r}});i.onload=()=>{setTimeout(()=>{p(i)},0)},t.appendChild(o),a?(a.appendChild(t),0===a.getBoundingClientRect().width&&(null==(c=a.parentElement)||c.style.setProperty("width","100%"))):document.body.appendChild(t)}const h=()=>{u.abort(),Zt.delete(r),window.removeEventListener("beforeunload",h)};return void window.addEventListener("beforeunload",h)}catch(f){!function(e,t,n){m(e,t,t.message,n)}(o,f,r)}},Gt=(e,t,n)=>{var o;const i=w(e.overrides),r=(null==(a=e.overrides)?void 0:a.widgetHost)||"https://agent.brainfi.sh";var a;G(r);const d=null==(o=e.overrides)?void 0:o.hideTriggerButton,{theme:p,settings:h}=t,g=e.overrides||{},{theme:m,redirectRules:b,regions:y,customCss:v}=g,x=((e,t)=>{var n={};for(var o in e)c.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&s)for(var o of s(e))t.indexOf(o)<0&&l.call(e,o)&&(n[o]=e[o]);return n})(g,["theme","redirectRules","regions","customCss"]),S=u(u({},p),m),C=u(u({},h),x),k=T(JSON.stringify(b)),E={theme:T(JSON.stringify(S)),settings:T(JSON.stringify(C)),redirectRules:k};y&&(E.regions=T(JSON.stringify(y))),v&&(E.customCss=T(v)),n&&(E.fingerprint=T(n));const I=`${r}/?widgetKey=${e.widgetKey}#${new URLSearchParams(E).toString()}`,L=f(u({},t),{theme:S,settings:C});"Search"===t.widgetType?Dt({config:L,widgetUrl:I,apiHost:i,widgetHost:r,widgetKey:e.widgetKey}):Ht({config:L,widgetUrl:I,apiHost:i,widgetHost:r,widgetKey:e.widgetKey,hideTriggerButton:d})};var zt=/* @__PURE__ */(e=>(e.FRESHCHAT="freshchat",e.INTERCOM="intercom",e.ZENDESK="zendesk",e.HELPSCOUT="helpscout",e))(zt||{});const $t=t=>h(null,null,function*(){if(t.widgetType===e.Popup){const e=window.fcWidget?zt.FRESHCHAT:null;e&&e===zt.FRESHCHAT&&(yield h(null,null,function*(){window.fcWidget||(yield new Promise(e=>setTimeout(e,100))),window.fcWidget.hide(),window.fcWidget.on("widget:closed",()=>{window.fcWidget.hide()})}))}}),Yt="brainfish-nudges",Xt=(e,t)=>h(null,null,function*(){try{yield h(null,null,function*(){if(!document.getElementById(Yt))return new Promise(e=>{const t=document.createElement("script");t.id=Yt,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){m(e,n,"Failed to initialize Nudge widget",t)}});let Jt,Kt,Ut,qt=!1;const Qt=e=>{null==Jt||Jt.abort(),Jt=new AbortController;const{signal:t}=Jt;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}),qt||(Kt=history.pushState,Ut=history.replaceState,history.pushState=function(...e){Kt.apply(this,e),setTimeout(o,0)},history.replaceState=function(...e){Ut.apply(this,e),setTimeout(o,0)},qt=!0),t.addEventListener("abort",()=>{qt&&(history.pushState=Kt,history.replaceState=Ut,qt=!1)})};var en="5.2.0";function tn(e,t){return new Promise(n=>setTimeout(n,e,t))}function nn(){return new Promise(e=>{const t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(null)})}function on(e){return!!e&&"function"==typeof e.then}function rn(e,t){try{const n=e();on(n)?n.then(e=>t(!0,e),e=>t(!1,e)):t(!0,n)}catch(n){t(!1,n)}}function an(e,t,n=16){return h(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 nn())}return o})}function sn(e){return e.then(void 0,()=>{}),e}function cn(e){return parseInt(e)}function ln(e){return parseFloat(e)}function dn(e,t){return"number"==typeof e&&isNaN(e)?t:e}function un(e){return e.reduce((e,t)=>e+(t?1:0),0)}function fn(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 pn(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 hn(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 gn(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 mn(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 bn(e,t){e[0]^=t[0],e[1]^=t[1]}const yn=[4283543511,3981806797],wn=[3301882366,444984403];function vn(e){const t=[0,e[0]>>>1];bn(e,t),hn(e,yn),t[1]=e[0]>>>1,bn(e,t),hn(e,wn),t[1]=e[0]>>>1,bn(e,t)}const xn=[2277735313,289559509],Sn=[1291169091,658871167],Cn=[0,5],kn=[0,1390208809],En=[0,944331445];function In(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,hn(c,xn),gn(c,31),hn(c,Sn),bn(a,c),gn(a,27),pn(a,s),hn(a,Cn),pn(a,kn),hn(l,Sn),gn(l,33),hn(l,xn),bn(s,l),gn(s,31),pn(s,a),hn(s,Cn),pn(s,En);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],mn(u,48),bn(l,u);case 14:u[1]=n[d+13],mn(u,40),bn(l,u);case 13:u[1]=n[d+12],mn(u,32),bn(l,u);case 12:u[1]=n[d+11],mn(u,24),bn(l,u);case 11:u[1]=n[d+10],mn(u,16),bn(l,u);case 10:u[1]=n[d+9],mn(u,8),bn(l,u);case 9:u[1]=n[d+8],bn(l,u),hn(l,Sn),gn(l,33),hn(l,xn),bn(s,l);case 8:u[1]=n[d+7],mn(u,56),bn(c,u);case 7:u[1]=n[d+6],mn(u,48),bn(c,u);case 6:u[1]=n[d+5],mn(u,40),bn(c,u);case 5:u[1]=n[d+4],mn(u,32),bn(c,u);case 4:u[1]=n[d+3],mn(u,24),bn(c,u);case 3:u[1]=n[d+2],mn(u,16),bn(c,u);case 2:u[1]=n[d+1],mn(u,8),bn(c,u);case 1:u[1]=n[d],bn(c,u),hn(c,xn),gn(c,31),hn(c,Sn),bn(a,c)}return bn(a,o),bn(s,o),pn(a,s),pn(s,a),vn(a),vn(s),pn(a,s),pn(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 Ln(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=sn(an(i,n=>function(e,t){const n=sn(new Promise(n=>{const o=Date.now();rn(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();rn(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 h(this,null,function*(){const e=yield r,t=yield an(e,e=>sn(e()),o),n=yield Promise.all(t),a={};for(let o=0;o<i.length;++o)a[i[o]]=n[o];return a})}}function Tn(){const e=window,t=navigator;return un(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Wn(){const e=window,t=navigator;return un(["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 _n(){const e=window;return un(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===navigator.vendor.indexOf("Apple"),"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function An(){const e=window,{HTMLElement:t,Document:n}=e;return un(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function Mn(){const e=window;return t=e.print,/^function\s.*?\{\s*\[native code]\s*}$/.test(String(t))&&"[object WebPageNamespace]"===String(e.browser);var t}function On(){var e,t;const n=window;return un(["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 Pn(){const{CSS:e}=window;return un([e.supports("selector(::details-content)"),e.supports("selector(::before::marker)"),e.supports("selector(::after::marker)"),!("locale"in CompositionEvent.prototype)])>=3}function Rn(){const e=window,t=navigator,{CSS:n,HTMLButtonElement:o}=e;return un([!("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 Bn(){const e=Wn(),t=On(),n=window,o=navigator,i="connection";return e?un([!("SharedWorker"in n),o[i]&&"ontypechange"in o[i],!("sinkId"in new Audio)])>=2:!!t&&un(["onorientationchange"in n,"orientation"in n,/android/i.test(o.appVersion)])>=2}function Fn(e){const t=new Error(e);return t.name=e,t}function jn(e,t,n=50){return h(this,null,function*(){var o,i,r;const a=document;for(;!a.body;)yield tn(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 tn(n);return yield e(s,s.contentWindow)}finally{null===(r=s.parentNode)||void 0===r||r.removeChild(s)}})}function Nn(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?Vn(o.style,e):o.setAttribute(i,e)}return o}function Vn(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 Hn=["monospace","sans-serif","serif"],Zn=["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 Dn(e){return e.toDataURL()}let Gn,zn;function $n(){return function(){if(void 0!==zn)return;const e=()=>{const t=Yn();Xn(t)?zn=setTimeout(e,2500):(Gn=t,zn=void 0)};e()}(),()=>h(null,null,function*(){let e=Yn();if(Xn(e)){if(Gn)return[...Gn];(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=Yn())}return Xn(e)||(Gn=e),e})}function Yn(){const e=screen;return[dn(ln(e.availTop),null),dn(ln(e.width)-ln(e.availWidth)-dn(ln(e.availLeft),0),null),dn(ln(e.height)-ln(e.availHeight)-dn(ln(e.availTop),0),null),dn(ln(e.availLeft),null)]}function Xn(e){for(let t=0;t<4;++t)if(e[t])return!1;return!0}function Jn(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function Kn(e){return matchMedia(`(inverted-colors: ${e})`).matches}function Un(e){return matchMedia(`(forced-colors: ${e})`).matches}function qn(e){return matchMedia(`(prefers-contrast: ${e})`).matches}function Qn(e){return matchMedia(`(prefers-reduced-motion: ${e})`).matches}function eo(e){return matchMedia(`(prefers-reduced-transparency: ${e})`).matches}function to(e){return matchMedia(`(dynamic-range: ${e})`).matches}const no=Math,oo=()=>0;const io="mmMwWLliI0fiflO&1",ro={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function ao(e){const t=Bn()?0:3,n=Math.pow(10,t);return Math.floor(e*n)/n}const so=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 co=/* @__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]),lo=/* @__PURE__ */new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),uo=["FRAGMENT_SHADER","VERTEX_SHADER"],fo=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],po="WEBGL_debug_renderer_info";function ho(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 go(e,t,n){const o=e.getShaderPrecisionFormat(e[t],e[n]);return o?[o.rangeMin,o.rangeMax,o.precision]:[]}function mo(e){return Object.keys(e.__proto__).filter(bo)}function bo(e){return"string"==typeof e&&!e.match(/[^A-Z0-9_x]/)}function yo(){return On()}function wo(){return Wn()||_n()}function vo(e){return"function"==typeof e.getParameter}const xo={userAgentData:function(){return h(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 jn((e,t)=>h(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=Hn.map(a),l=(()=>{const e={};for(const t of Zn)e[t]=Hn.map(e=>s(t,e));return e})();n.appendChild(o);for(let d=0;d<Hn.length;d++)i[Hn[d]]=c[d].offsetWidth,r[Hn[d]]=c[d].offsetHeight;return Zn.filter(e=>{return t=l[e],Hn.some((e,n)=>t[n].offsetWidth!==i[e]||t[n].offsetHeight!==r[e]);var t})}))},domBlockers:function(){return h(this,arguments,function*({debug:e}={}){if(!_n()&&!Bn())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 h(this,null,function*(){var t;const n=document,o=n.createElement("div"),i=new Array(e.length),r={};Jn(o);for(let a=0;a<e.length;++a){const t=Nn(e[a]);"DIALOG"===t.tagName&&t.show();const r=n.createElement("div");Jn(r),r.appendChild(t),o.appendChild(r),i[a]=t}for(;!n.body;)yield tn(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 un(n.map(e=>i[e]))>.6*n.length});return r.sort(),r})},fontPreferences:function(){return function(e,t=4e3){return jn((n,o)=>{const i=o.document,r=i.body,a=r.style;a.width=`${t}px`,a.webkitTextSizeAdjust=a.textSizeAdjust="none",Wn()?r.style.zoom=""+1/o.devicePixelRatio:_n()&&(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(ro)){const[n={},i=io]=ro[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=Wn()&&function(){const e=window,t=document,{CSS:n,Promise:o,AudioContext:i}=e;return un([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(ro)){const e=o[a].getBoundingClientRect().width;i[a]=r?ao(e*n.devicePixelRatio):e}return i})},audio:function(){return _n()&&Rn()&&Mn()||Wn()&&function(){const e=navigator,t=window,n=Audio.prototype,{visualViewport:o}=t;return un(["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 un(["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(_n()&&!An()&&!function(){const e=window;return un(["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(Fn("timeout")),Math.min(o,d+i-Date.now()))},f=()=>{try{const o=e.startRendering();switch(on(o)&&sn(o),e.state){case"running":d=Date.now(),c&&u();break;case"suspended":document.hidden||l++,c&&l>=t?s(Fn("suspended")):setTimeout(f,n)}}catch(o){s(o)}};f(),r=()=>{c||(c=!0,d>0&&u())}});return[a,r]}(o),c=sn(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=_n()&&Rn()&&Mn(),t=On()&&Pn();if(e||t)return()=>Promise.resolve(void 0);const n=$n();return()=>h(null,null,function*(){const e=yield n(),t=e=>null===e?null:fn(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=Dn(e),o=Dn(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=Dn(e);return[i,n]}(i,r));return{winding:o,geometry:t,text:n}}(function(){const e=_n()&&Rn()&&Mn(),t=On()&&function(){const e=window,t=navigator,{CSS:n}=e;return un(["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))Wn()&&function(){const e=window;return un([!("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 dn(ln(navigator.deviceMemory),void 0)},screenResolution:function(){if(!(_n()&&Rn()&&Mn()))return function(){const e=screen,t=e=>dn(cn(e),null),n=[t(e.width),t(e.height)];return n.sort().reverse(),n}()},hardwareConcurrency:function(){const e=dn(cn(navigator.hardwareConcurrency),void 0);return void 0!==e&&On()&&Pn()?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(ln(new Date(e,0,1).getTimezoneOffset()),ln(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(!Tn()&&!function(){const e=window,t=navigator;return un(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Tn()}())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&&_n()&&!An()?function(){if("iPad"===navigator.platform)return!0;const e=screen,t=e.width/e.height;return un(["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=cn(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!!Kn("inverted")||!Kn("none")&&void 0},forcedColors:function(){return!!Un("active")||!Un("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 qn("no-preference")?0:qn("high")||qn("more")?1:qn("low")||qn("less")?-1:qn("forced")?10:void 0},reducedMotion:function(){return!!Qn("reduce")||!Qn("no-preference")&&void 0},reducedTransparency:function(){return!!eo("reduce")||!eo("no-preference")&&void 0},hdr:function(){return!!to("high")||!to("standard")&&void 0},math:function(){const e=no.acos||oo,t=no.acosh||oo,n=no.asin||oo,o=no.asinh||oo,i=no.atanh||oo,r=no.atan||oo,a=no.sin||oo,s=no.sinh||oo,c=no.cos||oo,l=no.cosh||oo,d=no.tan||oo,u=no.tanh||oo,f=no.exp||oo,p=no.expm1||oo,h=no.log1p||oo;return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:(g=1e154,no.log(g+no.sqrt(g*g-1))),asin:n(.12312423423423424),asinh:o(1),asinhPf:(e=>no.log(e+no.sqrt(e*e+1)))(1),atanh:i(.5),atanhPf:(e=>no.log((1+e)/(1-e))/2)(.5),atan:r(.5),sin:a(-1e300),sinh:s(1),sinhPf:(e=>no.exp(e)-1/no.exp(e)/2)(1),cos:c(10.000000000123),cosh:l(1),coshPf:(e=>(no.exp(e)+1/no.exp(e))/2)(1),tan:d(-1e300),tanh:u(1),tanhPf:(e=>(no.exp(2*e)-1)/(no.exp(2*e)+1))(1),exp:f(1),expm1:p(1),expm1Pf:(e=>no.exp(e)-1)(1),log1p:h(10),log1pPf:(e=>no.log(1+e))(10),powPI:(e=>no.pow(no.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(so())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(!(Bn()||_n()))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=ho(e);if(!s)return-1;if(!vo(s))return-2;const c=yo()?null:s.getExtension(po);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=ho(e);if(!t)return-1;if(!vo(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=mo(t);for(const d of l){const e=t[d];a.push(`${d}=${e}${co.has(e)?`=${t.getParameter(e)}`:""}`)}if(n)for(const d of n){if(d===po&&yo()||"WEBGL_polygon_mode"===d&&wo())continue;const e=t.getExtension(d);if(e)for(const n of mo(e)){const o=e[n];s.push(`${n}=${o}${lo.has(o)?`=${t.getParameter(o)}`:""}`)}else i.push(d)}for(const d of uo)for(const e of fo){const n=go(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 So(e){const t=function(e){if(Bn())return.4;if(_n())return!An()||Rn()&&Mn()?.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 fn(.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 Co(e){return JSON.stringify(e,(e,t)=>{return t instanceof Error?u({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 ko(e){return In(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 Eo(e=50){return function(e,t=1/0){const{requestIdleCallback:n}=window;return n?new Promise(e=>n.call(window,()=>e(),{timeout:t})):tn(Math.min(e,t))}(e,2*e)}function Io(e,t){const n=Date.now();return{get(o){return h(this,null,function*(){const i=Date.now(),r=yield e(),a=function(e){let t;const n=So(e);return{get visitorId(){return void 0===t&&(t=ko(this.components)),t},set visitorId(e){t=e},confidence:n,components:e,version:en}}(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: ${Co(r)}\n\`\`\``),a})}}}var Lo={load:function(){return h(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${en}/npm-monitoring`,!0),e.send()}catch(e){console.error(e)}}(),yield Eo(t);const i=function(e){return Ln(xo,e,[])}({cache:{},debug:n});return Io(i,n)})},hashComponents:ko,componentsToDebugString:Co};J(),function(){if(Q||"undefined"==typeof window)return;Q=!0;const e=window;let t=e.BrainfishAnalytics?q(e.BrainfishAnalytics):void 0;try{Object.defineProperty(window,"BrainfishAnalytics",{configurable:!0,get:()=>t,set(e){t=e?q(e):e}})}catch(n){e.BrainfishAnalytics&&(e.BrainfishAnalytics=q(e.BrainfishAnalytics))}}();let To=null;const Wo="undefined"!=typeof window&&window.Brainfish?window.Brainfish:(To||(To=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),clearSecretAttributes:()=>n("Widgets.clearSecretAttributes",[]),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=To)),To),_o=/* @__PURE__ */new Map,Ao=/* @__PURE__ */new Map;let Mo=!1;function Oo(e,t,n,o,i){return h(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);Ao.set(e.widgetKey,{options:e,config:t,apiHost:n,analyticsApiHost:o,fingerprint:i});const h=[];(null==p?void 0:p.startsWith("2."))?(Gt(e,t,i),Mo||(Mo=!0,Qt(()=>{Ao.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."))&&Gt(e,t,n)})}))):h.push(S(e,t)),h.push(L(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(Xt(n,e.widgetKey));const[g]=yield Promise.allSettled(h);g&&"fulfilled"===g.status&&g.value&&Wo._setRealBrainfish(g.value)})}Wo.Widgets.isReady=!1,Wo.Widgets.identify=e=>{"undefined"!=typeof window&&window.BrainfishAnalytics?window.BrainfishAnalytics("identify",e):U(e)},Wo.Widgets.setSecretAttributes=e=>{N(e)},Wo.Widgets.clearSecretAttributes=()=>{!function(){var e;F=null;for(const{iframe:t,widgetHost:n}of O()){const o=M(t,n);null==(e=t.contentWindow)||e.postMessage({type:"CLEAR_SECRET_ATTRIBUTES"},o)}}()},Wo.Widgets.init=e=>h(null,null,function*(){window&&(window.BrainfishAnalytics=window.BrainfishAnalytics||function(...e){(window.BrainfishAnalytics.q=window.BrainfishAnalytics.q||[]).push(e)});const t=w(e.overrides),n=(null==(o=e.overrides)?void 0:o.analyticsApiHost)||"";var o;let i,r;try{const e=yield Lo.load();i=(yield e.get()).visitorId}catch(s){console.warn("[Brainfish] Error loading fingerprint:",s)}if(e.config)r=JSON.parse(W(e.config));else{const{config:n}=yield b({widgetKey:e.widgetKey,apiHost:t});r=n}let a=_o.get(e.widgetKey);if(a||(a=Oo(e,r,t,n,i),_o.set(e.widgetKey,a)),yield a,!St.isWidgetDOMExisting(e.widgetKey,r)){_o.delete(e.widgetKey);const o=Oo(e,r,t,n,i);_o.set(e.widgetKey,o),yield o}yield $t(r),Wo.Widgets.isReady=!0,window.dispatchEvent(new Event("onBrainfishReady"))}),Wo.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(W(r)));const s=u(u({},a),e);null==(t=n.contentWindow)||t.postMessage({type:"SET_THEME",theme:s},"*");const c=T(JSON.stringify(s));i.set("theme",c),o.hash=`#${i.toString()}`,n.src=o.toString()}},Wo.Widgets.registerClientActionHandler=(e,t)=>{((e,t)=>{Mt.set(e,t)})(e,t)};const Po=(...e)=>{"undefined"!=typeof window&&window.BrainfishAnalytics&&window.BrainfishAnalytics(...e)};export{Po as BrainfishAnalytics,Wo as default};
|
|
1
|
+
var e,t,n,o,i=Object.defineProperty,r=Object.defineProperties,a=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,d=(e,t,n)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,u=(e,t)=>{for(var n in t||(t={}))c.call(t,n)&&d(e,n,t[n]);if(s)for(var n of s(t))l.call(t,n)&&d(e,n,t[n]);return e},f=(e,t)=>r(e,a(t)),p=(e,t,n)=>d(e,"symbol"!=typeof t?t+"":t,n),h=(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]="9ab87d31-a300-4070-a251-302d5d27363d",e._sentryDebugIdIdentifier="sentry-dbid-9ab87d31-a300-4070-a251-302d5d27363d")}catch(n){}}(),("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"web-widget@1.25.2"},(t=e||(e={})).Sidebar="sidebar",t.Searchbar="searchbar",t.Popup="popup",e.Sidebar,e.Searchbar,e.Popup;class g extends Error{constructor(e,t){super(e,t),p(this,"cause"),this.name="BrainfishWidgetError",this.cause=null==t?void 0:t.cause,Error.captureStackTrace&&Error.captureStackTrace(this,g),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}}}(o=n||(n={})).LINK="link",o.CALLBACK="callback",o.EMAIL="email",o.PHONE="phone";const m=(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.25.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 g(i,{cause:r}),o)};const b=e=>h(null,[e],function*({widgetKey:e,apiHost:t}){return function(e,t,n){return h(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 m(e,r,"Error fetching config",n),o;yield new Promise(e=>setTimeout(e,500))}})}(t,"/api/searchWidgets.getConfigByKey",e)}),y=({config:e,apiKey:t,apiHost:o})=>{const i=e.settings||{};return["bodyActionButtons","footerActionButtons","nextBestActions"].forEach(e=>{i[e]&&(i[e]=i[e].map(e=>e.type===n.CALLBACK&&e.value?f(u({},e),{value:new Function(`return ${e.value}`)()}):e))}),f(u({},e),{settings:i,apiHost:o,widgetMode:e.widgetType,apiKey:t})},w=e=>(null==e?void 0:e.apiHost)||"https://app.brainfi.sh",v=e=>h(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=>h(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&&m(e,o,o.message,t)}});const x=/* @__PURE__ */new Set,S=(t,n)=>h(null,null,function*(){const o=w(t.overrides);try{if(x.has(t.widgetKey))return;const i=yield v({apiHost:o,widgetKey:t.widgetKey,version:n.version||"latest"});if(i){const{widget:r}=i,a=y({config:n,apiKey:t.widgetKey,apiHost:o});return t.overrides&&n.settings&&Object.entries(t.overrides).forEach(([e,t])=>{n.settings&&e in n.settings&&(n.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())})(n.settings[e],t))}),function(t,n){n.widgetType===e.Searchbar||"Search"===n.widgetType?t.SearchWidget.initStandard(n):t.HelpWidget.initPopup(n)}(r,a),x.add(t.widgetKey),r}}catch(i){m(o,i,i.message,t.widgetKey)}}),C=()=>{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}},k=e=>{try{if(C())return window.localStorage.getItem(e)}catch(t){}return null},E=e=>{try{C()&&window.localStorage.removeItem(e)}catch(t){}};let I=!1;const L=(e,t,n,...o)=>h(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."),!I)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"===k("bf_tracking_disabled"),c=a||s;window.BrainfishAnalytics("init",{apiUrl:o,accessKey:t,trackScreenViews:!0,trackAttributes:!c,trackOutgoingLinks:!c,enableRecording:!c&&i,recordingOptions:r}),I=!0,yield((e,t)=>h(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&&m(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){m(n,a,"Failed to initialize BrainfishAnalytics",e)}});function T(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 W=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")},_=/* @__PURE__ */new Map;function A(e){try{return new URL(e).origin}catch(t){return e}}function M(e,t){try{return new URL(e.src).origin}catch(n){if(t)return A(t)}return"*"}function O(){return Array.from(_,([e,{widgetHost:t}])=>({iframe:e,widgetHost:t}))}new TextEncoder;const P=new TextDecoder;const R=e=>{let t=e;t instanceof Uint8Array&&(t=P.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 B(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(P.decode(R(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")}}let F=null;function j(e,t,n){e.postMessage({type:"SET_SECRET_ATTRIBUTES",secretAttributes:n},t)}function N(e,t){F&&function(e,t,n){const o=M(e,n);e.contentWindow&&j(e.contentWindow,o,t)}(e,F,t)}function V(){for(const{iframe:e,widgetHost:t}of O())N(e,t)}function H(e){return function(e){try{const{alg:t}=B(e);return"dir"===t}catch(t){return!1}}(e)?(F=e,V(),function(){if(!F)return;let e=1;const t=()=>{e>=6||(e+=1,window.setTimeout(()=>{V(),t()},500))};t()}(),!0):(console.error("[Brainfish] Invalid JWE provided to setSecretAttributes."),!1)}const Z="USER_IDENTIFY";let D=null;const G=/* @__PURE__ */new Set;let z=!1;function $(e){G.add(A(e))}function Y(e){return G.has(e)||function(e){for(const n of _.keys())try{if(new URL(n.src).origin===e)return!0}catch(t){}return!1}(e)}function X(e,t,n){var o;const i=M(e,n);null==(o=e.contentWindow)||o.postMessage({type:Z,payload:t},i)}function J(e,t,n){var o;$(t),function(e,t){_.set(e,{widgetHost:t})}(e,t);const i=()=>{D&&X(e,D,t),N(e,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",()=>{!function(e){_.delete(e)}(e)},{once:!0}),e.contentWindow&&i()}function K(e){var t,n,o;"REQUEST_USER_IDENTITY"===(null==(t=e.data)?void 0:t.type)&&(D&&e.source&&Y(e.origin)&&(!function(e){if(!e)return!1;for(const t of _.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:Z,payload:D},e.origin),n=e.source,o=e.origin,F&&j(n,o,F))))}function U(){z||"undefined"==typeof window||(z=!0,window.addEventListener("message",K))}const q=/* @__PURE__ */new Set(["userId","firstName","lastName","email","phone","avatar","properties"]);function Q(e){U();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))q.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=u(u({},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)."),D=t,function(e){for(const{iframe:t,widgetHost:n}of O())X(t,e,n)}(t),t):null}function ee(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=Q(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 te=!1;function ne(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oe,ie={exports:{}},re={exports:{}},ae={exports:{}};function se(){return oe||(oe=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}(ae,ae.exports)),ae.exports}var ce,le={exports:{}};function de(){return ce||(ce=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}(le,le.exports)),le.exports}var ue,fe,pe,he={exports:{}};function ge(){return ue||(ue=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}(he,he.exports)),he.exports}function me(){return fe||(fe=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)+")",T=d.exec(L);if(!T)throw new i.default(4,t,L);return{red:parseInt(""+T[1],10),green:parseInt(""+T[2],10),blue:parseInt(""+T[3],10),alpha:parseFloat(""+C[4])>1?parseFloat(""+C[4])/100:parseFloat(""+C[4])}}throw new i.default(5)};var n=r(/* @__PURE__ */se()),o=r(/* @__PURE__ */de()),i=r(/* @__PURE__ */ge());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}(re,re.exports)),re.exports}function be(){return pe||(pe=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__ */me())&&n.__esModule?n:{default:n};e.exports=t.default}(ie,ie.exports)),ie.exports}const ye=/* @__PURE__ */ne(/* @__PURE__ */be());var we,ve={exports:{}},xe={exports:{}};function Se(){return we||(we=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}(xe,xe.exports)),xe.exports}var Ce,ke={exports:{}};function Ee(){return Ce||(Ce=1,e=ke,(t=ke.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),ke.exports;var e,t}var Ie,Le,Te={exports:{}},We={exports:{}};function _e(){return Ie||(Ie=1,e=We,(t=We.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),We.exports;var e,t}function Ae(){return Le||(Le=1,function(e,t){t.__esModule=!0,t.default=function(e){return(0,o.default)((0,n.default)(e))};var n=i(/* @__PURE__ */me()),o=i(/* @__PURE__ */_e());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Te,Te.exports)),Te.exports}var Me,Oe={exports:{}},Pe={exports:{}},Re={exports:{}},Be={exports:{}};function Fe(){return Me||(Me=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}(Be,Be.exports)),Be.exports}var je,Ne,Ve,He={exports:{}};function Ze(){return je||(je=1,e=He,(t=He.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),He.exports;var e,t}function De(){return Ne||(Ne=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=r(/* @__PURE__ */se()),o=r(/* @__PURE__ */Fe()),i=r(/* @__PURE__ */Ze());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}(Re,Re.exports)),Re.exports}function Ge(){return Ve||(Ve=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__ */De()),o=i(/* @__PURE__ */ge());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Pe,Pe.exports)),Pe.exports}var ze,$e={exports:{}};function Ye(){return ze||(ze=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__ */De()),o=r(/* @__PURE__ */se()),i=r(/* @__PURE__ */ge());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}($e,$e.exports)),$e.exports}var Xe,Je={exports:{}};function Ke(){return Xe||(Xe=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__ */Fe()),o=r(/* @__PURE__ */Ze()),i=r(/* @__PURE__ */ge());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Je,Je.exports)),Je.exports}var Ue,qe,Qe,et={exports:{}};function tt(){return Ue||(Ue=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__ */me()),o=r(/* @__PURE__ */Ke()),i=r(/* @__PURE__ */ge());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(et,et.exports)),et.exports}function nt(){return qe||(qe=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__ */Ge()),o=s(/* @__PURE__ */Ye()),i=s(/* @__PURE__ */Ke()),r=s(/* @__PURE__ */tt()),a=s(/* @__PURE__ */ge());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}(Oe,Oe.exports)),Oe.exports}function ot(){return Qe||(Qe=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(/* @__PURE__ */Se()),o=a(/* @__PURE__ */Ee()),i=a(/* @__PURE__ */Ae()),r=a(/* @__PURE__ */nt());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}(ve,ve.exports)),ve.exports}const it=/* @__PURE__ */ne(/* @__PURE__ */ot());var rt,at={exports:{}};function st(){return rt||(rt=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(/* @__PURE__ */Se()),o=a(/* @__PURE__ */Ee()),i=a(/* @__PURE__ */Ae()),r=a(/* @__PURE__ */nt());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}(at,at.exports)),at.exports}const ct=/* @__PURE__ */ne(/* @__PURE__ */st()),lt="bf-iframe-container",dt="bf-trigger-button",ut="bf-search-bar-iframe-container",ft="bf-search-bar-iframe-backdrop";function pt(e){var t,n;if(!document.querySelector("style[data-widget-styles]")){!function(e="#000",t="FFF"){const n=document.createElement("style");n.setAttribute("data-widget-styles","");const o=ye(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(100svh - 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 .${dt} { background: ${e}; }\n .${dt}:hover {\n background: ${o?it(.05,e):ct(.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 ht{constructor(e,t){p(this,"widgetKey"),p(this,"widgetType"),p(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 gt(e,t,n={}){const o=document.createElement(e);return o.className=t,Object.entries(n).forEach(([e,t])=>{o.setAttribute(e,t)}),o}const mt="brainfish-search-widget";function bt(e){const t=document.querySelector(e);return t instanceof HTMLElement?t:null}function yt(e){const t=null==e?void 0:e.trim();if(!t)return null;const n=bt(t);return n||console.warn(`[Brainfish] mountTarget "${t}" not found or is not a valid element. Falling back to document.body.`),n}function wt(e,t){const n=function(e){const t=document.getElementById(`trigger-button-${e}`);return t||document.querySelector(`.${lt}`)}(e);if(!n)return!1;const o=null==t?void 0:t.trim();if(!o)return!0;const i=bt(o);if(!i)return!1;if(!i.contains(n))return!1;if(document.getElementById(`trigger-button-${e}`)){const e=document.querySelector(`.${lt}`);if(e&&!i.contains(e))return!1}return!0}function vt(e,t){const n=()=>{(function(e){var t;return null!=(t=yt(e))?t:document.body})(t).appendChild(e)};if(!document.body)return console.warn("[Brainfish] document.body not ready. Widget initialization deferred."),void document.addEventListener("DOMContentLoaded",n,{once:!0});n()}const xt=["bottom-left","bottom-right","top-left","top-right"];let St;function Ct(e){return xt.includes(e)}class kt{constructor(e){p(this,"widgetType"),p(this,"button",null),p(this,"icon",null),p(this,"closeCallback",null),this.widgetType=e}setCloseCallback(e){this.closeCallback=e}get containerClass(){return this.widgetType===e.Searchbar?ut:lt}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(`.${ft}`)}setElements(e,t){this.button=e||null,this.icon=t||null}openWidget(t={}){var n,o,i;const r=document.querySelector(`.${this.containerClass}`),a=null==r?void 0:r.querySelector("iframe");if(t.newConversation&&t.contextualQuestion?null==(n=null==a?void 0:a.contentWindow)||n.postMessage({type:"CONTEXTUAL_QUESTION",question:t.contextualQuestion},"*"):t.newConversation&&(null==(o=null==a?void 0:a.contentWindow)||o.postMessage({type:"NEW_CONVERSATION"},"*")),null==(i=null==a?void 0:a.contentWindow)||i.postMessage({type:"FOCUS_SEARCH_FIELD"},"*"),this.widgetType!==e.Searchbar){null==r||r.classList.add("open");const e=Ct(s=t.position)?s:St;e&&(null==r||r.classList.add(`position-${e}`),null==r||r.setAttribute("data-current-position",e))}var s;if(null==r||r.setAttribute("aria-hidden","false"),this.widgetType!==e.Searchbar&&document.body.clientWidth>=962&&null===this.backdrop){const e=gt("div",ft);this.closeCallback&&e.addEventListener("click",this.closeCallback),document.body.appendChild(e)}this.updateButtonForOpen()}focusNextElement(){const e=document.querySelector(mt);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(t){if(this.widgetType!==e.Searchbar)return;if(!this.container||!this.iframe)return;const n=Math.max(t,200);this.container.style.height=`${n}px`,this.iframe.style.height=`${n}px`}isMobile(){return document.body.clientWidth<=576}setupButtonClickListener(e){this.button&&this.button.addEventListener("click",e)}static isWidgetDOMExisting(e,t){var n;const o=document.querySelector(`.${ut}[data-widget-key="${e}"]`);if(o){const e=document.querySelector("brainfish-search-widget");return!e||e.contains(o)}return"Search"!==t.widgetType&&wt(e,null==(n=t.settings)?void 0:n.mountTarget)}}class Et{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(t=>!t.isWidgetOpen&&t.widgetType===e.Popup)}static clear(){this.instances.clear()}}p(Et,"instances",/* @__PURE__ */new Map);const It=({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()}},Lt=e=>`brainfish_conversation_${e}`,Tt={save(e,t){if(t){const o=k(Lt(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{C()&&window.localStorage.setItem(e,t)}catch(n){}})(Lt(e),JSON.stringify(r))}else E(Lt(e))},load(e){const t=k(Lt(e));if(!t)return null;try{const n=JSON.parse(t);return Date.now()-n.persistedAt>72e5?(E(Lt(e)),null):n.conversationId}catch(n){return E(Lt(e)),null}},clear(e){E(Lt(e))}};class Wt{static getIframeForInstance(t){var n,o;const i=t.widgetType===e.Searchbar?ut:lt,r=t.widgetType===e.Searchbar?`.${i}[data-widget-key="${t.widgetKey}"]`:`.${i}`;return null!=(o=null==(n=document.querySelector(r))?void 0:n.querySelector("iframe"))?o: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=It,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=Et.getOpenInstance();e&&e.closeWidget()}static openCurrentlyClosedPopupWidget(e){const t=Et.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=Et.getOpenInstance();if(e)return void this.postMessageToInstance(e,{type:"NEW_CONVERSATION"});const t=Et.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=Et.getOpenInstance();if(n||(n=Et.getClosedPopupInstance()),!n)return void console.warn("Brainfish.Widgets.onContextHelp: No popup widget available");const o=f(u({},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=Et.getOpenInstance();const n=!!t;t||(t=Et.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=Et.getOpenInstance())?e:Et.getClosedPopupInstance();t?(Tt.clear(t.widgetKey),this.postMessageToInstance(t,{type:"NEW_CONVERSATION"})):console.warn("Brainfish.Widgets.clearConversation: No popup widget available")}}p(Wt,"isInitialized",!1);class _t{constructor(e,t){p(this,"widgetType"),p(this,"widgetKey"),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(t,n={}){if(window.BrainfishAnalytics){let o;switch(this.widgetType){case e.Searchbar:o="searchbar_widget";break;case e.Sidebar:default:o="search_widget"}window.BrainfishAnalytics("track",t,f(u({},n),{widgetKey:this.widgetKey}),{source:o,widgetKey:this.widgetKey})}}}class At{constructor(e,t){p(this,"state"),p(this,"domController"),p(this,"analyticsTracker"),this.state=new ht(e,t),this.domController=new kt(t),this.domController.setCloseCallback(()=>this.closeWidget()),this.analyticsTracker=new _t(t,e)}static getInstance(e){return Et.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()),Et.register(this.widgetKey,this),Wt.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=Tt.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(){Et.unregister(this.widgetKey)}static initialize(e){const t=new At(e.widgetKey,e.widgetType);return t.initialize(e),t}}function Mt({widgetUrl:t,widgetType:n,props:o}){const i=n===e.Searchbar?ut:lt,r=gt("div",i,u({id:i,"aria-live":"polite","aria-hidden":n===e.Searchbar?"false":"true"},o||{})),a=gt("div","iframe-loading-indicator"),s=gt("div","spinner");a.setAttribute("aria-label","Loading content"),a.setAttribute("role","status"),a.appendChild(s),r.appendChild(a);const c=gt("iframe","trigger-iframe",{src:t,sandbox:"allow-scripts allow-same-origin allow-popups allow-forms",allow:"clipboard-write",role:"dialog"});return c.style.opacity="0",c.addEventListener("load",()=>{a.style.display="none",c.style.opacity="1"}),c.addEventListener("error",e=>{console.error("Error loading iframe:",e),a.innerHTML="";const t=gt("div","loading-error");a.appendChild(t),a.setAttribute("aria-label","Failed to load content")}),r.appendChild(c),{iframeContainer:r,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 Pt=/* @__PURE__ */new Map,Rt=(e,t)=>`Error executing Client Action with key ${e}. Details: ${t instanceof Error?t.message:String(t)}`,Bt=(e,t)=>h(null,null,function*(){if(Pt.has(e)){const i=Pt.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}`}}),Ft=/* @__PURE__ */new Map,jt=/* @__PURE__ */new Set;function Nt(t,{widgetHost:n,apiHost:o,widgetKey:i,widgetType:r,signal:a,stateManager:s}){window.addEventListener("message",a=>h(null,null,function*(){var c,l;if(a.origin!==n)return;const{type:d,widgetKey:u}=a.data;if(!u||u===i){if("TOGGLE_WIDGET_SIZE"===d&&function(){const e=document.querySelector(`.${lt}`);e.classList.contains("expanded")?e.classList.remove("expanded"):e.classList.add("expanded")}(),"RESIZE_IFRAME"===d){const{height:e}=a.data;s.resizeContainer(e)}if("TRACK_EVENT"===d){const{messageId:e,eventName:t,data:n}=a.data;if(e){if(jt.has(e))return void console.warn(`[Brainfish] Duplicate TRACK_EVENT suppressed for "${t}" (messageId: ${e})`);jt.add(e),setTimeout(()=>jt.delete(e),5e3)}s.trackCustomEvent(t,n)}if("CLOSE_WIDGET"===d&&s.closeWidget(),"NEXT_BEST_ACTION_CLICKED"===d){const{action:e,searchQueryId:t,query:n,answer:r,conversation:s}=a.data;if(!["function","callback"].includes(e.type))return void console.error("[Brainfish] Invalid action type:",e);const c=Ft.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)`);Ft.set(e.id,Date.now()),setTimeout(()=>Ft.delete(e.id),1e3),Tt.clear(i);const l={query:n,answer:r,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](n,r,l);const t=new URL(`${o}/api/searchWidgets.callback.codeblocks`);t.searchParams.set("apiKey",i),t.searchParams.set("codeblockId",e.id),l.searchIntentId&&t.searchParams.set("searchIntentId",l.searchIntentId);const a=document.createElement("script");a.src=t.toString(),document.head.appendChild(a),a.onload=()=>{window.__bfCallbacks[e.id](n,r,l),setTimeout(()=>{document.head.removeChild(a)},300)},a.onerror=()=>{console.error("[Brainfish] Failed to load callback script from server")}}catch(f){console.error("[Brainfish] Error executing callback:",f)}}if("CLIENT_EXECUTION"===d){const{actionKey:e,inputs:n,messageId:o}=a.data,i=yield Bt(e,n);null==(c=t.contentWindow)||c.postMessage({type:"CLIENT_EXECUTION_RESULT",messageId:o,result:i},"*")}if("CONVERSATION_CHANGED"===d){const{conversationId:t}=a.data;r!==e.Searchbar&&Tt.save(i,t)}if("REQUEST_USER_IDENTITY"===d&&a.source===t.contentWindow&&r===e.Popup){const e=Tt.load(i);e&&(null==(l=t.contentWindow)||l.postMessage({type:"RESTORE_CONVERSATION",conversationId:e},"*"))}}}),{signal:a})}function Vt(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 Ht=/* @__PURE__ */new Set;function Zt(t,n,{isButtonHidden:o,triggerButtonIcon:i}){const r=document.createDocumentFragment();let a;if(o)a=At.initialize({isButtonHidden:o,widgetType:e.Popup,widgetKey:t});else{const{button:n,icon:o}=function(e,t){const n=gt("button",dt,{id:`trigger-button-${e}`,"aria-controls":lt,"aria-expanded":"false","data-name":dt}),o=gt("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}}(t,i);r.appendChild(n),a=At.initialize({button:n,icon:o,widgetType:e.Popup,widgetKey:t})}const{iframeContainer:s,iframe:c}=Mt({widgetUrl:n,widgetType:e.Popup});return r.appendChild(s),{fragment:r,iframe:c,stateManager:a}}const Dt=({config:t,widgetUrl:n,apiHost:o,widgetHost:i,widgetKey:r,hideTriggerButton:a})=>{const{settings:s}=t,c=null!=a?a:null==s?void 0:s.hideTriggerButton,l=null==s?void 0:s.triggerButtonIcon,d=null==s?void 0:s.mountTarget;try{if(u=null==s?void 0:s.popupPosition,St=Ct(u)?u:void 0,function(e,t){const n=yt(t);if(!n)return!1;const o=document.getElementById(`trigger-button-${e}`),i=document.querySelector(`.${lt}`);if(!o&&!i)return!1;let r=!1;o&&!n.contains(o)&&(n.appendChild(o),r=!0),i&&!n.contains(i)&&(n.appendChild(i),r=!0)}(r,d),wt(r,d))return void Ht.add(r);if(function(e){return Ht.has(e)}(r))return;pt(t);const{fragment:a,iframe:f,stateManager:p}=Zt(r,n,{isButtonHidden:c||!1,triggerButtonIcon:l||""}),h=new AbortController,{signal:g}=h;J(f,i,{signal:g}),f.onload=()=>{setTimeout(()=>{var t;Ot(f,g),Nt(f,{widgetHost:i,apiHost:o,widgetKey:r,widgetType:e.Popup,signal:g,stateManager:p}),Vt(f,g,p);const a=Tt.load(r),s=new URL(n).searchParams.has("conversation");a&&!s&&(null==(t=f.contentWindow)||t.postMessage({type:"RESTORE_CONVERSATION",conversationId:a},"*"))},0)},vt(a,d),Ht.add(r);const m=()=>{h.abort(),window.removeEventListener("beforeunload",m)};return void window.addEventListener("beforeunload",m)}catch(f){!function(e,t,n){m(e,t,t.message,n)}(o,f,r)}var u},Gt=/* @__PURE__ */new Map;const zt=({config:t,widgetUrl:n,apiHost:o,widgetHost:i,widgetKey:r})=>{var a,s,c,l;let d=At.getInstance(r);null==(a=Gt.get(r))||a.abort();const u=new AbortController;Gt.set(r,u),pt(t);try{const t=document.querySelector(`.${ut}[data-widget-key="${r}"]`),a=document.querySelector(mt);t&&a&&!a.contains(t)&&(a.appendChild(t),0===a.getBoundingClientRect().width&&(null==(s=a.parentElement)||s.style.setProperty("width","100%"))),d||(d=At.initialize({isButtonHidden:!0,widgetType:e.Searchbar,widgetKey:r}));const{signal:f}=u,p=t=>{J(t,i,{signal:f}),Ot(t,f),Nt(t,{widgetHost:i,apiHost:o,widgetKey:r,widgetType:e.Searchbar,signal:f,stateManager:d}),Vt(t,f,d)};if(t){const e=t.querySelector("iframe");e&&("complete"===(null==(l=e.contentDocument)?void 0:l.readyState)?setTimeout(()=>{p(e)},0):e.onload=()=>{setTimeout(()=>{p(e)},0)})}else{const t=document.createDocumentFragment(),{iframeContainer:o,iframe:i}=Mt({widgetUrl:n,widgetType:e.Searchbar,props:{"data-widget-type":"searchbar","data-widget-key":r}});i.onload=()=>{setTimeout(()=>{p(i)},0)},t.appendChild(o),a?(a.appendChild(t),0===a.getBoundingClientRect().width&&(null==(c=a.parentElement)||c.style.setProperty("width","100%"))):document.body.appendChild(t)}const h=()=>{u.abort(),Gt.delete(r),window.removeEventListener("beforeunload",h)};return void window.addEventListener("beforeunload",h)}catch(f){!function(e,t,n){m(e,t,t.message,n)}(o,f,r)}},$t=(e,t,n)=>{var o;const i=w(e.overrides),r=(null==(a=e.overrides)?void 0:a.widgetHost)||"https://agent.brainfi.sh";var a;$(r);const d=null==(o=e.overrides)?void 0:o.hideTriggerButton,{theme:p,settings:h}=t,g=e.overrides||{},{theme:m,redirectRules:b,regions:y,customCss:v}=g,x=((e,t)=>{var n={};for(var o in e)c.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&s)for(var o of s(e))t.indexOf(o)<0&&l.call(e,o)&&(n[o]=e[o]);return n})(g,["theme","redirectRules","regions","customCss"]),S=u(u({},p),m),C=u(u({},h),x),k=T(JSON.stringify(b)),E={theme:T(JSON.stringify(S)),settings:T(JSON.stringify(C)),redirectRules:k};y&&(E.regions=T(JSON.stringify(y))),v&&(E.customCss=T(v)),n&&(E.fingerprint=T(n));const I=`${r}/?widgetKey=${e.widgetKey}#${new URLSearchParams(E).toString()}`,L=f(u({},t),{theme:S,settings:C});"Search"===t.widgetType?zt({config:L,widgetUrl:I,apiHost:i,widgetHost:r,widgetKey:e.widgetKey}):Dt({config:L,widgetUrl:I,apiHost:i,widgetHost:r,widgetKey:e.widgetKey,hideTriggerButton:d})};var Yt=/* @__PURE__ */(e=>(e.FRESHCHAT="freshchat",e.INTERCOM="intercom",e.ZENDESK="zendesk",e.HELPSCOUT="helpscout",e))(Yt||{});const Xt=t=>h(null,null,function*(){if(t.widgetType===e.Popup){const e=window.fcWidget?Yt.FRESHCHAT:null;e&&e===Yt.FRESHCHAT&&(yield h(null,null,function*(){window.fcWidget||(yield new Promise(e=>setTimeout(e,100))),window.fcWidget.hide(),window.fcWidget.on("widget:closed",()=>{window.fcWidget.hide()})}))}}),Jt="brainfish-nudges",Kt=(e,t)=>h(null,null,function*(){try{yield h(null,null,function*(){if(!document.getElementById(Jt))return new Promise(e=>{const t=document.createElement("script");t.id=Jt,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){m(e,n,"Failed to initialize Nudge widget",t)}});let Ut,qt,Qt,en=!1;const tn=e=>{null==Ut||Ut.abort(),Ut=new AbortController;const{signal:t}=Ut;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}),en||(qt=history.pushState,Qt=history.replaceState,history.pushState=function(...e){qt.apply(this,e),setTimeout(o,0)},history.replaceState=function(...e){Qt.apply(this,e),setTimeout(o,0)},en=!0),t.addEventListener("abort",()=>{en&&(history.pushState=qt,history.replaceState=Qt,en=!1)})};var nn="5.2.0";function on(e,t){return new Promise(n=>setTimeout(n,e,t))}function rn(){return new Promise(e=>{const t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(null)})}function an(e){return!!e&&"function"==typeof e.then}function sn(e,t){try{const n=e();an(n)?n.then(e=>t(!0,e),e=>t(!1,e)):t(!0,n)}catch(n){t(!1,n)}}function cn(e,t,n=16){return h(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 rn())}return o})}function ln(e){return e.then(void 0,()=>{}),e}function dn(e){return parseInt(e)}function un(e){return parseFloat(e)}function fn(e,t){return"number"==typeof e&&isNaN(e)?t:e}function pn(e){return e.reduce((e,t)=>e+(t?1:0),0)}function hn(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 gn(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 mn(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 bn(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 yn(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 wn(e,t){e[0]^=t[0],e[1]^=t[1]}const vn=[4283543511,3981806797],xn=[3301882366,444984403];function Sn(e){const t=[0,e[0]>>>1];wn(e,t),mn(e,vn),t[1]=e[0]>>>1,wn(e,t),mn(e,xn),t[1]=e[0]>>>1,wn(e,t)}const Cn=[2277735313,289559509],kn=[1291169091,658871167],En=[0,5],In=[0,1390208809],Ln=[0,944331445];function Tn(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,mn(c,Cn),bn(c,31),mn(c,kn),wn(a,c),bn(a,27),gn(a,s),mn(a,En),gn(a,In),mn(l,kn),bn(l,33),mn(l,Cn),wn(s,l),bn(s,31),gn(s,a),mn(s,En),gn(s,Ln);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],yn(u,48),wn(l,u);case 14:u[1]=n[d+13],yn(u,40),wn(l,u);case 13:u[1]=n[d+12],yn(u,32),wn(l,u);case 12:u[1]=n[d+11],yn(u,24),wn(l,u);case 11:u[1]=n[d+10],yn(u,16),wn(l,u);case 10:u[1]=n[d+9],yn(u,8),wn(l,u);case 9:u[1]=n[d+8],wn(l,u),mn(l,kn),bn(l,33),mn(l,Cn),wn(s,l);case 8:u[1]=n[d+7],yn(u,56),wn(c,u);case 7:u[1]=n[d+6],yn(u,48),wn(c,u);case 6:u[1]=n[d+5],yn(u,40),wn(c,u);case 5:u[1]=n[d+4],yn(u,32),wn(c,u);case 4:u[1]=n[d+3],yn(u,24),wn(c,u);case 3:u[1]=n[d+2],yn(u,16),wn(c,u);case 2:u[1]=n[d+1],yn(u,8),wn(c,u);case 1:u[1]=n[d],wn(c,u),mn(c,Cn),bn(c,31),mn(c,kn),wn(a,c)}return wn(a,o),wn(s,o),gn(a,s),gn(s,a),Sn(a),Sn(s),gn(a,s),gn(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 Wn(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=ln(cn(i,n=>function(e,t){const n=ln(new Promise(n=>{const o=Date.now();sn(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();sn(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 h(this,null,function*(){const e=yield r,t=yield cn(e,e=>ln(e()),o),n=yield Promise.all(t),a={};for(let o=0;o<i.length;++o)a[i[o]]=n[o];return a})}}function _n(){const e=window,t=navigator;return pn(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function An(){const e=window,t=navigator;return pn(["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 Mn(){const e=window;return pn(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===navigator.vendor.indexOf("Apple"),"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function On(){const e=window,{HTMLElement:t,Document:n}=e;return pn(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function Pn(){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 pn(["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 Bn(){const{CSS:e}=window;return pn([e.supports("selector(::details-content)"),e.supports("selector(::before::marker)"),e.supports("selector(::after::marker)"),!("locale"in CompositionEvent.prototype)])>=3}function Fn(){const e=window,t=navigator,{CSS:n,HTMLButtonElement:o}=e;return pn([!("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 jn(){const e=An(),t=Rn(),n=window,o=navigator,i="connection";return e?pn([!("SharedWorker"in n),o[i]&&"ontypechange"in o[i],!("sinkId"in new Audio)])>=2:!!t&&pn(["onorientationchange"in n,"orientation"in n,/android/i.test(o.appVersion)])>=2}function Nn(e){const t=new Error(e);return t.name=e,t}function Vn(e,t,n=50){return h(this,null,function*(){var o,i,r;const a=document;for(;!a.body;)yield on(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 on(n);return yield e(s,s.contentWindow)}finally{null===(r=s.parentNode)||void 0===r||r.removeChild(s)}})}function Hn(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?Zn(o.style,e):o.setAttribute(i,e)}return o}function Zn(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 Dn=["monospace","sans-serif","serif"],Gn=["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 zn(e){return e.toDataURL()}let $n,Yn;function Xn(){return function(){if(void 0!==Yn)return;const e=()=>{const t=Jn();Kn(t)?Yn=setTimeout(e,2500):($n=t,Yn=void 0)};e()}(),()=>h(null,null,function*(){let e=Jn();if(Kn(e)){if($n)return[...$n];(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=Jn())}return Kn(e)||($n=e),e})}function Jn(){const e=screen;return[fn(un(e.availTop),null),fn(un(e.width)-un(e.availWidth)-fn(un(e.availLeft),0),null),fn(un(e.height)-un(e.availHeight)-fn(un(e.availTop),0),null),fn(un(e.availLeft),null)]}function Kn(e){for(let t=0;t<4;++t)if(e[t])return!1;return!0}function Un(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function qn(e){return matchMedia(`(inverted-colors: ${e})`).matches}function Qn(e){return matchMedia(`(forced-colors: ${e})`).matches}function eo(e){return matchMedia(`(prefers-contrast: ${e})`).matches}function to(e){return matchMedia(`(prefers-reduced-motion: ${e})`).matches}function no(e){return matchMedia(`(prefers-reduced-transparency: ${e})`).matches}function oo(e){return matchMedia(`(dynamic-range: ${e})`).matches}const io=Math,ro=()=>0;const ao="mmMwWLliI0fiflO&1",so={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function co(e){const t=jn()?0:3,n=Math.pow(10,t);return Math.floor(e*n)/n}const lo=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 uo=/* @__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]),fo=/* @__PURE__ */new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),po=["FRAGMENT_SHADER","VERTEX_SHADER"],ho=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],go="WEBGL_debug_renderer_info";function mo(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 bo(e,t,n){const o=e.getShaderPrecisionFormat(e[t],e[n]);return o?[o.rangeMin,o.rangeMax,o.precision]:[]}function yo(e){return Object.keys(e.__proto__).filter(wo)}function wo(e){return"string"==typeof e&&!e.match(/[^A-Z0-9_x]/)}function vo(){return Rn()}function xo(){return An()||Mn()}function So(e){return"function"==typeof e.getParameter}const Co={userAgentData:function(){return h(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 Vn((e,t)=>h(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=Dn.map(a),l=(()=>{const e={};for(const t of Gn)e[t]=Dn.map(e=>s(t,e));return e})();n.appendChild(o);for(let d=0;d<Dn.length;d++)i[Dn[d]]=c[d].offsetWidth,r[Dn[d]]=c[d].offsetHeight;return Gn.filter(e=>{return t=l[e],Dn.some((e,n)=>t[n].offsetWidth!==i[e]||t[n].offsetHeight!==r[e]);var t})}))},domBlockers:function(){return h(this,arguments,function*({debug:e}={}){if(!Mn()&&!jn())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 h(this,null,function*(){var t;const n=document,o=n.createElement("div"),i=new Array(e.length),r={};Un(o);for(let a=0;a<e.length;++a){const t=Hn(e[a]);"DIALOG"===t.tagName&&t.show();const r=n.createElement("div");Un(r),r.appendChild(t),o.appendChild(r),i[a]=t}for(;!n.body;)yield on(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 pn(n.map(e=>i[e]))>.6*n.length});return r.sort(),r})},fontPreferences:function(){return function(e,t=4e3){return Vn((n,o)=>{const i=o.document,r=i.body,a=r.style;a.width=`${t}px`,a.webkitTextSizeAdjust=a.textSizeAdjust="none",An()?r.style.zoom=""+1/o.devicePixelRatio:Mn()&&(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(so)){const[n={},i=ao]=so[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=An()&&function(){const e=window,t=document,{CSS:n,Promise:o,AudioContext:i}=e;return pn([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(so)){const e=o[a].getBoundingClientRect().width;i[a]=r?co(e*n.devicePixelRatio):e}return i})},audio:function(){return Mn()&&Fn()&&Pn()||An()&&function(){const e=navigator,t=window,n=Audio.prototype,{visualViewport:o}=t;return pn(["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 pn(["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(Mn()&&!On()&&!function(){const e=window;return pn(["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(Nn("timeout")),Math.min(o,d+i-Date.now()))},f=()=>{try{const o=e.startRendering();switch(an(o)&&ln(o),e.state){case"running":d=Date.now(),c&&u();break;case"suspended":document.hidden||l++,c&&l>=t?s(Nn("suspended")):setTimeout(f,n)}}catch(o){s(o)}};f(),r=()=>{c||(c=!0,d>0&&u())}});return[a,r]}(o),c=ln(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=Mn()&&Fn()&&Pn(),t=Rn()&&Bn();if(e||t)return()=>Promise.resolve(void 0);const n=Xn();return()=>h(null,null,function*(){const e=yield n(),t=e=>null===e?null:hn(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=zn(e),o=zn(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=zn(e);return[i,n]}(i,r));return{winding:o,geometry:t,text:n}}(function(){const e=Mn()&&Fn()&&Pn(),t=Rn()&&function(){const e=window,t=navigator,{CSS:n}=e;return pn(["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))An()&&function(){const e=window;return pn([!("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 fn(un(navigator.deviceMemory),void 0)},screenResolution:function(){if(!(Mn()&&Fn()&&Pn()))return function(){const e=screen,t=e=>fn(dn(e),null),n=[t(e.width),t(e.height)];return n.sort().reverse(),n}()},hardwareConcurrency:function(){const e=fn(dn(navigator.hardwareConcurrency),void 0);return void 0!==e&&Rn()&&Bn()?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(un(new Date(e,0,1).getTimezoneOffset()),un(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(!_n()&&!function(){const e=window,t=navigator;return pn(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!_n()}())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&&Mn()&&!On()?function(){if("iPad"===navigator.platform)return!0;const e=screen,t=e.width/e.height;return pn(["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=dn(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!!qn("inverted")||!qn("none")&&void 0},forcedColors:function(){return!!Qn("active")||!Qn("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 eo("no-preference")?0:eo("high")||eo("more")?1:eo("low")||eo("less")?-1:eo("forced")?10:void 0},reducedMotion:function(){return!!to("reduce")||!to("no-preference")&&void 0},reducedTransparency:function(){return!!no("reduce")||!no("no-preference")&&void 0},hdr:function(){return!!oo("high")||!oo("standard")&&void 0},math:function(){const e=io.acos||ro,t=io.acosh||ro,n=io.asin||ro,o=io.asinh||ro,i=io.atanh||ro,r=io.atan||ro,a=io.sin||ro,s=io.sinh||ro,c=io.cos||ro,l=io.cosh||ro,d=io.tan||ro,u=io.tanh||ro,f=io.exp||ro,p=io.expm1||ro,h=io.log1p||ro;return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:(g=1e154,io.log(g+io.sqrt(g*g-1))),asin:n(.12312423423423424),asinh:o(1),asinhPf:(e=>io.log(e+io.sqrt(e*e+1)))(1),atanh:i(.5),atanhPf:(e=>io.log((1+e)/(1-e))/2)(.5),atan:r(.5),sin:a(-1e300),sinh:s(1),sinhPf:(e=>io.exp(e)-1/io.exp(e)/2)(1),cos:c(10.000000000123),cosh:l(1),coshPf:(e=>(io.exp(e)+1/io.exp(e))/2)(1),tan:d(-1e300),tanh:u(1),tanhPf:(e=>(io.exp(2*e)-1)/(io.exp(2*e)+1))(1),exp:f(1),expm1:p(1),expm1Pf:(e=>io.exp(e)-1)(1),log1p:h(10),log1pPf:(e=>io.log(1+e))(10),powPI:(e=>io.pow(io.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(lo())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(!(jn()||Mn()))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=mo(e);if(!s)return-1;if(!So(s))return-2;const c=vo()?null:s.getExtension(go);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=mo(e);if(!t)return-1;if(!So(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=yo(t);for(const d of l){const e=t[d];a.push(`${d}=${e}${uo.has(e)?`=${t.getParameter(e)}`:""}`)}if(n)for(const d of n){if(d===go&&vo()||"WEBGL_polygon_mode"===d&&xo())continue;const e=t.getExtension(d);if(e)for(const n of yo(e)){const o=e[n];s.push(`${n}=${o}${fo.has(o)?`=${t.getParameter(o)}`:""}`)}else i.push(d)}for(const d of po)for(const e of ho){const n=bo(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 ko(e){const t=function(e){if(jn())return.4;if(Mn())return!On()||Fn()&&Pn()?.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 hn(.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 Eo(e){return JSON.stringify(e,(e,t)=>{return t instanceof Error?u({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 Io(e){return Tn(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 Lo(e=50){return function(e,t=1/0){const{requestIdleCallback:n}=window;return n?new Promise(e=>n.call(window,()=>e(),{timeout:t})):on(Math.min(e,t))}(e,2*e)}function To(e,t){const n=Date.now();return{get(o){return h(this,null,function*(){const i=Date.now(),r=yield e(),a=function(e){let t;const n=ko(e);return{get visitorId(){return void 0===t&&(t=Io(this.components)),t},set visitorId(e){t=e},confidence:n,components:e,version:nn}}(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: ${Eo(r)}\n\`\`\``),a})}}}var Wo={load:function(){return h(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${nn}/npm-monitoring`,!0),e.send()}catch(e){console.error(e)}}(),yield Lo(t);const i=function(e){return Wn(Co,e,[])}({cache:{},debug:n});return To(i,n)})},hashComponents:Io,componentsToDebugString:Eo};U(),function(){if(te||"undefined"==typeof window)return;te=!0;const e=window;let t=e.BrainfishAnalytics?ee(e.BrainfishAnalytics):void 0;try{Object.defineProperty(window,"BrainfishAnalytics",{configurable:!0,get:()=>t,set(e){t=e?ee(e):e}})}catch(n){e.BrainfishAnalytics&&(e.BrainfishAnalytics=ee(e.BrainfishAnalytics))}}();let _o=null;const Ao="undefined"!=typeof window&&window.Brainfish?window.Brainfish:(_o||(_o=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),clearSecretAttributes:()=>n("Widgets.clearSecretAttributes",[]),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=_o)),_o),Mo=/* @__PURE__ */new Map,Oo=/* @__PURE__ */new Map;let Po=!1;function Ro(e,t,n,o,i){return h(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);Oo.set(e.widgetKey,{options:e,config:t,apiHost:n,analyticsApiHost:o,fingerprint:i});const h=[];(null==p?void 0:p.startsWith("2."))?($t(e,t,i),Po||(Po=!0,tn(()=>{Oo.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."))&&$t(e,t,n)})}))):h.push(S(e,t)),h.push(L(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(Kt(n,e.widgetKey));const[g]=yield Promise.allSettled(h);g&&"fulfilled"===g.status&&g.value&&Ao._setRealBrainfish(g.value)})}Ao.Widgets.isReady=!1,Ao.Widgets.identify=e=>{"undefined"!=typeof window&&window.BrainfishAnalytics?window.BrainfishAnalytics("identify",e):Q(e)},Ao.Widgets.setSecretAttributes=e=>{H(e)},Ao.Widgets.clearSecretAttributes=()=>{!function(){var e;F=null;for(const{iframe:t,widgetHost:n}of O()){const o=M(t,n);null==(e=t.contentWindow)||e.postMessage({type:"CLEAR_SECRET_ATTRIBUTES"},o)}}()},Ao.Widgets.init=e=>h(null,null,function*(){window&&(window.BrainfishAnalytics=window.BrainfishAnalytics||function(...e){(window.BrainfishAnalytics.q=window.BrainfishAnalytics.q||[]).push(e)});const t=w(e.overrides),n=(null==(o=e.overrides)?void 0:o.analyticsApiHost)||"";var o;let i,r;try{const e=yield Wo.load();i=(yield e.get()).visitorId}catch(s){console.warn("[Brainfish] Error loading fingerprint:",s)}if(e.config)r=JSON.parse(W(e.config));else{const{config:n}=yield b({widgetKey:e.widgetKey,apiHost:t});r=n}let a=Mo.get(e.widgetKey);if(a||(a=Ro(e,r,t,n,i),Mo.set(e.widgetKey,a)),yield a,!kt.isWidgetDOMExisting(e.widgetKey,r)){Mo.delete(e.widgetKey);const o=Ro(e,r,t,n,i);Mo.set(e.widgetKey,o),yield o}yield Xt(r),Ao.Widgets.isReady=!0,window.dispatchEvent(new Event("onBrainfishReady"))}),Ao.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(W(r)));const s=u(u({},a),e);null==(t=n.contentWindow)||t.postMessage({type:"SET_THEME",theme:s},"*");const c=T(JSON.stringify(s));i.set("theme",c),o.hash=`#${i.toString()}`,n.src=o.toString()}},Ao.Widgets.registerClientActionHandler=(e,t)=>{((e,t)=>{Pt.set(e,t)})(e,t)};const Bo=(...e)=>{"undefined"!=typeof window&&window.BrainfishAnalytics&&window.BrainfishAnalytics(...e)};export{Bo as BrainfishAnalytics,Ao as default};
|
|
2
2
|
//# sourceMappingURL=web.js.map
|