import{a as b,b as B}from"./chunk-4HRGWH64.js";import{a as D,b as l,c as P}from"./chunk-INTD3ZAR.js";import{a as A,b as k}from"./chunk-PV6WMERW.js";import{H as N}from"./chunk-TOYHXA2V.js";import{B as M,C as p,K as g,L as q,h as v,n as y,p as w}from"./chunk-D3R64VAA.js";import R,{Fragment as G,memo as S,useMemo as L}from"react";import{useContext as K}from"react";import Q,{memo as T,useMemo as U}from"react";import V,{Fragment as W,memo as Y}from"react";import u,{memo as h,useContext as $,useMemo as x}from"react";import{createContext as re}from"react";import j,{memo as se,useContext as ce,useMemo as O}from"react";var H=g(M({children:p(A()),middleware:p(g(y(w(e=>typeof e=="function")),v()))}),v()),I=p(y(w(e=>e[l]===l)));function J(e){let{children:r,middleware:t}=k(H,e);return L(()=>{q(I,t).success||console.warn('botframework-webchat: "middleware" props passed to <DecoratorComposer> should be created using createXXXMiddleware() functions.',{middleware:t})},[t]),t?R.createElement(B,{middleware:t,priority:"normal"},r):R.createElement(G,null,r)}var Ce=S(J);function Me(e){let r=K(e)?.request;if(!r)throw new Error(`useDecoratorRequest must be used within a ${e}Provider`);return r}function Z({children:e}){return V.createElement(W,null,e)}var X=Y(Z),_=D();function ee(e,r,t=X){function n(i,a){function o(s){let m=$(r)?.request;return u.createElement(i,{...s,Next:a,request:m})}return o.displayName=`ChainNext(Next ${e})`,h(o)}function d(i){let a=o=>o!==e?!1:s=>()=>{let m=s(void 0);return m&&n(i,m)};return a[l]=l,a}let{Provider:f,useBuildComponentCallback:z}=_;function C(i){let a=z(),o=x(()=>a(void 0,{fallbackComponent:t}),[a]);return o&&u.createElement(o,{...i})}C.displayName=`DecoratorChain(Chain ${e})`;let F=h(C);function E(i){let{request:a}=i,{middleware:o}=$(b),s=x(()=>o.map(c=>c(e)).filter(c=>c).map(c=>()=>c),[o]),m=x(()=>({request:a}),[a]);return u.createElement(r.Provider,{value:m},u.createElement(f,{init:e,middleware:s},u.createElement(F,{...i})))}return E.displayName=`DecoratorProxy(Decorator ${e})`,{createMiddleware:d,Proxy:h(E),"~types":void 0}}var te=re(Object.freeze({request:Object.freeze({from:void 0,livestreamingState:void 0})})),ae=te,oe=ee("activity border",ae),{createMiddleware:Be,Proxy:ie}=oe,ne=["bot","channel","user",void 0];function me({activity:e,children:r}){let t=U(()=>{let{type:n}=N(e)||{};return{from:ne.includes(e?.from?.role)?e?.from?.role:void 0,livestreamingState:n==="final activity"?"completing":n==="informative message"?"preparing":n==="interim activity"?"ongoing":void 0}},[e]);return Q.createElement(ie,{request:t},r)}var Re=T(me),le=P("activity grouping"),{createMiddleware:je,extractMiddleware:ue,Provider:de,Proxy:pe}=le;function fe({activities:e,children:r,groupingName:t}){let n=O(()=>({groupingName:t}),[t]),{middleware:d}=ce(b),f=O(()=>ue(d),[d]);return j.createElement(de,{middleware:f},j.createElement(pe,{activities:e,fallbackComponent:X,request:n},r))}var Oe=se(fe);export{Ce as a,Me as b,ae as c,Be as d,Re as e,je as f,Oe as g};
//# sourceMappingURL=chunk-HH5NCZ4G.js.map
