1(this["webpackJsonpshreyu-react-app"]=this["webpackJsonpshreyu-react-app"]||[]).push([[70],{1041:function(e,t,a){"use strict";a.r(t);var c=a(3),r=a(1),n=a(82),s=a(64),i=a(290),l=a(71),o=a(48),b=a(0),d={Text:{text:"text-primary",bg:"bg-primary-subtle",badge:"bg-primary"},Image:{text:"text-danger",bg:"bg-danger-subtle",badge:"bg-danger"},Video:{text:"text-info",bg:"bg-info-subtle",badge:"bg-info"},Document:{text:"text-success",bg:"bg-success-subtle",badge:"bg-success"},Audio:{text:"text-warning",bg:"bg-warning-subtle",badge:"bg-warning"},Map:{text:"text-secondary",bg:"bg-secondary-subtle",badge:"bg-secondary"}},u=function(e){var t=e.activeType,a=e.onTypeChange,c=e.counts,r=void 0===c?{}:c,n=function(e,c,n,s){var i,l,u,j;return Object(b.jsxs)(o.b,{to:"#",onClick:function(){return a(e)},className:"list-group-item border-0 d-flex align-items-center ".concat(t===e?(null===(i=d[e])||void 0===i?void 0:i.bg)+" fw-bold":""),children:[Object(b.jsx)("i",{className:"bi ".concat(c," fs-2 me-3 ").concat(null===(l=d[e])||void 0===l?void 0:l.text)}),Object(b.jsx)("span",{className:"flex-grow-1",children:n}),Object(b.jsx)("span",{className:"badge rounded-pill ".concat(null===(u=d[e])||void 0===u?void 0:u.badge),children:null!==(j=null===r||void 0===r?void 0:r[e])&&void 0!==j?j:0})]})};return Object(b.jsxs)("div",{className:"list-group mail-list mt-2",children:[n("Text","bi-chat-dots","Text"),n("Image","bi-image","Images"),n("Video","bi-camera-video","Video"),n("Document","bi-file-earmark-text","Document"),n("Audio","bi-volume-up","Audio"),n("Map","bi-geo-alt","Map")]})},j=a(846),p=a(32);t.default=function(){var e=Object(r.useState)(!1),t=Object(c.a)(e,2),a=(t[0],t[1],Object(r.useState)("Text")),o=Object(c.a)(a,2),d=o[0],x=o[1],m=Object(r.useState)({}),y=Object(c.a)(m,2),O=y[0],g=y[1];return Object(r.useEffect)((function(){Object(p.eb)().then((function(e){var t=(e.data||[]).reduce((function(e,t){return e[t.type]=(e[t.type]||0)+1,e}),{});g(t)}))}),[]),Object(b.jsxs)(b.Fragment,{children:[Object(b.jsx)(l.a,{breadCrumbItems:[{label:"Automation",path:"/automation"},{label:"Reply Library",path:"/automation/reply_library",active:!0}],title:"Reply Library"}),Object(b.jsx)(n.a,{children:Object(b.jsx)(s.a,{children:Object(b.jsxs)("div",{className:"email-container bg-transparent",children:[Object(b.jsxs)(i.a,{className:"inbox-leftbar",children:[Object(b.jsx)("h4",{children:"Types"}),Object(b.jsx)(u,{activeType:d,onTypeChange:x,counts:O})]}),Object(b.jsx)(n.a,{children:Object(b.jsx)(s.a,{md:12,children:Object(b.jsxs)(i.a,{className:"border-0 bg-white py-3 p-3",children:[Object(b.jsx)(n.a,{className:"align-items-center mb-3"}),Object(b.jsx)(i.a.Body,{children:Object(b.jsx)(j.a,{type:d,module:"reply_material"})})]})})})]})})})]})}},846:function(e,t,a){"use strict";var c=a(9),r=a.n(c),n=a(18),s=a(3),i=a(1),l=a(287),o=a(82),b=a(64),d=a(185),u=a(290),j=a(47),p=a(291),x=a(32),m=a(0),y=function(e){var t=e.onClose,a=e.initialData,c=Object(i.useState)(""),l=Object(s.a)(c,2),u=l[0],p=l[1],y=Object(i.useState)("Text"),O=Object(s.a)(y,2),g=O[0],h=O[1],f=Object(i.useState)(""),v=Object(s.a)(f,2),_=v[0],N=v[1],w=Object(i.useState)(null),k=Object(s.a)(w,2),C=k[0],T=k[1],S=Object(i.useState)(null),D=Object(s.a)(S,2),A=D[0],I=D[1],M=Object(i.useState)(!1),R=Object(s.a)(M,2),V=R[0],L=R[1],F=Object(i.useState)(""),G=Object(s.a)(F,2),H=G[0],E=G[1];Object(i.useEffect)((function(){a&&(p(a.reply_name),E(a.map),h(a.type),N(a.text_reply||""),a.reply_file&&I("https://api.skynyx.ai/file_storage/reply_library/".concat(a.reply_file)),"Map"===a.type&&E(a.map||""))}),[a]);var U=function(){var e=Object(n.a)(r.a.mark((function e(){var c;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(L(!0),e.prev=1,(c=new FormData).append("reply_name",u),c.append("type",g),"Text"===g&&c.append("text_reply",_),"Text"!==g&&"Map"!==g&&C&&c.append("reply_file",C),"Map"===g&&c.append("map_url",H),!(null===a||void 0===a?void 0:a.reply_library_id)){e.next=13;break}return e.next=11,Object(x.rb)(a.reply_library_id,c);case 11:e.next=15;break;case 13:return e.next=15,Object(x.d)(c);case 15:null===t||void 0===t||t(),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(1),console.error(e.t0);case 21:return e.prev=21,L(!1),e.finish(21);case 24:case"end":return e.stop()}}),e,null,[[1,18,21,24]])})));return function(){return e.apply(this,arguments)}}();return Object(m.jsxs)(j.a,{children:[Object(m.jsxs)(j.a.Group,{className:"mb-3",children:[Object(m.jsx)(j.a.Label,{children:"Reply Name"}),Object(m.jsx)(j.a.Control,{value:u,onChange:function(e){return p(e.target.value)}})]}),Object(m.jsxs)(j.a.Group,{className:"mb-3",children:[Object(m.jsx)(j.a.Label,{children:"Reply Type"}),Object(m.jsxs)(j.a.Select,{value:g,onChange:function(e){return h(e.target.value)},disabled:!!a,children:[Object(m.jsx)("option",{value:"Text",children:"Text"}),Object(m.jsx)("option",{value:"Image",children:"Image"}),Object(m.jsx)("option",{value:"Video",children:"Video"}),Object(m.jsx)("option",{value:"Document",children:"Document"}),Object(m.jsx)("option",{value:"Audio",children:"Audio"}),Object(m.jsx)("option",{value:"Map",children:"Map"})]})]}),"Text"===g&&Object(m.jsx)(j.a.Group,{className:"mb-3",children:Object(m.jsx)(j.a.Control,{as:"textarea",rows:4,value:_,onCh
1ange:function(e){return N(e.target.value)}})}),"Text"!==g&&"Map"!==g&&Object(m.jsx)(j.a.Group,{className:"mb-3",children:Object(m.jsx)(j.a.Control,{type:"file",onChange:function(e){var t,a=null===(t=e.target.files)||void 0===t?void 0:t[0];a&&(T(a),I(URL.createObjectURL(a)))}})}),"Map"===g&&Object(m.jsx)(j.a.Group,{className:"mb-3",children:Object(m.jsx)(j.a.Control,{placeholder:"Paste Google Maps URL",value:H,onChange:function(e){return E(e.target.value)}})}),A&&"Map"!==g&&Object(m.jsxs)("div",{className:"mb-3",children:["Image"===g&&Object(m.jsx)("img",{src:A,style:{maxWidth:"100%",maxHeight:200}}),"Video"===g&&Object(m.jsx)("video",{src:A,controls:!0,style:{width:"100%"}}),"Document"===g&&Object(m.jsx)("a",{href:A,target:"_blank",rel:"noreferrer",children:"View Document"}),"Audio"===g&&Object(m.jsx)("audio",{src:A,controls:!0})]}),Object(m.jsx)(o.a,{children:Object(m.jsxs)(b.a,{className:"text-end",children:[Object(m.jsx)(d.a,{variant:"secondary",onClick:t,className:"me-2",children:"Cancel"}),Object(m.jsx)(d.a,{variant:"success",onClick:U,disabled:V,children:V?"Saving...":a?"Update Reply":"Save Reply"})]})})]})};t.a=function(e){var t=e.type,a=e.module,c=e.selectedId,O=e.onSelect,g=Object(i.useState)([]),h=Object(s.a)(g,2),f=h[0],v=h[1],_=Object(i.useState)(!0),N=Object(s.a)(_,2),w=N[0],k=N[1],C=Object(i.useState)(!1),T=Object(s.a)(C,2),S=T[0],D=T[1],A=Object(i.useState)(!1),I=Object(s.a)(A,2),M=(I[0],I[1],Object(i.useState)(null)),R=Object(s.a)(M,2),V=R[0],L=R[1],F=Object(i.useState)(""),G=Object(s.a)(F,2),H=G[0],E=G[1],U=f.filter((function(e){var a="All"===t||e.type===t,c=e.reply_name.toLowerCase().includes(H.toLowerCase())||e.text_reply&&e.text_reply.toLowerCase().includes(H.toLowerCase());return a&&c})),B=function(){var e=Object(n.a)(r.a.mark((function e(t){return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(window.confirm("Are you sure you want to deactivate this reply?")){e.next=3;break}return e.abrupt("return");case 3:return e.prev=3,e.next=6,Object(x.C)(t);case 6:v((function(e){return e.filter((function(e){return e.reply_library_id!==t}))})),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(3),console.error("Delete failed",e.t0),alert("Failed to delete reply");case 13:case"end":return e.stop()}}),e,null,[[3,9]])})));return function(t){return e.apply(this,arguments)}}();return Object(i.useEffect)((function(){Object(x.eb)().then((function(e){v(e.data||[]),k(!1)}))}),[]),w?Object(m.jsx)(l.a,{animation:"border"}):Object(m.jsxs)(m.Fragment,{children:[Object(m.jsxs)(o.a,{className:"mb-3",children:[Object(m.jsx)(b.a,{md:4,children:Object(m.jsx)("input",{type:"text",className:"form-control",placeholder:"Search replies...",value:H,onChange:function(e){return E(e.target.value)}})}),Object(m.jsx)(b.a,{md:8,className:"text-md-end",children:"reply_material"===a?Object(m.jsx)(d.a,{onClick:function(){L(null),D(!0)},children:"+ New Reply"}):Object(m.jsx)(m.Fragment,{})})]}),Object(m.jsxs)(o.a,{className:"g-3",children:[U.map((function(e){return Object(m.jsx)(b.a,{md:3,children:Object(m.jsx)(u.a,{className:"h-100 shadow-sm border-2 rounded-4 ".concat("Text"===e.type?"border-primary":"Image"===e.type?"border-danger":"Video"===e.type?"border-info":"Audio"===e.type?"border-warning":"border-success"),children:Object(m.jsxs)(u.a.Body,{className:"p-3",children:[Object(m.jsxs)("div",{className:"d-flex align-items-center gap-3 mb-2",children:[Object(m.jsx)("div",{className:"d-inline-flex align-items-center justify-content-center rounded-circle ".concat("Text"===e.type?"bg-primary-subtle":"Image"===e.type?"bg-danger-subtle":"Video"===e.type?"bg-info-subtle":"Audio"===e.type?"bg-warning-subtle":"bg-success-subtle"),style:{width:42,he
1ight:42},children:Object(m.jsx)("i",{className:"bi ".concat("Text"===e.type?"bi-chat-dots text-primary":"Image"===e.type?"bi-image text-danger":"Video"===e.type?"bi-camera-video text-info":"bi-file-earmark-text text-secondary"," fs-5")})}),"keyword_trigger"===a?Object(m.jsx)(j.a.Check,{type:"checkbox",className:"position-absolute top-0 end-0 m-2",checked:c===e.reply_library_id,onChange:function(){return O(c===e.reply_library_id?null:e.reply_library_id)}}):Object(m.jsxs)("div",{className:"position-absolute top-0 end-0 p-2 d-flex gap-2 reply-actions",children:[Object(m.jsx)("i",{className:"bi bi-pencil-square text-warning fs-6 cursor-pointer",title:"Edit",onClick:function(){return function(e){console.log(e),L(e),D(!0)}(e)}}),Object(m.jsx)("i",{className:"bi bi-trash text-danger fs-6 cursor-pointer",title:"Delete",onClick:function(){return B(e.reply_library_id)}})]}),Object(m.jsx)("h5",{className:"mb-0 fw-bold text-dark",children:e.reply_name})]}),"Text"===e.type&&Object(m.jsx)("p",{className:"text-muted small mt-2 mb-0 text-truncate",children:e.text_reply}),"Image"===e.type&&Object(m.jsx)("img",{src:"https://api.skynyx.ai/file_storage/reply_library/".concat(e.reply_file),alt:e.reply_name,className:"img-fluid rounded mt-2",style:{maxHeight:"120px",objectFit:"cover"}}),"Video"===e.type&&Object(m.jsx)("video",{src:"https://api.skynyx.ai/file_storage/reply_library/".concat(e.reply_file),className:"w-100 rounded mt-2",style:{maxHeight:"120px"},controls:!0}),"Audio"===e.type&&Object(m.jsx)("audio",{src:"https://api.skynyx.ai/file_storage/reply_library/".concat(e.reply_file),className:"w-100 rounded mt-2",style:{maxHeight:"120px"},controls:!0}),"Document"===e.type&&Object(m.jsxs)("div",{className:"d-flex align-items-center mt-2 text-muted small",children:[Object(m.jsx)("i",{className:"bi bi-file-earmark-text fs-4 me-2 text-success"}),"Document"===t&&Object(m.jsx)("a",{className:"text-success",href:"https://api.skynyx.ai/file_storage/reply_library/".concat(e.reply_file),target:"_blank",rel:"noreferrer",children:"View Document"})]})]})})},e.reply_library_id)})),Object(m.jsxs)(p.a,{show:S,onHide:function(){D(!1),L(null)},size:"lg",centered:!0,children:[Object(m.jsx)(p.a.Header,{className:"d-flex justify-content-between align-items-center",style:{background:"linear-gradient(135deg, #0eb7eb, #167491)"},children:Object(m.jsx)(p.a.Title,{className:"text-white",children:V?"Edit Reply":"Add New Reply"})}),Object(m.jsx)(p.a.Body,{children:Object(m.jsx)(y,{initialData:V,onClose:function(){D(!1),L(null)}})})]})]})]})}}}]); 2//# sourceMappingURL=70.22324fc2.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.