mind-link-ai-widget
Version:
A react widget for React Web and React-Native Mobile integrations.
20 lines (19 loc) • 58.4 kB
JavaScript
(function(w,G){typeof exports=="object"&&typeof module<"u"?module.exports=G(require("react")):typeof define=="function"&&define.amd?define(["react"],G):(w=typeof globalThis<"u"?globalThis:w||self,w.MindLinkAIWidget=G(w.React))})(this,function(w){"use strict";function G(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const d=G(w);var ue={exports:{}},Y={};/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Se;function dt(){if(Se)return Y;Se=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,i){var u=null;if(i!==void 0&&(u=""+i),a.key!==void 0&&(u=""+a.key),"key"in a){i={};for(var h in a)h!=="key"&&(i[h]=a[h])}else i=a;return a=i.ref,{$$typeof:e,type:r,key:u,ref:a!==void 0?a:null,props:i}}return Y.Fragment=t,Y.jsx=n,Y.jsxs=n,Y}var ke;function ht(){return ke||(ke=1,ue.exports=dt()),ue.exports}var o=ht(),Pe={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Re=w.createContext&&w.createContext(Pe),ft=["attr","size","title"];function mt(e,t){if(e==null)return{};var n=pt(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function pt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ee(){return ee=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ee.apply(this,arguments)}function Le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function te(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Le(Object(n),!0).forEach(function(r){vt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Le(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vt(e,t,n){return t=gt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gt(e){var t=xt(e,"string");return typeof t=="symbol"?t:t+""}function xt(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ie(e){return e&&e.map((t,n)=>w.createElement(t.tag,te({key:n},t.attr),Ie(t.child)))}function P(e){return t=>w.createElement(yt,ee({attr:te({},e.attr)},t),Ie(e.child))}function yt(e){var t=n=>{var{attr:r,size:a,title:i}=e,u=mt(e,ft),h=a||n.size||"1em",s;return n.className&&(s=n.className),e.className&&(s=(s?s+" ":"")+e.className),w.createElement("svg",ee({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,u,{className:s,style:te(te({color:e.color||n.color},n.style),e.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),i&&w.createElement("title",null,i),e.children)};return Re!==void 0?w.createElement(Re.Consumer,null,n=>t(n)):t(Pe)}function $e(e){return P({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 112a56 56 0 1 1 56-56 56.06 56.06 0 0 1-56 56z"},child:[]},{tag:"path",attr:{d:"m432 112.8-.45.12-.42.13c-1 .28-2 .58-3 .89-18.61 5.46-108.93 30.92-172.56 30.92-59.13 0-141.28-22-167.56-29.47a73.79 73.79 0 0 0-8-2.58c-19-5-32 14.3-32 31.94 0 17.47 15.7 25.79 31.55 31.76v.28l95.22 29.74c9.73 3.73 12.33 7.54 13.6 10.84 4.13 10.59.83 31.56-.34 38.88l-5.8 45-32.19 176.19q-.15.72-.27 1.47l-.23 1.27c-2.32 16.15 9.54 31.82 32 31.82 19.6 0 28.25-13.53 32-31.94s28-157.57 42-157.57 42.84 157.57 42.84 157.57c3.75 18.41 12.4 31.94 32 31.94 22.52 0 34.38-15.74 32-31.94a57.17 57.17 0 0 0-.76-4.06L329 301.27l-5.79-45c-4.19-26.21-.82-34.87.32-36.9a1.09 1.09 0 0 0 .08-.15c1.08-2 6-6.48 17.48-10.79l89.28-31.21a16.9 16.9 0 0 0 1.62-.52c16-6 32-14.3 32-31.93S451 107.81 432 112.8z"},child:[]}]})(e)}function bt(e){return P({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M244 400 100 256l144-144M120 256h292"},child:[]}]})(e)}function wt(e){return P({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"m112 244 144-144 144 144M256 120v292"},child:[]}]})(e)}function Nt(e){return P({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"32",d:"M216.08 192v143.85a40.08 40.08 0 0 0 80.15 0l.13-188.55a67.94 67.94 0 1 0-135.87 0v189.82a95.51 95.51 0 1 0 191 0V159.74"},child:[]}]})(e)}function Ae(e){return P({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M400 32H112a48 48 0 0 0-48 48v320a47.91 47.91 0 0 0 16 35.74V454a26 26 0 0 0 26 26h28a26 26 0 0 0 26-26v-6h192v6a26 26 0 0 0 26 26h28a26 26 0 0 0 26-26v-18.26A47.91 47.91 0 0 0 448 400V80a48 48 0 0 0-48-48zM147.47 399.82a32 32 0 1 1 28.35-28.35 32 32 0 0 1-28.35 28.35zM236 288H112a16 16 0 0 1-16-16V144a16 16 0 0 1 16-16h124a4 4 0 0 1 4 4v152a4 4 0 0 1-4 4zm20-192H112.46c-8.6 0-16-6.6-16.44-15.19A16 16 0 0 1 112 64h287.54c8.6 0 16 6.6 16.44 15.19A16 16 0 0 1 400 96H256zm20 32h124a16 16 0 0 1 16 16v128a16 16 0 0 1-16 16H276a4 4 0 0 1-4-4V132a4 4 0 0 1 4-4zm60.18 243.47a32 32 0 1 1 28.35 28.35 32 32 0 0 1-28.35-28.35z"},child:[]}]})(e)}function Me(e){return P({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M391 480c-19.52 0-46.94-7.06-88-30-49.93-28-88.55-53.85-138.21-103.38C116.91 298.77 93.61 267.79 61 208.45c-36.84-67-30.56-102.12-23.54-117.13C45.82 73.38 58.16 62.65 74.11 52a176.3 176.3 0 0 1 28.64-15.2c1-.43 1.93-.84 2.76-1.21 4.95-2.23 12.45-5.6 21.95-2 6.34 2.38 12 7.25 20.86 16 18.17 17.92 43 57.83 52.16 77.43 6.15 13.21 10.22 21.93 10.23 31.71 0 11.45-5.76 20.28-12.75 29.81-1.31 1.79-2.61 3.5-3.87 5.16-7.61 10-9.28 12.89-8.18 18.05 2.23 10.37 18.86 41.24 46.19 68.51s57.31 42.85 67.72 45.07c5.38 1.15 8.33-.59 18.65-8.47 1.48-1.13 3-2.3 4.59-3.47 10.66-7.93 19.08-13.54 30.26-13.54h.06c9.73 0 18.06 4.22 31.86 11.18 18 9.08 59.11 33.59 77.14 51.78 8.77 8.84 13.66 14.48 16.05 20.81 3.6 9.53.21 17-2 22-.37.83-.78 1.74-1.21 2.75a176.49 176.49 0 0 1-15.29 28.58c-10.63 15.9-21.4 28.21-39.38 36.58A67.42 67.42 0 0 1 391 480z"},child:[]}]})(e)}function jt(e){return P({attr:{viewBox:"0 0 512 512"},child:[{tag:"circle",attr:{cx:"256",cy:"256",r:"48"},child:[]},{tag:"circle",attr:{cx:"256",cy:"416",r:"48"},child:[]},{tag:"circle",attr:{cx:"256",cy:"96",r:"48"},child:[]}]})(e)}function _e(e){return P({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M340.75 344.49c5.91-20.7 9.82-44.75 11.31-67.84a4.41 4.41 0 0 0-4.46-4.65h-71.06a4.43 4.43 0 0 0-4.47 4.39v55.3a4.44 4.44 0 0 0 4.14 4.38 273.51 273.51 0 0 1 59 11.39 4.45 4.45 0 0 0 5.54-2.97zm-17.17 32.82a260.05 260.05 0 0 0-46.6-9.09 4.42 4.42 0 0 0-4.91 4.29v65.24a4.47 4.47 0 0 0 6.76 3.7c15.9-9.27 29-24.84 40.84-45.43 1.94-3.36 4.89-9.15 6.67-12.69a4.29 4.29 0 0 0-2.76-6.02zm-88.29-8.91a256.85 256.85 0 0 0-46.56 8.82c-2.64.76-3.75 4.4-2.55 6.79 1.79 3.56 4 8.11 5.89 11.51 13 23 26.84 37.5 41.24 45.93a4.47 4.47 0 0 0 6.76-3.7v-65.27a4.16 4.16 0 0 0-4.78-4.08zm.31-96.4h-71.06a4.41 4.41 0 0 0-4.46 4.64c1.48 23.06 5.37 47.16 11.26 67.84a4.46 4.46 0 0 0 5.59 3 272.2 272.2 0 0 1 59-11.36 4.44 4.44 0 0 0 4.15-4.38V276.4a4.43 4.43 0 0 0-4.48-4.4zM277 143.78a235.8 235.8 0 0 0 46.5-9.14 4.3 4.3 0 0 0 2.76-6c-1.79-3.57-4.27-8.68-6.17-12.09-12.29-22-26.14-37.35-41.24-46a4.48 4.48 0 0 0-6.76 3.7v65.23a4.43 4.43 0 0 0 4.91 4.3zm-.46 96.22h71.06a4.39 4.39 0 0 0 4.46-4.58c-1.48-22.77-5.27-47.8-11.16-68.22a4.46 4.46 0 0 0-5.59-2.95c-19 5.74-38.79 10.43-59.09 12a4.4 4.4 0 0 0-4.15 4.32v55.11a4.4 4.4 0 0 0 4.47 4.32zM233.31 70.56c-15.42 8.57-29.17 24.43-41.47 46.37-1.91 3.41-4.19 8.11-6 11.67a4.31 4.31 0 0 0 2.76 6 225.42 225.42 0 0 0 46.54 9.17 4.43 4.43 0 0 0 4.91-4.29V74.26a4.49 4.49 0 0 0-6.74-3.7zm2.61 105.7c-20.3-1.55-40.11-6.24-59.09-12a4.46 4.46 0 0 0-5.59 2.95c-5.89 20.42-9.68 45.45-11.16 68.22a4.39 4.39 0 0 0 4.46 4.58h71.06a4.4 4.4 0 0 0 4.47-4.34v-55.09a4.4 4.4 0 0 0-4.15-4.32z"},child:[]},{tag:"path",attr:{d:"M414.39 97.61A224 224 0 1 0 97.61 414.39 224 224 0 1 0 414.39 97.61zM176.6 430.85a219.08 219.08 0 0 1-12.48-19.66c-2-3.69-4.84-9.26-6.73-13.13a7.29 7.29 0 0 0-10.31-3.16c-4.3 2.41-10 5.72-14.13 8.43a147.29 147.29 0 0 1-23.57-22.43 248.83 248.83 0 0 1 30.41-18.36c1.86-1 2.77-2.14 2.18-4.18a374.8 374.8 0 0 1-14.09-82.17 4.36 4.36 0 0 0-4.3-4.17H66.84a2 2 0 0 1-2-1.7A98.28 98.28 0 0 1 64 256a96.27 96.27 0 0 1 .86-14.29 2 2 0 0 1 2-1.7h56.74c2.29 0 4.17-1.32 4.29-3.63a372.71 372.71 0 0 1 14-81.83 4.36 4.36 0 0 0-2.19-5.11 260.63 260.63 0 0 1-29.84-17.9 169.82 169.82 0 0 1 23.14-22.8c4.08 2.68 9.4 5.71 13.66 8.11a7.89 7.89 0 0 0 11-3.42c1.88-3.87 4-8.18 6.06-11.88a221.93 221.93 0 0 1 12.54-19.91A185 185 0 0 1 256 64c28.94 0 55.9 7 80.53 18.46a202.23 202.23 0 0 1 12 19c2.59 4.66 5.34 10.37 7.66 15.32a4.29 4.29 0 0 0 5.92 1.94c5.38-2.91 11.21-6.26 16.34-9.63a171.36 171.36 0 0 1 23.2 23 244.89 244.89 0 0 1-29.06 17.31 4.35 4.35 0 0 0-2.18 5.12 348.68 348.68 0 0 1 13.85 81.4 4.33 4.33 0 0 0 4.3 4.12l56.62-.07a2 2 0 0 1 2 1.7 117.46 117.46 0 0 1 0 28.62 2 2 0 0 1-2 1.72h-56.67a4.35 4.35 0 0 0-4.3 4.17 367.4 367.4 0 0 1-13.87 81.3 4.45 4.45 0 0 0 2.19 5.19c5 2.59 10.57 5.48 15.37 8.42s9.55 6.08 14.13 9.34a172.73 172.73 0 0 1-23 22.93c-2.44-1.61-5.34-3.44-7.84-4.94-1.72-1-4.89-2.77-6.65-3.76-3.82-2.14-7.88-.54-9.79 3.4s-4.83 9.59-6.87 13.25a212.42 212.42 0 0 1-12.35 19.53C310.91 442.37 284.94 448 256 448s-54.77-5.63-79.4-17.15z"},child:[]}]})(e)}function Te(e){return P({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"m478.33 433.6-90-218a22 22 0 0 0-40.67 0l-90 218a22 22 0 1 0 40.67 16.79L316.66 406h102.67l18.33 44.39A22 22 0 0 0 458 464a22 22 0 0 0 20.32-30.4zM334.83 362 368 281.65 401.17 362zm-66.99-19.08a22 22 0 0 0-4.89-30.7c-.2-.15-15-11.13-36.49-34.73 39.65-53.68 62.11-114.75 71.27-143.49H330a22 22 0 0 0 0-44H214V70a22 22 0 0 0-44 0v20H54a22 22 0 0 0 0 44h197.25c-9.52 26.95-27.05 69.5-53.79 108.36-31.41-41.68-43.08-68.65-43.17-68.87a22 22 0 0 0-40.58 17c.58 1.38 14.55 34.23 52.86 83.93.92 1.19 1.83 2.35 2.74 3.51-39.24 44.35-77.74 71.86-93.85 80.74a22 22 0 1 0 21.07 38.63c2.16-1.18 48.6-26.89 101.63-85.59 22.52 24.08 38 35.44 38.93 36.1a22 22 0 0 0 30.75-4.9z"},child:[]}]})(e)}function De(e){return P({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 32C167.67 32 96 96.51 96 176c0 128 160 304 160 304s160-176 160-304c0-79.49-71.67-144-160-144zm0 224a64 64 0 1 1 64-64 64.07 64.07 0 0 1-64 64z"},child:[]}]})(e)}function Oe(e){return P({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M424 80H88a56.06 56.06 0 0 0-56 56v240a56.06 56.06 0 0 0 56 56h336a56.06 56.06 0 0 0 56-56V136a56.06 56.06 0 0 0-56-56zm-14.18 92.63-144 112a16 16 0 0 1-19.64 0l-144-112a16 16 0 1 1 19.64-25.26L256 251.73l134.18-104.36a16 16 0 0 1 19.64 25.26z"},child:[]}]})(e)}function Be(e){return P({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",d:"M336 64H176a16 16 0 0 0-16 16v16h192V80a16 16 0 0 0-16-16z"},child:[]},{tag:"path",attr:{d:"M432 96h-48V80a48.05 48.05 0 0 0-48-48H176a48.05 48.05 0 0 0-48 48v16H80a64.07 64.07 0 0 0-64 64v256a64 64 0 0 0 64 64h352a64 64 0 0 0 64-64V160a64.07 64.07 0 0 0-64-64zm-96 208h-64v64a16 16 0 0 1-32 0v-64h-64a16 16 0 0 1 0-32h64v-64a16 16 0 0 1 32 0v64h64a16 16 0 0 1 0 32zm16-208H160V80a16 16 0 0 1 16-16h160a16 16 0 0 1 16 16z"},child:[]}]})(e)}function ze(e){return P({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M192 448h128m64-240v32c0 70.4-57.6 128-128 128h0c-70.4 0-128-57.6-128-128v-32m128 160v80"},child:[]},{tag:"path",attr:{d:"M256 320a78.83 78.83 0 0 1-56.55-24.1A80.89 80.89 0 0 1 176 239V128a79.69 79.69 0 0 1 80-80c44.86 0 80 35.14 80 80v111c0 44.66-35.89 81-80 81z"},child:[]}]})(e)}function He(e){return P({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M288 256c52.79 0 99.43-49.71 104-110.82 2.27-30.7-7.36-59.33-27.12-80.6C345.33 43.57 318 32 288 32c-30.24 0-57.59 11.5-77 32.38-19.63 21.11-29.2 49.8-27 80.78C188.49 206.28 235.12 256 288 256zm207.38 183.76c-8.44-46.82-34.79-86.15-76.19-113.75C382.42 301.5 335.83 288 288 288s-94.42 13.5-131.19 38c-41.4 27.6-67.75 66.93-76.19 113.75-1.93 10.73.69 21.34 7.19 29.11A30.94 30.94 0 0 0 112 480h352a30.94 30.94 0 0 0 24.21-11.13c6.48-7.77 9.1-18.38 7.17-29.11zM104 288v-40h40a16 16 0 0 0 0-32h-40v-40a16 16 0 0 0-32 0v40H32a16 16 0 0 0 0 32h40v40a16 16 0 0 0 32 0z"},child:[]}]})(e)}function Fe(e){return P({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 384.39a32 32 0 0 1-13-2.77 15.77 15.77 0 0 1-2.71-1.54l-82.71-58.22A32 32 0 0 1 352 295.7v-79.4a32 32 0 0 1 13.58-26.16l82.71-58.22a15.77 15.77 0 0 1 2.71-1.54 32 32 0 0 1 45 29.24v192.76a32 32 0 0 1-32 32zM268 400H84a68.07 68.07 0 0 1-68-68V180a68.07 68.07 0 0 1 68-68h184.48A67.6 67.6 0 0 1 336 179.52V332a68.07 68.07 0 0 1-68 68z"},child:[]}]})(e)}var ne,Ct=new Uint8Array(16);function Et(){if(!ne&&(ne=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!ne))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ne(Ct)}const St=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function kt(e){return typeof e=="string"&&St.test(e)}for(var S=[],de=0;de<256;++de)S.push((de+256).toString(16).substr(1));function Pt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(S[e[t+0]]+S[e[t+1]]+S[e[t+2]]+S[e[t+3]]+"-"+S[e[t+4]]+S[e[t+5]]+"-"+S[e[t+6]]+S[e[t+7]]+"-"+S[e[t+8]]+S[e[t+9]]+"-"+S[e[t+10]]+S[e[t+11]]+S[e[t+12]]+S[e[t+13]]+S[e[t+14]]+S[e[t+15]]).toLowerCase();if(!kt(n))throw TypeError("Stringified UUID is invalid");return n}function Rt(e,t,n){e=e||{};var r=e.random||(e.rng||Et)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Pt(r)}const Lt=Rt();function It(){const e=new Date().getHours();return e<12?"Good Morning":e<18?"Good Afternoon":"Good Evening"}function he(e,t=1){return e.slice().sort(()=>.5-Math.random()).slice(0,t)}function We(e){const t=e.replace(/\D/g,"");return t.length===10?`(${t.slice(0,3)}) ${t.slice(3,6)}-${t.slice(6)}`:t.length===11&&t.startsWith("1")?`+1 (${t.slice(1,4)}) ${t.slice(4,7)}-${t.slice(7)}`:e}function fe(e){return e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase())}async function $t(e){const n=await fetch("http://localhost:8000/api/v1/intents-and-entities",{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json","x-csid":Lt},body:JSON.stringify({query:e})});if(!n.ok)throw new Error("Network error");return n.json()}async function Ue(e){const n=await fetch("http://localhost:8000/api/v1/crediblemind/suggest",{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json"},body:JSON.stringify({query:e})});if(!n.ok)throw new Error("Network error");return n.json()}async function At(e){const n=await fetch("http://localhost:8000/api/v1/providers/search",{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error("Network error");return n.json()}/**
* react-router v7.7.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function k(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function T(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function me({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function pe(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Ve(e,t,n="/"){return Mt(e,t,n,!1)}function Mt(e,t,n,r){let a=typeof t=="string"?pe(t):t,i=F(a.pathname||"/",n);if(i==null)return null;let u=qe(e);_t(u);let h=null;for(let s=0;h==null&&s<u.length;++s){let c=qt(i);h=Ut(u[s],c,r)}return h}function qe(e,t=[],n=[],r=""){let a=(i,u,h)=>{let s={relativePath:h===void 0?i.path||"":h,caseSensitive:i.caseSensitive===!0,childrenIndex:u,route:i};s.relativePath.startsWith("/")&&(k(s.relativePath.startsWith(r),`Absolute route path "${s.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),s.relativePath=s.relativePath.slice(r.length));let c=D([r,s.relativePath]),m=n.concat(s);i.children&&i.children.length>0&&(k(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),qe(i.children,t,m,c)),!(i.path==null&&!i.index)&&t.push({path:c,score:Ft(c,i.index),routesMeta:m})};return e.forEach((i,u)=>{if(i.path===""||!i.path?.includes("?"))a(i,u);else for(let h of Je(i.path))a(i,u,h)}),t}function Je(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let u=Je(r.join("/")),h=[];return h.push(...u.map(s=>s===""?i:[i,s].join("/"))),a&&h.push(...u),h.map(s=>e.startsWith("/")&&s===""?"/":s)}function _t(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Wt(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Tt=/^:[\w-]+$/,Dt=3,Ot=2,Bt=1,zt=10,Ht=-2,Ge=e=>e==="*";function Ft(e,t){let n=e.split("/"),r=n.length;return n.some(Ge)&&(r+=Ht),t&&(r+=Ot),n.filter(a=>!Ge(a)).reduce((a,i)=>a+(Tt.test(i)?Dt:i===""?Bt:zt),r)}function Wt(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function Ut(e,t,n=!1){let{routesMeta:r}=e,a={},i="/",u=[];for(let h=0;h<r.length;++h){let s=r[h],c=h===r.length-1,m=i==="/"?t:t.slice(i.length)||"/",p=ae({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},m),g=s.route;if(!p&&c&&n&&!r[r.length-1].route.index&&(p=ae({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},m)),!p)return null;Object.assign(a,p.params),u.push({params:a,pathname:D([i,p.pathname]),pathnameBase:Kt(D([i,p.pathnameBase])),route:g}),p.pathnameBase!=="/"&&(i=D([i,p.pathnameBase]))}return u}function ae(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Vt(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let i=a[0],u=i.replace(/(.)\/+$/,"$1"),h=a.slice(1);return{params:r.reduce((c,{paramName:m,isOptional:p},g)=>{if(m==="*"){let x=h[g]||"";u=i.slice(0,i.length-x.length).replace(/(.)\/+$/,"$1")}const N=h[g];return p&&!N?c[m]=void 0:c[m]=(N||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:u,pattern:e}}function Vt(e,t=!1,n=!0){T(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,h,s)=>(r.push({paramName:h,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function qt(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return T(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function F(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Jt(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?pe(e):e;return{pathname:n?n.startsWith("/")?n:Gt(n,t):t,search:Xt(r),hash:Qt(a)}}function Gt(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function ve(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Yt(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ye(e){let t=Yt(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Ke(e,t,n,r=!1){let a;typeof e=="string"?a=pe(e):(a={...e},k(!a.pathname||!a.pathname.includes("?"),ve("?","pathname","search",a)),k(!a.pathname||!a.pathname.includes("#"),ve("#","pathname","hash",a)),k(!a.search||!a.search.includes("#"),ve("#","search","hash",a)));let i=e===""||a.pathname==="",u=i?"/":a.pathname,h;if(u==null)h=n;else{let p=t.length-1;if(!r&&u.startsWith("..")){let g=u.split("/");for(;g[0]==="..";)g.shift(),p-=1;a.pathname=g.join("/")}h=p>=0?t[p]:"/"}let s=Jt(a,h),c=u&&u!=="/"&&u.endsWith("/"),m=(i||u===".")&&n.endsWith("/");return!s.pathname.endsWith("/")&&(c||m)&&(s.pathname+="/"),s}var D=e=>e.join("/").replace(/\/\/+/g,"/"),Kt=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Xt=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Qt=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Zt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Xe=["POST","PUT","PATCH","DELETE"];new Set(Xe);var en=["GET",...Xe];new Set(en);var q=d.createContext(null);q.displayName="DataRouter";var re=d.createContext(null);re.displayName="DataRouterState",d.createContext(!1);var Qe=d.createContext({isTransitioning:!1});Qe.displayName="ViewTransition";var tn=d.createContext(new Map);tn.displayName="Fetchers";var nn=d.createContext(null);nn.displayName="Await";var O=d.createContext(null);O.displayName="Navigation";var ge=d.createContext(null);ge.displayName="Location";var B=d.createContext({outlet:null,matches:[],isDataRoute:!1});B.displayName="Route";var xe=d.createContext(null);xe.displayName="RouteError";function an(e,{relative:t}={}){k(ie(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=d.useContext(O),{hash:a,pathname:i,search:u}=K(e,{relative:t}),h=i;return n!=="/"&&(h=i==="/"?n:D([n,i])),r.createHref({pathname:h,search:u,hash:a})}function ie(){return d.useContext(ge)!=null}function V(){return k(ie(),"useLocation() may be used only in the context of a <Router> component."),d.useContext(ge).location}var Ze="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function et(e){d.useContext(O).static||d.useLayoutEffect(e)}function rn(){let{isDataRoute:e}=d.useContext(B);return e?xn():on()}function on(){k(ie(),"useNavigate() may be used only in the context of a <Router> component.");let e=d.useContext(q),{basename:t,navigator:n}=d.useContext(O),{matches:r}=d.useContext(B),{pathname:a}=V(),i=JSON.stringify(Ye(r)),u=d.useRef(!1);return et(()=>{u.current=!0}),d.useCallback((s,c={})=>{if(T(u.current,Ze),!u.current)return;if(typeof s=="number"){n.go(s);return}let m=Ke(s,JSON.parse(i),a,c.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:D([t,m.pathname])),(c.replace?n.replace:n.push)(m,c.state,c)},[t,n,i,a,e])}d.createContext(null);function K(e,{relative:t}={}){let{matches:n}=d.useContext(B),{pathname:r}=V(),a=JSON.stringify(Ye(n));return d.useMemo(()=>Ke(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function ln(e,t,n,r){k(ie(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=d.useContext(O),{matches:i}=d.useContext(B),u=i[i.length-1],h=u?u.params:{},s=u?u.pathname:"/",c=u?u.pathnameBase:"/",m=u&&u.route;{let v=m&&m.path||"";nt(s,!m||v.endsWith("*")||v.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${v}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}/*`}">.`)}let p=V(),g;g=p;let N=g.pathname||"/",x=N;if(c!=="/"){let v=c.replace(/^\//,"").split("/");x="/"+N.replace(/^\//,"").split("/").slice(v.length).join("/")}let y=Ve(e,{pathname:x});return T(m||y!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),T(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),hn(y&&y.map(v=>Object.assign({},v,{params:Object.assign({},h,v.params),pathname:D([c,a.encodeLocation?a.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:D([c,a.encodeLocation?a.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),i,n,r)}function sn(){let e=gn(),t=Zt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=d.createElement(d.Fragment,null,d.createElement("p",null,"💿 Hey developer 👋"),d.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",d.createElement("code",{style:i},"ErrorBoundary")," or"," ",d.createElement("code",{style:i},"errorElement")," prop on your route.")),d.createElement(d.Fragment,null,d.createElement("h2",null,"Unexpected Application Error!"),d.createElement("h3",{style:{fontStyle:"italic"}},t),n?d.createElement("pre",{style:a},n):null,u)}var cn=d.createElement(sn,null),un=class extends d.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?d.createElement(B.Provider,{value:this.props.routeContext},d.createElement(xe.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function dn({routeContext:e,match:t,children:n}){let r=d.useContext(q);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),d.createElement(B.Provider,{value:e},n)}function hn(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,i=n?.errors;if(i!=null){let s=a.findIndex(c=>c.route.id&&i?.[c.route.id]!==void 0);k(s>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,s+1))}let u=!1,h=-1;if(n)for(let s=0;s<a.length;s++){let c=a[s];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(h=s),c.route.id){let{loaderData:m,errors:p}=n,g=c.route.loader&&!m.hasOwnProperty(c.route.id)&&(!p||p[c.route.id]===void 0);if(c.route.lazy||g){u=!0,h>=0?a=a.slice(0,h+1):a=[a[0]];break}}}return a.reduceRight((s,c,m)=>{let p,g=!1,N=null,x=null;n&&(p=i&&c.route.id?i[c.route.id]:void 0,N=c.route.errorElement||cn,u&&(h<0&&m===0?(nt("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),g=!0,x=null):h===m&&(g=!0,x=c.route.hydrateFallbackElement||null)));let y=t.concat(a.slice(0,m+1)),j=()=>{let v;return p?v=N:g?v=x:c.route.Component?v=d.createElement(c.route.Component,null):c.route.element?v=c.route.element:v=s,d.createElement(dn,{match:c,routeContext:{outlet:s,matches:y,isDataRoute:n!=null},children:v})};return n&&(c.route.ErrorBoundary||c.route.errorElement||m===0)?d.createElement(un,{location:n.location,revalidation:n.revalidation,component:N,error:p,children:j(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):j()},null)}function ye(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fn(e){let t=d.useContext(q);return k(t,ye(e)),t}function mn(e){let t=d.useContext(re);return k(t,ye(e)),t}function pn(e){let t=d.useContext(B);return k(t,ye(e)),t}function be(e){let t=pn(e),n=t.matches[t.matches.length-1];return k(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function vn(){return be("useRouteId")}function gn(){let e=d.useContext(xe),t=mn("useRouteError"),n=be("useRouteError");return e!==void 0?e:t.errors?.[n]}function xn(){let{router:e}=fn("useNavigate"),t=be("useNavigate"),n=d.useRef(!1);return et(()=>{n.current=!0}),d.useCallback(async(a,i={})=>{T(n.current,Ze),n.current&&(typeof a=="number"?e.navigate(a):await e.navigate(a,{fromRouteId:t,...i}))},[e,t])}var tt={};function nt(e,t,n){!t&&!tt[e]&&(tt[e]=!0,T(!1,n))}d.memo(yn);function yn({routes:e,future:t,state:n}){return ln(e,void 0,n,t)}var oe="get",le="application/x-www-form-urlencoded";function se(e){return e!=null&&typeof e.tagName=="string"}function bn(e){return se(e)&&e.tagName.toLowerCase()==="button"}function wn(e){return se(e)&&e.tagName.toLowerCase()==="form"}function Nn(e){return se(e)&&e.tagName.toLowerCase()==="input"}function jn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Cn(e,t){return e.button===0&&(!t||t==="_self")&&!jn(e)}var ce=null;function En(){if(ce===null)try{new FormData(document.createElement("form"),0),ce=!1}catch{ce=!0}return ce}var Sn=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function we(e){return e!=null&&!Sn.has(e)?(T(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${le}"`),null):e}function kn(e,t){let n,r,a,i,u;if(wn(e)){let h=e.getAttribute("action");r=h?F(h,t):null,n=e.getAttribute("method")||oe,a=we(e.getAttribute("enctype"))||le,i=new FormData(e)}else if(bn(e)||Nn(e)&&(e.type==="submit"||e.type==="image")){let h=e.form;if(h==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||h.getAttribute("action");if(r=s?F(s,t):null,n=e.getAttribute("formmethod")||h.getAttribute("method")||oe,a=we(e.getAttribute("formenctype"))||we(h.getAttribute("enctype"))||le,i=new FormData(h,e),!En()){let{name:c,type:m,value:p}=e;if(m==="image"){let g=c?`${c}.`:"";i.append(`${g}x`,"0"),i.append(`${g}y`,"0")}else c&&i.append(c,p)}}else{if(se(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=oe,r=null,a=le,u=e}return i&&a==="text/plain"&&(u=i,i=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:i,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ne(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Pn(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&F(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function Rn(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ln(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function In(e,t,n){let r=await Promise.all(e.map(async a=>{let i=t.routes[a.route.id];if(i){let u=await Rn(i,n);return u.links?u.links():[]}return[]}));return _n(r.flat(1).filter(Ln).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function at(e,t,n,r,a,i){let u=(s,c)=>n[c]?s.route.id!==n[c].route.id:!0,h=(s,c)=>n[c].pathname!==s.pathname||n[c].route.path?.endsWith("*")&&n[c].params["*"]!==s.params["*"];return i==="assets"?t.filter((s,c)=>u(s,c)||h(s,c)):i==="data"?t.filter((s,c)=>{let m=r.routes[s.route.id];if(!m||!m.hasLoader)return!1;if(u(s,c)||h(s,c))return!0;if(s.route.shouldRevalidate){let p=s.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:s.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function $n(e,t,{includeHydrateFallback:n}={}){return An(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let i=[a.module];return a.clientActionModule&&(i=i.concat(a.clientActionModule)),a.clientLoaderModule&&(i=i.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(i=i.concat(a.hydrateFallbackModule)),a.imports&&(i=i.concat(a.imports)),i}).flat(1))}function An(e){return[...new Set(e)]}function Mn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function _n(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let i=JSON.stringify(Mn(a));return n.has(i)||(n.add(i),r.push({key:i,link:a})),r},[])}function rt(){let e=d.useContext(q);return Ne(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Tn(){let e=d.useContext(re);return Ne(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var je=d.createContext(void 0);je.displayName="FrameworkContext";function it(){let e=d.useContext(je);return Ne(e,"You must render this element inside a <HydratedRouter> element"),e}function Dn(e,t){let n=d.useContext(je),[r,a]=d.useState(!1),[i,u]=d.useState(!1),{onFocus:h,onBlur:s,onMouseEnter:c,onMouseLeave:m,onTouchStart:p}=t,g=d.useRef(null);d.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let y=v=>{v.forEach(C=>{u(C.isIntersecting)})},j=new IntersectionObserver(y,{threshold:.5});return g.current&&j.observe(g.current),()=>{j.disconnect()}}},[e]),d.useEffect(()=>{if(r){let y=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(y)}}},[r]);let N=()=>{a(!0)},x=()=>{a(!1),u(!1)};return n?e!=="intent"?[i,g,{}]:[i,g,{onFocus:X(h,N),onBlur:X(s,x),onMouseEnter:X(c,N),onMouseLeave:X(m,x),onTouchStart:X(p,N)}]:[!1,g,{}]}function X(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function On({page:e,...t}){let{router:n}=rt(),r=d.useMemo(()=>Ve(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?d.createElement(zn,{page:e,matches:r,...t}):null}function Bn(e){let{manifest:t,routeModules:n}=it(),[r,a]=d.useState([]);return d.useEffect(()=>{let i=!1;return In(e,t,n).then(u=>{i||a(u)}),()=>{i=!0}},[e,t,n]),r}function zn({page:e,matches:t,...n}){let r=V(),{manifest:a,routeModules:i}=it(),{basename:u}=rt(),{loaderData:h,matches:s}=Tn(),c=d.useMemo(()=>at(e,t,s,a,r,"data"),[e,t,s,a,r]),m=d.useMemo(()=>at(e,t,s,a,r,"assets"),[e,t,s,a,r]),p=d.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let x=new Set,y=!1;if(t.forEach(v=>{let C=a.routes[v.route.id];!C||!C.hasLoader||(!c.some(E=>E.route.id===v.route.id)&&v.route.id in h&&i[v.route.id]?.shouldRevalidate||C.hasClientLoader?y=!0:x.add(v.route.id))}),x.size===0)return[];let j=Pn(e,u,"data");return y&&x.size>0&&j.searchParams.set("_routes",t.filter(v=>x.has(v.route.id)).map(v=>v.route.id).join(",")),[j.pathname+j.search]},[u,h,r,a,c,t,e,i]),g=d.useMemo(()=>$n(m,a),[m,a]),N=Bn(m);return d.createElement(d.Fragment,null,p.map(x=>d.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...n})),g.map(x=>d.createElement("link",{key:x,rel:"modulepreload",href:x,...n})),N.map(({key:x,link:y})=>d.createElement("link",{key:x,...y})))}function Hn(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var ot=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{ot&&(window.__reactRouterVersion="7.7.0")}catch{}var lt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Q=d.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:i,replace:u,state:h,target:s,to:c,preventScrollReset:m,viewTransition:p,...g},N){let{basename:x}=d.useContext(O),y=typeof c=="string"&<.test(c),j,v=!1;if(typeof c=="string"&&y&&(j=c,ot))try{let R=new URL(window.location.href),M=c.startsWith("//")?new URL(R.protocol+c):new URL(c),J=F(M.pathname,x);M.origin===R.origin&&J!=null?c=J+M.search+M.hash:v=!0}catch{T(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let C=an(c,{relative:a}),[E,z,I]=Dn(r,g),W=Vn(c,{replace:u,state:h,target:s,preventScrollReset:m,relative:a,viewTransition:p});function A(R){t&&t(R),R.defaultPrevented||W(R)}let H=d.createElement("a",{...g,...I,href:j||C,onClick:v||i?t:A,ref:Hn(N,z),target:s,"data-discover":!y&&n==="render"?"true":void 0});return E&&!y?d.createElement(d.Fragment,null,H,d.createElement(On,{page:C})):H});Q.displayName="Link";var Fn=d.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:i,to:u,viewTransition:h,children:s,...c},m){let p=K(u,{relative:c.relative}),g=V(),N=d.useContext(re),{navigator:x,basename:y}=d.useContext(O),j=N!=null&&Kn(p)&&h===!0,v=x.encodeLocation?x.encodeLocation(p).pathname:p.pathname,C=g.pathname,E=N&&N.navigation&&N.navigation.location?N.navigation.location.pathname:null;n||(C=C.toLowerCase(),E=E?E.toLowerCase():null,v=v.toLowerCase()),E&&y&&(E=F(E,y)||E);const z=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let I=C===v||!a&&C.startsWith(v)&&C.charAt(z)==="/",W=E!=null&&(E===v||!a&&E.startsWith(v)&&E.charAt(v.length)==="/"),A={isActive:I,isPending:W,isTransitioning:j},H=I?t:void 0,R;typeof r=="function"?R=r(A):R=[r,I?"active":null,W?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let M=typeof i=="function"?i(A):i;return d.createElement(Q,{...c,"aria-current":H,className:R,ref:m,style:M,to:u,viewTransition:h},typeof s=="function"?s(A):s)});Fn.displayName="NavLink";var Wn=d.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:i,method:u=oe,action:h,onSubmit:s,relative:c,preventScrollReset:m,viewTransition:p,...g},N)=>{let x=Gn(),y=Yn(h,{relative:c}),j=u.toLowerCase()==="get"?"get":"post",v=typeof h=="string"&<.test(h),C=E=>{if(s&&s(E),E.defaultPrevented)return;E.preventDefault();let z=E.nativeEvent.submitter,I=z?.getAttribute("formmethod")||u;x(z||E.currentTarget,{fetcherKey:t,method:I,navigate:n,replace:a,state:i,relative:c,preventScrollReset:m,viewTransition:p})};return d.createElement("form",{ref:N,method:j,action:y,onSubmit:r?s:C,...g,"data-discover":!v&&e==="render"?"true":void 0})});Wn.displayName="Form";function Un(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function st(e){let t=d.useContext(q);return k(t,Un(e)),t}function Vn(e,{target:t,replace:n,state:r,preventScrollReset:a,relative:i,viewTransition:u}={}){let h=rn(),s=V(),c=K(e,{relative:i});return d.useCallback(m=>{if(Cn(m,t)){m.preventDefault();let p=n!==void 0?n:me(s)===me(c);h(e,{replace:p,state:r,preventScrollReset:a,relative:i,viewTransition:u})}},[s,h,c,n,r,t,e,a,i,u])}var qn=0,Jn=()=>`__${String(++qn)}__`;function Gn(){let{router:e}=st("useSubmit"),{basename:t}=d.useContext(O),n=vn();return d.useCallback(async(r,a={})=>{let{action:i,method:u,encType:h,formData:s,body:c}=kn(r,t);if(a.navigate===!1){let m=a.fetcherKey||Jn();await e.fetch(m,n,a.action||i,{preventScrollReset:a.preventScrollReset,formData:s,body:c,formMethod:a.method||u,formEncType:a.encType||h,flushSync:a.flushSync})}else await e.navigate(a.action||i,{preventScrollReset:a.preventScrollReset,formData:s,body:c,formMethod:a.method||u,formEncType:a.encType||h,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,t,n])}function Yn(e,{relative:t}={}){let{basename:n}=d.useContext(O),r=d.useContext(B);k(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),i={...K(e||".",{relative:t})},u=V();if(e==null){i.search=u.search;let h=new URLSearchParams(i.search),s=h.getAll("index");if(s.some(m=>m==="")){h.delete("index"),s.filter(p=>p).forEach(p=>h.append("index",p));let m=h.toString();i.search=m?`?${m}`:""}}return(!e||e===".")&&a.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:D([n,i.pathname])),me(i)}function Kn(e,t={}){let n=d.useContext(Qe);k(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=st("useViewTransitionState"),a=K(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=F(n.currentLocation.pathname,r)||n.currentLocation.pathname,u=F(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ae(a.pathname,u)!=null||ae(a.pathname,i)!=null}const ct="var(--carelon-purple)",Xn=({showGreeting:e,onStartChat:t,chipToSend:n,onChipSent:r,chips:a=[],selectedChipIdx:i=null,handleChipClick:u})=>{const[h,s]=w.useState([]),[c,m]=w.useState(""),[p,g]=w.useState(!1),[N,x]=w.useState(null),[y,j]=w.useState(!1),[v,C]=w.useState(!1),[E,z]=w.useState(!1),[I,W]=w.useState([]),[A,H]=w.useState(null),R=30,M=w.useRef(null);w.useEffect(()=>{M.current?.scrollIntoView({behavior:"smooth"})},[h,p]),w.useEffect(()=>{n&&!E&&(J(n),z(!0),e&&t(),typeof r=="function"&&r())},[n]);const J=async b=>{if(!(b||c.trim())||p)return;e&&t(),z(!0);const l=b||c,$={id:Date.now()+"-user",sender:"user",text:l};s(f=>[...f,$]),m(""),g(!0),x(null);try{const f=await $t($.text);let _=f.smalltalk||"Sorry, I could not understand. Say it again?";const Z=f.hybridtalk||"Sorry, I could not understand. Say it again?";if(f.intent!=="provider_search_intent"&&s(U=>[...U,{id:Date.now()+"-bot-smalltalk",sender:"bot",text:_}]),f.intent==="health_content_intent"&&f.slots.content_query){const U=await Ue(f.slots.content_query);s(Ce=>[...Ce,{id:Date.now()+"-bot-richinfo",sender:"bot",text:"",crediblemind:U.crediblemind}])}if(f.intent==="provider_search_intent"){const U=await Ue(f.query);U?.crediblemind?.length&&(_=Z),s(Ee=>[...Ee,{id:Date.now()+"-bot-smalltalk-hybrid",sender:"bot",text:_}]);const Ce=await At({gender:f.slots.gender,specialty:f.slots.specialty,provider_type:f.slots.provider_type,location:f.slots.location,language:f.slots.language});s(Ee=>[...Ee,{id:Date.now()+"-bot-providersearch-richinfo",sender:"bot",text:_,crediblemind:U.crediblemind,providers:Ce.providers}])}const ut=f.followup_prompt;ut&&s(U=>[...U,{id:Date.now()+"-bot-followup",sender:"bot",text:ut}])}catch{x("Sorry, there was a problem connecting. Please try again."),s(_=>[..._,{id:Date.now()+"-bot-error",sender:"bot",text:"Sorry, there was an error."}])}finally{g(!1)}};w.useEffect(()=>{if(!e&&h.length>I.length){const b=h[I.length];if(b.sender==="bot"){let l="",$=0;const f=()=>{$<b.text.length&&(l+=b.text[$],W(_=>{const Z=[..._];return Z[Z.length-1]={...b,text:l},Z}),$++,setTimeout(f,R))};W(_=>[..._,{...b,text:""}]),setTimeout(f,R)}else W(l=>[...l,b])}M.current?.scrollIntoView({behavior:"smooth"})},[h,e,I.length]);const ea=w.useMemo(()=>"John!",[]),ta=w.useMemo(()=>he(["Hi","Hey","Hello",It()]),[]),na=w.useMemo(()=>he(["How can I help you today?","What can I do for you today?"]),[]);return o.jsxs("div",{className:"chat-body-center",children:[e&&o.jsxs("div",{className:"greeting-chips-block",children:[o.jsxs("div",{className:"central-greeting",children:[o.jsxs("div",{className:"greeting-main",children:[ta,",",o.jsx("span",{className:"greeting-name",children:ea})]}),o.jsx("div",{className:"greeting-sub",children:na})]}),o.jsx("div",{className:"suggestion-chips-wrap main-chips",children:o.jsx("div",{className:"suggestion-chips",children:a.map((b,l)=>o.jsx("button",{className:`suggestion-chip${i===l?" selected":""}`,tabIndex:0,onClick:()=>u&&u(l),children:b},b))})})]}),o.jsx("div",{className:"chat-outer",children:o.jsxs("div",{className:"chat-container",children:[!e&&!A&&o.jsxs("div",{className:"chat-messages",children:[I.map(b=>o.jsx("div",{className:b.sender==="user"?"chat-user-msg":"chat-bot-msg",children:b.crediblemind&&Array.isArray(b.crediblemind)&&b.crediblemind.length>0&&b.providers&&Array.isArray(b.providers)&&b.providers.length>0?o.jsxs("div",{className:"crediblemind-and-provider-cards",children:[o.jsx("div",{className:"crediblemind-cards",children:b.crediblemind.map(l=>o.jsxs("a",{href:l.content_url,className:"crediblemind-card",children:[o.jsx("div",{className:"crediblemind-title",children:l.title}),o.jsx("div",{className:"crediblemind-type",children:l.content_type})]},l.entry_id))}),o.jsx("div",{className:"provider-cards",children:b.providers.map(l=>{const $=`${l.name.firstName?.[0]||""}${l.name.lastName?.[0]||""}`.toUpperCase();return o.jsxs("div",{className:"provider-card",children:[o.jsxs("div",{className:"provider-header-horizontal",children:[o.jsx("span",{className:"provider-logo-circle fixed-width-span",children:$}),o.jsxs("span",{className:"provider-name",children:[l.name.firstName," ",l.name.lastName]}),o.jsx("span",{className:"provider-title right-align",children:l.title})]}),o.jsxs("div",{className:"provider-details",children:[o.jsxs("div",{className:"provider-address",children:[o.jsxs("span",{className:"provider-icon address-icon",children:[o.jsx(De,{})," "]}),o.jsxs("span",{className:"provider-link",onClick:()=>{const f=`${l.contact.address.addr1}, ${l.contact.address.city}, ${l.contact.address.state} ${l.contact.address.zip}`;window.open(`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(f)}`,"_blank")},children:[l.contact.address.addr1,", ",l.contact.address.city,", ",l.contact.address.state," ",l.contact.address.zip]})]}),o.jsxs("div",{className:"provider-contact",children:[l.contact.phone&&l.contact.phone!=="Not Available"&&o.jsxs("span",{children:[o.jsx(Me,{className:"provider-icon"}),o.jsx("a",{href:`tel:${l.contact.phone}`,target:"_blank",rel:"noopener noreferrer",className:"provider-link",children:We(l.contact.phone)})]}),l.contact.officeEmail&&l.contact.officeEmail!=="Not Available"&&o.jsxs("span",{children:[o.jsx(Oe,{className:"provider-icon"}),o.jsx("a",{href:`mailto:${l.contact.officeEmail}`,className:"provider-link-blank",children:l.contact.officeEmail})]}),l.contact.website&&l.contact.website!=="Not Available"&&(l.contact.website.startsWith("/")?o.jsx(Q,{to:l.contact.website,className:"provider-link-blank",children:l.contact.website}):o.jsxs("span",{children:[o.jsx(_e,{className:"provider-icon"}),o.jsx("a",{href:l.contact.website.startsWith("http")?l.contact.website:`https://${l.contact.website}`,className:"provider-link-blank",onClick:f=>{f.preventDefault(),H(l.contact.website.startsWith("http")?l.contact.website:`https://${l.contact.website}`)},children:l.contact.website})]}))]}),l.languages&&l.languages.length>0&&o.jsxs("div",{className:"provider-languages",children:[o.jsx("span",{className:"provider-icon",children:o.jsx(Te,{})}),l.languages.map(f=>fe(f)).join(", ")]}),l.yellowLabels&&l.yellowLabels.length>0&&o.jsx("div",{className:"provider-labels",children:l.yellowLabels.filter(f=>!f.notAvailable).map(f=>f.icon==="accepting-new-patients"?o.jsx(L,{icon:o.jsx(He,{className:"provider-label-icon"}),tooltip:f.label||"Accepting new patients"},f.icon):f.icon==="public-transportation"?o.jsx(L,{icon:o.jsx(Ae,{className:"provider-label-icon"}),tooltip:f.label||"Public transportation available"},f.icon):f.icon==="wheelchair-accessible"?o.jsx(L,{icon:o.jsx($e,{className:"provider-label-icon"}),tooltip:f.label||"Wheelchair accessible"},f.icon):f.icon==="telehealth-provider"?o.jsx(L,{icon:o.jsx(Fe,{className:"provider-label-icon"}),tooltip:f.label||"Telehealth provider"},f.icon):f.icon==="medicaid-provider"?o.jsx(L,{icon:o.jsx(Be,{className:"provider-label-icon"}),tooltip:f.label||"Medicaid provider"},f.icon):o.jsx(L,{icon:null,tooltip:f.label||f.icon,children:f.label||f.icon},f.icon))})]}),l.onlineAppointmentScheduleFlag==1&&o.jsx("button",{className:"provider-request-appt-btn",onClick:()=>{},children:"Request an appointment"})]},l.providerId||`${l.name.firstName} ${l.name.lastName}`)})})]}):b.crediblemind&&Array.isArray(b.crediblemind)&&b.crediblemind.length>0?o.jsx("div",{className:"crediblemind-cards",children:b.crediblemind.map(l=>l.content_url.startsWith("/")?o.jsxs(Q,{to:l.content_url,className:"crediblemind-card",childre