@hiver/connector-agent 4.22.10-mondayEmailLog-beta.1 → 4.22.10-mondayEmailLog-beta.2

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
@@ -16044,16 +16044,17 @@ const Ew = {
16044
16044
  throw Ve.error(n), n;
16045
16045
  }
16046
16046
  }, i3 = (e, t) => {
16047
+ const n = e ?? {};
16047
16048
  if (!t)
16048
16049
  return { isApiEnabled: !0, args: {}, argsMap: t };
16049
- const n = {};
16050
- for (const r in t) {
16051
- const u = t[r], o = v5(e[u]) ? e[u].value : e[u];
16052
- if (!o)
16050
+ const r = {};
16051
+ for (const u in t) {
16052
+ const o = t[u], i = v5(n[o]) ? n[o].value : n[o];
16053
+ if (!i)
16053
16054
  return { isApiEnabled: !1, args: {} };
16054
- n[r] = o;
16055
+ r[u] = i;
16055
16056
  }
16056
- return { isApiEnabled: !0, args: n, argsMap: t };
16057
+ return { isApiEnabled: !0, args: r, argsMap: t };
16057
16058
  }, bs = (e) => JSON.stringify(e ?? null), y5 = (e, t) => e === t || bs(e) === bs(t), Iw = (e, t) => e.isApiEnabled === t.isApiEnabled && bs(e.args) === bs(t.args) && y5(e.argsMap, t.argsMap), Sw = ({
16058
16059
  formId: e,
16059
16060
  argsMap: t,
package/index.umd.js CHANGED
@@ -1741,7 +1741,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1741
1741
  border: 0;
1742
1742
  padding-left: ${nf};
1743
1743
  }
1744
- `;function KB(e){const[t,n]=g.useState(!1),u=g.useRef(null);g.useEffect(()=>{t&&u.current&&u.current.focus()},[t]);const r=(o,f)=>{o===null&&e.onChange(o,f),o&&typeof o.getTime=="function"&&!isNaN(o.getTime())&&e.onChange(o,f),e.onChange(o,f)};return a.jsx(UB,{inputFormat:e.inputFormat?e.inputFormat:Md.DATE,...e,value:e.value||null,open:t,onOpen:()=>n(!0),onClose:()=>n(!1),onChange:r,PopperProps:{anchorEl:u.current},renderInput:o=>a.jsx(s.DateTextField,{...o,fullWidth:!0,variant:"outlined",disabled:e.disabled,inputRef:u,inputProps:{...o.inputProps,placeholder:e.placeholder},onBlur:e.onBlur,onFocus:e.onFocus,InputProps:{endAdornment:a.jsx(s.InputAdornment,{position:"end",sx:{cursor:"pointer"},children:a.jsx(s.icons.CalendarTodayOutlinedIcon,{})})},onClick:()=>{t||n(!0)}})})}const $B=(e,t)=>({display:"inline-flex",alignItems:"center",gap:"2px",backgroundColor:"var(--connector-surface-active, #F6F8FC)",borderRadius:"4px",padding:"3px",width:"fit-content",height:"34px",boxSizing:"border-box",opacity:e?.6:1,pointerEvents:e?"none":"auto",...t}),ev=(e,t)=>({border:"none",borderRadius:"4px",backgroundColor:e?"var(--connector-segmented-selected-background, var(--connector-surface-elevated, #FFFFFF))":"transparent",color:e?"var(--connector-segmented-selected-text, var(--connector-accent, #196fe0))":"var(--connector-text-secondary, #3E4C5A)",boxShadow:e?"0px 1px 2px rgba(0, 0, 0, 0.08)":"none",minWidth:"56px",padding:"4px 16px",cursor:"pointer",fontSize:`${s.theme.typography.body2.fontSize}px`,height:"100%",transition:"background-color 0.15s ease, color 0.15s ease","&:hover":{color:e?"var(--connector-segmented-selected-text, var(--connector-accent, #196fe0))":"var(--connector-text-primary, #343C45)"},...t}),tv=[{label:"Yes",value:!0},{label:"No",value:!1}],Rd=({name:e,checked:t,disabled:n,className:u,styleOverrides:r,boxStyleOverrides:o,onChange:f})=>{const i=!!t,c=l=>D=>{if(D.preventDefault(),D.stopPropagation(),n||l===i)return;const A={target:{name:e,value:l,checked:l},currentTarget:{name:e,value:l,checked:l},stopPropagation:()=>{},preventDefault:()=>{}};f==null||f(A,l)};return a.jsx(s.Box,{sx:$B(n,r),className:u,role:"radiogroup","aria-label":e,children:tv.map(l=>{const D=l.value===i;return a.jsx(s.Box,{component:"button",type:"button",role:"radio","aria-checked":D,disabled:n,sx:ev(D,o),onClick:c(l.value),children:a.jsx(s.Typography,{variant:"caption",fontSize:(r==null?void 0:r.fontSize)||13,fontWeight:D?500:400,color:"inherit",children:l.label})},l.label)})})},nv="/v1/api"+"/templates/metadata",Hd={GET:"GET",POST:"POST",DELETE:"DELETE",PATCH:"PATCH",PUT:"PUT"},uv="Required Field",rv="Invalid date",Wd=/^https:\/\/([a-z0-9-]+(\.[a-z0-9-]+)+)(:[0-9]{1,5})?(\/[^\s/]*)*$/i,ov=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Gd="Please enter a valid URL",av="Please enter valid ID",sv="Please enter valid input",fv="URL must start with https://",iv="URL should not end with a slash",cv="Invalid email address",lv="Email must be a string",Vd="Invalid date",Dv="Date cannot be in the past",Av="Date cannot be in the future",dv="Invalid number",pv="Invalid text",gv=async e=>{const t=new URLSearchParams,{inboxIds:n,channelType:u,conversationId:r,fetchAuthenticatedConnectors:o}=e||{};return n==null||n.forEach(i=>{t.append("inbox_ids",i)}),[["channel_type",u],["conversation_id",r],["fetch_authenticated_connectors",o==null?void 0:o.toString()]].forEach(([i,c])=>{c!==void 0&&t.append(i,c)}),Fe({url:`${nv}?${t.toString()}`,method:Hd.GET})},Cv="/v1/api/connectors/ug",ei=async(e,t)=>{const n=new URLSearchParams;for(const[f,i]of Object.entries(e||{}))if(Array.isArray(i))i.forEach(c=>{c&&n.append(f,String(c))});else{if(!i)continue;n.append(f,i)}n.append(t?"onlyEnabled":"onlyEnabledAuthenticated","true"),n.append("minimal","true");const u=Cv+`?${n.toString()}`,r=await Fe({url:u,method:Hd.GET}),o=r==null?void 0:r.data;return Array.isArray(o)?o.map(({id:f,name:i,logo:c,type:l,connectorType:D,isConnectorAvailableInPlan:A})=>({id:f,name:i,logo:c,type:l,connectorType:D,isConnectorAvailableInPlan:A})).filter(({logo:f})=>!!f):[]};var ti=(e=>(e.ADD="ADD",e.MULTIPLY="MULTIPLY",e))(ti||{});const hv={[ti.ADD]:(e,t)=>e+t,[ti.MULTIPLY]:(e,t)=>e*t},Fv=e=>e,zd=()=>{if("crypto"in window&&"randomUUID"in window.crypto)return window.crypto.randomUUID();const e=Date.now().toString(16),t=Math.random().toString(16).substring(2,8);return`${e}-${t}`},Xd=(e,t)=>{let n;const u=hv[t]??Fv;for(const r of e){const o=Number(r);isNaN(o)||(n=n===void 0?o:u(n,o))}return(n??0).toFixed(2)},Zd=(e,t=n=>n)=>{const n=new Set,u=[];for(const r of e){const o=t(r);n.has(o)||(n.add(o),u.push(r))}return u},mv=(e,t)=>e.replace(/:(\w+)/g,(n,u)=>String(t[u])||""),Jd=e=>typeof e=="object"&&e!==null&&"value"in e&&"label"in e,Ev=/^\d{4}-\d{2}-\d{2}$/,Yd=e=>{if(typeof e=="string"){const o=e.trim();if(Ev.test(o))return o}const t=e instanceof Date?e:new Date(e);if(isNaN(t.getTime()))return typeof e=="string"?e:String(e);const n=t.getFullYear(),u=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${n}-${u}-${r}`},bv={GET:"GET",POST:"POST",DELETE:"DELETE",PATCH:"PATCH",PUT:"PUT"},xv="/v1/api/connectors/forms/:formId/get_forms_custom_fields",yv=async({formId:e,args:t})=>{try{const n=await Fe({url:mv(xv,{formId:e}),data:{args:t},method:bv.POST});return(n==null?void 0:n.data).fieldList}catch(n){throw Oe.error(n),n}},qd=(e,t)=>{if(!t)return{isApiEnabled:!0,args:{},argsMap:t};const n={};for(const u in t){const r=t[u],o=Jd(e[r])?e[r].value:e[r];if(!o)return{isApiEnabled:!1,args:{}};n[u]=o}return{isApiEnabled:!0,args:n,argsMap:t}},uf=e=>JSON.stringify(e??null),Ud=(e,t)=>e===t||uf(e)===uf(t),Bv=(e,t)=>e.isApiEnabled===t.isApiEnabled&&uf(e.args)===uf(t.args)&&Ud(e.argsMap,t.argsMap),vv=({formId:e,argsMap:t,formData:n,enabled:u=!0,delay:r=500})=>{const[o,f]=g.useState(()=>qd(n,t));g.useEffect(()=>{const l=setTimeout(()=>{f(D=>{const A=qd(n,t);return Bv(D,A)?D:A})},r);return()=>clearTimeout(l)},[n,t,r]);const i=Ud(o.argsMap,t),c=ot({queryKey:["customFormFields",e,o.args],queryFn:()=>yv({formId:e,args:o.args}),enabled:!!e&&u&&i&&o.isApiEnabled,staleTime:0});return{...c,data:o.isApiEnabled?c.data:void 0}},Kd=e=>{const t={current:null};return n=>{t.current&&clearTimeout(t.current),t.current=setTimeout(n,e)}};let Kr={};const wv={get length(){return Object.keys(Kr).length},getItem(e){return Kr[e]??null},setItem(e,t){Kr[e]=t},removeItem(e){delete Kr[e]},clear(){Kr={}},key(e){return Object.keys(Kr)[e]}},Sv={LOCAL:window==null?void 0:window.localStorage,SESSION:window==null?void 0:window.sessionStorage},oa=(e="LOCAL")=>Sv[e]??wv,$d=(e="LOCAL")=>{const t=oa(e);return{...t,getItem(n){const u=t.getItem(n);if(!u)return u;try{return JSON.parse(u)}catch(r){return Oe.warn(r),u}},setItem(n,u){try{const r=JSON.stringify(u);t.setItem(n,r)}catch(r){Oe.warn(r)}}}},ni=Symbol("root"),Iv="connectors-store",kv=e=>{const{name:t,initialState:n,persist:u,persistKey:r=`${Iv}-${t}`}=e,o=$d("LOCAL"),f={...n},i=u?o.getItem(r)??f:f,c=new Map,l=new Map;l.set(ni,new Set);const D=(C,p,d=!0)=>{var F;const h=Symbol("callback");c.set(h,C);const E=p||ni;if(l.has(E)||l.set(E,new Set),(F=l.get(E))==null||F.add(h),d){const b=p?i[p]:i;C(b)}return()=>{var b;c.delete(h),(b=l.get(E))==null||b.delete(h)}},A=(C,p)=>{p?i[p]=C:Object.assign(i,C),x();const d=p||ni,h=l.get(d);if(h)for(const E of h){const F=c.get(E);F==null||F(p?i[p]:i)}},m=C=>C?i[C]:{...i},x=()=>{u&&o.setItem(r,i)};return{subscribe:D,setData:A,getData:m}},Tv=e=>t=>{if(t&&typeof t=="string"){const n=t.replace(/\/$/,"");return n.startsWith("https://")?t.endsWith("/")?iv:Wd.test(n)?!0:e||Gd:fv}return!1},Lv=e=>t=>t&&typeof t=="string"?ov.test(t)?!0:e||cv:lv,Mv=e=>t=>t==null||t===""?e||uv:!0,Ov=e=>(t,n)=>{var u;if(!t||(t==null?void 0:t.toString())===rv)return Vd;if(typeof t=="object"){const r=t,o=new Date;o.setHours(0,0,0,0);const f=n.disablePast,i=n.disableFuture;return f&&r<o?e||Dv:i&&r>o?e||Av:!0}return typeof t=="string"&&((u=new Date(t))==null?void 0:u.toString())!=="Invalid Date"?!0:Vd},Nv=e=>(t,n)=>{if(t=Number(t),typeof t=="number"&&!isNaN(t)){const u=n.min,r=n.max;return u!==void 0&&t<u?e||`Value should not be less than ${u}`:r!==void 0&&t>r?e||`Value should not be greater than ${r}`:!0}return e||dv},ui=e=>(t,n)=>{if(typeof t=="string"){const u=n.limit;return u!==void 0&&t.length>u?e||`Maximum characters allowed are ${u}`:!0}return e||pv},jv=e=>t=>typeof t=="string"?t.startsWith("https:")?Wd.test(t)?!0:e||Gd:t.trim().length>0?!0:e||av:e||sv,Qv=["async-select","select","multi-select","reference"],e2=(e,t)=>{const n=Array.isArray(e)?e:e?[e]:[],u=Array.isArray(t)?t:t?[t]:[];return n.map((r,o)=>({value:r,label:u[o]??String(r)}))},t2=e=>{if(typeof e=="string"){const t=e.trim().toLowerCase();return t==="true"||t==="1"||t==="yes"}return!!e},n2=(e,t=!1)=>{const n={};for(const u in e){const r=e[u];if(!r)continue;if(r.type==="checkbox"){n[u]=t2(r.value??r.label);continue}if(!(r!=null&&r.label)&&!(r!=null&&r.value))continue;const o=r.label??r.value??"",f=Array.isArray(o)?o[0]??"":o;if(t&&r.type==="date"){const i=isNaN(Number(f))?f:Number(f),c=new Date(i);n[u]=isNaN(c.getTime())?f:c.toISOString();continue}if(Qv.includes(r.type)){r.type==="multi-select"?n[u]=e2(r.value,r.label):n[u]={label:r.label,value:r.value};continue}n[u]=f}return n},_v=(e,t)=>{const n={};for(const r of t)n[r.name]=r.type;const u={};for(const r in e){const o=e[r];if(Array.isArray(o)){const f=o.map(i=>i&&typeof i=="object"&&"value"in i&&"label"in i?i:{value:i,label:i});u[r]={value:f.map(i=>i.value),label:f.map(i=>i.label),type:n[r]}}else o&&typeof o=="object"&&"value"in o&&"label"in o?u[r]={value:o.value,label:o.label,type:n[r]}:u[r]={value:o,label:o,type:n[r]}}return u},Pv=e=>{let t=0,n=!1;for(const u in e){const r=e[u];if(r!=null&&r.value){t++;const o=r.value;if(typeof o!="string")continue;o.includes("{{")&&o.includes("}}")&&(n=!0)}}return{fields_configured_count:t,has_system_variable:n}},u2=({label:e,isRequired:t,prefixNode:n,...u})=>e?a.jsxs(s.Typography,{variant:"body_sm_medium",component:"label",color:"var(--connector-text-primary, #202124)",className:"hiver__field--label",...u,children:[n,e,t?a.jsx("span",{className:"required__star",children:"*"}):null]}):null,Rv=e=>I.createElement("svg",{width:"8px",height:"8px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e},I.createElement("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9zm7.5-5-1-1h-5l-1 1H5v2h14V4z"})),r2=250,Lu="__id",ri=e=>e!=null&&e!==""&&e!==!1,aa={isExpandable:!0,isExpanded:!0,defaultNumberOfRows:1,fixedRows:!1,cellWidth:r2,arithmeticOperation:[]},$r=({name:e,value:t,data:n={},columns:u=[],validation:r={},meta:{defaultNumberOfRows:o=aa.defaultNumberOfRows,fixedRows:f=aa.fixedRows,cellWidth:i=aa.cellWidth,arithmeticOperation:c=aa.arithmeticOperation}=aa,fetchConfig:l={},createConfig:D={},stackIndex:A,onChange:m=()=>{},onFocus:x,onValidationError:C})=>{const p=g.useMemo(()=>t??[],[t]),d=g.useMemo(()=>(r==null?void 0:r.validations)??{},[r]),h=!!(r!=null&&r.isRequired),E=g.useRef(),F=g.useRef({}),[b,B]=g.useState({}),[S,v]=g.useState(!1),{colsLength:w,colsTemplate:k,colWidth:L}=g.useMemo(()=>{let R=0,q="";for(const $ of u){let K=$.cols?Number($.cols):1;isNaN(K)&&(K=1),R+=K,q+=`${$.cols??K}fr `}return f||(R+=.5,q+="0.5fr"),{colsLength:R,colsTemplate:q.trim(),colWidth:`${isNaN(i)?r2:i}px`}},[u,i,f]),{fieldDependency:N,fieldConfigs:T}=g.useMemo(()=>{const R={},q={};for(const $ of u){if(!$.valueConfig)continue;q[$.name]=$.valueConfig;const K=$.valueConfig.columnNames;for(const Ae of K)R[Ae]||(R[Ae]=[]),R[Ae].push($.name)}return{fieldDependency:R,fieldConfigs:q}},[u]),M=g.useMemo(()=>u.filter(R=>{var q;return!!R.isRequired||!!((q=d==null?void 0:d[R.name])!=null&&q.isRequired)}),[u,d]),Q=g.useMemo(()=>new Set(M.map(R=>R.name)),[M]),P=g.useMemo(()=>u.filter(R=>!R.valueConfig).map(R=>R.name),[u]),_=g.useMemo(()=>{const R={};for(const q in d){const $={...d[q]};delete $.isRequired,R[q]=$}return R},[d]);g.useEffect(()=>{if(t)return;const R=[];for(let q=0;q<o;q++){const $=zd();R.push({[Lu]:$})}m(R)},[t,m,o]);const X=g.useMemo(()=>{const R={};return M.length&&p.forEach(({[Lu]:q,...$},K)=>{var pe;if(h&&K===0||P.some(oe=>ri($[oe])))for(const oe of M){const ie=$[oe.name];if(ri(ie))continue;const $e=(pe=d==null?void 0:d[oe.name])==null?void 0:pe.isRequired,Ke=typeof $e=="function"?$e(ie):!0;R[`${q}.${oe.name}`]=typeof Ke=="string"?Ke:tf}}),R},[p,M,P,h,d]),V=g.useMemo(()=>{const R=Object.values(X)[0];if(R)return R;if(!h||p.some($=>P.some(K=>ri($[K]))))return"";const q=typeof(r==null?void 0:r.isRequired)=="function"?r.isRequired(void 0):!0;return typeof q=="string"?q:tf},[X,h,p,P,r]),G=()=>{const R=Object.entries(F.current).filter(q=>!!q[1])[0];return(R==null?void 0:R[1])??""};g.useEffect(()=>{C==null||C(e,V||G())},[V,e]);const H=()=>{const R={[Lu]:zd()};m([...p,R])},U=R=>{const q=p.filter($=>$[Lu]!==R);m(q),B($=>({...$,[R]:{}}));for(const $ in F.current)$.startsWith(`${R}.`)&&delete F.current[$];C==null||C(e,V||G())},z=(R,{columnNames:q=[],operationType:$})=>{const K=q.map(Ae=>R[Ae]);return""+Xd(K,$)},ue=(R,q)=>{const $=p.map(K=>R!==K[Lu]?K:{...K,...q});m($)},fe=(R,q)=>{const $=p.map(K=>{if(R!==K[Lu])return K;const Ae={...K};for(const pe of q)delete Ae[pe];return Ae});m($)},W=(R,q,$,K)=>{var oe;const Ae=((oe=K==null?void 0:K.target)==null?void 0:oe.value)??"",pe={...$,[q]:Ae};if(N[q])for(const ie of N[q]){const $e=z(pe,T[ie]);pe[ie]=$e}ue(R,pe)},ee=(R,q,$)=>{ue(R,{[q]:$})},re=(R,q,$,K)=>{if($&&typeof $=="object"&&"value"in $&&typeof $.value=="string"&&typeof K.name<"u"){const Ae="prefillValues"in $&&$.prefillValues,pe={...q,[K.name]:$.value,...Ae};for(const oe in pe)if(N[oe])for(const ie of N[oe]){const $e=z(pe,T[ie]);pe[ie]=$e}ue(R,pe)}(K==null?void 0:K.action)==="clear"&&K.name&&fe(R,[K.name])},ve=(R,q,$)=>{ue(R,{[q]:($==null?void 0:$.toISOString())??""})},se=(R,q,$,K)=>{K&&B(Ae=>{const pe=Ae[R]??{};return{...Ae,[R]:{...pe,[q]:$}}}),F.current={...F.current,[`${R}.${q}`]:typeof $=="string"?$:""},C==null||C(e,V||G())},ke=R=>E.current===R,te=R=>{v(!0),x==null||x(R)},J=!h||p.length>1;return a.jsxs(GB,{children:[a.jsx(VB,{ref:E,children:a.jsxs(zB,{gridColumns:k,minWidth:`calc( ${w} * ${L} )`,children:[a.jsx(ZB,{children:u.map(({name:R,label:q})=>a.jsx($1,{children:a.jsx(u2,{label:q,isRequired:Q.has(R)})},R))}),p.map(({[Lu]:R,...q})=>a.jsxs(_d,{children:[u.map(({name:$,key:K,...Ae})=>{var pe;return a.jsx($1,{hasError:!!((pe=b==null?void 0:b[R])!=null&&pe[$])||S&&!!X[`${R}.${$}`],children:a.jsx(lr,{name:$,value:q[$],...Ae,className:ra,label:"",hideHelperText:!0,isRequired:!1,validation:_==null?void 0:_[$],onFocus:te,inputChangeHandler:oe=>W(R,$,q,oe),checkboxChangeHandler:(...oe)=>ee(R,$,oe[1]),selectChangeHandler:(...oe)=>re(R,q,...oe),dateChangeHandler:(oe,ie)=>ve(R,oe,ie),onValidationError:(...oe)=>se(R,...oe),fetchConfig:l==null?void 0:l[$],createConfig:D==null?void 0:D[$],isScrollTarget:ke,...A?{menuPortalTarget:document.body,stackIndex:A}:null})},$??K)}),f?null:a.jsx($1,{children:a.jsx(s.Stack,{width:"100%",height:"100%",alignItems:"center",justifyContent:"center",children:a.jsx(Pd,{disabled:!J,onClick:()=>U(R),children:a.jsx(Rv,{})})})})]},R))]})}),a.jsxs(XB,{children:[f?null:a.jsxs(JB,{onClick:H,children:[a.jsx(Qd,{}),a.jsx(s.Typography,{children:"Add Line"})]}),c.length?a.jsx(YB,{children:c.map(({label:R,columnName:q,operationType:$,prefix:K="",prefixKey:Ae,suffix:pe="",suffixKey:oe})=>a.jsxs(qB,{children:[a.jsx(s.Typography,{fontWeight:s.theme.typography.fontWeightMedium,children:R}),a.jsxs(s.Typography,{children:[a.jsxs("span",{children:[n[Ae]??K," "]}),a.jsx("span",{children:Xd(p.map(ie=>ie[q]),$)}),a.jsx("span",{children:n[oe]??pe})]})]},R))}):null]})]})};$r.ROW_ID=Lu;const Hv=1024*1024,Wv=e=>{if(typeof e=="number")return Number.isFinite(e)?e:0;const t=parseInt(String(e??""),10);return Number.isFinite(t)?t:0},Gv=e=>e/Hv,o2=e=>{const t=Wv(e),n=(r,o)=>`${r%1===0?r:r.toFixed(1)} ${o}`;if(t<1024)return`${t} B`;const u=t/1024;return u<1024?n(u,"KB"):n(u/1024,"MB")},a2=(e,t)=>{var u;if(t&&t.includes(".")){const r=t.split(".").pop();if(r)return r.toUpperCase()}const n=(u=e==null?void 0:e.split("/"))==null?void 0:u[1];return n?n.toUpperCase():(e||"FILE").toUpperCase()},Vv={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",svg:"image/svg+xml",ico:"image/x-icon",tif:"image/tiff",tiff:"image/tiff",heic:"image/heic",heif:"image/heif",mp4:"video/mp4",m4v:"video/mp4",webm:"video/webm",ogv:"video/ogg",mov:"video/quicktime",avi:"video/x-msvideo",mkv:"video/x-matroska",pdf:"application/pdf",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",csv:"text/csv",txt:"text/plain",json:"application/json",xml:"application/xml",zip:"application/zip",rar:"application/vnd.rar","7z":"application/x-7z-compressed",gz:"application/gzip",mp3:"audio/mpeg",wav:"audio/wav",ogg:"audio/ogg"},s2=e=>{if(!e)return"";const n=e.split(/[?#]/)[0].split("/").pop()??"",u=n.lastIndexOf(".");return u<=0?"":n.slice(u+1).toLowerCase()},zv=e=>{const t=(e??"").trim().toLowerCase();return t.startsWith(".")?t.slice(1):t},Xv=(e,t)=>{if(!(t!=null&&t.length))return!1;const n=s2(e);return n?t.some(u=>zv(u)===n):!1},f2=e=>{const t=s2(e);return t?Vv[t]:void 0},i2=(e,t,n)=>e||(f2(t)??f2(n)),Zv=e=>e?/^image\//.test(e)||/^video\//.test(e)||e==="application/pdf"||e==="text/csv":!1,oi=(e=[])=>e.filter(t=>t.status==="done"&&!!t.attachmentId).map(t=>({attachmentId:t.attachmentId})),Jv=3;let Yv=0;const qv=()=>`att-${Date.now()}-${++Yv}`,Uv=({initialValue:e,maxFiles:t,maxFileSizeMb:n,excludedTypes:u,upload:r,uploadContext:o,onChange:f,onToast:i})=>{const[c,l]=g.useState(e??[]),D=g.useRef(c),A=g.useRef((e??[]).length>0),m=g.useRef(f),x=g.useRef(i),C=g.useRef(r),p=g.useRef(o),d=g.useRef({}),h=g.useRef({}),E=g.useRef(new Set),F=g.useRef(0);g.useEffect(()=>{m.current=f,x.current=i,C.current=r,p.current=o},[f,i,r,o]);const b=g.useCallback(M=>{const Q=M(D.current);return D.current=Q,l(Q),Q},[]);g.useEffect(()=>{A.current||!e||e.length===0||(A.current=!0,b(()=>e))},[e,b]);const B=g.useCallback(M=>{var P;const Q=b(M);(P=m.current)==null||P.call(m,Q)},[b]),S=g.useCallback(M=>{const Q=h.current[M];Q&&typeof URL<"u"&&typeof URL.revokeObjectURL=="function"&&(URL.revokeObjectURL(Q),delete h.current[M])},[]),v=g.useRef(),w=g.useCallback(()=>{var M;if(C.current)for(const Q of D.current){if(F.current>=Jv)break;Q.status!=="uploading"||E.current.has(Q.tempId)||(M=v.current)==null||M.call(v,Q.tempId)}},[]),k=g.useCallback(M=>{const Q=d.current[M],P=C.current;if(!Q||!P)return;E.current.add(M),F.current+=1;const _=V=>{b(G=>G.map(H=>H.tempId===M&&H.status==="uploading"?{...H,progress:Math.min(100,Math.max(0,Math.round(V)))}:H))},X=()=>{E.current.delete(M),F.current=Math.max(0,F.current-1),w()};P(Q,_,p.current).then(V=>{var G;if(!D.current.some(H=>H.tempId===M)){X();return}delete d.current[M],V.url&&S(M),B(H=>H.map(U=>U.tempId===M?{...U,status:"done",progress:100,attachmentId:V.attachmentId,filename:V.filename??U.filename,size:V.size??U.size,mimeType:V.mimeType??U.mimeType,url:V.url??U.url,error:void 0}:U)),(G=x.current)==null||G.call(x,{message:`${V.filename??Q.name} uploaded`,type:"success"}),X()}).catch(()=>{var V;if(!D.current.some(G=>G.tempId===M)){X();return}B(G=>G.map(H=>H.tempId===M?{...H,status:"failed",progress:void 0,error:"Upload failed"}:H)),(V=x.current)==null||V.call(x,{message:`Couldn't upload ${Q.name}`,type:"error"}),X()})},[S,B,w,b]);v.current=k;const L=g.useCallback(M=>{var X,V,G,H;if(!M.length)return;const Q=t-D.current.length;if(Q<=0){(X=x.current)==null||X.call(x,{message:`You can add up to ${t} files`,type:"error"});return}const P=[];let _=0;for(const U of M){if(P.length>=Q){_+=1;continue}if(Xv(U.name,u)){(V=x.current)==null||V.call(x,{message:"File upload failed: unsupported file format.",type:"error"});continue}if(Gv(U.size)>n){(G=x.current)==null||G.call(x,{message:`${U.name} is larger than ${n} MB`,type:"error"});continue}const z=qv();d.current[z]=U;let ue;typeof URL<"u"&&typeof URL.createObjectURL=="function"&&(ue=URL.createObjectURL(U),h.current[z]=ue),P.push({tempId:z,filename:U.name,size:U.size,mimeType:U.type||"application/octet-stream",status:"uploading",progress:0,url:ue})}_>0&&((H=x.current)==null||H.call(x,{message:`You can add up to ${t} files`,type:"error"})),P.length&&(B(U=>[...U,...P]),w())},[t,n,u,B,w]),N=g.useCallback(M=>{S(M),E.current.has(M)&&(E.current.delete(M),F.current=Math.max(0,F.current-1)),delete d.current[M],B(Q=>Q.filter(P=>P.tempId!==M)),w()},[S,B,w]),T=g.useCallback(M=>{const Q=D.current.find(P=>P.tempId===M);!Q||Q.status!=="failed"||(E.current.delete(M),B(P=>P.map(_=>_.tempId===M?{..._,status:"uploading",progress:0,error:void 0}:_)),w())},[B,w]);return g.useEffect(()=>{const M=h.current;return()=>{typeof URL<"u"&&typeof URL.revokeObjectURL=="function"&&Object.values(M).forEach(Q=>URL.revokeObjectURL(Q))}},[]),{items:c,addFiles:L,removeItem:N,retry:T}},Kv=e=>I.createElement("svg",{viewBox:"0 0 50 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},I.createElement("path",{d:"M0 8C0 3.58172 3.58172 0 8 0H30L40 10L50 20V56C50 60.4183 46.4183 64 42 64H8C3.58172 64 0 60.4183 0 56V8Z",fill:"#255C87"}),I.createElement("path",{d:"M17.2721 46.7279L23.8686 40.1314C24.2646 39.7354 24.4627 39.5373 24.691 39.4632C24.8918 39.3979 25.1082 39.3979 25.309 39.4632C25.5373 39.5373 25.7354 39.7354 26.1314 40.1314L32.6839 46.6839M27 41L29.8686 38.1314C30.2646 37.7354 30.4627 37.5373 30.691 37.4632C30.8918 37.3979 31.1082 37.3979 31.309 37.4632C31.5373 37.5373 31.7354 37.7354 32.1314 38.1314L35 41M23 35C23 36.1046 22.1046 37 21 37C19.8954 37 19 36.1046 19 35C19 33.8954 19.8954 33 21 33C22.1046 33 23 33.8954 23 35ZM19.8 47H30.2C31.8802 47 32.7202 47 33.362 46.673C33.9265 46.3854 34.3854 45.9265 34.673 45.362C35 44.7202 35 43.8802 35 42.2V33.8C35 32.1198 35 31.2798 34.673 30.638C34.3854 30.0735 33.9265 29.6146 33.362 29.327C32.7202 29 31.8802 29 30.2 29H19.8C18.1198 29 17.2798 29 16.638 29.327C16.0735 29.6146 15.6146 30.0735 15.327 30.638C15 31.2798 15 32.1198 15 33.8V42.2C15 43.8802 15 44.7202 15.327 45.362C15.6146 45.9265 16.0735 46.3854 16.638 46.673C17.2798 47 18.1198 47 19.8 47Z",stroke:"white",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"}),I.createElement("path",{d:"M30 16V0L50 20H34C31.7909 20 30 18.2091 30 16Z",fill:"#DBE9F5"})),$v=e=>I.createElement("svg",{viewBox:"0 0 50 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},I.createElement("path",{d:"M0 8C0 3.58172 3.58172 0 8 0H30L40 10L50 20V56C50 60.4183 46.4183 64 42 64H8C3.58172 64 0 60.4183 0 56V8Z",fill:"#8789C5"}),I.createElement("path",{d:"M25 48V28M20 48V43M20 33V28M30 48V43M30 33V28M15 33H35M15 43H35M35 43.2V32.8C35 31.1198 35 30.2798 34.673 29.638C34.3854 29.0735 33.9265 28.6146 33.362 28.327C32.7202 28 31.8802 28 30.2 28H19.8C18.1198 28 17.2798 28 16.638 28.327C16.0735 28.6146 15.6146 29.0735 15.327 29.638C15 30.2798 15 31.1198 15 32.8V43.2C15 44.8802 15 45.7202 15.327 46.362C15.6146 46.9265 16.0735 47.3854 16.638 47.673C17.2798 48 18.1198 48 19.8 48H30.2C31.8802 48 32.7202 48 33.362 47.673C33.9265 47.3854 34.3854 46.9265 34.673 46.362C35 45.7202 35 44.8802 35 43.2Z",stroke:"white",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"}),I.createElement("path",{d:"M30 16V0L50 20H34C31.7909 20 30 18.2091 30 16Z",fill:"#E7E7F3"})),ew=e=>I.createElement("svg",{viewBox:"0 0 50 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},I.createElement("path",{d:"M0 8C0 3.58172 3.58172 0 8 0H30L40 10L50 20V56C50 60.4183 46.4183 64 42 64H8C3.58172 64 0 60.4183 0 56V8Z",fill:"#852326"}),I.createElement("path",{d:"M16.6323 35.7197C17.8299 35.7197 18.7038 35.9779 19.2539 36.4941C19.804 37.0062 20.0791 37.7129 20.0791 38.6143C20.0791 39.0205 20.0177 39.4098 19.895 39.7822C19.7723 40.1504 19.5713 40.4784 19.292 40.7661C19.0169 41.0539 18.6488 41.2824 18.1875 41.4517C17.7262 41.6167 17.1571 41.6992 16.48 41.6992H15.6357V45H13.668V35.7197H16.6323ZM16.5308 37.332H15.6357V40.0869H16.2832C16.6514 40.0869 16.9709 40.0382 17.2417 39.9409C17.5125 39.8436 17.722 39.6912 17.8701 39.4839C18.0182 39.2765 18.0923 39.0099 18.0923 38.6841C18.0923 38.2271 17.9653 37.8885 17.7114 37.6685C17.4575 37.4442 17.064 37.332 16.5308 37.332ZM29.5308 40.271C29.5308 41.3162 29.3298 42.1901 28.9277 42.8926C28.5299 43.5908 27.9523 44.1177 27.1948 44.4731C26.4373 44.8244 25.5254 45 24.459 45H21.8311V35.7197H24.7446C25.7179 35.7197 26.5622 35.8932 27.2773 36.2402C27.9925 36.583 28.5469 37.0929 28.9404 37.77C29.334 38.4429 29.5308 39.2765 29.5308 40.271ZM27.4868 40.3218C27.4868 39.6362 27.3853 39.0734 27.1821 38.6333C26.9832 38.189 26.687 37.861 26.2935 37.6494C25.9041 37.4378 25.4217 37.332 24.8462 37.332H23.7988V43.375H24.6431C25.6037 43.375 26.3167 43.119 26.7822 42.6069C27.252 42.0949 27.4868 41.3332 27.4868 40.3218ZM33.3901 45H31.4541V35.7197H36.7734V37.332H33.3901V39.7251H36.5386V41.3311H33.3901V45Z",fill:"white"}),I.createElement("path",{d:"M30 16V0L50 20H34C31.7909 20 30 18.2091 30 16Z",fill:"#F5DBDA"})),tw=e=>I.createElement("svg",{viewBox:"0 0 50 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},I.createElement("path",{d:"M0 8C0 3.58172 3.58172 0 8 0H30L40 10L50 20V56C50 60.4183 46.4183 64 42 64H8C3.58172 64 0 60.4183 0 56V8Z",fill:"#94A3B8"}),I.createElement("path",{d:"M30 16V0L50 20H34C31.7909 20 30 18.2091 30 16Z",fill:"#F1F5F9"}),I.createElement("path",{d:"M16 38H34M16 32H34M16 44H28",stroke:"white",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"})),nw=e=>I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 16 16",fill:"none",...e},I.createElement("g",{clipPath:"url(#clip0_3775_7404)"},I.createElement("path",{d:"M7.99999 3C4.66666 3 1.81999 5.07333 0.666656 8C1.81999 10.9267 4.66666 13 7.99999 13C11.3333 13 14.18 10.9267 15.3333 8C14.18 5.07333 11.3333 3 7.99999 3ZM7.99999 11.3333C6.15999 11.3333 4.66666 9.84 4.66666 8C4.66666 6.16 6.15999 4.66667 7.99999 4.66667C9.83999 4.66667 11.3333 6.16 11.3333 8C11.3333 9.84 9.83999 11.3333 7.99999 11.3333ZM7.99999 6C6.89332 6 5.99999 6.89333 5.99999 8C5.99999 9.10667 6.89332 10 7.99999 10C9.10666 10 9.99999 9.10667 9.99999 8C9.99999 6.89333 9.10666 6 7.99999 6Z",fill:"#4D596C"})),I.createElement("defs",null,I.createElement("clipPath",{id:"clip0_3775_7404"},I.createElement("rect",{width:16,height:16,fill:"white"})))),uw=e=>I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 16 16",fill:"none",...e},I.createElement("g",{clipPath:"url(#clip0_3775_7401)"},I.createElement("path",{d:"M12.9 6.69334C12.4467 4.39334 10.4267 2.66667 8 2.66667C6.07333 2.66667 4.4 3.76 3.56667 5.36001C1.56 5.57334 0 7.27334 0 9.33334C0 11.54 1.79333 13.3333 4 13.3333H12.6667C14.5067 13.3333 16 11.84 16 10C16 8.24001 14.6333 6.81334 12.9 6.69334ZM12.6667 12H4C2.52667 12 1.33333 10.8067 1.33333 9.33334C1.33333 7.96667 2.35333 6.82667 3.70667 6.68667L4.42 6.61334L4.75333 5.98001C5.38667 4.76001 6.62667 4.00001 8 4.00001C9.74667 4.00001 11.2533 5.24001 11.5933 6.95334L11.7933 7.95334L12.8133 8.02667C13.8533 8.09334 14.6667 8.96667 14.6667 10C14.6667 11.1 13.7667 12 12.6667 12ZM8.96667 6.66667H7.03333V8.66667H5.33333L8 11.3333L10.6667 8.66667H8.96667V6.66667Z",fill:"#4D596C"})),I.createElement("defs",null,I.createElement("clipPath",{id:"clip0_3775_7401"},I.createElement("rect",{width:16,height:16,fill:"white"})))),rw=nw,c2=uw,l2=({mimeType:e})=>e&&/^image\//.test(e)?a.jsx(Kv,{}):e&&/^video\//.test(e)?a.jsx($v,{}):e==="application/pdf"?a.jsx(ew,{}):a.jsx(tw,{}),ai="var(--connector-border-strong, #D6DDE8)",ow="color-mix(in srgb, var(--connector-negative, #E42525) 12%, var(--connector-surface, #FFFFFF))",si=`
1744
+ `;function KB(e){const[t,n]=g.useState(!1),u=g.useRef(null);g.useEffect(()=>{t&&u.current&&u.current.focus()},[t]);const r=(o,f)=>{o===null&&e.onChange(o,f),o&&typeof o.getTime=="function"&&!isNaN(o.getTime())&&e.onChange(o,f),e.onChange(o,f)};return a.jsx(UB,{inputFormat:e.inputFormat?e.inputFormat:Md.DATE,...e,value:e.value||null,open:t,onOpen:()=>n(!0),onClose:()=>n(!1),onChange:r,PopperProps:{anchorEl:u.current},renderInput:o=>a.jsx(s.DateTextField,{...o,fullWidth:!0,variant:"outlined",disabled:e.disabled,inputRef:u,inputProps:{...o.inputProps,placeholder:e.placeholder},onBlur:e.onBlur,onFocus:e.onFocus,InputProps:{endAdornment:a.jsx(s.InputAdornment,{position:"end",sx:{cursor:"pointer"},children:a.jsx(s.icons.CalendarTodayOutlinedIcon,{})})},onClick:()=>{t||n(!0)}})})}const $B=(e,t)=>({display:"inline-flex",alignItems:"center",gap:"2px",backgroundColor:"var(--connector-surface-active, #F6F8FC)",borderRadius:"4px",padding:"3px",width:"fit-content",height:"34px",boxSizing:"border-box",opacity:e?.6:1,pointerEvents:e?"none":"auto",...t}),ev=(e,t)=>({border:"none",borderRadius:"4px",backgroundColor:e?"var(--connector-segmented-selected-background, var(--connector-surface-elevated, #FFFFFF))":"transparent",color:e?"var(--connector-segmented-selected-text, var(--connector-accent, #196fe0))":"var(--connector-text-secondary, #3E4C5A)",boxShadow:e?"0px 1px 2px rgba(0, 0, 0, 0.08)":"none",minWidth:"56px",padding:"4px 16px",cursor:"pointer",fontSize:`${s.theme.typography.body2.fontSize}px`,height:"100%",transition:"background-color 0.15s ease, color 0.15s ease","&:hover":{color:e?"var(--connector-segmented-selected-text, var(--connector-accent, #196fe0))":"var(--connector-text-primary, #343C45)"},...t}),tv=[{label:"Yes",value:!0},{label:"No",value:!1}],Rd=({name:e,checked:t,disabled:n,className:u,styleOverrides:r,boxStyleOverrides:o,onChange:f})=>{const i=!!t,c=l=>D=>{if(D.preventDefault(),D.stopPropagation(),n||l===i)return;const A={target:{name:e,value:l,checked:l},currentTarget:{name:e,value:l,checked:l},stopPropagation:()=>{},preventDefault:()=>{}};f==null||f(A,l)};return a.jsx(s.Box,{sx:$B(n,r),className:u,role:"radiogroup","aria-label":e,children:tv.map(l=>{const D=l.value===i;return a.jsx(s.Box,{component:"button",type:"button",role:"radio","aria-checked":D,disabled:n,sx:ev(D,o),onClick:c(l.value),children:a.jsx(s.Typography,{variant:"caption",fontSize:(r==null?void 0:r.fontSize)||13,fontWeight:D?500:400,color:"inherit",children:l.label})},l.label)})})},nv="/v1/api"+"/templates/metadata",Hd={GET:"GET",POST:"POST",DELETE:"DELETE",PATCH:"PATCH",PUT:"PUT"},uv="Required Field",rv="Invalid date",Wd=/^https:\/\/([a-z0-9-]+(\.[a-z0-9-]+)+)(:[0-9]{1,5})?(\/[^\s/]*)*$/i,ov=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Gd="Please enter a valid URL",av="Please enter valid ID",sv="Please enter valid input",fv="URL must start with https://",iv="URL should not end with a slash",cv="Invalid email address",lv="Email must be a string",Vd="Invalid date",Dv="Date cannot be in the past",Av="Date cannot be in the future",dv="Invalid number",pv="Invalid text",gv=async e=>{const t=new URLSearchParams,{inboxIds:n,channelType:u,conversationId:r,fetchAuthenticatedConnectors:o}=e||{};return n==null||n.forEach(i=>{t.append("inbox_ids",i)}),[["channel_type",u],["conversation_id",r],["fetch_authenticated_connectors",o==null?void 0:o.toString()]].forEach(([i,c])=>{c!==void 0&&t.append(i,c)}),Fe({url:`${nv}?${t.toString()}`,method:Hd.GET})},Cv="/v1/api/connectors/ug",ei=async(e,t)=>{const n=new URLSearchParams;for(const[f,i]of Object.entries(e||{}))if(Array.isArray(i))i.forEach(c=>{c&&n.append(f,String(c))});else{if(!i)continue;n.append(f,i)}n.append(t?"onlyEnabled":"onlyEnabledAuthenticated","true"),n.append("minimal","true");const u=Cv+`?${n.toString()}`,r=await Fe({url:u,method:Hd.GET}),o=r==null?void 0:r.data;return Array.isArray(o)?o.map(({id:f,name:i,logo:c,type:l,connectorType:D,isConnectorAvailableInPlan:A})=>({id:f,name:i,logo:c,type:l,connectorType:D,isConnectorAvailableInPlan:A})).filter(({logo:f})=>!!f):[]};var ti=(e=>(e.ADD="ADD",e.MULTIPLY="MULTIPLY",e))(ti||{});const hv={[ti.ADD]:(e,t)=>e+t,[ti.MULTIPLY]:(e,t)=>e*t},Fv=e=>e,zd=()=>{if("crypto"in window&&"randomUUID"in window.crypto)return window.crypto.randomUUID();const e=Date.now().toString(16),t=Math.random().toString(16).substring(2,8);return`${e}-${t}`},Xd=(e,t)=>{let n;const u=hv[t]??Fv;for(const r of e){const o=Number(r);isNaN(o)||(n=n===void 0?o:u(n,o))}return(n??0).toFixed(2)},Zd=(e,t=n=>n)=>{const n=new Set,u=[];for(const r of e){const o=t(r);n.has(o)||(n.add(o),u.push(r))}return u},mv=(e,t)=>e.replace(/:(\w+)/g,(n,u)=>String(t[u])||""),Jd=e=>typeof e=="object"&&e!==null&&"value"in e&&"label"in e,Ev=/^\d{4}-\d{2}-\d{2}$/,Yd=e=>{if(typeof e=="string"){const o=e.trim();if(Ev.test(o))return o}const t=e instanceof Date?e:new Date(e);if(isNaN(t.getTime()))return typeof e=="string"?e:String(e);const n=t.getFullYear(),u=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${n}-${u}-${r}`},bv={GET:"GET",POST:"POST",DELETE:"DELETE",PATCH:"PATCH",PUT:"PUT"},xv="/v1/api/connectors/forms/:formId/get_forms_custom_fields",yv=async({formId:e,args:t})=>{try{const n=await Fe({url:mv(xv,{formId:e}),data:{args:t},method:bv.POST});return(n==null?void 0:n.data).fieldList}catch(n){throw Oe.error(n),n}},qd=(e,t)=>{const n=e??{};if(!t)return{isApiEnabled:!0,args:{},argsMap:t};const u={};for(const r in t){const o=t[r],f=Jd(n[o])?n[o].value:n[o];if(!f)return{isApiEnabled:!1,args:{}};u[r]=f}return{isApiEnabled:!0,args:u,argsMap:t}},uf=e=>JSON.stringify(e??null),Ud=(e,t)=>e===t||uf(e)===uf(t),Bv=(e,t)=>e.isApiEnabled===t.isApiEnabled&&uf(e.args)===uf(t.args)&&Ud(e.argsMap,t.argsMap),vv=({formId:e,argsMap:t,formData:n,enabled:u=!0,delay:r=500})=>{const[o,f]=g.useState(()=>qd(n,t));g.useEffect(()=>{const l=setTimeout(()=>{f(D=>{const A=qd(n,t);return Bv(D,A)?D:A})},r);return()=>clearTimeout(l)},[n,t,r]);const i=Ud(o.argsMap,t),c=ot({queryKey:["customFormFields",e,o.args],queryFn:()=>yv({formId:e,args:o.args}),enabled:!!e&&u&&i&&o.isApiEnabled,staleTime:0});return{...c,data:o.isApiEnabled?c.data:void 0}},Kd=e=>{const t={current:null};return n=>{t.current&&clearTimeout(t.current),t.current=setTimeout(n,e)}};let Kr={};const wv={get length(){return Object.keys(Kr).length},getItem(e){return Kr[e]??null},setItem(e,t){Kr[e]=t},removeItem(e){delete Kr[e]},clear(){Kr={}},key(e){return Object.keys(Kr)[e]}},Sv={LOCAL:window==null?void 0:window.localStorage,SESSION:window==null?void 0:window.sessionStorage},oa=(e="LOCAL")=>Sv[e]??wv,$d=(e="LOCAL")=>{const t=oa(e);return{...t,getItem(n){const u=t.getItem(n);if(!u)return u;try{return JSON.parse(u)}catch(r){return Oe.warn(r),u}},setItem(n,u){try{const r=JSON.stringify(u);t.setItem(n,r)}catch(r){Oe.warn(r)}}}},ni=Symbol("root"),Iv="connectors-store",kv=e=>{const{name:t,initialState:n,persist:u,persistKey:r=`${Iv}-${t}`}=e,o=$d("LOCAL"),f={...n},i=u?o.getItem(r)??f:f,c=new Map,l=new Map;l.set(ni,new Set);const D=(C,p,d=!0)=>{var F;const h=Symbol("callback");c.set(h,C);const E=p||ni;if(l.has(E)||l.set(E,new Set),(F=l.get(E))==null||F.add(h),d){const b=p?i[p]:i;C(b)}return()=>{var b;c.delete(h),(b=l.get(E))==null||b.delete(h)}},A=(C,p)=>{p?i[p]=C:Object.assign(i,C),x();const d=p||ni,h=l.get(d);if(h)for(const E of h){const F=c.get(E);F==null||F(p?i[p]:i)}},m=C=>C?i[C]:{...i},x=()=>{u&&o.setItem(r,i)};return{subscribe:D,setData:A,getData:m}},Tv=e=>t=>{if(t&&typeof t=="string"){const n=t.replace(/\/$/,"");return n.startsWith("https://")?t.endsWith("/")?iv:Wd.test(n)?!0:e||Gd:fv}return!1},Lv=e=>t=>t&&typeof t=="string"?ov.test(t)?!0:e||cv:lv,Mv=e=>t=>t==null||t===""?e||uv:!0,Ov=e=>(t,n)=>{var u;if(!t||(t==null?void 0:t.toString())===rv)return Vd;if(typeof t=="object"){const r=t,o=new Date;o.setHours(0,0,0,0);const f=n.disablePast,i=n.disableFuture;return f&&r<o?e||Dv:i&&r>o?e||Av:!0}return typeof t=="string"&&((u=new Date(t))==null?void 0:u.toString())!=="Invalid Date"?!0:Vd},Nv=e=>(t,n)=>{if(t=Number(t),typeof t=="number"&&!isNaN(t)){const u=n.min,r=n.max;return u!==void 0&&t<u?e||`Value should not be less than ${u}`:r!==void 0&&t>r?e||`Value should not be greater than ${r}`:!0}return e||dv},ui=e=>(t,n)=>{if(typeof t=="string"){const u=n.limit;return u!==void 0&&t.length>u?e||`Maximum characters allowed are ${u}`:!0}return e||pv},jv=e=>t=>typeof t=="string"?t.startsWith("https:")?Wd.test(t)?!0:e||Gd:t.trim().length>0?!0:e||av:e||sv,Qv=["async-select","select","multi-select","reference"],e2=(e,t)=>{const n=Array.isArray(e)?e:e?[e]:[],u=Array.isArray(t)?t:t?[t]:[];return n.map((r,o)=>({value:r,label:u[o]??String(r)}))},t2=e=>{if(typeof e=="string"){const t=e.trim().toLowerCase();return t==="true"||t==="1"||t==="yes"}return!!e},n2=(e,t=!1)=>{const n={};for(const u in e){const r=e[u];if(!r)continue;if(r.type==="checkbox"){n[u]=t2(r.value??r.label);continue}if(!(r!=null&&r.label)&&!(r!=null&&r.value))continue;const o=r.label??r.value??"",f=Array.isArray(o)?o[0]??"":o;if(t&&r.type==="date"){const i=isNaN(Number(f))?f:Number(f),c=new Date(i);n[u]=isNaN(c.getTime())?f:c.toISOString();continue}if(Qv.includes(r.type)){r.type==="multi-select"?n[u]=e2(r.value,r.label):n[u]={label:r.label,value:r.value};continue}n[u]=f}return n},_v=(e,t)=>{const n={};for(const r of t)n[r.name]=r.type;const u={};for(const r in e){const o=e[r];if(Array.isArray(o)){const f=o.map(i=>i&&typeof i=="object"&&"value"in i&&"label"in i?i:{value:i,label:i});u[r]={value:f.map(i=>i.value),label:f.map(i=>i.label),type:n[r]}}else o&&typeof o=="object"&&"value"in o&&"label"in o?u[r]={value:o.value,label:o.label,type:n[r]}:u[r]={value:o,label:o,type:n[r]}}return u},Pv=e=>{let t=0,n=!1;for(const u in e){const r=e[u];if(r!=null&&r.value){t++;const o=r.value;if(typeof o!="string")continue;o.includes("{{")&&o.includes("}}")&&(n=!0)}}return{fields_configured_count:t,has_system_variable:n}},u2=({label:e,isRequired:t,prefixNode:n,...u})=>e?a.jsxs(s.Typography,{variant:"body_sm_medium",component:"label",color:"var(--connector-text-primary, #202124)",className:"hiver__field--label",...u,children:[n,e,t?a.jsx("span",{className:"required__star",children:"*"}):null]}):null,Rv=e=>I.createElement("svg",{width:"8px",height:"8px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e},I.createElement("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9zm7.5-5-1-1h-5l-1 1H5v2h14V4z"})),r2=250,Lu="__id",ri=e=>e!=null&&e!==""&&e!==!1,aa={isExpandable:!0,isExpanded:!0,defaultNumberOfRows:1,fixedRows:!1,cellWidth:r2,arithmeticOperation:[]},$r=({name:e,value:t,data:n={},columns:u=[],validation:r={},meta:{defaultNumberOfRows:o=aa.defaultNumberOfRows,fixedRows:f=aa.fixedRows,cellWidth:i=aa.cellWidth,arithmeticOperation:c=aa.arithmeticOperation}=aa,fetchConfig:l={},createConfig:D={},stackIndex:A,onChange:m=()=>{},onFocus:x,onValidationError:C})=>{const p=g.useMemo(()=>t??[],[t]),d=g.useMemo(()=>(r==null?void 0:r.validations)??{},[r]),h=!!(r!=null&&r.isRequired),E=g.useRef(),F=g.useRef({}),[b,B]=g.useState({}),[S,v]=g.useState(!1),{colsLength:w,colsTemplate:k,colWidth:L}=g.useMemo(()=>{let R=0,q="";for(const $ of u){let K=$.cols?Number($.cols):1;isNaN(K)&&(K=1),R+=K,q+=`${$.cols??K}fr `}return f||(R+=.5,q+="0.5fr"),{colsLength:R,colsTemplate:q.trim(),colWidth:`${isNaN(i)?r2:i}px`}},[u,i,f]),{fieldDependency:N,fieldConfigs:T}=g.useMemo(()=>{const R={},q={};for(const $ of u){if(!$.valueConfig)continue;q[$.name]=$.valueConfig;const K=$.valueConfig.columnNames;for(const Ae of K)R[Ae]||(R[Ae]=[]),R[Ae].push($.name)}return{fieldDependency:R,fieldConfigs:q}},[u]),M=g.useMemo(()=>u.filter(R=>{var q;return!!R.isRequired||!!((q=d==null?void 0:d[R.name])!=null&&q.isRequired)}),[u,d]),Q=g.useMemo(()=>new Set(M.map(R=>R.name)),[M]),P=g.useMemo(()=>u.filter(R=>!R.valueConfig).map(R=>R.name),[u]),_=g.useMemo(()=>{const R={};for(const q in d){const $={...d[q]};delete $.isRequired,R[q]=$}return R},[d]);g.useEffect(()=>{if(t)return;const R=[];for(let q=0;q<o;q++){const $=zd();R.push({[Lu]:$})}m(R)},[t,m,o]);const X=g.useMemo(()=>{const R={};return M.length&&p.forEach(({[Lu]:q,...$},K)=>{var pe;if(h&&K===0||P.some(oe=>ri($[oe])))for(const oe of M){const ie=$[oe.name];if(ri(ie))continue;const $e=(pe=d==null?void 0:d[oe.name])==null?void 0:pe.isRequired,Ke=typeof $e=="function"?$e(ie):!0;R[`${q}.${oe.name}`]=typeof Ke=="string"?Ke:tf}}),R},[p,M,P,h,d]),V=g.useMemo(()=>{const R=Object.values(X)[0];if(R)return R;if(!h||p.some($=>P.some(K=>ri($[K]))))return"";const q=typeof(r==null?void 0:r.isRequired)=="function"?r.isRequired(void 0):!0;return typeof q=="string"?q:tf},[X,h,p,P,r]),G=()=>{const R=Object.entries(F.current).filter(q=>!!q[1])[0];return(R==null?void 0:R[1])??""};g.useEffect(()=>{C==null||C(e,V||G())},[V,e]);const H=()=>{const R={[Lu]:zd()};m([...p,R])},U=R=>{const q=p.filter($=>$[Lu]!==R);m(q),B($=>({...$,[R]:{}}));for(const $ in F.current)$.startsWith(`${R}.`)&&delete F.current[$];C==null||C(e,V||G())},z=(R,{columnNames:q=[],operationType:$})=>{const K=q.map(Ae=>R[Ae]);return""+Xd(K,$)},ue=(R,q)=>{const $=p.map(K=>R!==K[Lu]?K:{...K,...q});m($)},fe=(R,q)=>{const $=p.map(K=>{if(R!==K[Lu])return K;const Ae={...K};for(const pe of q)delete Ae[pe];return Ae});m($)},W=(R,q,$,K)=>{var oe;const Ae=((oe=K==null?void 0:K.target)==null?void 0:oe.value)??"",pe={...$,[q]:Ae};if(N[q])for(const ie of N[q]){const $e=z(pe,T[ie]);pe[ie]=$e}ue(R,pe)},ee=(R,q,$)=>{ue(R,{[q]:$})},re=(R,q,$,K)=>{if($&&typeof $=="object"&&"value"in $&&typeof $.value=="string"&&typeof K.name<"u"){const Ae="prefillValues"in $&&$.prefillValues,pe={...q,[K.name]:$.value,...Ae};for(const oe in pe)if(N[oe])for(const ie of N[oe]){const $e=z(pe,T[ie]);pe[ie]=$e}ue(R,pe)}(K==null?void 0:K.action)==="clear"&&K.name&&fe(R,[K.name])},ve=(R,q,$)=>{ue(R,{[q]:($==null?void 0:$.toISOString())??""})},se=(R,q,$,K)=>{K&&B(Ae=>{const pe=Ae[R]??{};return{...Ae,[R]:{...pe,[q]:$}}}),F.current={...F.current,[`${R}.${q}`]:typeof $=="string"?$:""},C==null||C(e,V||G())},ke=R=>E.current===R,te=R=>{v(!0),x==null||x(R)},J=!h||p.length>1;return a.jsxs(GB,{children:[a.jsx(VB,{ref:E,children:a.jsxs(zB,{gridColumns:k,minWidth:`calc( ${w} * ${L} )`,children:[a.jsx(ZB,{children:u.map(({name:R,label:q})=>a.jsx($1,{children:a.jsx(u2,{label:q,isRequired:Q.has(R)})},R))}),p.map(({[Lu]:R,...q})=>a.jsxs(_d,{children:[u.map(({name:$,key:K,...Ae})=>{var pe;return a.jsx($1,{hasError:!!((pe=b==null?void 0:b[R])!=null&&pe[$])||S&&!!X[`${R}.${$}`],children:a.jsx(lr,{name:$,value:q[$],...Ae,className:ra,label:"",hideHelperText:!0,isRequired:!1,validation:_==null?void 0:_[$],onFocus:te,inputChangeHandler:oe=>W(R,$,q,oe),checkboxChangeHandler:(...oe)=>ee(R,$,oe[1]),selectChangeHandler:(...oe)=>re(R,q,...oe),dateChangeHandler:(oe,ie)=>ve(R,oe,ie),onValidationError:(...oe)=>se(R,...oe),fetchConfig:l==null?void 0:l[$],createConfig:D==null?void 0:D[$],isScrollTarget:ke,...A?{menuPortalTarget:document.body,stackIndex:A}:null})},$??K)}),f?null:a.jsx($1,{children:a.jsx(s.Stack,{width:"100%",height:"100%",alignItems:"center",justifyContent:"center",children:a.jsx(Pd,{disabled:!J,onClick:()=>U(R),children:a.jsx(Rv,{})})})})]},R))]})}),a.jsxs(XB,{children:[f?null:a.jsxs(JB,{onClick:H,children:[a.jsx(Qd,{}),a.jsx(s.Typography,{children:"Add Line"})]}),c.length?a.jsx(YB,{children:c.map(({label:R,columnName:q,operationType:$,prefix:K="",prefixKey:Ae,suffix:pe="",suffixKey:oe})=>a.jsxs(qB,{children:[a.jsx(s.Typography,{fontWeight:s.theme.typography.fontWeightMedium,children:R}),a.jsxs(s.Typography,{children:[a.jsxs("span",{children:[n[Ae]??K," "]}),a.jsx("span",{children:Xd(p.map(ie=>ie[q]),$)}),a.jsx("span",{children:n[oe]??pe})]})]},R))}):null]})]})};$r.ROW_ID=Lu;const Hv=1024*1024,Wv=e=>{if(typeof e=="number")return Number.isFinite(e)?e:0;const t=parseInt(String(e??""),10);return Number.isFinite(t)?t:0},Gv=e=>e/Hv,o2=e=>{const t=Wv(e),n=(r,o)=>`${r%1===0?r:r.toFixed(1)} ${o}`;if(t<1024)return`${t} B`;const u=t/1024;return u<1024?n(u,"KB"):n(u/1024,"MB")},a2=(e,t)=>{var u;if(t&&t.includes(".")){const r=t.split(".").pop();if(r)return r.toUpperCase()}const n=(u=e==null?void 0:e.split("/"))==null?void 0:u[1];return n?n.toUpperCase():(e||"FILE").toUpperCase()},Vv={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",svg:"image/svg+xml",ico:"image/x-icon",tif:"image/tiff",tiff:"image/tiff",heic:"image/heic",heif:"image/heif",mp4:"video/mp4",m4v:"video/mp4",webm:"video/webm",ogv:"video/ogg",mov:"video/quicktime",avi:"video/x-msvideo",mkv:"video/x-matroska",pdf:"application/pdf",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",csv:"text/csv",txt:"text/plain",json:"application/json",xml:"application/xml",zip:"application/zip",rar:"application/vnd.rar","7z":"application/x-7z-compressed",gz:"application/gzip",mp3:"audio/mpeg",wav:"audio/wav",ogg:"audio/ogg"},s2=e=>{if(!e)return"";const n=e.split(/[?#]/)[0].split("/").pop()??"",u=n.lastIndexOf(".");return u<=0?"":n.slice(u+1).toLowerCase()},zv=e=>{const t=(e??"").trim().toLowerCase();return t.startsWith(".")?t.slice(1):t},Xv=(e,t)=>{if(!(t!=null&&t.length))return!1;const n=s2(e);return n?t.some(u=>zv(u)===n):!1},f2=e=>{const t=s2(e);return t?Vv[t]:void 0},i2=(e,t,n)=>e||(f2(t)??f2(n)),Zv=e=>e?/^image\//.test(e)||/^video\//.test(e)||e==="application/pdf"||e==="text/csv":!1,oi=(e=[])=>e.filter(t=>t.status==="done"&&!!t.attachmentId).map(t=>({attachmentId:t.attachmentId})),Jv=3;let Yv=0;const qv=()=>`att-${Date.now()}-${++Yv}`,Uv=({initialValue:e,maxFiles:t,maxFileSizeMb:n,excludedTypes:u,upload:r,uploadContext:o,onChange:f,onToast:i})=>{const[c,l]=g.useState(e??[]),D=g.useRef(c),A=g.useRef((e??[]).length>0),m=g.useRef(f),x=g.useRef(i),C=g.useRef(r),p=g.useRef(o),d=g.useRef({}),h=g.useRef({}),E=g.useRef(new Set),F=g.useRef(0);g.useEffect(()=>{m.current=f,x.current=i,C.current=r,p.current=o},[f,i,r,o]);const b=g.useCallback(M=>{const Q=M(D.current);return D.current=Q,l(Q),Q},[]);g.useEffect(()=>{A.current||!e||e.length===0||(A.current=!0,b(()=>e))},[e,b]);const B=g.useCallback(M=>{var P;const Q=b(M);(P=m.current)==null||P.call(m,Q)},[b]),S=g.useCallback(M=>{const Q=h.current[M];Q&&typeof URL<"u"&&typeof URL.revokeObjectURL=="function"&&(URL.revokeObjectURL(Q),delete h.current[M])},[]),v=g.useRef(),w=g.useCallback(()=>{var M;if(C.current)for(const Q of D.current){if(F.current>=Jv)break;Q.status!=="uploading"||E.current.has(Q.tempId)||(M=v.current)==null||M.call(v,Q.tempId)}},[]),k=g.useCallback(M=>{const Q=d.current[M],P=C.current;if(!Q||!P)return;E.current.add(M),F.current+=1;const _=V=>{b(G=>G.map(H=>H.tempId===M&&H.status==="uploading"?{...H,progress:Math.min(100,Math.max(0,Math.round(V)))}:H))},X=()=>{E.current.delete(M),F.current=Math.max(0,F.current-1),w()};P(Q,_,p.current).then(V=>{var G;if(!D.current.some(H=>H.tempId===M)){X();return}delete d.current[M],V.url&&S(M),B(H=>H.map(U=>U.tempId===M?{...U,status:"done",progress:100,attachmentId:V.attachmentId,filename:V.filename??U.filename,size:V.size??U.size,mimeType:V.mimeType??U.mimeType,url:V.url??U.url,error:void 0}:U)),(G=x.current)==null||G.call(x,{message:`${V.filename??Q.name} uploaded`,type:"success"}),X()}).catch(()=>{var V;if(!D.current.some(G=>G.tempId===M)){X();return}B(G=>G.map(H=>H.tempId===M?{...H,status:"failed",progress:void 0,error:"Upload failed"}:H)),(V=x.current)==null||V.call(x,{message:`Couldn't upload ${Q.name}`,type:"error"}),X()})},[S,B,w,b]);v.current=k;const L=g.useCallback(M=>{var X,V,G,H;if(!M.length)return;const Q=t-D.current.length;if(Q<=0){(X=x.current)==null||X.call(x,{message:`You can add up to ${t} files`,type:"error"});return}const P=[];let _=0;for(const U of M){if(P.length>=Q){_+=1;continue}if(Xv(U.name,u)){(V=x.current)==null||V.call(x,{message:"File upload failed: unsupported file format.",type:"error"});continue}if(Gv(U.size)>n){(G=x.current)==null||G.call(x,{message:`${U.name} is larger than ${n} MB`,type:"error"});continue}const z=qv();d.current[z]=U;let ue;typeof URL<"u"&&typeof URL.createObjectURL=="function"&&(ue=URL.createObjectURL(U),h.current[z]=ue),P.push({tempId:z,filename:U.name,size:U.size,mimeType:U.type||"application/octet-stream",status:"uploading",progress:0,url:ue})}_>0&&((H=x.current)==null||H.call(x,{message:`You can add up to ${t} files`,type:"error"})),P.length&&(B(U=>[...U,...P]),w())},[t,n,u,B,w]),N=g.useCallback(M=>{S(M),E.current.has(M)&&(E.current.delete(M),F.current=Math.max(0,F.current-1)),delete d.current[M],B(Q=>Q.filter(P=>P.tempId!==M)),w()},[S,B,w]),T=g.useCallback(M=>{const Q=D.current.find(P=>P.tempId===M);!Q||Q.status!=="failed"||(E.current.delete(M),B(P=>P.map(_=>_.tempId===M?{..._,status:"uploading",progress:0,error:void 0}:_)),w())},[B,w]);return g.useEffect(()=>{const M=h.current;return()=>{typeof URL<"u"&&typeof URL.revokeObjectURL=="function"&&Object.values(M).forEach(Q=>URL.revokeObjectURL(Q))}},[]),{items:c,addFiles:L,removeItem:N,retry:T}},Kv=e=>I.createElement("svg",{viewBox:"0 0 50 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},I.createElement("path",{d:"M0 8C0 3.58172 3.58172 0 8 0H30L40 10L50 20V56C50 60.4183 46.4183 64 42 64H8C3.58172 64 0 60.4183 0 56V8Z",fill:"#255C87"}),I.createElement("path",{d:"M17.2721 46.7279L23.8686 40.1314C24.2646 39.7354 24.4627 39.5373 24.691 39.4632C24.8918 39.3979 25.1082 39.3979 25.309 39.4632C25.5373 39.5373 25.7354 39.7354 26.1314 40.1314L32.6839 46.6839M27 41L29.8686 38.1314C30.2646 37.7354 30.4627 37.5373 30.691 37.4632C30.8918 37.3979 31.1082 37.3979 31.309 37.4632C31.5373 37.5373 31.7354 37.7354 32.1314 38.1314L35 41M23 35C23 36.1046 22.1046 37 21 37C19.8954 37 19 36.1046 19 35C19 33.8954 19.8954 33 21 33C22.1046 33 23 33.8954 23 35ZM19.8 47H30.2C31.8802 47 32.7202 47 33.362 46.673C33.9265 46.3854 34.3854 45.9265 34.673 45.362C35 44.7202 35 43.8802 35 42.2V33.8C35 32.1198 35 31.2798 34.673 30.638C34.3854 30.0735 33.9265 29.6146 33.362 29.327C32.7202 29 31.8802 29 30.2 29H19.8C18.1198 29 17.2798 29 16.638 29.327C16.0735 29.6146 15.6146 30.0735 15.327 30.638C15 31.2798 15 32.1198 15 33.8V42.2C15 43.8802 15 44.7202 15.327 45.362C15.6146 45.9265 16.0735 46.3854 16.638 46.673C17.2798 47 18.1198 47 19.8 47Z",stroke:"white",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"}),I.createElement("path",{d:"M30 16V0L50 20H34C31.7909 20 30 18.2091 30 16Z",fill:"#DBE9F5"})),$v=e=>I.createElement("svg",{viewBox:"0 0 50 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},I.createElement("path",{d:"M0 8C0 3.58172 3.58172 0 8 0H30L40 10L50 20V56C50 60.4183 46.4183 64 42 64H8C3.58172 64 0 60.4183 0 56V8Z",fill:"#8789C5"}),I.createElement("path",{d:"M25 48V28M20 48V43M20 33V28M30 48V43M30 33V28M15 33H35M15 43H35M35 43.2V32.8C35 31.1198 35 30.2798 34.673 29.638C34.3854 29.0735 33.9265 28.6146 33.362 28.327C32.7202 28 31.8802 28 30.2 28H19.8C18.1198 28 17.2798 28 16.638 28.327C16.0735 28.6146 15.6146 29.0735 15.327 29.638C15 30.2798 15 31.1198 15 32.8V43.2C15 44.8802 15 45.7202 15.327 46.362C15.6146 46.9265 16.0735 47.3854 16.638 47.673C17.2798 48 18.1198 48 19.8 48H30.2C31.8802 48 32.7202 48 33.362 47.673C33.9265 47.3854 34.3854 46.9265 34.673 46.362C35 45.7202 35 44.8802 35 43.2Z",stroke:"white",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"}),I.createElement("path",{d:"M30 16V0L50 20H34C31.7909 20 30 18.2091 30 16Z",fill:"#E7E7F3"})),ew=e=>I.createElement("svg",{viewBox:"0 0 50 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},I.createElement("path",{d:"M0 8C0 3.58172 3.58172 0 8 0H30L40 10L50 20V56C50 60.4183 46.4183 64 42 64H8C3.58172 64 0 60.4183 0 56V8Z",fill:"#852326"}),I.createElement("path",{d:"M16.6323 35.7197C17.8299 35.7197 18.7038 35.9779 19.2539 36.4941C19.804 37.0062 20.0791 37.7129 20.0791 38.6143C20.0791 39.0205 20.0177 39.4098 19.895 39.7822C19.7723 40.1504 19.5713 40.4784 19.292 40.7661C19.0169 41.0539 18.6488 41.2824 18.1875 41.4517C17.7262 41.6167 17.1571 41.6992 16.48 41.6992H15.6357V45H13.668V35.7197H16.6323ZM16.5308 37.332H15.6357V40.0869H16.2832C16.6514 40.0869 16.9709 40.0382 17.2417 39.9409C17.5125 39.8436 17.722 39.6912 17.8701 39.4839C18.0182 39.2765 18.0923 39.0099 18.0923 38.6841C18.0923 38.2271 17.9653 37.8885 17.7114 37.6685C17.4575 37.4442 17.064 37.332 16.5308 37.332ZM29.5308 40.271C29.5308 41.3162 29.3298 42.1901 28.9277 42.8926C28.5299 43.5908 27.9523 44.1177 27.1948 44.4731C26.4373 44.8244 25.5254 45 24.459 45H21.8311V35.7197H24.7446C25.7179 35.7197 26.5622 35.8932 27.2773 36.2402C27.9925 36.583 28.5469 37.0929 28.9404 37.77C29.334 38.4429 29.5308 39.2765 29.5308 40.271ZM27.4868 40.3218C27.4868 39.6362 27.3853 39.0734 27.1821 38.6333C26.9832 38.189 26.687 37.861 26.2935 37.6494C25.9041 37.4378 25.4217 37.332 24.8462 37.332H23.7988V43.375H24.6431C25.6037 43.375 26.3167 43.119 26.7822 42.6069C27.252 42.0949 27.4868 41.3332 27.4868 40.3218ZM33.3901 45H31.4541V35.7197H36.7734V37.332H33.3901V39.7251H36.5386V41.3311H33.3901V45Z",fill:"white"}),I.createElement("path",{d:"M30 16V0L50 20H34C31.7909 20 30 18.2091 30 16Z",fill:"#F5DBDA"})),tw=e=>I.createElement("svg",{viewBox:"0 0 50 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},I.createElement("path",{d:"M0 8C0 3.58172 3.58172 0 8 0H30L40 10L50 20V56C50 60.4183 46.4183 64 42 64H8C3.58172 64 0 60.4183 0 56V8Z",fill:"#94A3B8"}),I.createElement("path",{d:"M30 16V0L50 20H34C31.7909 20 30 18.2091 30 16Z",fill:"#F1F5F9"}),I.createElement("path",{d:"M16 38H34M16 32H34M16 44H28",stroke:"white",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round"})),nw=e=>I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 16 16",fill:"none",...e},I.createElement("g",{clipPath:"url(#clip0_3775_7404)"},I.createElement("path",{d:"M7.99999 3C4.66666 3 1.81999 5.07333 0.666656 8C1.81999 10.9267 4.66666 13 7.99999 13C11.3333 13 14.18 10.9267 15.3333 8C14.18 5.07333 11.3333 3 7.99999 3ZM7.99999 11.3333C6.15999 11.3333 4.66666 9.84 4.66666 8C4.66666 6.16 6.15999 4.66667 7.99999 4.66667C9.83999 4.66667 11.3333 6.16 11.3333 8C11.3333 9.84 9.83999 11.3333 7.99999 11.3333ZM7.99999 6C6.89332 6 5.99999 6.89333 5.99999 8C5.99999 9.10667 6.89332 10 7.99999 10C9.10666 10 9.99999 9.10667 9.99999 8C9.99999 6.89333 9.10666 6 7.99999 6Z",fill:"#4D596C"})),I.createElement("defs",null,I.createElement("clipPath",{id:"clip0_3775_7404"},I.createElement("rect",{width:16,height:16,fill:"white"})))),uw=e=>I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 16 16",fill:"none",...e},I.createElement("g",{clipPath:"url(#clip0_3775_7401)"},I.createElement("path",{d:"M12.9 6.69334C12.4467 4.39334 10.4267 2.66667 8 2.66667C6.07333 2.66667 4.4 3.76 3.56667 5.36001C1.56 5.57334 0 7.27334 0 9.33334C0 11.54 1.79333 13.3333 4 13.3333H12.6667C14.5067 13.3333 16 11.84 16 10C16 8.24001 14.6333 6.81334 12.9 6.69334ZM12.6667 12H4C2.52667 12 1.33333 10.8067 1.33333 9.33334C1.33333 7.96667 2.35333 6.82667 3.70667 6.68667L4.42 6.61334L4.75333 5.98001C5.38667 4.76001 6.62667 4.00001 8 4.00001C9.74667 4.00001 11.2533 5.24001 11.5933 6.95334L11.7933 7.95334L12.8133 8.02667C13.8533 8.09334 14.6667 8.96667 14.6667 10C14.6667 11.1 13.7667 12 12.6667 12ZM8.96667 6.66667H7.03333V8.66667H5.33333L8 11.3333L10.6667 8.66667H8.96667V6.66667Z",fill:"#4D596C"})),I.createElement("defs",null,I.createElement("clipPath",{id:"clip0_3775_7401"},I.createElement("rect",{width:16,height:16,fill:"white"})))),rw=nw,c2=uw,l2=({mimeType:e})=>e&&/^image\//.test(e)?a.jsx(Kv,{}):e&&/^video\//.test(e)?a.jsx($v,{}):e==="application/pdf"?a.jsx(ew,{}):a.jsx(tw,{}),ai="var(--connector-border-strong, #D6DDE8)",ow="color-mix(in srgb, var(--connector-negative, #E42525) 12%, var(--connector-surface, #FFFFFF))",si=`
1745
1745
  display: inline-flex;
1746
1746
  align-items: center;
1747
1747
  justify-content: center;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hiver/connector-agent",
3
- "version": "4.22.10-mondayEmailLog-beta.1",
3
+ "version": "4.22.10-mondayEmailLog-beta.2",
4
4
  "main": "index.es.js",
5
5
  "module": "index.es.js",
6
6
  "types": "index.d.ts",