@opencx/widget-react 4.0.48 → 4.0.50

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/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),_t=require("@radix-ui/react-popover"),h=require("react"),l=require("@opencx/widget-react-headless"),It=require("clsx"),Mt=require("tailwind-merge"),N=require("framer-motion"),Tt=require("@radix-ui/react-slot"),Rt=require("class-variance-authority"),g=require("lucide-react"),ot=require("remark-gfm"),Dt=require("react-markdown"),nt=require("rehype-raw"),P=require("@opencx/widget-core"),Pt=require("@radix-ui/react-avatar"),at=require("@uiw/react-iframe"),Et=require("@radix-ui/react-tooltip"),Ze=require("tinycolor2"),At=require("react-dropzone"),Wt=require("react-use/lib/useAsyncFn"),ne=require("zod");function te(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(r,s,o.get?o:{enumerable:!0,get:()=>t[s]})}}return r.default=t,Object.freeze(r)}const se=te(_t),B=te(h),Y=te(Pt),G=te(Et);function f(t){return{"data-component":t}}function m(...t){return Mt.twMerge(It.clsx(t))}const $={x:2,y:2},H=h.memo(h.forwardRef(({children:t,className:r,scale:s=1.02,off:o=!1},n)=>{const[a,i]=h.useState(!1),[c,d]=h.useState({x:0,y:0});if(o||/translate/.test(t.props.className||""))return t;const j=v=>{var k,M;const{clientX:S,clientY:T}=v,y=v.currentTarget.getBoundingClientRect(),R=S-(y.left+y.width/2),E=T-(y.top+y.height/2),D=Math.max(-1,Math.min(1,R/(y.width/2))),w=Math.max(-1,Math.min(1,E/(y.height/2))),I=D*$.x,x=w*$.y;d({x:I,y:x}),(M=(k=t.props).onMouseMove)==null||M.call(k,v)},b=()=>{var v,S;i(!0),(S=(v=t.props).onMouseEnter)==null||S.call(v)},u=()=>{var v,S;i(!1),d({x:0,y:0}),(S=(v=t.props).onMouseLeave)==null||S.call(v)},z={"--wobble-x":a?`${c.x}px`:"0px","--wobble-y":a?`${c.y}px`:"0px","--scale":1-(s-1)};return h.cloneElement(t,{ref:n,onMouseMove:j,onMouseEnter:b,onMouseLeave:u,style:{...z,...t.props.style},className:m("translate-x-[var(--wobble-x)]","translate-y-[var(--wobble-y)]","hover:scale-[var(--scale)] active:hover:scale-[calc(var(--scale)-0.02)]",r,t.props.className,"transition-all ease-out")})}));H.displayName="Wobble";const Ot=10,Ft=(t,r,s)=>({initial:{opacity:0,x:-t,...r.initial},animate:{opacity:1,x:0,...r.animate,transition:{delay:s}},exit:{opacity:0,x:t,...r.exit}}),Ht=(t,r,s)=>({initial:{opacity:0,x:t,...r.initial},animate:{opacity:1,x:0,...r.animate,transition:{delay:s}},exit:{opacity:0,x:-t,...r.exit}}),qt=(t,r,s)=>({initial:{opacity:0,y:t,...r.initial},animate:{opacity:1,y:0,...r.animate,transition:{delay:s}},exit:{opacity:0,y:-t,...r.exit}}),Lt=(t,r,s)=>({initial:{opacity:0,y:-t,...r.initial},animate:{opacity:1,y:0,...r.animate,transition:{delay:s}},exit:{opacity:0,y:t,...r.exit}}),$t={right:Ft,left:Ht,up:qt,down:Lt},C=h.forwardRef(({fadeIn:t="down",distance:r=Ot,children:s,snapExit:o=!1,overrides:n={},delay:a=0,...i},c)=>{const d=t?$t[t](r,n,a):{};return o&&d.exit&&typeof d.exit=="object"&&!Array.isArray(d.exit)&&(d.exit.transition={duration:0}),e.jsx(N.motion.div,{ref:c,...i,...d,children:s})});C.displayName="MotionDiv";const Bt=Rt.cva(m("inline-flex shrink-0 items-center justify-center gap-2","text-sm font-medium whitespace-nowrap","ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","active:scale-95 hover:active:scale-95","rounded-xl","transition"),{variants:{variant:{default:"bg-primary text-primary-foreground",destructive:"bg-destructive text-destructive-foreground",outline:"bg-background border",secondary:"bg-secondary text-secondary-foreground",ghost:"hover:bg-secondary",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"py-2 px-3.5 text-xs",lg:"min-h-12 px-4 rounded-[20px]",icon:"h-10 w-10",fit:"size-fit p-2",free:"p-2",selfless:"p-0"}},defaultVariants:{variant:"default",size:"default"}}),_=B.forwardRef(({className:t,variant:r="default",size:s,asChild:o=!1,...n},a)=>{const i=o?Tt.Slot:"button";return e.jsx(H,{ref:a,children:e.jsx(i,{...f("ui_lib/btn"),"data-variant":r,className:m(Bt({variant:r,size:s,className:t})),...n})})});_.displayName="Button";const it=h.createContext(null);function Yt({children:t}){const[r,s]=h.useState(!1),[o,n]=h.useState(null),a=c=>{n(c),s(!0)},i=()=>{s(!1),setTimeout(()=>{n(null)},200)};return e.jsxs(it.Provider,{value:{open:a,close:i,isOpen:r,content:o},children:[e.jsx(Ut,{}),t]})}function re(){const t=h.useContext(it);return t||(console.error("useDialoger must be used within a DialogerProvider"),{open:()=>{},close:()=>{},isOpen:!1,content:null})}function Ut(){const{contentIframeRef:t}=l.useWidget(),{isOpen:r,content:s,close:o}=re();return h.useEffect(()=>{var a,i;const n=c=>{c.key==="Escape"&&o()};return(i=(a=t==null?void 0:t.current)==null?void 0:a.contentWindow)==null||i.document.addEventListener("keydown",n),()=>{var c,d;return(d=(c=t==null?void 0:t.current)==null?void 0:c.contentWindow)==null?void 0:d.document.removeEventListener("keydown",n)}},[]),e.jsx(N.AnimatePresence,{mode:"wait",children:r&&s&&e.jsx(C,{overrides:{initial:{y:0},exit:{y:0}},className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm",tabIndex:-1,onClick:o,children:s},"dialog-content")})}function pe({children:t,className:r,withClose:s=!1}){const{close:o}=re();return e.jsxs("div",{className:m("fixed left-[50%] top-[50%] z-50 flex flex-col gap-4 w-full max-w-[61.8%] translate-x-[-50%] translate-y-[-50%] border bg-background p-4 rounded-3xl",r),onClick:n=>n.stopPropagation(),children:[t,s&&e.jsxs(_,{size:"fit",className:"rounded-full absolute top-4 right-4 opacity-50 hover:opacity-100",onClick:o,children:[e.jsx(g.X,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})}const lt=({className:t,...r})=>e.jsx("div",{className:m("flex flex-col gap-2 text-center pt-2",t),...r});lt.displayName="DialogerHeader";const ct=({className:t,...r})=>e.jsx("div",{className:m("flex flex-col gap-2 text-center",t),...r});ct.displayName="DialogerBody";const dt=({className:t,...r})=>e.jsx("div",{className:m("flex flex-col gap-2",t),...r});dt.displayName="DialogerFooter";const pt=h.forwardRef(({className:t,...r},s)=>e.jsx("p",{ref:s,className:m("text-lg font-semibold leading-none tracking-tight",t),...r}));pt.displayName="DialogerTitle";const ht=h.forwardRef(({className:t,...r},s)=>e.jsx("p",{ref:s,className:m("text-sm text-muted-foreground",t),...r}));ht.displayName="DialogerDescription";function he({children:t,trigger:r}){const{open:s}=re();return h.cloneElement(r,{onClick:()=>s(t)})}const Ke=1,Qe=5,K=.5,Xt=2.5;function Vt(t,r,s,o){if(!s||!o||r<=1)return{x:0,y:0};const n=s.getBoundingClientRect(),a=o.offsetWidth,i=o.offsetHeight,c=Math.max(0,(a*r-n.width)/(2*r)),d=Math.max(0,(i*r-n.height)/(2*r));return{x:Math.min(c,Math.max(-c,t.x)),y:Math.min(d,Math.max(-d,t.y))}}function mt({src:t,alt:r}){const[s,o]=h.useState(1),[n,a]=h.useState({x:0,y:0}),[i,c]=h.useState(!1),d=h.useRef({x:0,y:0}),p=h.useRef({x:0,y:0}),j=h.useRef(null),b=h.useRef(null),u=h.useRef(!1),z=w=>Math.min(Qe,Math.max(Ke,w)),v=h.useCallback(()=>{o(1),a({x:0,y:0})},[]),S=h.useCallback(()=>{o(w=>z(w+K))},[]),T=h.useCallback(()=>{o(w=>{const I=z(w-K);return I<=1&&a({x:0,y:0}),I})},[]);h.useCallback(w=>{w.preventDefault(),w.stopPropagation();const I=w.deltaY>0?-K:K;o(x=>{const k=z(x+I);return k<=1&&a({x:0,y:0}),k})},[]);const y=h.useCallback(w=>{w.preventDefault(),u.current=!1,c(!0),d.current={x:w.clientX,y:w.clientY},p.current={...n},w.target.setPointerCapture(w.pointerId)},[n]),R=h.useCallback(w=>{if(!i)return;const I=w.clientX-d.current.x,x=w.clientY-d.current.y;if((Math.abs(I)>3||Math.abs(x)>3)&&(u.current=!0),s<=1)return;const k={x:p.current.x+I/s,y:p.current.y+x/s};a(Vt(k,s,j.current,b.current))},[i,s]),E=h.useCallback(()=>{const w=u.current;c(!1),!w&&o(I=>I>1?(a({x:0,y:0}),1):Xt)},[]),D=s>1;return e.jsxs("div",{className:"relative size-full flex items-center justify-center select-none",onClick:w=>w.stopPropagation(),children:[e.jsx("div",{ref:j,className:m("overflow-hidden max-h-full max-w-full rounded-2xl flex items-center justify-center",D&&"size-full"),onPointerDown:y,onPointerMove:R,onPointerUp:E,onPointerCancel:E,style:{cursor:i?"grabbing":D?"grab":"zoom-in",touchAction:"none"},children:e.jsx("img",{ref:b,src:t,alt:r,className:"block max-w-full object-contain pointer-events-none",draggable:!1,style:{maxHeight:"100vh",transform:`scale(${s}) translate(${n.x}px, ${n.y}px)`,transformOrigin:"center center"}})}),e.jsxs("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 flex items-center gap-1 bg-black/60 backdrop-blur-sm rounded-full px-1.5 py-1 transition opacity-50 hover:opacity-100",children:[e.jsx(ae,{onClick:T,label:"Zoom out",disabled:s<=Ke,children:e.jsx(g.ZoomOut,{className:"size-3.5"})}),e.jsxs("span",{className:"text-white text-xs font-medium min-w-[3ch] text-center tabular-nums",children:[Math.round(s*100),"%"]}),e.jsx(ae,{onClick:S,label:"Zoom in",disabled:s>=Qe,children:e.jsx(g.ZoomIn,{className:"size-3.5"})}),D&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-4 bg-white/30 mx-0.5"}),e.jsx(ae,{onClick:v,label:"Reset zoom",children:e.jsx(g.RotateCcw,{className:"size-3.5"})})]})]})]})}function ae({onClick:t,label:r,children:s,disabled:o}){return e.jsx("button",{onClick:t,"aria-label":r,disabled:o,className:"text-white/80 hover:text-white disabled:text-white/30 disabled:hover:bg-transparent p-1.5 rounded-full hover:bg-white/15 transition-colors",children:s})}function ut({attachment:t}){const{name:r,size:s,type:o,url:n}=t,a=o.startsWith("image/"),i=o.startsWith("video/");return o.startsWith("audio/")?e.jsx(H,{children:e.jsx("div",{className:"w-full shrink-0 overflow-hidden",children:e.jsxs("audio",{controls:!0,className:"w-full",children:[e.jsx("source",{src:n,type:o}),"Your browser does not support the audio tag."]})})}):i?e.jsx(H,{children:e.jsx("div",{className:"w-full border shrink-0 rounded-2xl overflow-hidden",children:e.jsxs("video",{controls:!0,children:[e.jsx("source",{src:n,type:o}),"Your browser does not support the video tag."]})})}):a?e.jsx(he,{trigger:e.jsx("div",{children:e.jsx(H,{children:e.jsx("div",{className:"size-fit border shrink-0 rounded-2xl overflow-hidden",children:e.jsx("img",{src:n,className:"object-cover size-16",alt:r})})})}),children:e.jsx(pe,{className:"size-full max-w-full rounded-3xl flex items-center justify-center bg-transparent border-none gap-0",withClose:!0,children:e.jsx(mt,{src:n,alt:r})})}):e.jsx(H,{children:e.jsx("div",{className:"size-fit border shrink-0 rounded-2xl overflow-hidden",children:e.jsxs("div",{className:"flex items-end gap-2 p-2",children:[e.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:m("text-xs text-blue-500 line-clamp-2 underline hover:text-blue-600","break-words [word-break:break-word]"),children:r}),e.jsxs("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:[(s/1024).toFixed(2)," KB"]})]})})})}const gt=h.memo(Dt,(t,r)=>t.children===r.children&&t.className===r.className);function me({children:t,messageType:r,messageId:s}){const{anchorTarget:o}=l.useConfig();return e.jsx(gt,{"data-type":r,"data-id":s,remarkPlugins:[ot],rehypePlugins:[nt],components:{a:({children:n,...a})=>e.jsx("a",{target:a.target||o||"_top",...a,children:n}),img:({src:n,alt:a,...i})=>n?e.jsx(he,{trigger:e.jsx("img",{src:n,alt:a,...i,className:"cursor-pointer rounded-xl"}),children:e.jsx(pe,{className:"size-full max-w-full rounded-3xl flex items-center justify-center bg-transparent border-none gap-0",withClose:!0,children:e.jsx(mt,{src:n,alt:a})})}):e.jsx("img",{src:n,alt:a,...i})},children:t})}function U(){const{widgetCtx:{org:t}}=l.useWidget(),{sessionState:{session:r}}=l.useSessions(),s=l.useConfig(),{messagesState:{messages:o}}=l.useMessages(),{routerState:{screen:n}}=l.useWidgetRouter();return{react:h,org:t,session:r,config:s,messages:o,currentScreen:n}}function Gt({currentMessage:t}){var o;const r=U(),s=(o=r.config.customComponents)==null?void 0:o["message::after"];return s?e.jsx(s,{...r,currentMessage:t}):null}function ie(t){const{data:r,id:s,type:o,attachments:n,isFirstInGroup:a,isLastInGroup:i,isAloneInGroup:c,dataComponentNames:d,classNames:p}=t;if(o!=="AI"&&o!=="AGENT")return null;const{message:j,variant:b="default"}=r;return e.jsxs("div",{...f((d==null?void 0:d.messageContainer)??"chat/agent_msg/root"),className:m("w-5/6 flex flex-col items-start gap-1",p==null?void 0:p.messageContainer),children:[n&&n.length>0&&e.jsx("div",{className:"w-full gap-1 flex flex-row flex-wrap items-center justify-start",children:n==null?void 0:n.map(u=>e.jsx(ut,{attachment:u},u.id))}),j.length>0&&e.jsxs("div",{className:"flex flex-row gap-2",children:[e.jsx("div",{...f((d==null?void 0:d.message)??"chat/agent_msg/msg"),"data-first":a,"data-last":i,"data-alone":c,"data-variant":b,className:m("transition-all","w-fit py-3 px-4 rounded-3xl bg-secondary text-secondary-foreground","leading-snug text-sm prose prose-sm prose-a:decoration-primary prose-a:underline","break-words [word-break:break-word]",b==="error"&&"bg-destructive/15 text-destructive",a&&!c&&"rounded-bl-md",i&&!c&&"rounded-tl-md",!a&&!i&&!c&&"rounded-l-md",p==null?void 0:p.message),children:e.jsx(me,{messageType:o,messageId:s,children:j})}),e.jsx(Gt,{currentMessage:t})]})]})}function Zt(t){return e.jsx("div",{className:"w-full max-w-full overflow-auto shrink-0",children:e.jsx("pre",{className:"text-xs leading-tight whitespace-pre-wrap break-word",children:JSON.stringify(t,null,1)})})}const ue=B.forwardRef(({className:t,...r},s)=>e.jsx(Y.Root,{ref:s,className:m("relative flex size-6 aspect-square shrink-0 overflow-hidden rounded-full bg-secondary",t),...r}));ue.displayName=Y.Root.displayName;const ge=B.forwardRef(({className:t,...r},s)=>e.jsx(Y.Image,{ref:s,className:m("aspect-square h-full w-full",t),...r}));ge.displayName=Y.Image.displayName;const we=B.forwardRef(({className:t,...r},s)=>e.jsx(Y.Fallback,{ref:s,className:m("flex size-full text-xs items-center justify-center rounded-lg",t),...r}));we.displayName=Y.Fallback.displayName;function le({agent:t,...r}){var s,o;return e.jsxs(ue,{...r,children:[e.jsx(ge,{src:(t==null?void 0:t.avatarUrl)||(t==null?void 0:t.avatar)||"",alt:"Agent Icon"}),(t==null?void 0:t.name)&&e.jsx(we,{children:(o=(s=t==null?void 0:t.name)==null?void 0:s.slice(0,1))==null?void 0:o.toUpperCase()})]})}function Kt({agent:t}){return e.jsx(N.AnimatePresence,{children:e.jsxs(C,{...f("chat/bot_loading/root"),className:"flex flex-row items-end w-full gap-2 animate-pulse",children:[e.jsx(le,{agent:t}),e.jsxs("div",{...f("chat/bot_loading/bouncing_dots_container"),className:m("flex items-center [&_span]:bg-secondary-foreground [&_span]:size-1 gap-1 p-2 rounded-xl bg-secondary"),children:[e.jsx(N.motion.span,{className:"rounded-full animate-bounce [animation-delay:-0.3s]"}),e.jsx(N.motion.span,{className:"rounded-full animate-bounce [animation-delay:-0.15s]"}),e.jsx(N.motion.span,{className:"rounded-full animate-bounce"})]})]})})}const wt='*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{-ms-overflow-style:none;scrollbar-width:none}*::-webkit-scrollbar{display:none}*{border-color:hsl(var(--opencx-border))}.\\!container{width:100%!important}.container{width:100%}@media (min-width: 640px){.\\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width: 768px){.\\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width: 1024px){.\\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width: 1280px){.\\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width: 1536px){.\\!container{max-width:1536px!important}.container{max-width:1536px}}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-sm{font-size:.875rem;line-height:1.7142857}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-inline-start:1.1111111em}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding-top:.1428571em;padding-inline-end:.3571429em;padding-bottom:.1428571em;padding-inline-start:.3571429em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-inline-start:1.5714286em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.bottom-3{bottom:.75rem}.end-6{inset-inline-end:1.5rem}.left-1\\/2{left:50%}.left-2{left:.5rem}.left-\\[50\\%\\]{left:50%}.right-4{right:1rem}.top-4{top:1rem}.top-6{top:1.5rem}.top-\\[50\\%\\]{top:50%}.isolate{isolation:isolate}.z-10{z-index:10}.z-50{z-index:50}.m-2{margin:.5rem}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-0\\.5{margin-left:.125rem;margin-right:.125rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.ms-auto{margin-inline-start:auto}.mt-0\\.5{margin-top:.125rem}.mt-auto{margin-top:auto}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.size-0{width:0px;height:0px}.size-10{width:2.5rem;height:2.5rem}.size-12{width:3rem;height:3rem}.size-16{width:4rem;height:4rem}.size-3{width:.75rem;height:.75rem}.size-3\\.5{width:.875rem;height:.875rem}.size-4{width:1rem;height:1rem}.size-6{width:1.5rem;height:1.5rem}.size-8{width:2rem;height:2rem}.size-fit{width:fit-content;height:fit-content}.size-full{width:100%;height:100%}.h-0{height:0px}.h-10{height:2.5rem}.h-2{height:.5rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-dvh{height:100dvh}.h-full{height:100%}.h-px{height:1px}.max-h-16{max-height:4rem}.max-h-40{max-height:10rem}.max-h-full{max-height:100%}.min-h-12{min-height:3rem}.w-0{width:0px}.w-1\\/2{width:50%}.w-10{width:2.5rem}.w-2{width:.5rem}.w-2\\/5{width:40%}.w-3\\.5{width:.875rem}.w-3\\/5{width:60%}.w-4{width:1rem}.w-5\\/6{width:83.333333%}.w-60{width:15rem}.w-9{width:2.25rem}.w-auto{width:auto}.w-dvw{width:100dvw}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.min-w-80{min-width:20rem}.min-w-\\[3ch\\]{min-width:3ch}.min-w-\\[8rem\\]{min-width:8rem}.max-w-96{max-width:24rem}.max-w-\\[61\\.8\\%\\]{max-width:61.8%}.max-w-full{max-width:100%}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-\\[2\\]{flex:2}.shrink-0{flex-shrink:0}.-translate-x-1\\/2,.translate-x-\\[-50\\%\\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\\[var\\(--wobble-x\\)\\]{--tw-translate-x: var(--wobble-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[-50\\%\\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[var\\(--wobble-y\\)\\]{--tw-translate-y: var(--wobble-y);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-\\[1px\\]{gap:1px}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-scroll{overflow:scroll}.scroll-smooth{scroll-behavior:smooth}.text-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-\\[20px\\]{border-radius:20px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-l-md{border-top-left-radius:.375rem;border-bottom-left-radius:.375rem}.rounded-r-md{border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}.rounded-bl-md{border-bottom-left-radius:.375rem}.rounded-br-md{border-bottom-right-radius:.375rem}.rounded-tl-md{border-top-left-radius:.375rem}.rounded-tr-md{border-top-right-radius:.375rem}.border{border-width:1px}.border-2{border-width:2px}.border-none{border-style:none}.border-transparent{border-color:transparent}.bg-\\[white\\]{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-background{background-color:hsl(var(--opencx-background))}.bg-black\\/50{background-color:#00000080}.bg-black\\/60{background-color:#0009}.bg-destructive{background-color:hsl(var(--opencx-destructive))}.bg-destructive\\/15{background-color:hsl(var(--opencx-destructive) / .15)}.bg-muted{background-color:hsl(var(--opencx-muted))}.bg-primary{background-color:hsl(var(--opencx-primary))}.bg-secondary{background-color:hsl(var(--opencx-secondary))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\\/30{background-color:#ffffff4d}.bg-\\[radial-gradient\\(ellipse_at_top_left\\,hsl\\(var\\(--opencx-primary\\)\\)\\,transparent\\)\\,radial-gradient\\(ellipse_at_top_right\\,hsl\\(var\\(--opencx-primary\\)\\)\\,transparent\\)\\]{background-image:radial-gradient(ellipse at top left,hsl(var(--opencx-primary)),transparent),radial-gradient(ellipse at top right,hsl(var(--opencx-primary)),transparent)}.fill-current{fill:currentColor}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-1\\.5{padding:.375rem}.p-2{padding:.5rem}.p-4{padding:1rem}.p-8{padding:2rem}.px-1\\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3\\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pb-0{padding-bottom:0}.pb-2{padding-bottom:.5rem}.pe-2{padding-inline-end:.5rem}.pe-4{padding-inline-end:1rem}.ps-2{padding-inline-start:.5rem}.ps-4{padding-inline-start:1rem}.ps-8{padding-inline-start:2rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.text-center{text-align:center}.text-start{text-align:start}.align-middle{vertical-align:middle}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-2xl{font-size:1.5rem;line-height:2rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\\[1\\.75rem\\]{font-size:1.75rem}.text-\\[10px\\]{font-size:10px}.text-\\[16px\\]{font-size:16px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-destructive{color:hsl(var(--opencx-destructive))}.text-destructive-foreground{color:hsl(var(--opencx-destructive-foreground))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--opencx-foreground))}.text-muted-foreground{color:hsl(var(--opencx-muted-foreground))}.text-muted-foreground\\/70{color:hsl(var(--opencx-muted-foreground) / .7)}.text-muted-foreground\\/75{color:hsl(var(--opencx-muted-foreground) / .75)}.text-primary{color:hsl(var(--opencx-primary))}.text-primary-foreground{color:hsl(var(--opencx-primary-foreground))}.text-secondary-foreground{color:hsl(var(--opencx-secondary-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\\/80{color:#fffc}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-35{opacity:.35}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-95{opacity:.95}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.outline-8{outline-width:8px}.outline-background{outline-color:hsl(var(--opencx-background))}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-offset-background{--tw-ring-offset-color: hsl(var(--opencx-background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[height\\]{transition-property:height;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in{--tw-enter-scale: 0}.zoom-in-95{--tw-enter-scale: .95}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.\\[animation-delay\\:-0\\.15s\\]{animation-delay:-.15s}.\\[animation-delay\\:-0\\.3s\\]{animation-delay:-.3s}.\\[field-sizing\\:content\\;\\],.\\[field-sizing\\:content\\]{field-sizing:content}.\\[word-break\\:break-word\\]{word-break:break-word}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:font-medium::file-selector-button{font-weight:500}.file\\:text-primary-foreground::file-selector-button{color:hsl(var(--opencx-primary-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--opencx-muted-foreground))}.placeholder\\:text-muted-foreground\\/75::placeholder{color:hsl(var(--opencx-muted-foreground) / .75)}.focus-within\\:border-primary:focus-within{border-color:hsl(var(--opencx-primary))}.hover\\:scale-\\[var\\(--scale\\)\\]:hover{--tw-scale-x: var(--scale);--tw-scale-y: var(--scale);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:border-primary:hover{border-color:hsl(var(--opencx-primary))}.hover\\:bg-secondary:hover{background-color:hsl(var(--opencx-secondary))}.hover\\:bg-white\\/15:hover{background-color:#ffffff26}.hover\\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.hover\\:text-primary:hover{color:hsl(var(--opencx-primary))}.hover\\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.focus\\:bg-accent:focus{background-color:hsl(var(--opencx-accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--opencx-accent-foreground))}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--opencx-ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--opencx-background))}.active\\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\\:hover\\:scale-\\[calc\\(var\\(--scale\\)-0\\.02\\)\\]:hover:active{--tw-scale-x: calc(var(--scale) - .02);--tw-scale-y: calc(var(--scale) - .02);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:active\\:scale-95:active:hover{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:text-white\\/30:disabled{color:#ffffff4d}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:hover\\:bg-transparent:hover:disabled{background-color:transparent}.group:hover .group-hover\\:opacity-100{opacity:1}.group:hover .group-hover\\:active\\:scale-90:active,.group:active .group-active\\:scale-90{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[state\\=checked\\]\\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[state\\=checked\\]\\:bg-primary[data-state=checked]{background-color:hsl(var(--opencx-primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:hsl(var(--opencx-accent))}.data-\\[state\\=unchecked\\]\\:bg-input[data-state=unchecked]{background-color:hsl(var(--opencx-input))}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.prose-a\\:underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-line:underline}.prose-a\\:decoration-primary :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-color:hsl(var(--opencx-primary))}.rtl\\:-scale-100:where([dir=rtl],[dir=rtl] *){--tw-scale-x: -1;--tw-scale-y: -1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\\[\\&_span\\]\\:size-1 span{width:.25rem;height:.25rem}.\\[\\&_span\\]\\:bg-secondary-foreground span{background-color:hsl(var(--opencx-secondary-foreground))}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:size-4 svg{width:1rem;height:1rem}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_svg\\]\\:text-muted-foreground\\/70 svg{color:hsl(var(--opencx-muted-foreground) / .7)}.\\[\\&_svg\\]\\:hover\\:text-primary:hover svg{color:hsl(var(--opencx-primary))}',Qt=G.Provider,Jt=G.Root,es=G.Trigger,ft=B.forwardRef(({className:t,sideOffset:r=4,...s},o)=>e.jsx(G.Content,{ref:o,sideOffset:r,className:m("z-50 overflow-hidden max-w-xs rounded-xl bg-primary border text-primary-foreground p-2 text-center align-middle text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...s}));ft.displayName=G.Content.displayName;function X({children:t,content:r,side:s,align:o}){const{disableTooltips:n}=l.useConfig();return!r||n?t:e.jsxs(Jt,{children:[e.jsx(es,{asChild:!0,children:t}),e.jsx(ft,{side:s,align:o,collisionPadding:8,avoidCollisions:!0,children:r})]})}const Je=450;function W(){const[t,r]=h.useState(()=>(window.top||window).innerWidth<Je);return h.useEffect(()=>{const s=window.top||window,o=()=>{r(s.innerWidth<Je)};return o(),s.addEventListener("resize",o),()=>{s.removeEventListener("resize",o)}},[]),{isSmallScreen:t}}const Q={transitionTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",transitionDuration:"1000ms"};function q(){var b,u,z,v,S,T,y,R,E,D,w,I,x,k,M,O,Z,be,ye,je,ke,Ce,ze,Se,Ne,_e,Ie,Me,Te,Re,De,Pe,Ee,Ae,We,Oe,Fe,He,qe,Le,$e,Be,Ye,Ue,Xe,Ve,Ge;const{dir:t}=l.useDocumentDir(),{isSmallScreen:r}=W(),{theme:s,inline:o}=l.useConfig(),n=F=>o?"100%":F,a=(F,oe)=>r?`100dv${F}`:oe,i=(F,oe)=>n(a(F,oe)),c={zIndex:((b=s==null?void 0:s.widgetTrigger)==null?void 0:b.zIndex)??1e7,offset:{bottom:((z=(u=s==null?void 0:s.widgetTrigger)==null?void 0:u.offset)==null?void 0:z.bottom)??20,right:((S=(v=s==null?void 0:s.widgetTrigger)==null?void 0:v.offset)==null?void 0:S.right)??(t==="ltr"?20:"initial"),left:((y=(T=s==null?void 0:s.widgetTrigger)==null?void 0:T.offset)==null?void 0:y.left)??(t==="rtl"?20:"initial")},size:{button:((E=(R=s==null?void 0:s.widgetTrigger)==null?void 0:R.size)==null?void 0:E.button)??48,icon:((w=(D=s==null?void 0:s.widgetTrigger)==null?void 0:D.size)==null?void 0:w.icon)??24}},d=(()=>{const F=t==="ltr"?c.offset.right:c.offset.left;return typeof F!="number"?0:F})(),p={palette:(s==null?void 0:s.palette)??"neutral",primaryColor:(s==null?void 0:s.primaryColor)??"hsl(0 0% 9%)",widgetTrigger:c,widgetContentContainer:{borderRadius:r?"0px":((I=s==null?void 0:s.widgetContentContainer)==null?void 0:I.borderRadius)??"32px",zIndex:((x=s==null?void 0:s.widgetContentContainer)==null?void 0:x.zIndex)??c.zIndex+1,outline:((k=s==null?void 0:s.widgetContentContainer)==null?void 0:k.outline)??"none",outlineColor:((M=s==null?void 0:s.widgetContentContainer)==null?void 0:M.outlineColor)??"hsl(0 0% 50% / .5)",boxShadow:((O=s==null?void 0:s.widgetContentContainer)==null?void 0:O.boxShadow)??"0 0px 100px 0px rgb(0 0 0 / 0.25)",transitionProperty:((Z=s==null?void 0:s.widgetContentContainer)==null?void 0:Z.transitionProperty)??"all",transitionTimingFunction:((be=s==null?void 0:s.widgetContentContainer)==null?void 0:be.transitionTimingFunction)??Q.transitionTimingFunction,transitionDuration:((ye=s==null?void 0:s.widgetContentContainer)==null?void 0:ye.transitionDuration)??Q.transitionDuration,offset:{side:r?0:c.offset.bottom+c.size.button+$.y*2+(((ke=(je=s==null?void 0:s.widgetContentContainer)==null?void 0:je.offset)==null?void 0:ke.side)??10),align:r?0:d+(((ze=(Ce=s==null?void 0:s.widgetContentContainer)==null?void 0:Ce.offset)==null?void 0:ze.align)??0)}},screens:{welcome:{width:i("w",((Ne=(Se=s==null?void 0:s.screens)==null?void 0:Se.welcome)==null?void 0:Ne.width)??"400px"),minHeight:i("h",((Ie=(_e=s==null?void 0:s.screens)==null?void 0:_e.welcome)==null?void 0:Ie.minHeight)??"1px")},sessions:{width:i("w",((Te=(Me=s==null?void 0:s.screens)==null?void 0:Me.sessions)==null?void 0:Te.width)??"450px"),height:i("h",((De=(Re=s==null?void 0:s.screens)==null?void 0:Re.sessions)==null?void 0:De.height)??"600px")},chat:{width:i("w",((Ee=(Pe=s==null?void 0:s.screens)==null?void 0:Pe.chat)==null?void 0:Ee.width)??"525px"),height:i("h",((We=(Ae=s==null?void 0:s.screens)==null?void 0:Ae.chat)==null?void 0:We.height)??"700px"),withCanvas:{width:i("w",((He=(Fe=(Oe=s==null?void 0:s.screens)==null?void 0:Oe.chat)==null?void 0:Fe.withCanvas)==null?void 0:He.width)??"min(1050px, 100vw)"),height:i("h",(($e=(Le=(qe=s==null?void 0:s.screens)==null?void 0:qe.chat)==null?void 0:Le.withCanvas)==null?void 0:$e.height)??"min(800px, 100vh)"),transitionTimingFunction:((Ue=(Ye=(Be=s==null?void 0:s.screens)==null?void 0:Be.chat)==null?void 0:Ye.withCanvas)==null?void 0:Ue.transitionTimingFunction)??Q.transitionTimingFunction,transitionDuration:((Ge=(Ve=(Xe=s==null?void 0:s.screens)==null?void 0:Xe.chat)==null?void 0:Ve.withCanvas)==null?void 0:Ge.transitionDuration)??Q.transitionDuration}}}},j={maxHeight:i("h",`calc(
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),_t=require("@radix-ui/react-popover"),m=require("react"),l=require("@opencx/widget-react-headless"),g=require("lucide-react"),It=require("clsx"),Mt=require("tailwind-merge"),z=require("framer-motion"),Tt=require("@radix-ui/react-slot"),Rt=require("class-variance-authority"),nt=require("remark-gfm"),Dt=require("react-markdown"),ot=require("rehype-raw"),A=require("@opencx/widget-core"),Pt=require("@radix-ui/react-avatar"),at=require("@uiw/react-iframe"),Et=require("@radix-ui/react-tooltip"),Ze=require("tinycolor2"),At=require("react-dropzone"),Wt=require("react-use/lib/useAsyncFn"),oe=require("zod");function te(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(r,s,n.get?n:{enumerable:!0,get:()=>t[s]})}}return r.default=t,Object.freeze(r)}const se=te(_t),B=te(m),Y=te(Pt),G=te(Et);function x(t){return{"data-component":t}}function h(...t){return Mt.twMerge(It.clsx(t))}const $={x:2,y:2},F=m.memo(m.forwardRef(({children:t,className:r,scale:s=1.02,off:n=!1},o)=>{const[a,i]=m.useState(!1),[c,d]=m.useState({x:0,y:0});if(n||/translate/.test(t.props.className||""))return t;const b=y=>{var T,w;const{clientX:S,clientY:I}=y,v=y.currentTarget.getBoundingClientRect(),R=S-(v.left+v.width/2),P=I-(v.top+v.height/2),E=Math.max(-1,Math.min(1,R/(v.width/2))),f=Math.max(-1,Math.min(1,P/(v.height/2))),M=E*$.x,D=f*$.y;d({x:M,y:D}),(w=(T=t.props).onMouseMove)==null||w.call(T,y)},k=()=>{var y,S;i(!0),(S=(y=t.props).onMouseEnter)==null||S.call(y)},u=()=>{var y,S;i(!1),d({x:0,y:0}),(S=(y=t.props).onMouseLeave)==null||S.call(y)},C={"--wobble-x":a?`${c.x}px`:"0px","--wobble-y":a?`${c.y}px`:"0px","--scale":1-(s-1)};return m.cloneElement(t,{ref:o,onMouseMove:b,onMouseEnter:k,onMouseLeave:u,style:{...C,...t.props.style},className:h("translate-x-[var(--wobble-x)]","translate-y-[var(--wobble-y)]","hover:scale-[var(--scale)] active:hover:scale-[calc(var(--scale)-0.02)]",r,t.props.className,"transition-all ease-out")})}));F.displayName="Wobble";const Ot=10,Ft=(t,r,s)=>({initial:{opacity:0,x:-t,...r.initial},animate:{opacity:1,x:0,...r.animate,transition:{delay:s}},exit:{opacity:0,x:t,...r.exit}}),Ht=(t,r,s)=>({initial:{opacity:0,x:t,...r.initial},animate:{opacity:1,x:0,...r.animate,transition:{delay:s}},exit:{opacity:0,x:-t,...r.exit}}),qt=(t,r,s)=>({initial:{opacity:0,y:t,...r.initial},animate:{opacity:1,y:0,...r.animate,transition:{delay:s}},exit:{opacity:0,y:-t,...r.exit}}),Lt=(t,r,s)=>({initial:{opacity:0,y:-t,...r.initial},animate:{opacity:1,y:0,...r.animate,transition:{delay:s}},exit:{opacity:0,y:t,...r.exit}}),$t={right:Ft,left:Ht,up:qt,down:Lt},j=m.forwardRef(({fadeIn:t="down",distance:r=Ot,children:s,snapExit:n=!1,overrides:o={},delay:a=0,...i},c)=>{const d=t?$t[t](r,o,a):{};return n&&d.exit&&typeof d.exit=="object"&&!Array.isArray(d.exit)&&(d.exit.transition={duration:0}),e.jsx(z.motion.div,{ref:c,...i,...d,children:s})});j.displayName="MotionDiv";const Bt=Rt.cva(h("inline-flex shrink-0 items-center justify-center gap-2","text-sm font-medium whitespace-nowrap","ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","active:scale-95 hover:active:scale-95","rounded-xl","transition"),{variants:{variant:{default:"bg-primary text-primary-foreground",destructive:"bg-destructive text-destructive-foreground",outline:"bg-background border",secondary:"bg-secondary text-secondary-foreground",ghost:"hover:bg-secondary",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"py-2 px-3.5 text-xs",lg:"min-h-12 px-4 rounded-[20px]",icon:"h-10 w-10",fit:"size-fit p-2",free:"p-2",selfless:"p-0"}},defaultVariants:{variant:"default",size:"default"}}),N=B.forwardRef(({className:t,variant:r="default",size:s,asChild:n=!1,...o},a)=>{const i=n?Tt.Slot:"button";return e.jsx(F,{ref:a,children:e.jsx(i,{...x("ui_lib/btn"),"data-variant":r,className:h(Bt({variant:r,size:s,className:t})),...o})})});N.displayName="Button";const it=m.createContext(null);function Yt({children:t}){const[r,s]=m.useState(!1),[n,o]=m.useState(null),a=c=>{o(c),s(!0)},i=()=>{s(!1),setTimeout(()=>{o(null)},200)};return e.jsxs(it.Provider,{value:{open:a,close:i,isOpen:r,content:n},children:[e.jsx(Ut,{}),t]})}function re(){const t=m.useContext(it);return t||(console.error("useDialoger must be used within a DialogerProvider"),{open:()=>{},close:()=>{},isOpen:!1,content:null})}function Ut(){const{contentIframeRef:t}=l.useWidget(),{isOpen:r,content:s,close:n}=re();return m.useEffect(()=>{var a,i;const o=c=>{c.key==="Escape"&&n()};return(i=(a=t==null?void 0:t.current)==null?void 0:a.contentWindow)==null||i.document.addEventListener("keydown",o),()=>{var c,d;return(d=(c=t==null?void 0:t.current)==null?void 0:c.contentWindow)==null?void 0:d.document.removeEventListener("keydown",o)}},[]),e.jsx(z.AnimatePresence,{mode:"wait",children:r&&s&&e.jsx(j,{overrides:{initial:{y:0},exit:{y:0}},className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm",tabIndex:-1,onClick:n,children:s},"dialog-content")})}function pe({children:t,className:r,withClose:s=!1}){const{close:n}=re();return e.jsxs("div",{className:h("fixed left-[50%] top-[50%] z-50 flex flex-col gap-4 w-full max-w-[61.8%] translate-x-[-50%] translate-y-[-50%] border bg-background p-4 rounded-3xl",r),onClick:o=>o.stopPropagation(),children:[t,s&&e.jsxs(N,{size:"fit",className:"rounded-full absolute top-4 right-4 opacity-50 hover:opacity-100",onClick:n,children:[e.jsx(g.X,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})}const lt=({className:t,...r})=>e.jsx("div",{className:h("flex flex-col gap-2 text-center pt-2",t),...r});lt.displayName="DialogerHeader";const ct=({className:t,...r})=>e.jsx("div",{className:h("flex flex-col gap-2 text-center",t),...r});ct.displayName="DialogerBody";const dt=({className:t,...r})=>e.jsx("div",{className:h("flex flex-col gap-2",t),...r});dt.displayName="DialogerFooter";const pt=m.forwardRef(({className:t,...r},s)=>e.jsx("p",{ref:s,className:h("text-lg font-semibold leading-none tracking-tight",t),...r}));pt.displayName="DialogerTitle";const ht=m.forwardRef(({className:t,...r},s)=>e.jsx("p",{ref:s,className:h("text-sm text-muted-foreground",t),...r}));ht.displayName="DialogerDescription";function he({children:t,trigger:r}){const{open:s}=re();return m.cloneElement(r,{onClick:()=>s(t)})}const Ke=1,Qe=5,K=.5,Xt=2.5;function Vt(t,r,s,n){if(!s||!n||r<=1)return{x:0,y:0};const o=s.getBoundingClientRect(),a=n.offsetWidth,i=n.offsetHeight,c=Math.max(0,(a*r-o.width)/(2*r)),d=Math.max(0,(i*r-o.height)/(2*r));return{x:Math.min(c,Math.max(-c,t.x)),y:Math.min(d,Math.max(-d,t.y))}}function mt({src:t,alt:r}){const[s,n]=m.useState(1),[o,a]=m.useState({x:0,y:0}),[i,c]=m.useState(!1),d=m.useRef({x:0,y:0}),p=m.useRef({x:0,y:0}),b=m.useRef(null),k=m.useRef(null),u=m.useRef(!1),C=f=>Math.min(Qe,Math.max(Ke,f)),y=m.useCallback(()=>{n(1),a({x:0,y:0})},[]),S=m.useCallback(()=>{n(f=>C(f+K))},[]),I=m.useCallback(()=>{n(f=>{const M=C(f-K);return M<=1&&a({x:0,y:0}),M})},[]);m.useCallback(f=>{f.preventDefault(),f.stopPropagation();const M=f.deltaY>0?-K:K;n(D=>{const T=C(D+M);return T<=1&&a({x:0,y:0}),T})},[]);const v=m.useCallback(f=>{f.preventDefault(),u.current=!1,c(!0),d.current={x:f.clientX,y:f.clientY},p.current={...o},f.target.setPointerCapture(f.pointerId)},[o]),R=m.useCallback(f=>{if(!i)return;const M=f.clientX-d.current.x,D=f.clientY-d.current.y;if((Math.abs(M)>3||Math.abs(D)>3)&&(u.current=!0),s<=1)return;const T={x:p.current.x+M/s,y:p.current.y+D/s};a(Vt(T,s,b.current,k.current))},[i,s]),P=m.useCallback(()=>{const f=u.current;c(!1),!f&&n(M=>M>1?(a({x:0,y:0}),1):Xt)},[]),E=s>1;return e.jsxs("div",{className:"relative size-full flex items-center justify-center select-none",onClick:f=>f.stopPropagation(),children:[e.jsx("div",{ref:b,className:h("overflow-hidden max-h-full max-w-full rounded-2xl flex items-center justify-center",E&&"size-full"),onPointerDown:v,onPointerMove:R,onPointerUp:P,onPointerCancel:P,style:{cursor:i?"grabbing":E?"grab":"zoom-in",touchAction:"none"},children:e.jsx("img",{ref:k,src:t,alt:r,className:"block max-w-full object-contain pointer-events-none",draggable:!1,style:{maxHeight:"100vh",transform:`scale(${s}) translate(${o.x}px, ${o.y}px)`,transformOrigin:"center center"}})}),e.jsxs("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 flex items-center gap-1 bg-black/60 backdrop-blur-sm rounded-full px-1.5 py-1 transition opacity-50 hover:opacity-100",children:[e.jsx(ae,{onClick:I,label:"Zoom out",disabled:s<=Ke,children:e.jsx(g.ZoomOut,{className:"size-3.5"})}),e.jsxs("span",{className:"text-white text-xs font-medium min-w-[3ch] text-center tabular-nums",children:[Math.round(s*100),"%"]}),e.jsx(ae,{onClick:S,label:"Zoom in",disabled:s>=Qe,children:e.jsx(g.ZoomIn,{className:"size-3.5"})}),E&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-4 bg-white/30 mx-0.5"}),e.jsx(ae,{onClick:y,label:"Reset zoom",children:e.jsx(g.RotateCcw,{className:"size-3.5"})})]})]})]})}function ae({onClick:t,label:r,children:s,disabled:n}){return e.jsx("button",{onClick:t,"aria-label":r,disabled:n,className:"text-white/80 hover:text-white disabled:text-white/30 disabled:hover:bg-transparent p-1.5 rounded-full hover:bg-white/15 transition-colors",children:s})}function ut({attachment:t}){const{name:r,size:s,type:n,url:o}=t,a=n.startsWith("image/"),i=n.startsWith("video/"),c=n.startsWith("audio/"),d=n==="application/pdf";return c?e.jsx(F,{children:e.jsx("div",{className:"w-full shrink-0 overflow-hidden",children:e.jsxs("audio",{controls:!0,className:"w-full",children:[e.jsx("source",{src:o,type:n}),"Your browser does not support the audio tag."]})})}):i?e.jsx(F,{children:e.jsx("div",{className:"w-full border shrink-0 rounded-2xl overflow-hidden",children:e.jsxs("video",{controls:!0,children:[e.jsx("source",{src:o,type:n}),"Your browser does not support the video tag."]})})}):a?e.jsx(he,{trigger:e.jsx("div",{children:e.jsx(F,{children:e.jsx("div",{className:"size-fit border shrink-0 rounded-2xl overflow-hidden",children:e.jsx("img",{src:o,className:"object-cover size-16",alt:r})})})}),children:e.jsx(pe,{className:"size-full max-w-full rounded-3xl flex items-center justify-center bg-transparent border-none gap-0",withClose:!0,children:e.jsx(mt,{src:o,alt:r})})}):d?e.jsx(F,{children:e.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:h("block size-fit max-w-[min(100%,16rem)] shrink-0 rounded-2xl border","bg-background/80 transition-colors hover:bg-accent/60","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),children:e.jsxs("div",{className:"flex items-center gap-3 p-3 min-w-0",children:[e.jsx("div",{className:h("flex size-10 shrink-0 items-center justify-center rounded-xl","bg-secondary text-muted-foreground"),"aria-hidden":!0,children:e.jsx(g.FileText,{className:"size-5",strokeWidth:1.75})}),e.jsxs("div",{className:"min-w-0 flex-1 flex flex-col gap-0.5 text-left",children:[e.jsx("span",{className:h("text-xs font-medium text-foreground line-clamp-1","break-words [word-break:break-word]"),children:r}),e.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:[(s/1024).toFixed(2)," KB · PDF"]})]})]})})}):e.jsx(F,{children:e.jsx("div",{className:"size-fit border shrink-0 rounded-2xl overflow-hidden",children:e.jsxs("div",{className:"flex items-end gap-2 p-2",children:[e.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:h("text-xs text-blue-500 line-clamp-2 underline hover:text-blue-600","break-words [word-break:break-word]"),children:r}),e.jsxs("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:[(s/1024).toFixed(2)," KB"]})]})})})}const gt=m.memo(Dt,(t,r)=>t.children===r.children&&t.className===r.className);function me({children:t,messageType:r,messageId:s}){const{anchorTarget:n}=l.useConfig();return e.jsx(gt,{"data-type":r,"data-id":s,remarkPlugins:[nt],rehypePlugins:[ot],components:{a:({children:o,...a})=>e.jsx("a",{target:a.target||n||"_top",...a,children:o}),img:({src:o,alt:a,...i})=>o?e.jsx(he,{trigger:e.jsx("img",{src:o,alt:a,...i,className:"cursor-pointer rounded-xl"}),children:e.jsx(pe,{className:"size-full max-w-full rounded-3xl flex items-center justify-center bg-transparent border-none gap-0",withClose:!0,children:e.jsx(mt,{src:o,alt:a})})}):e.jsx("img",{src:o,alt:a,...i})},children:t})}function U(){const{widgetCtx:{org:t}}=l.useWidget(),{sessionState:{session:r}}=l.useSessions(),s=l.useConfig(),{messagesState:{messages:n}}=l.useMessages(),{routerState:{screen:o}}=l.useWidgetRouter();return{react:m,org:t,session:r,config:s,messages:n,currentScreen:o}}function Gt({currentMessage:t}){var n;const r=U(),s=(n=r.config.customComponents)==null?void 0:n["message::after"];return s?e.jsx(s,{...r,currentMessage:t}):null}function ie(t){const{data:r,id:s,type:n,attachments:o,isFirstInGroup:a,isLastInGroup:i,isAloneInGroup:c,dataComponentNames:d,classNames:p}=t;if(n!=="AI"&&n!=="AGENT")return null;const{message:b,variant:k="default"}=r;return e.jsxs("div",{...x((d==null?void 0:d.messageContainer)??"chat/agent_msg/root"),className:h("w-5/6 flex flex-col items-start gap-1",p==null?void 0:p.messageContainer),children:[o&&o.length>0&&e.jsx("div",{className:"w-full gap-1 flex flex-row flex-wrap items-center justify-start",children:o==null?void 0:o.map(u=>e.jsx(ut,{attachment:u},u.id))}),b.length>0&&e.jsxs("div",{className:"flex flex-row gap-2",children:[e.jsx("div",{...x((d==null?void 0:d.message)??"chat/agent_msg/msg"),"data-first":a,"data-last":i,"data-alone":c,"data-variant":k,className:h("transition-all","w-fit py-3 px-4 rounded-3xl bg-secondary text-secondary-foreground","leading-snug text-sm prose prose-sm prose-a:decoration-primary prose-a:underline","break-words [word-break:break-word]",k==="error"&&"bg-destructive/15 text-destructive",a&&!c&&"rounded-bl-md",i&&!c&&"rounded-tl-md",!a&&!i&&!c&&"rounded-l-md",p==null?void 0:p.message),children:e.jsx(me,{messageType:n,messageId:s,children:b})}),e.jsx(Gt,{currentMessage:t})]})]})}function Zt(t){return e.jsx("div",{className:"w-full max-w-full overflow-auto shrink-0",children:e.jsx("pre",{className:"text-xs leading-tight whitespace-pre-wrap break-word",children:JSON.stringify(t,null,1)})})}const ue=B.forwardRef(({className:t,...r},s)=>e.jsx(Y.Root,{ref:s,className:h("relative flex size-6 aspect-square shrink-0 overflow-hidden rounded-full bg-secondary",t),...r}));ue.displayName=Y.Root.displayName;const ge=B.forwardRef(({className:t,...r},s)=>e.jsx(Y.Image,{ref:s,className:h("aspect-square h-full w-full",t),...r}));ge.displayName=Y.Image.displayName;const we=B.forwardRef(({className:t,...r},s)=>e.jsx(Y.Fallback,{ref:s,className:h("flex size-full text-xs items-center justify-center rounded-lg",t),...r}));we.displayName=Y.Fallback.displayName;function le({agent:t,...r}){var s,n;return e.jsxs(ue,{...r,children:[e.jsx(ge,{src:(t==null?void 0:t.avatarUrl)||(t==null?void 0:t.avatar)||"",alt:"Agent Icon"}),(t==null?void 0:t.name)&&e.jsx(we,{children:(n=(s=t==null?void 0:t.name)==null?void 0:s.slice(0,1))==null?void 0:n.toUpperCase()})]})}function Kt({agent:t}){return e.jsx(z.AnimatePresence,{children:e.jsxs(j,{...x("chat/bot_loading/root"),className:"flex flex-row items-end w-full gap-2 animate-pulse",children:[e.jsx(le,{agent:t}),e.jsxs("div",{...x("chat/bot_loading/bouncing_dots_container"),className:h("flex items-center [&_span]:bg-secondary-foreground [&_span]:size-1 gap-1 p-2 rounded-xl bg-secondary"),children:[e.jsx(z.motion.span,{className:"rounded-full animate-bounce [animation-delay:-0.3s]"}),e.jsx(z.motion.span,{className:"rounded-full animate-bounce [animation-delay:-0.15s]"}),e.jsx(z.motion.span,{className:"rounded-full animate-bounce"})]})]})})}const wt='*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}*{-ms-overflow-style:none;scrollbar-width:none}*::-webkit-scrollbar{display:none}*{border-color:hsl(var(--opencx-border))}.\\!container{width:100%!important}.container{width:100%}@media (min-width: 640px){.\\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width: 768px){.\\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width: 1024px){.\\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width: 1280px){.\\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width: 1536px){.\\!container{max-width:1536px!important}.container{max-width:1536px}}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"“""”""‘""’";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows) / 10%),0 3px rgb(var(--tw-prose-kbd-shadows) / 10%);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body: #374151;--tw-prose-headings: #111827;--tw-prose-lead: #4b5563;--tw-prose-links: #111827;--tw-prose-bold: #111827;--tw-prose-counters: #6b7280;--tw-prose-bullets: #d1d5db;--tw-prose-hr: #e5e7eb;--tw-prose-quotes: #111827;--tw-prose-quote-borders: #e5e7eb;--tw-prose-captions: #6b7280;--tw-prose-kbd: #111827;--tw-prose-kbd-shadows: 17 24 39;--tw-prose-code: #111827;--tw-prose-pre-code: #e5e7eb;--tw-prose-pre-bg: #1f2937;--tw-prose-th-borders: #d1d5db;--tw-prose-td-borders: #e5e7eb;--tw-prose-invert-body: #d1d5db;--tw-prose-invert-headings: #fff;--tw-prose-invert-lead: #9ca3af;--tw-prose-invert-links: #fff;--tw-prose-invert-bold: #fff;--tw-prose-invert-counters: #9ca3af;--tw-prose-invert-bullets: #4b5563;--tw-prose-invert-hr: #374151;--tw-prose-invert-quotes: #f3f4f6;--tw-prose-invert-quote-borders: #374151;--tw-prose-invert-captions: #9ca3af;--tw-prose-invert-kbd: #fff;--tw-prose-invert-kbd-shadows: 255 255 255;--tw-prose-invert-code: #fff;--tw-prose-invert-pre-code: #d1d5db;--tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);--tw-prose-invert-th-borders: #4b5563;--tw-prose-invert-td-borders: #374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.prose-sm{font-size:.875rem;line-height:1.7142857}.prose-sm :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;line-height:1.5555556;margin-top:.8888889em;margin-bottom:.8888889em}.prose-sm :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.3333333em;margin-bottom:1.3333333em;padding-inline-start:1.1111111em}.prose-sm :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.1428571em;margin-top:0;margin-bottom:.8em;line-height:1.2}.prose-sm :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.4285714em;margin-top:1.6em;margin-bottom:.8em;line-height:1.4}.prose-sm :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2857143em;margin-top:1.5555556em;margin-bottom:.4444444em;line-height:1.5555556}.prose-sm :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.4285714em;margin-bottom:.5714286em;line-height:1.4285714}.prose-sm :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;border-radius:.3125rem;padding-top:.1428571em;padding-inline-end:.3571429em;padding-bottom:.1428571em;padding-inline-start:.3571429em}.prose-sm :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em}.prose-sm :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.prose-sm :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8888889em}.prose-sm :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.6666667;margin-top:1.6666667em;margin-bottom:1.6666667em;border-radius:.25rem;padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em;padding-inline-start:1.5714286em}.prose-sm :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;margin-bottom:.2857143em}.prose-sm :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4285714em}.prose-sm :where(.prose-sm>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(.prose-sm>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(.prose-sm>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.1428571em}.prose-sm :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5714286em;margin-bottom:.5714286em}.prose-sm :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em;margin-bottom:1.1428571em}.prose-sm :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.1428571em}.prose-sm :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.2857143em;padding-inline-start:1.5714286em}.prose-sm :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8571429em;margin-bottom:2.8571429em}.prose-sm :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.5}.prose-sm :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.6666667em;padding-inline-end:1em;padding-bottom:.6666667em;padding-inline-start:1em}.prose-sm :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose-sm :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose-sm :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.7142857em;margin-bottom:1.7142857em}.prose-sm :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose-sm :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8571429em;line-height:1.3333333;margin-top:.6666667em}.prose-sm :where(.prose-sm>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose-sm :where(.prose-sm>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.bottom-3{bottom:.75rem}.end-6{inset-inline-end:1.5rem}.left-1\\/2{left:50%}.left-2{left:.5rem}.left-\\[50\\%\\]{left:50%}.right-4{right:1rem}.top-4{top:1rem}.top-6{top:1.5rem}.top-\\[50\\%\\]{top:50%}.isolate{isolation:isolate}.z-10{z-index:10}.z-50{z-index:50}.m-2{margin:.5rem}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-0\\.5{margin-left:.125rem;margin-right:.125rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.ms-auto{margin-inline-start:auto}.mt-0\\.5{margin-top:.125rem}.mt-auto{margin-top:auto}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.size-0{width:0px;height:0px}.size-10{width:2.5rem;height:2.5rem}.size-12{width:3rem;height:3rem}.size-16{width:4rem;height:4rem}.size-3{width:.75rem;height:.75rem}.size-3\\.5{width:.875rem;height:.875rem}.size-4{width:1rem;height:1rem}.size-5{width:1.25rem;height:1.25rem}.size-6{width:1.5rem;height:1.5rem}.size-8{width:2rem;height:2rem}.size-fit{width:fit-content;height:fit-content}.size-full{width:100%;height:100%}.h-0{height:0px}.h-10{height:2.5rem}.h-2{height:.5rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-dvh{height:100dvh}.h-full{height:100%}.h-px{height:1px}.max-h-16{max-height:4rem}.max-h-40{max-height:10rem}.max-h-full{max-height:100%}.min-h-12{min-height:3rem}.w-0{width:0px}.w-1\\/2{width:50%}.w-10{width:2.5rem}.w-2{width:.5rem}.w-2\\/5{width:40%}.w-3\\.5{width:.875rem}.w-3\\/5{width:60%}.w-4{width:1rem}.w-5\\/6{width:83.333333%}.w-60{width:15rem}.w-9{width:2.25rem}.w-auto{width:auto}.w-dvw{width:100dvw}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-80{min-width:20rem}.min-w-\\[3ch\\]{min-width:3ch}.min-w-\\[8rem\\]{min-width:8rem}.max-w-96{max-width:24rem}.max-w-\\[61\\.8\\%\\]{max-width:61.8%}.max-w-\\[min\\(100\\%\\,16rem\\)\\]{max-width:min(100%,16rem)}.max-w-full{max-width:100%}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-\\[2\\]{flex:2}.shrink-0{flex-shrink:0}.-translate-x-1\\/2,.translate-x-\\[-50\\%\\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\\[var\\(--wobble-x\\)\\]{--tw-translate-x: var(--wobble-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[-50\\%\\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[var\\(--wobble-y\\)\\]{--tw-translate-y: var(--wobble-y);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-\\[1px\\]{gap:1px}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-scroll{overflow:scroll}.scroll-smooth{scroll-behavior:smooth}.text-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-\\[20px\\]{border-radius:20px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-l-md{border-top-left-radius:.375rem;border-bottom-left-radius:.375rem}.rounded-r-md{border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}.rounded-bl-md{border-bottom-left-radius:.375rem}.rounded-br-md{border-bottom-right-radius:.375rem}.rounded-tl-md{border-top-left-radius:.375rem}.rounded-tr-md{border-top-right-radius:.375rem}.border{border-width:1px}.border-2{border-width:2px}.border-none{border-style:none}.border-transparent{border-color:transparent}.bg-\\[white\\]{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-background{background-color:hsl(var(--opencx-background))}.bg-background\\/80{background-color:hsl(var(--opencx-background) / .8)}.bg-black\\/50{background-color:#00000080}.bg-black\\/60{background-color:#0009}.bg-destructive{background-color:hsl(var(--opencx-destructive))}.bg-destructive\\/15{background-color:hsl(var(--opencx-destructive) / .15)}.bg-muted{background-color:hsl(var(--opencx-muted))}.bg-primary{background-color:hsl(var(--opencx-primary))}.bg-secondary{background-color:hsl(var(--opencx-secondary))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\\/30{background-color:#ffffff4d}.bg-\\[radial-gradient\\(ellipse_at_top_left\\,hsl\\(var\\(--opencx-primary\\)\\)\\,transparent\\)\\,radial-gradient\\(ellipse_at_top_right\\,hsl\\(var\\(--opencx-primary\\)\\)\\,transparent\\)\\]{background-image:radial-gradient(ellipse at top left,hsl(var(--opencx-primary)),transparent),radial-gradient(ellipse at top right,hsl(var(--opencx-primary)),transparent)}.fill-current{fill:currentColor}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-1\\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-8{padding:2rem}.px-1\\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3\\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pb-0{padding-bottom:0}.pb-2{padding-bottom:.5rem}.pe-2{padding-inline-end:.5rem}.pe-4{padding-inline-end:1rem}.ps-2{padding-inline-start:.5rem}.ps-4{padding-inline-start:1rem}.ps-8{padding-inline-start:2rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-start{text-align:start}.align-middle{vertical-align:middle}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-2xl{font-size:1.5rem;line-height:2rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\\[1\\.75rem\\]{font-size:1.75rem}.text-\\[10px\\]{font-size:10px}.text-\\[16px\\]{font-size:16px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-destructive{color:hsl(var(--opencx-destructive))}.text-destructive-foreground{color:hsl(var(--opencx-destructive-foreground))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--opencx-foreground))}.text-muted-foreground{color:hsl(var(--opencx-muted-foreground))}.text-muted-foreground\\/70{color:hsl(var(--opencx-muted-foreground) / .7)}.text-muted-foreground\\/75{color:hsl(var(--opencx-muted-foreground) / .75)}.text-primary{color:hsl(var(--opencx-primary))}.text-primary-foreground{color:hsl(var(--opencx-primary-foreground))}.text-secondary-foreground{color:hsl(var(--opencx-secondary-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\\/80{color:#fffc}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-35{opacity:.35}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-95{opacity:.95}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.outline-8{outline-width:8px}.outline-background{outline-color:hsl(var(--opencx-background))}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-offset-background{--tw-ring-offset-color: hsl(var(--opencx-background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\\[height\\]{transition-property:height;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in{--tw-enter-scale: 0}.zoom-in-95{--tw-enter-scale: .95}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.\\[animation-delay\\:-0\\.15s\\]{animation-delay:-.15s}.\\[animation-delay\\:-0\\.3s\\]{animation-delay:-.3s}.\\[field-sizing\\:content\\;\\],.\\[field-sizing\\:content\\]{field-sizing:content}.\\[word-break\\:break-word\\]{word-break:break-word}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:font-medium::file-selector-button{font-weight:500}.file\\:text-primary-foreground::file-selector-button{color:hsl(var(--opencx-primary-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--opencx-muted-foreground))}.placeholder\\:text-muted-foreground\\/75::placeholder{color:hsl(var(--opencx-muted-foreground) / .75)}.focus-within\\:border-primary:focus-within{border-color:hsl(var(--opencx-primary))}.hover\\:scale-\\[var\\(--scale\\)\\]:hover{--tw-scale-x: var(--scale);--tw-scale-y: var(--scale);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:border-primary:hover{border-color:hsl(var(--opencx-primary))}.hover\\:bg-accent\\/60:hover{background-color:hsl(var(--opencx-accent) / .6)}.hover\\:bg-secondary:hover{background-color:hsl(var(--opencx-secondary))}.hover\\:bg-white\\/15:hover{background-color:#ffffff26}.hover\\:text-blue-600:hover{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.hover\\:text-primary:hover{color:hsl(var(--opencx-primary))}.hover\\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.focus\\:bg-accent:focus{background-color:hsl(var(--opencx-accent))}.focus\\:text-accent-foreground:focus{color:hsl(var(--opencx-accent-foreground))}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--opencx-ring))}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--opencx-background))}.active\\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\\:hover\\:scale-\\[calc\\(var\\(--scale\\)-0\\.02\\)\\]:hover:active{--tw-scale-x: calc(var(--scale) - .02);--tw-scale-y: calc(var(--scale) - .02);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:active\\:scale-95:active:hover{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:text-white\\/30:disabled{color:#ffffff4d}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:hover\\:bg-transparent:hover:disabled{background-color:transparent}.group:hover .group-hover\\:opacity-100{opacity:1}.group:hover .group-hover\\:active\\:scale-90:active,.group:active .group-active\\:scale-90{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[state\\=checked\\]\\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[state\\=checked\\]\\:bg-primary[data-state=checked]{background-color:hsl(var(--opencx-primary))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open]{background-color:hsl(var(--opencx-accent))}.data-\\[state\\=unchecked\\]\\:bg-input[data-state=unchecked]{background-color:hsl(var(--opencx-input))}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.prose-a\\:underline :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-line:underline}.prose-a\\:decoration-primary :is(:where(a):not(:where([class~=not-prose],[class~=not-prose] *))){text-decoration-color:hsl(var(--opencx-primary))}.rtl\\:-scale-100:where([dir=rtl],[dir=rtl] *){--tw-scale-x: -1;--tw-scale-y: -1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\\[\\&_span\\]\\:size-1 span{width:.25rem;height:.25rem}.\\[\\&_span\\]\\:bg-secondary-foreground span{background-color:hsl(var(--opencx-secondary-foreground))}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:size-4 svg{width:1rem;height:1rem}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_svg\\]\\:text-muted-foreground\\/70 svg{color:hsl(var(--opencx-muted-foreground) / .7)}.\\[\\&_svg\\]\\:hover\\:text-primary:hover svg{color:hsl(var(--opencx-primary))}',Qt=G.Provider,Jt=G.Root,es=G.Trigger,ft=B.forwardRef(({className:t,sideOffset:r=4,...s},n)=>e.jsx(G.Content,{ref:n,sideOffset:r,className:h("z-50 overflow-hidden max-w-xs rounded-xl bg-primary border text-primary-foreground p-2 text-center align-middle text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...s}));ft.displayName=G.Content.displayName;function X({children:t,content:r,side:s,align:n}){const{disableTooltips:o}=l.useConfig();return!r||o?t:e.jsxs(Jt,{children:[e.jsx(es,{asChild:!0,children:t}),e.jsx(ft,{side:s,align:n,collisionPadding:8,avoidCollisions:!0,children:r})]})}const Je=450;function O(){const[t,r]=m.useState(()=>(window.top||window).innerWidth<Je);return m.useEffect(()=>{const s=window.top||window,n=()=>{r(s.innerWidth<Je)};return n(),s.addEventListener("resize",n),()=>{s.removeEventListener("resize",n)}},[]),{isSmallScreen:t}}const Q={transitionTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)",transitionDuration:"1000ms"};function q(){var k,u,C,y,S,I,v,R,P,E,f,M,D,T,w,_,Z,be,ye,je,ke,Ce,ze,Se,Ne,_e,Ie,Me,Te,Re,De,Pe,Ee,Ae,We,Oe,Fe,He,qe,Le,$e,Be,Ye,Ue,Xe,Ve,Ge;const{dir:t}=l.useDocumentDir(),{isSmallScreen:r}=O(),{theme:s,inline:n}=l.useConfig(),o=H=>n?"100%":H,a=(H,ne)=>r?`100dv${H}`:ne,i=(H,ne)=>o(a(H,ne)),c={zIndex:((k=s==null?void 0:s.widgetTrigger)==null?void 0:k.zIndex)??1e7,offset:{bottom:((C=(u=s==null?void 0:s.widgetTrigger)==null?void 0:u.offset)==null?void 0:C.bottom)??20,right:((S=(y=s==null?void 0:s.widgetTrigger)==null?void 0:y.offset)==null?void 0:S.right)??(t==="ltr"?20:"initial"),left:((v=(I=s==null?void 0:s.widgetTrigger)==null?void 0:I.offset)==null?void 0:v.left)??(t==="rtl"?20:"initial")},size:{button:((P=(R=s==null?void 0:s.widgetTrigger)==null?void 0:R.size)==null?void 0:P.button)??48,icon:((f=(E=s==null?void 0:s.widgetTrigger)==null?void 0:E.size)==null?void 0:f.icon)??24}},d=(()=>{const H=t==="ltr"?c.offset.right:c.offset.left;return typeof H!="number"?0:H})(),p={palette:(s==null?void 0:s.palette)??"neutral",primaryColor:(s==null?void 0:s.primaryColor)??"hsl(0 0% 9%)",widgetTrigger:c,widgetContentContainer:{borderRadius:r?"0px":((M=s==null?void 0:s.widgetContentContainer)==null?void 0:M.borderRadius)??"32px",zIndex:((D=s==null?void 0:s.widgetContentContainer)==null?void 0:D.zIndex)??c.zIndex+1,outline:((T=s==null?void 0:s.widgetContentContainer)==null?void 0:T.outline)??"none",outlineColor:((w=s==null?void 0:s.widgetContentContainer)==null?void 0:w.outlineColor)??"hsl(0 0% 50% / .5)",boxShadow:((_=s==null?void 0:s.widgetContentContainer)==null?void 0:_.boxShadow)??"0 0px 100px 0px rgb(0 0 0 / 0.25)",transitionProperty:((Z=s==null?void 0:s.widgetContentContainer)==null?void 0:Z.transitionProperty)??"all",transitionTimingFunction:((be=s==null?void 0:s.widgetContentContainer)==null?void 0:be.transitionTimingFunction)??Q.transitionTimingFunction,transitionDuration:((ye=s==null?void 0:s.widgetContentContainer)==null?void 0:ye.transitionDuration)??Q.transitionDuration,offset:{side:r?0:c.offset.bottom+c.size.button+$.y*2+(((ke=(je=s==null?void 0:s.widgetContentContainer)==null?void 0:je.offset)==null?void 0:ke.side)??10),align:r?0:d+(((ze=(Ce=s==null?void 0:s.widgetContentContainer)==null?void 0:Ce.offset)==null?void 0:ze.align)??0)}},screens:{welcome:{width:i("w",((Ne=(Se=s==null?void 0:s.screens)==null?void 0:Se.welcome)==null?void 0:Ne.width)??"400px"),minHeight:i("h",((Ie=(_e=s==null?void 0:s.screens)==null?void 0:_e.welcome)==null?void 0:Ie.minHeight)??"1px")},sessions:{width:i("w",((Te=(Me=s==null?void 0:s.screens)==null?void 0:Me.sessions)==null?void 0:Te.width)??"450px"),height:i("h",((De=(Re=s==null?void 0:s.screens)==null?void 0:Re.sessions)==null?void 0:De.height)??"600px")},chat:{width:i("w",((Ee=(Pe=s==null?void 0:s.screens)==null?void 0:Pe.chat)==null?void 0:Ee.width)??"525px"),height:i("h",((We=(Ae=s==null?void 0:s.screens)==null?void 0:Ae.chat)==null?void 0:We.height)??"700px"),withCanvas:{width:i("w",((He=(Fe=(Oe=s==null?void 0:s.screens)==null?void 0:Oe.chat)==null?void 0:Fe.withCanvas)==null?void 0:He.width)??"min(1050px, 100vw)"),height:i("h",(($e=(Le=(qe=s==null?void 0:s.screens)==null?void 0:qe.chat)==null?void 0:Le.withCanvas)==null?void 0:$e.height)??"min(800px, 100vh)"),transitionTimingFunction:((Ue=(Ye=(Be=s==null?void 0:s.screens)==null?void 0:Be.chat)==null?void 0:Ye.withCanvas)==null?void 0:Ue.transitionTimingFunction)??Q.transitionTimingFunction,transitionDuration:((Ge=(Ve=(Xe=s==null?void 0:s.screens)==null?void 0:Xe.chat)==null?void 0:Ve.withCanvas)==null?void 0:Ge.transitionDuration)??Q.transitionDuration}}}},b={maxHeight:i("h",`calc(
2
2
  100vh
3
3
  - ${p.widgetTrigger.offset.bottom}px
4
4
  - ${p.widgetContentContainer.offset.side}px
@@ -14,7 +14,7 @@
14
14
  ${p.screens.welcome.width},
15
15
  ${p.screens.sessions.width},
16
16
  ${p.screens.chat.width}
17
- )`)};return{theme:p,computed:j,cssVars:ts({palette:p.palette,primary:p.primaryColor})}}function ts({palette:t,primary:r}){const s=xt(t),o=Ze(r).toHsl(),n=Ze(r).isLight()?s[950]:s[50];return{"--opencx-primary":`${o.h} ${o.s*100}% ${o.l*100}%`,"--opencx-primary-foreground":n,"--opencx-background":s[100],"--opencx-foreground":s[950],"--opencx-destructive":"0 72.2% 50.6%","--opencx-destructive-foreground":s[50],"--opencx-accent":s[200],"--opencx-accent-foreground":"var(--opencx-foreground)","--opencx-secondary":s[200],"--opencx-secondary-foreground":"var(--opencx-foreground)","--opencx-muted":s[200],"--opencx-muted-foreground":s[500],"--opencx-input":s[300],"--opencx-border":s[300],"--opencx-ring":"var(--opencx-foreground)"}}function xt(t){const r={50:"0 0% 98%",100:"0 0% 96.1%",200:"0 0% 89.8%",300:"0 0% 83.1%",400:"0 0% 63.9%",500:"0 0% 45.1%",600:"0 0% 32.2%",700:"0 0% 25.1%",800:"0 0% 14.9%",900:"0 0% 9%",950:"0 0% 3.9%"},s={50:"60 9.1% 97.8%",100:"60 4.8% 95.9%",200:"20 5.9% 90%",300:"24 5.7% 82.9%",400:"24 5.4% 63.9%",500:"25 5.3% 44.7%",600:"33.3 5.5% 32.4%",700:"30 6.3% 25.1%",800:"12 6.5% 15.1%",900:"24 9.8% 10%",950:"20 14.3% 4.1%"},o={50:"0 0% 98%",100:"240 4.8% 95.9%",200:"240 5.9% 90%",300:"240 4.9% 83.9%",400:"240 5% 64.9%",500:"240 3.8% 46.1%",600:"240 5.2% 33.9%",700:"240 5.3% 26.1%",800:"240 3.7% 15.9%",900:"240 5.9% 10%",950:"240 10% 3.9%"},n={50:"210 40% 98%",100:"210 40% 96.1%",200:"214.3 31.8% 91.4%",300:"212.7 26.8% 83.9%",400:"215 20.2% 65.1%",500:"215.4 16.3% 46.9%",600:"215.3 19.3% 34.5%",700:"215.3 25% 26.7%",800:"217.2 32.6% 17.5%",900:"222.2 47.4% 11.2%",950:"222.2 84% 4.9%"};switch(t){case"neutral":return r;case"stone":return s;case"zinc":return o;case"slate":return n;default:return P.isExhaustive(t,xt.name),r}}function vt(){const{contentIframeRef:t}=l.useWidget(),{inline:r}=l.useConfig();return{setWidth:s=>{var o;(o=t==null?void 0:t.current)==null||o.style.setProperty("--opencx-widget-width",r?"100%":s)},setHeight:s=>{var o;(o=t==null?void 0:t.current)==null||o.style.setProperty("--opencx-widget-height",r?"100%":s)}}}function fe({width:t,height:r}){const{isSmallScreen:s}=W(),{setWidth:o,setHeight:n}=vt();h.useEffect(()=>{t&&o(t),r&&n(r)},[s,r,t,o,n])}const et=g.CircleDashedIcon;function V({name:t,className:r}){const s=(()=>{switch(t){case"Check":return g.CheckIcon;case"CheckCheck":return g.CheckCheckIcon;case"CircleCheck":return g.CircleCheckIcon;case"CircleCheckBig":return g.CircleCheckBigIcon;case"CircleX":return g.CircleXIcon;case"Expand":return g.ExpandIcon;case"Maximize":return g.MaximizeIcon;case"Maximize2":return g.Maximize2Icon;case"Minimize":return g.MinimizeIcon;case"Minimize2":return g.Minimize2Icon;case"Shrink":return g.ShrinkIcon;case"SquareCheck":return g.SquareCheckIcon;case"SquareCheckBig":return g.SquareCheckBigIcon;case"SquareX":return g.SquareXIcon;case"X":return g.XIcon;case void 0:return et;default:return P.isExhaustive(t,V.name),et}})();return e.jsx(s,{className:m("size-4",r)})}function ss(){var s;const t=U(),r=(s=t.config.customComponents)==null?void 0:s.headerBottom;return r?e.jsx(r,{...t}):null}function rs({fallback:t}){var o;const r=U(),s=(o=r.config.customComponents)==null?void 0:o.headerTitle;return s?e.jsx(s,{...r}):t}function xe(){const{widgetCtx:{org:t}}=l.useWidget(),{routerState:{screen:r}}=l.useWidgetRouter(),{textContent:s}=l.useConfig();return(()=>{var n,a;switch(r){case"chat":return(n=s==null?void 0:s.chatScreen)==null?void 0:n.headerTitle;case"sessions":return(a=s==null?void 0:s.sessionsScreen)==null?void 0:a.headerTitle;case"welcome":return;default:P.isExhaustive(r,xe.name);return}})()??t.name??"Chat"}function os(t){switch(t){case"chat":return f("chat/header");case"sessions":return f("sessions/header");case"welcome":return;default:P.isExhaustive(t,xe.name);return}}function ns(){const{router:t}=l.useConfig(),{routerState:{screen:r},toSessionsScreen:s}=l.useWidgetRouter();return r!=="chat"||t!=null&&t.chatScreenOnly?null:e.jsx(_,{variant:"ghost",size:"fit",className:"rounded-full",onClick:s,children:e.jsx(g.ChevronLeftIcon,{className:"size-4 rtl:-scale-100"})})}function as({button:t}){const{setIsOpen:r}=l.useWidgetTrigger(),{isSmallScreen:s}=W();if(s&&t.hideOnSmallScreen||!s&&t.hideOnLargeScreen)return null;const o=()=>{if(t.handleClick)return t.handleClick();r(!1)};return e.jsx(_,{variant:"ghost",size:"fit",className:"rounded-full",onClick:o,children:e.jsx(V,{name:t.icon})})}function ce({button:t}){const[r,s]=h.useState(!1),{routerState:{screen:o}}=l.useWidgetRouter(),{isSmallScreen:n}=W(),{theme:a}=q(),{setWidth:i,setHeight:c}=vt();if(o!=="chat"&&o!=="sessions")return null;const d=(()=>{switch(o){case"chat":return a.screens.chat.height;case"sessions":return a.screens.sessions.height;default:return P.isExhaustive(o,ce.name),a.screens.chat.height}})(),p=(()=>{switch(o){case"chat":return a.screens.chat.width;case"sessions":return a.screens.sessions.width;default:return P.isExhaustive(o,ce.name),a.screens.chat.width}})(),j=()=>{s(b=>{const u=!b;return c(u?"100vh":d),i(u?`max(40vw, ${p})`:p),u})};return n&&t.hideOnSmallScreen||!n&&t.hideOnLargeScreen?null:e.jsx(_,{variant:"ghost",size:"fit",className:"rounded-full",onClick:j,children:e.jsx(V,{name:t.icon||(r?t.shrinkIcon:t.expandIcon)})})}function bt({button:t}){var S,T;const{close:r}=re(),{widgetCtx:s}=l.useWidget(),{setIsOpen:o}=l.useWidgetTrigger(),{resolveSession:n,sessionState:a}=l.useSessions(),{isSmallScreen:i}=W(),c=!a.session,d=((S=a.session)==null?void 0:S.isOpened)===!1,p=t.onResolved||"stay-in-chat",j=t.behaviorBeforeSessionCreation||"disabled",b=t.behaviorIfSessionIsResolved||"disabled",u=!!(a.isResolvingSession||c&&j==="disabled"||d&&b==="disabled"),z=async()=>{const{success:y,error:R}=await n();if(r(),!y)return console.error(R);switch(p){case"stay-in-chat":return;case"close-widget":o(!1);break;case"reset-chat":s.resetChat();break;case"reset-chat-and-close-widget":o(!1),s.resetChat();break;default:P.isExhaustive(p,bt.name);break}},v=()=>{if(c)switch(j){case"disabled":return;case"close-widget":o(!1);break;default:P.isExhaustive(j,v.name)}if(d)switch(b){case"disabled":return;case"close-widget":o(!1);break;case"reset-chat":s.resetChat();break;case"reset-chat-and-close-widget":o(!1),setTimeout(()=>{s.resetChat()},200);break;default:P.isExhaustive(b,v.name)}};return i&&t.hideOnSmallScreen||!i&&t.hideOnLargeScreen?null:((T=t.confirmation)==null?void 0:T.type)==="modal"&&!d&&!c?e.jsx(he,{trigger:e.jsx(_,{variant:"ghost",size:"fit",className:"rounded-full",disabled:u,children:e.jsx(V,{name:t.icon})}),children:e.jsxs(pe,{children:[e.jsx(lt,{children:e.jsx(pt,{children:t.confirmation.title||"Close conversation"})}),e.jsx(ct,{children:e.jsx(ht,{children:t.confirmation.description||"Are you sure you want to close this conversation?"})}),e.jsxs(dt,{children:[e.jsx(_,{variant:"secondary",onClick:r,disabled:a.isResolvingSession,children:t.confirmation.cancelButtonText||"No"}),e.jsx(_,{variant:"destructive",onClick:z,disabled:a.isResolvingSession,children:t.confirmation.confirmButtonText||"Yes"})]})]})}):e.jsx(_,{variant:"ghost",size:"fit",className:"rounded-full",onClick:d||c?v:z,disabled:u,children:e.jsx(V,{name:t.icon})})}function de({button:t}){switch(t.functionality){case"close-widget":return e.jsx(as,{button:t});case"expand-shrink":return e.jsx(ce,{button:t});case"resolve-session":return e.jsx(bt,{button:t});default:return P.isExhaustive(t,de.name),null}}const is={functionality:"close-widget",hideOnLargeScreen:!0,icon:"X"};function ls(){const{routerState:{screen:t}}=l.useWidgetRouter(),{headerButtons:r}=l.useConfig(),s=t==="chat"?r==null?void 0:r.chatScreen:t==="sessions"?r==null?void 0:r.sessionsScreen:[];return!s||s.length===0?e.jsx(de,{button:is}):e.jsx(e.Fragment,{children:s.map(o=>e.jsx(de,{button:o},`${o.functionality}-${o.icon}`))})}function yt(){const{routerState:{screen:t}}=l.useWidgetRouter(),r=os(t),s=xe();return e.jsxs("header",{...r,className:"py-2 px-4 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ns,{}),e.jsx("div",{className:m("flex-1 h-8 flex items-center",t==="sessions"&&"ps-2"),children:e.jsx(rs,{fallback:e.jsx("h2",{className:"font-semibold",children:s})})}),e.jsx(ls,{})]}),e.jsx(ss,{})]})}function jt({className:t}){return e.jsx(g.LoaderIcon,{className:m("size-4 animate-spin",t)})}function cs(){const{messagesState:{isInitialFetchLoading:t}}=l.useMessages(),{isSmallScreen:r}=W(),{activeMode:s,Component:o}=l.useModes();return{isCanvasOpen:!t&&!r&&!!s&&!!o}}function ds(){const t=U(),{activeMode:r,Component:s}=l.useModes(),{sendMessage:o}=l.useMessages(),{createStateCheckpoint:n}=l.useSessions(),[a,i]=h.useState(!1),c=async d=>{try{i(!0),await o(d)}catch(p){console.error(p)}finally{i(!1)}};return!r||!s?null:e.jsx(s,{...t,mode:r,createStateCheckpoint:n,sendMessage:c,isSendingMessage:a})}const A=h.forwardRef((t,r)=>{var s,o,n;return e.jsx(C,{...t,ref:r,className:m("overflow-hidden",t.className),overrides:{initial:{height:0,opacity:0,...(s=t.overrides)==null?void 0:s.initial},animate:{height:"auto",opacity:1,...(o=t.overrides)==null?void 0:o.animate},exit:{height:0,opacity:0,...(n=t.overrides)==null?void 0:n.exit}}})});A.displayName="MotionDiv__VerticalReveal";const ps=[{label:"Terrible",value:1,emoji:"😡"},{label:"Poor",value:2,emoji:"😞"},{label:"Okay",value:3,emoji:"😐"},{label:"Good",value:4,emoji:"😊"},{label:"Great",value:5,emoji:"😍"}];function hs(){const{isSmallScreen:t}=W(),{submitCsat:r,isCsatRequested:s,isCsatSubmitted:o,submittedScore:n,submittedFeedback:a}=l.useCsat(),[i,c]=h.useState(null),[d,p]=h.useState(null),j=u=>{c(z=>z===u?null:u)},b=()=>{i&&r({score:i,feedback:d||void 0})};return!s&&!o?null:e.jsxs("div",{className:"w-1/2 min-w-80 max-w-96 mx-auto overflow-hidden",children:[e.jsx(N.AnimatePresence,{mode:"wait",children:s&&!i?e.jsx(A,{children:e.jsx("p",{className:"text-sm text-muted-foreground text-center pt-2",children:"How was your conversation?"})},"csat-requested-title"):o?e.jsx(A,{children:e.jsx("p",{className:"text-sm text-muted-foreground text-center pt-2",children:"You rated the conversation as"})},"csat-submitted-title"):null}),e.jsx("div",{className:m("flex gap-4 justify-between pt-2 px-2 pb-2","transition-all",o&&"gap-0 justify-center"),children:ps.map(u=>e.jsx(_,{variant:u.value===i?"secondary":"ghost",size:"selfless",className:m("transition-all overflow-hidden","text-2xl size-8 rounded-full","opacity-35","hover:opacity-100",!i&&"opacity-100",u.value===i&&"opacity-100",o&&u.value!==n&&"opacity-0 size-0",o&&u.value===n&&"opacity-100 size-fit text-4xl"),onClick:s?()=>j(u.value):void 0,children:u.emoji},u.value))}),e.jsx(N.AnimatePresence,{mode:"wait",children:(i||n)&&e.jsx(A,{children:e.jsxs("div",{className:"pb-2 px-2 flex items-end",children:[e.jsx("textarea",{rows:3,className:m("transition-all","max-h-40 [field-sizing:content]","w-full resize-none","bg-transparent outline-none","placeholder:text-muted-foreground",t?"text-[16px]":"text-sm",o&&"text-center"),value:o?a||"":d||"",onChange:s?u=>p(u.target.value):void 0,readOnly:o,placeholder:s?"Tell us more... (optional)":void 0}),e.jsx(_,{size:"fit",onClick:b,disabled:!i,className:m("transition-all overflow-hidden","rounded-full size-8 flex items-center justify-center p-0",o&&"opacity-0 size-0"),children:e.jsx(g.ArrowUpIcon,{className:"size-4"})})]})},"feedback-box")}),e.jsx("div",{className:m("h-0 transition-[height]",o&&"h-4")})]})}function L(){const{dir:t}=l.useDocumentDir(),r=l.useConfig();return h.useMemo(()=>{const s=P.isSupportedLanguage(r.language)?r.language:"en";return{t:o=>P.getTranslation(o,s,r.translationOverrides),language:s,dir:s==="ar"?"rtl":"ltr",hostDocumentDir:t}},[r.language,t])}function ve({suggestion:t,className:r,...s}){const{sendMessage:o}=l.useMessages(),n=()=>{const a=t.trim();a&&o({content:a})};return e.jsx(_,{...f("chat/suggested_reply_btn"),size:"sm",className:m("rounded-xl w-fit",r),...s,onClick:n,children:t})}function ms(){const{t}=L(),r=[t("i_need_more_help"),t("this_was_helpful")];return e.jsx("div",{...f("chat/might_solve_user_issue_suggested_replies_container"),className:"flex items-center gap-2 p-2 pb-0 flex-wrap",children:r.map(s=>e.jsx(ve,{suggestion:s,className:"flex-1"},s))})}function tt(){const{sessionState:t}=l.useSessions(),{chatFooterItems:r}=l.useConfig(),s=!!t.session&&!t.session.isOpened,o=!s;return e.jsx(N.AnimatePresence,{mode:"wait",children:r==null?void 0:r.map((n,a)=>n.showWhenSessionIsOpen===!1&&o||n.showWhenSessionIsResolved===!1&&s?null:e.jsx(A,{children:e.jsx("div",{className:"pb-2 text-center text-xs",children:e.jsx(me,{children:n.message})})},`${n.message}-${a}`))})}function us({file:{status:t,file:r,error:s},onCancel:o}){const[n,a]=h.useState(null);h.useEffect(()=>{if(!r.type.startsWith("image/"))return;const d=new FileReader;return d.onload=()=>a(d.result),d.onerror=()=>console.error("Error reading file"),d.readAsDataURL(r),()=>d.abort()},[r]);const i=()=>{switch(t){case"uploading":return e.jsx(g.Loader2,{className:"size-4 animate-spin"});case"error":return e.jsx(g.AlertCircle,{className:"size-4 text-destructive"});default:return null}},c=()=>{const d=r.type.split("/")[0];return d==="image"&&n?e.jsx("img",{src:typeof n=="string"?n:"",className:"object-cover bg-secondary size-full",alt:r.name}):d==="audio"?e.jsx(g.FileAudio2Icon,{}):d==="video"?e.jsx(g.FileVideo2Icon,{}):e.jsx(g.FileIcon,{})};return e.jsx(X,{side:"bottom",content:t==="error"?e.jsxs("span",{className:"text-destructive",children:["Failed to upload: ",s]}):r.name,children:e.jsxs("div",{className:m(t==="uploading"&&"opacity-50","group","size-12 border rounded-2xl overflow-hidden relative","flex items-center justify-center shrink-0"),children:[e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:i()}),e.jsx("button",{type:"button",className:m("absolute bg-black/50 inset-0 size-full z-10 opacity-0","flex items-center justify-center","opacity-0 group-hover:opacity-100 transition"),onClick:o,children:e.jsx(g.XIcon,{className:"size-4 text-primary-foreground"})}),e.jsx(c,{})]})})}function gs(){var I;const{isSmallScreen:t}=W(),r=h.useRef(null),{sendMessage:s}=l.useMessages(),{sessionState:o}=l.useSessions(),{t:n}=L(),[a,i]=h.useState(""),{allFiles:c,emptyTheFiles:d,handleCancelUpload:p,appendFiles:j,isUploading:b,successFiles:u}=l.useUploadFiles(),z=!!((I=o.session)!=null&&I.isHandedOff),{isAwaitingBotReply:v}=l.useIsAwaitingBotReply(),S=x=>{j(x)},T=!a.trim()&&u.length===0,y=async()=>{if(v||T)return;b&&console.info("please wait for the file(s) to upload");const x=a.trim();s({content:x,attachments:u.flatMap(k=>k.fileUrl?[{url:k.fileUrl,type:k.file.type,name:k.file.name,id:k.id,size:k.file.size}]:[])}),i(""),d()},{getRootProps:R,getInputProps:E,open:D}=At.useDropzone({onDrop:S,noClick:!0,onDropRejected(){console.error("unsupported file type, or the file is too large")},maxSize:5*1024*1024,accept:z?{"text/*":[".txt"],"image/*":[".png",".jpg",".jpeg",".gif"],"application/pdf":[".pdf"]}:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg"],"image/gif":[".gif"],"image/webp":[".webp"]}}),w=x=>{const k=x.clipboardData;k&&k.files.length>0&&S(Array.from(k.files))};return e.jsxs("div",{...f("chat/input_box/root"),className:"p-2 relative space-y-1",...R(),children:[e.jsx("input",{...E()}),e.jsxs("div",{...f("chat/input_box/inner_root"),className:m("transition-all","bg-white","relative rounded-3xl flex flex-col gap-2 p-2","hover:border-primary focus-within:border-primary"),children:[e.jsxs("div",{...f("chat/input_box/textarea_and_attachments_container"),className:"flex flex-col gap-2",children:[c.length>0&&e.jsx("div",{...f("chat/input_box/attachments_container"),className:"flex items-center gap-1",children:e.jsx(N.AnimatePresence,{mode:"popLayout",children:c.map(x=>e.jsx(C,{snapExit:!0,children:e.jsx(us,{onCancel:()=>p(x.id),file:x})},x.id))})}),e.jsx("textarea",{...f("chat/input_box/textarea"),onPaste:w,ref:r,id:"chat-input",value:a,rows:3,className:m("max-h-16 [field-sizing:content]","w-full resize-none px-2",c.length===0&&"pt-1","bg-transparent outline-none","placeholder:text-muted-foreground",t?"text-[16px]":"text-sm"),onChange:x=>i(x.target.value),onKeyDown:async x=>{x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),y())},placeholder:n("write_a_message_placeholder")})]}),e.jsxs("div",{className:"gap-2 flex justify-between",children:[e.jsx(X,{side:"top",align:"start",content:"attach files, (maximum size 5mb)",children:e.jsx(_,{onClick:D,size:"fit",variant:"ghost",className:m("rounded-full size-8 flex items-center justify-center p-0 overflow-hidden"),children:e.jsx(N.AnimatePresence,{mode:"wait",children:z&&!v?e.jsx(C,{children:e.jsx(g.PaperclipIcon,{className:"size-4"})},"paper-clip"):e.jsx(C,{children:e.jsx(g.ImageIcon,{className:"size-4"})},"image-icon")})})}),e.jsx(X,{content:"send message",side:"top",align:"end",children:e.jsx(_,{size:"fit",onClick:y,disabled:v||b||T,className:"rounded-full size-8 flex items-center justify-center p-0",children:e.jsx(N.AnimatePresence,{mode:"wait",children:v||b?e.jsx(C,{snapExit:!0,children:e.jsx(g.CircleDashed,{className:"size-4 animate-spin animate-iteration-infinite"})},"loading"):e.jsx(C,{snapExit:!0,children:e.jsx(g.ArrowUpIcon,{className:"size-4"})},"send")})})})]})]})]})}function st(){const{widgetCtx:t}=l.useWidget(),{router:r}=l.useConfig(),{canCreateNewSession:s}=l.useSessions(),{toSessionsScreen:o}=l.useWidgetRouter(),{t:n}=L();return e.jsx(e.Fragment,{children:s||r!=null&&r.chatScreenOnly?e.jsx(_,{onClick:t.resetChat,className:"rounded-2xl w-full",children:n("new_conversation")}):e.jsx(_,{onClick:o,className:"rounded-2xl w-full",children:n("back_to_conversations")})})}function ws(){const{t}=L(),{isCsatRequested:r,isCsatSubmitted:s}=l.useCsat();return e.jsx("div",{className:"p-2",children:e.jsx("div",{className:"p-2 bg-muted rounded-3xl",children:e.jsx(N.AnimatePresence,{mode:"wait",children:r||s?e.jsxs(A,{children:[e.jsx(hs,{}),e.jsx(N.AnimatePresence,{mode:"wait",children:s&&e.jsx(A,{children:e.jsx(st,{})},"new-conv-or-back-to-convs-button")})]},"csat"):e.jsxs(A,{children:[e.jsxs("div",{className:"ps-2 flex items-center gap-1 pb-2",children:[e.jsx(g.CircleCheckIcon,{className:"size-4 text-emerald-600"}),e.jsx("h2",{className:"text-sm font-medium",children:t("your_issue_has_been_resolved")})]}),e.jsx(st,{})]},"session-closed")})})})}function fs(){var i;const{initialQuestions:t,initialQuestionsPosition:r,thisWasHelpfulOrNot:s}=l.useConfig(),{sessionState:o}=l.useSessions(),{messagesState:n}=l.useMessages(),a=n.messages.length===0;return e.jsx("footer",{children:e.jsx(N.AnimatePresence,{mode:"wait",children:o.session&&!((i=o.session)!=null&&i.isOpened)?e.jsxs(A,{children:[e.jsx(ws,{}),e.jsx(tt,{})]},"session-closed"):e.jsxs(A,{children:[n.lastAIResMightSolveUserIssue&&(s==null?void 0:s.enabled)!==!1&&e.jsx(ms,{}),a&&t&&r!=="below-initial-messages"&&e.jsx("div",{className:"flex items-center flex-row justify-end gap-2 flex-wrap px-2",children:t==null?void 0:t.map((c,d)=>e.jsx(ve,{suggestion:c},`${c}-${d}`))}),e.jsx(gs,{}),e.jsx(tt,{})]},"chat-input")})})}function xs({isFirstInGroup:t,isLastInGroup:r,isAloneInGroup:s,...o}){const{componentStore:n}=l.useWidget();if(o.type!=="AGENT"&&o.type!=="AI")return null;if(o.data.action){const i=n.getComponent(o.data.action.name);if(i)return e.jsx(i,{...o,id:o.id,isFirstInGroup:t,isLastInGroup:r,isAloneInGroup:s})}const a=n.getComponent(o.component);return a?e.jsx(a,{...o,id:o.id,isFirstInGroup:t,isLastInGroup:r,isAloneInGroup:s}):e.jsx(ie,{...o,isFirstInGroup:t,isLastInGroup:r,isAloneInGroup:s})}function kt({messages:t,className:r,containerClassName:s}){var i,c;const{timestamps:o}=l.useConfig();if(!((i=o==null?void 0:o.perMessageGroup)!=null&&i.enabled))return null;const n=(c=t[t.length-1])==null?void 0:c.timestamp;if(!n)return null;const a=(()=>{try{return new Date(n).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!0})}catch(d){return console.error(d),null}})();return a?e.jsx("div",{className:s,children:e.jsx("span",{className:m("text-xs text-muted-foreground",r),children:a})}):null}function ee({messages:t,agent:r,suggestedReplies:s}){return e.jsxs("div",{...f("chat/agent_msg_group/root"),className:m("flex items-end gap-2"),children:[e.jsx(X,{content:r==null?void 0:r.name,side:"right",align:"end",children:e.jsx(le,{...f("chat/agent_msg_group/root/avatar"),agent:r,className:"hidden"})}),e.jsxs("div",{className:m("flex-1 flex flex-col gap-1"),children:[e.jsxs("div",{...f("chat/agent_msg_group/avatar_and_msgs/root"),className:m("flex items-end gap-2"),children:[e.jsx(X,{content:r==null?void 0:r.name,side:"right",align:"end",children:e.jsx(le,{...f("chat/agent_msg_group/avatar_and_msgs/avatar"),agent:r})}),e.jsxs("div",{...f("chat/agent_msg_group/avatar_and_msgs/msgs"),className:m("flex-1 flex flex-col gap-1"),children:[t.map((o,n,a)=>e.jsx(xs,{isFirstInGroup:n===0,isLastInGroup:n===a.length-1,isAloneInGroup:a.length===1,...o},o.id)),e.jsx(kt,{messages:t})]})]}),s&&s.length>0&&e.jsx("div",{...f("chat/agent_msg_group/suggestions"),className:m("flex flex-col gap-1 ps-8"),children:s==null?void 0:s.map((o,n)=>e.jsx(ve,{suggestion:o},`${o}-${n}`))})]})]})}function vs(){var s,o;const t=U();if((s=t.session)!=null&&s.isOpened||!t.session)return null;const r=(o=t.config.customComponents)==null?void 0:o.onSessionResolved;return r?e.jsx(r,{...t}):null}function bs({message:t,isFirstInGroup:r,isLastInGroup:s,isAloneInGroup:o}){var n;return e.jsxs("div",{...f("chat/user_msg/root"),className:"w-5/6 flex flex-col items-end gap-1",children:[t.attachments&&t.attachments.length>0&&e.jsx("div",{className:"w-full flex gap-1 flex-wrap justify-end",children:(n=t.attachments)==null?void 0:n.map(a=>e.jsx(ut,{attachment:a},a.id))}),t.content.length>0&&e.jsx("div",{...f("chat/user_msg/msg"),"data-first":r,"data-last":s,"data-alone":o,className:m("transition-all","w-fit py-3 px-4 rounded-3xl text-sm","bg-primary text-primary-foreground","break-words [word-break:break-word]","whitespace-pre-wrap",r&&!o&&"rounded-br-md",s&&!o&&"rounded-tr-md",!r&&!s&&!o&&"rounded-r-md"),children:t.content})]})}function ys({messages:t}){return e.jsxs("div",{...f("chat/user_msg_group/root"),className:m("group","flex flex-col gap-1 justify-end items-end"),children:[t.map((r,s,o)=>e.jsx(bs,{message:r,isFirstInGroup:s===0,isLastInGroup:s===o.length-1,isAloneInGroup:o.length===1},r.id)),e.jsx(kt,{messages:t,containerClassName:"ms-auto"})]})}function js(t){const r=[];let s=null;return t.forEach(o=>{var n,a,i,c,d,p;(((n=s==null?void 0:s[0])==null?void 0:n.type)!==o.type||((a=s[0])==null?void 0:a.type)==="AGENT"&&o.type==="AGENT"&&(((i=o.agent)==null?void 0:i.id)!==((c=s[0].agent)==null?void 0:c.id)||((d=o.agent)==null?void 0:d.name)!==((p=s[0].agent)==null?void 0:p.name)))&&(s=[],r.push(s)),s.push(o)}),r}function ks(t){var r;return((r=t==null?void 0:t[0])==null?void 0:r.type)==="USER"}function Cs(t){var r;return((r=t==null?void 0:t[0])==null?void 0:r.type)==="AI"}function zs(t){var r;return((r=t==null?void 0:t[0])==null?void 0:r.type)==="AGENT"}function Ss(){const{messagesState:{messages:t}}=l.useMessages(),{advancedInitialMessages:r=[],initialQuestionsPosition:s,initialQuestions:o,bot:n}=l.useConfig();return e.jsx(e.Fragment,{children:t.length===0&&r.length>0&&e.jsx(ee,{messages:r.map(({message:a},i)=>({component:"bot_message",data:{message:a},id:`${i}-${a}`,type:"AI",timestamp:null})),suggestedReplies:t.length===0&&s==="below-initial-messages"?o:void 0,agent:n?{...n,isAi:!0,id:null}:void 0})})}function Ns(){const{messagesState:{messages:t}}=l.useMessages(),{chatBannerItems:r}=l.useConfig();return!(r!=null&&r.length)||t.length>0&&r.every(s=>!s.persistent)?null:e.jsx("div",{className:"w-full text-center text-xs",children:r.map(({message:s,persistent:o},n)=>t.length>0&&!o?null:e.jsx("div",{children:e.jsx(me,{children:s})},`${s}-${n}`))})}function _s(){const{messagesState:{messages:t}}=l.useMessages(),r=l.useConfig(),{advancedInitialMessages:s=[],initialQuestions:o,initialQuestionsPosition:n}=r,a=(()=>{var i;return s.length?[]:t.length?[]:(i=r.initialMessages)!=null&&i.length?r.initialMessages:["Hello, how can I help you?"]})();return e.jsx(e.Fragment,{children:t.length===0&&a.length>0&&e.jsx(ee,{messages:a.map((i,c)=>({component:"bot_message",data:{message:i},id:`${c}-${i}`,type:"AI",timestamp:null})),suggestedReplies:n==="below-initial-messages"?o:void 0,agent:r.bot?{...r.bot,isAi:!0,id:null}:void 0})})}function Is(){var s;const t=U(),r=(s=t.config.customComponents)==null?void 0:s.chatBottomComponents;return r?e.jsx("div",{children:r.map(({key:o,component:n})=>e.jsx(n,{...t},o))}):null}function Ms(){const{messagesState:{messages:t}}=l.useMessages(),{isAwaitingBotReply:r}=l.useIsAwaitingBotReply(),{componentStore:s}=l.useWidget(),{bot:o,humanAgent:n}=l.useConfig(),a=h.useMemo(()=>js(t),[t]),i=s.getComponent("loading"),c=h.useRef(null);function d(){setTimeout(()=>{const p=c.current;p&&(p.scrollTop=p.scrollHeight)},0)}return h.useEffect(()=>{d()},[t]),e.jsxs("div",{...f("chat/msgs/root"),ref:c,className:"max-h-full scroll-smooth relative flex-1 py-2 px-4 flex flex-col gap-2 overflow-auto",children:[e.jsx(Ns,{}),e.jsx(Ss,{}),e.jsx(_s,{}),a.map((p,j)=>{var z,v,S,T;const b=(z=p==null?void 0:p[0])==null?void 0:z.type,u=(v=p[0])==null?void 0:v.id;if(!b||!u)return null;if(ks(p))return e.jsx(ys,{messages:p},u);if(Cs(p)){const y=j===a.length-1;return r&&y?null:((S=p[0])==null||S.agent,e.jsx(ee,{messages:p,agent:o?{...o,isAi:!0,id:null}:void 0},u))}if(zs(p)){const y=(T=p[0])==null?void 0:T.agent;return e.jsx(ee,{messages:p,agent:y?{...y,name:(n==null?void 0:n.name)||y.name||"",avatarUrl:(n==null?void 0:n.avatarUrl)||y.avatarUrl||null}:n?{isAi:!1,id:null,name:n.name||"",avatarUrl:n.avatarUrl||null}:void 0},u)}return null}),r&&i&&e.jsx(i,{agent:o}),e.jsx(Is,{}),e.jsx(vs,{})]})}function Ts(){const{messagesState:{isInitialFetchLoading:t}}=l.useMessages(),{sessionState:{session:r}}=l.useSessions(),{isCanvasOpen:s}=cs(),{theme:o}=q();fe({width:s?o.screens.chat.withCanvas.width:o.screens.chat.width,height:s?o.screens.chat.withCanvas.height:o.screens.chat.height});const n=h.useRef((r==null?void 0:r.id)||"chat").current;return e.jsx("div",{...f("chat/root"),className:m("flex flex-col overflow-hidden"),style:{width:"100vw",maxWidth:"100vw",height:"100vh",maxHeight:"100vh"},children:e.jsxs("div",{className:"size-full justify-between flex flex-col",children:[e.jsx(yt,{}),e.jsx(N.AnimatePresence,{mode:"wait",children:t?e.jsx(C,{className:"flex flex-col items-center justify-center w-full flex-1",children:e.jsx(jt,{})},"loading"):e.jsxs(C,{className:"flex items-start h-full flex-1 overflow-auto",snapExit:!0,children:[e.jsxs("div",{...f("chat/main/root"),className:m("flex flex-col h-full overflow-auto transition-all",s?"w-2/5":"w-full"),style:{transitionTimingFunction:o.screens.chat.withCanvas.transitionTimingFunction,transitionDuration:o.screens.chat.withCanvas.transitionDuration},children:[e.jsx(Ms,{}),e.jsx(fs,{})]}),e.jsx("div",{...f("chat/canvas/root"),className:m("h-full overflow-auto transition-all",s?"w-3/5":"w-0"),style:{transitionTimingFunction:o.screens.chat.withCanvas.transitionTimingFunction,transitionDuration:o.screens.chat.withCanvas.transitionDuration},children:e.jsx(ds,{})})]},n)})]})})}function Rs({className:t,...r}){return e.jsx("div",{className:m("animate-pulse rounded-md bg-secondary",t),...r})}function Ds({className:t}){return e.jsx("svg",{width:"26",height:"32",viewBox:"0 0 26 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:m("text-primary-foreground",t),children:e.jsx("path",{d:"M1.34103 25.6132H5.44245C5.74203 25.6228 6.02673 25.7462 6.23867 25.9582C6.45062 26.1703 6.5739 26.4551 6.58348 26.7548V30.8584C6.59305 31.1581 6.71634 31.443 6.92828 31.655C7.14023 31.8671 7.42492 31.9904 7.7245 32H18.2894C18.589 31.9904 18.8737 31.8671 19.0856 31.655C19.2976 31.443 19.4209 31.1581 19.4304 30.8584V26.7548C19.4401 26.4545 19.5638 26.1692 19.7765 25.957C19.9892 25.7449 20.2748 25.6219 20.5749 25.6132H24.659C24.9586 25.6036 25.2433 25.4803 25.4552 25.2682C25.6671 25.0562 25.7904 24.7713 25.8 24.4716V7.52839C25.7904 7.22865 25.6671 6.94381 25.4552 6.73176C25.2433 6.5197 24.9586 6.39635 24.659 6.38677H20.561C20.2603 6.37802 19.9742 6.25457 19.7614 6.04169C19.5487 5.82881 19.4253 5.54261 19.4165 5.24168V1.14161C19.4072 0.84419 19.2858 0.561291 19.0768 0.349589C18.8678 0.137887 18.5865 0.0130193 18.2894 0L7.7245 0C7.42492 0.00957792 7.14023 0.132929 6.92828 0.344983C6.71634 0.557036 6.59305 0.841878 6.58348 1.14161V5.24168C6.57477 5.54203 6.45187 5.82773 6.23983 6.04052C6.0278 6.25331 5.74262 6.37715 5.44245 6.38677H1.34103C1.04144 6.39635 0.756749 6.5197 0.544805 6.73176C0.332861 6.94381 0.209574 7.22865 0.200001 7.52839V24.4716C0.209574 24.7713 0.332861 25.0562 0.544805 25.2682C0.756749 25.4803 1.04144 25.6036 1.34103 25.6132ZM6.58348 24.4716V7.52839C6.59305 7.22865 6.71634 6.94381 6.92828 6.73176C7.14023 6.5197 7.42492 6.39635 7.7245 6.38677H18.2894C18.589 6.39635 18.8737 6.5197 19.0856 6.73176C19.2976 6.94381 19.4209 7.22865 19.4304 7.52839V24.4716C19.4209 24.7713 19.2976 25.0562 19.0856 25.2682C18.8737 25.4803 18.589 25.6036 18.2894 25.6132H7.7245C7.42492 25.6036 7.14023 25.4803 6.92828 25.2682C6.71634 25.0562 6.59305 24.7713 6.58348 24.4716Z",fill:"currentColor"})})}function Ct({className:t}){const{token:r}=l.useConfig();return e.jsx("div",{className:m("flex items-center justify-center gap-2 p-2 pt-0",t),children:e.jsx(H,{children:e.jsxs("a",{href:`https://open.cx/?ref=${r}`,target:"_blank",rel:"noreferrer",className:m("text-[10px] flex items-center","text-muted-foreground/70 [&_svg]:text-muted-foreground/70","hover:text-primary [&_svg]:hover:text-primary"),children:[e.jsx("span",{children:"Powered by"}),e.jsx("span",{children:" "}),e.jsxs("span",{className:"flex items-center gap-[1px]",children:[e.jsx("span",{children:e.jsx(Ds,{className:"size-3 inline-block"})}),e.jsx("span",{className:"font-semibold",children:"open"})]})]})})})}function Ps({children:t}){return e.jsx("p",{className:"ps-4 text-xs text-muted-foreground/75 uppercase font-semibold tracking-tight",children:t})}function rt({session:t,className:r}){const{bot:s,humanAgent:o}=l.useConfig(),{toChatScreen:n}=l.useWidgetRouter(),a=t.assignee.kind==="human"?(o==null?void 0:o.name)||t.assignee.name||"Support Agent":(s==null?void 0:s.name)||"AI Support Agent",i=t.assignee.kind==="human"?(o==null?void 0:o.avatarUrl)||t.assignee.avatarUrl||"":(s==null?void 0:s.avatarUrl)||(s==null?void 0:s.avatar)||"";return e.jsxs(_,{variant:"ghost",size:"lg",className:m("rounded-full p-2 pe-4 flex text-start justify-between w-full whitespace-normal",r),onClick:()=>n(t.id),children:[e.jsxs("div",{className:"flex-1 flex gap-2 items-center",children:[e.jsx(N.AnimatePresence,{mode:"wait",children:e.jsx(C,{snapExit:!0,children:e.jsxs(ue,{className:"size-10",children:[e.jsx(ge,{src:i,alt:"Agent Icon"}),e.jsx(we,{children:e.jsx(g.UserRoundIcon,{className:"size-4"})})]})})}),e.jsxs("div",{className:"flex-1",children:[e.jsx(N.AnimatePresence,{mode:"wait",children:e.jsx(C,{snapExit:!0,children:a},a)}),e.jsx(N.AnimatePresence,{mode:"wait",children:t.lastMessage?e.jsx(C,{snapExit:!0,children:e.jsx(gt,{remarkPlugins:[ot],rehypePlugins:[nt],className:"line-clamp-1 overflow-hidden text-ellipsis text-xs text-muted-foreground",children:t.lastMessage})},t.lastMessage||"content"):e.jsx(C,{className:"w-1/2",snapExit:!0,children:e.jsx(Rs,{className:"h-4 w-full"})},"skeleton")})]})]}),e.jsx(g.ChevronRightIcon,{className:"size-4 text-muted-foreground shrink-0 rtl:-scale-100"})]})}function Es(){const{t}=L(),{toChatScreen:r}=l.useWidgetRouter(),{sessionsState:{data:s,isInitialFetchLoading:o},openSessions:n,closedSessions:a,canCreateNewSession:i}=l.useSessions();return e.jsx("div",{className:"flex-1 flex flex-col overflow-scroll py-2 px-2",children:e.jsx(N.AnimatePresence,{mode:"wait",children:o?e.jsx(C,{className:"flex-1 flex items-center justify-center",children:e.jsx(jt,{})},"loading"):e.jsx(C,{className:"flex-1 flex flex-col gap-2 relative",children:s.length?e.jsxs(e.Fragment,{children:[e.jsxs(N.AnimatePresence,{children:[n.length>0&&e.jsx(C,{fadeIn:"up",delay:.2,className:"space-y-2",snapExit:!0,children:n.map(c=>e.jsx(rt,{session:c},c.id))},"open-sessions"),a.length>0&&e.jsxs(C,{className:"space-y-2",delay:.2,snapExit:!0,children:[e.jsx(Ps,{children:t("closed_conversations")}),a.map(c=>e.jsx(rt,{session:c,className:"opacity-50 hover:opacity-100"},c.id))]},"closed-sessions")]}),i&&e.jsx("div",{className:"mt-auto w-full rounded-3xl sticky bottom-0 outline outline-8 outline-background bg-background",children:h.createElement(_,{...f("sessions/new_conversation_btn"),size:"lg",key:"new-session",className:"w-full",onClick:()=>r()},t("new_conversation"))})]}):e.jsxs("div",{className:"flex-1 flex flex-col gap-2 items-center",children:[e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("p",{className:"text-muted-foreground",children:t("no_conversations_yet")})}),h.createElement(_,{...f("sessions/new_conversation_btn"),size:"lg",key:"new-session",className:"w-full",onClick:()=>r()},t("new_conversation"))]})},"sessions")})})}function As(){const{theme:t}=q();return fe({width:t.screens.sessions.width,height:t.screens.sessions.height}),e.jsx("div",{...f("sessions/root"),className:m("flex flex-col overflow-hidden bg-background"),style:{width:"100vw",maxWidth:"100vw",height:"100vh",maxHeight:"100vh"},children:e.jsxs("div",{className:"size-full flex flex-col",children:[e.jsx(yt,{}),e.jsx(Es,{}),e.jsx(Ct,{})]})})}const J=B.forwardRef(({className:t,type:r,...s},o)=>{const{isSmallScreen:n}=W();return e.jsx("input",{ref:o,type:r,className:m(n?"text-[16px]":"text-sm","flex w-full rounded-xl p-2 ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-primary-foreground placeholder:text-muted-foreground/75 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 transition","rounded-2xl px-4","border shadow-sm",t),...s})});J.displayName="Input";function Ws(){const{contentIframeRef:t}=l.useWidget(),{inline:r}=l.useConfig(),s=h.useRef(null);return h.useEffect(()=>{const o=t==null?void 0:t.current;if(o&&s.current){const n=s.current;let a;const i=new ResizeObserver(()=>{a=requestAnimationFrame(()=>{const c=n.offsetHeight;o.style.setProperty("--opencx-widget-height",r?"100%":`${c.toFixed(1)}px`)})});return i.observe(n),()=>{cancelAnimationFrame(a),i.unobserve(n)}}},[t,r]),{observedElementRef:s}}const Os=ne.z.object({name:ne.z.string().min(2),email:ne.z.string().email()});function Fs(){var y,R,E,D,w,I,x,k;const{widgetCtx:{org:t}}=l.useWidget(),{setIsOpen:r}=l.useWidgetTrigger(),{createUnverifiedContact:s}=l.useContact(),{isSmallScreen:o}=W(),n=l.useConfig(),{theme:a}=q(),{t:i}=L(),{observedElementRef:c}=Ws();fe({height:void 0,width:a.screens.welcome.width});const[d,p]=h.useState(((y=n.prefillUserData)==null?void 0:y.name)||""),[j,b]=h.useState(((R=n.prefillUserData)==null?void 0:R.email)||""),u=(n.extraDataCollectionFields||[]).filter(M=>M!=="name"&&M!=="email"&&!!M),[z,v]=h.useState({}),[S,T]=Wt(async M=>{M.preventDefault();const O=Os.safeParse({name:d,email:j});O.success&&await s({email:O.data.email,non_verified_name:O.data.name},Object.values(z).filter(Boolean).length?z:void 0)},[d,j,z]);return e.jsx("div",{style:{width:"100vw",maxWidth:"100vw",minHeight:a.screens.welcome.minHeight,height:"100vh",maxHeight:"100vh",overflowY:"auto"},children:e.jsxs("div",{ref:c,className:m("flex flex-col",o&&"h-full","bg-[radial-gradient(ellipse_at_top_left,hsl(var(--opencx-primary)),transparent),radial-gradient(ellipse_at_top_right,hsl(var(--opencx-primary)),transparent)]"),children:[e.jsxs("div",{className:m("flex-1 flex flex-col px-4 py-12 text-start space-y-4 relative z-10","text-primary-foreground"),children:[o&&e.jsx(C,{className:"absolute top-6 end-6",children:e.jsx(_,{size:"selfless",onClick:()=>r(!1),children:e.jsx(g.XIcon,{className:"size-4"})})}),e.jsx("div",{className:"flex items-center justify-between w-full mb-2",children:(E=n.assets)!=null&&E.organizationLogo?e.jsx("img",{src:(D=n.assets)==null?void 0:D.organizationLogo,alt:"Company Logo",className:"h-8 w-auto object-contain"}):e.jsx("h2",{className:"font-bold text-sm",children:t.name})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-[1.75rem] font-semibold tracking-tight leading-none",children:((I=(w=n.textContent)==null?void 0:w.welcomeScreen)==null?void 0:I.title)||i("welcome_screen_title")}),e.jsx("p",{className:"text-sm",children:((k=(x=n.textContent)==null?void 0:x.welcomeScreen)==null?void 0:k.description)||i("welcome_screen_description")})]})]}),e.jsxs("div",{className:m("z-10 m-2 px-2 pt-2 bp-0 space-y-2","bg-[white]","border shadow","rounded-3xl"),children:[e.jsxs("form",{onSubmit:T,className:"space-y-2",children:[e.jsx(J,{value:d,onChange:M=>p(M.target.value),required:!0,placeholder:i("your_name_placeholder"),name:"name"}),e.jsx(J,{required:!0,value:j,onChange:M=>b(M.target.value),type:"email",placeholder:i("your_email_placeholder"),name:"email"}),u.map(M=>e.jsx(J,{value:z[M],onChange:O=>v(Z=>({...Z,[M]:O.target.value})),placeholder:`${M} (${i("optional")})`},M)),e.jsxs(_,{disabled:S.loading,className:"w-full",size:"lg",children:[S.loading?i("start_chat_button_loading"):i("start_chat_button"),e.jsx(g.SendHorizontal,{className:"size-4 rtl:-scale-100"})]})]}),e.jsx(Ct,{})]})]})})}function zt(){const{routerState:{screen:t}}=l.useWidgetRouter();return e.jsx("div",{className:"relative bg-background size-full",children:e.jsx(N.AnimatePresence,{mode:"wait",children:(()=>{switch(t){case"welcome":return e.jsx(C,{fadeIn:"right",className:"size-full",snapExit:!0,children:e.jsx(Fs,{})},t);case"sessions":return e.jsx(C,{fadeIn:"right",className:"size-full",snapExit:!0,children:e.jsx(As,{})},t);case"chat":return e.jsx(C,{fadeIn:"right",className:"size-full",snapExit:!0,children:e.jsx(Ts,{})},t);default:return P.isExhaustive(t,zt.name),null}})()})})}const Hs="4.0.48",qs=`<!DOCTYPE html>
17
+ )`)};return{theme:p,computed:b,cssVars:ts({palette:p.palette,primary:p.primaryColor})}}function ts({palette:t,primary:r}){const s=xt(t),n=Ze(r).toHsl(),o=Ze(r).isLight()?s[950]:s[50];return{"--opencx-primary":`${n.h} ${n.s*100}% ${n.l*100}%`,"--opencx-primary-foreground":o,"--opencx-background":s[100],"--opencx-foreground":s[950],"--opencx-destructive":"0 72.2% 50.6%","--opencx-destructive-foreground":s[50],"--opencx-accent":s[200],"--opencx-accent-foreground":"var(--opencx-foreground)","--opencx-secondary":s[200],"--opencx-secondary-foreground":"var(--opencx-foreground)","--opencx-muted":s[200],"--opencx-muted-foreground":s[500],"--opencx-input":s[300],"--opencx-border":s[300],"--opencx-ring":"var(--opencx-foreground)"}}function xt(t){const r={50:"0 0% 98%",100:"0 0% 96.1%",200:"0 0% 89.8%",300:"0 0% 83.1%",400:"0 0% 63.9%",500:"0 0% 45.1%",600:"0 0% 32.2%",700:"0 0% 25.1%",800:"0 0% 14.9%",900:"0 0% 9%",950:"0 0% 3.9%"},s={50:"60 9.1% 97.8%",100:"60 4.8% 95.9%",200:"20 5.9% 90%",300:"24 5.7% 82.9%",400:"24 5.4% 63.9%",500:"25 5.3% 44.7%",600:"33.3 5.5% 32.4%",700:"30 6.3% 25.1%",800:"12 6.5% 15.1%",900:"24 9.8% 10%",950:"20 14.3% 4.1%"},n={50:"0 0% 98%",100:"240 4.8% 95.9%",200:"240 5.9% 90%",300:"240 4.9% 83.9%",400:"240 5% 64.9%",500:"240 3.8% 46.1%",600:"240 5.2% 33.9%",700:"240 5.3% 26.1%",800:"240 3.7% 15.9%",900:"240 5.9% 10%",950:"240 10% 3.9%"},o={50:"210 40% 98%",100:"210 40% 96.1%",200:"214.3 31.8% 91.4%",300:"212.7 26.8% 83.9%",400:"215 20.2% 65.1%",500:"215.4 16.3% 46.9%",600:"215.3 19.3% 34.5%",700:"215.3 25% 26.7%",800:"217.2 32.6% 17.5%",900:"222.2 47.4% 11.2%",950:"222.2 84% 4.9%"};switch(t){case"neutral":return r;case"stone":return s;case"zinc":return n;case"slate":return o;default:return A.isExhaustive(t,xt.name),r}}function vt(){const{contentIframeRef:t}=l.useWidget(),{inline:r}=l.useConfig();return{setWidth:s=>{var n;(n=t==null?void 0:t.current)==null||n.style.setProperty("--opencx-widget-width",r?"100%":s)},setHeight:s=>{var n;(n=t==null?void 0:t.current)==null||n.style.setProperty("--opencx-widget-height",r?"100%":s)}}}function fe({width:t,height:r}){const{isSmallScreen:s}=O(),{setWidth:n,setHeight:o}=vt();m.useEffect(()=>{t&&n(t),r&&o(r)},[s,r,t,n,o])}const et=g.CircleDashedIcon;function V({name:t,className:r}){const s=(()=>{switch(t){case"Check":return g.CheckIcon;case"CheckCheck":return g.CheckCheckIcon;case"CircleCheck":return g.CircleCheckIcon;case"CircleCheckBig":return g.CircleCheckBigIcon;case"CircleX":return g.CircleXIcon;case"Expand":return g.ExpandIcon;case"Maximize":return g.MaximizeIcon;case"Maximize2":return g.Maximize2Icon;case"Minimize":return g.MinimizeIcon;case"Minimize2":return g.Minimize2Icon;case"Shrink":return g.ShrinkIcon;case"SquareCheck":return g.SquareCheckIcon;case"SquareCheckBig":return g.SquareCheckBigIcon;case"SquareX":return g.SquareXIcon;case"X":return g.XIcon;case void 0:return et;default:return A.isExhaustive(t,V.name),et}})();return e.jsx(s,{className:h("size-4",r)})}function ss(){var s;const t=U(),r=(s=t.config.customComponents)==null?void 0:s.headerBottom;return r?e.jsx(r,{...t}):null}function rs({fallback:t}){var n;const r=U(),s=(n=r.config.customComponents)==null?void 0:n.headerTitle;return s?e.jsx(s,{...r}):t}function xe(){const{widgetCtx:{org:t}}=l.useWidget(),{routerState:{screen:r}}=l.useWidgetRouter(),{textContent:s}=l.useConfig();return(()=>{var o,a;switch(r){case"chat":return(o=s==null?void 0:s.chatScreen)==null?void 0:o.headerTitle;case"sessions":return(a=s==null?void 0:s.sessionsScreen)==null?void 0:a.headerTitle;case"welcome":return;default:A.isExhaustive(r,xe.name);return}})()??t.name??"Chat"}function ns(t){switch(t){case"chat":return x("chat/header");case"sessions":return x("sessions/header");case"welcome":return;default:A.isExhaustive(t,xe.name);return}}function os(){const{router:t}=l.useConfig(),{routerState:{screen:r},toSessionsScreen:s}=l.useWidgetRouter();return r!=="chat"||t!=null&&t.chatScreenOnly?null:e.jsx(N,{variant:"ghost",size:"fit",className:"rounded-full",onClick:s,children:e.jsx(g.ChevronLeftIcon,{className:"size-4 rtl:-scale-100"})})}function as({button:t}){const{setIsOpen:r}=l.useWidgetTrigger(),{isSmallScreen:s}=O();if(s&&t.hideOnSmallScreen||!s&&t.hideOnLargeScreen)return null;const n=()=>{if(t.handleClick)return t.handleClick();r(!1)};return e.jsx(N,{variant:"ghost",size:"fit",className:"rounded-full",onClick:n,children:e.jsx(V,{name:t.icon})})}function ce({button:t}){const[r,s]=m.useState(!1),{routerState:{screen:n}}=l.useWidgetRouter(),{isSmallScreen:o}=O(),{theme:a}=q(),{setWidth:i,setHeight:c}=vt();if(n!=="chat"&&n!=="sessions")return null;const d=(()=>{switch(n){case"chat":return a.screens.chat.height;case"sessions":return a.screens.sessions.height;default:return A.isExhaustive(n,ce.name),a.screens.chat.height}})(),p=(()=>{switch(n){case"chat":return a.screens.chat.width;case"sessions":return a.screens.sessions.width;default:return A.isExhaustive(n,ce.name),a.screens.chat.width}})(),b=()=>{s(k=>{const u=!k;return c(u?"100vh":d),i(u?`max(40vw, ${p})`:p),u})};return o&&t.hideOnSmallScreen||!o&&t.hideOnLargeScreen?null:e.jsx(N,{variant:"ghost",size:"fit",className:"rounded-full",onClick:b,children:e.jsx(V,{name:t.icon||(r?t.shrinkIcon:t.expandIcon)})})}function bt({button:t}){var S,I;const{close:r}=re(),{widgetCtx:s}=l.useWidget(),{setIsOpen:n}=l.useWidgetTrigger(),{resolveSession:o,sessionState:a}=l.useSessions(),{isSmallScreen:i}=O(),c=!a.session,d=((S=a.session)==null?void 0:S.isOpened)===!1,p=t.onResolved||"stay-in-chat",b=t.behaviorBeforeSessionCreation||"disabled",k=t.behaviorIfSessionIsResolved||"disabled",u=!!(a.isResolvingSession||c&&b==="disabled"||d&&k==="disabled"),C=async()=>{const{success:v,error:R}=await o();if(r(),!v)return console.error(R);switch(p){case"stay-in-chat":return;case"close-widget":n(!1);break;case"reset-chat":s.resetChat();break;case"reset-chat-and-close-widget":n(!1),s.resetChat();break;default:A.isExhaustive(p,bt.name);break}},y=()=>{if(c)switch(b){case"disabled":return;case"close-widget":n(!1);break;default:A.isExhaustive(b,y.name)}if(d)switch(k){case"disabled":return;case"close-widget":n(!1);break;case"reset-chat":s.resetChat();break;case"reset-chat-and-close-widget":n(!1),setTimeout(()=>{s.resetChat()},200);break;default:A.isExhaustive(k,y.name)}};return i&&t.hideOnSmallScreen||!i&&t.hideOnLargeScreen?null:((I=t.confirmation)==null?void 0:I.type)==="modal"&&!d&&!c?e.jsx(he,{trigger:e.jsx(N,{variant:"ghost",size:"fit",className:"rounded-full",disabled:u,children:e.jsx(V,{name:t.icon})}),children:e.jsxs(pe,{children:[e.jsx(lt,{children:e.jsx(pt,{children:t.confirmation.title||"Close conversation"})}),e.jsx(ct,{children:e.jsx(ht,{children:t.confirmation.description||"Are you sure you want to close this conversation?"})}),e.jsxs(dt,{children:[e.jsx(N,{variant:"secondary",onClick:r,disabled:a.isResolvingSession,children:t.confirmation.cancelButtonText||"No"}),e.jsx(N,{variant:"destructive",onClick:C,disabled:a.isResolvingSession,children:t.confirmation.confirmButtonText||"Yes"})]})]})}):e.jsx(N,{variant:"ghost",size:"fit",className:"rounded-full",onClick:d||c?y:C,disabled:u,children:e.jsx(V,{name:t.icon})})}function de({button:t}){switch(t.functionality){case"close-widget":return e.jsx(as,{button:t});case"expand-shrink":return e.jsx(ce,{button:t});case"resolve-session":return e.jsx(bt,{button:t});default:return A.isExhaustive(t,de.name),null}}const is={functionality:"close-widget",hideOnLargeScreen:!0,icon:"X"};function ls(){const{routerState:{screen:t}}=l.useWidgetRouter(),{headerButtons:r}=l.useConfig(),s=t==="chat"?r==null?void 0:r.chatScreen:t==="sessions"?r==null?void 0:r.sessionsScreen:[];return!s||s.length===0?e.jsx(de,{button:is}):e.jsx(e.Fragment,{children:s.map(n=>e.jsx(de,{button:n},`${n.functionality}-${n.icon}`))})}function yt(){const{routerState:{screen:t}}=l.useWidgetRouter(),r=ns(t),s=xe();return e.jsxs("header",{...r,className:"py-2 px-4 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(os,{}),e.jsx("div",{className:h("flex-1 h-8 flex items-center",t==="sessions"&&"ps-2"),children:e.jsx(rs,{fallback:e.jsx("h2",{className:"font-semibold",children:s})})}),e.jsx(ls,{})]}),e.jsx(ss,{})]})}function jt({className:t}){return e.jsx(g.LoaderIcon,{className:h("size-4 animate-spin",t)})}function cs(){const{messagesState:{isInitialFetchLoading:t}}=l.useMessages(),{isSmallScreen:r}=O(),{activeMode:s,Component:n}=l.useModes();return{isCanvasOpen:!t&&!r&&!!s&&!!n}}function ds(){const t=U(),{activeMode:r,Component:s}=l.useModes(),{sendMessage:n}=l.useMessages(),{createStateCheckpoint:o}=l.useSessions(),[a,i]=m.useState(!1),c=async d=>{try{i(!0),await n(d)}catch(p){console.error(p)}finally{i(!1)}};return!r||!s?null:e.jsx(s,{...t,mode:r,createStateCheckpoint:o,sendMessage:c,isSendingMessage:a})}const W=m.forwardRef((t,r)=>{var s,n,o;return e.jsx(j,{...t,ref:r,className:h("overflow-hidden",t.className),overrides:{initial:{height:0,opacity:0,...(s=t.overrides)==null?void 0:s.initial},animate:{height:"auto",opacity:1,...(n=t.overrides)==null?void 0:n.animate},exit:{height:0,opacity:0,...(o=t.overrides)==null?void 0:o.exit}}})});W.displayName="MotionDiv__VerticalReveal";const ps=[{label:"Terrible",value:1,emoji:"😡"},{label:"Poor",value:2,emoji:"😞"},{label:"Okay",value:3,emoji:"😐"},{label:"Good",value:4,emoji:"😊"},{label:"Great",value:5,emoji:"😍"}];function hs(){const{isSmallScreen:t}=O(),{submitCsat:r,isCsatRequested:s,isCsatSubmitted:n,submittedScore:o,submittedFeedback:a}=l.useCsat(),[i,c]=m.useState(null),[d,p]=m.useState(null),b=u=>{c(C=>C===u?null:u)},k=()=>{i&&r({score:i,feedback:d||void 0})};return!s&&!n?null:e.jsxs("div",{className:"w-1/2 min-w-80 max-w-96 mx-auto overflow-hidden",children:[e.jsx(z.AnimatePresence,{mode:"wait",children:s&&!i?e.jsx(W,{children:e.jsx("p",{className:"text-sm text-muted-foreground text-center pt-2",children:"How was your conversation?"})},"csat-requested-title"):n?e.jsx(W,{children:e.jsx("p",{className:"text-sm text-muted-foreground text-center pt-2",children:"You rated the conversation as"})},"csat-submitted-title"):null}),e.jsx("div",{className:h("flex gap-4 justify-between pt-2 px-2 pb-2","transition-all",n&&"gap-0 justify-center"),children:ps.map(u=>e.jsx(N,{variant:u.value===i?"secondary":"ghost",size:"selfless",className:h("transition-all overflow-hidden","text-2xl size-8 rounded-full","opacity-35","hover:opacity-100",!i&&"opacity-100",u.value===i&&"opacity-100",n&&u.value!==o&&"opacity-0 size-0",n&&u.value===o&&"opacity-100 size-fit text-4xl"),onClick:s?()=>b(u.value):void 0,children:u.emoji},u.value))}),e.jsx(z.AnimatePresence,{mode:"wait",children:(i||o)&&e.jsx(W,{children:e.jsxs("div",{className:"pb-2 px-2 flex items-end",children:[e.jsx("textarea",{rows:3,className:h("transition-all","max-h-40 [field-sizing:content]","w-full resize-none","bg-transparent outline-none","placeholder:text-muted-foreground",t?"text-[16px]":"text-sm",n&&"text-center"),value:n?a||"":d||"",onChange:s?u=>p(u.target.value):void 0,readOnly:n,placeholder:s?"Tell us more... (optional)":void 0}),e.jsx(N,{size:"fit",onClick:k,disabled:!i,className:h("transition-all overflow-hidden","rounded-full size-8 flex items-center justify-center p-0",n&&"opacity-0 size-0"),children:e.jsx(g.ArrowUpIcon,{className:"size-4"})})]})},"feedback-box")}),e.jsx("div",{className:h("h-0 transition-[height]",n&&"h-4")})]})}function L(){const{dir:t}=l.useDocumentDir(),r=l.useConfig();return m.useMemo(()=>{const s=A.isSupportedLanguage(r.language)?r.language:"en";return{t:n=>A.getTranslation(n,s,r.translationOverrides),language:s,dir:s==="ar"?"rtl":"ltr",hostDocumentDir:t}},[r.language,t])}function ve({suggestion:t,className:r,...s}){const{sendMessage:n}=l.useMessages(),o=()=>{const a=t.trim();a&&n({content:a})};return e.jsx(N,{...x("chat/suggested_reply_btn"),size:"sm",className:h("rounded-xl w-fit",r),...s,onClick:o,children:t})}function ms(){const{t}=L(),r=[t("i_need_more_help"),t("this_was_helpful")];return e.jsx("div",{...x("chat/might_solve_user_issue_suggested_replies_container"),className:"flex items-center gap-2 p-2 pb-0 flex-wrap",children:r.map(s=>e.jsx(ve,{suggestion:s,className:"flex-1"},s))})}function tt(){const{sessionState:t}=l.useSessions(),{chatFooterItems:r}=l.useConfig(),s=!!t.session&&!t.session.isOpened,n=!s;return e.jsx(z.AnimatePresence,{mode:"wait",children:r==null?void 0:r.map((o,a)=>o.showWhenSessionIsOpen===!1&&n||o.showWhenSessionIsResolved===!1&&s?null:e.jsx(W,{children:e.jsx("div",{className:"pb-2 text-center text-xs",children:e.jsx(me,{children:o.message})})},`${o.message}-${a}`))})}function us({file:{status:t,file:r,error:s},onCancel:n}){const[o,a]=m.useState(null);m.useEffect(()=>{if(!r.type.startsWith("image/"))return;const d=new FileReader;return d.onload=()=>a(d.result),d.onerror=()=>console.error("Error reading file"),d.readAsDataURL(r),()=>d.abort()},[r]);const i=()=>{switch(t){case"uploading":return e.jsx(g.Loader2,{className:"size-4 animate-spin"});case"error":return e.jsx(g.AlertCircle,{className:"size-4 text-destructive"});default:return null}},c=()=>{const d=r.type.split("/")[0];return d==="image"&&o?e.jsx("img",{src:typeof o=="string"?o:"",className:"object-cover bg-secondary size-full",alt:r.name}):d==="audio"?e.jsx(g.FileAudio2Icon,{className:"size-4 text-muted-foreground"}):d==="video"?e.jsx(g.FileVideo2Icon,{className:"size-4 text-muted-foreground"}):r.type==="application/pdf"?e.jsx(g.FileText,{className:"size-4 text-muted-foreground"}):e.jsx(g.FileIcon,{className:"size-4 text-muted-foreground"})};return e.jsx(X,{side:"bottom",content:t==="error"?e.jsxs("span",{className:"text-destructive",children:["Failed to upload: ",s]}):r.name,children:e.jsxs("div",{className:h(t==="uploading"&&"opacity-50","group","size-12 border rounded-2xl overflow-hidden relative","flex items-center justify-center shrink-0"),children:[e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:i()}),e.jsx("button",{type:"button",className:h("absolute bg-black/50 inset-0 size-full z-10 opacity-0","flex items-center justify-center","opacity-0 group-hover:opacity-100 transition"),onClick:n,children:e.jsx(g.XIcon,{className:"size-4 text-primary-foreground"})}),e.jsx(c,{})]})})}function gs(){var T;const{isSmallScreen:t}=O(),r=m.useRef(null),{sendMessage:s}=l.useMessages(),{sessionState:n}=l.useSessions(),{disableSendingWhenAwaitingAIReply:o}=l.useConfig(),{t:a}=L(),[i,c]=m.useState(""),{allFiles:d,emptyTheFiles:p,handleCancelUpload:b,appendFiles:k,isUploading:u,successFiles:C}=l.useUploadFiles(),y=!!((T=n.session)!=null&&T.isHandedOff),{isAwaitingBotReply:S}=l.useIsAwaitingBotReply(),I=o!==!1&&S,v=w=>{k(w)},R=!i.trim()&&C.length===0,P=async()=>{if(I||R)return;u&&console.info("please wait for the file(s) to upload");const w=i.trim();s({content:w,attachments:C.flatMap(_=>_.fileUrl?[{url:_.fileUrl,type:_.file.type,name:_.file.name,id:_.id,size:_.file.size}]:[])}),c(""),p()},{getRootProps:E,getInputProps:f,open:M}=At.useDropzone({onDrop:v,noClick:!0,onDropRejected(){console.error("unsupported file type, or the file is too large")},maxSize:5*1024*1024,accept:y?{"text/*":[".txt"],"image/*":[".png",".jpg",".jpeg",".gif"],"application/pdf":[".pdf"]}:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg"],"image/gif":[".gif"],"image/webp":[".webp"],"application/pdf":[".pdf"]}}),D=w=>{const _=w.clipboardData;_&&_.files.length>0&&v(Array.from(_.files))};return e.jsxs("div",{...x("chat/input_box/root"),className:"p-2 relative space-y-1",...E(),children:[e.jsx("input",{...f()}),e.jsxs("div",{...x("chat/input_box/inner_root"),className:h("transition-all","bg-white","relative rounded-3xl flex flex-col gap-2 p-2","hover:border-primary focus-within:border-primary"),children:[e.jsxs("div",{...x("chat/input_box/textarea_and_attachments_container"),className:"flex flex-col gap-2",children:[d.length>0&&e.jsx("div",{...x("chat/input_box/attachments_container"),className:"flex items-center gap-1",children:e.jsx(z.AnimatePresence,{mode:"popLayout",children:d.map(w=>e.jsx(j,{snapExit:!0,children:e.jsx(us,{onCancel:()=>b(w.id),file:w})},w.id))})}),e.jsx("textarea",{...x("chat/input_box/textarea"),onPaste:D,ref:r,id:"chat-input",value:i,rows:3,className:h("max-h-16 [field-sizing:content]","w-full resize-none px-2",d.length===0&&"pt-1","bg-transparent outline-none","placeholder:text-muted-foreground",t?"text-[16px]":"text-sm"),onChange:w=>c(w.target.value),onKeyDown:async w=>{w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),P())},placeholder:a("write_a_message_placeholder")})]}),e.jsxs("div",{className:"gap-2 flex justify-between",children:[e.jsx(X,{side:"top",align:"start",content:"attach images or PDF (maximum size 5mb)",children:e.jsx(N,{onClick:M,size:"fit",variant:"ghost",className:h("rounded-full size-8 flex items-center justify-center p-0 overflow-hidden"),children:e.jsx(z.AnimatePresence,{mode:"wait",children:I?e.jsx(j,{children:e.jsx(g.PaperclipIcon,{className:"size-4 opacity-50"})},"paper-clip-disabled"):e.jsx(j,{children:e.jsx(g.PaperclipIcon,{className:"size-4"})},"paper-clip")})})}),e.jsx(X,{content:"send message",side:"top",align:"end",children:e.jsx(N,{size:"fit",onClick:P,disabled:I||u||R,className:"rounded-full size-8 flex items-center justify-center p-0",children:e.jsx(z.AnimatePresence,{mode:"wait",children:I||u?e.jsx(j,{snapExit:!0,children:e.jsx(g.CircleDashed,{className:"size-4 animate-spin animate-iteration-infinite"})},"loading"):e.jsx(j,{snapExit:!0,children:e.jsx(g.ArrowUpIcon,{className:"size-4"})},"send")})})})]})]})]})}function st(){const{widgetCtx:t}=l.useWidget(),{router:r}=l.useConfig(),{canCreateNewSession:s}=l.useSessions(),{toSessionsScreen:n}=l.useWidgetRouter(),{t:o}=L();return e.jsx(e.Fragment,{children:s||r!=null&&r.chatScreenOnly?e.jsx(N,{onClick:t.resetChat,className:"rounded-2xl w-full",children:o("new_conversation")}):e.jsx(N,{onClick:n,className:"rounded-2xl w-full",children:o("back_to_conversations")})})}function ws(){const{t}=L(),{isCsatRequested:r,isCsatSubmitted:s}=l.useCsat();return e.jsx("div",{className:"p-2",children:e.jsx("div",{className:"p-2 bg-muted rounded-3xl",children:e.jsx(z.AnimatePresence,{mode:"wait",children:r||s?e.jsxs(W,{children:[e.jsx(hs,{}),e.jsx(z.AnimatePresence,{mode:"wait",children:s&&e.jsx(W,{children:e.jsx(st,{})},"new-conv-or-back-to-convs-button")})]},"csat"):e.jsxs(W,{children:[e.jsxs("div",{className:"ps-2 flex items-center gap-1 pb-2",children:[e.jsx(g.CircleCheckIcon,{className:"size-4 text-emerald-600"}),e.jsx("h2",{className:"text-sm font-medium",children:t("your_issue_has_been_resolved")})]}),e.jsx(st,{})]},"session-closed")})})})}function fs(){var i;const{initialQuestions:t,initialQuestionsPosition:r,thisWasHelpfulOrNot:s}=l.useConfig(),{sessionState:n}=l.useSessions(),{messagesState:o}=l.useMessages(),a=o.messages.length===0;return e.jsx("footer",{children:e.jsx(z.AnimatePresence,{mode:"wait",children:n.session&&!((i=n.session)!=null&&i.isOpened)?e.jsxs(W,{children:[e.jsx(ws,{}),e.jsx(tt,{})]},"session-closed"):e.jsxs(W,{children:[o.lastAIResMightSolveUserIssue&&(s==null?void 0:s.enabled)!==!1&&e.jsx(ms,{}),a&&t&&r!=="below-initial-messages"&&e.jsx("div",{className:"flex items-center flex-row justify-end gap-2 flex-wrap px-2",children:t==null?void 0:t.map((c,d)=>e.jsx(ve,{suggestion:c},`${c}-${d}`))}),e.jsx(gs,{}),e.jsx(tt,{})]},"chat-input")})})}function xs({isFirstInGroup:t,isLastInGroup:r,isAloneInGroup:s,...n}){const{componentStore:o}=l.useWidget();if(n.type!=="AGENT"&&n.type!=="AI")return null;if(n.data.action){const i=o.getComponent(n.data.action.name);if(i)return e.jsx(i,{...n,id:n.id,isFirstInGroup:t,isLastInGroup:r,isAloneInGroup:s})}const a=o.getComponent(n.component);return a?e.jsx(a,{...n,id:n.id,isFirstInGroup:t,isLastInGroup:r,isAloneInGroup:s}):e.jsx(ie,{...n,isFirstInGroup:t,isLastInGroup:r,isAloneInGroup:s})}function kt({messages:t,className:r,containerClassName:s}){var i,c;const{timestamps:n}=l.useConfig();if(!((i=n==null?void 0:n.perMessageGroup)!=null&&i.enabled))return null;const o=(c=t[t.length-1])==null?void 0:c.timestamp;if(!o)return null;const a=(()=>{try{return new Date(o).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!0})}catch(d){return console.error(d),null}})();return a?e.jsx("div",{className:s,children:e.jsx("span",{className:h("text-xs text-muted-foreground",r),children:a})}):null}function ee({messages:t,agent:r,suggestedReplies:s}){return e.jsxs("div",{...x("chat/agent_msg_group/root"),className:h("flex items-end gap-2"),children:[e.jsx(X,{content:r==null?void 0:r.name,side:"right",align:"end",children:e.jsx(le,{...x("chat/agent_msg_group/root/avatar"),agent:r,className:"hidden"})}),e.jsxs("div",{className:h("flex-1 flex flex-col gap-1"),children:[e.jsxs("div",{...x("chat/agent_msg_group/avatar_and_msgs/root"),className:h("flex items-end gap-2"),children:[e.jsx(X,{content:r==null?void 0:r.name,side:"right",align:"end",children:e.jsx(le,{...x("chat/agent_msg_group/avatar_and_msgs/avatar"),agent:r})}),e.jsxs("div",{...x("chat/agent_msg_group/avatar_and_msgs/msgs"),className:h("flex-1 flex flex-col gap-1"),children:[t.map((n,o,a)=>e.jsx(xs,{isFirstInGroup:o===0,isLastInGroup:o===a.length-1,isAloneInGroup:a.length===1,...n},n.id)),e.jsx(kt,{messages:t})]})]}),s&&s.length>0&&e.jsx("div",{...x("chat/agent_msg_group/suggestions"),className:h("flex flex-col gap-1 ps-8"),children:s==null?void 0:s.map((n,o)=>e.jsx(ve,{suggestion:n},`${n}-${o}`))})]})]})}function vs(){var s,n;const t=U();if((s=t.session)!=null&&s.isOpened||!t.session)return null;const r=(n=t.config.customComponents)==null?void 0:n.onSessionResolved;return r?e.jsx(r,{...t}):null}function bs({message:t,isFirstInGroup:r,isLastInGroup:s,isAloneInGroup:n}){var o;return e.jsxs("div",{...x("chat/user_msg/root"),className:"w-5/6 flex flex-col items-end gap-1",children:[t.attachments&&t.attachments.length>0&&e.jsx("div",{className:"w-full flex gap-1 flex-wrap justify-end",children:(o=t.attachments)==null?void 0:o.map(a=>e.jsx(ut,{attachment:a},a.id))}),t.content.length>0&&e.jsx("div",{...x("chat/user_msg/msg"),"data-first":r,"data-last":s,"data-alone":n,className:h("transition-all","w-fit py-3 px-4 rounded-3xl text-sm","bg-primary text-primary-foreground","break-words [word-break:break-word]","whitespace-pre-wrap",r&&!n&&"rounded-br-md",s&&!n&&"rounded-tr-md",!r&&!s&&!n&&"rounded-r-md"),children:t.content})]})}function ys({messages:t}){return e.jsxs("div",{...x("chat/user_msg_group/root"),className:h("group","flex flex-col gap-1 justify-end items-end"),children:[t.map((r,s,n)=>e.jsx(bs,{message:r,isFirstInGroup:s===0,isLastInGroup:s===n.length-1,isAloneInGroup:n.length===1},r.id)),e.jsx(kt,{messages:t,containerClassName:"ms-auto"})]})}function js(t){const r=[];let s=null;return t.forEach(n=>{var o,a,i,c,d,p;(((o=s==null?void 0:s[0])==null?void 0:o.type)!==n.type||((a=s[0])==null?void 0:a.type)==="AGENT"&&n.type==="AGENT"&&(((i=n.agent)==null?void 0:i.id)!==((c=s[0].agent)==null?void 0:c.id)||((d=n.agent)==null?void 0:d.name)!==((p=s[0].agent)==null?void 0:p.name)))&&(s=[],r.push(s)),s.push(n)}),r}function ks(t){var r;return((r=t==null?void 0:t[0])==null?void 0:r.type)==="USER"}function Cs(t){var r;return((r=t==null?void 0:t[0])==null?void 0:r.type)==="AI"}function zs(t){var r;return((r=t==null?void 0:t[0])==null?void 0:r.type)==="AGENT"}function Ss(){const{messagesState:{messages:t}}=l.useMessages(),{advancedInitialMessages:r=[],initialQuestionsPosition:s,initialQuestions:n,bot:o}=l.useConfig();return e.jsx(e.Fragment,{children:t.length===0&&r.length>0&&e.jsx(ee,{messages:r.map(({message:a},i)=>({component:"bot_message",data:{message:a},id:`${i}-${a}`,type:"AI",timestamp:null})),suggestedReplies:t.length===0&&s==="below-initial-messages"?n:void 0,agent:o?{...o,isAi:!0,id:null}:void 0})})}function Ns(){const{messagesState:{messages:t}}=l.useMessages(),{chatBannerItems:r}=l.useConfig();return!(r!=null&&r.length)||t.length>0&&r.every(s=>!s.persistent)?null:e.jsx("div",{className:"w-full text-center text-xs",children:r.map(({message:s,persistent:n},o)=>t.length>0&&!n?null:e.jsx("div",{children:e.jsx(me,{children:s})},`${s}-${o}`))})}function _s(){const{messagesState:{messages:t}}=l.useMessages(),r=l.useConfig(),{advancedInitialMessages:s=[],initialQuestions:n,initialQuestionsPosition:o}=r,a=(()=>{var i;return s.length?[]:t.length?[]:(i=r.initialMessages)!=null&&i.length?r.initialMessages:["Hello, how can I help you?"]})();return e.jsx(e.Fragment,{children:t.length===0&&a.length>0&&e.jsx(ee,{messages:a.map((i,c)=>({component:"bot_message",data:{message:i},id:`${c}-${i}`,type:"AI",timestamp:null})),suggestedReplies:o==="below-initial-messages"?n:void 0,agent:r.bot?{...r.bot,isAi:!0,id:null}:void 0})})}function Is(){var s;const t=U(),r=(s=t.config.customComponents)==null?void 0:s.chatBottomComponents;return r?e.jsx("div",{children:r.map(({key:n,component:o})=>e.jsx(o,{...t},n))}):null}function Ms(){const{messagesState:{messages:t}}=l.useMessages(),{isAwaitingBotReply:r}=l.useIsAwaitingBotReply(),{componentStore:s}=l.useWidget(),{bot:n,humanAgent:o}=l.useConfig(),a=m.useMemo(()=>js(t),[t]),i=s.getComponent("loading"),c=m.useRef(null);function d(){setTimeout(()=>{const p=c.current;p&&(p.scrollTop=p.scrollHeight)},0)}return m.useEffect(()=>{d()},[t]),e.jsxs("div",{...x("chat/msgs/root"),ref:c,className:"max-h-full scroll-smooth relative flex-1 py-2 px-4 flex flex-col gap-2 overflow-auto",children:[e.jsx(Ns,{}),e.jsx(Ss,{}),e.jsx(_s,{}),a.map((p,b)=>{var C,y,S,I;const k=(C=p==null?void 0:p[0])==null?void 0:C.type,u=(y=p[0])==null?void 0:y.id;if(!k||!u)return null;if(ks(p))return e.jsx(ys,{messages:p},u);if(Cs(p)){const v=b===a.length-1;return r&&v?null:((S=p[0])==null||S.agent,e.jsx(ee,{messages:p,agent:n?{...n,isAi:!0,id:null}:void 0},u))}if(zs(p)){const v=(I=p[0])==null?void 0:I.agent;return e.jsx(ee,{messages:p,agent:v?{...v,name:(o==null?void 0:o.name)||v.name||"",avatarUrl:(o==null?void 0:o.avatarUrl)||v.avatarUrl||null}:o?{isAi:!1,id:null,name:o.name||"",avatarUrl:o.avatarUrl||null}:void 0},u)}return null}),r&&i&&e.jsx(i,{agent:n}),e.jsx(Is,{}),e.jsx(vs,{})]})}function Ts(){const{messagesState:{isInitialFetchLoading:t}}=l.useMessages(),{sessionState:{session:r}}=l.useSessions(),{isCanvasOpen:s}=cs(),{theme:n}=q();fe({width:s?n.screens.chat.withCanvas.width:n.screens.chat.width,height:s?n.screens.chat.withCanvas.height:n.screens.chat.height});const o=m.useRef((r==null?void 0:r.id)||"chat").current;return e.jsx("div",{...x("chat/root"),className:h("flex flex-col overflow-hidden"),style:{width:"100vw",maxWidth:"100vw",height:"100vh",maxHeight:"100vh"},children:e.jsxs("div",{className:"size-full justify-between flex flex-col",children:[e.jsx(yt,{}),e.jsx(z.AnimatePresence,{mode:"wait",children:t?e.jsx(j,{className:"flex flex-col items-center justify-center w-full flex-1",children:e.jsx(jt,{})},"loading"):e.jsxs(j,{className:"flex items-start h-full flex-1 overflow-auto",snapExit:!0,children:[e.jsxs("div",{...x("chat/main/root"),className:h("flex flex-col h-full overflow-auto transition-all",s?"w-2/5":"w-full"),style:{transitionTimingFunction:n.screens.chat.withCanvas.transitionTimingFunction,transitionDuration:n.screens.chat.withCanvas.transitionDuration},children:[e.jsx(Ms,{}),e.jsx(fs,{})]}),e.jsx("div",{...x("chat/canvas/root"),className:h("h-full overflow-auto transition-all",s?"w-3/5":"w-0"),style:{transitionTimingFunction:n.screens.chat.withCanvas.transitionTimingFunction,transitionDuration:n.screens.chat.withCanvas.transitionDuration},children:e.jsx(ds,{})})]},o)})]})})}function Rs({className:t,...r}){return e.jsx("div",{className:h("animate-pulse rounded-md bg-secondary",t),...r})}function Ds({className:t}){return e.jsx("svg",{width:"26",height:"32",viewBox:"0 0 26 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:h("text-primary-foreground",t),children:e.jsx("path",{d:"M1.34103 25.6132H5.44245C5.74203 25.6228 6.02673 25.7462 6.23867 25.9582C6.45062 26.1703 6.5739 26.4551 6.58348 26.7548V30.8584C6.59305 31.1581 6.71634 31.443 6.92828 31.655C7.14023 31.8671 7.42492 31.9904 7.7245 32H18.2894C18.589 31.9904 18.8737 31.8671 19.0856 31.655C19.2976 31.443 19.4209 31.1581 19.4304 30.8584V26.7548C19.4401 26.4545 19.5638 26.1692 19.7765 25.957C19.9892 25.7449 20.2748 25.6219 20.5749 25.6132H24.659C24.9586 25.6036 25.2433 25.4803 25.4552 25.2682C25.6671 25.0562 25.7904 24.7713 25.8 24.4716V7.52839C25.7904 7.22865 25.6671 6.94381 25.4552 6.73176C25.2433 6.5197 24.9586 6.39635 24.659 6.38677H20.561C20.2603 6.37802 19.9742 6.25457 19.7614 6.04169C19.5487 5.82881 19.4253 5.54261 19.4165 5.24168V1.14161C19.4072 0.84419 19.2858 0.561291 19.0768 0.349589C18.8678 0.137887 18.5865 0.0130193 18.2894 0L7.7245 0C7.42492 0.00957792 7.14023 0.132929 6.92828 0.344983C6.71634 0.557036 6.59305 0.841878 6.58348 1.14161V5.24168C6.57477 5.54203 6.45187 5.82773 6.23983 6.04052C6.0278 6.25331 5.74262 6.37715 5.44245 6.38677H1.34103C1.04144 6.39635 0.756749 6.5197 0.544805 6.73176C0.332861 6.94381 0.209574 7.22865 0.200001 7.52839V24.4716C0.209574 24.7713 0.332861 25.0562 0.544805 25.2682C0.756749 25.4803 1.04144 25.6036 1.34103 25.6132ZM6.58348 24.4716V7.52839C6.59305 7.22865 6.71634 6.94381 6.92828 6.73176C7.14023 6.5197 7.42492 6.39635 7.7245 6.38677H18.2894C18.589 6.39635 18.8737 6.5197 19.0856 6.73176C19.2976 6.94381 19.4209 7.22865 19.4304 7.52839V24.4716C19.4209 24.7713 19.2976 25.0562 19.0856 25.2682C18.8737 25.4803 18.589 25.6036 18.2894 25.6132H7.7245C7.42492 25.6036 7.14023 25.4803 6.92828 25.2682C6.71634 25.0562 6.59305 24.7713 6.58348 24.4716Z",fill:"currentColor"})})}function Ct({className:t}){const{token:r}=l.useConfig();return e.jsx("div",{className:h("flex items-center justify-center gap-2 p-2 pt-0",t),children:e.jsx(F,{children:e.jsxs("a",{href:`https://open.cx/?ref=${r}`,target:"_blank",rel:"noreferrer",className:h("text-[10px] flex items-center","text-muted-foreground/70 [&_svg]:text-muted-foreground/70","hover:text-primary [&_svg]:hover:text-primary"),children:[e.jsx("span",{children:"Powered by"}),e.jsx("span",{children:" "}),e.jsxs("span",{className:"flex items-center gap-[1px]",children:[e.jsx("span",{children:e.jsx(Ds,{className:"size-3 inline-block"})}),e.jsx("span",{className:"font-semibold",children:"open"})]})]})})})}function Ps({children:t}){return e.jsx("p",{className:"ps-4 text-xs text-muted-foreground/75 uppercase font-semibold tracking-tight",children:t})}function rt({session:t,className:r}){const{bot:s,humanAgent:n}=l.useConfig(),{toChatScreen:o}=l.useWidgetRouter(),a=t.assignee.kind==="human"?(n==null?void 0:n.name)||t.assignee.name||"Support Agent":(s==null?void 0:s.name)||"AI Support Agent",i=t.assignee.kind==="human"?(n==null?void 0:n.avatarUrl)||t.assignee.avatarUrl||"":(s==null?void 0:s.avatarUrl)||(s==null?void 0:s.avatar)||"";return e.jsxs(N,{variant:"ghost",size:"lg",className:h("rounded-full p-2 pe-4 flex text-start justify-between w-full whitespace-normal",r),onClick:()=>o(t.id),children:[e.jsxs("div",{className:"flex-1 flex gap-2 items-center",children:[e.jsx(z.AnimatePresence,{mode:"wait",children:e.jsx(j,{snapExit:!0,children:e.jsxs(ue,{className:"size-10",children:[e.jsx(ge,{src:i,alt:"Agent Icon"}),e.jsx(we,{children:e.jsx(g.UserRoundIcon,{className:"size-4"})})]})})}),e.jsxs("div",{className:"flex-1",children:[e.jsx(z.AnimatePresence,{mode:"wait",children:e.jsx(j,{snapExit:!0,children:a},a)}),e.jsx(z.AnimatePresence,{mode:"wait",children:t.lastMessage?e.jsx(j,{snapExit:!0,children:e.jsx(gt,{remarkPlugins:[nt],rehypePlugins:[ot],className:"line-clamp-1 overflow-hidden text-ellipsis text-xs text-muted-foreground",children:t.lastMessage})},t.lastMessage||"content"):e.jsx(j,{className:"w-1/2",snapExit:!0,children:e.jsx(Rs,{className:"h-4 w-full"})},"skeleton")})]})]}),e.jsx(g.ChevronRightIcon,{className:"size-4 text-muted-foreground shrink-0 rtl:-scale-100"})]})}function Es(){const{t}=L(),{toChatScreen:r}=l.useWidgetRouter(),{sessionsState:{data:s,isInitialFetchLoading:n},openSessions:o,closedSessions:a,canCreateNewSession:i}=l.useSessions();return e.jsx("div",{className:"flex-1 flex flex-col overflow-scroll py-2 px-2",children:e.jsx(z.AnimatePresence,{mode:"wait",children:n?e.jsx(j,{className:"flex-1 flex items-center justify-center",children:e.jsx(jt,{})},"loading"):e.jsx(j,{className:"flex-1 flex flex-col gap-2 relative",children:s.length?e.jsxs(e.Fragment,{children:[e.jsxs(z.AnimatePresence,{children:[o.length>0&&e.jsx(j,{fadeIn:"up",delay:.2,className:"space-y-2",snapExit:!0,children:o.map(c=>e.jsx(rt,{session:c},c.id))},"open-sessions"),a.length>0&&e.jsxs(j,{className:"space-y-2",delay:.2,snapExit:!0,children:[e.jsx(Ps,{children:t("closed_conversations")}),a.map(c=>e.jsx(rt,{session:c,className:"opacity-50 hover:opacity-100"},c.id))]},"closed-sessions")]}),i&&e.jsx("div",{className:"mt-auto w-full rounded-3xl sticky bottom-0 outline outline-8 outline-background bg-background",children:m.createElement(N,{...x("sessions/new_conversation_btn"),size:"lg",key:"new-session",className:"w-full",onClick:()=>r()},t("new_conversation"))})]}):e.jsxs("div",{className:"flex-1 flex flex-col gap-2 items-center",children:[e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("p",{className:"text-muted-foreground",children:t("no_conversations_yet")})}),m.createElement(N,{...x("sessions/new_conversation_btn"),size:"lg",key:"new-session",className:"w-full",onClick:()=>r()},t("new_conversation"))]})},"sessions")})})}function As(){const{theme:t}=q();return fe({width:t.screens.sessions.width,height:t.screens.sessions.height}),e.jsx("div",{...x("sessions/root"),className:h("flex flex-col overflow-hidden bg-background"),style:{width:"100vw",maxWidth:"100vw",height:"100vh",maxHeight:"100vh"},children:e.jsxs("div",{className:"size-full flex flex-col",children:[e.jsx(yt,{}),e.jsx(Es,{}),e.jsx(Ct,{})]})})}const J=B.forwardRef(({className:t,type:r,...s},n)=>{const{isSmallScreen:o}=O();return e.jsx("input",{ref:n,type:r,className:h(o?"text-[16px]":"text-sm","flex w-full rounded-xl p-2 ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-primary-foreground placeholder:text-muted-foreground/75 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 transition","rounded-2xl px-4","border shadow-sm",t),...s})});J.displayName="Input";function Ws(){const{contentIframeRef:t}=l.useWidget(),{inline:r}=l.useConfig(),s=m.useRef(null);return m.useEffect(()=>{const n=t==null?void 0:t.current;if(n&&s.current){const o=s.current;let a;const i=new ResizeObserver(()=>{a=requestAnimationFrame(()=>{const c=o.offsetHeight;n.style.setProperty("--opencx-widget-height",r?"100%":`${c.toFixed(1)}px`)})});return i.observe(o),()=>{cancelAnimationFrame(a),i.unobserve(o)}}},[t,r]),{observedElementRef:s}}const Os=oe.z.object({name:oe.z.string().min(2),email:oe.z.string().email()});function Fs(){var v,R,P,E,f,M,D,T;const{widgetCtx:{org:t}}=l.useWidget(),{setIsOpen:r}=l.useWidgetTrigger(),{createUnverifiedContact:s}=l.useContact(),{isSmallScreen:n}=O(),o=l.useConfig(),{theme:a}=q(),{t:i}=L(),{observedElementRef:c}=Ws();fe({height:void 0,width:a.screens.welcome.width});const[d,p]=m.useState(((v=o.prefillUserData)==null?void 0:v.name)||""),[b,k]=m.useState(((R=o.prefillUserData)==null?void 0:R.email)||""),u=(o.extraDataCollectionFields||[]).filter(w=>w!=="name"&&w!=="email"&&!!w),[C,y]=m.useState({}),[S,I]=Wt(async w=>{w.preventDefault();const _=Os.safeParse({name:d,email:b});_.success&&await s({email:_.data.email,non_verified_name:_.data.name},Object.values(C).filter(Boolean).length?C:void 0)},[d,b,C]);return e.jsx("div",{style:{width:"100vw",maxWidth:"100vw",minHeight:a.screens.welcome.minHeight,height:"100vh",maxHeight:"100vh",overflowY:"auto"},children:e.jsxs("div",{ref:c,className:h("flex flex-col",n&&"h-full","bg-[radial-gradient(ellipse_at_top_left,hsl(var(--opencx-primary)),transparent),radial-gradient(ellipse_at_top_right,hsl(var(--opencx-primary)),transparent)]"),children:[e.jsxs("div",{className:h("flex-1 flex flex-col px-4 py-12 text-start space-y-4 relative z-10","text-primary-foreground"),children:[n&&e.jsx(j,{className:"absolute top-6 end-6",children:e.jsx(N,{size:"selfless",onClick:()=>r(!1),children:e.jsx(g.XIcon,{className:"size-4"})})}),e.jsx("div",{className:"flex items-center justify-between w-full mb-2",children:(P=o.assets)!=null&&P.organizationLogo?e.jsx("img",{src:(E=o.assets)==null?void 0:E.organizationLogo,alt:"Company Logo",className:"h-8 w-auto object-contain"}):e.jsx("h2",{className:"font-bold text-sm",children:t.name})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-[1.75rem] font-semibold tracking-tight leading-none",children:((M=(f=o.textContent)==null?void 0:f.welcomeScreen)==null?void 0:M.title)||i("welcome_screen_title")}),e.jsx("p",{className:"text-sm",children:((T=(D=o.textContent)==null?void 0:D.welcomeScreen)==null?void 0:T.description)||i("welcome_screen_description")})]})]}),e.jsxs("div",{className:h("z-10 m-2 px-2 pt-2 bp-0 space-y-2","bg-[white]","border shadow","rounded-3xl"),children:[e.jsxs("form",{onSubmit:I,className:"space-y-2",children:[e.jsx(J,{value:d,onChange:w=>p(w.target.value),required:!0,placeholder:i("your_name_placeholder"),name:"name"}),e.jsx(J,{required:!0,value:b,onChange:w=>k(w.target.value),type:"email",placeholder:i("your_email_placeholder"),name:"email"}),u.map(w=>e.jsx(J,{value:C[w],onChange:_=>y(Z=>({...Z,[w]:_.target.value})),placeholder:`${w} (${i("optional")})`},w)),e.jsxs(N,{disabled:S.loading,className:"w-full",size:"lg",children:[S.loading?i("start_chat_button_loading"):i("start_chat_button"),e.jsx(g.SendHorizontal,{className:"size-4 rtl:-scale-100"})]})]}),e.jsx(Ct,{})]})]})})}function zt(){const{routerState:{screen:t}}=l.useWidgetRouter();return e.jsx("div",{className:"relative bg-background size-full",children:e.jsx(z.AnimatePresence,{mode:"wait",children:(()=>{switch(t){case"welcome":return e.jsx(j,{fadeIn:"right",className:"size-full",snapExit:!0,children:e.jsx(Fs,{})},t);case"sessions":return e.jsx(j,{fadeIn:"right",className:"size-full",snapExit:!0,children:e.jsx(As,{})},t);case"chat":return e.jsx(j,{fadeIn:"right",className:"size-full",snapExit:!0,children:e.jsx(Ts,{})},t);default:return A.isExhaustive(t,zt.name),null}})()})})}const Hs="4.0.50",qs=`<!DOCTYPE html>
18
18
  <html>
19
19
  <head>
20
20
  <style>
@@ -31,7 +31,7 @@ html, body {
31
31
  </head>
32
32
  <body>
33
33
  </body>
34
- </html>`;function St(){const{isOpen:t}=l.useWidgetTrigger(),{contentIframeRef:r}=l.useWidget(),{cssOverrides:s,inline:o}=l.useConfig(),{theme:n,cssVars:a,computed:i}=q(),{dir:c}=L();return e.jsx(N.motion.div,{animate:t?"visible":"hidden",initial:"hidden",variants:{hidden:{opacity:0,y:8,transitionEnd:{display:"none"},transition:{duration:.15}},visible:{opacity:1,y:0,display:"block",height:o?"100%":void 0}},children:e.jsxs(at,{ref:r,initialContent:qs,allowFullScreen:!0,title:"OpenCX Live Chat",style:{"--opencx-widget-width":i.minWidth,"--opencx-widget-height":i.minHeight,minWidth:i.minWidth,width:"var(--opencx-widget-width)",maxWidth:i.maxWidth,minHeight:i.minHeight,height:"var(--opencx-widget-height)",maxHeight:i.maxHeight,overflow:"hidden",outline:n.widgetContentContainer.outline,outlineColor:n.widgetContentContainer.outlineColor,borderRadius:n.widgetContentContainer.borderRadius,boxShadow:n.widgetContentContainer.boxShadow,transitionProperty:n.widgetContentContainer.transitionProperty,transitionTimingFunction:n.widgetContentContainer.transitionTimingFunction,transitionDuration:n.widgetContentContainer.transitionDuration,boxSizing:"border-box",borderWidth:"0px"},children:[s&&e.jsx("style",{children:s}),e.jsx("div",{style:{...a,zIndex:n.widgetContentContainer.zIndex},"data-version":Hs,className:m("antialiased font-sans size-full overflow-hidden relative text-secondary-foreground isolate"),dir:c,children:e.jsx(Qt,{delayDuration:200,disableHoverableContent:!0,children:e.jsx(Yt,{children:e.jsx(zt,{})})})})]})})}function Ls(){const{theme:t}=q();return e.jsx(se.Content,{onInteractOutside:r=>r.preventDefault(),forceMount:!0,style:{zIndex:t.widgetContentContainer.zIndex,fontSize:"16px"},side:"top",align:"end","aria-modal":"false","aria-label":"Support chat",sideOffset:t.widgetContentContainer.offset.side,alignOffset:t.widgetContentContainer.offset.align,avoidCollisions:!1,children:e.jsx(St,{})})}function $s({className:t,style:r}){return e.jsxs("svg",{width:"32",height:"30",viewBox:"0 0 32 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:m("text-primary-foreground",t),style:r,children:[e.jsx("path",{d:"M0 6.94263C0 3.62892 2.68629 0.942627 6 0.942627H26C29.3137 0.942627 32 3.62892 32 6.94263V17.9426C32 21.2563 29.3137 23.9426 26 23.9426H6C2.68629 23.9426 0 21.2563 0 17.9426V6.94263Z",fill:"currentColor"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.9945 23.8935L26.237 23.8934C26.1982 24.3557 26.1712 25.2778 26.1704 26.2318C26.1688 28.2839 26.1376 28.7041 25.974 28.868C25.583 29.2598 25.2686 29.0967 24.0616 27.8754C23.4162 27.2222 22.1141 25.9522 21.1682 25.0531L19.9945 23.8935Z",fill:"currentColor"})]})}const Bs=`<!DOCTYPE html>
34
+ </html>`;function St(){const{isOpen:t}=l.useWidgetTrigger(),{contentIframeRef:r}=l.useWidget(),{cssOverrides:s,inline:n}=l.useConfig(),{theme:o,cssVars:a,computed:i}=q(),{dir:c}=L();return e.jsx(z.motion.div,{animate:t?"visible":"hidden",initial:"hidden",variants:{hidden:{opacity:0,y:8,transitionEnd:{display:"none"},transition:{duration:.15}},visible:{opacity:1,y:0,display:"block",height:n?"100%":void 0}},children:e.jsxs(at,{ref:r,initialContent:qs,allowFullScreen:!0,title:"OpenCX Live Chat",style:{"--opencx-widget-width":i.minWidth,"--opencx-widget-height":i.minHeight,minWidth:i.minWidth,width:"var(--opencx-widget-width)",maxWidth:i.maxWidth,minHeight:i.minHeight,height:"var(--opencx-widget-height)",maxHeight:i.maxHeight,overflow:"hidden",outline:o.widgetContentContainer.outline,outlineColor:o.widgetContentContainer.outlineColor,borderRadius:o.widgetContentContainer.borderRadius,boxShadow:o.widgetContentContainer.boxShadow,transitionProperty:o.widgetContentContainer.transitionProperty,transitionTimingFunction:o.widgetContentContainer.transitionTimingFunction,transitionDuration:o.widgetContentContainer.transitionDuration,boxSizing:"border-box",borderWidth:"0px"},children:[s&&e.jsx("style",{children:s}),e.jsx("div",{style:{...a,zIndex:o.widgetContentContainer.zIndex},"data-version":Hs,className:h("antialiased font-sans size-full overflow-hidden relative text-secondary-foreground isolate"),dir:c,children:e.jsx(Qt,{delayDuration:200,disableHoverableContent:!0,children:e.jsx(Yt,{children:e.jsx(zt,{})})})})]})})}function Ls(){const{theme:t}=q();return e.jsx(se.Content,{onInteractOutside:r=>r.preventDefault(),forceMount:!0,style:{zIndex:t.widgetContentContainer.zIndex,fontSize:"16px"},side:"top",align:"end","aria-modal":"false","aria-label":"Support chat",sideOffset:t.widgetContentContainer.offset.side,alignOffset:t.widgetContentContainer.offset.align,avoidCollisions:!1,children:e.jsx(St,{})})}function $s({className:t,style:r}){return e.jsxs("svg",{width:"32",height:"30",viewBox:"0 0 32 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:h("text-primary-foreground",t),style:r,children:[e.jsx("path",{d:"M0 6.94263C0 3.62892 2.68629 0.942627 6 0.942627H26C29.3137 0.942627 32 3.62892 32 6.94263V17.9426C32 21.2563 29.3137 23.9426 26 23.9426H6C2.68629 23.9426 0 21.2563 0 17.9426V6.94263Z",fill:"currentColor"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.9945 23.8935L26.237 23.8934C26.1982 24.3557 26.1712 25.2778 26.1704 26.2318C26.1688 28.2839 26.1376 28.7041 25.974 28.868C25.583 29.2598 25.2686 29.0967 24.0616 27.8754C23.4162 27.2222 22.1141 25.9522 21.1682 25.0531L19.9945 23.8935Z",fill:"currentColor"})]})}const Bs=`<!DOCTYPE html>
35
35
  <html>
36
36
  <head>
37
37
  <style>
@@ -47,5 +47,5 @@ html, body {
47
47
  </head>
48
48
  <body>
49
49
  </body>
50
- </html>`;function Ys(){var c,d;const{isOpen:t,setIsOpen:r}=l.useWidgetTrigger(),{cssOverrides:s,assets:o,customComponents:n}=l.useConfig(),{theme:a,cssVars:i}=q();return n!=null&&n.widgetTrigger?n.widgetTrigger({react:h,isOpen:t,setIsOpen:p=>r(p)}):e.jsxs(at,{initialContent:Bs,title:"OpenCX Live Chat Trigger",style:{height:`calc(${a.widgetTrigger.size.button}px + ${$.x*2}px)`,width:`calc(${a.widgetTrigger.size.button}px + ${$.y*2}px)`,fontSize:"16px",position:"fixed",zIndex:a.widgetTrigger.zIndex,right:a.widgetTrigger.offset.right,bottom:a.widgetTrigger.offset.bottom,left:a.widgetTrigger.offset.left,boxSizing:"border-box",borderWidth:"0px",borderRadius:"100%"},children:[s&&e.jsx("style",{children:s}),e.jsx("div",{style:{...i,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(se.PopoverTrigger,{className:m("font-sans flex items-center justify-center rounded-full"),style:{height:a.widgetTrigger.size.button,width:a.widgetTrigger.size.button},children:e.jsx(H,{children:e.jsx("div",{...f("trigger/btn"),className:m("relative size-full rounded-full","flex items-center justify-center","overflow-hidden","transition-all","bg-primary","text-primary-foreground"),children:e.jsx(N.AnimatePresence,{mode:"wait",children:t?e.jsx(C,{snapExit:!0,fadeIn:"up",overrides:{initial:{rotate:45},animate:{rotate:0}},children:(c=o==null?void 0:o.widgetTrigger)!=null&&c.closeIcon?e.jsx("img",{src:o.widgetTrigger.closeIcon,alt:"Widget trigger close icon",style:{width:a.widgetTrigger.size.icon,height:a.widgetTrigger.size.icon}}):e.jsx(g.ChevronDownIcon,{style:{width:a.widgetTrigger.size.icon,height:a.widgetTrigger.size.icon}})},"x-icon"):e.jsx(C,{snapExit:!0,overrides:{initial:{rotate:45},animate:{rotate:0}},children:(d=o==null?void 0:o.widgetTrigger)!=null&&d.openIcon?e.jsx("img",{src:o.widgetTrigger.openIcon,alt:"Widget trigger open icon",style:{width:a.widgetTrigger.size.icon,height:a.widgetTrigger.size.icon}}):e.jsx($s,{style:{width:a.widgetTrigger.size.icon,height:a.widgetTrigger.size.icon},className:"mt-0.5 opacity-95"})},"message-icon")})})})})})]})}function Us(){const{dir:t}=l.useDocumentDir();return e.jsx(se.Anchor,{style:{position:"fixed",bottom:0,right:t==="ltr"?0:void 0,left:t==="rtl"?0:void 0}})}function Xs({widgetRef:t}){const{widgetCtx:r}=l.useWidget(),{contactState:s}=l.useContact(),{setIsOpen:o,isOpen:n}=l.useWidgetTrigger(),{toChatScreen:a,routerState:{screen:i}}=l.useWidgetRouter(),{sendMessage:c}=l.useMessages();return h.useImperativeHandle(t,()=>({newChat:async d=>{var p;if(!((p=s.contact)!=null&&p.token)){console.warn("Cannot start a new chat: contact not yet initialized.");return}console.log({isOpen:n}),n||o(!0),i==="chat"&&r.resetChat(),a(),d!=null&&d.message&&c({content:d.message})}}),[r,s,o,n,i,a,c]),null}function Vs(){const{isOpen:t,setIsOpen:r}=l.useWidgetTrigger();return e.jsxs(se.Root,{open:t,onOpenChange:r,children:[e.jsx(Us,{}),e.jsx(Ys,{}),e.jsx(Ls,{})]})}const Gs=[{key:"loading",component:Kt},{key:"fallback",component:Zt},{key:"bot_message",component:ie},{key:"agent_message",component:ie}],Zs={get:async t=>localStorage.getItem(t),set:async(t,r)=>{localStorage.setItem(t,r)},remove:async t=>{localStorage.removeItem(t)}},Nt=h.forwardRef(function({options:r,components:s=[],loadingComponent:o},n){return e.jsx(l.WidgetProvider,{components:[...Gs,...s],options:r,storage:Zs,loadingComponent:o,children:e.jsxs(l.WidgetTriggerProvider,{children:[e.jsx(Xs,{widgetRef:n}),r.inline?e.jsx(St,{}):e.jsx(Vs,{})]})})});Nt.displayName="Widget";exports.Widget=Nt;
50
+ </html>`;function Ys(){var c,d;const{isOpen:t,setIsOpen:r}=l.useWidgetTrigger(),{cssOverrides:s,assets:n,customComponents:o}=l.useConfig(),{theme:a,cssVars:i}=q();return o!=null&&o.widgetTrigger?o.widgetTrigger({react:m,isOpen:t,setIsOpen:p=>r(p)}):e.jsxs(at,{initialContent:Bs,title:"OpenCX Live Chat Trigger",style:{height:`calc(${a.widgetTrigger.size.button}px + ${$.x*2}px)`,width:`calc(${a.widgetTrigger.size.button}px + ${$.y*2}px)`,fontSize:"16px",position:"fixed",zIndex:a.widgetTrigger.zIndex,right:a.widgetTrigger.offset.right,bottom:a.widgetTrigger.offset.bottom,left:a.widgetTrigger.offset.left,boxSizing:"border-box",borderWidth:"0px",borderRadius:"100%"},children:[s&&e.jsx("style",{children:s}),e.jsx("div",{style:{...i,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(se.PopoverTrigger,{className:h("font-sans flex items-center justify-center rounded-full"),style:{height:a.widgetTrigger.size.button,width:a.widgetTrigger.size.button},children:e.jsx(F,{children:e.jsx("div",{...x("trigger/btn"),className:h("relative size-full rounded-full","flex items-center justify-center","overflow-hidden","transition-all","bg-primary","text-primary-foreground"),children:e.jsx(z.AnimatePresence,{mode:"wait",children:t?e.jsx(j,{snapExit:!0,fadeIn:"up",overrides:{initial:{rotate:45},animate:{rotate:0}},children:(c=n==null?void 0:n.widgetTrigger)!=null&&c.closeIcon?e.jsx("img",{src:n.widgetTrigger.closeIcon,alt:"Widget trigger close icon",style:{width:a.widgetTrigger.size.icon,height:a.widgetTrigger.size.icon}}):e.jsx(g.ChevronDownIcon,{style:{width:a.widgetTrigger.size.icon,height:a.widgetTrigger.size.icon}})},"x-icon"):e.jsx(j,{snapExit:!0,overrides:{initial:{rotate:45},animate:{rotate:0}},children:(d=n==null?void 0:n.widgetTrigger)!=null&&d.openIcon?e.jsx("img",{src:n.widgetTrigger.openIcon,alt:"Widget trigger open icon",style:{width:a.widgetTrigger.size.icon,height:a.widgetTrigger.size.icon}}):e.jsx($s,{style:{width:a.widgetTrigger.size.icon,height:a.widgetTrigger.size.icon},className:"mt-0.5 opacity-95"})},"message-icon")})})})})})]})}function Us(){const{dir:t}=l.useDocumentDir();return e.jsx(se.Anchor,{style:{position:"fixed",bottom:0,right:t==="ltr"?0:void 0,left:t==="rtl"?0:void 0}})}function Xs({widgetRef:t}){const{widgetCtx:r}=l.useWidget(),{contactState:s}=l.useContact(),{setIsOpen:n,isOpen:o}=l.useWidgetTrigger(),{toChatScreen:a,routerState:{screen:i}}=l.useWidgetRouter(),{sendMessage:c}=l.useMessages();return m.useImperativeHandle(t,()=>({newChat:async d=>{var p;if(!((p=s.contact)!=null&&p.token)){console.warn("Cannot start a new chat: contact not yet initialized.");return}console.log({isOpen:o}),o||n(!0),i==="chat"&&r.resetChat(),a(),d!=null&&d.message&&c({content:d.message})}}),[r,s,n,o,i,a,c]),null}function Vs(){const{isOpen:t,setIsOpen:r}=l.useWidgetTrigger();return e.jsxs(se.Root,{open:t,onOpenChange:r,children:[e.jsx(Us,{}),e.jsx(Ys,{}),e.jsx(Ls,{})]})}const Gs=[{key:"loading",component:Kt},{key:"fallback",component:Zt},{key:"bot_message",component:ie},{key:"agent_message",component:ie}],Zs={get:async t=>localStorage.getItem(t),set:async(t,r)=>{localStorage.setItem(t,r)},remove:async t=>{localStorage.removeItem(t)}},Nt=m.forwardRef(function({options:r,components:s=[],loadingComponent:n},o){return e.jsx(l.WidgetProvider,{components:[...Gs,...s],options:r,storage:Zs,loadingComponent:n,children:e.jsxs(l.WidgetTriggerProvider,{children:[e.jsx(Xs,{widgetRef:o}),r.inline?e.jsx(St,{}):e.jsx(Vs,{})]})})});Nt.displayName="Widget";exports.Widget=Nt;
51
51
  //# sourceMappingURL=index.cjs.map