@brainfish-ai/widgets-initiator 1.3.2-alpha.0 → 1.4.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,6 @@
1
+ import type { Config } from '@brainfish-ai/widgets-common';
2
+ export declare const TRIGGER_BUTTON_CLASS = "bf-trigger-button";
3
+ export declare const initIframeTrigger: (options: {
4
+ widgetKey: string;
5
+ overrides?: any;
6
+ }, config: Config) => undefined;
@@ -0,0 +1 @@
1
+ export declare function insertStyles(primaryColor?: string, foreground?: string): void;
@@ -0,0 +1 @@
1
+ export declare function createElementWithClass<K extends keyof HTMLElementTagNameMap>(tagName: K, className: string, attributes?: Record<string, string>): HTMLElementTagNameMap[K];
@@ -1,6 +1,9 @@
1
1
  export declare const getApiHost: (overrides?: {
2
2
  apiHost?: string;
3
3
  }) => string;
4
+ export declare const getWidgetHost: (overrides?: {
5
+ widgetHost?: string;
6
+ }) => string;
4
7
  export declare const getAnalyticsApiHost: (overrides?: {
5
8
  analyticsApiHost?: string;
6
9
  }) => string;
package/dist/web.cjs.js CHANGED
@@ -1,3 +1,165 @@
1
- "use strict";var j=Object.defineProperty,P=Object.defineProperties;var C=Object.getOwnPropertyDescriptors;var H=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var b=(t,n,r)=>n in t?j(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,v=(t,n)=>{for(var r in n||(n={}))I.call(n,r)&&b(t,r,n[r]);if(H)for(var r of H(n))N.call(n,r)&&b(t,r,n[r]);return t},A=(t,n)=>P(t,C(n));var W=(t,n,r)=>b(t,typeof n!="symbol"?n+"":n,r);var g=(t,n,r)=>new Promise((o,i)=>{var s=d=>{try{a(r.next(d))}catch(u){i(u)}},e=d=>{try{a(r.throw(d))}catch(u){i(u)}},a=d=>d.done?o(d.value):Promise.resolve(d.value).then(s,e);a((r=r.apply(t,n)).next())});var w,E;(function(){try{var t=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},n=new t.Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="64435ca6-5a6f-4165-b84d-904ca273045b",t._sentryDebugIdIdentifier="sentry-dbid-64435ca6-5a6f-4165-b84d-904ca273045b")}catch(r){}})(),Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),(typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{}).SENTRY_RELEASE={id:"f1b3472b67ed59854ba4be50f86981500ee3e188"},function(t){t.Sidebar="sidebar",t.Searchbar="searchbar"}(w||(w={})),w.Sidebar,w.Searchbar;class K extends Error{constructor(r,o){super(r,o);W(this,"cause");this.name="BrainfishWidgetError",this.cause=o==null?void 0:o.cause,Error.captureStackTrace&&Error.captureStackTrace(this,K),this.cause instanceof Error&&this.cause.stack&&(this.stack=this.stack+`
2
- Caused 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}}}(function(t){t.LINK="link",t.CALLBACK="callback",t.EMAIL="email",t.PHONE="phone"})(E||(E={}));const h=(t,n,r,o)=>{let i=r,s={};if(n instanceof Error)try{s=JSON.parse(n.message),i+=` - ${s.message||n.message}`}catch(e){i+=` - ${n.message}`}else i+=` - ${String(n)}`;((e,a,d)=>{if(!navigator||navigator.userAgent.toLowerCase().includes("headless"))return;const u=a.toJSON();fetch(`${e||"https://app.brainfi.sh"}/api/trackError.widget.create`,{method:"POST",headers:{"Content-Type":"application/json","api-key":d},body:JSON.stringify({error:`WebWidgetVersion: 1.3.2-alpha.0. ${a.message}`,stack:a.stack,cause:{message:u.message,stack:u.stack,cause:u.cause}})})})(t,new K(i,{cause:s}),o)},L=t=>g(exports,null,function*(){let{widgetKey:n,apiHost:r}=t;return function(o,i,s){return g(this,null,function*(){return fetch(`${o}${i}`,{method:"POST",headers:{"Content-Type":"application/json","api-key":s}}).then(e=>{if(!e.ok)throw new Error(`API call failed with status: ${e.status}`);return e.json()}).then(e=>{if(!e)throw new Error("Error loading config: empty response");return e}).catch(e=>{h(o,e,"Error fetching config",s)})})}(r,"/api/searchWidgets.getConfigByKey",n)}),_=t=>{let{config:n,apiKey:r,apiHost:o}=t;const i=n.settings||{};return["bodyActionButtons","footerActionButtons","nextBestActions"].forEach(s=>{i[s]&&(i[s]=i[s].map(e=>e.type===E.CALLBACK&&e.value?A(v({},e),{value:new Function(`return ${e.value}`)()}):e))}),A(v({},n),{settings:i,apiHost:o,widgetMode:n.widgetType,apiKey:r})},$=t=>(t==null?void 0:t.apiHost)||"https://app.brainfi.sh",k=(()=>{if(typeof window=="undefined")return;const t=window.navigator.userAgent;if(!(t.match(/iPad/i)||t.match(/iPhone/i)))return!1;const n=t.match(/OS (\d+)_/i);return n&&parseInt(n[1],10)<=14})(),R=t=>g(exports,null,function*(){let{apiHost:n,widgetKey:r,version:o}=t;try{const i=`https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${o}/dist/web.js`,s=k?i.replace("web.js","web.umd.js"):i;return{widget:yield(a=>g(exports,null,function*(){return document.getElementById("brainfish-widget")?window.Brainfish:new Promise((d,u)=>{const c=document.createElement("script");c.id="brainfish-widget",c.src=a,c.type=k?"text/javascript":"module",c.async=!0,c.crossOrigin="anonymous",c.onload=()=>{setTimeout(()=>{const l=window.Brainfish;l?d(l):u(new Error("Failed to load Brainfish module"))},200)},c.onerror=l=>{const f=l,y={message:`Failed to load script: ${a}`,type:f.type,fileName:f.filename,lineNumber:f.lineno,columnNumber:f.colno,error:f.error?f.error.toString():"Unknown error"};u(new Error(JSON.stringify(y)))},k||document.head.appendChild(c)})}))(s)}}catch(i){h(n,i,i.message,r)}}),O=new Set,F=(t,n)=>g(exports,null,function*(){const r=$(t.overrides);try{if(O.has(t.widgetKey))return;const o=yield R({apiHost:r,widgetKey:t.widgetKey,version:n.version||"latest"});if(o){const{widget:i}=o,s=_({config:n,apiKey:t.widgetKey,apiHost:r});return t.overrides&&n.settings&&Object.entries(t.overrides).forEach(e=>{let[a,d]=e;n.settings&&a in n.settings&&(n.settings[a]=function(){let u=arguments.length>1?arguments[1]:void 0;const c=new Map((arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).map(l=>[l.label,l]));return u.forEach(l=>c.set(l.label,l)),Array.from(c.values())}(n.settings[a],d))}),function(e,a){a.widgetType===w.Searchbar||a.widgetType==="Search"?e.SearchWidget.initStandard(a):e.HelpWidget.initPopup(a)}(i,s),O.add(t.widgetKey),i}}catch(o){h(r,o,o.message,t.widgetKey)}});let T=!1;const J=function(o,i,s){return g(this,arguments,function*(t,n,r){let e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:void 0,a=arguments.length>4&&arguments[4]!==void 0&&arguments[4];if(n||h(r,new Error("Access key is required"),"Access key is required",t),!T)try{window.BrainfishAnalytics("init",{apiUrl:e,accessKey:n,trackScreenViews:!0,trackAttributes:!0,trackOutgoingLinks:!0,enableRecording:a}),T=!0,yield((d,u)=>g(this,null,function*(){if(document.getElementById("brainfish-analytics"))return window.BrainfishAnalytics;const c=document.createElement("script");c.id="brainfish-analytics",c.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/web-tracker@latest/dist/tracker.js",c.type="module",c.async=!0,c.crossOrigin="anonymous",c.onerror=()=>{h(d,new Error(`Failed to load script: ${c.src}`),`Failed to load script: ${c.src}`,u)},document.head.appendChild(c)}))(r,t)}catch(d){h(r,d,"Failed to initialize BrainfishAnalytics",t)}})};let p=null;const B=typeof window!="undefined"&&window.Brainfish?window.Brainfish:(p||(p=function(){let t=[],n=null;function r(i,s){if(n){const e=i.split(".");let a=n;for(let u=0;u<e.length-1;u++)a=a[e[u]];const d=a[e[e.length-1]];if(typeof d=="function")return d.apply(a,s)}else t.push([i,s])}return{Widgets:{init:function(){for(var i=arguments.length,s=new Array(i),e=0;e<i;e++)s[e]=arguments[e];return r("Widgets.init",s)}},SearchWidget:{initStandard:function(){for(var i=arguments.length,s=new Array(i),e=0;e<i;e++)s[e]=arguments[e];return r("SearchWidget.initStandard",s)}},HelpWidget:{initPopup:function(){for(var i=arguments.length,s=new Array(i),e=0;e<i;e++)s[e]=arguments[e];return r("HelpWidget.initPopup",s)},close:function(){for(var i=arguments.length,s=new Array(i),e=0;e<i;e++)s[e]=arguments[e];return r("HelpWidget.close",s)},open:function(){for(var i=arguments.length,s=new Array(i),e=0;e<i;e++)s[e]=arguments[e];return r("HelpWidget.open",s)},toggle:function(){for(var i=arguments.length,s=new Array(i),e=0;e<i;e++)s[e]=arguments[e];return r("HelpWidget.toggle",s)}},_setRealBrainfish:function(i){for(n=i;t.length>0;){const[s,e]=t.shift();r(s,e)}}}}(),typeof window!="undefined"&&(window.Brainfish=p)),p);let S=null;B.Widgets.init=t=>g(exports,null,function*(){window&&(window.BrainfishAnalytics=window.BrainfishAnalytics||function(){for(var s=arguments.length,e=new Array(s),a=0;a<s;a++)e[a]=arguments[a];(window.BrainfishAnalytics.q=window.BrainfishAnalytics.q||[]).push(e)});const n=$(t.overrides),r=((o=t.overrides)==null?void 0:o.analyticsApiHost)||void 0;var o;const{config:i}=yield L({widgetKey:t.widgetKey,apiHost:n});S||(S=function(s,e,a,d){return g(this,null,function*(){var u,c,l;const f=((u=s.overrides)===null||u===void 0?void 0:u.enableRecording)||(e==null||(c=e.settings)===null||c===void 0?void 0:c.enableRecording)||!1,y=[F(s,e)];e!=null&&(l=e.settings)!==null&&l!==void 0&&l.enableTracking&&y.push(J(s.widgetKey,e.trackingToken||"",a,d,f));const[m]=yield Promise.allSettled(y);m.status==="fulfilled"&&m.value&&B._setRealBrainfish(m.value)})}(t,i,n,r)),yield S});exports.BrainfishAnalytics=function(){typeof window!="undefined"&&window.BrainfishAnalytics&&window.BrainfishAnalytics(...arguments)},exports.default=B;
1
+ "use strict";var Pe=Object.defineProperty,Ie=Object.defineProperties;var Fe=Object.getOwnPropertyDescriptors;var fe=Object.getOwnPropertySymbols;var Oe=Object.prototype.hasOwnProperty,Be=Object.prototype.propertyIsEnumerable;var I=(a,t,r)=>t in a?Pe(a,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[t]=r,F=(a,t)=>{for(var r in t||(t={}))Oe.call(t,r)&&I(a,r,t[r]);if(fe)for(var r of fe(t))Be.call(t,r)&&I(a,r,t[r]);return a},O=(a,t)=>Ie(a,Fe(t));var ce=(a,t,r)=>I(a,typeof t!="symbol"?t+"":t,r);var b=(a,t,r)=>new Promise((l,o)=>{var n=s=>{try{d(r.next(s))}catch(i){o(i)}},e=s=>{try{d(r.throw(s))}catch(i){o(i)}},d=s=>s.done?l(s.value):Promise.resolve(s.value).then(n,e);d((r=r.apply(a,t)).next())});var _,T;(function(){try{var a=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="00753c88-7c3e-46d2-ac79-4759af0e04e3",a._sentryDebugIdIdentifier="sentry-dbid-00753c88-7c3e-46d2-ac79-4759af0e04e3")}catch(r){}})(),Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),(typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{}).SENTRY_RELEASE={id:"fc6c9a05ea3bac86a978016fde6cf7b778d63a4a"},function(a){a.Sidebar="sidebar",a.Searchbar="searchbar"}(_||(_={})),_.Sidebar,_.Searchbar;class ae extends Error{constructor(r,l){super(r,l);ce(this,"cause");this.name="BrainfishWidgetError",this.cause=l==null?void 0:l.cause,Error.captureStackTrace&&Error.captureStackTrace(this,ae),this.cause instanceof Error&&this.cause.stack&&(this.stack=this.stack+`
2
+ Caused 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}}}(function(a){a.LINK="link",a.CALLBACK="callback",a.EMAIL="email",a.PHONE="phone"})(T||(T={}));const w=(a,t,r,l)=>{let o=r,n={};if(t instanceof Error)try{n=JSON.parse(t.message),o+=` - ${n.message||t.message}`}catch(e){o+=` - ${t.message}`}else o+=` - ${String(t)}`;((e,d,s)=>{if(!navigator||navigator.userAgent.toLowerCase().includes("headless"))return;const i=d.toJSON();fetch(`${e||"https://app.brainfi.sh"}/api/trackError.widget.create`,{method:"POST",headers:{"Content-Type":"application/json","api-key":s},body:JSON.stringify({error:`WebWidgetVersion: 1.4.0-alpha.0. ${d.message}`,stack:d.stack,cause:{message:i.message,stack:i.stack,cause:i.cause}})})})(a,new ae(o,{cause:n}),l)},Le=a=>b(exports,null,function*(){let{widgetKey:t,apiHost:r}=a;return function(l,o,n){return b(this,null,function*(){let e,d=0;for(;d<3;)try{const s=yield fetch(`${l}${o}`,{method:"POST",headers:{"Content-Type":"application/json","api-key":n}});if(!s.ok)throw new Error(`API call failed with status: ${s.status}`);const i=yield s.json();if(!i)throw new Error("Error loading config: empty response");return i}catch(s){if(e=s,d++,d>=3)throw w(l,s,"Error fetching config",n),e;yield new Promise(i=>setTimeout(i,500))}})}(r,"/api/searchWidgets.getConfigByKey",t)}),Te=a=>{let{config:t,apiKey:r,apiHost:l}=a;const o=t.settings||{};return["bodyActionButtons","footerActionButtons","nextBestActions"].forEach(n=>{o[n]&&(o[n]=o[n].map(e=>e.type===T.CALLBACK&&e.value?O(F({},e),{value:new Function(`return ${e.value}`)()}):e))}),O(F({},t),{settings:o,apiHost:l,widgetMode:t.widgetType,apiKey:r})},oe=a=>(a==null?void 0:a.apiHost)||"https://app.brainfi.sh",B=(()=>{if(typeof window=="undefined")return;const a=window.navigator.userAgent;if(!(a.match(/iPad/i)||a.match(/iPhone/i)))return!1;const t=a.match(/OS (\d+)_/i);return t&&parseInt(t[1],10)<=14})(),$e=a=>b(exports,null,function*(){let{apiHost:t,widgetKey:r,version:l}=a;try{const o=`https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${l}/dist/web.js`,n=B?o.replace("web.js","web.umd.js"):o;return{widget:yield(d=>b(exports,null,function*(){return document.getElementById("brainfish-widget")?window.Brainfish:new Promise((s,i)=>{const u=document.createElement("script");u.id="brainfish-widget",u.src=d,u.type=B?"text/javascript":"module",u.async=!0,u.crossOrigin="anonymous",u.onload=()=>{setTimeout(()=>{const c=window.Brainfish;c?s(c):i(new Error("Failed to load Brainfish module"))},200)},u.onerror=c=>{const f=c,h={message:`Failed to load script: ${d}`,type:f.type,fileName:f.filename,lineNumber:f.lineno,columnNumber:f.colno,error:f.error?f.error.toString():"Unknown error"};i(new Error(JSON.stringify(h)))},B||document.head.appendChild(u)})}))(n)}}catch(o){w(t,o,o.message,r)}}),pe=new Set,Ke=(a,t)=>b(exports,null,function*(){const r=oe(a.overrides);try{if(pe.has(a.widgetKey))return;const l=yield $e({apiHost:r,widgetKey:a.widgetKey,version:t.version||"latest"});if(l){const{widget:o}=l,n=Te({config:t,apiKey:a.widgetKey,apiHost:r});return a.overrides&&t.settings&&Object.entries(a.overrides).forEach(e=>{let[d,s]=e;t.settings&&d in t.settings&&(t.settings[d]=function(){let i=arguments.length>1?arguments[1]:void 0;const u=new Map((arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).map(c=>[c.label,c]));return i.forEach(c=>u.set(c.label,c)),Array.from(u.values())}(t.settings[d],s))}),function(e,d){d.widgetType===_.Searchbar||d.widgetType==="Search"?e.SearchWidget.initStandard(d):e.HelpWidget.initPopup(d)}(o,n),pe.add(a.widgetKey),o}}catch(l){w(r,l,l.message,a.widgetKey)}});let ge=!1;const He=function(l,o,n){return b(this,arguments,function*(a,t,r){let e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:void 0,d=arguments.length>4&&arguments[4]!==void 0&&arguments[4];if(t||w(r,new Error("Access key is required"),"Access key is required",a),!ge)try{window.BrainfishAnalytics("init",{apiUrl:e,accessKey:t,trackScreenViews:!0,trackAttributes:!0,trackOutgoingLinks:!0,enableRecording:d}),ge=!0,yield((s,i)=>b(this,null,function*(){if(document.getElementById("brainfish-analytics"))return window.BrainfishAnalytics;const u=document.createElement("script");u.id="brainfish-analytics",u.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/web-tracker@latest/dist/tracker.js",u.type="module",u.async=!0,u.crossOrigin="anonymous",u.onerror=()=>{w(s,new Error(`Failed to load script: ${u.src}`),`Failed to load script: ${u.src}`,i)},document.head.appendChild(u)}))(r,a)}catch(s){w(r,s,"Failed to initialize BrainfishAnalytics",a)}})};function P(a,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const l=document.createElement(a);return l.className=t,Object.entries(r).forEach(o=>{let[n,e]=o;l.setAttribute(n,e)}),l}function se(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var $={exports:{}},K={exports:{}},H={exports:{}};(function(a,t){function r(o){return Math.round(255*o)}function l(o,n,e){return r(o)+","+r(n)+","+r(e)}t.__esModule=!0,t.default=void 0,t.default=function(o,n,e,d){if(d===void 0&&(d=l),n===0)return d(e,e,e);var s=(o%360+360)%360/60,i=(1-Math.abs(2*e-1))*n,u=i*(1-Math.abs(s%2-1)),c=0,f=0,h=0;s>=0&&s<1?(c=i,f=u):s>=1&&s<2?(c=u,f=i):s>=2&&s<3?(f=i,h=u):s>=3&&s<4?(f=u,h=i):s>=4&&s<5?(c=u,h=i):s>=5&&s<6&&(c=i,h=u);var g=e-i/2;return d(c+g,f+g,h+g)},a.exports=t.default})(H,H.exports);var ie=H.exports,q={exports:{}};(function(a,t){t.__esModule=!0,t.default=void 0;var r={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(l){if(typeof l!="string")return l;var o=l.toLowerCase();return r[o]?"#"+r[o]:l},a.exports=t.default})(q,q.exports);var qe=q.exports,z={exports:{}};(function(a,t){function r(s){var i=typeof Map=="function"?new Map:void 0;return r=function(u){if(u===null||!function(f){try{return Function.toString.call(f).indexOf("[native code]")!==-1}catch(h){return typeof f=="function"}}(u))return u;if(typeof u!="function")throw new TypeError("Super expression must either be null or a function");if(i!==void 0){if(i.has(u))return i.get(u);i.set(u,c)}function c(){return function(f,h,g){if(l())return Reflect.construct.apply(null,arguments);var p=[null];p.push.apply(p,h);var m=new(f.bind.apply(f,p));return g&&o(m,g.prototype),m}(u,arguments,n(this).constructor)}return c.prototype=Object.create(u.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),o(c,u)},r(s)}function l(){try{var s=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(i){}return(l=function(){return!!s})()}function o(s,i){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(u,c){return u.__proto__=c,u},o(s,i)}function n(s){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)},n(s)}t.__esModule=!0,t.default=void 0;var e={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 }).
3
+
4
+ `,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 }).
5
+
6
+ `,3:`Passed an incorrect argument to a color function, please pass a string representation of a color.
7
+
8
+ `,4:`Couldn't generate valid rgb string from %s, it returned %s.
9
+
10
+ `,5:`Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.
11
+
12
+ `,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 }).
13
+
14
+ `,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 }).
15
+
16
+ `,8:`Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.
17
+
18
+ `,9:`Please provide a number of steps to the modularScale helper.
19
+
20
+ `,10:`Please pass a number or one of the predefined scales to the modularScale helper as the ratio.
21
+
22
+ `,11:`Invalid value passed as base to modularScale, expected number or em string but got "%s"
23
+
24
+ `,12:`Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.
25
+
26
+ `,13:`Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.
27
+
28
+ `,14:`Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.
29
+
30
+ `,15:`Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.
31
+
32
+ `,16:`You must provide a template to this method.
33
+
34
+ `,17:`You passed an unsupported selector state to this method.
35
+
36
+ `,18:`minScreen and maxScreen must be provided as stringified numbers with the same units.
37
+
38
+ `,19:`fromSize and toSize must be provided as stringified numbers with the same units.
39
+
40
+ `,20:`expects either an array of objects or a single object with the properties prop, fromSize, and toSize.
41
+
42
+ `,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.
43
+
44
+ `,24:`fontFace expects either the path to the font file(s) or a name of a local copy.
45
+
46
+ `,25:`fontFace expects localFonts to be an array.
47
+
48
+ `,26:`fontFace expects fileFormats to be an array.
49
+
50
+ `,27:`radialGradient requries at least 2 color-stops to properly render.
51
+
52
+ `,28:`Please supply a filename to retinaImage() as the first argument.
53
+
54
+ `,29:`Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.
55
+
56
+ `,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
57
+
58
+ `,32:`To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])
59
+ To pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')
60
+
61
+ `,33:`The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation
62
+
63
+ `,34:`borderRadius expects a radius value as a string or number as the second argument.
64
+
65
+ `,35:`borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.
66
+
67
+ `,36:`Property must be a string value.
68
+
69
+ `,37:`Syntax Error at %s.
70
+
71
+ `,38:`Formula contains a function that needs parentheses at %s.
72
+
73
+ `,39:`Formula is missing closing parenthesis at %s.
74
+
75
+ `,40:`Formula has too many closing parentheses at %s.
76
+
77
+ `,41:`All values in a formula must have the same unit or be unitless.
78
+
79
+ `,42:`Please provide a number of steps to the modularScale helper.
80
+
81
+ `,43:`Please pass a number or one of the predefined scales to the modularScale helper as the ratio.
82
+
83
+ `,44:`Invalid value passed as base to modularScale, expected number or em/rem string but got %s.
84
+
85
+ `,45:`Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.
86
+
87
+ `,46:`Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.
88
+
89
+ `,47:`minScreen and maxScreen must be provided as stringified numbers with the same units.
90
+
91
+ `,48:`fromSize and toSize must be provided as stringified numbers with the same units.
92
+
93
+ `,49:`Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.
94
+
95
+ `,50:`Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.
96
+
97
+ `,51:`Expects the first argument object to have the properties prop, fromSize, and toSize.
98
+
99
+ `,52:`fontFace expects either the path to the font file(s) or a name of a local copy.
100
+
101
+ `,53:`fontFace expects localFonts to be an array.
102
+
103
+ `,54:`fontFace expects fileFormats to be an array.
104
+
105
+ `,55:`fontFace expects a name of a font-family.
106
+
107
+ `,56:`linearGradient requries at least 2 color-stops to properly render.
108
+
109
+ `,57:`radialGradient requries at least 2 color-stops to properly render.
110
+
111
+ `,58:`Please supply a filename to retinaImage() as the first argument.
112
+
113
+ `,59:`Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.
114
+
115
+ `,60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:`Property must be a string value.
116
+
117
+ `,62:`borderRadius expects a radius value as a string or number as the second argument.
118
+
119
+ `,63:`borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.
120
+
121
+ `,64:`The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.
122
+
123
+ `,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').
124
+
125
+ `,66:`The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.
126
+
127
+ `,67:`You must provide a template to this method.
128
+
129
+ `,68:`You passed an unsupported selector state to this method.
130
+
131
+ `,69:`Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.
132
+
133
+ `,70:`Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.
134
+
135
+ `,71:`Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.
136
+
137
+ `,72:`Passed invalid base value %s to %s(), please pass a value like "12px" or 12.
138
+
139
+ `,73:`Please provide a valid CSS variable.
140
+
141
+ `,74:`CSS variable not found and no default was provided.
142
+
143
+ `,75:`important requires a valid style object, got a %s instead.
144
+
145
+ `,76:`fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.
146
+
147
+ `,77:`remToPx expects a value in "rem" but you provided it in "%s".
148
+
149
+ `,78:`base must be set in "px" or "%" but you set it in "%s".
150
+ `};function d(){for(var s=arguments.length,i=new Array(s),u=0;u<s;u++)i[u]=arguments[u];var c,f=i[0],h=[];for(c=1;c<i.length;c+=1)h.push(i[c]);return h.forEach(function(g){f=f.replace(/%[a-z]/,g)}),f}t.default=function(s){var i,u;function c(f){var h;if(process.env.NODE_ENV==="production")h=s.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+f+" for more information.")||this;else{for(var g=arguments.length,p=new Array(g>1?g-1:0),m=1;m<g;m++)p[m-1]=arguments[m];h=s.call(this,d.apply(void 0,[e[f]].concat(p)))||this}return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(h)}return u=s,(i=c).prototype=Object.create(u.prototype),i.prototype.constructor=i,o(i,u),c}(r(Error)),a.exports=t.default})(z,z.exports);var x=z.exports;(function(a,t){t.__esModule=!0,t.default=function(g){if(typeof g!="string")throw new o.default(3);var p=(0,l.default)(g);if(p.match(e))return{red:parseInt(""+p[1]+p[2],16),green:parseInt(""+p[3]+p[4],16),blue:parseInt(""+p[5]+p[6],16)};if(p.match(d)){var m=parseFloat((parseInt(""+p[7]+p[8],16)/255).toFixed(2));return{red:parseInt(""+p[1]+p[2],16),green:parseInt(""+p[3]+p[4],16),blue:parseInt(""+p[5]+p[6],16),alpha:m}}if(p.match(s))return{red:parseInt(""+p[1]+p[1],16),green:parseInt(""+p[2]+p[2],16),blue:parseInt(""+p[3]+p[3],16)};if(p.match(i)){var k=parseFloat((parseInt(""+p[4]+p[4],16)/255).toFixed(2));return{red:parseInt(""+p[1]+p[1],16),green:parseInt(""+p[2]+p[2],16),blue:parseInt(""+p[3]+p[3],16),alpha:k}}var C=u.exec(p);if(C)return{red:parseInt(""+C[1],10),green:parseInt(""+C[2],10),blue:parseInt(""+C[3],10)};var v=c.exec(p.substring(0,50));if(v)return{red:parseInt(""+v[1],10),green:parseInt(""+v[2],10),blue:parseInt(""+v[3],10),alpha:parseFloat(""+v[4])>1?parseFloat(""+v[4])/100:parseFloat(""+v[4])};var E=f.exec(p);if(E){var ke=parseInt(""+E[1],10),Ce=parseInt(""+E[2],10)/100,Ee=parseInt(""+E[3],10)/100,ue="rgb("+(0,r.default)(ke,Ce,Ee)+")",A=u.exec(ue);if(!A)throw new o.default(4,p,ue);return{red:parseInt(""+A[1],10),green:parseInt(""+A[2],10),blue:parseInt(""+A[3],10)}}var y=h.exec(p.substring(0,50));if(y){var Ae=parseInt(""+y[1],10),Me=parseInt(""+y[2],10)/100,je=parseInt(""+y[3],10)/100,de="rgb("+(0,r.default)(Ae,Me,je)+")",M=u.exec(de);if(!M)throw new o.default(4,p,de);return{red:parseInt(""+M[1],10),green:parseInt(""+M[2],10),blue:parseInt(""+M[3],10),alpha:parseFloat(""+y[4])>1?parseFloat(""+y[4])/100:parseFloat(""+y[4])}}throw new o.default(5)};var r=n(ie),l=n(qe),o=n(x);function n(g){return g&&g.__esModule?g:{default:g}}var e=/^#[a-fA-F0-9]{6}$/,d=/^#[a-fA-F0-9]{8}$/,s=/^#[a-fA-F0-9]{3}$/,i=/^#[a-fA-F0-9]{4}$/,u=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,c=/^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,h=/^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;a.exports=t.default})(K,K.exports);var le=K.exports;(function(a,t){t.__esModule=!0,t.default=function(o){if(o==="transparent")return 0;var n=(0,l.default)(o),e=Object.keys(n).map(function(u){var c=n[u]/255;return c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4)}),d=e[0],s=e[1],i=e[2];return parseFloat((.2126*d+.7152*s+.0722*i).toFixed(3))};var r,l=(r=le)&&r.__esModule?r:{default:r};a.exports=t.default})($,$.exports);const ze=se($.exports);var R={exports:{}},W={exports:{}};(function(a,t){function r(l,o,n){return function(){var e=n.concat(Array.prototype.slice.call(arguments));return e.length>=o?l.apply(this,e):r(l,o,e)}}t.__esModule=!0,t.default=function(l){return r(l,l.length,[])},a.exports=t.default})(W,W.exports);var me=W.exports,N={exports:{}};(function(a,t){t.__esModule=!0,t.default=void 0,t.default=function(r,l,o){return Math.max(r,Math.min(l,o))},a.exports=t.default})(N,N.exports);var be=N.exports,D={exports:{}},Y={exports:{}};(function(a,t){t.__esModule=!0,t.default=void 0,t.default=function(r){var l,o=r.red/255,n=r.green/255,e=r.blue/255,d=Math.max(o,n,e),s=Math.min(o,n,e),i=(d+s)/2;if(d===s)return r.alpha!==void 0?{hue:0,saturation:0,lightness:i,alpha:r.alpha}:{hue:0,saturation:0,lightness:i};var u=d-s,c=i>.5?u/(2-d-s):u/(d+s);switch(d){case o:l=(n-e)/u+(n<e?6:0);break;case n:l=(e-o)/u+2;break;default:l=(o-n)/u+4}return l*=60,r.alpha!==void 0?{hue:l,saturation:c,lightness:i,alpha:r.alpha}:{hue:l,saturation:c,lightness:i}},a.exports=t.default})(Y,Y.exports);var Re=Y.exports;(function(a,t){t.__esModule=!0,t.default=function(n){return(0,l.default)((0,r.default)(n))};var r=o(le),l=o(Re);function o(n){return n&&n.__esModule?n:{default:n}}a.exports=t.default})(D,D.exports);var ve=D.exports,G={exports:{}},J={exports:{}},Z={exports:{}},V={exports:{}};(function(a,t){t.__esModule=!0,t.default=void 0,t.default=function(r){return r.length===7&&r[1]===r[2]&&r[3]===r[4]&&r[5]===r[6]?"#"+r[1]+r[3]+r[5]:r},a.exports=t.default})(V,V.exports);var ye=V.exports,U={exports:{}};(function(a,t){t.__esModule=!0,t.default=void 0,t.default=function(r){var l=r.toString(16);return l.length===1?"0"+l:l},a.exports=t.default})(U,U.exports);var we=U.exports;(function(a,t){t.__esModule=!0,t.default=void 0;var r=n(ie),l=n(ye),o=n(we);function n(s){return s&&s.__esModule?s:{default:s}}function e(s){return(0,o.default)(Math.round(255*s))}function d(s,i,u){return(0,l.default)("#"+e(s)+e(i)+e(u))}t.default=function(s,i,u){return(0,r.default)(s,i,u,d)},a.exports=t.default})(Z,Z.exports);var xe=Z.exports;(function(a,t){t.__esModule=!0,t.default=function(n,e,d){if(typeof n=="number"&&typeof e=="number"&&typeof d=="number")return(0,r.default)(n,e,d);if(typeof n=="object"&&e===void 0&&d===void 0)return(0,r.default)(n.hue,n.saturation,n.lightness);throw new l.default(1)};var r=o(xe),l=o(x);function o(n){return n&&n.__esModule?n:{default:n}}a.exports=t.default})(J,J.exports);var We=J.exports,Q={exports:{}};(function(a,t){t.__esModule=!0,t.default=function(e,d,s,i){if(typeof e=="number"&&typeof d=="number"&&typeof s=="number"&&typeof i=="number")return i>=1?(0,r.default)(e,d,s):"rgba("+(0,l.default)(e,d,s)+","+i+")";if(typeof e=="object"&&d===void 0&&s===void 0&&i===void 0)return e.alpha>=1?(0,r.default)(e.hue,e.saturation,e.lightness):"rgba("+(0,l.default)(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new o.default(2)};var r=n(xe),l=n(ie),o=n(x);function n(e){return e&&e.__esModule?e:{default:e}}a.exports=t.default})(Q,Q.exports);var Ne=Q.exports,X={exports:{}};(function(a,t){t.__esModule=!0,t.default=function(e,d,s){if(typeof e=="number"&&typeof d=="number"&&typeof s=="number")return(0,r.default)("#"+(0,l.default)(e)+(0,l.default)(d)+(0,l.default)(s));if(typeof e=="object"&&d===void 0&&s===void 0)return(0,r.default)("#"+(0,l.default)(e.red)+(0,l.default)(e.green)+(0,l.default)(e.blue));throw new o.default(6)};var r=n(ye),l=n(we),o=n(x);function n(e){return e&&e.__esModule?e:{default:e}}a.exports=t.default})(X,X.exports);var _e=X.exports,ee={exports:{}};(function(a,t){t.__esModule=!0,t.default=function(e,d,s,i){if(typeof e=="string"&&typeof d=="number"){var u=(0,r.default)(e);return"rgba("+u.red+","+u.green+","+u.blue+","+d+")"}if(typeof e=="number"&&typeof d=="number"&&typeof s=="number"&&typeof i=="number")return i>=1?(0,l.default)(e,d,s):"rgba("+e+","+d+","+s+","+i+")";if(typeof e=="object"&&d===void 0&&s===void 0&&i===void 0)return e.alpha>=1?(0,l.default)(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new o.default(7)};var r=n(le),l=n(_e),o=n(x);function n(e){return e&&e.__esModule?e:{default:e}}a.exports=t.default})(ee,ee.exports);var De=ee.exports;(function(a,t){t.__esModule=!0,t.default=function(f){if(typeof f!="object")throw new e.default(8);if(i(f))return(0,n.default)(f);if(s(f))return(0,o.default)(f);if(c(f))return(0,l.default)(f);if(u(f))return(0,r.default)(f);throw new e.default(8)};var r=d(We),l=d(Ne),o=d(_e),n=d(De),e=d(x);function d(f){return f&&f.__esModule?f:{default:f}}var s=function(f){return typeof f.red=="number"&&typeof f.green=="number"&&typeof f.blue=="number"&&(typeof f.alpha!="number"||f.alpha===void 0)},i=function(f){return typeof f.red=="number"&&typeof f.green=="number"&&typeof f.blue=="number"&&typeof f.alpha=="number"},u=function(f){return typeof f.hue=="number"&&typeof f.saturation=="number"&&typeof f.lightness=="number"&&(typeof f.alpha!="number"||f.alpha===void 0)},c=function(f){return typeof f.hue=="number"&&typeof f.saturation=="number"&&typeof f.lightness=="number"&&typeof f.alpha=="number"};a.exports=t.default})(G,G.exports);var Se=G.exports;(function(a,t){t.__esModule=!0,t.default=void 0;var r=e(me),l=e(be),o=e(ve),n=e(Se);function e(i){return i&&i.__esModule?i:{default:i}}function d(){return d=Object.assign?Object.assign.bind():function(i){for(var u=1;u<arguments.length;u++){var c=arguments[u];for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(i[f]=c[f])}return i},d.apply(this,arguments)}var s=(0,r.default)(function(i,u){if(u==="transparent")return u;var c=(0,o.default)(u);return(0,n.default)(d({},c,{lightness:(0,l.default)(0,1,c.lightness-parseFloat(i))}))});t.default=s,a.exports=t.default})(R,R.exports);const Ye=se(R.exports);var te={exports:{}};(function(a,t){t.__esModule=!0,t.default=void 0;var r=e(me),l=e(be),o=e(ve),n=e(Se);function e(i){return i&&i.__esModule?i:{default:i}}function d(){return d=Object.assign?Object.assign.bind():function(i){for(var u=1;u<arguments.length;u++){var c=arguments[u];for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(i[f]=c[f])}return i},d.apply(this,arguments)}var s=(0,r.default)(function(i,u){if(u==="transparent")return u;var c=(0,o.default)(u);return(0,n.default)(d({},c,{lightness:(0,l.default)(0,1,c.lightness+parseFloat(i))}))});t.default=s,a.exports=t.default})(te,te.exports);const Ge=se(te.exports),he=new Set,S="bf-iframe-container",ne="bf-trigger-button";function Je(a){if(!document.querySelector("style[data-widget-styles]")){var t,r;(function(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"#000",o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"FFF";const n=document.createElement("style");n.attributes.setNamedItem(document.createAttribute("data-widget-styles"));const e=ze(l)>.5;n.textContent=`
151
+ .bf-trigger-button{position:fixed;bottom:16px;right:16px;width:56px;height:56px;border-radius:50%;border:none;box-shadow:0 20px 25px -5px #1212171a,0 10px 10px -5px #1212170a;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:1000;padding:12px;gap:10px;overflow:hidden}.trigger-button-icon{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 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)}.bf-iframe-container{position:fixed;bottom:0;right:0;width:100vw;height:100vh;border:none;overflow:hidden;z-index:999;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}.bf-iframe-container.open{opacity:1;transform:translateY(0);pointer-events:auto;top:0;left:0}@media (min-width: 768px){.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.expanded{width:min(calc(448px * 1.35),calc(100vw - 16px));height:min(calc(750px * 1.35),calc(100vh - 80px))}}
152
+ .${ne} { background: ${l}; }
153
+ .${ne}:hover {
154
+ background: ${e?Ye(.05,l):Ge(.05,l)};
155
+ }
156
+ .trigger-button-icon { color: ${o}; }
157
+ `,document.head.appendChild(n)})((a==null||(t=a.theme)===null||t===void 0?void 0:t.inputButtonBgColor)||"#007bff",(a==null||(r=a.theme)===null||r===void 0?void 0:r.textBaseColor)||"#ffffff")}}function Ze(a){const t=P("button",ne,{id:`trigger-button-${a}`,"aria-controls":S,"aria-expanded":"false"}),r=P("div","trigger-button-icon",{"aria-hidden":"true"});return r.innerHTML=`
158
+ <svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" fill="currentColor" viewBox="0 0 256 256" class="close-icon">
159
+ <path class="icon-path" d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>
160
+ </svg>
161
+ <svg width="24" height="14" viewBox="0 0 24 14" fill="none" xmlns="http://www.w3.org/2000/svg" class="fish-icon visible">
162
+ <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"/>
163
+ </svg>
164
+ `,t.setAttribute("aria-label","Open Brainfish widget"),t.appendChild(r),function(l,o){let n=!1;const e=o.querySelector(".fish-icon"),d=o.querySelector(".close-icon");l.addEventListener("click",()=>{n=!n;const s=document.querySelector(`.${S}`),i=s==null?void 0:s.querySelector("iframe");var u;n?(s==null||s.classList.add("open"),s==null||s.setAttribute("aria-hidden","false"),l.setAttribute("aria-expanded","true"),e.classList.remove("visible"),d.classList.add("visible"),i==null||(u=i.contentWindow)===null||u===void 0||u.postMessage({type:"FOCUS_SEARCH_FIELD"},"*")):(s==null||s.classList.remove("open"),s==null||s.setAttribute("aria-hidden","true"),l.setAttribute("aria-expanded","false"),d.classList.remove("visible"),e.classList.add("visible"))})}(t,r),t}function Ve(a,t){const r=document.createDocumentFragment(),l=Ze(a),o=function(n){const e=P("div",S,{id:S,"aria-live":"polite","aria-hidden":"true"}),d=P("iframe","trigger-iframe",{src:n,sandbox:"allow-scripts allow-same-origin allow-popups",role:"dialog"});return e.appendChild(d),e}(t);return r.appendChild(l),r.appendChild(o),r}function Ue(a){const t=new AbortController,{signal:r}=t;return window.addEventListener("message",l=>{if(l.origin!==a)return;const{type:o}=l.data;if(o==="TOGGLE_WIDGET_SIZE"&&function(){const n=document.querySelector(`.${S}`);n.classList.contains("expanded")?n.classList.remove("expanded"):n.classList.add("expanded")}(),o==="TRACK_EVENT"){if(!window.BrainfishAnalytics)return;const{eventName:n,data:e}=l.data;window.BrainfishAnalytics("track",n,e)}},{signal:r}),t}const Qe=(a,t)=>{const r=oe(a.overrides),l=((o=a.overrides)==null?void 0:o.widgetHost)||void 0;var o;const n=`${l}/?widgetKey=${a.widgetKey}`;try{if(e=a.widgetKey,he.has(e)||function(u){return!!document.getElementById(`trigger-button-${u}`)}(a.widgetKey))return;Je(t);const d=Ve(a.widgetKey,n);document.body.appendChild(d);const s=Ue(l);he.add(a.widgetKey);const i=()=>{s.abort(),window.removeEventListener("beforeunload",i)};return void window.addEventListener("beforeunload",i)}catch(d){(function(s,i,u){w(s,i,i.message,u)})(r,d,a.widgetKey)}var e};let j=null;const re=typeof window!="undefined"&&window.Brainfish?window.Brainfish:(j||(j=function(){let a=[],t=null;function r(o,n){if(t){const e=o.split(".");let d=t;for(let i=0;i<e.length-1;i++)d=d[e[i]];const s=d[e[e.length-1]];if(typeof s=="function")return s.apply(d,n)}else a.push([o,n])}return{Widgets:{init:function(){for(var o=arguments.length,n=new Array(o),e=0;e<o;e++)n[e]=arguments[e];return r("Widgets.init",n)}},SearchWidget:{initStandard:function(){for(var o=arguments.length,n=new Array(o),e=0;e<o;e++)n[e]=arguments[e];return r("SearchWidget.initStandard",n)}},HelpWidget:{initPopup:function(){for(var o=arguments.length,n=new Array(o),e=0;e<o;e++)n[e]=arguments[e];return r("HelpWidget.initPopup",n)},close:function(){for(var o=arguments.length,n=new Array(o),e=0;e<o;e++)n[e]=arguments[e];return r("HelpWidget.close",n)},open:function(){for(var o=arguments.length,n=new Array(o),e=0;e<o;e++)n[e]=arguments[e];return r("HelpWidget.open",n)},toggle:function(){for(var o=arguments.length,n=new Array(o),e=0;e<o;e++)n[e]=arguments[e];return r("HelpWidget.toggle",n)}},_setRealBrainfish:function(o){for(t=o;a.length>0;){const[n,e]=a.shift();r(n,e)}}}}(),typeof window!="undefined"&&(window.Brainfish=j)),j);let L=null;re.Widgets.init=a=>b(exports,null,function*(){window&&(window.BrainfishAnalytics=window.BrainfishAnalytics||function(){for(var n=arguments.length,e=new Array(n),d=0;d<n;d++)e[d]=arguments[d];(window.BrainfishAnalytics.q=window.BrainfishAnalytics.q||[]).push(e)});const t=oe(a.overrides),r=((l=a.overrides)==null?void 0:l.analyticsApiHost)||void 0;var l;const{config:o}=yield Le({widgetKey:a.widgetKey,apiHost:t});L||(L=function(n,e,d,s){return b(this,null,function*(){var i,u,c,f;const h=((i=n.overrides)===null||i===void 0?void 0:i.enableRecording)||(e==null||(u=e.settings)===null||u===void 0?void 0:u.enableRecording)||!1,g=((c=n.overrides)===null||c===void 0?void 0:c.version)||(e==null?void 0:e.version),p=[];g!=null&&g.startsWith("2.")?Qe(n,e):p.push(Ke(n,e)),e!=null&&(f=e.settings)!==null&&f!==void 0&&f.enableTracking&&p.push(He(n.widgetKey,e.trackingToken||"",d,s,h));const[m]=yield Promise.allSettled(p);m&&m.status==="fulfilled"&&m.value&&re._setRealBrainfish(m.value)})}(a,o,t,r)),yield L});exports.BrainfishAnalytics=function(){typeof window!="undefined"&&window.BrainfishAnalytics&&window.BrainfishAnalytics(...arguments)},exports.default=re;
3
165
  //# sourceMappingURL=web.cjs.js.map