@brainfish-ai/widgets-initiator 1.6.0 → 1.6.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.
- package/README.md +37 -0
- package/dist/types/initIframeTrigger/components/TriggerButton.d.ts +1 -1
- package/dist/types/initIframeTrigger/listeners/initMessageListener.d.ts +6 -1
- package/dist/types/initIframeTrigger/managers/IframeStateManager.d.ts +4 -1
- package/dist/types/types/brainfish.d.ts +1 -0
- package/dist/web.cjs.js +6 -6
- package/dist/web.cjs.js.map +1 -1
- package/dist/web.js +367 -336
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,3 +40,40 @@ npm install @branfish-ai/web-widget
|
|
|
40
40
|
controller.abort();
|
|
41
41
|
</script>
|
|
42
42
|
```
|
|
43
|
+
|
|
44
|
+
## Build
|
|
45
|
+
|
|
46
|
+
Run the following command to build the widget:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
yarn build:web-widget
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Testing locally
|
|
53
|
+
|
|
54
|
+
To test the widget locally, you can use the following command:
|
|
55
|
+
|
|
56
|
+
### Start the local server
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
cd packages/web-widget
|
|
60
|
+
npx serve ./ -p 8000 -C
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Fire up the test page
|
|
64
|
+
|
|
65
|
+
You can test the widget locally by opening the test page in your browser. You can also pass in the `env` parameter to test the widget in different environments. (local, staging, prod).
|
|
66
|
+
|
|
67
|
+
Note that they all point to the same web widget script run from your local server. (not the CDN). This provides a way to test the widget in different environments without having to deploy to the CDN.
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
open http://localhost:8000/test-pages/index.html?env=local
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
If you want to test the widget with the React app (react-search-widget), you can start the React app locally: (this will run on port 3006)
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
cd packages/react-search-widget
|
|
78
|
+
yarn dev
|
|
79
|
+
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function createTriggerButton(widgetKey: string): HTMLElement;
|
|
1
|
+
export declare function createTriggerButton(widgetKey: string, isButtonHidden: boolean): HTMLElement;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
export declare function initMessageListener(widgetHost
|
|
1
|
+
export declare function initMessageListener({ widgetHost, apiHost, widgetKey, signal, }: {
|
|
2
|
+
widgetHost: string;
|
|
3
|
+
apiHost: string;
|
|
4
|
+
widgetKey: string;
|
|
5
|
+
signal: AbortSignal;
|
|
6
|
+
}): void;
|
|
@@ -2,9 +2,12 @@ export declare class IframeStateManager {
|
|
|
2
2
|
private static isOpen;
|
|
3
3
|
private static button;
|
|
4
4
|
private static icon;
|
|
5
|
+
private static isButtonHidden;
|
|
5
6
|
static get isWidgetOpen(): boolean;
|
|
6
|
-
static initialize(button: HTMLElement, icon: HTMLElement): void;
|
|
7
|
+
static initialize(button: HTMLElement, icon: HTMLElement, isButtonHidden: boolean): void;
|
|
7
8
|
static toggleIframeVisibility(): void;
|
|
9
|
+
static openWidget(): void;
|
|
10
|
+
static closeWidget(): void;
|
|
8
11
|
static showTriggerButton(): void;
|
|
9
12
|
static hideTriggerButton(): void;
|
|
10
13
|
}
|
package/dist/web.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var
|
|
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"})(K||(K={}));const x=(a,t,n,i)=>{let o=n,r={};if(t instanceof Error)try{r=JSON.parse(t.message),o+=` - ${r.message||t.message}`}catch(e){o+=` - ${t.message}`}else o+=` - ${String(t)}`;((e,l,s)=>{if(!navigator||navigator.userAgent.toLowerCase().includes("headless"))return;const u=l.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.6.0. ${l.message}`,stack:l.stack,cause:{message:u.message,stack:u.stack,cause:u.cause}})})})(a,new ie(o,{cause:r}),i)},$e=a=>m(exports,null,function*(){let{widgetKey:t,apiHost:n}=a;return function(i,o,r){return m(this,null,function*(){let e,l=0;for(;l<3;)try{const s=yield fetch(`${i}${o}`,{method:"POST",headers:{"Content-Type":"application/json","api-key":r}});if(!s.ok)throw new Error(`API call failed with status: ${s.status}`);const u=yield s.json();if(!u)throw new Error("Error loading config: empty response");return u}catch(s){if(e=s,l++,l>=3)throw x(i,s,"Error fetching config",r),e;yield new Promise(u=>setTimeout(u,500))}})}(n,"/api/searchWidgets.getConfigByKey",t)}),We=a=>{let{config:t,apiKey:n,apiHost:i}=a;const o=t.settings||{};return["bodyActionButtons","footerActionButtons","nextBestActions"].forEach(r=>{o[r]&&(o[r]=o[r].map(e=>e.type===K.CALLBACK&&e.value?L(F({},e),{value:new Function(`return ${e.value}`)()}):e))}),L(F({},t),{settings:o,apiHost:i,widgetMode:t.widgetType,apiKey:n})},se=a=>(a==null?void 0:a.apiHost)||"https://app.brainfi.sh",$=(()=>{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})(),Ke=a=>m(exports,null,function*(){let{apiHost:t,widgetKey:n,version:i}=a;try{const o=`https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${i}/dist/web.js`,r=$?o.replace("web.js","web.umd.js"):o;return{widget:yield(l=>m(exports,null,function*(){return document.getElementById("brainfish-widget")?window.Brainfish:new Promise((s,u)=>{const d=document.createElement("script");d.id="brainfish-widget",d.src=l,d.type=$?"text/javascript":"module",d.async=!0,d.crossOrigin="anonymous",d.onload=()=>{setTimeout(()=>{const c=window.Brainfish;c?s(c):u(new Error("Failed to load Brainfish module"))},200)},d.onerror=c=>{const f=c,h={message:`Failed to load script: ${l}`,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(h)))},$||document.head.appendChild(d)})}))(r)}}catch(o){x(t,o,o.message,n)}}),ge=new Set,ze=(a,t)=>m(exports,null,function*(){const n=se(a.overrides);try{if(ge.has(a.widgetKey))return;const i=yield Ke({apiHost:n,widgetKey:a.widgetKey,version:t.version||"latest"});if(i){const{widget:o}=i,r=We({config:t,apiKey:a.widgetKey,apiHost:n});return a.overrides&&t.settings&&Object.entries(a.overrides).forEach(e=>{let[l,s]=e;t.settings&&l in t.settings&&(t.settings[l]=function(){let u=arguments.length>1?arguments[1]:void 0;const d=new Map((arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).map(c=>[c.label,c]));return u.forEach(c=>d.set(c.label,c)),Array.from(d.values())}(t.settings[l],s))}),function(e,l){l.widgetType===k.Searchbar||l.widgetType==="Search"?e.SearchWidget.initStandard(l):e.HelpWidget.initPopup(l)}(o,r),ge.add(a.widgetKey),o}}catch(i){x(n,i,i.message,a.widgetKey)}});let he=!1;const He=function(i,o,r){return m(this,arguments,function*(a,t,n){let e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"",l=arguments.length>4&&arguments[4]!==void 0&&arguments[4];if(t||x(n,new Error("Access key is required"),"Access key is required",a),!he)try{const s=(()=>{if(typeof window=="undefined"||typeof navigator=="undefined")return!1;const u=navigator,d=window,c=(u.doNotTrack||d.doNotTrack||u.msDoNotTrack||"0").toString().toLowerCase();return["1","yes","true"].includes(c)})();window.BrainfishAnalytics("init",{apiUrl:e,accessKey:t,trackScreenViews:!s,trackAttributes:!s,trackOutgoingLinks:!s,enableRecording:!s&&l}),he=!0,yield((u,d)=>m(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=()=>{x(u,new Error(`Failed to load script: ${c.src}`),`Failed to load script: ${c.src}`,d)},document.head.appendChild(c)}))(n,a)}catch(s){x(n,s,"Failed to initialize BrainfishAnalytics",a)}})};function I(a,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=document.createElement(a);return i.className=t,Object.entries(n).forEach(o=>{let[r,e]=o;i.setAttribute(r,e)}),i}const B="bf-iframe-container",j="bf-trigger-button";class v{static get isWidgetOpen(){return this.isOpen}static initialize(t,n){this.button=t,this.icon=n,t.addEventListener("click",()=>this.toggleIframeVisibility())}static toggleIframeVisibility(){if(!this.button||!this.icon)return;this.isOpen=!this.isOpen;const t=this.icon.querySelector(".fish-icon"),n=this.icon.querySelector(".close-icon"),i=document.querySelector(".bf-iframe-container"),o=i==null?void 0:i.querySelector("iframe");var r;this.isOpen?(i==null||i.classList.add("open"),i==null||i.setAttribute("aria-hidden","false"),this.button.setAttribute("aria-expanded","true"),t.classList.remove("visible"),n.classList.add("visible"),o==null||(r=o.contentWindow)===null||r===void 0||r.postMessage({type:"FOCUS_SEARCH_FIELD"},"*"),window.BrainfishAnalytics("track","Open Widget"),document.body.clientWidth<=576&&this.hideTriggerButton()):(i==null||i.classList.remove("open"),i==null||i.setAttribute("aria-hidden","true"),this.button.setAttribute("aria-expanded","false"),n.classList.remove("visible"),t.classList.add("visible"),this.showTriggerButton(),window.BrainfishAnalytics("track","Close Widget"))}static showTriggerButton(){var t;(t=this.button)===null||t===void 0||t.classList.remove("hidden")}static hideTriggerButton(){var t;(t=this.button)===null||t===void 0||t.classList.add("hidden")}}_(v,"isOpen",!1),_(v,"button",null),_(v,"icon",null);function qe(a,t){window.addEventListener("message",n=>{if(n.origin!==a)return;const{type:i}=n.data;if(i==="TOGGLE_WIDGET_SIZE"&&function(){const o=document.querySelector(`.${B}`);o.classList.contains("expanded")?o.classList.remove("expanded"):o.classList.add("expanded")}(),i==="TRACK_EVENT"){if(!window.BrainfishAnalytics)return;const{eventName:o,data:r}=n.data;window.BrainfishAnalytics("track",o,r)}i==="CLOSE_WIDGET"&&(window.BrainfishAnalytics("track","Close Widget"),v.toggleIframeVisibility())},{signal:t})}function ue(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var z={exports:{}},H={exports:{}},q={exports:{}};(function(a,t){function n(o){return Math.round(255*o)}function i(o,r,e){return n(o)+","+n(r)+","+n(e)}t.__esModule=!0,t.default=void 0,t.default=function(o,r,e,l){if(l===void 0&&(l=i),r===0)return l(e,e,e);var s=(o%360+360)%360/60,u=(1-Math.abs(2*e-1))*r,d=u*(1-Math.abs(s%2-1)),c=0,f=0,h=0;s>=0&&s<1?(c=u,f=d):s>=1&&s<2?(c=d,f=u):s>=2&&s<3?(f=u,h=d):s>=3&&s<4?(f=d,h=u):s>=4&&s<5?(c=d,h=u):s>=5&&s<6&&(c=u,h=d);var g=e-u/2;return l(c+g,f+g,h+g)},a.exports=t.default})(q,q.exports);var le=q.exports,D={exports:{}};(function(a,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(i){if(typeof i!="string")return i;var o=i.toLowerCase();return n[o]?"#"+n[o]:i},a.exports=t.default})(D,D.exports);var De=D.exports,N={exports:{}};(function(a,t){function n(s){var u=typeof Map=="function"?new Map:void 0;return n=function(d){if(d===null||!function(f){try{return Function.toString.call(f).indexOf("[native code]")!==-1}catch(h){return typeof f=="function"}}(d))return d;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(u!==void 0){if(u.has(d))return u.get(d);u.set(d,c)}function c(){return function(f,h,g){if(i())return Reflect.construct.apply(null,arguments);var p=[null];p.push.apply(p,h);var b=new(f.bind.apply(f,p));return g&&o(b,g.prototype),b}(d,arguments,r(this).constructor)}return c.prototype=Object.create(d.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),o(c,d)},n(s)}function i(){try{var s=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(u){}return(i=function(){return!!s})()}function o(s,u){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,c){return d.__proto__=c,d},o(s,u)}function r(s){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(u){return u.__proto__||Object.getPrototypeOf(u)},r(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 }).
|
|
1
|
+
"use strict";var Pe=Object.defineProperty,je=Object.defineProperties;var Le=Object.getOwnPropertyDescriptors;var ge=Object.getOwnPropertySymbols;var Fe=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable;var L=(a,t,n)=>t in a?Pe(a,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[t]=n,F=(a,t)=>{for(var n in t||(t={}))Fe.call(t,n)&&L(a,n,t[n]);if(ge)for(var n of ge(t))We.call(t,n)&&L(a,n,t[n]);return a},W=(a,t)=>je(a,Le(t));var S=(a,t,n)=>L(a,typeof t!="symbol"?t+"":t,n);var m=(a,t,n)=>new Promise((i,o)=>{var r=l=>{try{d(n.next(l))}catch(s){o(s)}},e=l=>{try{d(n.throw(l))}catch(s){o(s)}},d=l=>l.done?i(l.value):Promise.resolve(l.value).then(r,e);d((n=n.apply(a,t)).next())});var k,K;(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]="f249cbeb-5f3c-46a1-bef3-f727b2890065",a._sentryDebugIdIdentifier="sentry-dbid-f249cbeb-5f3c-46a1-bef3-f727b2890065")}catch(n){}})(),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:"8caaf781e1d718f459b9b3c07fdbcb4a119f0d01"},function(a){a.Sidebar="sidebar",a.Searchbar="searchbar"}(k||(k={})),k.Sidebar,k.Searchbar;class se extends Error{constructor(n,i){super(n,i);S(this,"cause");this.name="BrainfishWidgetError",this.cause=i==null?void 0:i.cause,Error.captureStackTrace&&Error.captureStackTrace(this,se),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"})(K||(K={}));const x=(a,t,n,i)=>{let o=n,r={};if(t instanceof Error)try{r=JSON.parse(t.message),o+=` - ${r.message||t.message}`}catch(e){o+=` - ${t.message}`}else o+=` - ${String(t)}`;((e,d,l)=>{if(!navigator||navigator.userAgent.toLowerCase().includes("headless"))return;const s=d.toJSON();fetch(`${e||"https://app.brainfi.sh"}/api/trackError.widget.create`,{method:"POST",headers:{"Content-Type":"application/json","api-key":l},body:JSON.stringify({error:`WebWidgetVersion: 1.6.2. ${d.message}`,stack:d.stack,cause:{message:s.message,stack:s.stack,cause:s.cause}})})})(a,new se(o,{cause:r}),i)},He=a=>m(exports,null,function*(){let{widgetKey:t,apiHost:n}=a;return function(i,o,r){return m(this,null,function*(){let e,d=0;for(;d<3;)try{const l=yield fetch(`${i}${o}`,{method:"POST",headers:{"Content-Type":"application/json","api-key":r}});if(!l.ok)throw new Error(`API call failed with status: ${l.status}`);const s=yield l.json();if(!s)throw new Error("Error loading config: empty response");return s}catch(l){if(e=l,d++,d>=3)throw x(i,l,"Error fetching config",r),e;yield new Promise(s=>setTimeout(s,500))}})}(n,"/api/searchWidgets.getConfigByKey",t)}),$e=a=>{let{config:t,apiKey:n,apiHost:i}=a;const o=t.settings||{};return["bodyActionButtons","footerActionButtons","nextBestActions"].forEach(r=>{o[r]&&(o[r]=o[r].map(e=>e.type===K.CALLBACK&&e.value?W(F({},e),{value:new Function(`return ${e.value}`)()}):e))}),W(F({},t),{settings:o,apiHost:i,widgetMode:t.widgetType,apiKey:n})},de=a=>(a==null?void 0:a.apiHost)||"https://app.brainfi.sh",H=(()=>{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})(),Ke=a=>m(exports,null,function*(){let{apiHost:t,widgetKey:n,version:i}=a;try{const o=`https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${i}/dist/web.js`,r=H?o.replace("web.js","web.umd.js"):o;return{widget:yield(d=>m(exports,null,function*(){return document.getElementById("brainfish-widget")?window.Brainfish:new Promise((l,s)=>{const u=document.createElement("script");u.id="brainfish-widget",u.src=d,u.type=H?"text/javascript":"module",u.async=!0,u.crossOrigin="anonymous",u.onload=()=>{setTimeout(()=>{const c=window.Brainfish;c?l(c):s(new Error("Failed to load Brainfish module"))},200)},u.onerror=c=>{const f=c,g={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"};s(new Error(JSON.stringify(g)))},H||document.head.appendChild(u)})}))(r)}}catch(o){x(t,o,o.message,n)}}),he=new Set,qe=(a,t)=>m(exports,null,function*(){const n=de(a.overrides);try{if(he.has(a.widgetKey))return;const i=yield Ke({apiHost:n,widgetKey:a.widgetKey,version:t.version||"latest"});if(i){const{widget:o}=i,r=$e({config:t,apiKey:a.widgetKey,apiHost:n});return a.overrides&&t.settings&&Object.entries(a.overrides).forEach(e=>{let[d,l]=e;t.settings&&d in t.settings&&(t.settings[d]=function(){let s=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 s.forEach(c=>u.set(c.label,c)),Array.from(u.values())}(t.settings[d],l))}),function(e,d){d.widgetType===k.Searchbar||d.widgetType==="Search"?e.SearchWidget.initStandard(d):e.HelpWidget.initPopup(d)}(o,r),he.add(a.widgetKey),o}}catch(i){x(n,i,i.message,a.widgetKey)}});let me=!1;const ze=function(i,o,r){return m(this,arguments,function*(a,t,n){let e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"",d=arguments.length>4&&arguments[4]!==void 0&&arguments[4];if(t||x(n,new Error("Access key is required"),"Access key is required",a),!me)try{const l=(()=>{if(typeof window=="undefined"||typeof navigator=="undefined")return!1;const s=navigator,u=window,c=(s.doNotTrack||u.doNotTrack||s.msDoNotTrack||"0").toString().toLowerCase();return["1","yes","true"].includes(c)})();window.BrainfishAnalytics("init",{apiUrl:e,accessKey:t,trackScreenViews:!l,trackAttributes:!l,trackOutgoingLinks:!l,enableRecording:!l&&d}),me=!0,yield((s,u)=>m(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=()=>{x(s,new Error(`Failed to load script: ${c.src}`),`Failed to load script: ${c.src}`,u)},document.head.appendChild(c)}))(n,a)}catch(l){x(n,l,"Failed to initialize BrainfishAnalytics",a)}})};function I(a,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=document.createElement(a);return i.className=t,Object.entries(n).forEach(o=>{let[r,e]=o;i.setAttribute(r,e)}),i}const T="bf-iframe-container",j="bf-trigger-button",P=576;class v{static get isWidgetOpen(){return this.isOpen}static initialize(t,n,i){var o;this.button=t,this.icon=n,this.isButtonHidden=i,t.addEventListener("click",()=>this.toggleIframeVisibility()),i&&this.hideTriggerButton(),(o=window.Brainfish)!==null&&o!==void 0&&o.HelpWidget&&(window.Brainfish.HelpWidget.close=()=>this.closeWidget(),window.Brainfish.HelpWidget.open=()=>this.openWidget())}static toggleIframeVisibility(){if(!this.button||!this.icon)return;this.isOpen=!this.isOpen;const t=this.icon.querySelector(".fish-icon"),n=this.icon.querySelector(".close-icon"),i=document.querySelector(".bf-iframe-container"),o=i==null?void 0:i.querySelector("iframe");var r;this.isOpen?(i==null||i.classList.add("open"),i==null||i.setAttribute("aria-hidden","false"),this.button.setAttribute("aria-expanded","true"),t.classList.remove("visible"),n.classList.add("visible"),o==null||(r=o.contentWindow)===null||r===void 0||r.postMessage({type:"FOCUS_SEARCH_FIELD"},"*"),window.BrainfishAnalytics("track","Open Widget"),document.body.clientWidth<=P&&this.hideTriggerButton()):(i==null||i.classList.remove("open"),i==null||i.setAttribute("aria-hidden","true"),this.button.setAttribute("aria-expanded","false"),n.classList.remove("visible"),t.classList.add("visible"),this.showTriggerButton(),window.BrainfishAnalytics("track","Close Widget"))}static openWidget(){var t;if(!this.icon)return;this.isOpen=!0;const n=document.querySelector(".bf-iframe-container"),i=n==null?void 0:n.querySelector("iframe");if(n==null||n.classList.add("open"),n==null||n.setAttribute("aria-hidden","false"),i==null||(t=i.contentWindow)===null||t===void 0||t.postMessage({type:"FOCUS_SEARCH_FIELD"},"*"),window.BrainfishAnalytics("track","Open Widget"),this.button&&this.icon&&!this.isButtonHidden){const o=this.icon.querySelector(".fish-icon"),r=this.icon.querySelector(".close-icon");this.button.setAttribute("aria-expanded","true"),o.classList.remove("visible"),r.classList.add("visible"),window.BrainfishAnalytics("track","Open Widget"),document.body.clientWidth<=P&&this.hideTriggerButton()}}static closeWidget(){this.isOpen=!1;const t=document.querySelector(".bf-iframe-container");if(t==null||t.classList.remove("open"),t==null||t.setAttribute("aria-hidden","true"),window.BrainfishAnalytics("track","Close Widget"),this.button&&this.icon&&!this.isButtonHidden){this.button.setAttribute("aria-expanded","false");const n=this.icon.querySelector(".fish-icon"),i=this.icon.querySelector(".close-icon");n.classList.add("visible"),i.classList.remove("visible"),document.body.clientWidth<=P&&this.showTriggerButton()}}static showTriggerButton(){var t;(t=this.button)===null||t===void 0||t.classList.remove("hidden")}static hideTriggerButton(){var t;(t=this.button)===null||t===void 0||t.classList.add("hidden")}}S(v,"isOpen",!1),S(v,"button",null),S(v,"icon",null),S(v,"isButtonHidden",!1);function De(a){let{widgetHost:t,apiHost:n,widgetKey:i,signal:o}=a;window.addEventListener("message",r=>{if(r.origin!==t)return;const{type:e}=r.data;if(e==="TOGGLE_WIDGET_SIZE"&&function(){const d=document.querySelector(`.${T}`);d.classList.contains("expanded")?d.classList.remove("expanded"):d.classList.add("expanded")}(),e==="TRACK_EVENT"){if(!window.BrainfishAnalytics)return;const{eventName:d,data:l}=r.data;window.BrainfishAnalytics("track",d,l)}if(e==="CLOSE_WIDGET"&&(window.BrainfishAnalytics("track","Close Widget"),v.toggleIframeVisibility()),e==="NEXT_BEST_ACTION_CLICKED"){const{action:d,searchQueryId:l,query:s,answer:u}=r.data,c={action:d,searchQueryId:l};if(!["function","callback"].includes(d.type))return void console.error("Invalid action type",d);if(window.__bfCallbacks=window.__bfCallbacks||{},window.__bfCallbacks[d.id])return void window.__bfCallbacks[d.id](s,u,c);const f=`${n}/api/searchWidgets.callback.codeblocks?apiKey=${i}&codeblockId=${d.id}`,g=document.createElement("script");g.src=f,document.head.appendChild(g),g.onload=()=>{window.__bfCallbacks[d.id](s,u,c),setTimeout(()=>{document.head.removeChild(g)},300)}}},{signal:o})}function le(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var q={exports:{}},z={exports:{}},D={exports:{}};(function(a,t){function n(o){return Math.round(255*o)}function i(o,r,e){return n(o)+","+n(r)+","+n(e)}t.__esModule=!0,t.default=void 0,t.default=function(o,r,e,d){if(d===void 0&&(d=i),r===0)return d(e,e,e);var l=(o%360+360)%360/60,s=(1-Math.abs(2*e-1))*r,u=s*(1-Math.abs(l%2-1)),c=0,f=0,g=0;l>=0&&l<1?(c=s,f=u):l>=1&&l<2?(c=u,f=s):l>=2&&l<3?(f=s,g=u):l>=3&&l<4?(f=u,g=s):l>=4&&l<5?(c=u,g=s):l>=5&&l<6&&(c=s,g=u);var h=e-s/2;return d(c+h,f+h,g+h)},a.exports=t.default})(D,D.exports);var ue=D.exports,N={exports:{}};(function(a,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(i){if(typeof i!="string")return i;var o=i.toLowerCase();return n[o]?"#"+n[o]:i},a.exports=t.default})(N,N.exports);var Ne=N.exports,R={exports:{}};(function(a,t){function n(l){var s=typeof Map=="function"?new Map:void 0;return n=function(u){if(u===null||!function(f){try{return Function.toString.call(f).indexOf("[native code]")!==-1}catch(g){return typeof f=="function"}}(u))return u;if(typeof u!="function")throw new TypeError("Super expression must either be null or a function");if(s!==void 0){if(s.has(u))return s.get(u);s.set(u,c)}function c(){return function(f,g,h){if(i())return Reflect.construct.apply(null,arguments);var p=[null];p.push.apply(p,g);var b=new(f.bind.apply(f,p));return h&&o(b,h.prototype),b}(u,arguments,r(this).constructor)}return c.prototype=Object.create(u.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),o(c,u)},n(l)}function i(){try{var l=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(s){}return(i=function(){return!!l})()}function o(l,s){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(u,c){return u.__proto__=c,u},o(l,s)}function r(l){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(s){return s.__proto__||Object.getPrototypeOf(s)},r(l)}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
3
|
|
|
4
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
5
|
|
|
@@ -147,19 +147,19 @@ To pass a single animation please supply them in simple values, e.g. animation('
|
|
|
147
147
|
`,77:`remToPx expects a value in "rem" but you provided it in "%s".
|
|
148
148
|
|
|
149
149
|
`,78:`base must be set in "px" or "%" but you set it in "%s".
|
|
150
|
-
`};function l(){for(var s=arguments.length,u=new Array(s),d=0;d<s;d++)u[d]=arguments[d];var c,f=u[0],h=[];for(c=1;c<u.length;c+=1)h.push(u[c]);return h.forEach(function(g){f=f.replace(/%[a-z]/,g)}),f}t.default=function(s){var u,d;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),b=1;b<g;b++)p[b-1]=arguments[b];h=s.call(this,l.apply(void 0,[e[f]].concat(p)))||this}return function(C){if(C===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}(h)}return d=s,(u=c).prototype=Object.create(d.prototype),u.prototype.constructor=u,o(u,d),c}(n(Error)),a.exports=t.default})(N,N.exports);var S=N.exports;(function(a,t){t.__esModule=!0,t.default=function(g){if(typeof g!="string")throw new o.default(3);var p=(0,i.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(l)){var b=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:b}}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(u)){var C=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:C}}var E=d.exec(p);if(E)return{red:parseInt(""+E[1],10),green:parseInt(""+E[2],10),blue:parseInt(""+E[3],10)};var y=c.exec(p.substring(0,50));if(y)return{red:parseInt(""+y[1],10),green:parseInt(""+y[2],10),blue:parseInt(""+y[3],10),alpha:parseFloat(""+y[4])>1?parseFloat(""+y[4])/100:parseFloat(""+y[4])};var A=f.exec(p);if(A){var Ee=parseInt(""+A[1],10),Ae=parseInt(""+A[2],10)/100,Me=parseInt(""+A[3],10)/100,fe="rgb("+(0,n.default)(Ee,Ae,Me)+")",M=d.exec(fe);if(!M)throw new o.default(4,p,fe);return{red:parseInt(""+M[1],10),green:parseInt(""+M[2],10),blue:parseInt(""+M[3],10)}}var w=h.exec(p.substring(0,50));if(w){var Oe=parseInt(""+w[1],10),Ie=parseInt(""+w[2],10)/100,Pe=parseInt(""+w[3],10)/100,ce="rgb("+(0,n.default)(Oe,Ie,Pe)+")",O=d.exec(ce);if(!O)throw new o.default(4,p,ce);return{red:parseInt(""+O[1],10),green:parseInt(""+O[2],10),blue:parseInt(""+O[3],10),alpha:parseFloat(""+w[4])>1?parseFloat(""+w[4])/100:parseFloat(""+w[4])}}throw new o.default(5)};var n=r(le),i=r(De),o=r(S);function r(g){return g&&g.__esModule?g:{default:g}}var e=/^#[a-fA-F0-9]{6}$/,l=/^#[a-fA-F0-9]{8}$/,s=/^#[a-fA-F0-9]{3}$/,u=/^#[a-fA-F0-9]{4}$/,d=/^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})(H,H.exports);var de=H.exports;(function(a,t){t.__esModule=!0,t.default=function(o){if(o==="transparent")return 0;var r=(0,i.default)(o),e=Object.keys(r).map(function(d){var c=r[d]/255;return c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4)}),l=e[0],s=e[1],u=e[2];return parseFloat((.2126*l+.7152*s+.0722*u).toFixed(3))};var n,i=(n=de)&&n.__esModule?n:{default:n};a.exports=t.default})(z,z.exports);const Ne=ue(z.exports);var R={exports:{}},Y={exports:{}};(function(a,t){function n(i,o,r){return function(){var e=r.concat(Array.prototype.slice.call(arguments));return e.length>=o?i.apply(this,e):n(i,o,e)}}t.__esModule=!0,t.default=function(i){return n(i,i.length,[])},a.exports=t.default})(Y,Y.exports);var ve=Y.exports,J={exports:{}};(function(a,t){t.__esModule=!0,t.default=void 0,t.default=function(n,i,o){return Math.max(n,Math.min(i,o))},a.exports=t.default})(J,J.exports);var ye=J.exports,U={exports:{}},G={exports:{}};(function(a,t){t.__esModule=!0,t.default=void 0,t.default=function(n){var i,o=n.red/255,r=n.green/255,e=n.blue/255,l=Math.max(o,r,e),s=Math.min(o,r,e),u=(l+s)/2;if(l===s)return n.alpha!==void 0?{hue:0,saturation:0,lightness:u,alpha:n.alpha}:{hue:0,saturation:0,lightness:u};var d=l-s,c=u>.5?d/(2-l-s):d/(l+s);switch(l){case o:i=(r-e)/d+(r<e?6:0);break;case r:i=(e-o)/d+2;break;default:i=(o-r)/d+4}return i*=60,n.alpha!==void 0?{hue:i,saturation:c,lightness:u,alpha:n.alpha}:{hue:i,saturation:c,lightness:u}},a.exports=t.default})(G,G.exports);var Re=G.exports;(function(a,t){t.__esModule=!0,t.default=function(r){return(0,i.default)((0,n.default)(r))};var n=o(de),i=o(Re);function o(r){return r&&r.__esModule?r:{default:r}}a.exports=t.default})(U,U.exports);var we=U.exports,V={exports:{}},Z={exports:{}},Q={exports:{}},X={exports:{}};(function(a,t){t.__esModule=!0,t.default=void 0,t.default=function(n){return n.length===7&&n[1]===n[2]&&n[3]===n[4]&&n[5]===n[6]?"#"+n[1]+n[3]+n[5]:n},a.exports=t.default})(X,X.exports);var xe=X.exports,ee={exports:{}};(function(a,t){t.__esModule=!0,t.default=void 0,t.default=function(n){var i=n.toString(16);return i.length===1?"0"+i:i},a.exports=t.default})(ee,ee.exports);var Se=ee.exports;(function(a,t){t.__esModule=!0,t.default=void 0;var n=r(le),i=r(xe),o=r(Se);function r(s){return s&&s.__esModule?s:{default:s}}function e(s){return(0,o.default)(Math.round(255*s))}function l(s,u,d){return(0,i.default)("#"+e(s)+e(u)+e(d))}t.default=function(s,u,d){return(0,n.default)(s,u,d,l)},a.exports=t.default})(Q,Q.exports);var _e=Q.exports;(function(a,t){t.__esModule=!0,t.default=function(r,e,l){if(typeof r=="number"&&typeof e=="number"&&typeof l=="number")return(0,n.default)(r,e,l);if(typeof r=="object"&&e===void 0&&l===void 0)return(0,n.default)(r.hue,r.saturation,r.lightness);throw new i.default(1)};var n=o(_e),i=o(S);function o(r){return r&&r.__esModule?r:{default:r}}a.exports=t.default})(Z,Z.exports);var Ye=Z.exports,te={exports:{}};(function(a,t){t.__esModule=!0,t.default=function(e,l,s,u){if(typeof e=="number"&&typeof l=="number"&&typeof s=="number"&&typeof u=="number")return u>=1?(0,n.default)(e,l,s):"rgba("+(0,i.default)(e,l,s)+","+u+")";if(typeof e=="object"&&l===void 0&&s===void 0&&u===void 0)return e.alpha>=1?(0,n.default)(e.hue,e.saturation,e.lightness):"rgba("+(0,i.default)(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new o.default(2)};var n=r(_e),i=r(le),o=r(S);function r(e){return e&&e.__esModule?e:{default:e}}a.exports=t.default})(te,te.exports);var Je=te.exports,ne={exports:{}};(function(a,t){t.__esModule=!0,t.default=function(e,l,s){if(typeof e=="number"&&typeof l=="number"&&typeof s=="number")return(0,n.default)("#"+(0,i.default)(e)+(0,i.default)(l)+(0,i.default)(s));if(typeof e=="object"&&l===void 0&&s===void 0)return(0,n.default)("#"+(0,i.default)(e.red)+(0,i.default)(e.green)+(0,i.default)(e.blue));throw new o.default(6)};var n=r(xe),i=r(Se),o=r(S);function r(e){return e&&e.__esModule?e:{default:e}}a.exports=t.default})(ne,ne.exports);var ke=ne.exports,re={exports:{}};(function(a,t){t.__esModule=!0,t.default=function(e,l,s,u){if(typeof e=="string"&&typeof l=="number"){var d=(0,n.default)(e);return"rgba("+d.red+","+d.green+","+d.blue+","+l+")"}if(typeof e=="number"&&typeof l=="number"&&typeof s=="number"&&typeof u=="number")return u>=1?(0,i.default)(e,l,s):"rgba("+e+","+l+","+s+","+u+")";if(typeof e=="object"&&l===void 0&&s===void 0&&u===void 0)return e.alpha>=1?(0,i.default)(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new o.default(7)};var n=r(de),i=r(ke),o=r(S);function r(e){return e&&e.__esModule?e:{default:e}}a.exports=t.default})(re,re.exports);var Ue=re.exports;(function(a,t){t.__esModule=!0,t.default=function(f){if(typeof f!="object")throw new e.default(8);if(u(f))return(0,r.default)(f);if(s(f))return(0,o.default)(f);if(c(f))return(0,i.default)(f);if(d(f))return(0,n.default)(f);throw new e.default(8)};var n=l(Ye),i=l(Je),o=l(ke),r=l(Ue),e=l(S);function l(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)},u=function(f){return typeof f.red=="number"&&typeof f.green=="number"&&typeof f.blue=="number"&&typeof f.alpha=="number"},d=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})(V,V.exports);var Ce=V.exports;(function(a,t){t.__esModule=!0,t.default=void 0;var n=e(ve),i=e(ye),o=e(we),r=e(Ce);function e(u){return u&&u.__esModule?u:{default:u}}function l(){return l=Object.assign?Object.assign.bind():function(u){for(var d=1;d<arguments.length;d++){var c=arguments[d];for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(u[f]=c[f])}return u},l.apply(this,arguments)}var s=(0,n.default)(function(u,d){if(d==="transparent")return d;var c=(0,o.default)(d);return(0,r.default)(l({},c,{lightness:(0,i.default)(0,1,c.lightness-parseFloat(u))}))});t.default=s,a.exports=t.default})(R,R.exports);const Ge=ue(R.exports);var ae={exports:{}};(function(a,t){t.__esModule=!0,t.default=void 0;var n=e(ve),i=e(ye),o=e(we),r=e(Ce);function e(u){return u&&u.__esModule?u:{default:u}}function l(){return l=Object.assign?Object.assign.bind():function(u){for(var d=1;d<arguments.length;d++){var c=arguments[d];for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(u[f]=c[f])}return u},l.apply(this,arguments)}var s=(0,n.default)(function(u,d){if(d==="transparent")return d;var c=(0,o.default)(d);return(0,r.default)(l({},c,{lightness:(0,i.default)(0,1,c.lightness+parseFloat(u))}))});t.default=s,a.exports=t.default})(ae,ae.exports);const Ve=ue(ae.exports);function Ze(a){if(!document.querySelector("style[data-widget-styles]")){var t,n;(function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"#000",o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"FFF";const r=document.createElement("style");r.attributes.setNamedItem(document.createAttribute("data-widget-styles"));const e=Ne(i)>.5;r.textContent=`
|
|
150
|
+
`};function d(){for(var l=arguments.length,s=new Array(l),u=0;u<l;u++)s[u]=arguments[u];var c,f=s[0],g=[];for(c=1;c<s.length;c+=1)g.push(s[c]);return g.forEach(function(h){f=f.replace(/%[a-z]/,h)}),f}t.default=function(l){var s,u;function c(f){var g;if(process.env.NODE_ENV==="production")g=l.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 h=arguments.length,p=new Array(h>1?h-1:0),b=1;b<h;b++)p[b-1]=arguments[b];g=l.call(this,d.apply(void 0,[e[f]].concat(p)))||this}return function(C){if(C===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}(g)}return u=l,(s=c).prototype=Object.create(u.prototype),s.prototype.constructor=s,o(s,u),c}(n(Error)),a.exports=t.default})(R,R.exports);var _=R.exports;(function(a,t){t.__esModule=!0,t.default=function(h){if(typeof h!="string")throw new o.default(3);var p=(0,i.default)(h);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 b=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:b}}if(p.match(l))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(s)){var C=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:C}}var A=u.exec(p);if(A)return{red:parseInt(""+A[1],10),green:parseInt(""+A[2],10),blue:parseInt(""+A[3],10)};var y=c.exec(p.substring(0,50));if(y)return{red:parseInt(""+y[1],10),green:parseInt(""+y[2],10),blue:parseInt(""+y[3],10),alpha:parseFloat(""+y[4])>1?parseFloat(""+y[4])/100:parseFloat(""+y[4])};var E=f.exec(p);if(E){var Ee=parseInt(""+E[1],10),Oe=parseInt(""+E[2],10)/100,Be=parseInt(""+E[3],10)/100,ce="rgb("+(0,n.default)(Ee,Oe,Be)+")",O=u.exec(ce);if(!O)throw new o.default(4,p,ce);return{red:parseInt(""+O[1],10),green:parseInt(""+O[2],10),blue:parseInt(""+O[3],10)}}var w=g.exec(p.substring(0,50));if(w){var Ie=parseInt(""+w[1],10),Me=parseInt(""+w[2],10)/100,Te=parseInt(""+w[3],10)/100,pe="rgb("+(0,n.default)(Ie,Me,Te)+")",B=u.exec(pe);if(!B)throw new o.default(4,p,pe);return{red:parseInt(""+B[1],10),green:parseInt(""+B[2],10),blue:parseInt(""+B[3],10),alpha:parseFloat(""+w[4])>1?parseFloat(""+w[4])/100:parseFloat(""+w[4])}}throw new o.default(5)};var n=r(ue),i=r(Ne),o=r(_);function r(h){return h&&h.__esModule?h:{default:h}}var e=/^#[a-fA-F0-9]{6}$/,d=/^#[a-fA-F0-9]{8}$/,l=/^#[a-fA-F0-9]{3}$/,s=/^#[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,g=/^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})(z,z.exports);var fe=z.exports;(function(a,t){t.__esModule=!0,t.default=function(o){if(o==="transparent")return 0;var r=(0,i.default)(o),e=Object.keys(r).map(function(u){var c=r[u]/255;return c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4)}),d=e[0],l=e[1],s=e[2];return parseFloat((.2126*d+.7152*l+.0722*s).toFixed(3))};var n,i=(n=fe)&&n.__esModule?n:{default:n};a.exports=t.default})(q,q.exports);const Re=le(q.exports);var U={exports:{}},Y={exports:{}};(function(a,t){function n(i,o,r){return function(){var e=r.concat(Array.prototype.slice.call(arguments));return e.length>=o?i.apply(this,e):n(i,o,e)}}t.__esModule=!0,t.default=function(i){return n(i,i.length,[])},a.exports=t.default})(Y,Y.exports);var ye=Y.exports,J={exports:{}};(function(a,t){t.__esModule=!0,t.default=void 0,t.default=function(n,i,o){return Math.max(n,Math.min(i,o))},a.exports=t.default})(J,J.exports);var we=J.exports,G={exports:{}},V={exports:{}};(function(a,t){t.__esModule=!0,t.default=void 0,t.default=function(n){var i,o=n.red/255,r=n.green/255,e=n.blue/255,d=Math.max(o,r,e),l=Math.min(o,r,e),s=(d+l)/2;if(d===l)return n.alpha!==void 0?{hue:0,saturation:0,lightness:s,alpha:n.alpha}:{hue:0,saturation:0,lightness:s};var u=d-l,c=s>.5?u/(2-d-l):u/(d+l);switch(d){case o:i=(r-e)/u+(r<e?6:0);break;case r:i=(e-o)/u+2;break;default:i=(o-r)/u+4}return i*=60,n.alpha!==void 0?{hue:i,saturation:c,lightness:s,alpha:n.alpha}:{hue:i,saturation:c,lightness:s}},a.exports=t.default})(V,V.exports);var Ue=V.exports;(function(a,t){t.__esModule=!0,t.default=function(r){return(0,i.default)((0,n.default)(r))};var n=o(fe),i=o(Ue);function o(r){return r&&r.__esModule?r:{default:r}}a.exports=t.default})(G,G.exports);var xe=G.exports,Z={exports:{}},Q={exports:{}},X={exports:{}},ee={exports:{}};(function(a,t){t.__esModule=!0,t.default=void 0,t.default=function(n){return n.length===7&&n[1]===n[2]&&n[3]===n[4]&&n[5]===n[6]?"#"+n[1]+n[3]+n[5]:n},a.exports=t.default})(ee,ee.exports);var Se=ee.exports,te={exports:{}};(function(a,t){t.__esModule=!0,t.default=void 0,t.default=function(n){var i=n.toString(16);return i.length===1?"0"+i:i},a.exports=t.default})(te,te.exports);var _e=te.exports;(function(a,t){t.__esModule=!0,t.default=void 0;var n=r(ue),i=r(Se),o=r(_e);function r(l){return l&&l.__esModule?l:{default:l}}function e(l){return(0,o.default)(Math.round(255*l))}function d(l,s,u){return(0,i.default)("#"+e(l)+e(s)+e(u))}t.default=function(l,s,u){return(0,n.default)(l,s,u,d)},a.exports=t.default})(X,X.exports);var ke=X.exports;(function(a,t){t.__esModule=!0,t.default=function(r,e,d){if(typeof r=="number"&&typeof e=="number"&&typeof d=="number")return(0,n.default)(r,e,d);if(typeof r=="object"&&e===void 0&&d===void 0)return(0,n.default)(r.hue,r.saturation,r.lightness);throw new i.default(1)};var n=o(ke),i=o(_);function o(r){return r&&r.__esModule?r:{default:r}}a.exports=t.default})(Q,Q.exports);var Ye=Q.exports,ne={exports:{}};(function(a,t){t.__esModule=!0,t.default=function(e,d,l,s){if(typeof e=="number"&&typeof d=="number"&&typeof l=="number"&&typeof s=="number")return s>=1?(0,n.default)(e,d,l):"rgba("+(0,i.default)(e,d,l)+","+s+")";if(typeof e=="object"&&d===void 0&&l===void 0&&s===void 0)return e.alpha>=1?(0,n.default)(e.hue,e.saturation,e.lightness):"rgba("+(0,i.default)(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new o.default(2)};var n=r(ke),i=r(ue),o=r(_);function r(e){return e&&e.__esModule?e:{default:e}}a.exports=t.default})(ne,ne.exports);var Je=ne.exports,re={exports:{}};(function(a,t){t.__esModule=!0,t.default=function(e,d,l){if(typeof e=="number"&&typeof d=="number"&&typeof l=="number")return(0,n.default)("#"+(0,i.default)(e)+(0,i.default)(d)+(0,i.default)(l));if(typeof e=="object"&&d===void 0&&l===void 0)return(0,n.default)("#"+(0,i.default)(e.red)+(0,i.default)(e.green)+(0,i.default)(e.blue));throw new o.default(6)};var n=r(Se),i=r(_e),o=r(_);function r(e){return e&&e.__esModule?e:{default:e}}a.exports=t.default})(re,re.exports);var Ce=re.exports,ae={exports:{}};(function(a,t){t.__esModule=!0,t.default=function(e,d,l,s){if(typeof e=="string"&&typeof d=="number"){var u=(0,n.default)(e);return"rgba("+u.red+","+u.green+","+u.blue+","+d+")"}if(typeof e=="number"&&typeof d=="number"&&typeof l=="number"&&typeof s=="number")return s>=1?(0,i.default)(e,d,l):"rgba("+e+","+d+","+l+","+s+")";if(typeof e=="object"&&d===void 0&&l===void 0&&s===void 0)return e.alpha>=1?(0,i.default)(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new o.default(7)};var n=r(fe),i=r(Ce),o=r(_);function r(e){return e&&e.__esModule?e:{default:e}}a.exports=t.default})(ae,ae.exports);var Ge=ae.exports;(function(a,t){t.__esModule=!0,t.default=function(f){if(typeof f!="object")throw new e.default(8);if(s(f))return(0,r.default)(f);if(l(f))return(0,o.default)(f);if(c(f))return(0,i.default)(f);if(u(f))return(0,n.default)(f);throw new e.default(8)};var n=d(Ye),i=d(Je),o=d(Ce),r=d(Ge),e=d(_);function d(f){return f&&f.__esModule?f:{default:f}}var l=function(f){return typeof f.red=="number"&&typeof f.green=="number"&&typeof f.blue=="number"&&(typeof f.alpha!="number"||f.alpha===void 0)},s=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})(Z,Z.exports);var Ae=Z.exports;(function(a,t){t.__esModule=!0,t.default=void 0;var n=e(ye),i=e(we),o=e(xe),r=e(Ae);function e(s){return s&&s.__esModule?s:{default:s}}function d(){return d=Object.assign?Object.assign.bind():function(s){for(var u=1;u<arguments.length;u++){var c=arguments[u];for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(s[f]=c[f])}return s},d.apply(this,arguments)}var l=(0,n.default)(function(s,u){if(u==="transparent")return u;var c=(0,o.default)(u);return(0,r.default)(d({},c,{lightness:(0,i.default)(0,1,c.lightness-parseFloat(s))}))});t.default=l,a.exports=t.default})(U,U.exports);const Ve=le(U.exports);var ie={exports:{}};(function(a,t){t.__esModule=!0,t.default=void 0;var n=e(ye),i=e(we),o=e(xe),r=e(Ae);function e(s){return s&&s.__esModule?s:{default:s}}function d(){return d=Object.assign?Object.assign.bind():function(s){for(var u=1;u<arguments.length;u++){var c=arguments[u];for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(s[f]=c[f])}return s},d.apply(this,arguments)}var l=(0,n.default)(function(s,u){if(u==="transparent")return u;var c=(0,o.default)(u);return(0,r.default)(d({},c,{lightness:(0,i.default)(0,1,c.lightness+parseFloat(s))}))});t.default=l,a.exports=t.default})(ie,ie.exports);const Ze=le(ie.exports);function Qe(a){if(!document.querySelector("style[data-widget-styles]")){var t,n;(function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"#000",o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"FFF";const r=document.createElement("style");r.attributes.setNamedItem(document.createAttribute("data-widget-styles"));const e=Re(i)>.5;r.textContent=`
|
|
151
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}.bf-trigger-button.hidden{display:none}.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: 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.expanded{width:min(calc(448px * 1.35),calc(100vw - 16px));height:min(calc(750px * 1.35),calc(100vh - 80px))}}
|
|
152
152
|
.${j} { background: ${i}; }
|
|
153
153
|
.${j}:hover {
|
|
154
|
-
background: ${e?
|
|
154
|
+
background: ${e?Ve(.05,i):Ze(.05,i)};
|
|
155
155
|
}
|
|
156
156
|
.trigger-button-icon { color: ${o}; }
|
|
157
|
-
`,document.head.appendChild(r)})((a==null||(t=a.theme)===null||t===void 0?void 0:t.inputButtonBgColor)||"#007bff",(a==null||(n=a.theme)===null||n===void 0?void 0:n.textBaseColor)||"#ffffff")}}function
|
|
157
|
+
`,document.head.appendChild(r)})((a==null||(t=a.theme)===null||t===void 0?void 0:t.inputButtonBgColor)||"#007bff",(a==null||(n=a.theme)===null||n===void 0?void 0:n.textBaseColor)||"#ffffff")}}function Xe(a,t){const n=()=>{(i=>{var o;(o=a.contentWindow)===null||o===void 0||o.postMessage({type:"UPDATE_BODY_CLASS",isDarkMode:i},"*")})(document.body.classList.contains("dark"))};n(),(()=>{const i=new MutationObserver(n);i.observe(document.body,{attributes:!0,attributeFilter:["class"]}),t.addEventListener("abort",()=>i.disconnect())})()}function et(a,t){let n;const i=()=>{(r=>{var e;const d={type:"UPDATE_BODY_CLASS",isMobile:r};(e=a.contentWindow)===null||e===void 0||e.postMessage(d,"*"),r&&(v.isWidgetOpen?v.hideTriggerButton():v.showTriggerButton())})(document.body.clientWidth<=P)},o=()=>{n&&clearTimeout(n),n=window.setTimeout(i,300)};i(),(()=>{const r=new ResizeObserver(o);r.observe(document.body),t.addEventListener("abort",()=>r.disconnect())})()}function be(a){const t=new TextEncoder().encode(a);if(typeof window!="undefined"&&typeof window.btoa=="function"){const n=Array.from(t,i=>String.fromCharCode(i)).join("");return btoa(n)}if(typeof Buffer!="undefined")return Buffer.from(t).toString("base64");throw new Error("[utils.base64Encode]: Unsupported environment")}const ve=new Set;function tt(a,t,n){const i=document.createDocumentFragment(),o=function(d,l){const s=I("button",j,{id:`trigger-button-${d}`,"aria-controls":T,"aria-expanded":"false","data-name":j}),u=I("div","trigger-button-icon",{"aria-hidden":"true"});return u.innerHTML=`
|
|
158
158
|
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">
|
|
159
159
|
<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>
|
|
160
160
|
</svg>
|
|
161
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
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
163
|
</svg>
|
|
164
|
-
`,
|
|
164
|
+
`,s.setAttribute("aria-label","Open Brainfish widget"),s.appendChild(u),v.initialize(s,u,l),s}(a,n),{iframeContainer:r,iframe:e}=function(d){const l=I("div",T,{id:T,"aria-live":"polite","aria-hidden":"true"}),s=I("iframe","trigger-iframe",{src:d,sandbox:"allow-scripts allow-same-origin allow-popups allow-forms",allow:"clipboard-write",role:"dialog"});return l.appendChild(s),{iframeContainer:l,iframe:s}}(t);return i.appendChild(o),i.appendChild(r),{fragment:i,iframe:e}}const nt=(a,t)=>{const n=de(a.overrides),i=((o=a.overrides)==null?void 0:o.widgetHost)||"https://agent.brainfi.sh";var o;const{theme:r,settings:e}=t,d=`${i}/?widgetKey=${a.widgetKey}&themeParam=${be(JSON.stringify(r))}&settingsParam=${be(JSON.stringify(e))}`,l=e==null?void 0:e.hideTriggerButton;try{if(s=a.widgetKey,ve.has(s)||function(p){return!!document.getElementById(`trigger-button-${p}`)}(a.widgetKey))return;Qe(t);const{fragment:u,iframe:c}=tt(a.widgetKey,d,l||!1),f=new AbortController,{signal:g}=f;c.onload=()=>{setTimeout(()=>{Xe(c,g),De({widgetHost:i,apiHost:n,widgetKey:a.widgetKey,signal:g}),et(c,g)},0)},document.body.appendChild(u),ve.add(a.widgetKey);const h=()=>{f.abort(),window.removeEventListener("beforeunload",h)};return void window.addEventListener("beforeunload",h)}catch(u){(function(c,f,g){x(c,f,f.message,g)})(n,u,a.widgetKey)}var s};let M=null;const oe=typeof window!="undefined"&&window.Brainfish?window.Brainfish:(M||(M=function(){let a=[],t=null;function n(o,r){if(t){const e=o.split(".");let d=t;for(let s=0;s<e.length-1;s++)d=d[e[s]];const l=d[e[e.length-1]];if(typeof l=="function")return l.apply(d,r)}else a.push([o,r])}return{Widgets:{init:function(){for(var o=arguments.length,r=new Array(o),e=0;e<o;e++)r[e]=arguments[e];return n("Widgets.init",r)}},SearchWidget:{initStandard:function(){for(var o=arguments.length,r=new Array(o),e=0;e<o;e++)r[e]=arguments[e];return n("SearchWidget.initStandard",r)}},HelpWidget:{initPopup:function(){for(var o=arguments.length,r=new Array(o),e=0;e<o;e++)r[e]=arguments[e];return n("HelpWidget.initPopup",r)},close:function(){for(var o=arguments.length,r=new Array(o),e=0;e<o;e++)r[e]=arguments[e];return n("HelpWidget.close",r)},open:function(){for(var o=arguments.length,r=new Array(o),e=0;e<o;e++)r[e]=arguments[e];return n("HelpWidget.open",r)},toggle:function(){for(var o=arguments.length,r=new Array(o),e=0;e<o;e++)r[e]=arguments[e];return n("HelpWidget.toggle",r)}},_setRealBrainfish:function(o){for(t=o;a.length>0;){const[r,e]=a.shift();n(r,e)}}}}(),typeof window!="undefined"&&(window.Brainfish=M)),M);let $=null;oe.Widgets.init=a=>m(exports,null,function*(){window&&(window.BrainfishAnalytics=window.BrainfishAnalytics||function(){for(var r=arguments.length,e=new Array(r),d=0;d<r;d++)e[d]=arguments[d];(window.BrainfishAnalytics.q=window.BrainfishAnalytics.q||[]).push(e)});const t=de(a.overrides),n=((i=a.overrides)==null?void 0:i.analyticsApiHost)||"";var i;let o;if(a.config)o=JSON.parse((r=>{if(typeof window!="undefined"&&typeof window.atob=="function"){const e=atob(r),d=e.length,l=new Uint8Array(d);for(let s=0;s<d;s++)l[s]=e.charCodeAt(s);return new TextDecoder().decode(l)}if(typeof Buffer!="undefined")return Buffer.from(r,"base64").toString("utf-8");throw new Error("[utils.base64Decode]: Unsupported environment")})(a.config));else{const{config:r}=yield He({widgetKey:a.widgetKey,apiHost:t});o=r}$||($=function(r,e,d,l){return m(this,null,function*(){var s,u,c;const f=((s=r.overrides)===null||s===void 0?void 0:s.enableRecording)||(e==null||(u=e.settings)===null||u===void 0?void 0:u.enableRecording)||!1,g=((c=r.overrides)===null||c===void 0?void 0:c.version)||(e==null?void 0:e.version),h=[];g!=null&&g.startsWith("2.")?nt(r,e):h.push(qe(r,e)),h.push(ze(r.widgetKey,e.trackingToken||"",d,l,f));const[p]=yield Promise.allSettled(h);p&&p.status==="fulfilled"&&p.value&&oe._setRealBrainfish(p.value)})}(a,o,t,n)),yield $});exports.BrainfishAnalytics=function(){typeof window!="undefined"&&window.BrainfishAnalytics&&window.BrainfishAnalytics(...arguments)},exports.default=oe;
|
|
165
165
|
//# sourceMappingURL=web.cjs.js.map
|