@hiver/connector-admin 4.13.0-uauth2-beta.0 → 4.13.0-uauth3-beta.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/index.es.js
CHANGED
|
@@ -36766,7 +36766,6 @@ const nJ = T(G)`
|
|
|
36766
36766
|
re,
|
|
36767
36767
|
{
|
|
36768
36768
|
sx: {
|
|
36769
|
-
fontFamily: "'Inter', sans-serif",
|
|
36770
36769
|
fontWeight: 500,
|
|
36771
36770
|
fontSize: "18px",
|
|
36772
36771
|
lineHeight: "28px",
|
|
@@ -36781,7 +36780,6 @@ const nJ = T(G)`
|
|
|
36781
36780
|
re,
|
|
36782
36781
|
{
|
|
36783
36782
|
sx: {
|
|
36784
|
-
fontFamily: "'Inter', sans-serif",
|
|
36785
36783
|
fontWeight: 400,
|
|
36786
36784
|
fontSize: "14px",
|
|
36787
36785
|
lineHeight: "20px",
|
|
@@ -36801,7 +36799,6 @@ const nJ = T(G)`
|
|
|
36801
36799
|
onClick: a,
|
|
36802
36800
|
sx: {
|
|
36803
36801
|
textTransform: "none",
|
|
36804
|
-
fontFamily: "'Inter', sans-serif",
|
|
36805
36802
|
fontWeight: 500,
|
|
36806
36803
|
fontSize: "14px",
|
|
36807
36804
|
lineHeight: "18px",
|
|
@@ -36824,7 +36821,6 @@ const nJ = T(G)`
|
|
|
36824
36821
|
disableElevation: !0,
|
|
36825
36822
|
sx: {
|
|
36826
36823
|
textTransform: "none",
|
|
36827
|
-
fontFamily: "'Inter', sans-serif",
|
|
36828
36824
|
fontWeight: 500,
|
|
36829
36825
|
fontSize: "14px",
|
|
36830
36826
|
lineHeight: "18px",
|
package/index.umd.js
CHANGED
|
@@ -3465,7 +3465,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
3465
3465
|
`,oJ=g.styled(g.icons.OpenInNew)`
|
|
3466
3466
|
height: 18px;
|
|
3467
3467
|
width: 18px;
|
|
3468
|
-
`,AJ=({upgradeGuideContent:e,upgradeGuideLink:t})=>c.jsxs(eJ,{children:[c.jsxs(g.Stack,{marginBottom:"20px",children:[c.jsxs(g.Stack,{direction:"row",padding:"8px 0",gap:"4px",alignItems:"center",children:[c.jsx(tJ,{}),c.jsx(g.Typography,{variant:"body1_medium",color:g.theme.palette.gray.black,children:lY})]}),c.jsx(g.Typography,{variant:"body2",children:cY})]}),c.jsx(g.Typography,{variant:"body2_medium",marginBottom:"8px",color:g.theme.palette.gray.black,children:uY}),c.jsx(rJ,{variant:"body2",dangerouslySetInnerHTML:{__html:e}}),t?c.jsxs(nJ,{target:"_blank",underline:"none",href:t,children:[c.jsx(oJ,{}),gY]}):null]}),$1=(e,t)=>{const n=t.authType===di,r=t.authType===B1,o=t.authType===Ls;if(!e||!e.data)return{authUrl:"",authStatus:r?nt.API_KEY_FAILED:n?nt.BASIC_AUTH_FAILED:o?nt.OAUTH1_FAILED:nt.OAUTH_FAILED};const A=e.data;return r?{authUrl:"",id:A.id,authStatus:nt.API_KEY_SUCCESS}:n?{authUrl:"",id:A.id,authStatus:nt.BASIC_AUTH_SUCCESS}:o?{authUrl:"",id:A.id,authStatus:nt.OAUTH1_SUCCESS}:A.authorizationUrl?{authUrl:A.authorizationUrl,id:A.id,authStatus:nt.PENDING}:{authUrl:"",id:"",authStatus:nt.OAUTH_FAILED}},sJ=async e=>{try{const t=await Pe({url:tG,method:zt.POST,data:e});return $1(t,e.authDetails)}catch(t){return Promise.reject(t)}},aJ=async(e,t)=>{try{const n=rG.replace("{{id}}",t),r=await Pe({url:n,method:zt.PATCH,data:e});return $1(r,e.authDetails)}catch(n){return Promise.reject(n)}},iJ=({connectorId:e,onSuccess:t})=>{const n=Oo(),r=m.useMemo(()=>["authDetails",{connectorId:e}],[e]),{data:o}=Co({queryKey:r,queryFn:()=>Promise.resolve({authUrl:"",authStatus:nt.IDLE,id:""}),enabled:!1}),A=EA({mutationFn:a=>"connectorId"in a?aJ(a.data,a.connectorId):sJ(a.data),onSuccess:a=>{n.setQueryData(r,a),t==null||t()}});m.useEffect(()=>()=>{n.removeQueries({queryKey:r,exact:!0})},[n,r]);const s=m.useCallback(a=>{n.setQueryData(r,i=>i&&{...i,authStatus:a})},[r,n]);return{mutate:A.mutate,isLoading:A.isPending,data:o,mutateStatus:s}},lJ=async e=>{var t;try{const n=await Pe({url:Lr(AG,{connectorId:e}),method:zt.GET});return!n||!((t=n==null?void 0:n.data)!=null&&t.status)?{status:"failed"}:n==null?void 0:n.data}catch(n){return Promise.reject(n)}},cJ=({connectorId:e,enabled:t=!1})=>{const n=Oo(),r=m.useMemo(()=>["authSuccessStatus",{connectorId:e}],[e]),o=Co({queryKey:r,queryFn:()=>lJ(e),refetchInterval:A=>{var s,a;return((s=A.state.data)==null?void 0:s.status)==="failed"||((a=A.state.data)==null?void 0:a.status)==="success"?!1:500},enabled:t,refetchOnWindowFocus:!1,refetchIntervalInBackground:!0});return m.useEffect(()=>()=>{n.removeQueries({queryKey:r,exact:!0})},[n,r]),o},K1=({connectorData:e})=>{const{sendTrackingEvent:t,availableFeatures:n}=m.useContext(Qt),[r,o]=m.useState(!1),A=Oe(ci),s=Oe(zm),a=m.useRef(null),i=cn(),{id:l=""}=ko(),[u]=pA(),d=u.get("isEdit")==="true",f=!!(e!=null&&e.showUpgradeButton),B=Ar(n,Fj),{data:I,mutateStatus:C,isLoading:E,mutate:h}=iJ({connectorId:l,onSuccess:()=>{B&&o(!0)}}),p=cJ({connectorId:(I==null?void 0:I.id)||"",enabled:r}),{status:Q}=p.data||{},y=(I==null?void 0:I.authStatus)||nt.IDLE,b=(I==null?void 0:I.authUrl)||"",v=sr();m.useEffect(()=>()=>{v(iG())},[v]),m.useEffect(()=>{let x,S;const R=O=>{a.current&&O.origin===window.location.origin&&(O.data===P1||O.data===KC)&&(clearTimeout(x),a.current.close(),a.current=null,C(O.data===KC?nt.OAUTH_SUCCESS:nt.OAUTH_FAILED))};try{if(b){a.current=window.open(b,"_blank");const O=5*60*1e3;x=setTimeout(()=>{var N;(N=a.current)==null||N.close(),a.current=null,C(nt.OAUTH_FAILED)},O),S=setInterval(()=>{var N;(N=a.current)!=null&&N.closed&&(clearInterval(S),a.current=null,C(nt.OAUTH_FAILED))},500),window.addEventListener("message",R)}}catch(O){console.log("Error in Authentication",O)}return()=>{window.removeEventListener("message",R),clearTimeout(x),clearInterval(S)}},[b,v,C]),m.useEffect(()=>{Q&&Q!=="pending"&&a.current&&B&&(a.current.close(),a.current=null,C(Q==="success"?nt.OAUTH_SUCCESS:nt.OAUTH_FAILED))},[Q,C,B]),m.useEffect(()=>{switch((y===nt.OAUTH1_FAILED||y===nt.OAUTH_FAILED||y===nt.API_KEY_FAILED||y===nt.BASIC_AUTH_FAILED)&&i(Xe.BASEPATH),(y===nt.OAUTH1_SUCCESS||y===nt.OAUTH_SUCCESS||y===nt.API_KEY_SUCCESS||y===nt.BASIC_AUTH_SUCCESS)&&I!=null&&I.id&&i(d?Xe.BASEPATH:`${Xe.BASEPATH}${Xe.CONNECTOR_INITIAL_SETUP}/${l}?connectorId=${I.id}`),y){case nt.BASIC_AUTH_SUCCESS:case nt.OAUTH1_SUCCESS:case nt.OAUTH_SUCCESS:{Dt({message:f?M1:nY,type:eo}),t(Ye.CONNECTOR_AUTH_SUCCESS,{connector_name:e==null?void 0:e.name});break}case nt.BASIC_AUTH_FAILED:case nt.OAUTH1_FAILED:case nt.OAUTH_FAILED:{Dt({message:f?j1:rY,type:Nn});break}case nt.REQUEST_FAILED:{Dt({message:Mc,type:Nn});break}case nt.API_KEY_SUCCESS:{Dt({message:f?M1:AY,type:eo}),t(Ye.CONNECTOR_AUTH_SUCCESS,{connector_name:e==null?void 0:e.name});break}case nt.API_KEY_FAILED:{Dt({message:f?j1:Mc,type:Nn});break}}},[y,i,f,l,d,e==null?void 0:e.name,t,I==null?void 0:I.id]);const w=A===pe.LOADING||s===pe.LOADING;return c.jsxs(KY,{direction:"row",id:"connectors-auth-page",children:[c.jsx("div",{className:"flex flex-col",children:c.jsx(VY,{connectorId:l,isEdit:d,connectorData:e,authStatus:y,isLoading:w,authMutate:h,isAuthPending:E})}),c.jsxs(g.Stack,{gap:"36px",width:"322px",className:"connector-auth-help",children:[e!=null&&e.upgradeGuideContent?c.jsx(AJ,{upgradeGuideContent:e.upgradeGuideContent,upgradeGuideLink:e.upgradeGuideLink}):null,c.jsxs(g.Stack,{gap:"12px",children:[c.jsx(g.Typography,{variant:"h2",marginBottom:"8px",children:eW}),d?null:c.jsx(JC,{isSettingsPage:!0}),c.jsx($Y,{connectorName:e==null?void 0:e.name,supportLinks:e==null?void 0:e.supportLinks})]})]})]})},uJ="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_139_3606)'%3e%3cpath%20d='M9.00012%2011.0127C8.46629%2011.0127%207.95432%2010.8006%207.57685%2010.4232C7.19937%2010.0457%206.9873%209.53371%206.9873%208.99988C6.9873%208.46605%207.19937%207.95408%207.57685%207.5766C7.95432%207.19912%208.46629%206.98706%209.00012%206.98706C9.53395%206.98706%2010.0459%207.19912%2010.4234%207.5766C10.8009%207.95408%2011.0129%208.46605%2011.0129%208.99988C11.0129%209.53371%2010.8009%2010.0457%2010.4234%2010.4232C10.0459%2010.8006%209.53395%2011.0127%209.00012%2011.0127ZM9.00012%207.99347C8.73321%207.99347%208.47722%208.0995%208.28848%208.28824C8.09975%208.47698%207.99371%208.73296%207.99371%208.99988C7.99371%209.26679%208.09975%209.52278%208.28848%209.71152C8.47722%209.90025%208.73321%2010.0063%209.00012%2010.0063C9.26704%2010.0063%209.52302%209.90025%209.71176%209.71152C9.9005%209.52278%2010.0065%209.26679%2010.0065%208.99988C10.0065%208.73296%209.9005%208.47698%209.71176%208.28824C9.52302%208.0995%209.26704%207.99347%209.00012%207.99347Z'%20fill='%23344A64'/%3e%3ccircle%20cx='2.96555'%20cy='15.1248'%20r='1.22238'%20fill='%23FFE250'/%3e%3ccircle%20cx='15.133'%20cy='15.1248'%20r='1.22238'%20fill='%23FFE250'/%3e%3ccircle%20cx='15.133'%20cy='2.89426'%20r='1.22238'%20fill='%23FFE250'/%3e%3ccircle%20cx='2.96555'%20cy='2.89426'%20r='1.22238'%20fill='%23FFE250'/%3e%3cpath%20d='M11.4468%2010.5942L14.0483%2013.1948C14.3509%2013.0275%2014.6901%2012.9363%2015.0366%2012.9312H15.0386C15.4553%2012.9312%2015.863%2013.0551%2016.2095%2013.2866C16.5558%2013.5181%2016.8254%2013.8471%2016.9849%2014.2319C17.1444%2014.617%2017.1863%2015.0409%2017.105%2015.4497C17.0236%2015.8584%2016.8235%2016.2341%2016.5288%2016.5288C16.2341%2016.8235%2015.8584%2017.0236%2015.4497%2017.105C15.0409%2017.1863%2014.617%2017.1444%2014.2319%2016.9849C13.8471%2016.8254%2013.5181%2016.5558%2013.2866%2016.2095C13.0551%2015.863%2012.9312%2015.4553%2012.9312%2015.0386V15.0366C12.9363%2014.6898%2013.0272%2014.3501%2013.1948%2014.0474L10.604%2011.437L10.5376%2011.3696L11.3804%2010.5269L11.4468%2010.5942ZM2.96143%2014.1265C2.7196%2014.1265%202.48789%2014.223%202.31689%2014.394C2.14594%2014.5651%202.04932%2014.7968%202.04932%2015.0386C2.04935%2015.2804%202.1459%2015.5121%202.31689%2015.6831C2.48789%2015.8541%202.7196%2015.9507%202.96143%2015.9507C3.20324%2015.9507%203.43494%2015.8541%203.60596%2015.6831C3.77696%2015.5121%203.8735%2015.2804%203.87354%2015.0386C3.87354%2014.7967%203.77698%2014.5651%203.60596%2014.394C3.43493%2014.223%203.20329%2014.1265%202.96143%2014.1265ZM15.0386%2014.1265C14.7967%2014.1265%2014.5651%2014.223%2014.394%2014.394C14.223%2014.5651%2014.1265%2014.7967%2014.1265%2015.0386C14.1265%2015.2804%2014.223%2015.5121%2014.394%2015.6831C14.5651%2015.8541%2014.7968%2015.9507%2015.0386%2015.9507C15.2804%2015.9507%2015.5121%2015.8541%2015.6831%2015.6831C15.8541%2015.5121%2015.9507%2015.2804%2015.9507%2015.0386C15.9507%2014.7968%2015.8541%2014.5651%2015.6831%2014.394C15.5121%2014.223%2015.2804%2014.1265%2015.0386%2014.1265ZM14.2319%201.01514C14.617%200.855643%2015.0409%200.81371%2015.4497%200.89502C15.8584%200.976353%2016.2341%201.17653%2016.5288%201.47119C16.8235%201.76585%2017.0236%202.1416%2017.105%202.55029C17.1863%202.95906%2017.1444%203.38301%2016.9849%203.76807C16.8254%204.15289%2016.5558%204.48189%2016.2095%204.71338C15.863%204.94491%2015.4553%205.06882%2015.0386%205.06885H15.0366C14.69%205.06369%2014.351%204.97171%2014.0483%204.8042L11.437%207.41162L11.3696%207.479L11.3022%207.41064L10.5933%206.68604L10.5278%206.61963L10.5942%206.55322L13.1948%203.95068C13.0277%203.64828%2012.9363%203.3096%2012.9312%202.96338V2.96143C12.9312%202.54469%2013.0551%202.13703%2013.2866%201.79053C13.5181%201.44423%2013.8471%201.17459%2014.2319%201.01514ZM2.55029%200.89502C2.95906%200.81371%203.38301%200.855643%203.76807%201.01514C4.15289%201.17459%204.48189%201.44422%204.71338%201.79053C4.9449%202.13703%205.06882%202.54469%205.06885%202.96143V2.96338C5.06369%203.31005%204.97171%203.64897%204.8042%203.95166L7.396%206.56299L7.4624%206.63037L6.61963%207.47314L6.55322%207.40576L3.95068%204.8042C3.64818%204.97145%203.30976%205.0637%202.96338%205.06885H2.96143C2.54469%205.06882%202.13703%204.9449%201.79053%204.71338C1.44422%204.48189%201.17459%204.15289%201.01514%203.76807C0.855643%203.38301%200.81371%202.95906%200.89502%202.55029C0.976353%202.1416%201.17653%201.76585%201.47119%201.47119C1.76585%201.17653%202.1416%200.976353%202.55029%200.89502ZM2.96143%202.04932C2.7196%202.04935%202.48789%202.1459%202.31689%202.31689C2.1459%202.48789%202.04935%202.7196%202.04932%202.96143C2.04932%203.20324%202.14595%203.43494%202.31689%203.60596C2.48789%203.77695%202.7196%203.8735%202.96143%203.87354C3.20329%203.87354%203.43493%203.77698%203.60596%203.60596C3.77698%203.43493%203.87354%203.20329%203.87354%202.96143C3.8735%202.7196%203.77695%202.48789%203.60596%202.31689C3.43494%202.14595%203.20324%202.04932%202.96143%202.04932ZM15.0386%202.04932C14.7968%202.04932%2014.5651%202.14594%2014.394%202.31689C14.223%202.48789%2014.1265%202.7196%2014.1265%202.96143C14.1265%203.20329%2014.223%203.43493%2014.394%203.60596C14.5651%203.77698%2014.7967%203.87354%2015.0386%203.87354C15.2804%203.8735%2015.5121%203.77696%2015.6831%203.60596C15.8541%203.43494%2015.9507%203.20324%2015.9507%202.96143C15.9507%202.7196%2015.8541%202.48789%2015.6831%202.31689C15.5121%202.1459%2015.2804%202.04935%2015.0386%202.04932ZM5.06885%2015.0386C5.06882%2015.4553%204.94491%2015.863%204.71338%2016.2095C4.48189%2016.5558%204.15289%2016.8254%203.76807%2016.9849C3.38301%2017.1444%202.95906%2017.1863%202.55029%2017.105C2.1416%2017.0236%201.76585%2016.8235%201.47119%2016.5288C1.17653%2016.2341%200.976353%2015.8584%200.89502%2015.4497C0.81371%2015.0409%200.855643%2014.617%201.01514%2014.2319C1.17459%2013.8471%201.44423%2013.5181%201.79053%2013.2866C2.13703%2013.0551%202.54469%2012.9312%202.96143%2012.9312H2.96338C3.3096%2012.9363%203.64828%2013.0277%203.95068%2013.1948L6.56299%2010.5884L6.63037%2010.521L6.69775%2010.5894L7.40674%2011.314L7.47217%2011.3804L4.8042%2014.0483C4.97171%2014.351%205.06369%2014.69%205.06885%2015.0366V15.0386Z'%20fill='%23344A64'%20stroke='%23344A64'%20stroke-width='0.188888'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_139_3606'%3e%3crect%20width='17.0498'%20height='17.0498'%20fill='white'%20transform='translate(0.475098%200.475098)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",gJ="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_750_5307)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.50021%204.52393L10.5002%2010.5201L16.5002%204.52393L17.378%205.56774V12.9049L16.5002%2014.2872H5.55771L3.7666%2013.6668V4.52393H4.50021Z'%20fill='%23FFE250'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15.75%203H5.25C4.00736%203%203%204.02335%203%205.28571V12.9048C3%2014.1671%204.00736%2015.1905%205.25%2015.1905H15.75C16.9926%2015.1905%2018%2014.1671%2018%2012.9048V5.28571C18%204.02335%2016.9926%203%2015.75%203ZM15.4425%204.52381L11.0325%209.00381C10.8917%209.14805%2010.7%209.22918%2010.5%209.22918C10.3%209.22918%2010.1083%209.14805%209.9675%209.00381L5.5575%204.52381H15.4425ZM15.75%2013.6667C16.1642%2013.6667%2016.5%2013.3256%2016.5%2012.9048V5.56762L12.09%2010.0476C11.2115%2010.9389%209.78845%2010.9389%208.91%2010.0476L4.5%205.56762V12.9048C4.5%2013.3256%204.83579%2013.6667%205.25%2013.6667H15.75Z'%20fill='%233E4C5A'/%3e%3ccircle%20cx='16.6587'%20cy='14.7451'%20r='3.86133'%20fill='%23F6F8FC'/%3e%3c/g%3e%3cpath%20d='M15.4392%2012.307C15.5441%2012.2488%2015.6577%2012.2474%2015.7683%2012.2972C15.8778%2012.3467%2015.9519%2012.4314%2015.988%2012.5453H15.99C16.0246%2012.649%2016.0227%2012.7548%2015.9851%2012.8578C15.9469%2012.9624%2015.8772%2013.0436%2015.78%2013.099L15.7791%2013.1C15.4768%2013.2667%2015.2361%2013.4968%2015.0564%2013.7914C14.8775%2014.0847%2014.7881%2014.4079%2014.7878%2014.7621C14.7879%2014.9952%2014.8323%2015.2218%2014.9207%2015.4427C14.9935%2015.625%2015.1022%2015.7953%2015.2449%2015.9564V15.7308C15.2449%2015.6126%2015.2862%2015.5087%2015.3689%2015.4261C15.4514%2015.3439%2015.5548%2015.3025%2015.6726%2015.3021C15.7909%2015.3018%2015.8954%2015.3433%2015.9783%2015.4261C16.061%2015.509%2016.1019%2015.6127%2016.1013%2015.7308V17.0443C16.1013%2017.1624%2016.0608%2017.2664%2015.9783%2017.349C15.8957%2017.4316%2015.7916%2017.4722%2015.6736%2017.472V17.473H14.3591C14.241%2017.4729%2014.1369%2017.4317%2014.0544%2017.349C13.9721%2017.2664%2013.9317%2017.1623%2013.9314%2017.0443C13.9312%2016.9261%2013.9725%2016.8223%2014.0554%2016.7396C14.1381%2016.6573%2014.2414%2016.6157%2014.3591%2016.6156H14.6726C14.4106%2016.3679%2014.2213%2016.087%2014.1091%2015.7719C13.9906%2015.4387%2013.9314%2015.1014%2013.9314%2014.7611C13.9315%2014.2287%2014.0675%2013.7433%2014.3406%2013.308C14.613%2012.8737%2014.9797%2012.5393%2015.4392%2012.307ZM18.9578%2012.0179C19.0759%2012.018%2019.1798%2012.0585%2019.2625%2012.141C19.3452%2012.2237%2019.3868%2012.3284%2019.3865%2012.4467C19.3861%2012.5644%2019.3445%2012.6677%2019.2625%2012.7504C19.1799%2012.8334%2019.0761%2012.8738%2018.9578%2012.8734V12.8744H18.6355C18.8857%2013.1365%2019.0745%2013.4199%2019.1951%2013.7279C19.3227%2014.0539%2019.3867%2014.3879%2019.3865%2014.7289C19.3864%2015.2614%2019.2495%2015.7466%2018.9763%2016.182C18.7039%2016.6163%2018.3372%2016.9506%2017.8777%2017.183L17.8767%2017.182C17.7719%2017.2399%2017.6599%2017.2426%2017.5496%2017.1927C17.4395%2017.143%2017.3633%2017.0585%2017.3269%2016.9437C17.2926%2016.8401%2017.2949%2016.735%2017.3328%2016.6322C17.3712%2016.5279%2017.4402%2016.4464%2017.5369%2016.391L17.5378%2016.39C17.8401%2016.2232%2018.0806%2015.993%2018.2605%2015.6986C18.4395%2015.4057%2018.5292%2015.0834%2018.5291%2014.7289C18.5291%2014.4955%2018.4856%2014.2682%2018.3972%2014.0472C18.3241%2013.8647%2018.2153%2013.6934%2018.072%2013.5316V13.7601C18.0719%2013.8782%2018.0315%2013.9822%2017.949%2014.0648C17.8663%2014.1475%2017.7615%2014.1881%2017.6433%2014.1879C17.5256%2014.1875%2017.4221%2014.1469%2017.3396%2014.0648C17.2569%2013.9824%2017.2157%2013.8783%2017.2156%2013.7601V12.4457C17.2157%2012.3275%2017.2569%2012.2234%2017.3396%2012.141C17.4221%2012.0589%2017.5256%2012.0183%2017.6433%2012.0179H18.9578Z'%20fill='%233E4C5A'%20stroke='%233E4C5A'%20stroke-width='0.2'/%3e%3cdefs%3e%3cclipPath%20id='clip0_750_5307'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",dJ="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_751_5597)'%3e%3cpath%20d='M15.4999%2014H14.7099L14.4299%2013.73C15.4099%2012.59%2015.9999%2011.11%2015.9999%209.5C15.9999%205.91%2013.0899%203%209.49991%203C6.07991%203%203.27991%205.64%203.02991%209H5.04991C5.29991%206.75%207.17991%205%209.49991%205C11.9899%205%2013.9999%207.01%2013.9999%209.5C13.9999%2011.99%2011.9899%2014%209.49991%2014C9.32991%2014%209.16991%2013.97%208.99991%2013.95V15.97C9.16991%2015.99%209.32991%2016%209.49991%2016C11.1099%2016%2012.5899%2015.41%2013.7299%2014.43L13.9999%2014.71V15.5L18.9999%2020.49L20.4899%2019L15.4999%2014Z'%20fill='%23344A64'/%3e%3c/g%3e%3ccircle%20cx='9.55469'%20cy='9.45557'%20r='4.49316'%20fill='%23FFE250'/%3e%3cg%20clip-path='url(%23clip1_751_5597)'%3e%3cpath%20d='M6.0747%2015.2672C6.00267%2015.2675%205.93225%2015.2459%205.87285%2015.2052C5.81344%2015.1645%205.76788%2015.1066%205.74225%2015.0393L5.17479%2013.5637C5.1633%2013.534%205.14572%2013.5069%205.12318%2013.4844C5.10064%2013.4619%205.07363%2013.4443%205.0439%2013.4328L3.56785%2012.8649C3.50061%2012.8391%203.44278%2012.7935%203.40199%2012.7342C3.36119%2012.6748%203.33936%2012.6045%203.33936%2012.5324C3.33936%2012.4604%203.36119%2012.3901%203.40199%2012.3308C3.44278%2012.2714%203.50061%2012.2258%203.56785%2012.2L5.04347%2011.6326C5.0732%2011.6211%205.10021%2011.6035%205.12275%2011.5809C5.14529%2011.5584%205.16288%2011.5314%205.17437%2011.5017L5.74225%2010.0256C5.76806%209.95838%205.81365%209.90054%205.873%209.85975C5.93235%209.81896%206.00268%209.79712%206.0747%209.79712C6.14671%209.79712%206.21704%209.81896%206.27639%209.85975C6.33574%209.90054%206.38133%209.95838%206.40713%2010.0256L6.9746%2011.5012C6.98609%2011.531%207.00367%2011.558%207.02621%2011.5805C7.04875%2011.6031%207.07575%2011.6206%207.10549%2011.6321L8.57259%2012.1966C8.64255%2012.2225%208.70283%2012.2694%208.74523%2012.3308C8.78756%2012.3923%208.80999%2012.4652%208.80944%2012.5399C8.80835%2012.6106%208.78603%2012.6794%208.74539%2012.7374C8.7048%2012.7953%208.64769%2012.8397%208.58156%2012.8649L7.10592%2013.4324C7.07618%2013.4439%207.04918%2013.4614%207.02664%2013.484C7.0041%2013.5065%206.98652%2013.5335%206.97502%2013.5633L6.40713%2015.0393C6.38151%2015.1066%206.33594%2015.1645%206.27654%2015.2052C6.21714%2015.2459%206.14671%2015.2675%206.0747%2015.2672Z'%20fill='%23FFE250'/%3e%3cpath%20d='M6.11108%209.5376L6.1687%209.5415L6.17651%209.54248C6.21226%209.54793%206.24734%209.55755%206.28101%209.5708L6.37769%209.62256L6.43433%209.66846C6.48712%209.71812%206.52824%209.77915%206.55444%209.84717L7.15503%2011.4067L8.71558%2012.0073C8.80679%2012.0425%208.88418%2012.1052%208.93921%2012.1851C8.99476%2012.2658%209.02515%2012.3618%209.02515%2012.4595C9.02501%2012.5565%208.99584%2012.6521%208.94019%2012.7329C8.88519%2012.8129%208.80718%2012.8754%208.71558%2012.9106L7.15405%2013.5093L6.55444%2015.0698C6.51941%2015.161%206.45806%2015.2401%206.37769%2015.2954C6.29731%2015.3505%206.2015%2015.3802%206.10425%2015.3804C6.00668%2015.3804%205.9105%2015.3508%205.82983%2015.2954C5.7501%2015.2405%205.68737%2015.1624%205.6521%2015.0708L5.05151%2013.5103L3.49194%2012.9097C3.40102%2012.8746%203.32263%2012.8132%203.26733%2012.7329C3.22581%2012.6725%203.19819%2012.6034%203.18726%2012.5317L3.18628%2012.5239L3.18237%2012.4663C3.18201%2012.4614%203.18201%2012.4565%203.18237%2012.4517L3.18628%2012.394L3.18726%2012.3862C3.19817%2012.3143%203.22587%2012.2455%203.26733%2012.1851L3.27124%2012.1792L3.30737%2012.1343L3.31226%2012.1274C3.36209%2012.0743%203.42404%2012.0335%203.49194%2012.0073L5.05151%2011.4067L5.6521%209.84717L5.65503%209.84033L5.67944%209.7876L5.68335%209.78076L5.7478%209.69385C5.77235%209.6672%205.79978%209.64323%205.82983%209.62256L5.83569%209.61768V9.61865L5.8855%209.58936L5.89233%209.58545L5.99487%209.54932C6.03039%209.54112%206.06746%209.5376%206.10425%209.5376H6.11108ZM5.67456%2011.7515C5.65029%2011.8145%205.61303%2011.8726%205.56519%2011.9204C5.51728%2011.9683%205.45923%2012.0055%205.39624%2012.0298L4.28003%2012.4575L5.39624%2012.8882L5.40112%2012.8901L5.43823%2012.9058L5.44312%2012.9087L5.50757%2012.9487C5.52783%2012.9635%205.54744%2012.9798%205.56519%2012.9976C5.6128%2013.0453%205.65032%2013.1026%205.67456%2013.1655L6.10327%2014.2798L6.53296%2013.1655L6.53491%2013.1606L6.55151%2013.1245L6.55347%2013.1196C6.5764%2013.0747%206.60647%2013.0334%206.64233%2012.9976L6.64624%2012.9927L6.67651%2012.9663L6.68042%2012.9634C6.71917%2012.9321%206.76287%2012.9065%206.8103%2012.8882L7.92456%2012.4585L6.8103%2012.0298C6.74749%2012.0056%206.69018%2011.9682%206.64233%2011.9204C6.59453%2011.8726%206.55723%2011.8146%206.53296%2011.7515L6.10229%2010.6353L5.67456%2011.7515Z'%20fill='%23344A64'%20stroke='%23344A64'%20stroke-width='0.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_751_5597'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_751_5597'%3e%3crect%20width='8.06842'%20height='8.06842'%20fill='white'%20transform='translate(3.02979%207.96582)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",CJ="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2020%2020'%20fill='none'%3e%3cg%20transform='translate(1.004%201.004)'%3e%3ccircle%20cx='12.5953'%20cy='12.4035'%20r='4.10637'%20fill='%23FFE250'/%3e%3cpath%20d='M12.5951%2012.2532C13.1515%2012.2532%2013.6027%2011.8021%2013.6027%2011.2456C13.6027%2010.6891%2013.1515%2010.238%2012.5951%2010.238C12.0386%2010.238%2011.5875%2010.6891%2011.5875%2011.2456C11.5875%2011.8021%2012.0386%2012.2532%2012.5951%2012.2532Z'%20fill='%23343C45'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.5948%2013.0445C11.938%2013.0445%2010.6246%2013.3683%2010.5796%2014.0161C11.0294%2014.6548%2011.7671%2015.0687%2012.5948%2015.0687C13.4224%2015.0687%2014.1602%2014.6548%2014.61%2014.0161C14.565%2013.3683%2013.2515%2013.0445%2012.5948%2013.0445Z'%20fill='%23343C45'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.4946%207.2781V2.94183L6.74731%200L0%202.94183V7.35907C0%2011.4434%202.87885%2015.2669%206.74731%2016.1936C7.24212%2016.0766%207.71893%2015.9057%208.18674%2015.6988C9.15835%2017.0842%2010.7687%2017.9928%2012.595%2017.9928C15.5728%2017.9928%2017.9928%2015.5728%2017.9928%2012.595C17.9928%209.92305%2016.0496%207.70993%2013.4946%207.2781ZM7.19713%2012.595C7.19713%2013.0988%207.26911%2013.5936%207.40405%2014.0524C7.18814%2014.1514%206.97222%2014.2503%206.74731%2014.3223C3.89545%2013.4227%201.79928%2010.5078%201.79928%207.35907V4.12036L6.74731%201.96122L11.6953%204.12036V7.2781C9.14036%207.70993%207.19713%209.92305%207.19713%2012.595ZM12.595%2016.1936C10.6068%2016.1936%208.99642%2014.5832%208.99642%2012.595C8.99642%2010.6068%2010.6068%208.99642%2012.595%208.99642C14.5832%208.99642%2016.1936%2010.6068%2016.1936%2012.595C16.1936%2014.5832%2014.5832%2016.1936%2012.595%2016.1936Z'%20fill='%23343C45'/%3e%3c/g%3e%3c/svg%3e",EJ="integration_sense",e2="email_log_settings",fJ="quick_access",oE="user_auth_enabled",IJ="This feature can only be used for one App and is currently enabled for :enabledConnector.",pJ=[{id:EJ,heading:"Smart Previews",subHeading:"Quickly view details from {{app_name}} by hovering on entities in emails.",icon:uJ,featureKey:Nj},{id:e2,heading:"Sync conversation",subHeading:"Save emails from Hiver to {{app_name}} to create a single source of truth for customer information.",icon:gJ,featureKey:kj,modalSettings:{title:"Tell us why you no longer want to use this feature",radioOptions:[{label:"We already use another tool for this",value:"already_using_another_extension"},{label:"We don't need to log emails",value:"do_not_have-email_logging_requirement"},{label:"The feature isn't working as expected",value:"not_working_as_expected"},{label:"Other",value:"other"}],textArea:{placeholder:"Tell us more (optional)"}}},{id:fJ,heading:"Quick Access",subHeading:"Access your {{app_name}} entities quickly with a single click.",icon:dJ,featureKey:Rj},{id:oE,heading:"User level authentication",subHeading:"Allow users to connect their own accounts and access data according to their permissions",icon:CJ,featureKey:Pj}],BJ="Advanced settings",hJ="Enhance your integrations with contextual insights and email logging.",Kc={title:"Confirm Changes?",description:"After enabling user-level authentication, users must connect their own accounts to access integration data.",confirmLabel:"Confirm",cancelLabel:"Cancel"},QJ=g.styled(({className:e,...t})=>c.jsx(g.Tooltip,{...t,classes:{popper:e}}))(({width:e,height:t,color:n})=>({[`& .${g.tooltipClasses.arrow}`]:{color:n||"#fff !important"},[`& .${g.tooltipClasses.tooltip}`]:{backgroundColor:n||"#fff",maxWidth:e,height:t,width:e,borderRadius:"6px",boxShadow:"0px 2px 10px 0px #00000026"}})),t2=e=>c.jsx(g.Button,{...e,disabled:e.isLoading||e.disabled,children:e.isLoading?c.jsx(g.CircularProgress,{sx:{color:"#97A3B7"},size:20}):e.label}),mJ=({onCancel:e,onSubmit:t,isLoading:n,showOptions:r=!0,title:o,feedbackOptions:A,placeholder:s})=>{const[a,i]=m.useState(""),[l,u]=m.useState(""),d=E=>{i(E.target.value)},f=E=>{E.stopPropagation();const{value:h}=(E==null?void 0:E.target)||{};u(h)},B=()=>{t({feedbackOption:a,feedbackComment:l})},I=()=>{e==null||e()},C=r?!a:!l;return c.jsxs("div",{className:"max-h-[420px] w-[510px] rounded-xl p-4 box-border [&>*]:box-border [&_.MuiFormGroup-root]:mb-3",children:[c.jsx(g.Typography,{variant:"h3",children:o}),c.jsx("div",{className:"border-b border-gray-6 mx-[-16px] my-3"}),r?c.jsx(g.FormControl,{children:c.jsx(g.RadioGroup,{"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:a,onChange:d,children:A.map(E=>c.jsx(g.FormControlLabel,{value:E.value,control:c.jsx(g.Radio,{}),label:E.label},E.value))})}):null,c.jsx(pC,{type:"text",placeholder:s,value:l,name:"feedbackComment",inputChangeHandler:f,multiline:!0,rows:5,limit:250,validation:{validate:vk()}}),c.jsxs("div",{className:"flex justify-end mt-8 gap-2",children:[c.jsx(g.Button,{variant:"text",color:"primary",style:{color:g.theme.palette.gray.gray3},disabled:n,onClick:I,children:"Cancel"}),c.jsx(t2,{variant:"contained",color:"primary",isLoading:n,disabled:C,label:"Submit",onClick:B})]})]})},yJ=({title:e,description:t,confirmLabel:n="Confirm",cancelLabel:r="Cancel",isLoading:o=!1,danger:A=!1,onConfirm:s,onCancel:a})=>c.jsxs("div",{className:"flex flex-col gap-6 p-5",style:{minWidth:360,maxWidth:440},children:[c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx(g.Typography,{sx:{fontFamily:"'Inter', sans-serif",fontWeight:500,fontSize:"18px",lineHeight:"28px",letterSpacing:"-0.09px",color:"#343C45",pr:"34px"},children:e}),c.jsx(g.Typography,{sx:{fontFamily:"'Inter', sans-serif",fontWeight:400,fontSize:"14px",lineHeight:"20px",letterSpacing:"-0.07px",color:"#4D596C"},children:t})]}),c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx(g.Button,{variant:"text",disabled:o,onClick:a,sx:{textTransform:"none",fontFamily:"'Inter', sans-serif",fontWeight:500,fontSize:"14px",lineHeight:"18px",padding:"9px 12px",borderRadius:"6px",minWidth:"auto",color:"#4D596C","&:hover":{color:"#4D596C",backgroundColor:"#F5F7FA"}},children:r}),c.jsx(t2,{variant:"contained",isLoading:o,label:n,onClick:s,disableElevation:!0,sx:{textTransform:"none",fontFamily:"'Inter', sans-serif",fontWeight:500,fontSize:"14px",lineHeight:"18px",padding:"9px 12px",borderRadius:"6px",minWidth:"auto",boxShadow:"none",...A?{backgroundColor:"#CD3746","&:hover":{backgroundColor:"#B83340",boxShadow:"none"}}:{}}})]})]}),bJ=wt+"/connectors/:connectorId/advanced-feature",xJ=wt+"/connectors/:connectorId/user-auth-enabled",vJ=`${wt}/connector/admin-feedback`,wJ=async(e,t)=>{try{const n=Lr(bJ,{connectorId:t})+"?channel_type=email",r=await Pe({url:n,method:zt.PATCH,data:e});return Dt({type:eo,message:"Successfully updated feature"}),r}catch(n){return Dt({type:Nn,message:"Failed to update feature"}),Promise.reject(n)}};function SJ(){return EA({mutationKey:["toggle-advanced-feature"],mutationFn:async({connectorId:e,data:t})=>{if(!e)throw new Error("Connector ID is required");const n=await wJ(t,e);return n==null?void 0:n.data}})}const TJ=async({connectorId:e,userAuthEnabled:t})=>{try{const n=Lr(xJ,{connectorId:e}),r=await Pe({url:n,method:zt.PATCH,data:{userAuthEnabled:t}});return Dt({type:eo,message:t?"Enabled user-level authentication":"Disabled user-level authentication"}),r}catch(n){return Dt({type:Nn,message:"Failed to update user-level authentication"}),Promise.reject(n)}};function _J(){return EA({mutationKey:["toggle-user-auth-enabled"],mutationFn:async({connectorId:e,userAuthEnabled:t})=>{if(!e)throw new Error("Connector ID is required");const n=await TJ({connectorId:e,userAuthEnabled:t});return n==null?void 0:n.data}})}const OJ=async({feedbackData:e})=>{try{const t=await Pe({url:vJ+"?channel_type=email",method:"POST",data:e});return t==null?void 0:t.data}catch(t){throw console.error("Error submitting feedback:",t),t}};function DJ(){return EA({mutationFn:OJ})}const LJ=({id:e,heading:t,subHeading:n,isEnabled:r,icon:o,connectorId:A,connectorType:s,modalSettings:a,disabled:i=!1,tooltipContent:l=""})=>{var S;const[u,d]=m.useState(!1),[f,B]=m.useState(r),[I,C]=m.useState(!1),[E,h]=m.useState(!1),p=Oe(ci)===pe.LOADING,{mutate:Q}=SJ(),{mutate:y}=_J(),{mutate:b}=DJ();m.useEffect(()=>{B(r)},[r]);const v=()=>{d(!0),y({connectorId:A,userAuthEnabled:!0},{onSettled:()=>{d(!1),h(!1)},onSuccess:R=>{(R==null?void 0:R.userAuthEnabled)!==void 0&&B(R.userAuthEnabled)}})},w=R=>{const O=R.target.checked;if(e===oE&&O){h(!0);return}if(d(!0),e===oE){y({connectorId:A,userAuthEnabled:O},{onSettled:()=>{d(!1)},onSuccess:N=>{(N==null?void 0:N.userAuthEnabled)!==void 0&&B(N.userAuthEnabled),(N==null?void 0:N.userAuthEnabled)===!1&&a&&C(!0)}});return}Q({connectorId:A,data:{[e]:O}},{onSettled:()=>{d(!1)},onSuccess:N=>{N.enabled!==void 0&&B(N.enabled),!O&&a&&C(!0)}})},x=R=>{const O={feedback_type:"email-logging-disabled",comment:R.feedbackComment,option:R.feedbackOption,connector_id:A,connector_type:s};b({feedbackData:O}),C(!1)};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"w-full flex justify-between items-start border-1 border-gray-5 rounded-sm p-4 gap-2.5 [&:first-child:last-child]:col-span-2",children:[c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("div",{className:"h-11 w-11 p-3 bg-gray-6a rounded-sm shrink-0 flex items-center justify-center",children:c.jsx("img",{src:o,alt:"Smart Previews Icon"})}),c.jsxs("div",{className:"flex flex-col items-start gap-1",children:[c.jsx("h3",{className:"font-semibold! text-body1",children:t}),c.jsx("p",{className:"text-body2",children:n})]})]}),c.jsx(QJ,{title:l,placement:"top",color:"#343C45",arrow:!0,width:"287px",children:c.jsx("div",{className:"w-12",children:c.jsx(k1,{id:`switch_${e}`,checked:f,onClick:R=>R==null?void 0:R.stopPropagation(),onChange:w,isLoading:u||p,disabled:u||p||i})})})]}),c.jsx(_A,{shown:I,setShown:C,borderRadius:12,sx:{zIndex:15002},children:c.jsx(mJ,{onCancel:()=>C(!1),onSubmit:x,isLoading:u,title:(a==null?void 0:a.title)||"",feedbackOptions:(a==null?void 0:a.radioOptions)||[],placeholder:((S=a==null?void 0:a.textArea)==null?void 0:S.placeholder)||""})}),c.jsx(_A,{shown:E,setShown:h,showCloseButton:!0,borderRadius:8,sx:{zIndex:15002},children:c.jsx(yJ,{title:Kc.title,description:Kc.description,confirmLabel:Kc.confirmLabel,cancelLabel:Kc.cancelLabel,isLoading:u,danger:!0,onConfirm:v,onCancel:()=>h(!1)})})]})},FJ=(e,t)=>typeof e[t]=="boolean",NJ=(e,t)=>{var n;return typeof e[t]=="object"&&typeof((n=e[t])==null?void 0:n.enabled)=="boolean"},RJ=e=>{const t={};for(const n in e)NJ(e,n)?t[n]=e[n]:FJ(e,n)&&(t[n]={enabled:e[n],connector:n===e2?e.connector:void 0});return t},kJ=({advancedFeatures:e,connectorId:t,connectorName:n,connectorType:r})=>{const{availableFeatures:o}=m.useContext(Qt),A=RJ(e),s=pJ.filter(l=>Ar(o,l.featureKey)&&typeof A[l.id]=="object");if(s.length===0)return null;const a=l=>A[l].enabled,i=l=>{var d;const u=A[l];return!a(l)&&((d=u==null?void 0:u.connector)!=null&&d.id)?{isDisabled:!0,tooltipContent:Lr(IJ,{enabledConnector:u.connector.name,currentConnector:n})}:{isDisabled:!1,tooltipContent:""}};return c.jsxs("div",{children:[c.jsx("h2",{className:"text-h2 text-[#4D596C]! mt-8 mb-2",children:BJ}),c.jsx("p",{className:"text-body2 text-[#6F7C90]!",children:hJ}),c.jsx("div",{className:"grid grid-cols-2 mt-6 gap-4",children:s.map(l=>{const{isDisabled:u,tooltipContent:d}=i(l.id);return c.jsx(LJ,{id:l.id,heading:l.heading.replace(/\{\{app_name\}\}/g,n),subHeading:l.subHeading.replace(/\{\{app_name\}\}/g,n),isEnabled:a(l.id),icon:l.icon,connectorId:t,connectorType:r,modalSettings:l.modalSettings,disabled:u,tooltipContent:d},l.id)})})]})},PJ=e=>_.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("g",{clipPath:"url(#clip0_1446_4479)"},_.createElement("path",{d:"M11.3333 2H3.33333C2.59333 2 2 2.6 2 3.33333V12.6667C2 13.4 2.59333 14 3.33333 14H12.6667C13.4 14 14 13.4 14 12.6667V4.66667L11.3333 2ZM8 12.6667C6.89333 12.6667 6 11.7733 6 10.6667C6 9.56 6.89333 8.66667 8 8.66667C9.10667 8.66667 10 9.56 10 10.6667C10 11.7733 9.10667 12.6667 8 12.6667ZM10 6H3.33333V3.33333H10V6Z",fill:"white"})),_.createElement("defs",null,_.createElement("clipPath",{id:"clip0_1446_4479"},_.createElement("rect",{width:16,height:16,fill:"white"})))),n2=e=>_.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.86993 0.652446C7.56922 0.248711 8.43078 0.248711 9.13007 0.652446L13.7981 3.34755C14.4974 3.75129 14.9282 4.49742 14.9282 5.30489V10.6951C14.9282 11.5026 14.4974 12.2487 13.7981 12.6524L9.13007 15.3476C8.43078 15.7513 7.56922 15.7513 6.86993 15.3476L2.20187 12.6524C1.50258 12.2487 1.0718 11.5026 1.0718 10.6951V5.30489C1.0718 4.49742 1.50258 3.75129 2.20187 3.34755L6.86993 0.652446Z",fill:"#FFD122"}),_.createElement("g",{filter:"url(#filter0_d_360_39563)"},_.createElement("path",{d:"M5.83154 4.43359V4.43359C6.84296 4.43359 7.66287 5.25351 7.66287 6.26492V11.5179V11.5179C6.65146 11.5179 5.83154 10.698 5.83154 9.68661V4.43359Z",fill:"white"})),_.createElement("g",{filter:"url(#filter1_d_360_39563)"},_.createElement("path",{d:"M8.57812 7.66211V7.66211C9.58954 7.66211 10.4095 8.48202 10.4095 9.49343V11.7103V11.7103C9.39804 11.7103 8.57812 10.8904 8.57812 9.87898V7.66211Z",fill:"white"})),_.createElement("defs",null,_.createElement("filter",{id:"filter0_d_360_39563",x:4.76488,y:3.36693,width:3.96488,height:9.21732,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},_.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),_.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),_.createElement("feOffset",null),_.createElement("feGaussianBlur",{stdDeviation:.533333}),_.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.114019 0"}),_.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_360_39563"}),_.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_360_39563",result:"shape"})),_.createElement("filter",{id:"filter1_d_360_39563",x:7.51146,y:6.59544,width:3.96488,height:6.18216,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},_.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),_.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),_.createElement("feOffset",null),_.createElement("feGaussianBlur",{stdDeviation:.533333}),_.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.114019 0"}),_.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_360_39563"}),_.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_360_39563",result:"shape"})))),MJ=({connectorId:e,connectorName:t,connectorLogo:n})=>{const{sendTrackingEvent:r}=m.useContext(Qt),[o,A]=m.useState(null),[s,a]=m.useState([]),[i,l]=m.useState(!1),[u,d]=m.useState(""),[f,B]=m.useState(!0),[I,C]=m.useState(!1);if(m.useEffect(()=>{(async()=>{var v;B(!0);try{const[w,x]=await Promise.all([VV(e),GV(e)]);A(w.data??null),a(((v=x.data)==null?void 0:v.presets)??[])}catch(w){Dt({message:Mc,type:Nn}),console.error(w)}finally{B(!1)}})()},[e]),f||s.length===0)return null;const E=s.find(b=>b.hiverParam===(o==null?void 0:o.hiverParam))??s[0],h=()=>{var w;r(Ye.LOOKUP_CONFIG_CLICKED,{connector_name:t,page:"connector_settings"});const b=(o==null?void 0:o.hiverParam)??E.hiverParam,v=s.some(x=>x.hiverParam===b);d(v?b:((w=s[0])==null?void 0:w.hiverParam)??""),l(!0)},p=async()=>{C(!0);try{await HV([{connectorId:e,hiverParam:u}]),A({connectorId:e,hiverParam:u}),r(Ye.LOOKUP_SAVED,{connector_name:t,hiver_param:u,page:"connector_settings"}),Dt({message:fH,type:eo}),l(!1)}catch{Dt({message:IH,type:Nn})}finally{C(!1)}},Q=EH.replace("%s",t),y=s.find(b=>b.hiverParam===(u||(o==null?void 0:o.hiverParam)))??s[0];return c.jsxs("div",{className:"border border-[#D6DDE8] rounded-lg bg-white p-4 mb-6",children:[c.jsxs("div",{className:"flex items-center justify-between mb-1",children:[c.jsx("span",{className:"text-h2 text-[#3E4C5A]!",children:uH}),i?c.jsx(g.Button,{variant:"contained",size:"small",startIcon:c.jsx(PJ,{}),onClick:p,disabled:I,children:CH}):c.jsx(g.Button,{variant:"outlined",color:"tertiary",size:"small",onClick:h,children:dH})]}),c.jsx("p",{className:"text-body2 text-[#6F7C90]! mb-6",children:gH}),i?c.jsxs("div",{className:"inline-flex items-center border border-[#ECEFF6] overflow-hidden p-3 rounded-[8px] w-full",children:[c.jsx(g.Select,{value:u,onChange:b=>{const v=b.target.value;r(Ye.LOOKUP_FIELD_CLICKED,{hiver_param:v,connector_name:t,page:"connector_settings"}),d(v)},size:"small",variant:"outlined",renderValue:b=>{var w;const v=((w=s.find(x=>x.hiverParam===b))==null?void 0:w.label)??"";return c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(n2,{className:"w-4 h-4 shrink-0"}),v]})},sx:{fontSize:"14px",width:"209px",height:"40px",background:"#F6F8FC",borderRadius:"8px",fontWeight:500,"& .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"}},children:s.map(b=>c.jsx(g.MenuItem,{value:b.hiverParam,sx:{fontSize:"14px"},children:b.label},b.hiverParam))}),c.jsx("div",{className:"h-px w-8 bg-[#ECEFF6] shrink-0"}),c.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 text-sm text-[#4D596C] rounded-full border-1 border-[#ECEFF6] h-[26px]",children:[n&&c.jsx("img",{src:n,alt:t,className:"w-4 h-4 object-contain shrink-0"}),Q]}),c.jsx("div",{className:"h-px w-8 bg-[#ECEFF6] shrink-0"}),c.jsx("div",{className:"px-4 py-2.5 text-sm text-[#4D596C] bg-[#F6F8FC] rounded-[8px] h-10 grow",children:y.objectParamLabel})]}):c.jsxs("div",{className:"inline-flex items-center border border-[#ECEFF6] overflow-hidden p-3 rounded-[8px] w-full",children:[c.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 text-sm text-[#4D596C] rounded-[8px] font-medium bg-[#F6F8FC] w-[209px] h-10",children:[c.jsx(n2,{className:"w-4 h-4 shrink-0"}),y.label]}),c.jsx("div",{className:"h-px w-8 bg-[#ECEFF6] shrink-0"}),c.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 text-sm text-[#4D596C] rounded-full border-1 border-[#ECEFF6] h-[26px]",children:[n&&c.jsx("img",{src:n,alt:t,className:"w-4 h-4 object-contain shrink-0"}),Q]}),c.jsx("div",{className:"h-px w-8 bg-[#ECEFF6] shrink-0"}),c.jsx("div",{className:"px-4 py-2.5 text-sm text-[#4D596C] bg-[#F6F8FC] rounded-[8px] h-10 grow",children:y.objectParamLabel})]})]})},jJ=({connectorData:e})=>{var B;const{cardList:t=[],name:n="",customCardsList:r=[],advancedFeatures:o={},type:A,logo:s=null}=e||{},[a,i]=m.useState(!1),{availableFeatures:l}=m.useContext(Qt),u=(B=yr())==null?void 0:B.tenantPlatform,d=Ar(l,u==="HIVERWEB"?`hot-${Rm}`:Rm),{id:f=""}=ko();return c.jsxs(c.Fragment,{children:[c.jsx(qC,{shown:a,setShown:i,connectorName:n}),c.jsx("h2",{className:"text-h2 text-[#4D596C]!",children:lH}),c.jsx("p",{className:"text-body2 text-[#6F7C90]! mb-6 mt-2",children:cH}),d&&c.jsx(MJ,{connectorId:f,connectorName:n,connectorLogo:s}),c.jsx(L1,{setShowEnabledModal:i,currentConnectorId:f,formDefaultsEnabled:e==null?void 0:e.formDefaultsEnabled,infoCards:[...t,...r]}),c.jsx(kJ,{advancedFeatures:o,connectorId:f,connectorName:n,connectorType:A})]})},VJ=()=>{const e=sr(),{sendTrackingEvent:t}=m.useContext(Qt),n=Oe(_C),r=Oe(ci),o=Oe(s1),A=Oe(to),s=Oe(ri),{id:a=""}=ko(),[i]=pA(),l=i.get("isEdit")==="true",u=i.get("tabIndex"),[d,f]=m.useState(()=>{const v=Number(u);return Number.isNaN(v)||v<0?0:v>Zc.length-1?Zc.length-1:v}),B=(v,w)=>{f(w)},I=(A==null?void 0:A[a])||null,C=(s==null?void 0:s[a])||null,E=l?I:C,h=!(E!=null&&E.isAuthenticated),p=!!(E!=null&&E.isEnabled),Q=[n,r].includes(pe.LOADING)||h,y=[{name:Lc,route:`${Xe.BASEPATH}${Xe.DASHBOARD}`},{name:(E==null?void 0:E.name)||"",route:`${Xe.BASEPATH}${Xe.API_VIEW}/${a}?isEdit=${String(l)}`},{name:Xz}],b=(v,w)=>{v==null||v.stopPropagation(),e(si({id:w,enabled:v.target.checked})).unwrap().then(()=>{v.target.checked?t(Ye.TOGGLE_ENABLED,{connector_name:E==null?void 0:E.name}):(t(Ye.TOGGLE_DISABLED,{connector_name:E==null?void 0:E.name}),Dt({message:Zm,type:wC}))}).catch(()=>{Dt({message:qm,type:Nn})})};return m.useEffect(()=>{e(ai()),l?(e(ii(a)),e(Vc(a))):e(oi(a))},[l,e,a]),c.jsxs("div",{className:"w-full h-full flex flex-col",children:[c.jsxs("div",{className:`flex flex-row justify-between ${l?"mb-2":"mb-9"}`,children:[c.jsx(R1,{options:y}),l?c.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[c.jsx($z,{active:p,label:c.jsx(g.Typography,{variant:"body2",children:p?"Active":"Inactive"})}),c.jsx(k1,{isLoading:(o==null?void 0:o[a])===pe.LOADING,id:`switch_${a}`,checked:p,disabled:Q,onClick:v=>v==null?void 0:v.stopPropagation(),onChange:v=>b(v,a)})]}):null]}),l?c.jsxs(c.Fragment,{children:[c.jsx("div",{children:c.jsxs(g.Tabs,{value:d,onChange:B,classes:{flexContainer:"border-b-2 border-[#D6DDE8]"},children:[c.jsx(g.Tab,{label:Zc[0],className:"border-b-0!"}),c.jsx(g.Tab,{label:Zc[1],className:"border-b-0!"})]})}),c.jsx("div",{hidden:d!==0,className:"grow overflow-auto py-6",children:c.jsx(K1,{connectorData:E})}),c.jsx("div",{hidden:d!==1,className:"grow overflow-auto py-6",children:c.jsx(jJ,{connectorData:E})})]}):c.jsx("div",{className:"grow overflow-auto py-0",children:c.jsx(K1,{connectorData:E})})]})},GJ=e=>e.auth.verifyTokenApiStatus,HJ=e=>e.auth.authVerificationDone,WJ=g.styled(g.Box)`
|
|
3468
|
+
`,AJ=({upgradeGuideContent:e,upgradeGuideLink:t})=>c.jsxs(eJ,{children:[c.jsxs(g.Stack,{marginBottom:"20px",children:[c.jsxs(g.Stack,{direction:"row",padding:"8px 0",gap:"4px",alignItems:"center",children:[c.jsx(tJ,{}),c.jsx(g.Typography,{variant:"body1_medium",color:g.theme.palette.gray.black,children:lY})]}),c.jsx(g.Typography,{variant:"body2",children:cY})]}),c.jsx(g.Typography,{variant:"body2_medium",marginBottom:"8px",color:g.theme.palette.gray.black,children:uY}),c.jsx(rJ,{variant:"body2",dangerouslySetInnerHTML:{__html:e}}),t?c.jsxs(nJ,{target:"_blank",underline:"none",href:t,children:[c.jsx(oJ,{}),gY]}):null]}),$1=(e,t)=>{const n=t.authType===di,r=t.authType===B1,o=t.authType===Ls;if(!e||!e.data)return{authUrl:"",authStatus:r?nt.API_KEY_FAILED:n?nt.BASIC_AUTH_FAILED:o?nt.OAUTH1_FAILED:nt.OAUTH_FAILED};const A=e.data;return r?{authUrl:"",id:A.id,authStatus:nt.API_KEY_SUCCESS}:n?{authUrl:"",id:A.id,authStatus:nt.BASIC_AUTH_SUCCESS}:o?{authUrl:"",id:A.id,authStatus:nt.OAUTH1_SUCCESS}:A.authorizationUrl?{authUrl:A.authorizationUrl,id:A.id,authStatus:nt.PENDING}:{authUrl:"",id:"",authStatus:nt.OAUTH_FAILED}},sJ=async e=>{try{const t=await Pe({url:tG,method:zt.POST,data:e});return $1(t,e.authDetails)}catch(t){return Promise.reject(t)}},aJ=async(e,t)=>{try{const n=rG.replace("{{id}}",t),r=await Pe({url:n,method:zt.PATCH,data:e});return $1(r,e.authDetails)}catch(n){return Promise.reject(n)}},iJ=({connectorId:e,onSuccess:t})=>{const n=Oo(),r=m.useMemo(()=>["authDetails",{connectorId:e}],[e]),{data:o}=Co({queryKey:r,queryFn:()=>Promise.resolve({authUrl:"",authStatus:nt.IDLE,id:""}),enabled:!1}),A=EA({mutationFn:a=>"connectorId"in a?aJ(a.data,a.connectorId):sJ(a.data),onSuccess:a=>{n.setQueryData(r,a),t==null||t()}});m.useEffect(()=>()=>{n.removeQueries({queryKey:r,exact:!0})},[n,r]);const s=m.useCallback(a=>{n.setQueryData(r,i=>i&&{...i,authStatus:a})},[r,n]);return{mutate:A.mutate,isLoading:A.isPending,data:o,mutateStatus:s}},lJ=async e=>{var t;try{const n=await Pe({url:Lr(AG,{connectorId:e}),method:zt.GET});return!n||!((t=n==null?void 0:n.data)!=null&&t.status)?{status:"failed"}:n==null?void 0:n.data}catch(n){return Promise.reject(n)}},cJ=({connectorId:e,enabled:t=!1})=>{const n=Oo(),r=m.useMemo(()=>["authSuccessStatus",{connectorId:e}],[e]),o=Co({queryKey:r,queryFn:()=>lJ(e),refetchInterval:A=>{var s,a;return((s=A.state.data)==null?void 0:s.status)==="failed"||((a=A.state.data)==null?void 0:a.status)==="success"?!1:500},enabled:t,refetchOnWindowFocus:!1,refetchIntervalInBackground:!0});return m.useEffect(()=>()=>{n.removeQueries({queryKey:r,exact:!0})},[n,r]),o},K1=({connectorData:e})=>{const{sendTrackingEvent:t,availableFeatures:n}=m.useContext(Qt),[r,o]=m.useState(!1),A=Oe(ci),s=Oe(zm),a=m.useRef(null),i=cn(),{id:l=""}=ko(),[u]=pA(),d=u.get("isEdit")==="true",f=!!(e!=null&&e.showUpgradeButton),B=Ar(n,Fj),{data:I,mutateStatus:C,isLoading:E,mutate:h}=iJ({connectorId:l,onSuccess:()=>{B&&o(!0)}}),p=cJ({connectorId:(I==null?void 0:I.id)||"",enabled:r}),{status:Q}=p.data||{},y=(I==null?void 0:I.authStatus)||nt.IDLE,b=(I==null?void 0:I.authUrl)||"",v=sr();m.useEffect(()=>()=>{v(iG())},[v]),m.useEffect(()=>{let x,S;const R=O=>{a.current&&O.origin===window.location.origin&&(O.data===P1||O.data===KC)&&(clearTimeout(x),a.current.close(),a.current=null,C(O.data===KC?nt.OAUTH_SUCCESS:nt.OAUTH_FAILED))};try{if(b){a.current=window.open(b,"_blank");const O=5*60*1e3;x=setTimeout(()=>{var N;(N=a.current)==null||N.close(),a.current=null,C(nt.OAUTH_FAILED)},O),S=setInterval(()=>{var N;(N=a.current)!=null&&N.closed&&(clearInterval(S),a.current=null,C(nt.OAUTH_FAILED))},500),window.addEventListener("message",R)}}catch(O){console.log("Error in Authentication",O)}return()=>{window.removeEventListener("message",R),clearTimeout(x),clearInterval(S)}},[b,v,C]),m.useEffect(()=>{Q&&Q!=="pending"&&a.current&&B&&(a.current.close(),a.current=null,C(Q==="success"?nt.OAUTH_SUCCESS:nt.OAUTH_FAILED))},[Q,C,B]),m.useEffect(()=>{switch((y===nt.OAUTH1_FAILED||y===nt.OAUTH_FAILED||y===nt.API_KEY_FAILED||y===nt.BASIC_AUTH_FAILED)&&i(Xe.BASEPATH),(y===nt.OAUTH1_SUCCESS||y===nt.OAUTH_SUCCESS||y===nt.API_KEY_SUCCESS||y===nt.BASIC_AUTH_SUCCESS)&&I!=null&&I.id&&i(d?Xe.BASEPATH:`${Xe.BASEPATH}${Xe.CONNECTOR_INITIAL_SETUP}/${l}?connectorId=${I.id}`),y){case nt.BASIC_AUTH_SUCCESS:case nt.OAUTH1_SUCCESS:case nt.OAUTH_SUCCESS:{Dt({message:f?M1:nY,type:eo}),t(Ye.CONNECTOR_AUTH_SUCCESS,{connector_name:e==null?void 0:e.name});break}case nt.BASIC_AUTH_FAILED:case nt.OAUTH1_FAILED:case nt.OAUTH_FAILED:{Dt({message:f?j1:rY,type:Nn});break}case nt.REQUEST_FAILED:{Dt({message:Mc,type:Nn});break}case nt.API_KEY_SUCCESS:{Dt({message:f?M1:AY,type:eo}),t(Ye.CONNECTOR_AUTH_SUCCESS,{connector_name:e==null?void 0:e.name});break}case nt.API_KEY_FAILED:{Dt({message:f?j1:Mc,type:Nn});break}}},[y,i,f,l,d,e==null?void 0:e.name,t,I==null?void 0:I.id]);const w=A===pe.LOADING||s===pe.LOADING;return c.jsxs(KY,{direction:"row",id:"connectors-auth-page",children:[c.jsx("div",{className:"flex flex-col",children:c.jsx(VY,{connectorId:l,isEdit:d,connectorData:e,authStatus:y,isLoading:w,authMutate:h,isAuthPending:E})}),c.jsxs(g.Stack,{gap:"36px",width:"322px",className:"connector-auth-help",children:[e!=null&&e.upgradeGuideContent?c.jsx(AJ,{upgradeGuideContent:e.upgradeGuideContent,upgradeGuideLink:e.upgradeGuideLink}):null,c.jsxs(g.Stack,{gap:"12px",children:[c.jsx(g.Typography,{variant:"h2",marginBottom:"8px",children:eW}),d?null:c.jsx(JC,{isSettingsPage:!0}),c.jsx($Y,{connectorName:e==null?void 0:e.name,supportLinks:e==null?void 0:e.supportLinks})]})]})]})},uJ="data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_139_3606)'%3e%3cpath%20d='M9.00012%2011.0127C8.46629%2011.0127%207.95432%2010.8006%207.57685%2010.4232C7.19937%2010.0457%206.9873%209.53371%206.9873%208.99988C6.9873%208.46605%207.19937%207.95408%207.57685%207.5766C7.95432%207.19912%208.46629%206.98706%209.00012%206.98706C9.53395%206.98706%2010.0459%207.19912%2010.4234%207.5766C10.8009%207.95408%2011.0129%208.46605%2011.0129%208.99988C11.0129%209.53371%2010.8009%2010.0457%2010.4234%2010.4232C10.0459%2010.8006%209.53395%2011.0127%209.00012%2011.0127ZM9.00012%207.99347C8.73321%207.99347%208.47722%208.0995%208.28848%208.28824C8.09975%208.47698%207.99371%208.73296%207.99371%208.99988C7.99371%209.26679%208.09975%209.52278%208.28848%209.71152C8.47722%209.90025%208.73321%2010.0063%209.00012%2010.0063C9.26704%2010.0063%209.52302%209.90025%209.71176%209.71152C9.9005%209.52278%2010.0065%209.26679%2010.0065%208.99988C10.0065%208.73296%209.9005%208.47698%209.71176%208.28824C9.52302%208.0995%209.26704%207.99347%209.00012%207.99347Z'%20fill='%23344A64'/%3e%3ccircle%20cx='2.96555'%20cy='15.1248'%20r='1.22238'%20fill='%23FFE250'/%3e%3ccircle%20cx='15.133'%20cy='15.1248'%20r='1.22238'%20fill='%23FFE250'/%3e%3ccircle%20cx='15.133'%20cy='2.89426'%20r='1.22238'%20fill='%23FFE250'/%3e%3ccircle%20cx='2.96555'%20cy='2.89426'%20r='1.22238'%20fill='%23FFE250'/%3e%3cpath%20d='M11.4468%2010.5942L14.0483%2013.1948C14.3509%2013.0275%2014.6901%2012.9363%2015.0366%2012.9312H15.0386C15.4553%2012.9312%2015.863%2013.0551%2016.2095%2013.2866C16.5558%2013.5181%2016.8254%2013.8471%2016.9849%2014.2319C17.1444%2014.617%2017.1863%2015.0409%2017.105%2015.4497C17.0236%2015.8584%2016.8235%2016.2341%2016.5288%2016.5288C16.2341%2016.8235%2015.8584%2017.0236%2015.4497%2017.105C15.0409%2017.1863%2014.617%2017.1444%2014.2319%2016.9849C13.8471%2016.8254%2013.5181%2016.5558%2013.2866%2016.2095C13.0551%2015.863%2012.9312%2015.4553%2012.9312%2015.0386V15.0366C12.9363%2014.6898%2013.0272%2014.3501%2013.1948%2014.0474L10.604%2011.437L10.5376%2011.3696L11.3804%2010.5269L11.4468%2010.5942ZM2.96143%2014.1265C2.7196%2014.1265%202.48789%2014.223%202.31689%2014.394C2.14594%2014.5651%202.04932%2014.7968%202.04932%2015.0386C2.04935%2015.2804%202.1459%2015.5121%202.31689%2015.6831C2.48789%2015.8541%202.7196%2015.9507%202.96143%2015.9507C3.20324%2015.9507%203.43494%2015.8541%203.60596%2015.6831C3.77696%2015.5121%203.8735%2015.2804%203.87354%2015.0386C3.87354%2014.7967%203.77698%2014.5651%203.60596%2014.394C3.43493%2014.223%203.20329%2014.1265%202.96143%2014.1265ZM15.0386%2014.1265C14.7967%2014.1265%2014.5651%2014.223%2014.394%2014.394C14.223%2014.5651%2014.1265%2014.7967%2014.1265%2015.0386C14.1265%2015.2804%2014.223%2015.5121%2014.394%2015.6831C14.5651%2015.8541%2014.7968%2015.9507%2015.0386%2015.9507C15.2804%2015.9507%2015.5121%2015.8541%2015.6831%2015.6831C15.8541%2015.5121%2015.9507%2015.2804%2015.9507%2015.0386C15.9507%2014.7968%2015.8541%2014.5651%2015.6831%2014.394C15.5121%2014.223%2015.2804%2014.1265%2015.0386%2014.1265ZM14.2319%201.01514C14.617%200.855643%2015.0409%200.81371%2015.4497%200.89502C15.8584%200.976353%2016.2341%201.17653%2016.5288%201.47119C16.8235%201.76585%2017.0236%202.1416%2017.105%202.55029C17.1863%202.95906%2017.1444%203.38301%2016.9849%203.76807C16.8254%204.15289%2016.5558%204.48189%2016.2095%204.71338C15.863%204.94491%2015.4553%205.06882%2015.0386%205.06885H15.0366C14.69%205.06369%2014.351%204.97171%2014.0483%204.8042L11.437%207.41162L11.3696%207.479L11.3022%207.41064L10.5933%206.68604L10.5278%206.61963L10.5942%206.55322L13.1948%203.95068C13.0277%203.64828%2012.9363%203.3096%2012.9312%202.96338V2.96143C12.9312%202.54469%2013.0551%202.13703%2013.2866%201.79053C13.5181%201.44423%2013.8471%201.17459%2014.2319%201.01514ZM2.55029%200.89502C2.95906%200.81371%203.38301%200.855643%203.76807%201.01514C4.15289%201.17459%204.48189%201.44422%204.71338%201.79053C4.9449%202.13703%205.06882%202.54469%205.06885%202.96143V2.96338C5.06369%203.31005%204.97171%203.64897%204.8042%203.95166L7.396%206.56299L7.4624%206.63037L6.61963%207.47314L6.55322%207.40576L3.95068%204.8042C3.64818%204.97145%203.30976%205.0637%202.96338%205.06885H2.96143C2.54469%205.06882%202.13703%204.9449%201.79053%204.71338C1.44422%204.48189%201.17459%204.15289%201.01514%203.76807C0.855643%203.38301%200.81371%202.95906%200.89502%202.55029C0.976353%202.1416%201.17653%201.76585%201.47119%201.47119C1.76585%201.17653%202.1416%200.976353%202.55029%200.89502ZM2.96143%202.04932C2.7196%202.04935%202.48789%202.1459%202.31689%202.31689C2.1459%202.48789%202.04935%202.7196%202.04932%202.96143C2.04932%203.20324%202.14595%203.43494%202.31689%203.60596C2.48789%203.77695%202.7196%203.8735%202.96143%203.87354C3.20329%203.87354%203.43493%203.77698%203.60596%203.60596C3.77698%203.43493%203.87354%203.20329%203.87354%202.96143C3.8735%202.7196%203.77695%202.48789%203.60596%202.31689C3.43494%202.14595%203.20324%202.04932%202.96143%202.04932ZM15.0386%202.04932C14.7968%202.04932%2014.5651%202.14594%2014.394%202.31689C14.223%202.48789%2014.1265%202.7196%2014.1265%202.96143C14.1265%203.20329%2014.223%203.43493%2014.394%203.60596C14.5651%203.77698%2014.7967%203.87354%2015.0386%203.87354C15.2804%203.8735%2015.5121%203.77696%2015.6831%203.60596C15.8541%203.43494%2015.9507%203.20324%2015.9507%202.96143C15.9507%202.7196%2015.8541%202.48789%2015.6831%202.31689C15.5121%202.1459%2015.2804%202.04935%2015.0386%202.04932ZM5.06885%2015.0386C5.06882%2015.4553%204.94491%2015.863%204.71338%2016.2095C4.48189%2016.5558%204.15289%2016.8254%203.76807%2016.9849C3.38301%2017.1444%202.95906%2017.1863%202.55029%2017.105C2.1416%2017.0236%201.76585%2016.8235%201.47119%2016.5288C1.17653%2016.2341%200.976353%2015.8584%200.89502%2015.4497C0.81371%2015.0409%200.855643%2014.617%201.01514%2014.2319C1.17459%2013.8471%201.44423%2013.5181%201.79053%2013.2866C2.13703%2013.0551%202.54469%2012.9312%202.96143%2012.9312H2.96338C3.3096%2012.9363%203.64828%2013.0277%203.95068%2013.1948L6.56299%2010.5884L6.63037%2010.521L6.69775%2010.5894L7.40674%2011.314L7.47217%2011.3804L4.8042%2014.0483C4.97171%2014.351%205.06369%2014.69%205.06885%2015.0366V15.0386Z'%20fill='%23344A64'%20stroke='%23344A64'%20stroke-width='0.188888'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_139_3606'%3e%3crect%20width='17.0498'%20height='17.0498'%20fill='white'%20transform='translate(0.475098%200.475098)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",gJ="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_750_5307)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.50021%204.52393L10.5002%2010.5201L16.5002%204.52393L17.378%205.56774V12.9049L16.5002%2014.2872H5.55771L3.7666%2013.6668V4.52393H4.50021Z'%20fill='%23FFE250'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15.75%203H5.25C4.00736%203%203%204.02335%203%205.28571V12.9048C3%2014.1671%204.00736%2015.1905%205.25%2015.1905H15.75C16.9926%2015.1905%2018%2014.1671%2018%2012.9048V5.28571C18%204.02335%2016.9926%203%2015.75%203ZM15.4425%204.52381L11.0325%209.00381C10.8917%209.14805%2010.7%209.22918%2010.5%209.22918C10.3%209.22918%2010.1083%209.14805%209.9675%209.00381L5.5575%204.52381H15.4425ZM15.75%2013.6667C16.1642%2013.6667%2016.5%2013.3256%2016.5%2012.9048V5.56762L12.09%2010.0476C11.2115%2010.9389%209.78845%2010.9389%208.91%2010.0476L4.5%205.56762V12.9048C4.5%2013.3256%204.83579%2013.6667%205.25%2013.6667H15.75Z'%20fill='%233E4C5A'/%3e%3ccircle%20cx='16.6587'%20cy='14.7451'%20r='3.86133'%20fill='%23F6F8FC'/%3e%3c/g%3e%3cpath%20d='M15.4392%2012.307C15.5441%2012.2488%2015.6577%2012.2474%2015.7683%2012.2972C15.8778%2012.3467%2015.9519%2012.4314%2015.988%2012.5453H15.99C16.0246%2012.649%2016.0227%2012.7548%2015.9851%2012.8578C15.9469%2012.9624%2015.8772%2013.0436%2015.78%2013.099L15.7791%2013.1C15.4768%2013.2667%2015.2361%2013.4968%2015.0564%2013.7914C14.8775%2014.0847%2014.7881%2014.4079%2014.7878%2014.7621C14.7879%2014.9952%2014.8323%2015.2218%2014.9207%2015.4427C14.9935%2015.625%2015.1022%2015.7953%2015.2449%2015.9564V15.7308C15.2449%2015.6126%2015.2862%2015.5087%2015.3689%2015.4261C15.4514%2015.3439%2015.5548%2015.3025%2015.6726%2015.3021C15.7909%2015.3018%2015.8954%2015.3433%2015.9783%2015.4261C16.061%2015.509%2016.1019%2015.6127%2016.1013%2015.7308V17.0443C16.1013%2017.1624%2016.0608%2017.2664%2015.9783%2017.349C15.8957%2017.4316%2015.7916%2017.4722%2015.6736%2017.472V17.473H14.3591C14.241%2017.4729%2014.1369%2017.4317%2014.0544%2017.349C13.9721%2017.2664%2013.9317%2017.1623%2013.9314%2017.0443C13.9312%2016.9261%2013.9725%2016.8223%2014.0554%2016.7396C14.1381%2016.6573%2014.2414%2016.6157%2014.3591%2016.6156H14.6726C14.4106%2016.3679%2014.2213%2016.087%2014.1091%2015.7719C13.9906%2015.4387%2013.9314%2015.1014%2013.9314%2014.7611C13.9315%2014.2287%2014.0675%2013.7433%2014.3406%2013.308C14.613%2012.8737%2014.9797%2012.5393%2015.4392%2012.307ZM18.9578%2012.0179C19.0759%2012.018%2019.1798%2012.0585%2019.2625%2012.141C19.3452%2012.2237%2019.3868%2012.3284%2019.3865%2012.4467C19.3861%2012.5644%2019.3445%2012.6677%2019.2625%2012.7504C19.1799%2012.8334%2019.0761%2012.8738%2018.9578%2012.8734V12.8744H18.6355C18.8857%2013.1365%2019.0745%2013.4199%2019.1951%2013.7279C19.3227%2014.0539%2019.3867%2014.3879%2019.3865%2014.7289C19.3864%2015.2614%2019.2495%2015.7466%2018.9763%2016.182C18.7039%2016.6163%2018.3372%2016.9506%2017.8777%2017.183L17.8767%2017.182C17.7719%2017.2399%2017.6599%2017.2426%2017.5496%2017.1927C17.4395%2017.143%2017.3633%2017.0585%2017.3269%2016.9437C17.2926%2016.8401%2017.2949%2016.735%2017.3328%2016.6322C17.3712%2016.5279%2017.4402%2016.4464%2017.5369%2016.391L17.5378%2016.39C17.8401%2016.2232%2018.0806%2015.993%2018.2605%2015.6986C18.4395%2015.4057%2018.5292%2015.0834%2018.5291%2014.7289C18.5291%2014.4955%2018.4856%2014.2682%2018.3972%2014.0472C18.3241%2013.8647%2018.2153%2013.6934%2018.072%2013.5316V13.7601C18.0719%2013.8782%2018.0315%2013.9822%2017.949%2014.0648C17.8663%2014.1475%2017.7615%2014.1881%2017.6433%2014.1879C17.5256%2014.1875%2017.4221%2014.1469%2017.3396%2014.0648C17.2569%2013.9824%2017.2157%2013.8783%2017.2156%2013.7601V12.4457C17.2157%2012.3275%2017.2569%2012.2234%2017.3396%2012.141C17.4221%2012.0589%2017.5256%2012.0183%2017.6433%2012.0179H18.9578Z'%20fill='%233E4C5A'%20stroke='%233E4C5A'%20stroke-width='0.2'/%3e%3cdefs%3e%3cclipPath%20id='clip0_750_5307'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",dJ="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_751_5597)'%3e%3cpath%20d='M15.4999%2014H14.7099L14.4299%2013.73C15.4099%2012.59%2015.9999%2011.11%2015.9999%209.5C15.9999%205.91%2013.0899%203%209.49991%203C6.07991%203%203.27991%205.64%203.02991%209H5.04991C5.29991%206.75%207.17991%205%209.49991%205C11.9899%205%2013.9999%207.01%2013.9999%209.5C13.9999%2011.99%2011.9899%2014%209.49991%2014C9.32991%2014%209.16991%2013.97%208.99991%2013.95V15.97C9.16991%2015.99%209.32991%2016%209.49991%2016C11.1099%2016%2012.5899%2015.41%2013.7299%2014.43L13.9999%2014.71V15.5L18.9999%2020.49L20.4899%2019L15.4999%2014Z'%20fill='%23344A64'/%3e%3c/g%3e%3ccircle%20cx='9.55469'%20cy='9.45557'%20r='4.49316'%20fill='%23FFE250'/%3e%3cg%20clip-path='url(%23clip1_751_5597)'%3e%3cpath%20d='M6.0747%2015.2672C6.00267%2015.2675%205.93225%2015.2459%205.87285%2015.2052C5.81344%2015.1645%205.76788%2015.1066%205.74225%2015.0393L5.17479%2013.5637C5.1633%2013.534%205.14572%2013.5069%205.12318%2013.4844C5.10064%2013.4619%205.07363%2013.4443%205.0439%2013.4328L3.56785%2012.8649C3.50061%2012.8391%203.44278%2012.7935%203.40199%2012.7342C3.36119%2012.6748%203.33936%2012.6045%203.33936%2012.5324C3.33936%2012.4604%203.36119%2012.3901%203.40199%2012.3308C3.44278%2012.2714%203.50061%2012.2258%203.56785%2012.2L5.04347%2011.6326C5.0732%2011.6211%205.10021%2011.6035%205.12275%2011.5809C5.14529%2011.5584%205.16288%2011.5314%205.17437%2011.5017L5.74225%2010.0256C5.76806%209.95838%205.81365%209.90054%205.873%209.85975C5.93235%209.81896%206.00268%209.79712%206.0747%209.79712C6.14671%209.79712%206.21704%209.81896%206.27639%209.85975C6.33574%209.90054%206.38133%209.95838%206.40713%2010.0256L6.9746%2011.5012C6.98609%2011.531%207.00367%2011.558%207.02621%2011.5805C7.04875%2011.6031%207.07575%2011.6206%207.10549%2011.6321L8.57259%2012.1966C8.64255%2012.2225%208.70283%2012.2694%208.74523%2012.3308C8.78756%2012.3923%208.80999%2012.4652%208.80944%2012.5399C8.80835%2012.6106%208.78603%2012.6794%208.74539%2012.7374C8.7048%2012.7953%208.64769%2012.8397%208.58156%2012.8649L7.10592%2013.4324C7.07618%2013.4439%207.04918%2013.4614%207.02664%2013.484C7.0041%2013.5065%206.98652%2013.5335%206.97502%2013.5633L6.40713%2015.0393C6.38151%2015.1066%206.33594%2015.1645%206.27654%2015.2052C6.21714%2015.2459%206.14671%2015.2675%206.0747%2015.2672Z'%20fill='%23FFE250'/%3e%3cpath%20d='M6.11108%209.5376L6.1687%209.5415L6.17651%209.54248C6.21226%209.54793%206.24734%209.55755%206.28101%209.5708L6.37769%209.62256L6.43433%209.66846C6.48712%209.71812%206.52824%209.77915%206.55444%209.84717L7.15503%2011.4067L8.71558%2012.0073C8.80679%2012.0425%208.88418%2012.1052%208.93921%2012.1851C8.99476%2012.2658%209.02515%2012.3618%209.02515%2012.4595C9.02501%2012.5565%208.99584%2012.6521%208.94019%2012.7329C8.88519%2012.8129%208.80718%2012.8754%208.71558%2012.9106L7.15405%2013.5093L6.55444%2015.0698C6.51941%2015.161%206.45806%2015.2401%206.37769%2015.2954C6.29731%2015.3505%206.2015%2015.3802%206.10425%2015.3804C6.00668%2015.3804%205.9105%2015.3508%205.82983%2015.2954C5.7501%2015.2405%205.68737%2015.1624%205.6521%2015.0708L5.05151%2013.5103L3.49194%2012.9097C3.40102%2012.8746%203.32263%2012.8132%203.26733%2012.7329C3.22581%2012.6725%203.19819%2012.6034%203.18726%2012.5317L3.18628%2012.5239L3.18237%2012.4663C3.18201%2012.4614%203.18201%2012.4565%203.18237%2012.4517L3.18628%2012.394L3.18726%2012.3862C3.19817%2012.3143%203.22587%2012.2455%203.26733%2012.1851L3.27124%2012.1792L3.30737%2012.1343L3.31226%2012.1274C3.36209%2012.0743%203.42404%2012.0335%203.49194%2012.0073L5.05151%2011.4067L5.6521%209.84717L5.65503%209.84033L5.67944%209.7876L5.68335%209.78076L5.7478%209.69385C5.77235%209.6672%205.79978%209.64323%205.82983%209.62256L5.83569%209.61768V9.61865L5.8855%209.58936L5.89233%209.58545L5.99487%209.54932C6.03039%209.54112%206.06746%209.5376%206.10425%209.5376H6.11108ZM5.67456%2011.7515C5.65029%2011.8145%205.61303%2011.8726%205.56519%2011.9204C5.51728%2011.9683%205.45923%2012.0055%205.39624%2012.0298L4.28003%2012.4575L5.39624%2012.8882L5.40112%2012.8901L5.43823%2012.9058L5.44312%2012.9087L5.50757%2012.9487C5.52783%2012.9635%205.54744%2012.9798%205.56519%2012.9976C5.6128%2013.0453%205.65032%2013.1026%205.67456%2013.1655L6.10327%2014.2798L6.53296%2013.1655L6.53491%2013.1606L6.55151%2013.1245L6.55347%2013.1196C6.5764%2013.0747%206.60647%2013.0334%206.64233%2012.9976L6.64624%2012.9927L6.67651%2012.9663L6.68042%2012.9634C6.71917%2012.9321%206.76287%2012.9065%206.8103%2012.8882L7.92456%2012.4585L6.8103%2012.0298C6.74749%2012.0056%206.69018%2011.9682%206.64233%2011.9204C6.59453%2011.8726%206.55723%2011.8146%206.53296%2011.7515L6.10229%2010.6353L5.67456%2011.7515Z'%20fill='%23344A64'%20stroke='%23344A64'%20stroke-width='0.2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_751_5597'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_751_5597'%3e%3crect%20width='8.06842'%20height='8.06842'%20fill='white'%20transform='translate(3.02979%207.96582)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",CJ="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2020%2020'%20fill='none'%3e%3cg%20transform='translate(1.004%201.004)'%3e%3ccircle%20cx='12.5953'%20cy='12.4035'%20r='4.10637'%20fill='%23FFE250'/%3e%3cpath%20d='M12.5951%2012.2532C13.1515%2012.2532%2013.6027%2011.8021%2013.6027%2011.2456C13.6027%2010.6891%2013.1515%2010.238%2012.5951%2010.238C12.0386%2010.238%2011.5875%2010.6891%2011.5875%2011.2456C11.5875%2011.8021%2012.0386%2012.2532%2012.5951%2012.2532Z'%20fill='%23343C45'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.5948%2013.0445C11.938%2013.0445%2010.6246%2013.3683%2010.5796%2014.0161C11.0294%2014.6548%2011.7671%2015.0687%2012.5948%2015.0687C13.4224%2015.0687%2014.1602%2014.6548%2014.61%2014.0161C14.565%2013.3683%2013.2515%2013.0445%2012.5948%2013.0445Z'%20fill='%23343C45'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M13.4946%207.2781V2.94183L6.74731%200L0%202.94183V7.35907C0%2011.4434%202.87885%2015.2669%206.74731%2016.1936C7.24212%2016.0766%207.71893%2015.9057%208.18674%2015.6988C9.15835%2017.0842%2010.7687%2017.9928%2012.595%2017.9928C15.5728%2017.9928%2017.9928%2015.5728%2017.9928%2012.595C17.9928%209.92305%2016.0496%207.70993%2013.4946%207.2781ZM7.19713%2012.595C7.19713%2013.0988%207.26911%2013.5936%207.40405%2014.0524C7.18814%2014.1514%206.97222%2014.2503%206.74731%2014.3223C3.89545%2013.4227%201.79928%2010.5078%201.79928%207.35907V4.12036L6.74731%201.96122L11.6953%204.12036V7.2781C9.14036%207.70993%207.19713%209.92305%207.19713%2012.595ZM12.595%2016.1936C10.6068%2016.1936%208.99642%2014.5832%208.99642%2012.595C8.99642%2010.6068%2010.6068%208.99642%2012.595%208.99642C14.5832%208.99642%2016.1936%2010.6068%2016.1936%2012.595C16.1936%2014.5832%2014.5832%2016.1936%2012.595%2016.1936Z'%20fill='%23343C45'/%3e%3c/g%3e%3c/svg%3e",EJ="integration_sense",e2="email_log_settings",fJ="quick_access",oE="user_auth_enabled",IJ="This feature can only be used for one App and is currently enabled for :enabledConnector.",pJ=[{id:EJ,heading:"Smart Previews",subHeading:"Quickly view details from {{app_name}} by hovering on entities in emails.",icon:uJ,featureKey:Nj},{id:e2,heading:"Sync conversation",subHeading:"Save emails from Hiver to {{app_name}} to create a single source of truth for customer information.",icon:gJ,featureKey:kj,modalSettings:{title:"Tell us why you no longer want to use this feature",radioOptions:[{label:"We already use another tool for this",value:"already_using_another_extension"},{label:"We don't need to log emails",value:"do_not_have-email_logging_requirement"},{label:"The feature isn't working as expected",value:"not_working_as_expected"},{label:"Other",value:"other"}],textArea:{placeholder:"Tell us more (optional)"}}},{id:fJ,heading:"Quick Access",subHeading:"Access your {{app_name}} entities quickly with a single click.",icon:dJ,featureKey:Rj},{id:oE,heading:"User level authentication",subHeading:"Allow users to connect their own accounts and access data according to their permissions",icon:CJ,featureKey:Pj}],BJ="Advanced settings",hJ="Enhance your integrations with contextual insights and email logging.",Kc={title:"Confirm Changes?",description:"After enabling user-level authentication, users must connect their own accounts to access integration data.",confirmLabel:"Confirm",cancelLabel:"Cancel"},QJ=g.styled(({className:e,...t})=>c.jsx(g.Tooltip,{...t,classes:{popper:e}}))(({width:e,height:t,color:n})=>({[`& .${g.tooltipClasses.arrow}`]:{color:n||"#fff !important"},[`& .${g.tooltipClasses.tooltip}`]:{backgroundColor:n||"#fff",maxWidth:e,height:t,width:e,borderRadius:"6px",boxShadow:"0px 2px 10px 0px #00000026"}})),t2=e=>c.jsx(g.Button,{...e,disabled:e.isLoading||e.disabled,children:e.isLoading?c.jsx(g.CircularProgress,{sx:{color:"#97A3B7"},size:20}):e.label}),mJ=({onCancel:e,onSubmit:t,isLoading:n,showOptions:r=!0,title:o,feedbackOptions:A,placeholder:s})=>{const[a,i]=m.useState(""),[l,u]=m.useState(""),d=E=>{i(E.target.value)},f=E=>{E.stopPropagation();const{value:h}=(E==null?void 0:E.target)||{};u(h)},B=()=>{t({feedbackOption:a,feedbackComment:l})},I=()=>{e==null||e()},C=r?!a:!l;return c.jsxs("div",{className:"max-h-[420px] w-[510px] rounded-xl p-4 box-border [&>*]:box-border [&_.MuiFormGroup-root]:mb-3",children:[c.jsx(g.Typography,{variant:"h3",children:o}),c.jsx("div",{className:"border-b border-gray-6 mx-[-16px] my-3"}),r?c.jsx(g.FormControl,{children:c.jsx(g.RadioGroup,{"aria-labelledby":"demo-controlled-radio-buttons-group",name:"controlled-radio-buttons-group",value:a,onChange:d,children:A.map(E=>c.jsx(g.FormControlLabel,{value:E.value,control:c.jsx(g.Radio,{}),label:E.label},E.value))})}):null,c.jsx(pC,{type:"text",placeholder:s,value:l,name:"feedbackComment",inputChangeHandler:f,multiline:!0,rows:5,limit:250,validation:{validate:vk()}}),c.jsxs("div",{className:"flex justify-end mt-8 gap-2",children:[c.jsx(g.Button,{variant:"text",color:"primary",style:{color:g.theme.palette.gray.gray3},disabled:n,onClick:I,children:"Cancel"}),c.jsx(t2,{variant:"contained",color:"primary",isLoading:n,disabled:C,label:"Submit",onClick:B})]})]})},yJ=({title:e,description:t,confirmLabel:n="Confirm",cancelLabel:r="Cancel",isLoading:o=!1,danger:A=!1,onConfirm:s,onCancel:a})=>c.jsxs("div",{className:"flex flex-col gap-6 p-5",style:{minWidth:360,maxWidth:440},children:[c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx(g.Typography,{sx:{fontWeight:500,fontSize:"18px",lineHeight:"28px",letterSpacing:"-0.09px",color:"#343C45",pr:"34px"},children:e}),c.jsx(g.Typography,{sx:{fontWeight:400,fontSize:"14px",lineHeight:"20px",letterSpacing:"-0.07px",color:"#4D596C"},children:t})]}),c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx(g.Button,{variant:"text",disabled:o,onClick:a,sx:{textTransform:"none",fontWeight:500,fontSize:"14px",lineHeight:"18px",padding:"9px 12px",borderRadius:"6px",minWidth:"auto",color:"#4D596C","&:hover":{color:"#4D596C",backgroundColor:"#F5F7FA"}},children:r}),c.jsx(t2,{variant:"contained",isLoading:o,label:n,onClick:s,disableElevation:!0,sx:{textTransform:"none",fontWeight:500,fontSize:"14px",lineHeight:"18px",padding:"9px 12px",borderRadius:"6px",minWidth:"auto",boxShadow:"none",...A?{backgroundColor:"#CD3746","&:hover":{backgroundColor:"#B83340",boxShadow:"none"}}:{}}})]})]}),bJ=wt+"/connectors/:connectorId/advanced-feature",xJ=wt+"/connectors/:connectorId/user-auth-enabled",vJ=`${wt}/connector/admin-feedback`,wJ=async(e,t)=>{try{const n=Lr(bJ,{connectorId:t})+"?channel_type=email",r=await Pe({url:n,method:zt.PATCH,data:e});return Dt({type:eo,message:"Successfully updated feature"}),r}catch(n){return Dt({type:Nn,message:"Failed to update feature"}),Promise.reject(n)}};function SJ(){return EA({mutationKey:["toggle-advanced-feature"],mutationFn:async({connectorId:e,data:t})=>{if(!e)throw new Error("Connector ID is required");const n=await wJ(t,e);return n==null?void 0:n.data}})}const TJ=async({connectorId:e,userAuthEnabled:t})=>{try{const n=Lr(xJ,{connectorId:e}),r=await Pe({url:n,method:zt.PATCH,data:{userAuthEnabled:t}});return Dt({type:eo,message:t?"Enabled user-level authentication":"Disabled user-level authentication"}),r}catch(n){return Dt({type:Nn,message:"Failed to update user-level authentication"}),Promise.reject(n)}};function _J(){return EA({mutationKey:["toggle-user-auth-enabled"],mutationFn:async({connectorId:e,userAuthEnabled:t})=>{if(!e)throw new Error("Connector ID is required");const n=await TJ({connectorId:e,userAuthEnabled:t});return n==null?void 0:n.data}})}const OJ=async({feedbackData:e})=>{try{const t=await Pe({url:vJ+"?channel_type=email",method:"POST",data:e});return t==null?void 0:t.data}catch(t){throw console.error("Error submitting feedback:",t),t}};function DJ(){return EA({mutationFn:OJ})}const LJ=({id:e,heading:t,subHeading:n,isEnabled:r,icon:o,connectorId:A,connectorType:s,modalSettings:a,disabled:i=!1,tooltipContent:l=""})=>{var S;const[u,d]=m.useState(!1),[f,B]=m.useState(r),[I,C]=m.useState(!1),[E,h]=m.useState(!1),p=Oe(ci)===pe.LOADING,{mutate:Q}=SJ(),{mutate:y}=_J(),{mutate:b}=DJ();m.useEffect(()=>{B(r)},[r]);const v=()=>{d(!0),y({connectorId:A,userAuthEnabled:!0},{onSettled:()=>{d(!1),h(!1)},onSuccess:R=>{(R==null?void 0:R.userAuthEnabled)!==void 0&&B(R.userAuthEnabled)}})},w=R=>{const O=R.target.checked;if(e===oE&&O){h(!0);return}if(d(!0),e===oE){y({connectorId:A,userAuthEnabled:O},{onSettled:()=>{d(!1)},onSuccess:N=>{(N==null?void 0:N.userAuthEnabled)!==void 0&&B(N.userAuthEnabled),(N==null?void 0:N.userAuthEnabled)===!1&&a&&C(!0)}});return}Q({connectorId:A,data:{[e]:O}},{onSettled:()=>{d(!1)},onSuccess:N=>{N.enabled!==void 0&&B(N.enabled),!O&&a&&C(!0)}})},x=R=>{const O={feedback_type:"email-logging-disabled",comment:R.feedbackComment,option:R.feedbackOption,connector_id:A,connector_type:s};b({feedbackData:O}),C(!1)};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"w-full flex justify-between items-start border-1 border-gray-5 rounded-sm p-4 gap-2.5 [&:first-child:last-child]:col-span-2",children:[c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("div",{className:"h-11 w-11 p-3 bg-gray-6a rounded-sm shrink-0 flex items-center justify-center",children:c.jsx("img",{src:o,alt:"Smart Previews Icon"})}),c.jsxs("div",{className:"flex flex-col items-start gap-1",children:[c.jsx("h3",{className:"font-semibold! text-body1",children:t}),c.jsx("p",{className:"text-body2",children:n})]})]}),c.jsx(QJ,{title:l,placement:"top",color:"#343C45",arrow:!0,width:"287px",children:c.jsx("div",{className:"w-12",children:c.jsx(k1,{id:`switch_${e}`,checked:f,onClick:R=>R==null?void 0:R.stopPropagation(),onChange:w,isLoading:u||p,disabled:u||p||i})})})]}),c.jsx(_A,{shown:I,setShown:C,borderRadius:12,sx:{zIndex:15002},children:c.jsx(mJ,{onCancel:()=>C(!1),onSubmit:x,isLoading:u,title:(a==null?void 0:a.title)||"",feedbackOptions:(a==null?void 0:a.radioOptions)||[],placeholder:((S=a==null?void 0:a.textArea)==null?void 0:S.placeholder)||""})}),c.jsx(_A,{shown:E,setShown:h,showCloseButton:!0,borderRadius:8,sx:{zIndex:15002},children:c.jsx(yJ,{title:Kc.title,description:Kc.description,confirmLabel:Kc.confirmLabel,cancelLabel:Kc.cancelLabel,isLoading:u,danger:!0,onConfirm:v,onCancel:()=>h(!1)})})]})},FJ=(e,t)=>typeof e[t]=="boolean",NJ=(e,t)=>{var n;return typeof e[t]=="object"&&typeof((n=e[t])==null?void 0:n.enabled)=="boolean"},RJ=e=>{const t={};for(const n in e)NJ(e,n)?t[n]=e[n]:FJ(e,n)&&(t[n]={enabled:e[n],connector:n===e2?e.connector:void 0});return t},kJ=({advancedFeatures:e,connectorId:t,connectorName:n,connectorType:r})=>{const{availableFeatures:o}=m.useContext(Qt),A=RJ(e),s=pJ.filter(l=>Ar(o,l.featureKey)&&typeof A[l.id]=="object");if(s.length===0)return null;const a=l=>A[l].enabled,i=l=>{var d;const u=A[l];return!a(l)&&((d=u==null?void 0:u.connector)!=null&&d.id)?{isDisabled:!0,tooltipContent:Lr(IJ,{enabledConnector:u.connector.name,currentConnector:n})}:{isDisabled:!1,tooltipContent:""}};return c.jsxs("div",{children:[c.jsx("h2",{className:"text-h2 text-[#4D596C]! mt-8 mb-2",children:BJ}),c.jsx("p",{className:"text-body2 text-[#6F7C90]!",children:hJ}),c.jsx("div",{className:"grid grid-cols-2 mt-6 gap-4",children:s.map(l=>{const{isDisabled:u,tooltipContent:d}=i(l.id);return c.jsx(LJ,{id:l.id,heading:l.heading.replace(/\{\{app_name\}\}/g,n),subHeading:l.subHeading.replace(/\{\{app_name\}\}/g,n),isEnabled:a(l.id),icon:l.icon,connectorId:t,connectorType:r,modalSettings:l.modalSettings,disabled:u,tooltipContent:d},l.id)})})]})},PJ=e=>_.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("g",{clipPath:"url(#clip0_1446_4479)"},_.createElement("path",{d:"M11.3333 2H3.33333C2.59333 2 2 2.6 2 3.33333V12.6667C2 13.4 2.59333 14 3.33333 14H12.6667C13.4 14 14 13.4 14 12.6667V4.66667L11.3333 2ZM8 12.6667C6.89333 12.6667 6 11.7733 6 10.6667C6 9.56 6.89333 8.66667 8 8.66667C9.10667 8.66667 10 9.56 10 10.6667C10 11.7733 9.10667 12.6667 8 12.6667ZM10 6H3.33333V3.33333H10V6Z",fill:"white"})),_.createElement("defs",null,_.createElement("clipPath",{id:"clip0_1446_4479"},_.createElement("rect",{width:16,height:16,fill:"white"})))),n2=e=>_.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.86993 0.652446C7.56922 0.248711 8.43078 0.248711 9.13007 0.652446L13.7981 3.34755C14.4974 3.75129 14.9282 4.49742 14.9282 5.30489V10.6951C14.9282 11.5026 14.4974 12.2487 13.7981 12.6524L9.13007 15.3476C8.43078 15.7513 7.56922 15.7513 6.86993 15.3476L2.20187 12.6524C1.50258 12.2487 1.0718 11.5026 1.0718 10.6951V5.30489C1.0718 4.49742 1.50258 3.75129 2.20187 3.34755L6.86993 0.652446Z",fill:"#FFD122"}),_.createElement("g",{filter:"url(#filter0_d_360_39563)"},_.createElement("path",{d:"M5.83154 4.43359V4.43359C6.84296 4.43359 7.66287 5.25351 7.66287 6.26492V11.5179V11.5179C6.65146 11.5179 5.83154 10.698 5.83154 9.68661V4.43359Z",fill:"white"})),_.createElement("g",{filter:"url(#filter1_d_360_39563)"},_.createElement("path",{d:"M8.57812 7.66211V7.66211C9.58954 7.66211 10.4095 8.48202 10.4095 9.49343V11.7103V11.7103C9.39804 11.7103 8.57812 10.8904 8.57812 9.87898V7.66211Z",fill:"white"})),_.createElement("defs",null,_.createElement("filter",{id:"filter0_d_360_39563",x:4.76488,y:3.36693,width:3.96488,height:9.21732,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},_.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),_.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),_.createElement("feOffset",null),_.createElement("feGaussianBlur",{stdDeviation:.533333}),_.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.114019 0"}),_.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_360_39563"}),_.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_360_39563",result:"shape"})),_.createElement("filter",{id:"filter1_d_360_39563",x:7.51146,y:6.59544,width:3.96488,height:6.18216,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},_.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),_.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),_.createElement("feOffset",null),_.createElement("feGaussianBlur",{stdDeviation:.533333}),_.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.114019 0"}),_.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_360_39563"}),_.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_360_39563",result:"shape"})))),MJ=({connectorId:e,connectorName:t,connectorLogo:n})=>{const{sendTrackingEvent:r}=m.useContext(Qt),[o,A]=m.useState(null),[s,a]=m.useState([]),[i,l]=m.useState(!1),[u,d]=m.useState(""),[f,B]=m.useState(!0),[I,C]=m.useState(!1);if(m.useEffect(()=>{(async()=>{var v;B(!0);try{const[w,x]=await Promise.all([VV(e),GV(e)]);A(w.data??null),a(((v=x.data)==null?void 0:v.presets)??[])}catch(w){Dt({message:Mc,type:Nn}),console.error(w)}finally{B(!1)}})()},[e]),f||s.length===0)return null;const E=s.find(b=>b.hiverParam===(o==null?void 0:o.hiverParam))??s[0],h=()=>{var w;r(Ye.LOOKUP_CONFIG_CLICKED,{connector_name:t,page:"connector_settings"});const b=(o==null?void 0:o.hiverParam)??E.hiverParam,v=s.some(x=>x.hiverParam===b);d(v?b:((w=s[0])==null?void 0:w.hiverParam)??""),l(!0)},p=async()=>{C(!0);try{await HV([{connectorId:e,hiverParam:u}]),A({connectorId:e,hiverParam:u}),r(Ye.LOOKUP_SAVED,{connector_name:t,hiver_param:u,page:"connector_settings"}),Dt({message:fH,type:eo}),l(!1)}catch{Dt({message:IH,type:Nn})}finally{C(!1)}},Q=EH.replace("%s",t),y=s.find(b=>b.hiverParam===(u||(o==null?void 0:o.hiverParam)))??s[0];return c.jsxs("div",{className:"border border-[#D6DDE8] rounded-lg bg-white p-4 mb-6",children:[c.jsxs("div",{className:"flex items-center justify-between mb-1",children:[c.jsx("span",{className:"text-h2 text-[#3E4C5A]!",children:uH}),i?c.jsx(g.Button,{variant:"contained",size:"small",startIcon:c.jsx(PJ,{}),onClick:p,disabled:I,children:CH}):c.jsx(g.Button,{variant:"outlined",color:"tertiary",size:"small",onClick:h,children:dH})]}),c.jsx("p",{className:"text-body2 text-[#6F7C90]! mb-6",children:gH}),i?c.jsxs("div",{className:"inline-flex items-center border border-[#ECEFF6] overflow-hidden p-3 rounded-[8px] w-full",children:[c.jsx(g.Select,{value:u,onChange:b=>{const v=b.target.value;r(Ye.LOOKUP_FIELD_CLICKED,{hiver_param:v,connector_name:t,page:"connector_settings"}),d(v)},size:"small",variant:"outlined",renderValue:b=>{var w;const v=((w=s.find(x=>x.hiverParam===b))==null?void 0:w.label)??"";return c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(n2,{className:"w-4 h-4 shrink-0"}),v]})},sx:{fontSize:"14px",width:"209px",height:"40px",background:"#F6F8FC",borderRadius:"8px",fontWeight:500,"& .MuiOutlinedInput-notchedOutline":{borderColor:"#ECEFF6"}},children:s.map(b=>c.jsx(g.MenuItem,{value:b.hiverParam,sx:{fontSize:"14px"},children:b.label},b.hiverParam))}),c.jsx("div",{className:"h-px w-8 bg-[#ECEFF6] shrink-0"}),c.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 text-sm text-[#4D596C] rounded-full border-1 border-[#ECEFF6] h-[26px]",children:[n&&c.jsx("img",{src:n,alt:t,className:"w-4 h-4 object-contain shrink-0"}),Q]}),c.jsx("div",{className:"h-px w-8 bg-[#ECEFF6] shrink-0"}),c.jsx("div",{className:"px-4 py-2.5 text-sm text-[#4D596C] bg-[#F6F8FC] rounded-[8px] h-10 grow",children:y.objectParamLabel})]}):c.jsxs("div",{className:"inline-flex items-center border border-[#ECEFF6] overflow-hidden p-3 rounded-[8px] w-full",children:[c.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 text-sm text-[#4D596C] rounded-[8px] font-medium bg-[#F6F8FC] w-[209px] h-10",children:[c.jsx(n2,{className:"w-4 h-4 shrink-0"}),y.label]}),c.jsx("div",{className:"h-px w-8 bg-[#ECEFF6] shrink-0"}),c.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 text-sm text-[#4D596C] rounded-full border-1 border-[#ECEFF6] h-[26px]",children:[n&&c.jsx("img",{src:n,alt:t,className:"w-4 h-4 object-contain shrink-0"}),Q]}),c.jsx("div",{className:"h-px w-8 bg-[#ECEFF6] shrink-0"}),c.jsx("div",{className:"px-4 py-2.5 text-sm text-[#4D596C] bg-[#F6F8FC] rounded-[8px] h-10 grow",children:y.objectParamLabel})]})]})},jJ=({connectorData:e})=>{var B;const{cardList:t=[],name:n="",customCardsList:r=[],advancedFeatures:o={},type:A,logo:s=null}=e||{},[a,i]=m.useState(!1),{availableFeatures:l}=m.useContext(Qt),u=(B=yr())==null?void 0:B.tenantPlatform,d=Ar(l,u==="HIVERWEB"?`hot-${Rm}`:Rm),{id:f=""}=ko();return c.jsxs(c.Fragment,{children:[c.jsx(qC,{shown:a,setShown:i,connectorName:n}),c.jsx("h2",{className:"text-h2 text-[#4D596C]!",children:lH}),c.jsx("p",{className:"text-body2 text-[#6F7C90]! mb-6 mt-2",children:cH}),d&&c.jsx(MJ,{connectorId:f,connectorName:n,connectorLogo:s}),c.jsx(L1,{setShowEnabledModal:i,currentConnectorId:f,formDefaultsEnabled:e==null?void 0:e.formDefaultsEnabled,infoCards:[...t,...r]}),c.jsx(kJ,{advancedFeatures:o,connectorId:f,connectorName:n,connectorType:A})]})},VJ=()=>{const e=sr(),{sendTrackingEvent:t}=m.useContext(Qt),n=Oe(_C),r=Oe(ci),o=Oe(s1),A=Oe(to),s=Oe(ri),{id:a=""}=ko(),[i]=pA(),l=i.get("isEdit")==="true",u=i.get("tabIndex"),[d,f]=m.useState(()=>{const v=Number(u);return Number.isNaN(v)||v<0?0:v>Zc.length-1?Zc.length-1:v}),B=(v,w)=>{f(w)},I=(A==null?void 0:A[a])||null,C=(s==null?void 0:s[a])||null,E=l?I:C,h=!(E!=null&&E.isAuthenticated),p=!!(E!=null&&E.isEnabled),Q=[n,r].includes(pe.LOADING)||h,y=[{name:Lc,route:`${Xe.BASEPATH}${Xe.DASHBOARD}`},{name:(E==null?void 0:E.name)||"",route:`${Xe.BASEPATH}${Xe.API_VIEW}/${a}?isEdit=${String(l)}`},{name:Xz}],b=(v,w)=>{v==null||v.stopPropagation(),e(si({id:w,enabled:v.target.checked})).unwrap().then(()=>{v.target.checked?t(Ye.TOGGLE_ENABLED,{connector_name:E==null?void 0:E.name}):(t(Ye.TOGGLE_DISABLED,{connector_name:E==null?void 0:E.name}),Dt({message:Zm,type:wC}))}).catch(()=>{Dt({message:qm,type:Nn})})};return m.useEffect(()=>{e(ai()),l?(e(ii(a)),e(Vc(a))):e(oi(a))},[l,e,a]),c.jsxs("div",{className:"w-full h-full flex flex-col",children:[c.jsxs("div",{className:`flex flex-row justify-between ${l?"mb-2":"mb-9"}`,children:[c.jsx(R1,{options:y}),l?c.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[c.jsx($z,{active:p,label:c.jsx(g.Typography,{variant:"body2",children:p?"Active":"Inactive"})}),c.jsx(k1,{isLoading:(o==null?void 0:o[a])===pe.LOADING,id:`switch_${a}`,checked:p,disabled:Q,onClick:v=>v==null?void 0:v.stopPropagation(),onChange:v=>b(v,a)})]}):null]}),l?c.jsxs(c.Fragment,{children:[c.jsx("div",{children:c.jsxs(g.Tabs,{value:d,onChange:B,classes:{flexContainer:"border-b-2 border-[#D6DDE8]"},children:[c.jsx(g.Tab,{label:Zc[0],className:"border-b-0!"}),c.jsx(g.Tab,{label:Zc[1],className:"border-b-0!"})]})}),c.jsx("div",{hidden:d!==0,className:"grow overflow-auto py-6",children:c.jsx(K1,{connectorData:E})}),c.jsx("div",{hidden:d!==1,className:"grow overflow-auto py-6",children:c.jsx(jJ,{connectorData:E})})]}):c.jsx("div",{className:"grow overflow-auto py-0",children:c.jsx(K1,{connectorData:E})})]})},GJ=e=>e.auth.verifyTokenApiStatus,HJ=e=>e.auth.authVerificationDone,WJ=g.styled(g.Box)`
|
|
3469
3469
|
position: fixed;
|
|
3470
3470
|
z-index: 1000;
|
|
3471
3471
|
background-color: #fff;
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/features/advanced-features/components/confirm-modal/index.tsx"],"names":[],"mappings":"AAIA,UAAU,iBAAiB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iEAAiE;IACjE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,8FAStB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/features/advanced-features/components/confirm-modal/index.tsx"],"names":[],"mappings":"AAIA,UAAU,iBAAiB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iEAAiE;IACjE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,8FAStB,iBAAiB,4CAmEnB,CAAC"}
|