PageSourceSearch

https://app.smartdialog.ai/assets/GroupServiceEdit-p4RKHP4W.js

js smartdialog.ai collected 2026-10-05 12:39:15 UTC 33,800 bytes, 1 lines download raw bytes

1import{i as Je,j as Xe,k as Ze,n as Qe,o as et,b as Q,bK as _,a2 as le,R as e,p as Z,cS as re,a4 as se,bP as $,r as ee,b1 as ke,b2 as Ne,T as b,b3 as Ae,b5 as V,b6 as z,b7 as i,w as ge,A as h,G as X,N as ne,O as A,b9 as tt,ba as Ie,E as K,U as W,bY as Re,b8 as Ee,d_ as fe,bG as D,ai as B,y as f,c_ as xe,aD as O,am as De,a6 as Me,af as Te,d4 as Ge,b0 as Be,d as de,cI as $e,c6 as Pe,q as Le,c$ as qe,bZ as Oe,be as Ke,bx as te,d2 as ce,d5 as oe,b4 as ae,dY as ve,dP as at,z as he,dX as We,c9 as ye,b_ as Ce,cs as Se,d$ as nt,e0 as rt,P as lt}from"./index-CpcUj6vn.js";import{R as st}from"./RoutedStepper-B2K1ef8A.js";import{C as He}from"./ArrowBackRounded-BNNIYZIL.js";import{G as Fe}from"./GuideLink-Cb5YRbze.js";import{I as Ye}from"./InstructionVideoPopup-Bf6EIbNt.js";import{A as ct}from"./ActionList-DlfzHCUT.js";import{A as ot}from"./ActionEditor-DofUVy9o.js";import{u as it}from"./useCodeServiceSelect-CrjyuOPs.js";import{D as mt}from"./DefaultSenderTextField-kQ0FG8GZ.js";import"./Stepper-DOnYgvt3.js";import"./lodash-1T78Azbp.js";import"./AdminAction-DPSBG5Fm.js";import"./lodash-DqXObOj3.js";import"./UrlShortenerButton-CbNmcr18.js";import"./CreateShortLinkPopup-Cp78RFaS.js";var ie={},be;function dt(){if(be)return ie;be=1;var a=Je(),g=Xe();Object.defineProperty(ie,"__esModule",{value:!0}),ie.default=void 0;var c=g(Ze()),w=a(Qe()),u=(0,w.default)(c.createElement("path",{d:"M19 13v5c0 .55-.45 1-1 1H6c-.55 0-1-.45-1-1v-5c0-.55-.45-1-1-1s-1 .45-1 1v6c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-6c0-.55-.45-1-1-1s-1 .45-1 1zm-6-.33l1.88-1.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-3.59 3.59c-.39.39-1.02.39-1.41 0L7.7 12.2a.9959.9959 0 010-1.41c.39-.39 1.02-.39 1.41 0L11 12.67V4c0-.55.45-1 1-1s1 .45 1 1v8.67z"}),"SaveAltRounded");return ie.default=u,ie}var ut=dt();const pt=et(ut),U=ge({root:{borderBottom:"none"}})(Ee),gt=_(()=>({formControl:{width:"100%",minWidth:"40%"},select:{width:"90%",minWidth:"40%"},cellWidth:{width:"100%"}})),Et={phone:"",firstname:"",lastname:"",phoneNumberRegions:[]};function je(a){const g=Q(),c=gt(),{error:w,success:u}=le(),{onClose:I,open:n}=a,[y,o]=e.useState({...Et}),[l,k]=e.useState([]),{selectedGroupService:r}=Z(p=>p.groupmessaging),{payload:C,loading:P}=re({method:"GET",endpoint:"/customermanagement/country/details"});e.useEffect(()=>{C&&k(C)},[C]);const R=()=>{I()},{loading:t,mutate:T}=se(p=>({method:"POST",endpoint:`/messaging/services/group/groupadmin/${r.id}`,body:p,headers:{serviceId:r.id}})),L=t||P,H=p=>{const G={...y,[p.target.name]:p.target.value};o(G)},F=p=>{const G={...y,phoneNumberRegions:[p.target.value]};o(G)},M=async()=>{const{error:p,errorMessages:G}=await T({...y});p?w(G):(u("Group admin added successfully"),g(fe()),I()),await g(D(!1))};return L?e.createElement($,null):e.createElement(ee.Suspense,{fallback:e.createElement($,null)},e.createElement(ke,{onClose:R,"aria-labelledby":"add admin popup",open:n,fullWidth:!0,maxWidth:"sm"},e.createElement(Ne,{disableTypography:!0},e.createElement(b,{variant:"h4"},"Add admin")),e.createElement(Ae,null,e.createElement(V,null,e.createElement("colgroup",null,e.createElement("col",{width:"30%"}),e.createElement("col",{width:"70%"})),e.createElement(z,{className:c.tbody},e.createElement(i,{key:"phone"},e.createElement(U,{align:"left"},"Phone:"),e.createElement(U,{align:"left",className:c.cellWidth},e.createElement(h,{name:"phone",onBlur:H,className:c.select}))),e.createElement(i,{key:"firstname"},e.createElement(U,{align:"left"},"Firstname:"),e.createElement(U,{align:"left"},e.createElement(h,{name:"firstname",onBlur:H,className:c.select}))),e.createElement(i,{key:"lastname"},e.createElement(U,{align:"left"},"Lastname:"),e.createElement(U,{align:"left"},e.createElement(h,{name:"lastname",onBlur:H,className:c.select}))),e.createElement(i,null,e.createElement(U,{align:"left"},"Phonenumber Region"),e.createElement(U,{align:"left",className:c.cellWidth},e.createElement(X,{className:c.formControl},e.createElement(ne,{id:"cphonenumberRegions-select",name:"phoneNumberRegions",className:c.select,defaultValue:"",onChange:p=>F(p)},e.createElement(A,{value:""},"None"),l?.map(p=>
1e.createElement(A,{key:p.alpha2,value:p.alpha2},`${p.name}, ${p.alpha2}`)))),e.createElement(tt,{id:"phonenumber-regions-helpertext"},"Optional 2 letter country code to use for parsing phonenumber field.")))))),e.createElement(Ie,null,e.createElement(K,{onClick:R},e.createElement(W,{title:"Close"},e.createElement(Re,null))),e.createElement(K,{onClick:M},e.createElement(W,{title:"Add admin"},e.createElement(pt,null))))))}je.propTypes={onClose:B.func.isRequired,open:B.bool.isRequired};const ft=_(a=>({listItem:{marginBottom:"5px"},listItemText:{textAlign:"center"},paper:{padding:a.spacing(2)}}));function _e({addDeleteDisabled:a}){const g=ft(),c=Q(),{error:w,success:u}=le(),[I,n]=e.useState(!1),[y,o]=e.useState(null),{selectedGroupService:l}=Z(t=>t.groupmessaging),k=()=>{n(!0)},r=()=>{n(!1)},{loading:C,mutate:P}=se(t=>({method:"DELETE",endpoint:`/messaging/services/group/groupadmin/${l?.id}/${t}`})),R=async t=>{const{error:T,errorMessages:L}=await P(t);T?w(L):(u("Group admin removed successfully"),c(fe()))};return C?e.createElement($,null):e.createElement(ee.Suspense,{fallback:e.createElement($,null)},e.createElement(f,{container:!0,direction:"row",justifyContent:"flex-end",alignItems:"center",className:g.toolbar},e.createElement(f,{item:!0,className:g.gridItem},e.createElement(K,{"aria-label":"add",onClick:k,disabled:a},e.createElement(W,{title:"Add admin"},e.createElement(xe,null))))),e.createElement(O,{className:g.paper},e.createElement(De,{component:"nav","aria-label":"Admins"},l?.serviceConfiguration?.admins?.map(t=>{const T=`${t.phone}, ${t.firstname||""} ${t.lastname||""}`;return e.createElement("div",{key:t.phone},e.createElement(Me,{key:t.phone,button:!0,className:g.listItem},e.createElement(Te,{className:g.listItemText,primary:T}),e.createElement(K,{"aria-label":"remove",onClick:()=>o(t.id),disabled:a},e.createElement(W,{title:"Remove admin"},e.createElement(Ge,null)))))})),e.createElement(Be,{title:"Delete admin",open:y!==null,setOpen:()=>o(null),onConfirm:()=>R(y)},e.createElement(b,{variant:"body1"},"Are you sure you wish to delete this admin?"))),e.createElement(je,{open:I,onClose:r}))}_e.propTypes={addDeleteDisabled:B.bool.isRequired};const pe=ge({root:{borderBottom:"none"}})(Ee),vt=_(()=>({formControl:{width:"100%"},smsIcon:{width:"100%",height:"100%"}})),we=["SMS","RCS"],Ue=a=>{const g=vt(),{error:c,success:w}=le(),u=Q(),{serviceId:I}=de(),{onClose:n,open:y,action:o,inputSources:l}=a,[k,r]=e.useState(""),[C,P]=e.useState(""),R=e.useMemo(()=>l?.find(s=>s?.id===C)??null,[l,C]),t=e.useMemo(()=>l.filter(s=>we.some(j=>j===s?.inputSource?.type)&&s?.inputSource?.address!=="Root"),[l,we]),T=e.useMemo(()=>t?.map(s=>e.createElement(A,{key:s?.id,value:s?.id},s?.inputSource?.type==="RCS"?s?.inputSource?.metadata?.find?.(j=>j.key===$e)?.value??s?.inputSource?.address:s?.inputSource?.address,!!s?.ke
1ywordPrefix&&` - ${s?.keywordPrefix}`)),[t]),{loading:L,mutate:H}=se(s=>({method:"POST",endpoint:`/messaging/services/group/actions/${I}`,body:s})),F=async()=>{const s={inputSourceId:R?.inputSource?.id,keyword:R.keywordPrefix?`${R.keywordPrefix} ${k}`:k,action:o},{error:j,status:v}=await H(s);j?c(v===403?"You don´t have access to create/update this service":v===409?"Error creating keyword. Keyword already in use":"Error creating keyword"):(w("Keyword created"),u(fe())),await u(D(!1))},M=s=>{P(s.target.value),u(D(!0))},p=s=>{r(s.target.value),u(D(!0))},G=()=>{u(D(!1)),n()};return L?e.createElement($,null):e.createElement(ee.Suspense,{fallback:e.createElement($,null)},e.createElement(ke,{onClose:G,"aria-labelledby":"add group action keyword popup",open:y,fullWidth:!0,maxWidth:"sm"},e.createElement(Ne,{disableTypography:!0},e.createElement(b,{variant:"h4"},"Add Action Keyword")),e.createElement(Ae,null,e.createElement(V,null,e.createElement("colgroup",null,e.createElement("col",{width:"40%"}),e.createElement("col",{width:"60%"})),e.createElement(z,null,e.createElement(i,null,e.createElement(pe,{align:"left"},"Inputsource"),e.createElement(pe,{align:"left"},e.createElement(X,{className:g.formControl},e.createElement(ne,{placeholder:"Select code",labelId:"codeSelect-label",id:"codeSelect",value:C,onChange:M},T)))),R&&e.createElement(i,null,e.createElement(pe,{align:"left"},"Keyword"),e.createElement(pe,{align:"left"},e.createElement(X,{className:g.formControl},e.createElement(h,{name:"defaultSender",onChange:p,value:k,InputProps:{startAdornment:e.createElement("div",null,R?.keywordPrefix?e.createElement(e.Fragment,null,`${R.keywordPrefix}`," "):"")}}))))))),e.createElement(Ie,null,e.createElement(K,{"aria-label":"cancel",onClick:G},e.createElement(W,{title:"Cancel"},e.createElement(Re,null))),e.createElement(K,{"aria-label":"save",onClick:F},e.createElement(W,{title:"Create keyword"},e.createElement(Pe,null))))))};
1Ue.propTypes={onClose:B.func.isRequired,open:B.bool.isRequired,action:B.string.isRequired,inputSources:B.any.isRequired};const ht=_(a=>({listItem:{marginBottom:"5px"},listItemText:{textAlign:"center"},paper:{padding:a.spacing(2)}}));function me({action:a,serviceId:g,inputSources:c,addDeleteDisabled:w}){const u=ht(),I=Q(),{error:n,success:y}=le(),[o,l]=e.useState(!1),[k,r]=e.useState(null),{selectedGroupService:C}=Z(v=>v.groupmessaging),[P,R]=e.useState(null),{payload:t,loading:T}=re({method:"GET",endpoint:`/messaging/services/group/inputsources/servicekeywords/${g}`});e.useEffect(()=>{t&&R(t)},[t]);const L=()=>{l(!0)},H=()=>{l(!1)},{loading:F,mutate:M}=se(v=>({method:"DELETE",endpoint:`/messaging/services/group/actions/${g}/${v?.id}/${a}/${v?.text}`})),p=e.useCallback(M,[]),G=async v=>{const x=P?.availableKeywords?.find(S=>S?.text===v);r({id:x.id,text:v})},N=async()=>{const{error:v,status:x}=await p(k);v?n(x===403?"You don´t have access to create/update this service":"Error creating keyword"):(r(null),I(fe()),y("Action keyword deleted"))},s=v=>{const x=P?.availableKeywords?.find(S=>S?.text===v);if(x!==void 0){const S=c?.find(J=>J?.inputSource?.id===x?.inputSourceId);let Y=S?.inputSource?.address??"";return S.inputSource.type==="RCS"&&(Y=S?.inputSource?.metadata?.find?.(J=>J.key===$e)?.value??Y),`${Y} - ${v}`}return""};return F||T?e.createElement($,null):e.createElement(ee.Suspense,{fallback:e.createElement($,null)},e.createElement(f,{container:!0,direction:"row",justifyContent:"flex-end",alignItems:"center",className:u.toolbar},e.createElement(f,{item:!0,className:u.gridItem},e.createElement(K,{"aria-label":"add",onClick:L,disabled:w},e.createElement(W,{title:"Add keyword"},e.createElement(xe,null))))),e.createElement(O,{className:u.paper},e.createElement(De,{component:"nav","aria-label":"Actions"},C?.serviceConfiguration?.actions?.filter(v=>v.action===a)?.map(v=>e.createElement("div",{key:v},v.keywords?.map(x=>e.createElement(Me,{key:x,button:!0,className:u.listItem},e.createElement(Te,{className:u.listItemText,primary:s(x)}),e.createElement(K,{"aria-label":"remove",onClick:()=>G(x),disabled:w},e.createElement(W,{title:"Remove keyword"},e.createElement(Ge,null))))))))),e.createElement(Ue,{open:o,onClose:H,action:a,inputSources:c}),e.createElement(Be,{title:"Delete action keyword",open:k!==null,setOpen:()=>r(null),onConfirm:()=>N()},e.createElement(b,{variant:"body1"},'Are you sure you want to delete this "',e.createElement("b",null,k?.text),'" keyword?')))}me.propTypes={action:B.string,serviceId:B.string,inputSources:B.any.isRequired,addDeleteDisabled:B.bool.isRequired};const E=ge({root:{borderBottom:"none"}})(Ee),yt=_(a=>({lastTableRow:{border:"0"},select:{width:"100%",minWidth:"40%"},root:{width:"100%"},button:{marginRight:a.spacing(1)},completed:{display:"inline-block"},instructions:{marginTop:a.spacing(1),marginBottom:a.spacing(1)},card:{backgroundColor:"#fbfbfb"},paper:{padding:a.spacing(2),height:"100%"},cellWidth:{width:"100%"}})),Ct={defaultSender:"",dlrUrl:"",endDate:null,messagingAccountId:null,name:"",rCodeServiceId:null,serviceState:"Active",startDate:null,serviceConfiguration:{responseMessages:{}},hiddenContent:!1},St=["SMS","RCS"],bt=()=>{const a=Le(),{customerId:g,serviceId:c}=de(),{showInfo:w}=qe(),{error:u,success:I}=le(),n=yt(),y=Q(),o=!!c,[l,k]=e.useState(!1),[r,C]=e.useState(null),{selectedGroupService:P,selectedGroupServiceLoading:R}=Z(S=>S.groupmessaging),[t,T]=e.useState(P??Ct),{payload:L,loading:H}=re({method:"GET",endpoint:"/messaging/services/group/defaultmessages"});e.useEffect(()=>{L&&k(L)},[L,y]);const{payload:F,loading:M}=re({method:"GET",endpoint:"/messaging/services/group/inputsources"});e.useEffect(()=>{F&&C(F?.filter(S=>St.some(Y=>Y===S?.inputSource?.type))??[])},[F,y]);const{loading:p,mutate:G}=se(S=>({method:"PATCH",endpoint:`/messaging/services/group/${S.id}`,body:S})),N=async()=>{const{error:S,errorMessages:Y,status:ue}=await G(t);S?u(ue===403?"You don´t have access to create/update this service":Y):(I("Group service updated successfully"),y(ve(t))),await y(D(!1))},s=S=>{const Y={...t,serviceConfiguration:{...t.serviceConfiguration,responseMessages:{...t.serviceConfiguration.responseMessages,[S.target.name]:S.target.value}}};T(Y),y(D(!0))},j=async()=>{await y(D(!1)),a.push(`/${g}/services/groupmessaging/${c}/info`)},v=R||p||H||M;!v&&t.id===void 0&&T(P);let x=!1;return(o===!1||o&&t.id!==void 0)&&(x=!0),e.createElement("div",{className:n.container},v?e.createElement($,null):e.createElement(ee.Suspense,{fallback:e.createElement($,null)},e.createElement(f,{container:!0,direction:"row",justifyContent:"flex-end",alignItems:"center",className:n.toolbar},e.createElement(f,{item:!0,className:n.gridItem},e.createElement(Fe,null),e.createElement(Ye,{useButton:!0,videoId:"groupservice"}),e.createElement(K,{"aria-label":"info",onClick:w},e.createElement(W,{title:"Info"},e.createElement(Oe,null))),e.createElement(K,{"aria-label":"back",onClick:j},e.createElement(W,{title:"Back to service info"},e.createElement(He,null))))),e.createElement(Ke,null),x?e.createElement(e.Fragment,null,e.createElement(te,{className:n.card},e.createElement(ce,{avatar:e.createElement(b,{variant:"h5"},"Start & End")}),e.createElement(oe,{className:n.cardContent},e.createElement(f,{container:!0,spacing:2},e.createElement(f,{item:!0,xs:12,md:6},e.createElement(O,{className:n.paper},e.createElement(b,{variant:"h5"},"Response Messages"),e.createElement(ae,null,e.createElement(V,null,e.createElement("colgroup",null,e.createElement("col",{width:"30%"}),e.createElement("col",{width:"70%"})),e.createElement(z,null,e.createElement(i,{key:"serviceexpired"},e.createElement(E,{align:"left"},"Service expired:"),e.createElement(E,{align:"left",className:n.cellWidth},e.createElement(h,{name:"serviceExpired",onChange:s,onBlur:N,value:t?.serviceConfiguration?.responseMessages?.serviceExpired||"",placeholder:l.serviceExpired,className:n.select}))),e.createElement(i,{key:"servicenotstarted"},e.createElement(E,{align:"left"},"Service not started:"),e.createElement(E,{align:"left"},e.createElement(h,{name:"serviceNotStarted",onChange:s,onBlur:N,value:t?.serviceConfiguration?.responseMessages?.serviceNotStarted||"",placeholder:l.serviceNotStarted,className:n.select}))))))))))),e.createElement("br",null),e.createElement(te,{className:n.card},e.createElement(ce,{avatar:e.createElement(b,{variant:"h5"},"Join Group")}),e.createElement(oe,{className:n.cardContent},e.createElement(f,{container:!0,spacing:2},e.createElement(f,{item:!0,xs:12,md:6},e.createElement(O,{className:n.paper},e.createElement(b,{variant:"h5"},"Response Messages"),e.createElement(ae,null,e.createElement(V,{xs:6,sm:3},e.createElement("colgroup",null,e.createElement("col",{width:"30%"}),e.createElement("col",{width:"70%"})),e.createElement(z,null,e.createElement(i,{key:"joingroup"},e.createElement(E,{align:"left"},"Join group:"),e.createElement(E,{align:"left"},e.createElement(h,{name:"joinGroup",onChange:s,onBlur:N,value:t?.serviceConfiguration?.responseMessages?.joinGroup||"",placeholder:l.joinGroup,className:n.select}))),e.createElement(i,{key:"alreadymember"},e.createElement(E,{align:"left"},"Already a member:"),e.createElement(E,{align:"left"},e.createElement(h,{name:"alreadyMember",onChange:s,onBlur:N,value:t?.serviceConfiguration?.responseMessages?.alreadyMember||"",placeholder:l.alreadyMember,className:n.select}))),e.createElement(i,{key:"memberlimithit"},e.createElement(E,{align:"left"},"Member limit hit:"),e.createElement(E,{align:"left"}
1,e.createElement(h,{name:"memberLimitHit",onChange:s,onBlur:N,value:t?.serviceConfiguration?.responseMessages?.memberLimitHit||"",placeholder:l.memberLimitHit,className:n.select})))))))),e.createElement(f,{item:!0,xs:12,md:6},e.createElement(O,{className:n.paper},e.createElement(b,{variant:"h5"},"Action Keywords"),e.createElement(me,{serviceId:t.id,action:"Join",inputSources:r,addDeleteDisabled:!!t?.serviceConfiguration?.pushBilling})))))),e.createElement("br",null),e.createElement(te,{className:n.card},e.createElement(ce,{avatar:e.createElement(b,{variant:"h5"},"Leave Group")}),e.createElement(oe,{className:n.cardContent},e.createElement(f,{container:!0,spacing:2},e.createElement(f,{item:!0,xs:12,md:6},e.createElement(O,{className:n.paper},e.createElement(b,{variant:"h5"},"Response Messages"),e.createElement(ae,null,e.createElement(V,{xs:6,sm:3},e.createElement("colgroup",null,e.createElement("col",{width:"30%"}),e.createElement("col",{width:"70%"})),e.createElement(z,null,e.createElement(i,{key:"leavegroup"},e.createElement(E,{align:"left"},"Leave group:"),e.createElement(E,{align:"left"},e.createElement(h,{name:"leaveGroup",onChange:s,onBlur:N,value:t?.serviceConfiguration?.responseMessages?.leaveGroup||"",placeholder:l.leaveGroup,className:n.select}))),e.createElement(i,{key:"notmember"},e.createElement(E,{align:"left"},"Not a member:"),e.createElement(E,{align:"left"},e.createElement(h,{name:"notMember",onChange:s,onBlur:N,value:t?.serviceConfiguration?.responseMessages?.notMember||"",placeholder:l.notMember,className:n.select})))))))),e.createElement(f,{item:!0,xs:12,md:6},e.createElement(O,{className:n.paper},e.createElement(b,{variant:"h5"},"Action Keywords"),e.createElement(me,{serviceId:t.id,action:"Leave",inputSources:r,addDeleteDisabled:t?.serviceConfiguration?.pushBilling})))))),e.createElement("br",null),e.createElement(te,{className:n.card},e.createElement(ce,{avatar:e.createElement(b,{variant:"h5"},"Renew Group Membership")}),e.createElement(oe,{className:n.cardContent},e.createElement(f,{container:!0,spacing:2},e.createElement(f,{item:!0,xs:12,md:6},e.createElement(O,{className:n.paper},e.createElement(b,{variant:"h5"},"Response Messages"),e.createElement(ae,null,e.createElement(V,{xs:6,sm:3},e.createElement("colgroup",null,e.createElement("col",{width:"30%"}),e.createElement("col",{width:"70%"})),e.createElement(z,null,e.createElement(i,{key:"renewalreminder"},e.createElement(E,{align:"left"},"Renewal reminder:"),e.createElement(E,{align:"left"},e.createElement(h,{name:"renewalReminder",onChange:s,onBlur:N,value:t?.serviceConfiguration?.responseMessages?.renewalReminder||"",placeholder:l.renewalReminder,className:n.select}))),e.createElement(i,{key:"membershiprenewed"},e.createElement(E,{align:"left"},"Membership renewed:"),e.createElement(E,{align:"left"},e.createElement(h,{name:"membershipRenewed",onChange:s,onBlur:N,value:t?.serviceConfiguration?.responseMessages?.membershipRenewed||"",placeholder:l.membershipRenewed,className:n.select})))))))),e.createElement(f,{item:!0,xs:12,md:6},e.createElement(O,{className:n.paper},e.createElement(b,{variant:"h5"},"Action Keywords"),e.createElement(me,{serviceId:t.id,action:"RenewMembership",inputSources:r,addDeleteDisabled:!!t?.serviceConfiguration?.pushBilling})))))),e.createElement("br",null),e.createElement(te,{className:n.card},e.createElement(ce,{avatar:e.createElement(b,{variant:"h5"},"Set Admin Senders")}),e.createElement(oe,{className:n.cardContent},e.createElement(f,{container:!0,spacing:2},e.createElement(f,{item:!0,xs:12,md:6},e.createElement(O,{className:n.paper},e.createElement(b,{variant:"h5"},"Response Messages"),e.createElement(ae,null,e.createElement(V,{xs:6,sm:3},e.createElement("colgroup",null,e.createElement("col",{width:"30%"}),e.createElement("col",{width:"70%"})),e.createElement(z,null,e.createElement(i,{key:"messagesent"},e.createElement(E,{align:"left"},"Message sent:"),e.createElement(E,{align:"left"},e.createElement(h,{name:"messageSent",onChange:s,onBlur:N,value:t?.serviceConfiguration?.responseMessages?.messageSent||"",placeholder:l.messageSent,className:n.select}))),e.createElement(i,{key:"sendingnotallowed"},e.createElement(E,{align:"left"},"Sending not allowed:"),e.createElement(E,{align:"left"},e.createElement(h,{name:"sendingNotAllowed",onChange:s,onBlur:N,value:t?.serviceConfiguration?.responseMessages?.sendingNotAllowed||"",placeholder:l.sendingNotAllowed,className:n.select}))),e.createElement(i,{key:"emptymessagenotallowed"},e.createElement(E,{align:"left"},"Empty messages not allowed:"),e.createElement(E,{align:"left"},e.createElement(h,{name:"emptyMessageNotAllowed",onChange:s,onBlur:N,value:t?.serviceConfiguration?.responseMessages?.emptyMessageNotAllowed||"",placeholder:l.emptyMessageNotAllowed,className:n.select}))),e.createElement(i,{key:"messagenotsentnocontacts"},e.createElement(E,{align:"left"},"Message not sent:"),e.createElement(E,{align:"left"},e.createElement(h,{name:"messageNotSentNoContacts",onChange:s,onBlur:N,value:t?.serviceConfiguration?.responseMessages?.messageNotSentNoContacts||"",placeholder:l.messageNotSentNoContacts,className:n.select})))))))),e.createElement(f,{item:!0,xs:12,md:6},e.createElement(O,{className:n.paper},e.createElement(b,{variant:"h5"},"Action Keywords"),e.createElement(me,{serviceId:t.id,action:"AdminSend",inputSources:r,addDeleteDisabled:!!t?.serviceConfiguration?.pushBilling}))),e.createElement(f,{item:!0,xs:12,md:6},e.createElement(O,{className:n.paper},e.createElement(b,{variant:"h5"},"Admins"),e.createElement(_e,{addDeleteDisabled:!!t?.serviceConfiguration?.pushBilling}))))))):null))},wt=_(a=>({root:{flexGrow:1},paper:{padding:a.spacing(2),height:"100%"},selector:{marginBottom:a.spacing(2)}})),kt=()=>{const a=wt(),{actionId:g}=de(),c=e.useRef(),{loading:w,mainKeywordNotFound:u}=at({serviceType:"group"}),I=()=>{c?.current?.scrollIntoView&&c.current.scrollIntoView({behavior:"smooth"})};return e.useEffect(()=>{g!==void 0&&I()},[g]),w?e.createElement($,null):e.createElement(he,{path:"/:customerId/services/groupmessaging/edit/:serviceId/actions/:actionId?",exact:!0},e.createElement("div",{className:a.root},e.createElement(f,{container:!0,spacing:2},e.createElement(f,{item:!0,xs:12,md:6},e.createElement(O,{className:a.paper},e.createElement(ct,{addDisabled:u,onScrollToEditor:I}))),e.createElement(f,{item:!0,xs:12,md:6,ref:c},e.createElement(he,{path:"/:customerId/services/groupmessaging/edit/:serviceId/actions/:actionId",exact:!0},e.createElement(ot,{key:g}))))))},d=ge({root:{borderBottom:"none"}})(Ee),Nt=_(a=>({lastTableRow:{border:"0"},select:{minWidth:"40%"},root:{width:"100%"},button:{marginRight:a.spacing(1)},completed:{display:"inline-block"},instructions:{marginTop:a.spacing(1),marginBottom:a.spacing(1)},helper:{color:"#546e7a",margin:"0",fontSize:"12px",marginTop:"3px",textAlign:"left",fontFamily:"Rajdhani",fontWeight:"400",lineHeight:"13px",letterSpacing:"0.33px"},required:{fontWeight:"bold"}})),At={defaultSender:"",dlrUrl:"",endDate:null,messagingAccountId:null,name:"",rCodeServiceId:null,serviceState:"Active",startDate:null,serviceConfiguration:{customContactProperties:[],dialogService:!1,responseMessages:{},gracePeriod:null,restriction:"None",membershipPeriod:null,renew
1alMode:"ExpiresAutomatically",contactLimit:""},hiddenContent:!1},It=()=>{const a=Le(),{customerId:g,serviceId:c}=de(),{showInfo:w}=qe(),{error:u,success:I}=le(),{messagingAccounts:n}=Z(m=>m.messagingAccounts),{selectedCustomerMessageRetentionDays:y}=Z(m=>m.auth),o=Nt(),l=Q(),k=!!c,[r,C]=e.useState({...At,customerId:g}),[P,R]=e.useState(!1);e.useEffect(()=>{r?.serviceState==="Passive"&&r?.serviceConfiguration?.pushBilling&&(u("It´s not possible to edit a passive Group service with push billing activated."),a.push(`/${g}/services/groupmessaging/${c}/info`))},[u,a,g,c,r]);const{payload:t,loading:T}=re({method:"GET",endpoint:`/messaging/services/group/${c}`,params:{includeUncachedProperties:!0}});e.useEffect(()=>{t&&(R(t?.hiddenContent??!1),C(t),l(We(t)))},[t,l]);const{loading:L,mutate:H}=se(m=>({method:"PATCH",endpoint:`/messaging/services/group/${m.id}`,body:m})),F=async()=>{const m={...r,hiddenContent:P},{error:q,errorMessages:Ve,status:ze}=await H(m);q?u(ze===403?"You don´t have access to create/update this service":Ve):(I("Group service updated successfully"),l(nt(m))),await l(D(!1))},M=m=>{const q={...r,[m.target.name]:m.target.value};C(q),l(D(!0))},p=m=>{const q={...r,serviceConfiguration:{...r.serviceConfiguration,[m.target.name]:m.target.value}};C(q),l(D(!0))},G=m=>{const q={...r,[m.target.name]:m.target.checked};C(q),l(D(!0))},N=m=>{const q={...r,serviceConfiguration:{...r.serviceConfiguration,[m.target.name]:m.target.checked}};C(q),l(D(!0))},s=m=>{const q={...r,startDate:m._d};C(q),l(D(!0))},j=m=>{const q={...r,endDate:m};C(q),l(D(!0))},v=async()=>{await l(D(!1)),a.push(`/${g}/services/groupmessaging/${c}/info`)},x=m=>{m.target.value.length<3&&u("Default sender value must be at least 3 characters.")},{loading:S,CodeServiceSelect:Y}=it(),ue=T||L||S;let J=!1;return(k===!1||k&&r.id!==void 0)&&(J=!0),e.createElement("div",{className:o.container},ue?e.createElement($,null):e.createElement(ee.Suspense,{fallback:e.createElement($,null)},e.createElement(f,{container:!0,direction:"row",justifyContent:"flex-end",alignItems:"center",className:o.toolbar},e.createElement(f,{item:!0,className:o.gridItem},e.createElement(Fe,null),e.createElement(Ye,{useButton:!0,videoId:"groupservice"}),e.createElement(K,{"aria-label":"info",onClick:w},e.createElement(W,{title:"Info"},e.createElement(Oe,null))),e.createElement(K,{"aria-label":"back",onClick:v},e.createElement(W,{title:"Back to service info"},e.createElement(He,null))),e.createElement(K,{"aria-label":"save",onClick:F},e.createElement(W,{title:"Save changes"},e.createElement(Pe,null))))),e.createElement(Ke,null),J?e.createElement(ae,null,e.createElement(V,{xs:6,sm:3},e.createElement("colgroup",null,e.createElement("col",{width:"20%"}),e.createElement("col",{width:"80%"})),e.createElement(z,null,e.createElement(i,{key:"name"},e.createElement(d,{align:"left",className:o.required},"Service name (*)"),e.createElement(d,{align:"left"},e.createElement(h,{name:"name",onChange:M,value:r?.name??"",className:o.select}))),e.createElement(i,{key:"description"},e.createElement(d,{align:"left"},"Description"),e.createElement(d,{align:"left"},e.createElement(h,{name:"description",onChange:p,value:r?.serviceConfiguration?.description??"",className:o.select}))),e.createElement(i,{key:"servicestate"},e.createElement(d,{align:"left"},"Service state"),e.createElement(d,{align:"left"},e.createElement(X,{className:o.formControl},e.createElement(ne,{id:"state-select",value:r?.serviceState,onChange:M,name:"serviceState"},e.createElement(A,{value:"Active"},"Active"),e.createElement(A,{value:"Passive"},"Passive"))))),e.createElement(i,{key:"messagingaccount"},e.createElement(d,{align:"left"},"Messaging account"),e.createElement(d,{align:"left"},e.createElement(X,{className:o.formControl},e.createElement(ne,{id:"messaging-account-select",onChange:M,name:"messagingAccountId",value:r?.messagingAccountId??"None"},e.createElement(A,{value:"None"},"None"),n?.map?.(m=>e.createElement(A,{key:m.id,value:m.id},m.name)))))),e.createElement(i,{key:"defaultsender"},e.createElement(d,{align:"left",className:o.required},"Default sender (*)"),e.createElement(d,{align:"left"},e.createElement(mt,{name:"defaultSender",onChange:M,value:r?.defaultSender??"",className:o.select,helperText:"Long- or shortcode or Alphanumeric string (3-11 chars, no special characters)",onBlur:m=>x(m)}))),e.createElement(i,{key:"startdate"},e.createElement(d,{align:"left",className:o.required},"Start date (*)"),e.createElement(d,{align:"left"},e.createElement(ye,{autoOk:!0,hideTabs:!0,ampm:!1,value:r?.startDate,onChange:s,name:"startDate",format:"D.M.YYYY HH.mm"}))),e.createElement(i,{key:"enddate"},e.createElement(d,{align:"left"},"End date"),e.createElement(d,{align:"left"},e.createElement(ye,{autoOk:!0,hideTabs:!0,clearable:!0,ampm:!1,value:r?.endDate,onChange:j,name:"endDate",format:"D.M.YYYY HH.mm"}))),e.createElement(i,{key:"dlrurl"},e.createElement(d,{align:"left"},"Dlr url"),e.createElement(d,{align:"left"}
1,e.createElement(h,{name:"dlrUrl",onChange:M,value:r?.dlrUrl??"",className:o.select}))),e.createElement(i,{key:"dialogService"},e.createElement(d,{align:"left"},"Dialog service"),e.createElement(d,{align:"left"},e.createElement(Ce,{control:e.createElement(Se,{checked:!!r?.serviceConfiguration?.dialogService,onChange:N,name:"dialogService",color:"primary"})}))),e.createElement(Y,{name:"rCodeServiceId",value:r?.rCodeServiceId??"",onChange:M}),e.createElement(i,{key:"graceperiod"},e.createElement(d,{align:"left"},"Grace period"),e.createElement(d,{align:"left"},e.createElement(h,{name:"gracePeriod",onChange:p,value:r?.serviceConfiguration?.gracePeriod??"",className:o.select,helperText:"The number of days, in which the recipient does not receive Group messages, after joining."}))),e.createElement(i,{key:"restriction"},e.createElement(d,{align:"left"},"Messaging limitations"),e.createElement(d,{align:"left"},e.createElement(X,{className:o.formControl},e.createElement(ne,{id:"state-select",value:r?.serviceConfiguration?.restriction??"None",onChange:p,name:"restriction"},e.createElement(A,{value:"None"},"None"),e.createElement(A,{value:"OnceADay"},"Once a day"),e.createElement(A,{value:"OnceAWeek"},"Oncea week"),e.createElement(A,{value:"OnceAMonth"},"Once a month"),e.createElement(A,{value:"OnceAYear"},"Once a year"),e.createElement(A,{value:"OnceInServiceLifetime"},"Once in service lifetime"))),e.createElement(b,{className:o.helper},"Limits how often a message can be sent to the group."))),e.createElement(i,{key:"membershipperiod"},e.createElement(d,{align:"left"},"Membership period"),e.createElement(d,{align:"left"},e.createElement(h,{name:"membershipPeriod",onChange:p,value:r?.serviceConfiguration?.membershipPeriod??"",className:o.select,helperText:"Defines how long the membership lasts. Can be empty."}))),e.createElement(i,{key:"renewalmode"},e.createElement(d,{align:"left"},"Renewal mode"),e.createElement(d,{align:"left"},e.createElement(X,{className:o.formControl},e.createElement(ne,{id:"state-select",value:r?.serviceConfiguration?.renewalMode??"None",onChange:p,name:"renewalmode"},e.createElement(A,{value:"None"},"None"),e.createElement(A,{value:"ExpiresAutomatically"},"Expires automatically"),e.createElement(A,{value:"RequiresRenewal"},"Requires renewal"),e.createElement(A,{value:"AutomaticRenewal"},"Automatic renewal"),e.createElement(A,{value:"RenewalReminder"},"Renewal reminder"))),e.createElement(b,{className:o.helper},"Defines what happens when the membership period has ended."))),e.createElement(i,{key:"contactlimit"},e.createElement(d,{align:"left"},"Contact amount limit"),e.createElement(d,{align:"left"},e.createElement(h,{name:"contactLimit",onChange:p,value:r?.serviceConfiguration?.contactLimit??"",className:o.select}))),e.createElement(i,{key:"messageretentiondays"},e.createElement(d,{align:"left"},"Message retention days"),e.createElement(d,{align:"left"},e.createElement(h,{name:"messageRetentionDays",onChange:M,value:r?.messageRetentionDays??"",className:o.select,placeholder:`${y??"365"}`,helperText:`Must be greater than or equal to 90 days. If not set, default value is ${y??"365"} days.`}))),e.createElement(i,{key:"hiddenContent"},e.createElement(d,{align:"left"},"Hidden content"),e.createElement(d,{align:"left"},e.createElement(Ce,{control:e.createElement(Se,{checked:!!r?.hiddenContent,onChange:G,name:"hiddenContent",color:"primary"})})))))):null))},Rt=_(a=>({lastTableRow:{border:"0"},card:{width:"100%",marginBottom:0},select:{minWidth:"40%"},root:{width:"100%",height:"100%"},button:{marginRight:a.spacing(1)},completed:{display:"inline-block"},instructions:{marginTop:a.spacing(1),marginBottom:a.spacing(1)},stepperContainer:{padding:a.spacing(2)},stepperControllersContainer:{paddingTop:a.spacing(4)}})),xt=()=>{const a=Rt(),{serviceId:g}=de(),c=Q(),{refreshSelectedGroupService:w}=Z(o=>o.groupmessaging),[u,I]=e.useState(!1),{query:n}=re({method:"GET",endpoint:`/messaging/services/group/${g}`,params:{includeUncachedProperties:!0}},!1),y=e.useCallback(n,[]);return e.useEffect(()=>{(!u||w)&&((async()=>{c(rt(!0));const{payload:l,error:k}=await y();k?c(ve(null)):(c(ve(l)),c(We(l)))})(),I(!0))},[c,y,u,w]),e.createElement("div",{className:a.root},e.createElement(ee.Suspense,{fallback:e.createElement($,null)},e.createElement(te,{className:a.card},e.createElement(st,{steps:[{id:"basicSettings",title:"Basic Settings",path:"/basicsettings",component:It},{id:"advancedSettings",title:"Advanced Settings",path:"/advancedsettings",component:bt},{id:"actions",title:"Actions",path:"/actions/:actionId?",component:kt}]}))))};_(a=>({contentContainer:{width:"100%",padding:a.spacing(2)},gridItem:{margin:a.spacing(1)},toggleContainer:{margin:a.spacing(2,0)},formControl:{margin:a.spacing(1),minWidth:120},appBar:{backgroundColor:"#fff"},panelContainer:{flexGrow:1,width:"100%",padding:a.spacing(0),paddingTop:a.spacing(3)},panel:{width:"100%",margin:a.spacing(0),padding:a.spacing(0)}}));B.node,B.any.isRequired,B.any.isRequired;const jt=()=>e.createElement(lt,{title:"Group messaging service edit"},e.createElement(xt,null));export{jt as default};

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.