@askly/widget 3.1.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -294,6 +294,39 @@ or a self-hosted server older than this feature) the widget falls back to checki
294
294
  seconds while the chat is open, as before. If your site sets a Content Security Policy, the Askly
295
295
  API origin must be in `connect-src`.
296
296
 
297
+ ### History and delivery
298
+
299
+ The server keeps the record of a visitor's conversations; the browser's copy is a cache of it.
300
+ When the Messages tab opens, the widget fetches the list of the visitor's threads, so a signed-in
301
+ person (see [Identifying an authenticated user](#identifying-an-authenticated-user)) finds their
302
+ chats on a new browser or device, and a thread an agent has closed shows as closed. A thread's
303
+ messages are fetched when it is opened.
304
+
305
+ A message that could not be delivered (offline, or the server unreachable) is marked **Not sent**
306
+ with a **Retry** link; messages that failed for want of a network are sent again on their own
307
+ when it returns. Every message carries an id minted in the browser, so a retry can never produce
308
+ a duplicate: if the first attempt did reach the server, the retry gets the first attempt's answer.
309
+ A message that was still on its way when the page was closed shows as not sent on the next visit.
310
+
311
+ Writing into a closed conversation reopens it. Nothing to configure; these need an Askly server
312
+ from October 2026 or later, and degrade to the previous behaviour (local history only, no
313
+ delivery marks beyond the error) on an older one.
314
+
315
+ ### Attachments and feedback
316
+
317
+ Visitors can attach up to five files per message (10 MB each) with the paperclip, by dropping
318
+ them on the chat, or by pasting a screenshot into the message box. Files upload as soon as they
319
+ are picked and go with the message; images show as thumbnails, other files as a chip with name
320
+ and size. Executable and HTML-like types are refused by the server. A message may be attachments
321
+ only.
322
+
323
+ Every AI reply has thumbs up/down. The rating is saved on the message, so it follows the thread
324
+ into your inbox and back to the widget on another browser; a thumbs-down also asks, optionally,
325
+ what was wrong. Listen with `Askly.on("message:feedback", …)`.
326
+
327
+ Both need an Askly server from October 2026; the widget reads the server's `capabilities` and
328
+ falls back (a file as a link in the text, a rating kept locally) on an older one.
329
+
297
330
  ### Voice input
298
331
 
299
332
  Visitors can press the microphone button, speak, and have their words turned into a message. The
@@ -423,8 +456,11 @@ affect the widget.
423
456
  | :--- | :--- | :--- |
424
457
  | `ready` | `{ visitorId }` | The widget has mounted and applied its configuration. |
425
458
  | `open` / `close` | none | The panel was opened or closed. |
426
- | `message:sent` | `{ text, conversationId }` | The visitor sent a message. |
459
+ | `message:sent` | `{ text, conversationId, attachments? }` | The visitor sent a message. |
427
460
  | `message:received` | `{ text, conversationId, from, messageId }` | A reply arrived; `from` is `"ai"` or `"agent"`. |
461
+ | `message:feedback` | `{ conversationId, messageId?, rating, comment? }` | The visitor rated a reply (`rating` is `"up"`, `"down"` or `null` when withdrawn). |
462
+ | `message:failed` | `{ text, conversationId, status? }` | A message could not be delivered and is shown as not sent; `status` is the HTTP status, absent when offline. |
463
+ | `conversation:status` | `{ conversationId, status }` | A conversation became `"active"`, `"escalated"` (with your team) or `"resolved"` (closed). |
428
464
  | `unread` | `{ count }` | The number of unseen agent replies changed. |
429
465
  | `escalated` | `{ conversationId }` | The conversation was handed to a human. |
430
466
  | `lead:captured` | none | The visitor left an email address. |
@@ -0,0 +1 @@
1
+ import{g as e,t,v as a,H as r,f as m,P as n,X as c}from"./shared-keljZg37.js";function s({attachments:s,removeAttachment:o}){return e.createElement("ul",{className:"composer-attachments","aria-label":t(1===s.length?"attachments_summary_one":"attachments_summary_other",{count:m(s.length)})},s.map(s=>{const l=s.error?t("too-large"===s.error?"attachment_too_large":"rejected"===s.error?"attachment_rejected":"attachment_failed"):s.url?a(s.size,r()):t("attachment_uploading",{name:s.name,percent:m(s.progress)});return e.createElement("li",{key:s.id,className:"composer-attachment"+(s.error?" failed":s.url?" ready":" uploading")},s.previewUrl?e.createElement("img",{className:"composer-attachment-thumb",src:s.previewUrl,alt:""}):e.createElement("span",{className:"composer-attachment-icon","aria-hidden":"true"},e.createElement(n,{size:14})),e.createElement("span",{className:"composer-attachment-text"},e.createElement("span",{className:"composer-attachment-name"},s.name),e.createElement("span",{className:"composer-attachment-status",role:s.error?"alert":void 0},l)),!s.url&&!s.error&&e.createElement("span",{className:"composer-attachment-bar","aria-hidden":"true"},e.createElement("span",{style:{width:`${s.progress}%`}})),e.createElement("button",{type:"button",className:"composer-attachment-remove",onClick:()=>o(s.id),"aria-label":t("attachment_remove",{name:s.name}),title:t("attachment_remove",{name:s.name})},e.createElement(c,{size:12})))}))}export{s as AttachmentTray};
@@ -1 +1 @@
1
- import{g as e,t,n as l,b as a,o as c,aa as n,ab as s,C as r,d as i,f as o,B as m}from"./shared-Cp0FX5Ux.js";function p(e){switch(e){case"guide":return{title:t("help_collection_guide_title"),desc:t("help_collection_guide_desc")};case"faq":return{title:t("help_collection_faq_title"),desc:t("help_collection_faq_desc")};case"troubleshooting":return{title:t("help_collection_troubleshooting_title"),desc:t("help_collection_troubleshooting_desc")};default:return{title:t("help_collection_other_title"),desc:t("help_collection_other_desc")}}}function d(d){const{allArticles:h,articleFeedback:u,articlesLoading:E,handleSearchChange:_,handleSelectArticle:y,organizationLogo:f,organizationName:N,searchError:b,searchLoading:k,searchQuery:v,searchResults:g,selectedArticle:x,selectedCollection:w,setActiveTab:C,setArticleFeedback:z,setInput:S,setSelectedArticle:A,setSelectedCollection:L,themeColor:I}=d;return e.createElement("div",{className:"chat-body help-layout"},x?e.createElement("div",{className:"help-article-reader"},e.createElement("div",{className:"article-breadcrumb"},e.createElement("button",{type:"button",className:"article-breadcrumb-link",onClick:()=>{A(null),L(null)}},t("header_help_center")),e.createElement("span",{"aria-hidden":"true"},"/"),e.createElement("span",{className:"article-breadcrumb-type"},x.document_type?p(x.document_type.toLowerCase()).title:t("help_document_type_fallback"))),e.createElement("button",{type:"button",className:"help-back-btn",onClick:()=>A(null),style:{marginBottom:14}},e.createElement(l,{size:16,className:"askly-flip-rtl"}),e.createElement("span",null,t("help_back_to_articles"))),e.createElement("h1",{className:"help-article-heading",tabIndex:-1},x.title),e.createElement("div",{className:"article-author-bar"},e.createElement("img",{src:f||"https://askly.co.in/logo-small.png",alt:N,className:"article-author-avatar"}),e.createElement("div",{className:"article-author-text"},e.createElement("span",{className:"article-author-name"},t("help_written_by",{organizationName:N})),e.createElement("span",{className:"article-author-meta"},t("help_updated_recently")," • ",e.createElement("span",{"aria-hidden":"true"},"⏱ "),a("help_read_time",(q=x.content,Math.max(1,Math.ceil((q||"").split(/\s+/).length/180))))))),e.createElement("div",{className:"help-article-body",dangerouslySetInnerHTML:{__html:c(n(x.content))}}),e.createElement("div",{className:"article-feedback"},e.createElement("div",{className:"article-feedback-title"},t("help_feedback_title")),u[x.id]?e.createElement("div",{className:"article-feedback-thanks",role:"status"},e.createElement("span",{"aria-hidden":"true"},"🎉 "),t("help_feedback_thanks")):e.createElement("div",{className:"article-feedback-options"},e.createElement("button",{type:"button",className:"article-feedback-btn",onClick:()=>z(e=>({...e,[x.id]:"yes"}))},e.createElement("span",{"aria-hidden":"true"},"😃 "),t("help_feedback_yes")),e.createElement("button",{type:"button",className:"article-feedback-btn",onClick:()=>z(e=>({...e,[x.id]:"somewhat"}))},e.createElement("span",{"aria-hidden":"true"},"😐 "),t("help_feedback_somewhat")),e.createElement("button",{type:"button",className:"article-feedback-btn",onClick:()=>z(e=>({...e,[x.id]:"no"}))},e.createElement("span",{"aria-hidden":"true"},"😞 "),t("help_feedback_no"))),e.createElement("button",{type:"button",className:"article-handoff",onClick:()=>{S(t("help_handoff_prefill",{title:x.title})),C("messages")}},e.createElement("div",{className:"article-handoff-text"},e.createElement("span",{className:"article-handoff-title"},e.createElement(s,{size:13})," ",t("help_handoff_title")),e.createElement("span",{className:"article-handoff-desc"},t("help_handoff_desc"))),e.createElement(r,{size:16,className:"article-handoff-chevron askly-flip-rtl"})))):e.createElement("div",null,e.createElement("div",{className:"home-search-input-wrapper",style:{marginBottom:14}},e.createElement(i,{size:14,className:"search-icon-svg"}),e.createElement("input",{type:"text",value:v,onChange:_,placeholder:t("help_search_placeholder"),"aria-label":t("help_search_label")}),k&&e.createElement("span",{className:"search-loader"})),w&&e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12}},e.createElement("button",{type:"button",onClick:()=>L(null),style:{all:"unset",cursor:"pointer",fontSize:12,color:I,fontWeight:500,display:"flex",alignItems:"center",gap:4}},e.createElement(l,{size:14,className:"askly-flip-rtl"}),e.createElement("span",null,t("help_all_collections"))),e.createElement("span",{style:{fontSize:12,color:"var(--text-4)"},"aria-hidden":"true"},"/"),e.createElement("span",{style:{fontSize:12,fontWeight:600,color:"var(--text-1)",textTransform:"capitalize"}},p(w).title)),e.createElement("div",{className:"help-articles-list"},""===v.trim()?w?(()=>{const l=h.filter(e=>(e.document_type||"guide").toLowerCase()===w.toLowerCase());return e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:10,width:"100%"}},e.createElement("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-3)",textTransform:"uppercase",letterSpacing:"0.5px"}},t("help_collection_articles",{collection:p(w).title,count:o(l.length)})),e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:8}},l.map(t=>e.createElement("button",{type:"button",key:t.id,className:"help-article-row",onClick:()=>y(t)},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:3,alignItems:"flex-start",textAlign:"start"}},e.createElement("span",{className:"article-row-title"},t.title),t.content&&e.createElement("span",{className:"article-row-preview"},t.content.replace(/[\n\r]+/g," ").slice(0,85),"…")),e.createElement(r,{size:14,className:"article-row-chevron askly-flip-rtl"})))))})():e.createElement("div",{className:"help-collections"},(()=>{if(E)return[0,1,2].map(t=>e.createElement("div",{key:t,className:"help-collection-card is-skeleton"},e.createElement("div",{className:"help-collection-left"},e.createElement("span",{className:"askly-skeleton help-collection-icon-skel"}),e.createElement("div",{className:"help-collection-text"},e.createElement("span",{className:"askly-skeleton askly-skeleton-line",style:{width:"60%"}}),e.createElement("span",{className:"askly-skeleton askly-skeleton-line",style:{width:"90%"}})))));const l={};h.forEach(e=>{const t=(e.document_type||"guide").toLowerCase();l[t]||(l[t]=[]),l[t].push(e)});const c=Object.keys(l);return 0===c.length?e.createElement("div",{className:"askly-empty-state"},e.createElement("div",{className:"askly-empty-icon"},e.createElement(m,{size:22})),e.createElement("div",{className:"askly-empty-title"},t("help_empty_title")),e.createElement("div",{className:"askly-empty-desc"},t("help_empty_desc"))):c.map(t=>{const c=l[t],{title:n,desc:s}=p(t);return e.createElement("button",{type:"button",key:t,className:"help-collection-card",onClick:()=>L(t)},e.createElement("div",{className:"help-collection-left"},e.createElement("div",{className:"help-collection-icon"},e.createElement(m,{size:16})),e.createElement("div",{className:"help-collection-text"},e.createElement("div",{className:"help-collection-title"},n),e.createElement("div",{className:"help-collection-desc"},s),e.createElement("div",{className:"help-collection-count"},a("help_article_count",c.length)))),e.createElement(r,{size:16,className:"help-collection-chevron askly-flip-rtl"}))})})()):b?e.createElement("div",{className:"no-search-results"},b):0!==g.length||k?g.map(t=>e.createElement("button",{type:"button",key:t.id,className:"help-article-row",onClick:()=>y(t)},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:3,alignItems:"flex-start",textAlign:"start"}},e.createElement("span",{className:"article-row-title"},t.title),e.createElement("span",{className:"article-row-preview"},t.content.slice(0,80),"…")),e.createElement(r,{size:14,className:"article-row-chevron askly-flip-rtl"}))):e.createElement("div",{className:"no-search-results",role:"status"},t("help_search_no_results",{query:v})))));var q}export{d as HelpTab};
1
+ import{g as e,t,o as l,b as a,r as c,aj as n,ak as s,C as r,d as i,f as o,B as m}from"./shared-keljZg37.js";function p(e){switch(e){case"guide":return{title:t("help_collection_guide_title"),desc:t("help_collection_guide_desc")};case"faq":return{title:t("help_collection_faq_title"),desc:t("help_collection_faq_desc")};case"troubleshooting":return{title:t("help_collection_troubleshooting_title"),desc:t("help_collection_troubleshooting_desc")};default:return{title:t("help_collection_other_title"),desc:t("help_collection_other_desc")}}}function d(d){const{allArticles:h,articleFeedback:u,articlesLoading:E,handleSearchChange:_,handleSelectArticle:y,organizationLogo:f,organizationName:N,searchError:b,searchLoading:k,searchQuery:v,searchResults:g,selectedArticle:x,selectedCollection:w,setActiveTab:C,setArticleFeedback:z,setInput:S,setSelectedArticle:A,setSelectedCollection:L,themeColor:I}=d;return e.createElement("div",{className:"chat-body help-layout"},x?e.createElement("div",{className:"help-article-reader"},e.createElement("div",{className:"article-breadcrumb"},e.createElement("button",{type:"button",className:"article-breadcrumb-link",onClick:()=>{A(null),L(null)}},t("header_help_center")),e.createElement("span",{"aria-hidden":"true"},"/"),e.createElement("span",{className:"article-breadcrumb-type"},x.document_type?p(x.document_type.toLowerCase()).title:t("help_document_type_fallback"))),e.createElement("button",{type:"button",className:"help-back-btn",onClick:()=>A(null),style:{marginBottom:14}},e.createElement(l,{size:16,className:"askly-flip-rtl"}),e.createElement("span",null,t("help_back_to_articles"))),e.createElement("h1",{className:"help-article-heading",tabIndex:-1},x.title),e.createElement("div",{className:"article-author-bar"},e.createElement("img",{src:f||"https://askly.co.in/logo-small.png",alt:N,className:"article-author-avatar"}),e.createElement("div",{className:"article-author-text"},e.createElement("span",{className:"article-author-name"},t("help_written_by",{organizationName:N})),e.createElement("span",{className:"article-author-meta"},t("help_updated_recently")," • ",e.createElement("span",{"aria-hidden":"true"},"⏱ "),a("help_read_time",(q=x.content,Math.max(1,Math.ceil((q||"").split(/\s+/).length/180))))))),e.createElement("div",{className:"help-article-body",dangerouslySetInnerHTML:{__html:c(n(x.content))}}),e.createElement("div",{className:"article-feedback"},e.createElement("div",{className:"article-feedback-title"},t("help_feedback_title")),u[x.id]?e.createElement("div",{className:"article-feedback-thanks",role:"status"},e.createElement("span",{"aria-hidden":"true"},"🎉 "),t("help_feedback_thanks")):e.createElement("div",{className:"article-feedback-options"},e.createElement("button",{type:"button",className:"article-feedback-btn",onClick:()=>z(e=>({...e,[x.id]:"yes"}))},e.createElement("span",{"aria-hidden":"true"},"😃 "),t("help_feedback_yes")),e.createElement("button",{type:"button",className:"article-feedback-btn",onClick:()=>z(e=>({...e,[x.id]:"somewhat"}))},e.createElement("span",{"aria-hidden":"true"},"😐 "),t("help_feedback_somewhat")),e.createElement("button",{type:"button",className:"article-feedback-btn",onClick:()=>z(e=>({...e,[x.id]:"no"}))},e.createElement("span",{"aria-hidden":"true"},"😞 "),t("help_feedback_no"))),e.createElement("button",{type:"button",className:"article-handoff",onClick:()=>{S(t("help_handoff_prefill",{title:x.title})),C("messages")}},e.createElement("div",{className:"article-handoff-text"},e.createElement("span",{className:"article-handoff-title"},e.createElement(s,{size:13})," ",t("help_handoff_title")),e.createElement("span",{className:"article-handoff-desc"},t("help_handoff_desc"))),e.createElement(r,{size:16,className:"article-handoff-chevron askly-flip-rtl"})))):e.createElement("div",null,e.createElement("div",{className:"home-search-input-wrapper",style:{marginBottom:14}},e.createElement(i,{size:14,className:"search-icon-svg"}),e.createElement("input",{type:"text",value:v,onChange:_,placeholder:t("help_search_placeholder"),"aria-label":t("help_search_label")}),k&&e.createElement("span",{className:"search-loader"})),w&&e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12}},e.createElement("button",{type:"button",onClick:()=>L(null),style:{all:"unset",cursor:"pointer",fontSize:12,color:I,fontWeight:500,display:"flex",alignItems:"center",gap:4}},e.createElement(l,{size:14,className:"askly-flip-rtl"}),e.createElement("span",null,t("help_all_collections"))),e.createElement("span",{style:{fontSize:12,color:"var(--text-4)"},"aria-hidden":"true"},"/"),e.createElement("span",{style:{fontSize:12,fontWeight:600,color:"var(--text-1)",textTransform:"capitalize"}},p(w).title)),e.createElement("div",{className:"help-articles-list"},""===v.trim()?w?(()=>{const l=h.filter(e=>(e.document_type||"guide").toLowerCase()===w.toLowerCase());return e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:10,width:"100%"}},e.createElement("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-3)",textTransform:"uppercase",letterSpacing:"0.5px"}},t("help_collection_articles",{collection:p(w).title,count:o(l.length)})),e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:8}},l.map(t=>e.createElement("button",{type:"button",key:t.id,className:"help-article-row",onClick:()=>y(t)},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:3,alignItems:"flex-start",textAlign:"start"}},e.createElement("span",{className:"article-row-title"},t.title),t.content&&e.createElement("span",{className:"article-row-preview"},t.content.replace(/[\n\r]+/g," ").slice(0,85),"…")),e.createElement(r,{size:14,className:"article-row-chevron askly-flip-rtl"})))))})():e.createElement("div",{className:"help-collections"},(()=>{if(E)return[0,1,2].map(t=>e.createElement("div",{key:t,className:"help-collection-card is-skeleton"},e.createElement("div",{className:"help-collection-left"},e.createElement("span",{className:"askly-skeleton help-collection-icon-skel"}),e.createElement("div",{className:"help-collection-text"},e.createElement("span",{className:"askly-skeleton askly-skeleton-line",style:{width:"60%"}}),e.createElement("span",{className:"askly-skeleton askly-skeleton-line",style:{width:"90%"}})))));const l={};h.forEach(e=>{const t=(e.document_type||"guide").toLowerCase();l[t]||(l[t]=[]),l[t].push(e)});const c=Object.keys(l);return 0===c.length?e.createElement("div",{className:"askly-empty-state"},e.createElement("div",{className:"askly-empty-icon"},e.createElement(m,{size:22})),e.createElement("div",{className:"askly-empty-title"},t("help_empty_title")),e.createElement("div",{className:"askly-empty-desc"},t("help_empty_desc"))):c.map(t=>{const c=l[t],{title:n,desc:s}=p(t);return e.createElement("button",{type:"button",key:t,className:"help-collection-card",onClick:()=>L(t)},e.createElement("div",{className:"help-collection-left"},e.createElement("div",{className:"help-collection-icon"},e.createElement(m,{size:16})),e.createElement("div",{className:"help-collection-text"},e.createElement("div",{className:"help-collection-title"},n),e.createElement("div",{className:"help-collection-desc"},s),e.createElement("div",{className:"help-collection-count"},a("help_article_count",c.length)))),e.createElement(r,{size:16,className:"help-collection-chevron askly-flip-rtl"}))})})()):b?e.createElement("div",{className:"no-search-results"},b):0!==g.length||k?g.map(t=>e.createElement("button",{type:"button",key:t.id,className:"help-article-row",onClick:()=>y(t)},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:3,alignItems:"flex-start",textAlign:"start"}},e.createElement("span",{className:"article-row-title"},t.title),e.createElement("span",{className:"article-row-preview"},t.content.slice(0,80),"…")),e.createElement(r,{size:14,className:"article-row-chevron askly-flip-rtl"}))):e.createElement("div",{className:"no-search-results",role:"status"},t("help_search_no_results",{query:v})))));var q}export{d as HelpTab};
@@ -1 +1 @@
1
- import{x as e,y as t,t as a,b as s,g as n,f as c,X as l}from"./shared-Cp0FX5Ux.js";function i({phase:i,meterRef:o,maxMs:r,onStop:m,onCancel:v}){const[u,p]=e([]),[d,y]=e(0);t(()=>{if("recording"!==i)return;const e=setInterval(()=>{const{level:e,elapsedMs:t}=o.current;y(t),p(t=>(t.length>=80?t.slice(1):t).concat(e))},100);return()=>clearInterval(e)},[i]);const b="recording"===i,_=r-d,h=Math.max(0,Math.ceil(_/1e3)),k=b&&_<=1e4,E=a("transcribing"===i?"voice_status_transcribing":b?"voice_status_listening":"voice_status_waiting"),g=b&&_<=5e3?`${E} ${s("voice_seconds_left",h)}`:E;return n.createElement("div",{className:`askly-voice ${i}`},n.createElement("button",{type:"button",className:"askly-voice-btn",onClick:v,title:a("voice_cancel"),"aria-label":a("voice_cancel")},n.createElement(l,{size:20})),n.createElement("span",{className:"askly-voice-meter","aria-hidden":"true"},u.map((e,t)=>n.createElement("i",{key:t,style:{height:`${Math.round(2+22*Math.min(1,e))}px`}}))),n.createElement("span",{className:"askly-voice-status",role:"status"},g),k&&n.createElement("span",{className:"askly-voice-time","aria-hidden":"true"},a("voice_countdown",{count:c(h)})),b?n.createElement("button",{type:"button",className:"askly-voice-btn done",onClick:m,title:a("voice_stop"),"aria-label":a("voice_stop")},n.createElement("span",{className:"askly-voice-stop"})):n.createElement("span",{className:"askly-voice-btn done busy","aria-hidden":"true"},n.createElement("span",{className:"askly-voice-spinner"})))}export{i as VoiceRecorder};
1
+ import{p as e,q as t,t as a,b as s,g as n,f as c,X as l}from"./shared-keljZg37.js";function i({phase:i,meterRef:o,maxMs:r,onStop:m,onCancel:v}){const[u,p]=e([]),[d,y]=e(0);t(()=>{if("recording"!==i)return;const e=setInterval(()=>{const{level:e,elapsedMs:t}=o.current;y(t),p(t=>(t.length>=80?t.slice(1):t).concat(e))},100);return()=>clearInterval(e)},[i]);const b="recording"===i,_=r-d,h=Math.max(0,Math.ceil(_/1e3)),k=b&&_<=1e4,E=a("transcribing"===i?"voice_status_transcribing":b?"voice_status_listening":"voice_status_waiting"),g=b&&_<=5e3?`${E} ${s("voice_seconds_left",h)}`:E;return n.createElement("div",{className:`askly-voice ${i}`},n.createElement("button",{type:"button",className:"askly-voice-btn",onClick:v,title:a("voice_cancel"),"aria-label":a("voice_cancel")},n.createElement(l,{size:20})),n.createElement("span",{className:"askly-voice-meter","aria-hidden":"true"},u.map((e,t)=>n.createElement("i",{key:t,style:{height:`${Math.round(2+22*Math.min(1,e))}px`}}))),n.createElement("span",{className:"askly-voice-status",role:"status"},g),k&&n.createElement("span",{className:"askly-voice-time","aria-hidden":"true"},a("voice_countdown",{count:c(h)})),b?n.createElement("button",{type:"button",className:"askly-voice-btn done",onClick:m,title:a("voice_stop"),"aria-label":a("voice_stop")},n.createElement("span",{className:"askly-voice-stop"})):n.createElement("span",{className:"askly-voice-btn done busy","aria-hidden":"true"},n.createElement("span",{className:"askly-voice-spinner"})))}export{i as VoiceRecorder};
@@ -0,0 +1 @@
1
+ const e={launcher_open:"فتح محادثة الدعم",launcher_close:"إغلاق محادثة الدعم",launcher_open_unread_zero:"فتح محادثة الدعم، لا توجد رسائل جديدة",launcher_open_unread_one:"فتح محادثة الدعم، رسالة جديدة واحدة",launcher_open_unread_two:"فتح محادثة الدعم، رسالتان جديدتان",launcher_open_unread_few:"فتح محادثة الدعم، {count} رسائل جديدة",launcher_open_unread_many:"فتح محادثة الدعم، {count} رسالة جديدة",launcher_open_unread_other:"فتح محادثة الدعم، {count} رسالة جديدة",launcher_unread_overflow:"{count}+",panel_label:"دعم {organizationName}",header_messages:"الرسائل",header_help_center:"مركز المساعدة",header_back_to_conversations:"الرجوع إلى المحادثات",header_expand:"تكبير النافذة",header_collapse:"تصغير النافذة",header_close:"إغلاق",conversation_label:"محادثة",sending_to_team:"جارٍ الإرسال إلى الفريق…",uploading_attachment:"جارٍ رفع المرفق…",new_messages_zero:"لا توجد رسائل جديدة",new_messages_one:"رسالة جديدة واحدة",new_messages_two:"رسالتان جديدتان",new_messages_few:"{count} رسائل جديدة",new_messages_many:"{count} رسالة جديدة",new_messages_other:"{count} رسالة جديدة",reaction_helpful:"مفيد",reaction_not_helpful:"غير مفيد",copy_message:"نسخ الرسالة",copied:"تم النسخ",message_from_agent:"موظف الدعم",message_from_you:"أنت",terms_notice:"بالدردشة معنا، فإنك توافق على {terms}",terms_link:"الشروط",powered_by:"مدعوم من {brand}",tab_explore:"استكشاف",tab_messages:"الرسائل",tab_help:"المساعدة",tabs_label:"الأقسام",conversations_empty_title:"لا توجد محادثات بعد",conversations_empty_desc:"ابدأ محادثة وسيساعدك وكيل الذكاء الاصطناعي وفريقنا.",conversation_no_messages:"لا توجد رسائل بعد",conversation_title:"محادثة رقم {number}",start_new_chat:"اطرح سؤالًا",conversation_closed_chip:"مغلقة",message_not_sent:"لم تُرسل",message_retry:"إعادة الإرسال",conversation_closed:"تم إغلاق هذه المحادثة. أرسل رسالة لإعادة فتحها، أو ابدأ محادثة جديدة.",conversation_with_agent:"تم تحويل هذه المحادثة إلى فريقنا. قد يستغرق الرد وقتًا أطول قليلًا.",composer_label:"الرسالة",composer_placeholder:"اكتب رسالتك…",composer_placeholder_lead_required:"أضف بريدك الإلكتروني أعلاه للمتابعة…",composer_placeholder_security_check:"أكمل التحقق الأمني للدردشة…",composer_hint:"اضغط Enter للإرسال، وShift+Enter لسطر جديد",attach_file:"إرفاق ملف (10 ميغابايت كحد أقصى)",insert_emoji:"إدراج رمز تعبيري",emoji_picker_label:"اختر رمزًا تعبيريًا",send_message:"إرسال الرسالة",attachment_image_alt:"صورة مرفقة",attachment_file_label:"ملف مرفق: {name}",attachment_remove:"إزالة {name}",attachment_uploading:"جارٍ رفع {name}، {percent}%",attachment_too_large:"كبير جدًا (الحد 10 ميغابايت)",attachment_failed:"فشل الرفع",attachment_rejected:"نوع الملف غير مسموح",attachment_limit:"يمكنك إرفاق ما يصل إلى {count} ملفات في الرسالة الواحدة.",attachment_drop_hint:"أفلت الملفات لإرفاقها",attachment_open:"فتح {name}",attachments_summary_one:"{count} مرفق",attachments_summary_other:"{count} مرفقات",feedback_comment_prompt:"ما الخطأ؟ (اختياري)",feedback_comment_placeholder:"أخبرنا المزيد…",feedback_comment_send:"إرسال",feedback_comment_skip:"تخطٍ",feedback_thanks:"شكرًا على ملاحظاتك",notice_security_check_required:"يرجى إكمال التحقق الأمني أولًا.",voice_start:"إدخال صوتي",voice_finish:"إنهاء التسجيل",voice_status_waiting:"في انتظار الميكروفون…",voice_status_listening:"جارٍ الاستماع…",voice_status_transcribing:"جارٍ التحويل إلى نص…",voice_seconds_left_zero:"انتهى الوقت",voice_countdown:"{count} ث",voice_seconds_left_one:"ثانية واحدة متبقية",voice_seconds_left_two:"ثانيتان متبقيتان",voice_seconds_left_few:"{count} ثوانٍ متبقية",voice_seconds_left_many:"{count} ثانية متبقية",voice_seconds_left_other:"{count} ثانية متبقية",voice_cancel:"إلغاء الإدخال الصوتي",voice_stop:"إيقاف التسجيل وتحويله إلى نص",voice_retry:"حاول مرة أخرى",voice_error_insecure:"يتطلب الإدخال الصوتي صفحة آمنة (https).",voice_error_unsupported:"الإدخال الصوتي غير مدعوم في هذا المتصفح.",voice_error_denied:"الوصول إلى الميكروفون محظور. اسمح به من إعدادات الموقع في متصفحك لاستخدام الإدخال الصوتي.",voice_error_no_microphone:"لم يتم العثور على ميكروفون.",voice_error_no_speech:"لم نسمع ذلك جيدًا. يرجى المحاولة مرة أخرى.",voice_error_no_audio:"لا يصدر أي صوت من الميكروفون. تأكد من أنه غير مكتوم ومن اختيار الميكروفون الصحيح.",voice_error_limit:"الإدخال الصوتي غير متاح حاليًا. يرجى كتابة رسالتك.",voice_error_disabled:"الإدخال الصوتي معطَّل.",voice_error_network:"تعذّر تحويل تسجيلك إلى نص. تحقق من اتصالك وحاول مرة أخرى.",voice_error_failed:"تعذّر تحويل تسجيلك إلى نص. يرجى المحاولة مرة أخرى أو كتابة رسالتك.",lead_prompt:"اترك بريدك الإلكتروني وسنردّ عليك هناك إذا غادرت.",lead_email_placeholder:"you@example.com",lead_email_label:"بريدك الإلكتروني",lead_save:"حفظ",lead_saving:"جارٍ الحفظ…",lead_dismiss:"لا، شكرًا",lead_error_invalid_email:"لا يبدو هذا عنوان بريد إلكتروني صحيحًا.",lead_error_save_failed:"تعذّر الحفظ الآن. يمكنك متابعة المحادثة.",greeting_default:"مرحبًا من {organizationName}. كيف يمكننا مساعدتك؟",greeting_default_persona:"مرحبًا، أنا {ai_name} من {organizationName}. كيف يمكنني مساعدتك؟",greeting_dismiss:"إغلاق الترحيب",welcome_default:"مرحبًا! كيف يمكنني مساعدتك اليوم؟",explore_hero_title:"أهلًا بك",explore_hero_subtitle:"كيف يمكننا مساعدتك؟",explore_search_placeholder:"ابحث عن مساعدة…",explore_cta_title:"اسأل وكيل الذكاء الاصطناعي",explore_cta_sub:"إجابات فورية على مدار الساعة — أو تواصل مع الفريق",explore_tile_help_title:"مركز المساعدة",explore_tile_help_sub:"أدلة ومستندات",explore_tile_messages_title:"الرسائل",explore_tile_messages_sub:"محادثاتك",explore_popular_questions:"أسئلة شائعة",explore_ask_ai_about_this:"اسأل وكيل الذكاء الاصطناعي عن هذا",explore_recommended_reading:"قراءات مقترحة",help_search_placeholder:"ابحث في المقالات…",help_search_label:"البحث في المقالات",help_searching:"جارٍ البحث…",help_search_no_results:"لا توجد مقالات مطابقة لـ «{query}»",help_all_collections:"جميع المجموعات",help_back_to_articles:"الرجوع إلى المقالات",help_document_type_fallback:"دليل",help_written_by:"بقلم فريق دعم {organizationName}",help_updated_recently:"تم التحديث مؤخرًا",help_read_time_zero:"أقل من دقيقة للقراءة",help_read_time_one:"دقيقة واحدة للقراءة",help_read_time_two:"دقيقتان للقراءة",help_read_time_few:"{count} دقائق للقراءة",help_read_time_many:"{count} دقيقة للقراءة",help_read_time_other:"{count} دقيقة للقراءة",help_feedback_title:"هل أجاب هذا عن سؤالك؟",help_feedback_thanks:"شكرًا على ملاحظاتك!",help_feedback_yes:"نعم",help_feedback_somewhat:"إلى حدٍّ ما",help_feedback_no:"لا",help_handoff_title:"لا تزال لديك أسئلة؟",help_handoff_desc:"اسأل وكيل الذكاء الاصطناعي للحصول على إجابات فورية",help_handoff_prefill:"لديّ سؤال حول المقالة «{title}»: ",help_collection_articles:"مقالات {collection} ({count})",help_article_count_zero:"لا توجد مقالات",help_article_count_one:"مقالة واحدة",help_article_count_two:"مقالتان",help_article_count_few:"{count} مقالات",help_article_count_many:"{count} مقالة",help_article_count_other:"{count} مقالة",help_empty_title:"وثائق المساعدة",help_empty_desc:"ابحث أعلاه للحصول على حلول فورية من قاعدة معارفنا.",help_collection_guide_title:"الأدلة والدروس",help_collection_guide_desc:"شروحات الإعداد والقواعد وأدلة البدء",help_collection_faq_title:"الأسئلة المتكررة",help_collection_faq_desc:"إجابات سريعة عن الأسئلة الشائعة حول الحساب والخدمة",help_collection_troubleshooting_title:"استكشاف الأخطاء والدعم",help_collection_troubleshooting_desc:"حلول خطوة بخطوة للمشكلات التقنية",help_collection_other_title:"القواعد والوثائق",help_collection_other_desc:"الشروط الرسمية والقواعد ووثائق السياسات",help_featured_article:"مقالة مميزة",help_untitled_article:"مقالة بدون عنوان",help_unavailable:"تعذّر تحميل مركز المساعدة. تحقق من اتصالك وحاول مرة أخرى.",link_opens_new_tab:"(يُفتح في علامة تبويب جديدة)",error_search_rate_limited:"أنت تبحث بسرعة كبيرة. يرجى الانتظار قليلًا ثم المحاولة مرة أخرى.",error_search_unavailable:"البحث غير متاح حاليًا. يرجى المحاولة مرة أخرى بعد قليل.",error_send_rate_limited:"أنت ترسل الرسائل بسرعة كبيرة. يرجى الانتظار قليلًا ثم المحاولة مرة أخرى.",error_attachment_rejected:"لا يمكن إرفاق هذا الملف. قد يكون كبيرًا جدًا (الحد 10 ميغابايت) أو من نوع غير مسموح به.",error_attachment_upload_failed:"تعذّر رفع هذا المرفق. يرجى المحاولة مرة أخرى."};export{e as default};