botframework-webchat-fluent-theme 4.18.1-main.20240807.dfe788c → 4.18.1-main.20240808.851825d

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.
@@ -1,3 +1,3 @@
1
- import{injectMetaTag as Ka}from"inject-meta-tag";import{Components as Ha}from"botframework-webchat-component";import Z,{memo as La}from"react";import{array as Bt,literal as I,object as St,safeParse as Ct,string as Et}from"valibot";var Mt=St({"@context":I("https://schema.org"),"@id":I(""),"@type":I("Message"),keywords:Bt(Et()),type:I("https://schema.org/Message")});function M(e){return e?.type!=="message"?!1:!!e.entities?.find(o=>Ct(Mt,o).success)?.keywords.includes("PreChatMessage")}import{hooks as Qt}from"botframework-webchat-component";import $,{memo as eo,useMemo as to}from"react";var Ft=".webchat-fluent .d{display:grid;grid-template-areas:\"body\" \"toolbar\";grid-template-rows:auto auto;gap:var(--webchat-spacingHorizontalXXXL);padding:var(--webchat-spacingHorizontalXXXL)}.webchat-fluent .r{font-family:var(--webchat-fontFamilyBase);font-size:var(--webchat-fontSizeBase300);font-weight:var(--webchat-fontWeightRegular);grid-area:body;line-height:var(--webchat-lineHeightBase300);text-align:center}.webchat-fluent .r h2{color:var(--webchat-colorNeutralForeground1);font-family:inherit;font-weight:var(--webchat-fontWeightSemibold);font-size:var(--webchat-fontSizeHero700);line-height:var(--webchat-lineHeightHero700);margin:var(--webchat-spacingVerticalL) 0 0}.webchat-fluent .r img{border-radius:4px;height:64px}.webchat-fluent .b{grid-area:toolbar}.webchat-fluent .u{background-color:var(--webchat-colorNeutralForeground4);-webkit-mask-image:var(--mask-image);mask-image:var(--mask-image);--webkit-mask-image: var(--mask-image)}.webchat-fluent .e{-webkit-appearance:none;appearance:none;background-color:var(--webchat-colorNeutralBackground1);border:0;border-radius:16px;box-shadow:var(--webchat-shadow2);color:var(--webchat-colorNeutralForeground1);cursor:pointer;display:grid;gap:8px;grid-template-areas:\"image title\" \"image subtitle\";grid-template-columns:20px 1fr;grid-template-rows:auto 1fr;overflow:hidden;padding:16px 20px;text-align:left;-webkit-user-select:none;user-select:none}.webchat-fluent .e:disabled{background-color:var(--webchat-colorNeutralBackground1Disabled)}.webchat-fluent .e:hover{background-color:var(--webchat-colorNeutralGrey94)}.webchat-fluent .e:active{background-color:var(--webchat-colorNeutralBackground1Pressed)}.webchat-fluent .e:focus-visible{outline:solid 2px var(--webchat-colorStrokeFocus2);outline-offset:-2px}.webchat-fluent .h{grid-area:image;height:20px;width:20px}.webchat-fluent .g{font-family:var(--webchat-fontFamilyBase);font-size:14px;font-weight:var(--webchat-fontWeightRegular);grid-area:subtitle;line-height:20px;pointer-events:none}.webchat-fluent .s{font-family:var(--webchat-fontFamilyBase);font-size:14px;font-weight:var(--webchat-fontWeightSemibold);grid-area:title;line-height:20px}.webchat-fluent .w{container-name:a;container-type:inline-size}.webchat-fluent .o{display:grid;gap:var(--webchat-spacingHorizontalM);grid-template-columns:1fr 1fr 1fr;padding:0}@container a (width <= 480px){.webchat-fluent .o{grid-template-columns:1fr}}.webchat-fluent .p{background-color:var(--webchat-colorNeutralBackground4);border-radius:inherit;cursor:copy;display:grid;gap:8px;inset:0;place-content:center;place-items:center;position:absolute}.webchat-fluent .f{background-color:#e00;color:#fff}.webchat-fluent .v{height:36px;pointer-events:none;width:36px}.webchat-fluent .x{align-items:center;background:transparent;border-radius:8px;border:1px solid var(--webchat-colorBrandStroke2);color:currentColor;cursor:pointer;display:flex;font-size:12px;gap:4px;padding:4px 8px;text-align:start;transition:all .15s ease-out}@media (hover: hover){.webchat-fluent .x:not([aria-disabled=true]):hover{background-color:var(--webchat-colorBrandBackground2Hover);color:var(--webchat-colorBrandForeground2Hover)}}.webchat-fluent .x:not([aria-disabled=true]):active{background-color:var(--webchat-colorBrandBackground2Pressed);color:var(--webchat-colorBrandForeground2Pressed)}.webchat-fluent .x[aria-disabled=true]{color:var(--webchat-colorNeutralForegroundDisabled);cursor:not-allowed}.webchat-fluent .m{font-size:12px;height:1em;width:1em}.webchat-fluent .k{align-items:flex-end;align-self:flex-end;display:flex;flex-direction:column;gap:8px}.webchat-fluent .k:not(:empty){padding-block-end:8px;padding-inline-start:4px}.webchat-fluent .k.B{flex-direction:row;flex-wrap:wrap;justify-content:flex-end}.webchat-fluent .k.y{flex-direction:column}.webchat-fluent .t{-webkit-user-select:none;align-items:center;-webkit-appearance:none;appearance:none;background-color:#fff;border-radius:100%;border:solid 1px var(--webchat-colorNeutralStroke1);color:var(--webchat-colorGray200);font-weight:var(--webchat-fontWeightSemibold);cursor:pointer;display:flex;flex-direction:column;height:60px;opacity:.7;padding:0;position:relative;touch-action:none;user-select:none;width:60px}.webchat-fluent .t:hover{background-color:var(--webchat-colorGray30)}.webchat-fluent .l{color:var(--webchat-colorGray190);font-size:10px}.webchat-fluent .c{font-size:24px;margin-top:8px}.webchat-fluent .F .t{height:32px;justify-content:center;margin:8px 4px;width:32px}.webchat-fluent .F .l{display:none}.webchat-fluent .F .c{font-size:20px;margin-top:0}.webchat-fluent .N{align-items:center;background:var(--webchat-colorNeutralBackground1);border:none;border-radius:var(--webchat-borderRadiusXLarge);display:flex;flex-direction:column;font-family:var(--webchat-fontFamilyBase);justify-content:center}.webchat-fluent .S{box-sizing:border-box;display:grid;gap:16px;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(4,1fr);justify-items:center;padding:16px;width:100%}.webchat-fluent .z{align-items:center;color:var(--webchat-colorNeutralForeground4);display:flex;font-size:12px;gap:6px;margin-block-end:6px}.webchat-fluent .H{color:var(--webchat-colorBrandForegroundLink);text-decoration-color:transparent}.webchat-fluent .H:target{color:var(--webchat-colorBrandForegroundLinkSelected)}.webchat-fluent .H:hover{color:var(--webchat-colorBrandForegroundLinkHover);text-decoration:underline 1px currentColor}.webchat-fluent .H:active{color:var(--webchat-colorBrandForegroundLinkPressed)}.webchat-fluent .H:focus-visible{outline:none;text-decoration:underline 1px double var(--webchat-colorStrokeFocus2)}.webchat-fluent .L{display:flex;gap:4px;margin-inline-start:auto}.webchat-fluent .W{align-items:center;-webkit-appearance:none;appearance:none;aspect-ratio:1;background:transparent;border-radius:var(--webchat-borderRadiusSmall);border:none;color:currentColor;cursor:pointer;display:flex;justify-content:center;padding:3px;width:32px}.webchat-fluent .W>svg{font-size:20px;pointer-events:none}.webchat-fluent .W.R{color:var(--webchat-colorNeutralForeground2BrandSelected)}@media (hover: hover){.webchat-fluent .W:not([aria-disabled=true]):hover{color:var(--webchat-colorNeutralForeground2BrandHover)}}.webchat-fluent .W:not([aria-disabled=true]):active{color:var(--webchat-colorNeutralForeground2BrandPressed)}.webchat-fluent .W[aria-disabled=true]{color:var(--webchat-colorNeutralForegroundDisabled);cursor:not-allowed}.webchat-fluent .P{align-self:center;border-inline-end:1px solid var(--webchat-colorNeutralStroke2);height:28px}.webchat-fluent .P:is(:first-child,:last-child,:only-child){display:none}.webchat-fluent .X{display:grid}.webchat-fluent .G{font-size:0;height:0;opacity:0;width:1px}.webchat-fluent .D{border-radius:var(--webchat-borderRadiusLarge);border:1px solid var(--webchat-colorNeutralStroke1);cursor:default;padding:6px 8px;width:fit-content}.webchat-fluent .M{color:transparent;font-size:0;height:0;left:0;position:absolute;top:0;width:0}.webchat-fluent .U{display:grid;grid-template-areas:\"main\";max-height:200px;overflow:hidden}.webchat-fluent .C{height:0;visibility:collapse}.webchat-fluent .j{border:none;font:inherit;grid-area:main;outline:inherit;overflow-wrap:anywhere;resize:inherit;scrollbar-gutter:stable}.webchat-fluent .T{overflow:hidden;visibility:hidden;white-space:pre-wrap}.webchat-fluent .I{background-color:inherit;color:currentColor;height:100%;padding:0}.webchat-fluent .A{scrollbar-color:unset;scrollbar-width:unset;-moz-scrollbar-color:var(--webchat-colorNeutralBackground5) var(--webchat-colorNeutralForeground2);-moz-scrollbar-width:thin}.webchat-fluent .A::-webkit-scrollbar{width:8px}.webchat-fluent .A::-webkit-scrollbar-track{background-color:var(--webchat-colorNeutralBackground5);border-radius:16px}.webchat-fluent .A::-webkit-scrollbar-thumb{background-color:var(--webchat-colorNeutralForeground2);border-radius:16px}.webchat-fluent .A::-webkit-scrollbar-corner{background-color:var(--webchat-colorNeutralBackground5)}.webchat-fluent .V{color:var(--webchat-colorNeutralForeground1);font-family:var(--webchat-fontFamilyBase);padding:0 10px 10px;text-rendering:optimizeLegibility;--webchat-sendbox-attachment-area-active: ;--webchat-sendbox-border-radius: var(--webchat-borderRadiusLarge)}.webchat-fluent .E{background-color:var(--webchat-colorNeutralBackground1);border-radius:var(--webchat-sendbox-border-radius);border:1px solid var(--webchat-colorNeutralStroke1);display:grid;font-family:var(--webchat-fontFamilyBase);font-size:14px;gap:6px;grid-template:[telephone-keypad-start] \"text-area\" [telephone-keypad-end] var(--webchat-sendbox-attachment-area-active) \"controls\" / [telephone-keypad] 1fr;line-height:20px;padding:8px;position:relative}.webchat-fluent .E:has(.n){--webchat-sendbox-attachment-area-active: \"attachment\" }.webchat-fluent .E:focus-within{border-color:var(--webchat-colorNeutralStroke1Selected)}.webchat-fluent .E:after{border-bottom-left-radius:var(--webchat-sendbox-border-radius);border-bottom-right-radius:var(--webchat-sendbox-border-radius);border-bottom:var(--webchat-strokeWidthThicker) solid var(--webchat-colorCompoundBrandForeground1Hover);bottom:-1px;clip-path:inset(calc(100% - var(--webchat-strokeWidthThicker)) 50% 0 50%);content:\"\";height:var(--webchat-sendbox-border-radius);left:-1px;position:absolute;right:-1px;transition:clip-path var(--webchat-durationUltraFast) var(--webchat-curveAccelerateMid)}.webchat-fluent .E:focus-within:after{clip-path:inset(calc(100% - var(--webchat-strokeWidthThicker)) 0 0 0);transition:clip-path var(--webchat-durationNormal) var(--webchat-curveDecelerateMid)}.webchat-fluent .E>.q{grid-area:text-area}.webchat-fluent .E>.n{grid-area:attachment}.webchat-fluent .E>.J{grid-area:controls}.webchat-fluent .E>.K{grid-area:telephone-keypad}.webchat-fluent .O{background-color:transparent;border:none;flex:auto;font-family:var(--webchat-fontFamilyBase);font-size:14px;line-height:20px;outline:none;padding:4px 4px 0;resize:none}@media only screen and (hover: none) and (pointer: coarse){.webchat-fluent .O:focus-within{font-size:16px}}.webchat-fluent .Q{align-items:center;display:flex;padding-inline-start:4px}.webchat-fluent .Y{color:var(--webchat-colorNeutralForeground4);cursor:default;font-family:var(--webchat-fontFamilyNumeric);font-size:10px;line-height:14px;margin-inline-end:4px}.webchat-fluent .Z{color:var(--webchat-colorStatusDangerForeground1)}.webchat-fluent.i{display:contents;--webchat-colorNeutralForeground1: var(--colorNeutralForeground1, #242424);--webchat-colorNeutralForeground2: var(--colorNeutralForeground2, #424242);--webchat-colorNeutralForeground4: var(--colorNeutralForeground4, #707070);--webchat-colorNeutralForeground2BrandHover: var(--colorNeutralForeground2BrandHover, #02729c);--webchat-colorNeutralForeground2BrandPressed: var(--colorNeutralForeground2BrandPressed, #01678c);--webchat-colorNeutralForeground2BrandSelected: var(--colorNeutralForeground2BrandSelected, #067191);--webchat-colorNeutralForegroundDisabled: var(--colorNeutralForegroundDisabled, #bdbdbd);--webchat-colorNeutralBackground1: var(--colorNeutralBackground1, #ffffff);--webchat-colorNeutralBackground4: var(--colorNeutralBackground4, #f0f0f0);--webchat-colorNeutralBackground5: var(--colorNeutralBackground5, #ebebeb);--webchat-colorNeutralBackground1Disabled: var(--colorNeutralBackground1Disabled, #f0f0f0);--webchat-colorNeutralBackground1Pressed: var(--colorNeutralBackground1Pressed, #e0e0e0);--webchat-colorNeutralGrey94: var(--colorNeutralGrey94, #f0f0f0);--webchat-colorNeutralStroke1: var(--colorNeutralStroke1, #d1d1d1);--webchat-colorNeutralStroke2: var(--colorNeutralStroke2, #e0e0e0);--webchat-colorNeutralStroke1Selected: var(--colorNeutralStroke1Selected, #bdbdbd);--webchat-colorStrokeFocus2: var(--colorStrokeFocus2, #000000);--webchat-colorBrandStroke2: var(--colorBrandStroke2, #9edcf7);--webchat-colorBrandForeground2Hover: var(--colorBrandForeground2Hover, #015a7a);--webchat-colorBrandForeground2Pressed: var(--colorBrandForeground2Pressed, #01384d);--webchat-colorBrandForegroundLink: var(--colorBrandForegroundLink, #01678c);--webchat-colorBrandForegroundLinkHover: var(--colorBrandForegroundLinkHover, #015a7a);--webchat-colorBrandForegroundLinkPressed: var(--colorBrandForegroundLinkPressed, #014259);--webchat-colorBrandForegroundLinkSelected: var(--colorBrandForegroundLinkSelected, #01678c);--webchat-colorBrandBackground2Hover: var(--colorBrandBackground2Hover, #bee7fa);--webchat-colorBrandBackground2Pressed: var(--colorBrandBackground2Pressed, #7fd2f5);--webchat-colorCompoundBrandForeground1Hover: var(--colorCompoundBrandForeground1Hover, #02729c);--webchat-colorStatusDangerForeground1: var(--colorStatusDangerForeground1, #b10e1c);--webchat-colorGray30: var(--colorGray30, #edebe9);--webchat-colorGray160: var(--colorGray160, #323130);--webchat-colorGray190: var(--colorGray190, #201f1e);--webchat-colorGray200: var(--colorGray200, #1b1a19);--webchat-borderRadiusSmall: var(--borderRadiusSmall, 2px);--webchat-borderRadiusLarge: var(--borderRadiusLarge, 6px);--webchat-borderRadiusXLarge: var(--borderRadiusXLarge, 8px);--webchat-shadow16: var(--shadow16, 0 6.4px 14.4px 0 rgba(0, 0, 0, .132), 0 1.2px 3.6px 0 rgba(0, 0, 0, .108));--webchat-spacingHorizontalMNudge: var(--spacingHorizontalMNudge, 10px);--webchat-spacingHorizontalM: var(--spacingHorizontalM, 12px);--webchat-spacingHorizontalXXXL: var(--spacingHorizontalXXXL, 32px);--webchat-spacingVerticalL: var(--spacingVerticalL, 16px);--webchat-fontFamilyBase: var(--fontFamilyBase, \"Segoe UI\", \"Segoe UI Web (West European)\", -apple-system, BlinkMacSystemFont, Roboto, \"Helvetica Neue\", sans-serif);--webchat-fontFamilyNumeric: var(--fontFamilyNumeric, Bahnschrift, \"Segoe UI\", \"Segoe UI Web (West European)\", -apple-system, BlinkMacSystemFont, Roboto, \"Helvetica Neue\", sans-serif);--webchat-fontWeightRegular: var(--fontWeightRegular, 400);--webchat-fontWeightSemibold: var(--fontWeightSemibold, 600);--webchat-fontSizeBase300: var(--fontSizeBase300, 14px);--webchat-fontSizeHero700: var(--fontSizeHero700, 28px);--webchat-lineHeightBase300: var(--lineHeightBase300, 20px);--webchat-lineHeightHero700: var(--lineHeightHero700, 36px);--webchat-strokeWidthThicker: var(--strokeWidthThicker, 3px);--webchat-durationUltraFast: var(--durationUltraFast, 0);--webchat-durationNormal: var(--durationNormal, .2s);--webchat-curveAccelerateMid: var(--curveAccelerateMid, cubic-bezier(1,0,1,1));--webchat-curveDecelerateMid: var(--curveDecelerateMid, cubic-bezier(0,0,0,1));--webchat-shadow2: 0 0 2px rgba(0, 0, 0, 12%), 0 1px 2px rgba(0, 0, 0, 14%)}@media (prefers-reduced-motion){.webchat-fluent.i{--webchat-durationUltraFast: .01ms;--webchat-durationNormal: .01ms}}\n/*! For license information please see botframework-webchat-fluent-theme.css.LEGAL.txt */\n";function R(){if(globalThis.document){let e=document.createElement("style");e.append(document.createTextNode(Ft)),document.head.appendChild(e)}}import{useMemo as At}from"react";function Ht(e){return At(()=>Object.freeze(Object.fromEntries(Object.entries(e).map(([t,o])=>[t,`${t} ${o}`]))),[e])}var l=Ht;var Te={"pre-chat-message-activity":"d","pre-chat-message-activity__body":"r","pre-chat-message-activity__toolbar":"b"};import qt from"classnames";import V,{memo as Jt}from"react";import{hooks as Ot}from"botframework-webchat-component";import Ut from"classnames";import z,{memo as Wt,useCallback as Zt,useMemo as Xt}from"react";import{useRefFrom as jt}from"use-ref-from";import Dt from"classnames";import It,{memo as Rt,useMemo as zt}from"react";var _e={"pre-chat-message-activity__monochrome-image-masker":"u"};var Ne=({className:e,src:t})=>{let o=l(_e),r=zt(()=>({"--mask-image":`url(${t})`}),[t]);return It.createElement("div",{className:Dt(e,o["pre-chat-message-activity__monochrome-image-masker"]),style:r})};Ne.displayName="MonochromeImageMasker";var Be=Rt(Ne);var Se={"pre-chat-message-activity__card-action-box":"e","pre-chat-message-activity__card-action-image":"h","pre-chat-message-activity__card-action-subtitle":"g","pre-chat-message-activity__card-action-title":"s"};var{useFocus:Gt,useRenderMarkdownAsHTML:Vt,useSendBoxValue:$t}=Ot,Ce=({className:e,messageBackAction:t})=>{let[o,r]=$t(),a=l(Se),d=Gt(),c=jt(t.displayText||t.text||""),n=Vt("message activity"),u=Xt(()=>n?{__html:n(t.text||"")}:{__html:""},[t.text,n]),b=Zt(()=>{r(c.current),d("sendBox")},[d,c,r]);return z.createElement("button",{className:Ut(e,a["pre-chat-message-activity__card-action-box"]),onClick:b,type:"button"},z.createElement("div",{className:a["pre-chat-message-activity__card-action-title"]},"title"in t&&t.title),"image"in t&&t.image&&z.createElement(Be,{className:a["pre-chat-message-activity__card-action-image"],src:t.image}),z.createElement("div",{className:a["pre-chat-message-activity__card-action-subtitle"],dangerouslySetInnerHTML:u}))};Ce.displayName="StarterPromptAction";var Ee=Wt(Ce);var Me={"pre-chat-message-activity__card-action-toolbar":"w","webchat-container":"a","pre-chat-message-activity__card-action-toolbar-grid":"o"};var Fe=({cardActions:e,className:t})=>{let o=l(Me);return V.createElement("div",{className:qt(t,o["pre-chat-message-activity__card-action-toolbar"])},V.createElement("div",{className:o["pre-chat-message-activity__card-action-toolbar-grid"]},e.filter(r=>r.type==="messageBack").map(r=>V.createElement(Ee,{key:r.text,messageBackAction:r}))))};Fe.displayName="StarterPrompts";var Ae=Jt(Fe);var{useRenderMarkdownAsHTML:oo}=Qt,He=({activity:e})=>{let t=l(Te),o=oo(),r=to(()=>o?{__html:o(e.text||"")}:{__html:""},[e.text,o]);return $.createElement("div",{className:t["pre-chat-message-activity"]},$.createElement("div",{className:t["pre-chat-message-activity__body"],dangerouslySetInnerHTML:r}),$.createElement(Ae,{cardActions:e.suggestedActions?.actions||[],className:t["pre-chat-message-activity__toolbar"]}))};He.displayName="PreChatMessageActivity";var Y=eo(He);import{hooks as ga}from"botframework-webchat-component";import P from"classnames";import g,{memo as ya,useCallback as A,useRef as xa,useState as va}from"react";import{useRefFrom as vt}from"use-ref-from";import Le,{memo as ro}from"react";function ao(e){return Le.createElement("svg",{"aria-hidden":"true",className:e.className,height:"1em",viewBox:"0 0 20 20",width:"1em",xmlns:"http://www.w3.org/2000/svg"},Le.createElement("path",{d:"M6 2a2 2 0 0 0-2 2v5.2c.32-.08.66-.15 1-.18V4a1 1 0 0 1 1-1h4v3.5c0 .83.67 1.5 1.5 1.5H15v8a1 1 0 0 1-1 1h-3.6c-.18.36-.4.7-.66 1H14a2 2 0 0 0 2-2V7.41c0-.4-.16-.78-.44-1.06l-3.91-3.91A1.5 1.5 0 0 0 10.59 2H6Zm8.8 5h-3.3a.5.5 0 0 1-.5-.5V3.2L14.8 7ZM10 14.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Zm-4-2a.5.5 0 0 0-1 0V14H3.5a.5.5 0 0 0 0 1H5v1.5a.5.5 0 0 0 1 0V15h1.5a.5.5 0 0 0 0-1H6v-1.5Z",fill:"currentColor"}))}var q=ro(ao);import Pe,{memo as no}from"react";function so(e){return Pe.createElement("svg",{"aria-hidden":"true",className:e.className,height:"1em",viewBox:"0 0 20 20",width:"1em",xmlns:"http://www.w3.org/2000/svg"},Pe.createElement("path",{d:"m4.83 10.48 5.65-5.65a3 3 0 0 1 4.25 4.24L8 15.8a1.5 1.5 0 0 1-2.12-2.12l6-6.01a.5.5 0 1 0-.7-.71l-6 6.01a2.5 2.5 0 0 0 3.53 3.54l6.71-6.72a4 4 0 1 0-5.65-5.66L4.12 9.78a.5.5 0 0 0 .7.7Z",fill:"currentColor"}))}var J=no(so);import De,{memo as io}from"react";function lo(e){return De.createElement("svg",{"aria-hidden":"true",className:e.className,height:"1em",viewBox:"0 0 16 16",width:"1em",xmlns:"http://www.w3.org/2000/svg"},De.createElement("path",{d:"M8.5 7.5a.5.5 0 1 0-1 0v3a.5.5 0 0 0 1 0v-3Zm.25-2a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1ZM2 8a6 6 0 1 1 12 0A6 6 0 0 1 2 8Z",fill:"currentColor"}))}var Q=io(lo);import Ie,{memo as co}from"react";function uo(e){return Ie.createElement("svg",{"aria-hidden":"true",className:e.className,height:"1em",viewBox:"0 0 20 20",width:"1em",xmlns:"http://www.w3.org/2000/svg"},Ie.createElement("path",{d:"M2.18 2.11a.5.5 0 0 1 .54-.06l15 7.5a.5.5 0 0 1 0 .9l-15 7.5a.5.5 0 0 1-.7-.58L3.98 10 2.02 2.63a.5.5 0 0 1 .16-.52Zm2.7 8.39-1.61 6.06L16.38 10 3.27 3.44 4.88 9.5h6.62a.5.5 0 1 1 0 1H4.88Z",fill:"currentColor"}))}var ee=co(uo);import Re,{memo as mo}from"react";function po(e){return Re.createElement("svg",{"aria-hidden":"true",className:e.className,height:"1em",viewBox:"0 0 20 20",width:"1em",xmlns:"http://www.w3.org/2000/svg"},Re.createElement("path",{d:"M6 5.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm0 4a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5ZM7.25 12a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM10 5.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5ZM11.25 8a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM10 13.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5ZM11.25 16a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM14 5.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5ZM15.25 8a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM14 13.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z",fill:"currentColor"}))}var te=mo(po);var bo={sendBoxDropZone:"send box drop zone",sendBoxSendButton:"send box send button",sendBoxTextBox:"send box text area",sendBoxTelephoneKeypadButton1:"send box telephone keypad button 1",sendBoxTelephoneKeypadButton2:"send box telephone keypad button 2",sendBoxTelephoneKeypadButton3:"send box telephone keypad button 3",sendBoxTelephoneKeypadButton4:"send box telephone keypad button 4",sendBoxTelephoneKeypadButton5:"send box telephone keypad button 5",sendBoxTelephoneKeypadButton6:"send box telephone keypad button 6",sendBoxTelephoneKeypadButton7:"send box telephone keypad button 7",sendBoxTelephoneKeypadButton8:"send box telephone keypad button 8",sendBoxTelephoneKeypadButton9:"send box telephone keypad button 9",sendBoxTelephoneKeypadButton0:"send box telephone keypad button 0",sendBoxTelephoneKeypadButtonStar:"send box telephone keypad button star",sendBoxTelephoneKeypadButtonPound:"send box telephone keypad button pound",sendBoxTelephoneKeypadToolbarButton:"send box telephone keypad toolbar button",sendBoxUploadButton:"send box upload button"},m=bo;import{hooks as fo}from"botframework-webchat-component";import go from"classnames";import Ke,{memo as yo,useCallback as xo,useEffect as vo,useRef as wo,useState as ko}from"react";import{useRefFrom as To}from"use-ref-from";var ze={"sendbox__attachment-drop-zone":"p","sendbox__attachment-drop-zone--droppable":"f","sendbox__attachment-drop-zone-icon":"v"};var{useLocalizer:_o}=fo,No=e=>{e.preventDefault()},Oe=e=>!!e.dataTransfer?.types?.some(t=>t.toLowerCase()==="files");function Bo(e,t){let o=e.parentNode;for(;o;){if(o===t)return!0;o=o.parentNode}return!1}var Ue=e=>{let[t,o]=ko(!1),r=l(ze),a=wo(null),d=_o(),c=To(e.onFilesAdded);vo(()=>{let u=0,b=i=>{u++,Oe(i)&&o(a.current&&(i.target===a.current||i.target instanceof HTMLElement&&Bo(i.target,a.current))?"droppable":"visible")},s=()=>--u<=0&&o(!1);return document.addEventListener("dragenter",b,!1),document.addEventListener("dragleave",s,!1),()=>{document.removeEventListener("dragenter",b),document.removeEventListener("dragleave",s)}},[o]);let n=xo(u=>{u.preventDefault(),o(!1),Oe(u.nativeEvent)&&c.current([...u.dataTransfer.files])},[c,o]);return t?Ke.createElement("div",{className:go(r["sendbox__attachment-drop-zone"],{[r["sendbox__attachment-drop-zone--droppable"]]:t==="droppable"}),"data-testid":m.sendBoxDropZone,onDragOver:No,onDrop:n,ref:a},Ke.createElement(q,{className:r["sendbox__attachment-drop-zone-icon"]}),d("TEXT_INPUT_DROP_ZONE")):null};Ue.displayName="DropZone";var oe=yo(Ue);import{hooks as Qo}from"botframework-webchat-component";import er from"classnames";import L,{memo as tr,useCallback as or}from"react";function re(e){let{title:t}=e,{type:o,value:r}=e;return o==="messageBack"?t||e.displayText:t||(typeof r=="string"?r:JSON.stringify(r))}import So,{createContext as Co,memo as Eo,useCallback as F,useContext as Mo,useEffect as Fo,useMemo as Ao,useRef as ae}from"react";var We=Co({itemEffector:()=>{throw new Error("botframework-webchat-fluent-theme rovingFocus: no provider for RovingFocusContext.")}});function Ho(e){let t=ae(0),o=ae([]),r=F(({current:s},i)=>s&&(s.tabIndex=t.current===i?0:-1),[t]),a=F(s=>{let i;typeof s=="number"?i=s:i=s(t.current),i&&!o.current.at(i)?.current&&(i=0),t.current!==i&&(t.current=i,o.current.forEach((p,f)=>r(p,f)),o.current.at(i)?.current?.focus())},[r,o,t]),d=F(s=>{let{target:i}=s,p=o.current.findIndex(({current:f})=>f===i);p!==-1&&a(p)},[o,a]),c=F(s=>i=>{let p=!e.direction,f=/up|down/iu.test(s)&&e.direction==="vertical",T=/left|right/iu.test(s)&&e.direction==="horizontal",w=/right|down/iu.test(s),B=p||f||T?w?1:-1:0,k=o.current.map((S,E)=>E),_=k.indexOf(i)+B;return k.at(_)??0},[e.direction]),n=F(s=>{let{key:i}=s;switch(i){case"Up":case"ArrowUp":case"Left":case"ArrowLeft":case"Down":case"ArrowDown":case"Right":case"ArrowRight":a(c(i));break;case"Home":a(0);break;case"End":a(-1);break;case"Escape":e.onEscapeKey?.();break;default:return}s.preventDefault(),s.stopPropagation()},[a,c,e]),u=F((s,i)=>{let{current:p}=s;return o.current[Number(i)]=s,p.addEventListener("focus",d),p.addEventListener("keydown",n),r(s,i),()=>{p.removeEventListener("focus",d),p.removeEventListener("keydown",n),delete o.current[Number(i)]}},[d,n,r,o]),b=Ao(()=>({itemEffector:u}),[u]);return So.createElement(We.Provider,{value:b},e.children)}function Ze(e){let t=ae(null),{itemEffector:o}=Mo(We);return Fo(()=>o(t,e)),t}var Xe=Eo(Ho);import{hooks as Oo}from"botframework-webchat-component";import Uo from"classnames";import ne,{memo as Wo,useCallback as Zo}from"react";var je={"suggested-action":"x","suggested-action__image":"m"};import Po,{forwardRef as Do,memo as Io,useRef as Ro}from"react";var zo=e=>e.preventDefault(),Ko=Do(({"aria-hidden":e,children:t,disabled:o,onClick:r,tabIndex:a,...d},c)=>{let n=Ro(null);return Po.createElement("button",{"aria-disabled":o?"true":"false","aria-hidden":e,onClick:o?zo:r,ref:c||n,tabIndex:a,...o&&{"aria-disabled":"true",tabIndex:-1},...d,type:"button"},t)}),Ge=Io(Ko);var{useDisabled:Xo,useFocus:jo,usePerformCardAction:Go,useScrollToEnd:Vo,useStyleSet:$o,useSuggestedActions:Yo}=Oo;function qo({buttonText:e,className:t,displayText:o,image:r,imageAlt:a,itemIndex:d,text:c,type:n,value:u}){let[b,s]=Yo(),[{suggestedAction:i}]=$o(),[p]=Xo(),f=jo(),T=Ze(d),w=Go(),B=l(je),k=Vo(),_=Zo(({target:S})=>{(async function(){await f("sendBoxWithoutKeyboard"),w({displayText:o,text:c,type:n,value:u},{target:S}),n==="openUrl"&&s([]),k()})()},[o,f,w,k,s,c,n,u]);return ne.createElement(Ge,{className:Uo(B["suggested-action"],i+"",(t||"")+""),disabled:p,onClick:_,ref:T,type:"button"},r&&ne.createElement("img",{alt:a,className:B["suggested-action__image"],src:r}),ne.createElement("span",null,e))}var Ve=Wo(qo);var se={"suggested-actions":"k","suggested-actions--flow":"B","suggested-actions--stacked":"y"};var{useFocus:rr,useLocalizer:ar,useStyleOptions:nr,useStyleSet:sr,useSuggestedActions:ir}=Qo;function lr(e){let[{suggestedActionLayout:t}]=nr(),[{suggestedActions:o}]=sr(),r=l(se);return L.createElement("div",{"aria-label":e["aria-label"],"aria-live":"polite","aria-orientation":"vertical",className:er(r["suggested-actions"],o+"",{[r["suggested-actions--flow"]]:t==="flow",[r["suggested-actions--stacked"]]:t!=="flow"},e.className),role:"toolbar"},!!e.children&&!!L.Children.count(e.children)&&e.children)}function dr(){let e=l(se),t=ar(),[o,r,{activity:a}]=ir(),d=rr(),c=or(()=>{d("sendBox")},[d]),n=M(a)?[]:o.map((u,b)=>{let{displayText:s,image:i,imageAltText:p,text:f,type:T,value:w}=u;return o?.length?L.createElement(Ve,{buttonText:re(u),displayText:s,image:i,imageAlt:i&&(p||f),itemIndex:b,key:b,text:f,type:T,value:w}):null});return L.createElement(Xe,{onEscapeKey:c},L.createElement(lr,{"aria-label":t("SUGGESTED_ACTIONS_LABEL_ALT"),className:e["suggested-actions"]},n))}var ie=tr(dr);import ur,{memo as mr,useMemo as pr,useState as br}from"react";import{createContext as cr}from"react";var $e=cr(new Proxy({},{get(){throw new Error("botframework-webchat: This hook can only used under its corresponding <Provider>.")}}));$e.displayName="TelephoneKeypad.Context";var K=$e;var hr=mr(({children:e})=>{let[t,o]=br(!1),r=pr(()=>Object.freeze({setShown:o,shown:t}),[o,t]);return ur.createElement(K.Provider,{value:r},e)}),le=hr;import Er,{memo as Mr}from"react";import{Components as _r}from"botframework-webchat-component";import Nr from"classnames";import h,{memo as Qe,useCallback as v,useEffect as Br,useRef as Sr}from"react";import{useRefFrom as Je}from"use-ref-from";import de,{forwardRef as gr,memo as yr,useCallback as xr}from"react";import{useRefFrom as vr}from"use-ref-from";var Ye={"telephone-keypad__button":"t","telephone-keypad__button__ruby":"l","telephone-keypad__button__text":"c","telephone-keypad--horizontal":"F"};var qe=yr(gr(({button:e,"data-testid":t,onClick:o,ruby:r},a)=>{let d=l(Ye),c=vr(o),n=xr(()=>c.current?.(),[c]);return de.createElement("button",{className:d["telephone-keypad__button"],"data-testid":t,onClick:n,ref:a,type:"button"},de.createElement("span",{className:d["telephone-keypad__button__text"]},e==="*"?"\u2217":e),!!r&&de.createElement("ruby",{className:d["telephone-keypad__button__ruby"]},r))}));qe.displayName="TelephoneKeypad.Button";var x=qe;import{useContext as wr,useMemo as kr}from"react";function N(){let{setShown:e,shown:t}=wr(K);return kr(()=>Object.freeze([t,e]),[t,e])}var ce={"telephone-keypad":"N","telephone-keypad__box":"S","telephone-keypad__info-message":"z","telephone-keypad__info-message-link":"H"};var{LocalizedString:Cr}=_r,et=Qe(({children:e,isHorizontal:t})=>{let o=l(ce);return t?null:h.createElement("div",{className:o["telephone-keypad__box"]},e)});et.displayName="TelephoneKeypad:Orientation";var tt=Qe(({autoFocus:e,className:t,onButtonClick:o,isHorizontal:r})=>{let a=Je(e),d=l(ce),c=Sr(null),n=Je(o),[,u]=N(),b=v(()=>n.current?.("1"),[n]),s=v(()=>n.current?.("2"),[n]),i=v(()=>n.current?.("3"),[n]),p=v(()=>n.current?.("4"),[n]),f=v(()=>n.current?.("5"),[n]),T=v(()=>n.current?.("6"),[n]),w=v(()=>n.current?.("7"),[n]),B=v(()=>n.current?.("8"),[n]),k=v(()=>n.current?.("9"),[n]),_=v(()=>n.current?.("0"),[n]),S=v(()=>n.current?.("*"),[n]),E=v(()=>n.current?.("#"),[n]),X=v(j=>{j.key==="Escape"&&u(!1)},[u]);return Br(()=>{a.current&&c.current?.focus()},[a,c]),h.createElement("div",{className:Nr(d["telephone-keypad"],t),onKeyDown:X},h.createElement(et,{isHorizontal:r},h.createElement(x,{button:"1","data-testid":m.sendBoxTelephoneKeypadButton1,onClick:b,ref:c}),h.createElement(x,{button:"2","data-testid":m.sendBoxTelephoneKeypadButton2,onClick:s,ruby:"ABC"}),h.createElement(x,{button:"3","data-testid":m.sendBoxTelephoneKeypadButton3,onClick:i,ruby:"DEF"}),h.createElement(x,{button:"4","data-testid":m.sendBoxTelephoneKeypadButton4,onClick:p,ruby:"GHI"}),h.createElement(x,{button:"5","data-testid":m.sendBoxTelephoneKeypadButton5,onClick:f,ruby:"JKL"}),h.createElement(x,{button:"6","data-testid":m.sendBoxTelephoneKeypadButton6,onClick:T,ruby:"MNO"}),h.createElement(x,{button:"7","data-testid":m.sendBoxTelephoneKeypadButton7,onClick:w,ruby:"PQRS"}),h.createElement(x,{button:"8","data-testid":m.sendBoxTelephoneKeypadButton8,onClick:B,ruby:"TUV"}),h.createElement(x,{button:"9","data-testid":m.sendBoxTelephoneKeypadButton9,onClick:k,ruby:"WXYZ"}),h.createElement(x,{button:"*","data-testid":m.sendBoxTelephoneKeypadButtonStar,onClick:S}),h.createElement(x,{button:"0","data-testid":m.sendBoxTelephoneKeypadButton0,onClick:_,ruby:"+"}),h.createElement(x,{button:"#","data-testid":m.sendBoxTelephoneKeypadButtonPound,onClick:E})),h.createElement("div",{className:d["telephone-keypad__info-message"]},h.createElement(Q,null),h.createElement(Cr,{linkClassName:d["telephone-keypad__info-message-link"],stringIds:"TELEPHONE_KEYPAD_INPUT_MESSAGE"})))});tt.displayName="TelephoneKeypad";var ot=tt;var rt=Mr(e=>N()[0]?Er.createElement(ot,{...e}):null);rt.displayName="TelephoneKeypad.Surrogate";var ue=rt;import{hooks as Lr}from"botframework-webchat-component";import U,{useCallback as nt,useRef as Pr,memo as Dr}from"react";import{useRefFrom as Ir}from"use-ref-from";import me from"classnames";import pe,{memo as be}from"react";var O={sendbox__toolbar:"L","sendbox__toolbar-button":"W","sendbox__toolbar-button--selected":"R","sendbox__toolbar-separator":"P"};var Ar=e=>e.preventDefault(),C=be(e=>{let t=l(O);return pe.createElement("button",{"aria-label":e["aria-label"],className:me(t["sendbox__toolbar-button"],e.className,{[t["sendbox__toolbar-button--selected"]]:e.selected}),"data-testid":e["data-testid"],onClick:e.disabled?Ar:e.onClick,type:e.type==="submit"?"submit":"button",...e.disabled&&{"aria-disabled":"true",tabIndex:-1}},e.children)});C.displayName="ToolbarButton";var he=be(e=>{let t=l(O);return pe.createElement("div",{className:me(t.sendbox__toolbar,e.className)},e.children)});he.displayName="Toolbar";var fe=be(e=>{let t=l(O);return pe.createElement("div",{"aria-orientation":"vertical",className:me(t["sendbox__toolbar-separator"],e.className),role:"separator"})});fe.displayName="ToolbarSeparator";var at={"sendbox__add-attachment":"X","sendbox__add-attachment-input":"G"};var{useLocalizer:Rr,useStyleOptions:zr}=Lr;function Kr(e){let t=Pr(null),o=l(at),r=Rr(),[{uploadAccept:a,uploadMultiple:d}]=zr(),c=Ir(e.onFilesAdded),n=nt(()=>t.current?.click(),[t]),u=nt(({target:{files:b}})=>{b&&(c.current?.([...b]),t.current&&(t.current.value=""))},[t,c]);return U.createElement("div",{className:o["sendbox__add-attachment"]},U.createElement("input",{accept:a,"aria-disabled":e.disabled,"aria-hidden":"true",className:o["sendbox__add-attachment-input"],multiple:d,onInput:e.disabled?void 0:u,readOnly:e.disabled,ref:t,role:"button",tabIndex:-1,type:"file"}),U.createElement(C,{"aria-label":r("TEXT_INPUT_UPLOAD_BUTTON_ALT"),"data-testid":m.sendBoxUploadButton,onClick:n},U.createElement(J,null)))}var st=Dr(Kr);import{hooks as Ur}from"botframework-webchat-component";import Wr,{memo as Zr}from"react";import Xr from"classnames";var it={sendbox__attachment:"D"};var{useLocalizer:jr}=Ur,Gr={one:"TEXT_INPUT_ATTACHMENTS_ONE",two:"TEXT_INPUT_ATTACHMENTS_TWO",few:"TEXT_INPUT_ATTACHMENTS_FEW",many:"TEXT_INPUT_ATTACHMENTS_MANY",other:"TEXT_INPUT_ATTACHMENTS_OTHER"};function Vr({attachments:e,className:t}){let o=l(it),r=jr({plural:!0});return e.length?Wr.createElement("div",{className:Xr(o.sendbox__attachment,t)},r(Gr,e.length)):null}var lt=Zr(Vr);import Yr,{memo as qr}from"react";var dt={"sendbox__error-message":"M"};function Jr(e){let t=l(dt);return Yr.createElement("span",{className:t["sendbox__error-message"],id:e.id,role:"alert"},e.error)}var ct=qr(Jr);import ut,{memo as Qr,useCallback as ea}from"react";import{hooks as ta}from"botframework-webchat-component";var{useLocalizer:oa}=ta,mt=Qr(()=>{let[e,t]=N(),o=oa(),r=ea(()=>t(a=>!a),[t]);return ut.createElement(C,{"aria-label":o("TEXT_INPUT_TELEPHONE_KEYPAD_BUTTON_ALT"),"data-testid":m.sendBoxTelephoneKeypadToolbarButton,onClick:r,selected:e},ut.createElement(te,null))});mt.displayName="SendBox.TelephoneKeypadToolbarButton";var pt=mt;import ge from"classnames";import ye,{forwardRef as aa,useCallback as na}from"react";var bt={"sendbox__text-area":"U","sendbox__text-area--hidden":"C","sendbox__text-area-shared":"j","sendbox__text-area-doppelganger":"T","sendbox__text-area-input":"I","sendbox__text-area-input--scroll":"A"};var ht=aa((e,t)=>{let o=l(bt),r=na(a=>{!a.shiftKey&&a.key==="Enter"&&(a.preventDefault(),"form"in a.target&&a.target.form instanceof HTMLFormElement&&a.target?.form?.requestSubmit())},[]);return ye.createElement("div",{className:ge(o["sendbox__text-area"],{[o["sendbox__text-area--hidden"]]:e.hidden},e.className),role:e.hidden?"hidden":void 0},ye.createElement("div",{className:ge(o["sendbox__text-area-doppelganger"],o["sendbox__text-area-shared"],o["sendbox__text-area-input--scroll"])},e.value||e.placeholder," "),ye.createElement("textarea",{"aria-label":e["aria-label"],className:ge(o["sendbox__text-area-input"],o["sendbox__text-area-shared"],o["sendbox__text-area-input--scroll"]),"data-testid":e["data-testid"],onInput:e.onInput,onKeyDown:r,placeholder:e.placeholder,ref:t,rows:e.startRows??1,tabIndex:e.hidden?-1:void 0,value:e.value}))});ht.displayName="TextArea";var ft=ht;import{hooks as sa}from"botframework-webchat-component";import{useMemo as gt}from"react";import{useRefFrom as ia}from"use-ref-from";var{useConnectivityStatus:la,useLocalizer:da}=sa,ca=({attachments:e,message:t})=>{let[o]=la(),r=da(),a=ia(o!=="connected"&&o!=="reconnected"?"offline":!t&&!e.length?"empty":void 0),d=gt(()=>Object.freeze(new Map().set("empty",r("SEND_BOX_IS_EMPTY_TOOLTIP_ALT")).set("offline",r("CONNECTIVITY_STATUS_ALT_FATAL"))),[r]);return gt(()=>Object.freeze([a,a.current&&d.get(a.current)]),[d,a])},yt=ca;import{useMemo as ua}from"react";function xe(e){let t=ua(()=>Math.random().toString(36).substr(2,5),[]);return e=e?`${e}--`:"",`${e}${t}`}var xt={sendbox:"V",sendbox__sendbox:"E","sendbox__attachment--in-grid":"n","sendbox__text-area--in-grid":"q","sendbox__sendbox-controls--in-grid":"J","sendbox__telephone-keypad--in-grid":"K","sendbox__sendbox-text":"O","sendbox__sendbox-controls":"Q","sendbox__text-counter":"Y","sendbox__text-counter--error":"Z"};import{useCallback as pa}from"react";import{hooks as ba}from"botframework-webchat-component";var{useScrollDown:ha,useScrollUp:fa}=ba;function ve(){let e=ha(),t=fa();return pa(o=>{if(o.target instanceof HTMLTextAreaElement&&o.target.value)return;let{ctrlKey:r,metaKey:a,shiftKey:d}=o;if(r||a||d)return;let c=!0;switch(o.key){case"End":e({displacement:1/0});break;case"Home":t({displacement:1/0});break;case"PageDown":e();break;case"PageUp":t();break;default:c=!1;break}c&&(o.preventDefault(),o.stopPropagation())},[e,t])}var{useFocus:wa,useLocalizer:ka,useMakeThumbnail:Ta,useRegisterFocusSendBox:_a,useSendBoxAttachments:Na,useSendMessage:Ba,useStyleOptions:Sa}=ga;function Ca(e){let t=xa(null),[o,r]=va(""),[a,d]=Na(),[{hideTelephoneKeypadButton:c,hideUploadButton:n,maxMessageLength:u}]=Sa(),b=!!u&&o.length>u,s=l(xt),i=ka(),p=Ba(),f=Ta(),T=xe("sendbox__error-message-id"),[w,B]=yt({message:o,attachments:a}),[k]=N(),_=wa();_a(A(({noKeyboard:y,waitUntil:G})=>{t.current&&(y?G((async()=>{let H=t.current?.getAttribute("readonly");t.current?.setAttribute("readonly","true"),await new Promise(D=>setTimeout(D,0)),t.current?.focus(),typeof H!="string"?t.current?.removeAttribute("readonly"):t.current?.setAttribute("readonly",H)})()):t.current?.focus())},[t]));let S=vt(a),E=vt(o),X=A(y=>{"tabIndex"in y.target&&typeof y.target.tabIndex=="number"&&y.target.tabIndex>=0||_("sendBox")},[_]),j=A(y=>r(y.currentTarget.value),[r]),ke=A(async y=>{let G=Object.freeze(await Promise.all(y.map(H=>f(H).then(D=>Object.freeze({blob:H,...D&&{thumbnailURL:D}})))));d(G)},[f,d]),kt=A(y=>{y.preventDefault(),w.current!=="empty"&&!b&&(p(E.current,void 0,{attachments:S.current}),r(""),d([])),_("sendBox")},[S,E,p,d,r,b,w,_]),Tt=A(y=>p(`/DTMFKey ${y}`),[p]),_t=ve(),Nt={"aria-invalid":"false",...B&&{"aria-invalid":"true","aria-errormessage":T}};return g.createElement("form",{...Nt,className:P(s.sendbox,e.className),onSubmit:kt},g.createElement(ie,null),g.createElement("div",{className:P(s.sendbox__sendbox),onClickCapture:X,onKeyDown:_t},g.createElement(ft,{"aria-label":i(b?"TEXT_INPUT_LENGTH_EXCEEDED_ALT":"TEXT_INPUT_ALT"),className:P(s["sendbox__sendbox-text"],s["sendbox__text-area--in-grid"]),"data-testid":m.sendBoxTextBox,hidden:k,onInput:j,placeholder:e.placeholder??i("TEXT_INPUT_PLACEHOLDER"),ref:t,value:o}),g.createElement(ue,{autoFocus:!0,className:s["sendbox__telephone-keypad--in-grid"],isHorizontal:!1,onButtonClick:Tt}),g.createElement(lt,{attachments:a,className:s["sendbox__attachment--in-grid"]}),g.createElement("div",{className:P(s["sendbox__sendbox-controls"],s["sendbox__sendbox-controls--in-grid"])},!k&&u&&isFinite(u)&&g.createElement("div",{className:P(s["sendbox__text-counter"],{[s["sendbox__text-counter--error"]]:b})},`${o.length}/${u}`),g.createElement(he,null,!c&&g.createElement(pt,null),!n&&g.createElement(st,{onFilesAdded:ke}),g.createElement(fe,null),g.createElement(C,{"aria-label":i("TEXT_INPUT_SEND_BUTTON_ALT"),"data-testid":m.sendBoxSendButton,disabled:b||k,type:"submit"},g.createElement(ee,null)))),g.createElement(oe,{onFilesAdded:ke}),g.createElement(ct,{error:B,id:T})))}var we=ya(Ca);import Ma from"react";import Fa from"classnames";var wt={theme:"i"};var Aa="webchat-fluent";function W(e){let t=l(wt);return Ma.createElement("div",{className:Fa(Aa,t.theme)},e.children)}var{ThemeProvider:Pa}=Ha,Da=[()=>e=>(...t)=>{let o=t[0]?.activity;return o&&M(o)?()=>Z.createElement(Y,{activity:o}):e(...t)}],Ia=[()=>()=>()=>we],Ra=({children:e})=>Z.createElement(W,null,Z.createElement(le,null,Z.createElement(Pa,{activityMiddleware:Da,sendBoxMiddleware:Ia},e))),za=La(Ra);var Oa="tsup",Ua="esmodules",Wa="4.18.1-main.20240807.dfe788c",od={buildTool:Oa,moduleFormat:Ua,version:Wa};Ka("botframework-webchat:fluent-theme","version=4.18.1-main.20240807.dfe788c; build-tool=tsup; module-format=esmodules");R();export{za as FluentThemeProvider,od as buildInfo,m as testIds};
1
+ import{injectMetaTag as ja}from"inject-meta-tag";import{Components as Ka}from"botframework-webchat-component";import G,{memo as Ra}from"react";import{array as Ft,literal as K,object as Ht,safeParse as Lt,string as Pt}from"valibot";var Dt=Ht({"@context":K("https://schema.org"),"@id":K(""),"@type":K("Message"),keywords:Ft(Pt()),type:K("https://schema.org/Message")});function A(e){return e?.type!=="message"?!1:!!e.entities?.find(o=>Lt(Dt,o).success)?.keywords.includes("PreChatMessage")}import{hooks as so}from"botframework-webchat-component";import Y,{memo as io,useMemo as lo}from"react";var It=".webchat-fluent .d{display:grid;grid-template-areas:\"body\" \"toolbar\";grid-template-rows:auto auto;gap:var(--webchat-spacingHorizontalXXXL);padding:var(--webchat-spacingHorizontalXXXL)}.webchat-fluent .r{font-family:var(--webchat-fontFamilyBase);font-size:var(--webchat-fontSizeBase300);font-weight:var(--webchat-fontWeightRegular);grid-area:body;line-height:var(--webchat-lineHeightBase300);text-align:center}.webchat-fluent .r h2{color:var(--webchat-colorNeutralForeground1);font-family:inherit;font-weight:var(--webchat-fontWeightSemibold);font-size:var(--webchat-fontSizeHero700);line-height:var(--webchat-lineHeightHero700);margin:var(--webchat-spacingVerticalL) 0 0}.webchat-fluent .r img{border-radius:4px;height:64px}.webchat-fluent .b{grid-area:toolbar}.webchat-fluent .u{background-color:var(--webchat-colorNeutralForeground4);-webkit-mask-image:var(--mask-image);mask-image:var(--mask-image);--webkit-mask-image: var(--mask-image)}.webchat-fluent .e{-webkit-appearance:none;appearance:none;background-color:var(--webchat-colorNeutralBackground1);border:0;border-radius:16px;box-shadow:var(--webchat-shadow2);color:var(--webchat-colorNeutralForeground1);cursor:pointer;display:grid;gap:8px;grid-template-areas:\"image title\" \"image subtitle\";grid-template-columns:20px 1fr;grid-template-rows:auto 1fr;overflow:hidden;padding:16px 20px;text-align:left;-webkit-user-select:none;user-select:none}.webchat-fluent .e:disabled{background-color:var(--webchat-colorNeutralBackground1Disabled)}.webchat-fluent .e:hover{background-color:var(--webchat-colorNeutralGrey94)}.webchat-fluent .e:active{background-color:var(--webchat-colorNeutralBackground1Pressed)}.webchat-fluent .e:focus-visible{outline:solid 2px var(--webchat-colorStrokeFocus2);outline-offset:-2px}.webchat-fluent .h{grid-area:image;height:20px;width:20px}.webchat-fluent .g{font-family:var(--webchat-fontFamilyBase);font-size:14px;font-weight:var(--webchat-fontWeightRegular);grid-area:subtitle;line-height:20px;pointer-events:none}.webchat-fluent .s{font-family:var(--webchat-fontFamilyBase);font-size:14px;font-weight:var(--webchat-fontWeightSemibold);grid-area:title;line-height:20px}.webchat-fluent .w{container-name:a;container-type:inline-size}.webchat-fluent .o{display:grid;gap:var(--webchat-spacingHorizontalM);grid-template-columns:1fr 1fr 1fr;padding:0}@container a (width <= 480px){.webchat-fluent .o{grid-template-columns:1fr}}.webchat-fluent .p{background-color:var(--webchat-colorNeutralBackground4);border-radius:inherit;cursor:copy;display:grid;gap:8px;inset:0;place-content:center;place-items:center;position:absolute}.webchat-fluent .f{background-color:#e00;color:#fff}.webchat-fluent .v{height:36px;pointer-events:none;width:36px}.webchat-fluent .x{align-items:center;background:transparent;border-radius:8px;border:1px solid var(--webchat-colorBrandStroke2);color:currentColor;cursor:pointer;display:flex;font-size:12px;gap:4px;padding:4px 8px;text-align:start;transition:all .15s ease-out}@media (hover: hover){.webchat-fluent .x:not([aria-disabled=true]):hover{background-color:var(--webchat-colorBrandBackground2Hover);color:var(--webchat-colorBrandForeground2Hover)}}.webchat-fluent .x:not([aria-disabled=true]):active{background-color:var(--webchat-colorBrandBackground2Pressed);color:var(--webchat-colorBrandForeground2Pressed)}.webchat-fluent .x[aria-disabled=true]{color:var(--webchat-colorNeutralForegroundDisabled);cursor:not-allowed}.webchat-fluent .m{font-size:12px;height:1em;width:1em}.webchat-fluent .k{align-items:flex-end;align-self:flex-end;display:flex;flex-direction:column;gap:8px}.webchat-fluent .k:not(:empty){padding-block-end:8px;padding-inline-start:4px}.webchat-fluent .k.B{flex-direction:row;flex-wrap:wrap;justify-content:flex-end}.webchat-fluent .k.y{flex-direction:column}.webchat-fluent .t{-webkit-user-select:none;align-items:center;-webkit-appearance:none;appearance:none;background-color:#fff;border-radius:100%;border:solid 1px var(--webchat-colorNeutralStroke1);color:var(--webchat-colorGray200);font-weight:var(--webchat-fontWeightSemibold);cursor:pointer;display:flex;flex-direction:column;height:60px;opacity:.7;padding:0;position:relative;touch-action:none;user-select:none;width:60px}.webchat-fluent .t:hover{background-color:var(--webchat-colorGray30)}.webchat-fluent .l{color:var(--webchat-colorGray190);font-size:10px}.webchat-fluent .c{font-size:24px;margin-top:8px}.webchat-fluent .F .t{height:32px;justify-content:center;margin:8px 4px;width:32px}.webchat-fluent .F .l{display:none}.webchat-fluent .F .c{font-size:20px;margin-top:0}.webchat-fluent .N{align-items:center;background:var(--webchat-colorNeutralBackground1);border:none;border-radius:var(--webchat-borderRadiusXLarge);display:flex;flex-direction:column;font-family:var(--webchat-fontFamilyBase);justify-content:center}.webchat-fluent .S{box-sizing:border-box;display:grid;gap:16px;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(4,1fr);justify-items:center;padding:16px;width:100%}.webchat-fluent .z{align-items:center;color:var(--webchat-colorNeutralForeground4);display:flex;font-size:12px;gap:6px;margin-block-end:6px}.webchat-fluent .H{color:var(--webchat-colorBrandForegroundLink);text-decoration-color:transparent}.webchat-fluent .H:target{color:var(--webchat-colorBrandForegroundLinkSelected)}.webchat-fluent .H:hover{color:var(--webchat-colorBrandForegroundLinkHover);text-decoration:underline 1px currentColor}.webchat-fluent .H:active{color:var(--webchat-colorBrandForegroundLinkPressed)}.webchat-fluent .H:focus-visible{outline:none;text-decoration:underline 1px double var(--webchat-colorStrokeFocus2)}.webchat-fluent .L{display:flex;gap:4px;margin-inline-start:auto}.webchat-fluent .W{align-items:center;-webkit-appearance:none;appearance:none;aspect-ratio:1;background:transparent;border-radius:var(--webchat-borderRadiusSmall);border:none;color:currentColor;cursor:pointer;display:flex;justify-content:center;padding:3px;width:32px}.webchat-fluent .W>svg{font-size:20px;pointer-events:none}.webchat-fluent .W.R{color:var(--webchat-colorNeutralForeground2BrandSelected)}@media (hover: hover){.webchat-fluent .W:not([aria-disabled=true]):hover{color:var(--webchat-colorNeutralForeground2BrandHover)}}.webchat-fluent .W:not([aria-disabled=true]):active{color:var(--webchat-colorNeutralForeground2BrandPressed)}.webchat-fluent .W[aria-disabled=true]{color:var(--webchat-colorNeutralForegroundDisabled);cursor:not-allowed}.webchat-fluent .P{align-self:center;border-inline-end:1px solid var(--webchat-colorNeutralStroke2);height:28px}.webchat-fluent .P:is(:first-child,:last-child,:only-child){display:none}.webchat-fluent .X{display:grid}.webchat-fluent .G{font-size:0;height:0;opacity:0;width:1px}.webchat-fluent .D{border-radius:var(--webchat-borderRadiusLarge);border:1px solid var(--webchat-colorNeutralStroke1);cursor:default;padding:6px 8px;width:fit-content}.webchat-fluent .M{color:transparent;font-size:0;height:0;left:0;position:absolute;top:0;width:0}.webchat-fluent .U{color:var(--webchat-colorNeutralForeground1);font-family:var(--webchat-fontFamilyBase);padding:0 10px 10px;text-rendering:optimizeLegibility;--webchat-sendbox-attachment-area-active: ;--webchat-sendbox-border-radius: var(--webchat-borderRadiusLarge)}.webchat-fluent .C{background-color:var(--webchat-colorNeutralBackground1);border-radius:var(--webchat-sendbox-border-radius);border:1px solid var(--webchat-colorNeutralStroke1);display:grid;font-family:var(--webchat-fontFamilyBase);font-size:14px;gap:6px;grid-template:[telephone-keypad-start] \"text-area\" [telephone-keypad-end] var(--webchat-sendbox-attachment-area-active) \"controls\" / [telephone-keypad] 1fr;line-height:20px;padding:8px;position:relative}.webchat-fluent .C:has(.n){--webchat-sendbox-attachment-area-active: \"attachment\" }.webchat-fluent .C:focus-within{border-color:var(--webchat-colorNeutralStroke1Selected)}.webchat-fluent .C:after{border-bottom-left-radius:var(--webchat-sendbox-border-radius);border-bottom-right-radius:var(--webchat-sendbox-border-radius);border-bottom:var(--webchat-strokeWidthThicker) solid var(--webchat-colorCompoundBrandForeground1Hover);bottom:-1px;clip-path:inset(calc(100% - var(--webchat-strokeWidthThicker)) 50% 0 50%);content:\"\";height:var(--webchat-sendbox-border-radius);left:-1px;position:absolute;right:-1px;transition:clip-path var(--webchat-durationUltraFast) var(--webchat-curveAccelerateMid)}.webchat-fluent .C:focus-within:after{clip-path:inset(calc(100% - var(--webchat-strokeWidthThicker)) 0 0 0);transition:clip-path var(--webchat-durationNormal) var(--webchat-curveDecelerateMid)}.webchat-fluent .C>.j{grid-area:text-area}.webchat-fluent .C>.n{grid-area:attachment}.webchat-fluent .C>.T{grid-area:controls}.webchat-fluent .C>.I{grid-area:telephone-keypad}.webchat-fluent .A{background-color:transparent;border:none;flex:auto;font-family:var(--webchat-fontFamilyBase);font-size:14px;line-height:20px;outline:none;padding:4px 4px 0;resize:none}@media only screen and (hover: none) and (pointer: coarse){.webchat-fluent .A:focus-within{font-size:16px}}.webchat-fluent .V{align-items:center;display:flex;padding-inline-start:4px}.webchat-fluent .E{color:var(--webchat-colorNeutralForeground4);cursor:default;font-family:var(--webchat-fontFamilyNumeric);font-size:10px;line-height:14px;margin-inline-end:4px}.webchat-fluent .q{color:var(--webchat-colorStatusDangerForeground1)}.webchat-fluent .J{display:grid;grid-template-areas:\"main\";max-height:200px;overflow:hidden}.webchat-fluent .K{height:0;visibility:collapse}.webchat-fluent .O{border:none;font:inherit;grid-area:main;outline:inherit;overflow-wrap:anywhere;resize:inherit;scrollbar-gutter:stable}.webchat-fluent .Q{overflow:hidden;visibility:hidden;white-space:pre-wrap}.webchat-fluent .Y{background-color:inherit;color:currentColor;height:100%;padding:0}.webchat-fluent .Z{scrollbar-color:unset;scrollbar-width:unset;-moz-scrollbar-color:var(--webchat-colorNeutralBackground5) var(--webchat-colorNeutralForeground2);-moz-scrollbar-width:thin}.webchat-fluent .Z::-webkit-scrollbar{width:8px}.webchat-fluent .Z::-webkit-scrollbar-track{background-color:var(--webchat-colorNeutralBackground5);border-radius:16px}.webchat-fluent .Z::-webkit-scrollbar-thumb{background-color:var(--webchat-colorNeutralForeground2);border-radius:16px}.webchat-fluent .Z::-webkit-scrollbar-corner{background-color:var(--webchat-colorNeutralBackground5)}.webchat-fluent.i{display:contents;--webchat-colorNeutralForeground1: var(--colorNeutralForeground1, #242424);--webchat-colorNeutralForeground2: var(--colorNeutralForeground2, #424242);--webchat-colorNeutralForeground4: var(--colorNeutralForeground4, #707070);--webchat-colorNeutralForeground2BrandHover: var(--colorNeutralForeground2BrandHover, #02729c);--webchat-colorNeutralForeground2BrandPressed: var(--colorNeutralForeground2BrandPressed, #01678c);--webchat-colorNeutralForeground2BrandSelected: var(--colorNeutralForeground2BrandSelected, #067191);--webchat-colorNeutralForegroundDisabled: var(--colorNeutralForegroundDisabled, #bdbdbd);--webchat-colorNeutralBackground1: var(--colorNeutralBackground1, #ffffff);--webchat-colorNeutralBackground4: var(--colorNeutralBackground4, #f0f0f0);--webchat-colorNeutralBackground5: var(--colorNeutralBackground5, #ebebeb);--webchat-colorNeutralBackground1Disabled: var(--colorNeutralBackground1Disabled, #f0f0f0);--webchat-colorNeutralBackground1Pressed: var(--colorNeutralBackground1Pressed, #e0e0e0);--webchat-colorNeutralGrey94: var(--colorNeutralGrey94, #f0f0f0);--webchat-colorNeutralStroke1: var(--colorNeutralStroke1, #d1d1d1);--webchat-colorNeutralStroke2: var(--colorNeutralStroke2, #e0e0e0);--webchat-colorNeutralStroke1Selected: var(--colorNeutralStroke1Selected, #bdbdbd);--webchat-colorStrokeFocus2: var(--colorStrokeFocus2, #000000);--webchat-colorBrandStroke2: var(--colorBrandStroke2, #9edcf7);--webchat-colorBrandForeground2Hover: var(--colorBrandForeground2Hover, #015a7a);--webchat-colorBrandForeground2Pressed: var(--colorBrandForeground2Pressed, #01384d);--webchat-colorBrandForegroundLink: var(--colorBrandForegroundLink, #01678c);--webchat-colorBrandForegroundLinkHover: var(--colorBrandForegroundLinkHover, #015a7a);--webchat-colorBrandForegroundLinkPressed: var(--colorBrandForegroundLinkPressed, #014259);--webchat-colorBrandForegroundLinkSelected: var(--colorBrandForegroundLinkSelected, #01678c);--webchat-colorBrandBackground2Hover: var(--colorBrandBackground2Hover, #bee7fa);--webchat-colorBrandBackground2Pressed: var(--colorBrandBackground2Pressed, #7fd2f5);--webchat-colorCompoundBrandForeground1Hover: var(--colorCompoundBrandForeground1Hover, #02729c);--webchat-colorStatusDangerForeground1: var(--colorStatusDangerForeground1, #b10e1c);--webchat-colorGray30: var(--colorGray30, #edebe9);--webchat-colorGray160: var(--colorGray160, #323130);--webchat-colorGray190: var(--colorGray190, #201f1e);--webchat-colorGray200: var(--colorGray200, #1b1a19);--webchat-borderRadiusSmall: var(--borderRadiusSmall, 2px);--webchat-borderRadiusLarge: var(--borderRadiusLarge, 6px);--webchat-borderRadiusXLarge: var(--borderRadiusXLarge, 8px);--webchat-shadow16: var(--shadow16, 0 6.4px 14.4px 0 rgba(0, 0, 0, .132), 0 1.2px 3.6px 0 rgba(0, 0, 0, .108));--webchat-spacingHorizontalMNudge: var(--spacingHorizontalMNudge, 10px);--webchat-spacingHorizontalM: var(--spacingHorizontalM, 12px);--webchat-spacingHorizontalXXXL: var(--spacingHorizontalXXXL, 32px);--webchat-spacingVerticalL: var(--spacingVerticalL, 16px);--webchat-fontFamilyBase: var(--fontFamilyBase, \"Segoe UI\", \"Segoe UI Web (West European)\", -apple-system, BlinkMacSystemFont, Roboto, \"Helvetica Neue\", sans-serif);--webchat-fontFamilyNumeric: var(--fontFamilyNumeric, Bahnschrift, \"Segoe UI\", \"Segoe UI Web (West European)\", -apple-system, BlinkMacSystemFont, Roboto, \"Helvetica Neue\", sans-serif);--webchat-fontWeightRegular: var(--fontWeightRegular, 400);--webchat-fontWeightSemibold: var(--fontWeightSemibold, 600);--webchat-fontSizeBase300: var(--fontSizeBase300, 14px);--webchat-fontSizeHero700: var(--fontSizeHero700, 28px);--webchat-lineHeightBase300: var(--lineHeightBase300, 20px);--webchat-lineHeightHero700: var(--lineHeightHero700, 36px);--webchat-strokeWidthThicker: var(--strokeWidthThicker, 3px);--webchat-durationUltraFast: var(--durationUltraFast, 0);--webchat-durationNormal: var(--durationNormal, .2s);--webchat-curveAccelerateMid: var(--curveAccelerateMid, cubic-bezier(1,0,1,1));--webchat-curveDecelerateMid: var(--curveDecelerateMid, cubic-bezier(0,0,0,1));--webchat-shadow2: 0 0 2px rgba(0, 0, 0, 12%), 0 1px 2px rgba(0, 0, 0, 14%)}@media (prefers-reduced-motion){.webchat-fluent.i{--webchat-durationUltraFast: .01ms;--webchat-durationNormal: .01ms}}\n/*! For license information please see botframework-webchat-fluent-theme.css.LEGAL.txt */\n";function R(){if(globalThis.document){let e=document.createElement("style");e.append(document.createTextNode(It)),document.head.appendChild(e)}}import{useMemo as zt}from"react";function Kt(e){return zt(()=>Object.freeze(Object.fromEntries(Object.entries(e).map(([t,o])=>[t,`${t} ${o}`]))),[e])}var s=Kt;var Ne={"pre-chat-message-activity":"d","pre-chat-message-activity__body":"r","pre-chat-message-activity__toolbar":"b"};import ao from"classnames";import $,{memo as no}from"react";import{hooks as Vt}from"botframework-webchat-component";import $t from"classnames";import O,{memo as Yt,useCallback as qt,useMemo as Jt}from"react";import{useRefFrom as Qt}from"use-ref-from";var Ot={preChatMessageActivityStarterPromptsCardAction:"pre-chat message activity starter prompts card action",sendBoxDropZone:"send box drop zone",sendBoxSendButton:"send box send button",sendBoxTextBox:"send box text area",sendBoxTelephoneKeypadButton1:"send box telephone keypad button 1",sendBoxTelephoneKeypadButton2:"send box telephone keypad button 2",sendBoxTelephoneKeypadButton3:"send box telephone keypad button 3",sendBoxTelephoneKeypadButton4:"send box telephone keypad button 4",sendBoxTelephoneKeypadButton5:"send box telephone keypad button 5",sendBoxTelephoneKeypadButton6:"send box telephone keypad button 6",sendBoxTelephoneKeypadButton7:"send box telephone keypad button 7",sendBoxTelephoneKeypadButton8:"send box telephone keypad button 8",sendBoxTelephoneKeypadButton9:"send box telephone keypad button 9",sendBoxTelephoneKeypadButton0:"send box telephone keypad button 0",sendBoxTelephoneKeypadButtonStar:"send box telephone keypad button star",sendBoxTelephoneKeypadButtonPound:"send box telephone keypad button pound",sendBoxTelephoneKeypadToolbarButton:"send box telephone keypad toolbar button",sendBoxUploadButton:"send box upload button"},m=Ot;import Wt from"classnames";import Zt,{memo as Xt,useMemo as jt}from"react";var Be={"pre-chat-message-activity__monochrome-image-masker":"u"};var Se=({className:e,src:t})=>{let o=s(Be),r=jt(()=>({"--mask-image":`url(${t})`}),[t]);return Zt.createElement("div",{className:Wt(e,o["pre-chat-message-activity__monochrome-image-masker"]),style:r})};Se.displayName="MonochromeImageMasker";var Ce=Xt(Se);var Me={"pre-chat-message-activity__card-action-box":"e","pre-chat-message-activity__card-action-image":"h","pre-chat-message-activity__card-action-subtitle":"g","pre-chat-message-activity__card-action-title":"s"};var{useFocus:eo,useRenderMarkdownAsHTML:to,useSendBoxValue:oo}=Vt,Ee=({className:e,messageBackAction:t})=>{let[o,r]=oo(),n=s(Me),d=eo(),l=Qt(t.displayText||t.text||""),a=to("message activity"),u=Jt(()=>a?{__html:a(t.text||"")}:{__html:""},[t.text,a]),b=qt(()=>{r(l.current),d("sendBox")},[d,l,r]);return O.createElement("button",{className:$t(e,n["pre-chat-message-activity__card-action-box"]),"data-testid":m.preChatMessageActivityStarterPromptsCardAction,onClick:b,type:"button"},O.createElement("div",{className:n["pre-chat-message-activity__card-action-title"]},"title"in t&&t.title),"image"in t&&t.image&&O.createElement(Ce,{className:n["pre-chat-message-activity__card-action-image"],src:t.image}),O.createElement("div",{className:n["pre-chat-message-activity__card-action-subtitle"],dangerouslySetInnerHTML:u}))};Ee.displayName="StarterPromptAction";var Ae=Yt(Ee);var Fe={"pre-chat-message-activity__card-action-toolbar":"w","webchat-container":"a","pre-chat-message-activity__card-action-toolbar-grid":"o"};var He=({cardActions:e,className:t})=>{let o=s(Fe);return $.createElement("div",{className:ao(t,o["pre-chat-message-activity__card-action-toolbar"])},$.createElement("div",{className:o["pre-chat-message-activity__card-action-toolbar-grid"]},e.filter(r=>r.type==="messageBack").map(r=>$.createElement(Ae,{key:r.text,messageBackAction:r}))))};He.displayName="StarterPrompts";var Le=no(He);var{useRenderMarkdownAsHTML:co}=so,Pe=({activity:e})=>{let t=s(Ne),o=co(),r=lo(()=>o?{__html:o(e.text||"")}:{__html:""},[e.text,o]);return Y.createElement("div",{className:t["pre-chat-message-activity"]},Y.createElement("div",{className:t["pre-chat-message-activity__body"],dangerouslySetInnerHTML:r}),Y.createElement(Le,{cardActions:e.suggestedActions?.actions||[],className:t["pre-chat-message-activity__toolbar"]}))};Pe.displayName="PreChatMessageActivity";var q=io(Pe);import{hooks as Ta}from"botframework-webchat-component";import I from"classnames";import y,{memo as Tt,useCallback as H,useRef as _a,useState as Na}from"react";import{useRefFrom as kt}from"use-ref-from";import De,{memo as uo}from"react";function mo(e){return De.createElement("svg",{"aria-hidden":"true",className:e.className,height:"1em",viewBox:"0 0 20 20",width:"1em",xmlns:"http://www.w3.org/2000/svg"},De.createElement("path",{d:"M6 2a2 2 0 0 0-2 2v5.2c.32-.08.66-.15 1-.18V4a1 1 0 0 1 1-1h4v3.5c0 .83.67 1.5 1.5 1.5H15v8a1 1 0 0 1-1 1h-3.6c-.18.36-.4.7-.66 1H14a2 2 0 0 0 2-2V7.41c0-.4-.16-.78-.44-1.06l-3.91-3.91A1.5 1.5 0 0 0 10.59 2H6Zm8.8 5h-3.3a.5.5 0 0 1-.5-.5V3.2L14.8 7ZM10 14.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Zm-4-2a.5.5 0 0 0-1 0V14H3.5a.5.5 0 0 0 0 1H5v1.5a.5.5 0 0 0 1 0V15h1.5a.5.5 0 0 0 0-1H6v-1.5Z",fill:"currentColor"}))}var J=uo(mo);import Ie,{memo as po}from"react";function bo(e){return Ie.createElement("svg",{"aria-hidden":"true",className:e.className,height:"1em",viewBox:"0 0 20 20",width:"1em",xmlns:"http://www.w3.org/2000/svg"},Ie.createElement("path",{d:"m4.83 10.48 5.65-5.65a3 3 0 0 1 4.25 4.24L8 15.8a1.5 1.5 0 0 1-2.12-2.12l6-6.01a.5.5 0 1 0-.7-.71l-6 6.01a2.5 2.5 0 0 0 3.53 3.54l6.71-6.72a4 4 0 1 0-5.65-5.66L4.12 9.78a.5.5 0 0 0 .7.7Z",fill:"currentColor"}))}var Q=po(bo);import ze,{memo as ho}from"react";function fo(e){return ze.createElement("svg",{"aria-hidden":"true",className:e.className,height:"1em",viewBox:"0 0 16 16",width:"1em",xmlns:"http://www.w3.org/2000/svg"},ze.createElement("path",{d:"M8.5 7.5a.5.5 0 1 0-1 0v3a.5.5 0 0 0 1 0v-3Zm.25-2a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1ZM2 8a6 6 0 1 1 12 0A6 6 0 0 1 2 8Z",fill:"currentColor"}))}var ee=ho(fo);import Ke,{memo as go}from"react";function yo(e){return Ke.createElement("svg",{"aria-hidden":"true",className:e.className,height:"1em",viewBox:"0 0 20 20",width:"1em",xmlns:"http://www.w3.org/2000/svg"},Ke.createElement("path",{d:"M2.18 2.11a.5.5 0 0 1 .54-.06l15 7.5a.5.5 0 0 1 0 .9l-15 7.5a.5.5 0 0 1-.7-.58L3.98 10 2.02 2.63a.5.5 0 0 1 .16-.52Zm2.7 8.39-1.61 6.06L16.38 10 3.27 3.44 4.88 9.5h6.62a.5.5 0 1 1 0 1H4.88Z",fill:"currentColor"}))}var te=go(yo);import Re,{memo as xo}from"react";function vo(e){return Re.createElement("svg",{"aria-hidden":"true",className:e.className,height:"1em",viewBox:"0 0 20 20",width:"1em",xmlns:"http://www.w3.org/2000/svg"},Re.createElement("path",{d:"M6 5.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm0 4a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5ZM7.25 12a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM10 5.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5ZM11.25 8a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM10 13.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5ZM11.25 16a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM14 5.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5ZM15.25 8a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM14 13.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z",fill:"currentColor"}))}var oe=xo(vo);import{hooks as ko}from"botframework-webchat-component";import To from"classnames";import Ue,{memo as _o,useCallback as No,useEffect as Bo,useRef as So,useState as Co}from"react";import{useRefFrom as Mo}from"use-ref-from";var Oe={"sendbox__attachment-drop-zone":"p","sendbox__attachment-drop-zone--droppable":"f","sendbox__attachment-drop-zone-icon":"v"};var{useLocalizer:Eo}=ko,Ao=e=>{e.preventDefault()},We=e=>!!e.dataTransfer?.types?.some(t=>t.toLowerCase()==="files");function Fo(e,t){let o=e.parentNode;for(;o;){if(o===t)return!0;o=o.parentNode}return!1}var Ze=e=>{let[t,o]=Co(!1),r=s(Oe),n=So(null),d=Eo(),l=Mo(e.onFilesAdded);Bo(()=>{let u=0,b=i=>{u++,We(i)&&o(n.current&&(i.target===n.current||i.target instanceof HTMLElement&&Fo(i.target,n.current))?"droppable":"visible")},c=()=>--u<=0&&o(!1);return document.addEventListener("dragenter",b,!1),document.addEventListener("dragleave",c,!1),()=>{document.removeEventListener("dragenter",b),document.removeEventListener("dragleave",c)}},[o]);let a=No(u=>{u.preventDefault(),o(!1),We(u.nativeEvent)&&l.current([...u.dataTransfer.files])},[l,o]);return t?Ue.createElement("div",{className:To(r["sendbox__attachment-drop-zone"],{[r["sendbox__attachment-drop-zone--droppable"]]:t==="droppable"}),"data-testid":m.sendBoxDropZone,onDragOver:Ao,onDrop:a,ref:n},Ue.createElement(J,{className:r["sendbox__attachment-drop-zone-icon"]}),d("TEXT_INPUT_DROP_ZONE")):null};Ze.displayName="DropZone";var re=_o(Ze);import{hooks as nr}from"botframework-webchat-component";import sr from"classnames";import D,{memo as ir,useCallback as lr}from"react";function ae(e){let{title:t}=e,{type:o,value:r}=e;return o==="messageBack"?t||e.displayText:t||(typeof r=="string"?r:JSON.stringify(r))}import Ho,{createContext as Lo,memo as Po,useCallback as F,useContext as Do,useEffect as Io,useMemo as zo,useRef as ne}from"react";var Xe=Lo({itemEffector:()=>{throw new Error("botframework-webchat-fluent-theme rovingFocus: no provider for RovingFocusContext.")}});function Ko(e){let t=ne(0),o=ne([]),r=F(({current:c},i)=>c&&(c.tabIndex=t.current===i?0:-1),[t]),n=F(c=>{let i;typeof c=="number"?i=c:i=c(t.current),i&&!o.current.at(i)?.current&&(i=0),t.current!==i&&(t.current=i,o.current.forEach((p,h)=>r(p,h)),o.current.at(i)?.current?.focus())},[r,o,t]),d=F(c=>{let{target:i}=c,p=o.current.findIndex(({current:h})=>h===i);p!==-1&&n(p)},[o,n]),l=F(c=>i=>{let p=!e.direction,h=/up|down/iu.test(c)&&e.direction==="vertical",f=/left|right/iu.test(c)&&e.direction==="horizontal",x=/right|down/iu.test(c),T=p||h||f?x?1:-1:0,_=o.current.map((S,M)=>M),B=_.indexOf(i)+T;return _.at(B)??0},[e.direction]),a=F(c=>{let{key:i}=c;switch(i){case"Up":case"ArrowUp":case"Left":case"ArrowLeft":case"Down":case"ArrowDown":case"Right":case"ArrowRight":n(l(i));break;case"Home":n(0);break;case"End":n(-1);break;case"Escape":e.onEscapeKey?.();break;default:return}c.preventDefault(),c.stopPropagation()},[n,l,e]),u=F((c,i)=>{let{current:p}=c;return o.current[Number(i)]=c,p.addEventListener("focus",d),p.addEventListener("keydown",a),r(c,i),()=>{p.removeEventListener("focus",d),p.removeEventListener("keydown",a),delete o.current[Number(i)]}},[d,a,r,o]),b=zo(()=>({itemEffector:u}),[u]);return Ho.createElement(Xe.Provider,{value:b},e.children)}function je(e){let t=ne(null),{itemEffector:o}=Do(Xe);return Io(()=>o(t,e)),t}var Ge=Po(Ko);import{hooks as Go}from"botframework-webchat-component";import Vo from"classnames";import se,{memo as $o,useCallback as Yo}from"react";var Ve={"suggested-action":"x","suggested-action__image":"m"};import Oo,{forwardRef as Uo,memo as Wo,useRef as Zo}from"react";var Xo=e=>e.preventDefault(),jo=Uo(({"aria-hidden":e,children:t,disabled:o,onClick:r,tabIndex:n,...d},l)=>{let a=Zo(null);return Oo.createElement("button",{"aria-disabled":o?"true":"false","aria-hidden":e,onClick:o?Xo:r,ref:l||a,tabIndex:n,...o&&{"aria-disabled":"true",tabIndex:-1},...d,type:"button"},t)}),$e=Wo(jo);var{useDisabled:qo,useFocus:Jo,usePerformCardAction:Qo,useScrollToEnd:er,useStyleSet:tr,useSuggestedActions:or}=Go;function rr({buttonText:e,className:t,displayText:o,image:r,imageAlt:n,itemIndex:d,text:l,type:a,value:u}){let[b,c]=or(),[{suggestedAction:i}]=tr(),[p]=qo(),h=Jo(),f=je(d),x=Qo(),T=s(Ve),_=er(),B=Yo(({target:S})=>{(async function(){await h("sendBoxWithoutKeyboard"),x({displayText:o,text:l,type:a,value:u},{target:S}),a==="openUrl"&&c([]),_()})()},[o,h,x,_,c,l,a,u]);return se.createElement($e,{className:Vo(T["suggested-action"],i+"",(t||"")+""),disabled:p,onClick:B,ref:f,type:"button"},r&&se.createElement("img",{alt:n,className:T["suggested-action__image"],src:r}),se.createElement("span",null,e))}var Ye=$o(rr);var ie={"suggested-actions":"k","suggested-actions--flow":"B","suggested-actions--stacked":"y"};var{useFocus:dr,useLocalizer:cr,useStyleOptions:ur,useStyleSet:mr,useSuggestedActions:pr}=nr;function br(e){let[{suggestedActionLayout:t}]=ur(),[{suggestedActions:o}]=mr(),r=s(ie);return D.createElement("div",{"aria-label":e["aria-label"],"aria-live":"polite","aria-orientation":"vertical",className:sr(r["suggested-actions"],o+"",{[r["suggested-actions--flow"]]:t==="flow",[r["suggested-actions--stacked"]]:t!=="flow"},e.className),role:"toolbar"},!!e.children&&!!D.Children.count(e.children)&&e.children)}function hr(){let e=s(ie),t=cr(),[o,r,{activity:n}]=pr(),d=dr(),l=lr(()=>{d("sendBox")},[d]),a=A(n)?[]:o.map((u,b)=>{let{displayText:c,image:i,imageAltText:p,text:h,type:f,value:x}=u;return o?.length?D.createElement(Ye,{buttonText:ae(u),displayText:c,image:i,imageAlt:i&&(p||h),itemIndex:b,key:b,text:h,type:f,value:x}):null});return D.createElement(Ge,{onEscapeKey:l},D.createElement(br,{"aria-label":t("SUGGESTED_ACTIONS_LABEL_ALT"),className:e["suggested-actions"]},a))}var le=ir(hr);import gr,{memo as yr,useMemo as xr,useState as vr}from"react";import{createContext as fr}from"react";var qe=fr(new Proxy({},{get(){throw new Error("botframework-webchat: This hook can only used under its corresponding <Provider>.")}}));qe.displayName="TelephoneKeypad.Context";var U=qe;var wr=yr(({children:e})=>{let[t,o]=vr(!1),r=xr(()=>Object.freeze({setShown:o,shown:t}),[o,t]);return gr.createElement(U.Provider,{value:r},e)}),de=wr;import Pr,{memo as Dr}from"react";import{Components as Er}from"botframework-webchat-component";import Ar from"classnames";import g,{memo as tt,useCallback as k,useEffect as Fr,useRef as Hr}from"react";import{useRefFrom as et}from"use-ref-from";import ce,{forwardRef as Tr,memo as _r,useCallback as Nr}from"react";import{useRefFrom as Br}from"use-ref-from";var Je={"telephone-keypad__button":"t","telephone-keypad__button__ruby":"l","telephone-keypad__button__text":"c","telephone-keypad--horizontal":"F"};var Qe=_r(Tr(({button:e,"data-testid":t,onClick:o,ruby:r},n)=>{let d=s(Je),l=Br(o),a=Nr(()=>l.current?.(),[l]);return ce.createElement("button",{className:d["telephone-keypad__button"],"data-testid":t,onClick:a,ref:n,type:"button"},ce.createElement("span",{className:d["telephone-keypad__button__text"]},e==="*"?"\u2217":e),!!r&&ce.createElement("ruby",{className:d["telephone-keypad__button__ruby"]},r))}));Qe.displayName="TelephoneKeypad.Button";var w=Qe;import{useContext as Sr,useMemo as Cr}from"react";function N(){let{setShown:e,shown:t}=Sr(U);return Cr(()=>Object.freeze([t,e]),[t,e])}var ue={"telephone-keypad":"N","telephone-keypad__box":"S","telephone-keypad__info-message":"z","telephone-keypad__info-message-link":"H"};var{LocalizedString:Lr}=Er,ot=tt(({children:e,isHorizontal:t})=>{let o=s(ue);return t?null:g.createElement("div",{className:o["telephone-keypad__box"]},e)});ot.displayName="TelephoneKeypad:Orientation";var rt=tt(({autoFocus:e,className:t,onButtonClick:o,isHorizontal:r})=>{let n=et(e),d=s(ue),l=Hr(null),a=et(o),[,u]=N(),b=k(()=>a.current?.("1"),[a]),c=k(()=>a.current?.("2"),[a]),i=k(()=>a.current?.("3"),[a]),p=k(()=>a.current?.("4"),[a]),h=k(()=>a.current?.("5"),[a]),f=k(()=>a.current?.("6"),[a]),x=k(()=>a.current?.("7"),[a]),T=k(()=>a.current?.("8"),[a]),_=k(()=>a.current?.("9"),[a]),B=k(()=>a.current?.("0"),[a]),S=k(()=>a.current?.("*"),[a]),M=k(()=>a.current?.("#"),[a]),L=k(E=>{E.key==="Escape"&&u(!1)},[u]);return Fr(()=>{n.current&&l.current?.focus()},[n,l]),g.createElement("div",{className:Ar(d["telephone-keypad"],t),onKeyDown:L},g.createElement(ot,{isHorizontal:r},g.createElement(w,{button:"1","data-testid":m.sendBoxTelephoneKeypadButton1,onClick:b,ref:l}),g.createElement(w,{button:"2","data-testid":m.sendBoxTelephoneKeypadButton2,onClick:c,ruby:"ABC"}),g.createElement(w,{button:"3","data-testid":m.sendBoxTelephoneKeypadButton3,onClick:i,ruby:"DEF"}),g.createElement(w,{button:"4","data-testid":m.sendBoxTelephoneKeypadButton4,onClick:p,ruby:"GHI"}),g.createElement(w,{button:"5","data-testid":m.sendBoxTelephoneKeypadButton5,onClick:h,ruby:"JKL"}),g.createElement(w,{button:"6","data-testid":m.sendBoxTelephoneKeypadButton6,onClick:f,ruby:"MNO"}),g.createElement(w,{button:"7","data-testid":m.sendBoxTelephoneKeypadButton7,onClick:x,ruby:"PQRS"}),g.createElement(w,{button:"8","data-testid":m.sendBoxTelephoneKeypadButton8,onClick:T,ruby:"TUV"}),g.createElement(w,{button:"9","data-testid":m.sendBoxTelephoneKeypadButton9,onClick:_,ruby:"WXYZ"}),g.createElement(w,{button:"*","data-testid":m.sendBoxTelephoneKeypadButtonStar,onClick:S}),g.createElement(w,{button:"0","data-testid":m.sendBoxTelephoneKeypadButton0,onClick:B,ruby:"+"}),g.createElement(w,{button:"#","data-testid":m.sendBoxTelephoneKeypadButtonPound,onClick:M})),g.createElement("div",{className:d["telephone-keypad__info-message"]},g.createElement(ee,null),g.createElement(Lr,{linkClassName:d["telephone-keypad__info-message-link"],stringIds:"TELEPHONE_KEYPAD_INPUT_MESSAGE"})))});rt.displayName="TelephoneKeypad";var at=rt;var nt=Dr(e=>N()[0]?Pr.createElement(at,{...e}):null);nt.displayName="TelephoneKeypad.Surrogate";var me=nt;import{hooks as Rr}from"botframework-webchat-component";import Z,{useCallback as it,useRef as Or,memo as Ur}from"react";import{useRefFrom as Wr}from"use-ref-from";import pe from"classnames";import be,{memo as he}from"react";var W={sendbox__toolbar:"L","sendbox__toolbar-button":"W","sendbox__toolbar-button--selected":"R","sendbox__toolbar-separator":"P"};var zr=e=>e.preventDefault(),C=he(e=>{let t=s(W);return be.createElement("button",{"aria-label":e["aria-label"],className:pe(t["sendbox__toolbar-button"],e.className,{[t["sendbox__toolbar-button--selected"]]:e.selected}),"data-testid":e["data-testid"],onClick:e.disabled?zr:e.onClick,type:e.type==="submit"?"submit":"button",...e.disabled&&{"aria-disabled":"true",tabIndex:-1}},e.children)});C.displayName="ToolbarButton";var fe=he(e=>{let t=s(W);return be.createElement("div",{className:pe(t.sendbox__toolbar,e.className)},e.children)});fe.displayName="Toolbar";var ge=he(e=>{let t=s(W);return be.createElement("div",{"aria-orientation":"vertical",className:pe(t["sendbox__toolbar-separator"],e.className),role:"separator"})});ge.displayName="ToolbarSeparator";var st={"sendbox__add-attachment":"X","sendbox__add-attachment-input":"G"};var{useLocalizer:Zr,useStyleOptions:Xr}=Rr;function jr(e){let t=Or(null),o=s(st),r=Zr(),[{uploadAccept:n,uploadMultiple:d}]=Xr(),l=Wr(e.onFilesAdded),a=it(()=>t.current?.click(),[t]),u=it(({target:{files:b}})=>{b&&(l.current?.([...b]),t.current&&(t.current.value=""))},[t,l]);return Z.createElement("div",{className:o["sendbox__add-attachment"]},Z.createElement("input",{accept:n,"aria-disabled":e.disabled,"aria-hidden":"true",className:o["sendbox__add-attachment-input"],multiple:d,onInput:e.disabled?void 0:u,readOnly:e.disabled,ref:t,role:"button",tabIndex:-1,type:"file"}),Z.createElement(C,{"aria-label":r("TEXT_INPUT_UPLOAD_BUTTON_ALT"),"data-testid":m.sendBoxUploadButton,onClick:a},Z.createElement(Q,null)))}var lt=Ur(jr);import{hooks as Vr}from"botframework-webchat-component";import $r,{memo as Yr}from"react";import qr from"classnames";var dt={sendbox__attachment:"D"};var{useLocalizer:Jr}=Vr,Qr={one:"TEXT_INPUT_ATTACHMENTS_ONE",two:"TEXT_INPUT_ATTACHMENTS_TWO",few:"TEXT_INPUT_ATTACHMENTS_FEW",many:"TEXT_INPUT_ATTACHMENTS_MANY",other:"TEXT_INPUT_ATTACHMENTS_OTHER"};function ea({attachments:e,className:t}){let o=s(dt),r=Jr({plural:!0});return e.length?$r.createElement("div",{className:qr(o.sendbox__attachment,t)},r(Qr,e.length)):null}var ct=Yr(ea);import oa,{memo as ra}from"react";var ut={"sendbox__error-message":"M"};function aa(e){let t=s(ut);return oa.createElement("span",{className:t["sendbox__error-message"],id:e.id,role:"alert"},e.error)}var mt=ra(aa);import{hooks as na}from"botframework-webchat-component";import{useMemo as pt}from"react";import{useRefFrom as sa}from"use-ref-from";var{useConnectivityStatus:ia,useLocalizer:la}=na,da=({attachments:e,message:t})=>{let[o]=ia(),r=la(),n=sa(o!=="connected"&&o!=="reconnected"?"offline":!t&&!e.length?"empty":void 0),d=pt(()=>Object.freeze(new Map().set("empty",r("SEND_BOX_IS_EMPTY_TOOLTIP_ALT")).set("offline",r("CONNECTIVITY_STATUS_ALT_FATAL"))),[r]);return pt(()=>Object.freeze([n,n.current&&d.get(n.current)]),[d,n])},bt=da;import{useCallback as ca}from"react";import{hooks as ua}from"botframework-webchat-component";var{useScrollDown:ma,useScrollUp:pa}=ua;function ye(){let e=ma(),t=pa();return ca(o=>{if(o.target instanceof HTMLTextAreaElement&&o.target.value)return;let{ctrlKey:r,metaKey:n,shiftKey:d}=o;if(r||n||d)return;let l=!0;switch(o.key){case"End":e({displacement:1/0});break;case"Home":t({displacement:1/0});break;case"PageDown":e();break;case"PageUp":t();break;default:l=!1;break}l&&(o.preventDefault(),o.stopPropagation())},[e,t])}import{useMemo as ba}from"react";function xe(e){let t=ba(()=>Math.random().toString(36).substr(2,5),[]);return e=e?`${e}--`:"",`${e}${t}`}var ht={sendbox:"U",sendbox__sendbox:"C","sendbox__attachment--in-grid":"n","sendbox__text-area--in-grid":"j","sendbox__sendbox-controls--in-grid":"T","sendbox__telephone-keypad--in-grid":"I","sendbox__sendbox-text":"A","sendbox__sendbox-controls":"V","sendbox__text-counter":"E","sendbox__text-counter--error":"q"};import ft,{memo as fa,useCallback as ga}from"react";import{hooks as ya}from"botframework-webchat-component";var{useLocalizer:xa}=ya,gt=fa(()=>{let[e,t]=N(),o=xa(),r=ga(()=>t(n=>!n),[t]);return ft.createElement(C,{"aria-label":o("TEXT_INPUT_TELEPHONE_KEYPAD_BUTTON_ALT"),"data-testid":m.sendBoxTelephoneKeypadToolbarButton,onClick:r,selected:e},ft.createElement(oe,null))});gt.displayName="SendBox.TelephoneKeypadToolbarButton";var yt=gt;import ve from"classnames";import we,{forwardRef as wa,useCallback as ka}from"react";var xt={"sendbox__text-area":"J","sendbox__text-area--hidden":"K","sendbox__text-area-shared":"O","sendbox__text-area-doppelganger":"Q","sendbox__text-area-input":"Y","sendbox__text-area-input--scroll":"Z"};var vt=wa((e,t)=>{let o=s(xt),r=ka(n=>{!n.shiftKey&&n.key==="Enter"&&(n.preventDefault(),"form"in n.target&&n.target.form instanceof HTMLFormElement&&n.target?.form?.requestSubmit())},[]);return we.createElement("div",{className:ve(o["sendbox__text-area"],{[o["sendbox__text-area--hidden"]]:e.hidden},e.className),role:e.hidden?"hidden":void 0},we.createElement("div",{className:ve(o["sendbox__text-area-doppelganger"],o["sendbox__text-area-shared"],o["sendbox__text-area-input--scroll"])},e.value||e.placeholder," "),we.createElement("textarea",{"aria-label":e["aria-label"],className:ve(o["sendbox__text-area-input"],o["sendbox__text-area-shared"],o["sendbox__text-area-input--scroll"]),"data-testid":e["data-testid"],onInput:e.onInput,onKeyDown:r,placeholder:e.placeholder,ref:t,rows:e.startRows??1,tabIndex:e.hidden?-1:void 0,value:e.value}))});vt.displayName="TextArea";var wt=vt;var{useFocus:Ba,useLocalizer:Sa,useMakeThumbnail:Ca,useRegisterFocusSendBox:Ma,useSendBoxAttachments:Ea,useSendBoxValue:Aa,useSendMessage:Fa,useStyleOptions:Ha}=Ta;function _t(e){let t=_a(null),[o,r]=Na(""),[n,d]=Aa(),l=e.isPrimary?n:o,a=e.isPrimary?d:r,[u,b]=Ea(),[{hideTelephoneKeypadButton:c,hideUploadButton:i,maxMessageLength:p}]=Ha(),h=!!p&&l.length>p,f=s(ht),x=Sa(),T=Fa(),_=Ca(),B=xe("sendbox__error-message-id"),[S,M]=bt({message:l,attachments:u}),[L]=N(),E=Ba();Ma(H(({noKeyboard:v,waitUntil:V})=>{t.current&&(v?V((async()=>{let P=t.current?.getAttribute("readonly");t.current?.setAttribute("readonly","true"),await new Promise(z=>setTimeout(z,0)),t.current?.focus(),typeof P!="string"?t.current?.removeAttribute("readonly"):t.current?.setAttribute("readonly",P)})()):t.current?.focus())},[t]));let ke=kt(u),Te=kt(l),Bt=H(v=>{"tabIndex"in v.target&&typeof v.target.tabIndex=="number"&&v.target.tabIndex>=0||E("sendBox")},[E]),St=H(v=>a(v.currentTarget.value),[a]),_e=H(async v=>{let V=Object.freeze(await Promise.all(v.map(P=>_(P).then(z=>Object.freeze({blob:P,...z&&{thumbnailURL:z}})))));b(V)},[_,b]),Ct=H(v=>{v.preventDefault(),S.current!=="empty"&&!h&&(T(Te.current,void 0,{attachments:ke.current}),a(""),b([])),E("sendBox")},[ke,Te,T,b,a,h,S,E]),Mt=H(v=>T(`/DTMFKey ${v}`),[T]),Et=ye(),At={"aria-invalid":"false",...M&&{"aria-invalid":"true","aria-errormessage":B}};return y.createElement("form",{...At,className:I(f.sendbox,e.className),onSubmit:Ct},y.createElement(le,null),y.createElement("div",{className:I(f.sendbox__sendbox),onClickCapture:Bt,onKeyDown:Et},y.createElement(wt,{"aria-label":x(h?"TEXT_INPUT_LENGTH_EXCEEDED_ALT":"TEXT_INPUT_ALT"),className:I(f["sendbox__sendbox-text"],f["sendbox__text-area--in-grid"]),"data-testid":m.sendBoxTextBox,hidden:L,onInput:St,placeholder:e.placeholder??x("TEXT_INPUT_PLACEHOLDER"),ref:t,value:l}),y.createElement(me,{autoFocus:!0,className:f["sendbox__telephone-keypad--in-grid"],isHorizontal:!1,onButtonClick:Mt}),y.createElement(ct,{attachments:u,className:f["sendbox__attachment--in-grid"]}),y.createElement("div",{className:I(f["sendbox__sendbox-controls"],f["sendbox__sendbox-controls--in-grid"])},!L&&p&&isFinite(p)&&y.createElement("div",{className:I(f["sendbox__text-counter"],{[f["sendbox__text-counter--error"]]:h})},`${l.length}/${p}`),y.createElement(fe,null,!c&&y.createElement(yt,null),!i&&y.createElement(lt,{onFilesAdded:_e}),y.createElement(ge,null),y.createElement(C,{"aria-label":x("TEXT_INPUT_SEND_BUTTON_ALT"),"data-testid":m.sendBoxSendButton,disabled:h||L,type:"submit"},y.createElement(te,null)))),y.createElement(re,{onFilesAdded:_e}),y.createElement(mt,{error:M,id:B})))}var X=Tt(e=>y.createElement(_t,{...e,isPrimary:!0}));X.displayName="PrimarySendBox";var La=Tt(_t);import Da from"react";import Ia from"classnames";var Nt={theme:"i"};var za="webchat-fluent";function j(e){let t=s(Nt);return Da.createElement("div",{className:Ia(za,t.theme)},e.children)}var{ThemeProvider:Oa}=Ka,Ua=[()=>e=>(...t)=>{let o=t[0]?.activity;return o&&A(o)?()=>G.createElement(q,{activity:o}):e(...t)}],Wa=[()=>()=>()=>X],Za=({children:e})=>G.createElement(j,null,G.createElement(de,null,G.createElement(Oa,{activityMiddleware:Ua,sendBoxMiddleware:Wa},e))),Xa=Ra(Za);var Ga="tsup",Va="esmodules",$a="4.18.1-main.20240808.851825d",dd={buildTool:Ga,moduleFormat:Va,version:$a};ja("botframework-webchat:fluent-theme","version=4.18.1-main.20240808.851825d; build-tool=tsup; module-format=esmodules");R();export{Xa as FluentThemeProvider,dd as buildInfo,m as testIds};
2
2
  /*! For license information please see botframework-webchat-fluent-theme.mjs.LEGAL.txt */
3
3
  //# sourceMappingURL=botframework-webchat-fluent-theme.mjs.map