@eka-care/medassist-widget 0.0.99 → 0.1.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.
@@ -43,7 +43,7 @@ Error generating stack: `+o.message+`
43
43
  .synapse-chat-widget-container [data-radix-scroll-area-viewport] {
44
44
  overscroll-behavior: contain;
45
45
  }
46
- `}),y.jsxs(Yn,{className:QA(k,"border-0"),"data-text-color":D.textColor,children:[D.backgroundImage&&y.jsx("div",{className:"absolute inset-0 -z-10",style:{backgroundImage:`url(${D.backgroundImage})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",transform:"scale(1.1)"}}),D.backgroundImage&&D.textColor==="black"&&y.jsx("div",{className:"absolute inset-0 -z-10",style:{backgroundColor:"rgba(0, 0, 0, 0.4)"}}),y.jsx("div",{className:QA("flex-shrink-0 sticky top-0 z-50 synapse-chat-widget-header",D.backgroundImage?"":"bg-popover"),style:{...!Q&&{cursor:A?"grab":"default"}},children:y.jsx(K4,{onClose:n,showCloseButton:r,title:c,titleImg:f,iconUrl:i,startNewConversation:l})}),y.jsx("div",{className:"flex-1 min-h-0 overflow-hidden flex flex-col relative",children:u}),Y?.disp_toast_msg&&y.jsx("div",{className:"pointer-events-auto absolute left-0 right-0 bottom-[150px] z-[70] flex justify-center px-4",children:y.jsxs(Yn,{className:"px-4 py-2 rounded-full shadow-md bg-popover text-popover-foreground flex items-center gap-3 max-w-[90%]",children:[y.jsx("span",{className:"text-xs font-medium truncate",children:Y.disp_toast_msg}),y.jsx("button",{type:"button",onClick:()=>$({...Y,disp_toast_msg:void 0}),className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground hover:text-foreground",children:"X"})]})}),B&&y.jsxs("div",{className:QA("flex-shrink-0 sticky bottom-0 z-50 synapse-chat-widget-footer",D.backgroundImage?"":"bg-popover",s&&"synapse-chat-widget-footer--no-border"),children:[y.jsx(x.Suspense,{fallback:null,children:y.jsx(Ab,{value:B.value,onChange:B.onChange,onSend:U?_:B.onSend,onFileChange:B.onFileChange,onRemoveFile:B.onRemoveFile,onRecording:B.onRecording,isRecording:B.isRecording,hasAttachment:B.hasAttachment,attachmentFiles:B.attachmentFiles,isDisabled:B.isDisabled||U&&T,isMobile:Q,placeholder:B.placeholder,recordingStatus:B.recordingStatus,theme:D,onStartNewChat:l,showStartNewChatButton:s,allowed:B.allowed})}),h&&p==="development"&&y.jsx("div",{className:"px-6 flex justify-center items-center",children:y.jsxs("p",{className:"text-[8px] text-text-secondary font-mono opacity-50",children:["Session ID: ",h]})}),y.jsxs("div",{className:"px-6 py-2 flex justify-center items-center gap-1.5 text-foreground opacity-90",children:[y.jsx("span",{className:"text-[10px] leading-[14px] font-medium",style:{fontFamily:"Inter, system-ui, -apple-system, sans-serif"},children:"Powered by"}),y.jsx($4,{})]})]})]})]})}function Tp(){const[A,n]=x.useState(typeof navigator<"u"?navigator.onLine:!0);return x.useEffect(()=>{const r=()=>n(!0),i=()=>n(!1);return window.addEventListener("online",r),window.addEventListener("offline",i),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",i)}},[]),{isOnline:A}}const Qc=5,eb=10*1024*1024,tb=({environment:A,baseUrl:n,context:r,auth:i})=>{const[l,s]=x.useState([]),[u,c]=x.useState(!1),[f,h]=x.useState(0),[B,p]=x.useState(!1),[m,C]=x.useState([]),Q=x.useRef(null),E=x.useRef(null),{isOnline:T}=Tp(),{agentId:S,setSessionId:H,setSessionToken:D,sessionId:Y,sessionToken:$,setError:U,setConnectionStatus:_,setShowRetryButton:R,setStartNewConnection:O,setIsStreaming:G,setIsWaitingForResponse:k,isStreaming:K,initialMessage:eA,isWaitingForResponse:aA,setProgressMessage:tA,setRecordingStatus:L,clearSession:W,addMessageToSession:q,getMessagesForSession:pA,updateMessageInSession:F,setInitialMessage:N,userId:J,setUserId:b,fileUploadPerSession:lA,setFileUploadPerSession:dA,setElicitationState:fA,elicitationState:hA}=st();x.useEffect(()=>{T?B?XA()&&(_(je.CONNECTED),Re()):_(je.CONNECTING):_(je.NOT_CONNECTED)},[T,B]),x.useEffect(()=>{if(Y){const uA=pA(Y)||[];uA.length<=0&&eA?.text?s([{id:Date.now().toString(),content:eA.text,role:lt.ASSISTANT,timestamp:Rr(Date.now()),isStored:!1,...eA.suggestions?.length&&{toolEscalationData:{tool_id:eA.suggestions[0].value??null,tool_name:"elicitation",details:{component:EA.SYNAPSE_COMPONENTS.PILL,input:{options:eA.suggestions.map(oA=>({id:oA.value||"",label:oA.label||"",value:oA.value||""}))}},isResponded:!1}}}]):s(uA),C([])}},[Y,eA]),x.useEffect(()=>{if(p(!1),!S)return;const uA=new EA.SynapseSDK({agentId:S,environment:A,userId:J,callbacks:{onError:oA=>{if(oA instanceof EA.SynapseError)switch(oA.code){case EA.SynapseErrorCode.SESSION:const z=oA.context;z?.stage==="handleSessionExpiry"||z?.stage==="refreshSession"?T?(U({title:"Something went wrong!",description:"Please try again."}),R(!0)):(U({title:"Your session has ended.",description:"Please start a new Chat."}),R(!0)):(_(je.NOT_CONNECTED),U({title:"Something went wrong!",description:"Please try again."}),R(!0));break;case EA.SynapseErrorCode.RECORDING:U({title:"Recording failed",description:oA?.displayMessage||"Please try again later"});break;case EA.SynapseErrorCode.CONNECTION:XA()||(_(je.NOT_CONNECTED),f<2?(h(cA=>cA+1),NA(Y,$)):(R(!0),U({title:"Trying to connect...",description:"Please wait while we try to connect"})));break;default:U({title:"Something went wrong",description:"Please try again later from onError callback"}),R(!0);break}},onSessionRefreshed:oA=>{oA?.session_id&&oA?.session_token&&(H(oA.session_id),D(oA.session_token),NA(oA.session_id,oA.session_token))}},...n&&{serverUrl:n},...r&&{context:r},...i&&{auth:i}});return Q.current=uA,p(!0),()=>{p(!1),Q.current?.endSession(),Q.current=null,E.current&&(clearTimeout(E.current),E.current=null)}},[S,A,i]),x.useEffect(()=>{const uA=l[l.length-1];!uA?.role||!Y||(uA?.role===lt.USER?q(Y,uA):!K&&!uA.isStored&&(s(oA=>{const z=[...oA];return z[z.length-1]={...uA,isStored:!0},z}),q(Y,{...uA,isStored:!0})))},[l,K]),x.useEffect(()=>{const uA=l[l.length-1];return()=>{uA&&!uA?.isStored&&Y&&q(Y,{...uA,isStored:!0})}},[]),x.useEffect(()=>(E.current&&(clearTimeout(E.current),E.current=null),aA&&!K?E.current=setTimeout(()=>{k(!1),E.current=null},3e4):K&&E.current&&(clearTimeout(E.current),E.current=null),()=>{E.current&&(clearTimeout(E.current),E.current=null)}),[aA,K,k]);const NA=async(uA,oA,z=!1)=>{try{const nA=await Q.current?.startSession({session_id:uA||"",session_token:oA||""});nA?.session_id&&nA?.session_token&&(H(nA.session_id),D(nA.session_token)),(nA?.initial_message?.text||nA?.initial_message?.suggestions?.length)&&N(nA.initial_message),nA?.user_id&&b(nA.user_id),sr()}catch(nA){const cA=nA.context,yA=cA?.stage==="handleSessionExpiry"||cA?.stage==="refreshSession"||nA instanceof EA.APIError&&nA.status===404,xA=nA instanceof EA.APIError&&nA.status===403;yA?(U(null),_(je.NOT_CONNECTED),O(!0)):xA&&!z?(W(),Re(),await NA(void 0,void 0,!0)):(U({title:"Something went wrong!",description:"Please try again later."}),R(!0))}},_A=async(uA=!1)=>{try{if(!Q.current){U({title:"SDK not initialized",description:"Please ensure agentId is configured"}),c(!1);return}if(c(!0),uA){await W(),await Q?.current?.endSession(),Re(),await NA();return}const{sessionId:oA,sessionToken:z}=st.getState();await NA(oA,z)}catch{}finally{c(!1)}},XA=()=>Q.current?.isConnected()??!1,Me=()=>{Q.current?.endSession()},Re=()=>{h(0),R(!1),O(!1),U(null)},sr=()=>{Q.current?.on(EA.SYNAPSE_REALTIME_EVENTS.MESSAGE_CHUNK,uA=>{const oA=uA;if(oA.data?.text&&oA.messageId){K||(k(!1),G(!0)),XA()&&_(je.CONNECTED);const z=oA.data.text,nA=oA.messageId;s(cA=>{const yA=cA[cA.length-1];if(yA&&yA.id===nA&&yA.role===lt.ASSISTANT){const xA=[...cA];return xA[xA.length-1]={...yA,content:yA.content+z},xA}else return[...cA,{id:nA,content:z,role:lt.ASSISTANT,timestamp:Rr(Date.now()),isStored:!1}]})}}),Q.current?.on(EA.SYNAPSE_REALTIME_EVENTS.END_OF_STREAM,()=>{G(!1),tA(null),k(!1)}),Q.current?.on(EA.SYNAPSE_REALTIME_EVENTS.CONNECTED,()=>{Re(),_(je.CONNECTED)}),Q.current?.on(EA.SYNAPSE_REALTIME_EVENTS.TOOL_CALL,uA=>{const oA=uA;if(!oA?.messageId||!oA?.data||!oA?.data?.details?.component||!oA?.data?.tool_id)return;aA&&k(!1);const z=oA.messageId,nA=oA.timestamp??Date.now();switch(oA?.data?.details?.status){case EA.SYNAPSE_EICITATION_STATUS.PROGRESS:{const cA=oA?.data?.details?._meta?.schema?.required||[],yA=oA?.data?.details?.input||{},xA=cA.reduce((qA,pe)=>(yA[pe]!==void 0&&(qA[pe]=yA[pe]),qA),{}),Be={...st.getState().elicitationState.input||{},...xA},tt=cA.find(qA=>!Be[qA]),ve=oA.data.details?._meta?.mcp_meta_fields||[];fA({active:!0,input:Be,required:cA,component:oA.data.details?.component,toolId:oA.data.tool_id??void 0,toolSelectionName:tt,messageId:z,pattern:oA.data.details?._meta?.schema?.properties?.[oA.data.details?.component]?.pattern,minLength:oA.data.details?._meta?.schema?.properties?.[oA.data.details?.component]?.minLength,maxLength:oA.data.details?._meta?.schema?.properties?.[oA.data.details?.component]?.maxLength,type:oA.data.details?._meta?.schema?.properties?.[oA.data.details?.component]?.type,disp_toast_msg:oA.data.details?._meta?.disp_toast_msg,description:oA.data.details?._meta?.schema?.properties?.[oA.data.details?.component]?.description,...ve.length&&{mcp_meta_fields:ve}});break}case EA.SYNAPSE_EICITATION_STATUS.FAILURE:{fA({active:!1});break}case EA.SYNAPSE_EICITATION_STATUS.SUCCESS:{fA({active:!1,disp_toast_msg:oA?.data?.details?._meta?.disp_toast_msg});break}}s(cA=>{const yA=cA[cA.length-1];if(yA.id===z&&yA.role===lt.ASSISTANT){const xA=[...cA],Be={...yA,content:yA.content,toolEscalationData:{...oA.data,isResponded:!1},isResponseFromTool:!0};return xA[cA.length-1]=Be,F(Y,z,Be),xA}else{const xA={id:z,content:oA.data?.details?.input?.text||"",role:lt.ASSISTANT,toolEscalationData:{...oA.data,isResponded:!1},isResponseFromTool:!0,timestamp:Rr(nA),isStored:!1};return[...cA,xA]}})}),Q.current?.on(EA.SYNAPSE_REALTIME_EVENTS.DISCONNECTED,uA=>{uA?.reason!==EA.DisconnectionReason.CLIENT_CLOSED&&(f<2?(_(je.NOT_CONNECTED),h(oA=>oA+1),R(!0),U({title:"Something went wrong!",description:"Please try again."})):(_(je.NOT_CONNECTED),U({title:"Something went wrong!",description:"Please start a new Chat."}),O(!0)))}),Q.current?.on(EA.SYNAPSE_REALTIME_EVENTS.ERROR,uA=>{switch(uA?.data?.code){case EA.SYNAPSE_REALTIME_ERROR_CODES.SESSION_INACTIVE:U({title:"Session not found",description:"Please start a new session"}),O(!0),L(fe.IDLE);return;case EA.SYNAPSE_REALTIME_ERROR_CODES.SESSION_TOKEN_MISMATCH:U({title:"Session not found",description:"Please start a new chat from onError callback"}),O(!0),L(fe.IDLE);return;case EA.SYNAPSE_REALTIME_ERROR_CODES.INVALID_EVENT:return;case EA.SYNAPSE_REALTIME_ERROR_CODES.INVALID_CONTENT_TYPE:return;case EA.SYNAPSE_REALTIME_ERROR_CODES.PARSING_ERROR:if(f<1){h(z=>z+1),Lt();return}U({title:"Error parsing request",description:"please try again"}),R(!0),L(fe.IDLE);return;case EA.SYNAPSE_REALTIME_ERROR_CODES.TIMEOUT:U({title:"Request timed out",description:"please try again"}),R(!0),L(fe.IDLE);return;case EA.SYNAPSE_REALTIME_ERROR_CODES.PROMPT_FETCH_ERROR:U({title:"Something went wrong",description:"please try again"}),R(!0),L(fe.IDLE);return;case EA.SYNAPSE_REALTIME_ERROR_CODES.INVALID_FILE_REQUEST:U({title:"Something went wrong",description:"please try again"}),R(!0),L(fe.IDLE);return;case EA.SYNAPSE_REALTIME_ERROR_CODES.SERVER_ERROR:U({title:"Something went wrong",description:"please try again"}),R(!0),L(fe.IDLE);return;default:U({title:"Something went wrong",description:"please try again"}),R(!0),L(fe.IDLE);return}}),Q.current?.on(EA.SYNAPSE_REALTIME_EVENTS.AUDIO_TRANSCRIPT,async uA=>{const oA=uA;oA?.data?.text&&(s(z=>[...z,{id:Date.now().toString(),content:oA.data.text||"",role:lt.USER,timestamp:Rr(Date.now()),isStored:!0}]),L(fe.IDLE)),G(!1),k(!1),tA(null)}),Q.current?.on(EA.SYNAPSE_REALTIME_EVENTS.PROGRESS_MESSAGE,uA=>{const oA=uA;oA.data?.text&&(k(!1),tA(oA.data.text))}),Q.current?.on(EA.SYNAPSE_REALTIME_EVENTS.TOOL_START,uA=>{const oA=uA;if(oA.data?.name&&oA.messageId){const z=oA.messageId;s(nA=>{const cA=nA[nA.length-1];if(cA&&cA.id===z&&cA.role===lt.ASSISTANT){const yA=[...nA];return yA[yA.length-1]={...cA,toolCallStatus:`Calling tool: ${oA.data.name}...`},Y&&F(Y,z,{toolCallStatus:`Calling tool: ${oA.data.name}...`}),yA}return nA})}}),Q.current?.on(EA.SYNAPSE_REALTIME_EVENTS.TOOL_END,uA=>{const oA=uA;if(oA.data?.name&&oA.messageId){const z=oA.messageId;s(nA=>{const cA=nA[nA.length-1];if(cA&&cA.id===z&&cA.role===lt.ASSISTANT){const yA=[...nA];return yA[yA.length-1]={...cA,toolCallStatus:"Tool call completed."},Y&&F(Y,z,{toolCallStatus:"Tool call completed."}),yA}return nA})}})},et=async({message:uA,messageId:oA,files:z,audio:nA,toolCalled:cA,hidden:yA,selectedCard:xA,selectedComponent:Be,resend:tt})=>{if(!XA()){R(!0),U({title:"Please try again."});return}if(z&&z.length===0&&uA?.trim()===""&&!nA?.audio&&!Be&&!hA.active)return;if(z&&z.length>3){U({title:"Maximum 3 files are allowed to be sent at a time",description:"Please try again"});return}if(z&&z.length>0&&z.reduce((nt,ke)=>nt+ke.size,0)>10*1024*1024){U({title:"Total file size limit of 10MB exceeded",description:"Please reduce the size of the files or try again with less files"});return}if(z&&z.length>0&&z.length+lA>Qc){const nt=Qc-lA;U({title:`You can only upload up to ${Qc} files per session`,description:`${nt<=0?"Maximum file upload limit reached":`You have ${nt} file${nt===1?"":"s"} upload${nt===1?"":"s"} left`}`});return}else z&&z.length&&dA(lA+z.length);U(null),R(!1),XA()&&_(je.CONNECTED);const ve=l.length==2&&m.length==2?m:null;let qA=null;const pe=l.length-1,zA=pe>=0?l[pe]:null,Wt=zA?zA?.isResponseFromTool||zA.role===lt.ASSISTANT&&zA.toolEscalationData:null,JA=st.getState().elicitationState;if(JA?.active&&JA?.toolId&&JA?.messageId){const nt=JA.toolSelectionName??JA.required?.find(me=>!JA.input?.[me])??"",ke=Be?Be[nt]:uA,dt=JA.mcp_meta_fields?.reduce((me,xe)=>(nt===xe?me[xe]=ke:JA.input?.[xe]&&(me[xe]=JA.input[xe]),tt&&!me.is_resend&&(me.is_resend=tt),me),{}),it={...Object.keys(JA.input||{})?.reduce((me,xe)=>{const Ii=!Object.keys(dt||{})?.includes(xe),dl=!!JA.input?.[xe];return(tt?Ii&&dl:Ii&&JA.required?.includes(xe)&&dl)&&(me[xe]=JA.input?.[xe]),me},{})||{},...!tt&&nt&&!Object.keys(dt||{})?.includes(nt)?{[nt]:ke}:{},...Object.keys(dt||{}).length&&{mcp_meta_fields:dt}};fA({...JA,input:{...JA.input||{},...it}});try{await ge(JA.toolId,JA.messageId,it),qA=!0}catch{fA({active:!1})}}else await Q.current?.sendMessage({message:uA,files:z,audio:nA,...ve&&{initial_prompts:ve},...Wt&&!cA?{tool_declined:!0,tool_id:zA?.toolEscalationData?.tool_id||""}:{}});(uA||z&&z.length>0)&&(s(nt=>{const ke=[...nt],dt=ke.length-1,$t=ke[dt].toolEscalationData||null;if(Wt&&dt>=0&&$t&&Object.keys($t).length>0){let it;const me=$t.details;if(me?.component===EA.SYNAPSE_COMPONENTS.CARD&&me?.input?.cards){const xe=me.input.cards.find(Ii=>Ii.title===xA)||null;xe&&(it={...$t,isResponded:!0,tool_id:null,details:{...me,input:{...me.input,cards:[xe]}}})}it||(it={...$t,isResponded:!hA.active,tool_id:null}),ke[dt]={...ke[dt],toolEscalationData:it},F(Y,ke[pe].id||Date.now().toString(),ke[pe])}return yA||qA?ke:[...ke,{id:oA||Date.now().toString(),content:uA||"",files:z||[],role:lt.USER,timestamp:Rr(Date.now()),isStored:!0}]}),qA||k(!0),qA=null)},fn=uA=>uA.type.toLowerCase()&&!["application/pdf","image/jpeg","image/jpg","image/png"].includes(uA.type)?(U({title:`File type not supported: ${uA.name}`,description:"Only PDF, images (JPG, JPEG, PNG) are allowed."}),!1):uA.size>3*1024*1024?(U({title:"File size limit of 3MB exceeded",description:"Please reduce the size of the file or try again with a smaller file"}),!1):!0,dn=async()=>{if(!XA())throw new Error("Not connected to the server");try{await Q.current?.startRecording({onChunks:async uA=>{L(fe.PROCESSING),await et({audio:uA}),L(fe.TRANSCRIBING)},onError(uA){L(fe.IDLE)}}),L(fe.LISTENING)}catch(uA){throw L(fe.IDLE),uA}},re=()=>{XA()&&Q.current?.endRecording()},ge=async(uA,oA,z)=>{try{if(!XA())throw new Error("Not connected to the server");await Q.current?.callTool(uA,oA,z)}catch(nA){throw nA}},De=async()=>{Re(),await W(),await _A(!0)},Lt=async()=>{if(!XA())_(je.NOT_CONNECTED),f<2?(h(uA=>uA+1),await NA(Y,$)):f===2?(h(uA=>uA+1),R(!0),U({title:"Trying to connect..."})):(U({title:"Something went wrong!",description:"Please start a new chat."}),O(!0));else{_(je.CONNECTED),Re();const uA=l[l.length-1];uA&&uA.role===lt.USER&&Q.current?.sendMessage({message:uA.content,files:uA.files||[],messageId:uA.id})}};return{sendMessage:et,startSession:_A,incomingMessages:l,loading:u,endSession:Me,isReady:B,startRecording:dn,stopRecording:re,handleRetry:Lt,isValidFile:fn,handleStartNewConnection:De,callTool:ge,handleInitialTaskClick:async uA=>{if(!eA?.suggestions?.length||!uA)return;const oA=eA.suggestions.find(z=>z.value===uA);if(!oA||!oA.response){await et({message:uA});return}s(z=>[...z,{id:Date.now().toString(),content:uA,role:lt.USER,timestamp:Rr(Date.now()),isStored:!0}]),k(!0),await NQ(1e3),k(!1),s(z=>[...z,{id:Date.now().toString(),content:oA.response||"Please try again",role:lt.ASSISTANT,timestamp:Rr(Date.now()),isStored:!1}]),C([{role:"user",text:uA},{role:"assistant",text:oA.response}])},handleToggleFeedback:async(uA,oA,z)=>{if(XA())try{await Q.current?.sendFeedback(oA,uA,z)}catch{}},clearElicitationState:async()=>{try{await et({message:`User aborted elicitation :tool id ${hA.toolId}, message id ${hA.messageId}, ${hA.component}`,hidden:!0})}catch{}finally{fA({active:!1})}}}},nb=x.lazy(()=>Promise.resolve().then(()=>lF)),rb=x.lazy(()=>Promise.resolve().then(()=>oF).then(A=>({default:A.ConnectionStatus})));function ib({isOpen:A,agentId:n,config:r}){const[i,l]=x.useState(""),[s,u]=x.useState(!1),[c,f]=x.useState(!1),[h,B]=x.useState([]),p=x.useRef(!1),m=x.useRef(null),C=x.useRef(null),[Q,E]=x.useState(!1),{setAgentId:T,startNewConnection:S,showRetryButton:H,clearError:D,error:Y,connectionStatus:$,recordingStatus:U,isWaitingForResponse:_,isStreaming:R,setError:O,sessionId:G,agentId:k,setContext:K}=st(),{incomingMessages:eA,loading:aA,sendMessage:tA,startSession:L,isReady:W,startRecording:q,stopRecording:pA,handleRetry:F,isValidFile:N,handleToggleFeedback:J,clearElicitationState:b}=tb({environment:"production",baseUrl:r.environment==="development"&&r.baseUrl?r.baseUrl:void 0,context:r?.context,...r?.auth&&{auth:r.auth}});x.useEffect(()=>{n&&(D4(n),k4(n),T(n),r?.context&&Object.keys(r?.context||{}).length&&K(r.context),A&&W&&!p.current&&(p.current=!0,L(!1)))},[A,W,k]);const lA=()=>m.current?.querySelector("[data-radix-scroll-area-viewport]")||null,dA=()=>{const re=lA();re&&(re.scrollTo({top:re.scrollHeight,behavior:"smooth"}),E(!1))},fA=eA.length>0,hA=eA.length===1;x.useEffect(()=>{hA?setTimeout(()=>{dA()},0):dA()},[eA,R,hA]);const NA=$===EA.ConnectionStatus.CONNECTED,_A=aA||!NA||_||R,XA=aA||!NA,Me=x.useMemo(()=>U===fe.IDLE?null:U===fe.LISTENING?"Listening...":U===fe.PROCESSING?"Processing...":U===fe.TRANSCRIBING?"Transcribing...":null,[U]),Re=XA?"Connecting...":Me&&U!==fe.IDLE?Me:_||R?"Please wait for the response...":"Type a reply…",sr=async re=>{if(_A)return;const ge=re?.message??i;if(ge.trim()||s||c||re?.resend){const De=Date.now().toString();h.length>0?(await tA({files:h,message:ge.trim(),messageId:De}),B([]),f(!1)):ge.trim()?await tA({message:ge.trim(),messageId:De,resend:re?.resend}):re?.resend&&await tA({resend:re?.resend}),l(""),u(!1),f(!1),setTimeout(()=>{dA()},100)}},et=re=>{if(re&&re.length>0){const ge=re.filter(De=>!!N(De));if(ge?.length+h.length>3){O({title:"You can only upload up to 3 files at a time",description:"Please remove some files and try again."});return}if(ge?.length>0&&ge.reduce((De,Lt)=>De+Lt.size,0)>10*1024*1024){O({title:`Total file size limit of ${eb} MB exceeded`,description:"Please reduce the size of the files or try again with less files"});return}if(ge?.length>0)re=ge;else return}B(ge=>(f((ge?.length??0)+(re?.length??0)>0),[...ge,...re]))},fn=re=>{B(ge=>{const De=ge.filter((Lt,or)=>or!==re);return f(De.length>0),De})},dn=async()=>{if(s)await pA(),u(!1);else{if(_A)return;try{await q(),u(!0)}catch{}}};return y.jsx(Fp,{isOpen:A,onClose:r.onClose,showCloseButton:r.showCloseButton,title:r.title,showStartNewChatButton:S,titleImg:r.theme?.titleImg,iconUrl:r.iconUrl,onStartNewSession:()=>L(!0),sessionId:G,environment:r.environment,displayMode:r.displayMode??"widget",theme:r.theme,chatComposer:{value:i,onChange:l,onSend:sr,onFileChange:et,onRemoveFile:fn,onRecording:dn,isRecording:s,hasAttachment:c,attachmentFiles:h,isDisabled:_A,placeholder:Re,recordingStatus:U,allowed:r.allowed},children:!aA&&y.jsx(x.Suspense,{fallback:y.jsx(ab,{}),children:y.jsxs("div",{className:QA("flex-1 flex flex-col min-h-0 overflow-hidden relative synapse-chat-window",r.theme?.backgroundImage?"":"bg-surface"),children:[y.jsxs(dB,{ref:m,className:"flex-1 min-h-0 [&>[data-radix-scroll-area-viewport]>div]:!flex [&>[data-radix-scroll-area-viewport]>div]:flex-col [&>[data-radix-scroll-area-viewport]>div]:min-h-full",children:[y.jsx("div",{className:"flex-1"}),y.jsxs("div",{className:QA("transition-all duration-300 min-w-0 overflow-x-hidden",fA?"p-4 space-y-3":"p-4 space-y-4"),children:[hA&&y.jsx("div",{className:"text-xs text-[var(--color-muted-foreground)] text-center mb-2",children:"Just now"}),!hA&&y.jsx("div",{className:"text-xs text-[var(--color-muted-foreground)] text-center",children:new Date().toLocaleString("en-US",{weekday:"long",hour:"2-digit",minute:"2-digit",hour12:!0})}),y.jsx(nb,{messages:eA,onSendMessage:tA,iconUrl:r.iconUrl,onToggleFeedback:J,onClearElicitationState:b}),y.jsx("div",{ref:C})]})]}),Q&&y.jsx("div",{className:"absolute bottom-[10px] left-1/2 transform -translate-x-1/2 z-10",children:y.jsx($A,{onClick:dA,size:"icon",className:"h-10 w-10 rounded-full bg-surface/90 backdrop-blur-sm shadow-lg border border-border-subtle hover:bg-surface hover:shadow-xl transition-all duration-200",children:y.jsx(gs,{className:"w-5 h-5 text-text-primary"})})}),y.jsx(rb,{className:"mt-2",onRetry:F,showRetryButton:H,startNewConnection:S,clearError:D,error:Y,isConnected:NA})]})})})}function ab(){return y.jsxs("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden bg-surface backdrop-blur-2xl animate-pulse",children:[y.jsxs("div",{className:"flex-1 p-6 space-y-4",children:[y.jsx("div",{className:"h-16 bg-surface/80 rounded-2xl border border-border-subtle/50"}),y.jsx("div",{className:"h-16 bg-surface/80 rounded-2xl border border-border-subtle/50"}),y.jsx("div",{className:"h-16 bg-surface/80 rounded-2xl border border-border-subtle/50"})]}),y.jsx("div",{className:"h-24 border-t border-border-subtle bg-surface/80"})]})}function bc(A){if(A instanceof Error)return A;if(typeof A=="string")return new Error(A);try{return new Error(JSON.stringify(A))}catch{return new Error("Unknown error")}}class lb extends x.Component{state={error:null};static getDerivedStateFromError(n){return{error:bc(n)}}componentDidCatch(n,r){this.setState({componentStack:r?.componentStack})}render(){return this.state.error?y.jsx(ub,{error:this.state.error,componentStack:this.state.componentStack,title:this.props.title,titleImg:this.props.titleImg,iconUrl:this.props.iconUrl,onClose:this.props.onClose,showCloseButton:this.props.showCloseButton,environment:this.props.environment,displayMode:this.props.displayMode,theme:this.props.theme}):this.props.children}}function sb({error:A}){throw A}function ob(A){const[n,r]=x.useState(null);return x.useEffect(()=>{if(typeof window>"u")return;const i=s=>{!s?.error&&!s?.filename&&s?.message==="Script error."||(s?.error?r(bc(s.error)):s?.message&&r(new Error(s.message)))},l=s=>{r(bc(s.reason))};return window.addEventListener("error",i),window.addEventListener("unhandledrejection",l),()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",l)}},[]),y.jsx(lb,{...A,children:n?y.jsx(sb,{error:n}):A.children})}function ub({error:A,title:n,titleImg:r,iconUrl:i,onClose:l,showCloseButton:s,environment:u,displayMode:c,theme:f}){const h=()=>{typeof window<"u"&&window.location.reload()},B=n??"Medi Clinic",p=u??"production",m=x.useMemo(()=>f?.textColor==="white"?"text-white/60":"text-[var(--color-muted-foreground)]",[f?.textColor]);return y.jsx(Fp,{isOpen:!0,onClose:l??(()=>{}),showCloseButton:s??!1,onStartNewSession:h,title:B,titleImg:r,iconUrl:i,environment:p,displayMode:c,theme:f,children:y.jsx("div",{className:"flex-1 min-h-0 overflow-hidden flex flex-col",children:y.jsx("div",{className:"flex-1 min-h-0 flex items-center justify-center p-6",children:y.jsxs("div",{className:"w-full max-w-[320px] text-center",children:[y.jsx("div",{className:"mx-auto mb-4 grid place-items-center",children:y.jsx("div",{className:"h-16 w-16 rounded-3xl bg-popover backdrop-blur border border-border-subtle grid place-items-center",children:y.jsx(s4,{className:"h-8 w-8",style:{color:f?.primary??"hsl(var(--primary))"}})})}),y.jsx("div",{className:"text-2xl font-semibold text-text-primary",children:"Uh-oh!"}),y.jsx("div",{className:["mt-2 text-sm",m].join(" "),children:"Something went wrong. Please try again."}),y.jsx("div",{className:["mt-4 rounded-2xl border border-border-subtle/60 bg-surface/60 backdrop-blur px-4 py-3","text-left text-[11px] leading-relaxed font-mono whitespace-pre-wrap break-words",m].join(" "),children:A?.message||String(A)}),y.jsx("div",{className:"mt-5 flex items-center justify-center gap-3",children:y.jsxs($A,{type:"button",onClick:h,className:"rounded-2xl",style:{backgroundColor:f?.primary??void 0},children:[y.jsx(i4,{className:"h-4 w-4 mr-2"}),"Retry"]})})]})})})})}function cb({agentId:A,config:n}){const[r,i]=x.useState(!1);x.useEffect(()=>{i(!0)},[]);const l=()=>{i(!1),n?.onClose?.()};return y.jsx(ob,{title:n.title??"Medi Clinic",titleImg:n.theme?.titleImg,iconUrl:n.iconUrl??"https://cdn.eka.care/bot-icon.svg",onClose:l,showCloseButton:n.showCloseButton,environment:n.environment??"production",displayMode:n.displayMode,theme:n.theme,children:y.jsx(ib,{isOpen:r,agentId:A,config:{...n,environment:n.environment??"production",onClose:l,title:n.title??"Medi Clinic",iconUrl:n.iconUrl??"https://cdn.eka.care/bot-icon.svg",theme:n.theme}})})}const Hp=(A,n,r)=>{const i=r||{},l=mv.createRoot(A);return l.render(y.jsx(x.StrictMode,{children:y.jsx(cb,{agentId:n,config:i})})),l};typeof window<"u"&&(window.renderMedAssist=Hp);const Ip=x.forwardRef(({className:A,...n},r)=>y.jsx("textarea",{className:QA("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",A),ref:r,...n}));Ip.displayName="Textarea";function Np({file:A,onRemove:n,isPreview:r=!0,className:i=""}){const[l,s]=x.useState(!1),[u,c]=x.useState(""),f=A?.type?.startsWith("image/")??!1,h=A?.type==="application/pdf";x.useEffect(()=>{if(f){const m=URL.createObjectURL(A);return c(m),()=>URL.revokeObjectURL(m)}},[A,f]),x.useEffect(()=>{s(!1)},[A]);const B=()=>f?"text-green-600":"text-text-secondary",p=m=>{if(m===0)return"0 B";const C=1024,Q=["B","KB","MB","GB"],E=Math.floor(Math.log(m)/Math.log(C));return`${(m/Math.pow(C,E)).toFixed(1)} ${Q[E]}`.toLowerCase()};return!f||l?y.jsxs("div",{className:`relative group inline-flex flex-shrink-0 bg-white border border-neutral-300 rounded-lg flex items-center gap-3 px-3 py-2.5 max-w-full ${r?"hover:bg-neutral-50":""} ${i}`,children:[y.jsx("div",{className:`flex-shrink-0 ${B()}`,children:y.jsx(A4,{className:"h-5 w-5"})}),y.jsxs("div",{className:"flex-1 min-w-0 max-w-[200px]",children:[A?.name&&y.jsx("div",{className:"text-sm font-medium text-[var(--color-foreground)] truncate",children:A.name}),A?.size&&y.jsx("div",{className:"text-xs text-[var(--color-muted-foreground)]",children:p(A.size)})]}),r&&n&&y.jsx("button",{onClick:n,"aria-label":`Remove ${A.name}`,className:"flex-shrink-0 flex items-center justify-center w-5 h-5 text-[var(--color-muted-foreground)] hover:text-[var(--color-foreground)] transition-colors",children:y.jsx(nc,{className:"h-4 w-4"})})]}):y.jsxs("div",{className:`relative group flex-shrink-0 ${i}`,children:[y.jsx("div",{className:`w-20 h-20 bg-white border border-neutral-300 rounded-lg flex items-center justify-center overflow-hidden ${r?"hover:bg-neutral-100 cursor-pointer":""}`,children:u&&y.jsx("img",{src:u,alt:A.name,className:"w-full h-full object-cover",onError:()=>s(!0)})}),r&&n&&y.jsx("button",{onClick:n,"aria-label":`Remove ${A.name}`,className:"absolute top-0 right-0 bg-[var(--color-muted)] text-black rounded-full w-5 h-5 flex items-center justify-center hover:bg-[var(--color-muted-foreground)] transition-colors z-10 transform translate-x-1 -translate-y-1",children:y.jsx(nc,{className:"h-3 w-3 text-black"})})]})}function _p({files:A,onRemoveFile:n,isPreview:r=!0,className:i=""}){if(A.length===0)return null;const l=A.filter(u=>u.type?.startsWith("image/")),s=A.filter(u=>!u.type?.startsWith("image/"));return y.jsxs("div",{className:`flex flex-wrap justify-end gap-2 max-w-full ${i}`,children:[s.map(u=>{const c=A.indexOf(u);return y.jsx(Np,{file:u,onRemove:n?()=>n(c):void 0,isPreview:r},`${u.name}-${u.size}-${c}`)}),l.length>0&&y.jsx("div",{className:"flex gap-2 overflow-x-auto max-w-full p-1 scrollbar-hide",children:l.map(u=>{const c=A.indexOf(u);return y.jsx(Np,{file:u,onRemove:n?()=>n(c):void 0,isPreview:r},`${u.name}-${u.size}-${c}`)})})]})}const fb=({className:A})=>y.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:A,children:y.jsx("path",{d:"M1.46875 0.09375L16.3125 6.9375C16.75 7.125 17 7.53125 17 8C17 8.46875 16.75 8.875 16.3125 9.0625L1.46875 15.9062C1.3125 15.9688 1.1875 16 1.03125 16C0.46875 16 0 15.5312 0 14.9688C0 14.8125 0.03125 14.6875 0.09375 14.5625L2.34375 9.5C2.5 9.15625 2.8125 8.9375 3.15625 8.90625L8.0625 8.46875C8.3125 8.46875 8.5 8.25 8.5 8C8.5 7.75 8.3125 7.5625 8.0625 7.53125L3.15625 7.09375C2.8125 7.0625 2.5 6.84375 2.34375 6.5L0.09375 1.4375C0.03125 1.3125 0 1.1875 0 1.03125C0 0.46875 0.46875 0 1.03125 0C1.1875 0 1.3125 0.03125 1.46875 0.09375Z",fill:"currentColor"})}),Rp=x.forwardRef(({className:A,type:n,...r},i)=>{const l=A&&typeof A=="string"&&A.includes("placeholder:");return y.jsx("input",{type:n,className:QA("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",!l&&"placeholder:text-muted-foreground",A),ref:i,...r})});Rp.displayName="Input";const db="+91";function hb({className:A}){return y.jsx("span",{className:QA("inline-flex shrink-0 text-lg leading-none",A),role:"img","aria-label":"India",children:"🇮🇳"})}function gb({value:A,onChange:n,onKeyDown:r,placeholder:i,disabled:l,theme:s,isMobile:u,maxLength:c,isMobileValid:f,onSend:h}){return y.jsxs("div",{className:"px-2 pt-3 pb-2 space-y-2 w-full",children:[y.jsx("p",{className:"px-1 text-xs font-semibold tracking-wide text-foreground uppercase",children:"Enter your mobile number"}),y.jsxs("div",{className:"flex items-center gap-2 w-full",children:[y.jsxs("div",{className:QA("inline-flex items-center gap-1 rounded-full h-[40px] px-3 shrink-0 py-2 min-h-[50px] h-full",l&&"opacity-60",s?.textColor==="white"?"bg-white-100":"bg-black-100"),style:{fontSize:u?"16px":"14px"},children:[y.jsx(hb,{}),y.jsx("span",{className:"text-sm font-medium text-foreground",children:db}),y.jsx(gs,{className:"h-4 w-4 text-muted-foreground","aria-hidden":!0})]}),y.jsxs("div",{className:QA("flex items-center gap-1 rounded-full px-2 py-2 flex-1 min-w-0",l&&"opacity-60",s?.textColor==="white"?"bg-white-100":"bg-black-100"),children:[y.jsx(Rp,{type:"tel",autoComplete:"tel-national",value:A,onChange:n,onKeyDown:r,placeholder:i,className:QA("w-full h-full shadow-none border-0 outline-none focus-visible:ring-0 focus-visible:ring-offset-0","text-sm placeholder:text-muted-foreground bg-transparent","disabled:cursor-not-allowed rounded-none break-words overflow-wrap-anywhere whitespace-pre-wrap","text-foreground px-3 py-2 pr-11 min-h-[40px]"),style:{fontSize:u?"16px":"14px"},maxLength:c,inputMode:"numeric",autoFocus:!l,disabled:l}),y.jsx($A,{type:"button",size:"icon",onClick:h,disabled:l||!f,variant:"ghost",className:`h-10 w-10 ${f?"bg-primary":"bg-none"} hover:bg-primary/90 rounded-full transition-all duration-200 shadow-lg hover:shadow-xl hover:scale-105 active:scale-95 shrink-0 disabled:opacity-50 disabled:pointer-events-none disabled:hover:scale-100`,title:f?"Submit mobile number":"Enter a valid mobile number","aria-label":f?"Submit mobile number":"Enter a valid mobile number",children:y.jsx(QB,{className:`w-4 h-4 ${f?"text-primary-foreground":"text-primary"}`})})]})]})]})}const qn=6,Bb=30;function pb({disabled:A,isMobile:n,validation:r,onSubmit:i,onResendOtp:l}){const[s,u]=x.useState(Array(qn).fill("")),c=x.useRef([]),[f,h]=x.useState(0),B=s.join(""),p=r?.pattern??`^\\d{${qn}}$`,m=new RegExp(p),C=r?.minLength??qn,Q=r?.maxLength??qn,E=B.length===C&&m.test(B),T=x.useCallback((O,G)=>{u(k=>{const K=[...k];return K[O]=G.slice(-1),K})},[]),S=O=>{O<qn-1&&c.current[O+1]?.focus()},H=O=>{O>0&&c.current[O-1]?.focus()},D=x.useCallback(()=>c.current.map(O=>O?.value.replace(/\D/g,"").slice(-1)??""),[]),Y=(O,G)=>{const k=G.target.value.replace(/\D/g,"").slice(-1);T(O,k),k&&S(O)},$=(O,G)=>{if(G.key==="Backspace"&&!s[O]){H(O),T(O,"");return}if(G.key==="Enter"&&!G.shiftKey&&!A){G.preventDefault();const k=D(),K=k.join("");if(K.length>=C&&m.test(K))i(K);else{const eA=k.findIndex(aA=>!aA);c.current[eA===-1?0:eA]?.focus()}}},U=O=>{O.preventDefault();const G=O.clipboardData.getData("text").replace(/\D/g,"").slice(0,Q);if(!G)return;const k=[...s];for(let eA=0;eA<G.length&&eA<qn;eA++)k[eA]=G[eA];u(k);const K=Math.min(G.length,qn-1);c.current[K]?.focus()},_=()=>{if(A)return;const O=D().join("");O.length>=C&&m.test(O)&&i(O)},R=()=>{f>0||A||(u(Array(qn).fill("")),c.current[0]?.focus(),l?.(),h(Bb))};return x.useEffect(()=>{!A&&c.current[0]&&c.current[0].focus()},[A]),x.useEffect(()=>{if(f<=0)return;const O=setTimeout(()=>h(G=>G-1),1e3);return()=>clearTimeout(O)},[f]),y.jsx("div",{className:"px-4 pt-3 pb-2 space-y-3",children:y.jsxs("div",{className:"flex flex-col gap-3",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("p",{className:"text-xs font-semibold tracking-wide text-foreground uppercase",children:"Please enter the OTP"}),y.jsxs("button",{type:"button",onClick:R,disabled:A||f>0,className:QA("text-xs font-medium underline underline-offset-2","text-primary hover:opacity-90 disabled:opacity-50 disabled:no-underline disabled:cursor-not-allowed"),children:["Resend OTP",f>0?` (00:${String(f).padStart(2,"0")}s)`:""]})]}),y.jsxs("div",{className:"flex items-center w-full gap-2 justify-between",children:[y.jsx("div",{className:"flex items-center gap-2",children:s.map((O,G)=>y.jsx("input",{ref:k=>{c.current[G]=k},type:"text",inputMode:"numeric",maxLength:1,value:O,onChange:k=>Y(G,k),onKeyDown:k=>$(G,k),onPaste:U,disabled:A,style:{fontSize:n?"16px":"14px"},className:QA("h-10 w-10 rounded-full border text-center text-lg font-semibold bg-transparent text-foreground","border-border shadow-sm outline-none transition-colors","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0 focus-visible:border-transparent","disabled:cursor-not-allowed disabled:opacity-50"),"aria-label":`Digit ${G+1}`},G))}),y.jsx($A,{type:"button",size:"icon",onClick:_,disabled:A,variant:"ghost",className:`h-10 w-10 ${E?"bg-primary":"bg-none"} hover:bg-primary/90 rounded-full transition-all duration-200 shadow-lg hover:shadow-xl hover:scale-105 active:scale-95 shrink-0 disabled:opacity-50 disabled:pointer-events-none disabled:hover:scale-100`,title:E?"Submit OTP":"Enter the full OTP to submit","aria-label":E?"Submit OTP":"Enter the full OTP to submit",children:y.jsx(QB,{className:`w-4 h-4 ${E?"text-primary-foreground":"text-primary"}`})})]})]})})}const Op=10,mb=10,Cb=/^[6-9][0-9]{9}$/;function wb({component:A,value:n,onChange:r,isDisabled:i,validation:l,theme:s,isMobile:u,placeholder:c,onSend:f,onResendOtp:h}){const B=A===EA.SYNAPSE_COMPONENTS.MOBILE,p=A===EA.SYNAPSE_COMPONENTS.OTP;if(!B&&!p)return null;const m=T=>{const S=T.target.value.replace(/\D/g,""),H=l?.maxLength??Op;r(S.slice(0,H))},C=n.length===(l?.minLength??mb)&&(l?.pattern?new RegExp(l.pattern).test(n):Cb.test(n)),Q=()=>{!C||i||f()},E=T=>{T.key==="Enter"&&(T.preventDefault(),Q())};return y.jsxs(y.Fragment,{children:[B&&y.jsx(gb,{value:n,onChange:m,onSend:Q,onKeyDown:E,placeholder:c??"Enter your mobile number",disabled:i,isMobileValid:C,theme:s,isMobile:u,maxLength:l?.maxLength??Op}),p&&y.jsx(pb,{disabled:i,isMobile:u,validation:{pattern:l?.pattern,minLength:l?.minLength,maxLength:l?.maxLength},onSubmit:T=>{r(T),f({message:T})},onResendOtp:h,theme:s})]})}function yb({value:A,onChange:n,onSend:r,onFileChange:i,onRemoveFile:l,onRecording:s,isRecording:u,hasAttachment:c,attachmentFiles:f,isDisabled:h,placeholder:B,isMobile:p,recordingStatus:m,theme:C,allowed:Q,showStartNewChatButton:E,onStartNewChat:T}){const S=x.useRef(null),H=x.useRef(null),D=st(q=>q.elicitationState),Y=D.component===EA.SYNAPSE_COMPONENTS.MOBILE,$=D.component===EA.SYNAPSE_COMPONENTS.OTP,U=A.trim().length>0||c,_=Q===void 0||Q.includes("audio"),R=U||!_,O=U,G=Q===void 0||Q.includes("file"),k=(h||m!==fe.IDLE)&&!u,K=QA("rounded-full transition-all duration-200 ",u?"bg-gradient-to-r from-rose-400 via-primary to-indigo-500 text-white ring-2 ring-white/60 animate-pulse shadow-[0_0_20px_rgba(139,92,246,0.45)]":k?"text-primary/50 cursor-not-allowed shadow-none":"text-foreground hover:bg-secondary"),eA=q=>{const pA=Array.from(q.target.files||[]);pA.length>0&&i(pA)},aA=()=>{h||S.current?.click()},tA=q=>{q.key==="Enter"&&!q.shiftKey&&O&&!h&&(q.preventDefault(),r())},L=q=>{q.style.height="auto",q.style.overflow="hidden";const pA=q.scrollHeight,F=40,N=120,J=Math.max(F,Math.min(pA,N));q.style.height=J+"px",pA>N?q.style.overflow="auto":q.style.overflow="hidden"},W=q=>{L(q.currentTarget)};return x.useEffect(()=>{H.current&&L(H.current)},[A]),x.useEffect(()=>{!h&&!p&&H.current?.focus()},[h]),E&&T?y.jsx("div",{className:"px-4 py-2 flex justify-unset",children:y.jsxs("button",{type:"button",onClick:T,className:"px-6 py-3 bg-primary text-primary-foreground text-sm font-semibold rounded-lg hover:bg-primary/90 transition-colors flex items-center justify-center gap-2 disabled:opacity-60 disabled:pointer-events-none w-full",children:[y.jsx("span",{children:"Start new chat"}),y.jsx(vB,{className:"w-5 h-5","aria-hidden":!0})]})}):y.jsx(y.Fragment,{children:Y||$?y.jsx(wb,{component:D.component,value:A,onChange:n,isDisabled:h,placeholder:D.description,validation:{pattern:D.pattern,minLength:D.minLength,maxLength:D.maxLength,type:D.type},theme:C,isMobile:p,onSend:r,onResendOtp:()=>r({resend:!0})}):y.jsxs("div",{className:"px-2 py-2",children:[c&&f.length>0&&y.jsx("div",{className:"mb-2 pb-2 border-b border-border-subtle",children:y.jsx(_p,{files:f,onRemoveFile:l,isPreview:!0})}),y.jsx("input",{ref:S,type:"file",multiple:!0,max:3,accept:"image/jpeg, image/png, image/jpg, application/pdf",className:"hidden",onChange:eA,disabled:h,title:"Attach file","aria-label":"Attach file"}),y.jsxs("div",{className:"flex items-center gap-2 w-full",children:[G&&m===fe.IDLE&&y.jsx($A,{type:"button",variant:"ghost",size:"icon",onClick:aA,disabled:h,className:QA("rounded-full transition-all shrink-0",c?"bg-primary text-foreground hover:bg-primary/15":"hover:bg-secondary text-foreground"),title:"Attach file","aria-label":"Attach file",children:y.jsx(t4,{className:"w-5 h-5"})}),y.jsx("div",{className:QA("flex items-center gap-1 rounded-full px-2 py-2 flex-1 min-w-0",h&&"opacity-60",C?.textColor==="white"?"bg-white-100":"bg-black-100"),children:y.jsxs("div",{className:"flex-1 relative min-w-0",children:[y.jsx(Ip,{ref:H,onInput:W,placeholder:B,value:A,onChange:q=>n(q.target.value),rows:1,maxLength:1e3,autoFocus:!h&&!p,style:{wordBreak:"break-word",overflowWrap:"anywhere",minHeight:"40px",maxHeight:"120px",fontSize:p?"16px":"14px",lineHeight:"1.5"},onKeyPress:tA,disabled:h,title:"Enter your message","aria-label":"Enter your message",className:"w-full shadow-none border-0 outline-none focus-visible:ring-0 focus-visible:ring-offset-0 text-sm placeholder:text-muted-foreground bg-transparent disabled:cursor-not-allowed rounded-none break-words overflow-wrap-anywhere whitespace-pre-wrap text-foreground resize-none pr-11"}),u?y.jsx($A,{type:"button",variant:"ghost",size:"icon",onClick:s,className:"absolute right-0.5 top-1/2 -translate-y-1/2 rounded-full bg-gradient-to-r from-red-400 to-rose-500 text-white hover:from-red-500 hover:to-rose-600 shadow-lg transition-all duration-200 hover:scale-105 active:scale-95 shrink-0",title:"Stop recording","aria-label":"Stop recording",children:y.jsx(a4,{className:"w-4 h-4"})}):_&&!R&&y.jsx($A,{type:"button",variant:"ghost",size:"icon",onClick:s,disabled:k,className:QA("absolute right-0.5 top-1/2 -translate-y-1/2 shrink-0",K),title:"Start recording","aria-label":"Start recording",children:y.jsx(r4,{className:"w-5 h-5"})}),R&&y.jsx($A,{type:"button",size:"icon",onClick:()=>r(),disabled:h||!O,variant:"ghost",className:`absolute right-0.5 top-1/2 -translate-y-1/2 h-10 w-10 ${O?"bg-primary":"bg-none"} hover:bg-primary/90 rounded-full transition-all duration-200 shadow-lg hover:shadow-xl hover:scale-105 active:scale-95 shrink-0 disabled:opacity-50 disabled:pointer-events-none disabled:hover:scale-100`,title:O?"Send message":"Type a message to send","aria-label":O?"Send message":"Type a message to send",children:y.jsx(fb,{className:`w-4 h-4 ${O?"text-primary-foreground":"text-primary"}`})})]})})]})]})})}const Eb=Object.freeze(Object.defineProperty({__proto__:null,default:yb},Symbol.toStringTag,{value:"Module"}));function vb(A,n){const r={};return(A[A.length-1]===""?[...A,""]:A).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const Qb=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bb=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ub={};function Lp(A,n){return(Ub.jsx?bb:Qb).test(A)}const Sb=/[ \t\n\f\r]/g;function xb(A){return typeof A=="object"?A.type==="text"?Mp(A.value):!1:Mp(A)}function Mp(A){return A.replace(Sb,"")===""}class Oa{constructor(n,r,i){this.normal=r,this.property=n,i&&(this.space=i)}}Oa.prototype.normal={},Oa.prototype.property={},Oa.prototype.space=void 0;function Dp(A,n){const r={},i={};for(const l of A)Object.assign(r,l.property),Object.assign(i,l.normal);return new Oa(r,i,n)}function Uc(A){return A.toLowerCase()}class ot{constructor(n,r){this.attribute=r,this.property=n}}ot.prototype.attribute="",ot.prototype.booleanish=!1,ot.prototype.boolean=!1,ot.prototype.commaOrSpaceSeparated=!1,ot.prototype.commaSeparated=!1,ot.prototype.defined=!1,ot.prototype.mustUseProperty=!1,ot.prototype.number=!1,ot.prototype.overloadedBoolean=!1,ot.prototype.property="",ot.prototype.spaceSeparated=!1,ot.prototype.space=void 0;let Fb=0;const HA=Dr(),Ue=Dr(),Sc=Dr(),sA=Dr(),ae=Dr(),hi=Dr(),yt=Dr();function Dr(){return 2**++Fb}const xc=Object.freeze(Object.defineProperty({__proto__:null,boolean:HA,booleanish:Ue,commaOrSpaceSeparated:yt,commaSeparated:hi,number:sA,overloadedBoolean:Sc,spaceSeparated:ae},Symbol.toStringTag,{value:"Module"})),Fc=Object.keys(xc);class Tc extends ot{constructor(n,r,i,l){let s=-1;if(super(n,r),kp(this,"space",l),typeof i=="number")for(;++s<Fc.length;){const u=Fc[s];kp(this,Fc[s],(i&xc[u])===xc[u])}}}Tc.prototype.defined=!0;function kp(A,n,r){r&&(A[n]=r)}function gi(A){const n={},r={};for(const[i,l]of Object.entries(A.properties)){const s=new Tc(i,A.transform(A.attributes||{},i),l,A.space);A.mustUseProperty&&A.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),n[i]=s,r[Uc(i)]=i,r[Uc(s.attribute)]=i}return new Oa(n,r,A.space)}const Kp=gi({properties:{ariaActiveDescendant:null,ariaAtomic:Ue,ariaAutoComplete:null,ariaBusy:Ue,ariaChecked:Ue,ariaColCount:sA,ariaColIndex:sA,ariaColSpan:sA,ariaControls:ae,ariaCurrent:null,ariaDescribedBy:ae,ariaDetails:null,ariaDisabled:Ue,ariaDropEffect:ae,ariaErrorMessage:null,ariaExpanded:Ue,ariaFlowTo:ae,ariaGrabbed:Ue,ariaHasPopup:null,ariaHidden:Ue,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ae,ariaLevel:sA,ariaLive:null,ariaModal:Ue,ariaMultiLine:Ue,ariaMultiSelectable:Ue,ariaOrientation:null,ariaOwns:ae,ariaPlaceholder:null,ariaPosInSet:sA,ariaPressed:Ue,ariaReadOnly:Ue,ariaRelevant:null,ariaRequired:Ue,ariaRoleDescription:ae,ariaRowCount:sA,ariaRowIndex:sA,ariaRowSpan:sA,ariaSelected:Ue,ariaSetSize:sA,ariaSort:null,ariaValueMax:sA,ariaValueMin:sA,ariaValueNow:sA,ariaValueText:null,role:null},transform(A,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function zp(A,n){return n in A?A[n]:n}function jp(A,n){return zp(A,n.toLowerCase())}const Tb=gi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:hi,acceptCharset:ae,accessKey:ae,action:null,allow:null,allowFullScreen:HA,allowPaymentRequest:HA,allowUserMedia:HA,alt:null,as:null,async:HA,autoCapitalize:null,autoComplete:ae,autoFocus:HA,autoPlay:HA,blocking:ae,capture:null,charSet:null,checked:HA,cite:null,className:ae,cols:sA,colSpan:null,content:null,contentEditable:Ue,controls:HA,controlsList:ae,coords:sA|hi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:HA,defer:HA,dir:null,dirName:null,disabled:HA,download:Sc,draggable:Ue,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:HA,formTarget:null,headers:ae,height:sA,hidden:Sc,high:sA,href:null,hrefLang:null,htmlFor:ae,httpEquiv:ae,id:null,imageSizes:null,imageSrcSet:null,inert:HA,inputMode:null,integrity:null,is:null,isMap:HA,itemId:null,itemProp:ae,itemRef:ae,itemScope:HA,itemType:ae,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:HA,low:sA,manifest:null,max:null,maxLength:sA,media:null,method:null,min:null,minLength:sA,multiple:HA,muted:HA,name:null,nonce:null,noModule:HA,noValidate:HA,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:HA,optimum:sA,pattern:null,ping:ae,placeholder:null,playsInline:HA,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:HA,referrerPolicy:null,rel:ae,required:HA,reversed:HA,rows:sA,rowSpan:sA,sandbox:ae,scope:null,scoped:HA,seamless:HA,selected:HA,shadowRootClonable:HA,shadowRootDelegatesFocus:HA,shadowRootMode:null,shape:null,size:sA,sizes:null,slot:null,span:sA,spellCheck:Ue,src:null,srcDoc:null,srcLang:null,srcSet:null,start:sA,step:null,style:null,tabIndex:sA,target:null,title:null,translate:null,type:null,typeMustMatch:HA,useMap:null,value:Ue,width:sA,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ae,axis:null,background:null,bgColor:null,border:sA,borderColor:null,bottomMargin:sA,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:HA,declare:HA,event:null,face:null,frame:null,frameBorder:null,hSpace:sA,leftMargin:sA,link:null,longDesc:null,lowSrc:null,marginHeight:sA,marginWidth:sA,noResize:HA,noHref:HA,noShade:HA,noWrap:HA,object:null,profile:null,prompt:null,rev:null,rightMargin:sA,rules:null,scheme:null,scrolling:Ue,standby:null,summary:null,text:null,topMargin:sA,valueType:null,version:null,vAlign:null,vLink:null,vSpace:sA,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:HA,disableRemotePlayback:HA,prefix:null,property:null,results:sA,security:null,unselectable:null},space:"html",transform:jp}),Hb=gi({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:yt,accentHeight:sA,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:sA,amplitude:sA,arabicForm:null,ascent:sA,attributeName:null,attributeType:null,azimuth:sA,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:sA,by:null,calcMode:null,capHeight:sA,className:ae,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:sA,diffuseConstant:sA,direction:null,display:null,dur:null,divisor:sA,dominantBaseline:null,download:HA,dx:null,dy:null,edgeMode:null,editable:null,elevation:sA,enableBackground:null,end:null,event:null,exponent:sA,externalResourcesRequired:null,fill:null,fillOpacity:sA,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:hi,g2:hi,glyphName:hi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:sA,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:sA,horizOriginX:sA,horizOriginY:sA,id:null,ideographic:sA,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:sA,k:sA,k1:sA,k2:sA,k3:sA,k4:sA,kernelMatrix:yt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:sA,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:sA,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:sA,overlineThickness:sA,paintOrder:null,panose1:null,path:null,pathLength:sA,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ae,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:sA,pointsAtY:sA,pointsAtZ:sA,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:yt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:yt,rev:yt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:yt,requiredFeatures:yt,requiredFonts:yt,requiredFormats:yt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:sA,specularExponent:sA,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:sA,strikethroughThickness:sA,string:null,stroke:null,strokeDashArray:yt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:sA,strokeOpacity:sA,strokeWidth:null,style:null,surfaceScale:sA,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:yt,tabIndex:sA,tableValues:null,target:null,targetX:sA,targetY:sA,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:yt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:sA,underlineThickness:sA,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:sA,values:null,vAlphabetic:sA,vMathematical:sA,vectorEffect:null,vHanging:sA,vIdeographic:sA,version:null,vertAdvY:sA,vertOriginX:sA,vertOriginY:sA,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:sA,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:zp}),Gp=gi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(A,n){return"xlink:"+n.slice(5).toLowerCase()}}),Vp=gi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:jp}),Pp=gi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(A,n){return"xml:"+n.slice(3).toLowerCase()}}),Ib={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Nb=/[A-Z]/g,Yp=/-[a-z]/g,_b=/^data[-\w.:]+$/i;function Rb(A,n){const r=Uc(n);let i=n,l=ot;if(r in A.normal)return A.property[A.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&_b.test(n)){if(n.charAt(4)==="-"){const s=n.slice(5).replace(Yp,Lb);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=n.slice(4);if(!Yp.test(s)){let u=s.replace(Nb,Ob);u.charAt(0)!=="-"&&(u="-"+u),n="data"+u}}l=Tc}return new l(i,n)}function Ob(A){return"-"+A.toLowerCase()}function Lb(A){return A.charAt(1).toUpperCase()}const Mb=Dp([Kp,Tb,Gp,Vp,Pp],"html"),Hc=Dp([Kp,Hb,Gp,Vp,Pp],"svg");function Db(A){return A.join(" ").trim()}var Bi={},Ic,Xp;function kb(){if(Xp)return Ic;Xp=1;var A=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,c=/^\s+|\s+$/g,f=`
46
+ `}),y.jsxs(Yn,{className:QA(k,"border-0"),"data-text-color":D.textColor,children:[D.backgroundImage&&y.jsx("div",{className:"absolute inset-0 -z-10",style:{backgroundImage:`url(${D.backgroundImage})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",transform:"scale(1.1)"}}),D.backgroundImage&&D.textColor==="black"&&y.jsx("div",{className:"absolute inset-0 -z-10",style:{backgroundColor:"rgba(0, 0, 0, 0.4)"}}),y.jsx("div",{className:QA("flex-shrink-0 sticky top-0 z-50 synapse-chat-widget-header",D.backgroundImage?"":"bg-popover"),style:{...!Q&&{cursor:A?"grab":"default"}},children:y.jsx(K4,{onClose:n,showCloseButton:r,title:c,titleImg:f,iconUrl:i,startNewConversation:l})}),y.jsx("div",{className:"flex-1 min-h-0 overflow-hidden flex flex-col relative",children:u}),Y?.disp_toast_msg&&y.jsx("div",{className:"pointer-events-auto absolute left-0 right-0 bottom-[150px] z-[70] flex justify-center px-4",children:y.jsxs(Yn,{className:"px-4 py-2 rounded-full shadow-md bg-popover text-popover-foreground flex items-center gap-3 max-w-[90%]",children:[y.jsx("span",{className:"text-xs font-medium truncate",children:Y.disp_toast_msg}),y.jsx("button",{type:"button",onClick:()=>$({...Y,disp_toast_msg:void 0}),className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground hover:text-foreground",children:"X"})]})}),B&&y.jsxs("div",{className:QA("flex-shrink-0 sticky bottom-0 z-50 synapse-chat-widget-footer",D.backgroundImage?"":"bg-popover",s&&"synapse-chat-widget-footer--no-border"),children:[y.jsx(x.Suspense,{fallback:null,children:y.jsx(Ab,{value:B.value,onChange:B.onChange,onSend:U?_:B.onSend,onFileChange:B.onFileChange,onRemoveFile:B.onRemoveFile,onRecording:B.onRecording,isRecording:B.isRecording,hasAttachment:B.hasAttachment,attachmentFiles:B.attachmentFiles,isDisabled:B.isDisabled||U&&T,isMobile:Q,placeholder:B.placeholder,recordingStatus:B.recordingStatus,theme:D,onStartNewChat:l,showStartNewChatButton:s,allowed:B.allowed})}),h&&p==="development"&&y.jsx("div",{className:"px-6 flex justify-center items-center",children:y.jsxs("p",{className:"text-[8px] text-text-secondary font-mono opacity-50",children:["Session ID: ",h]})}),y.jsxs("div",{className:"px-6 py-2 flex justify-center items-center gap-1.5 text-foreground opacity-90",children:[y.jsx("span",{className:"text-[10px] leading-[14px] font-medium",style:{fontFamily:"Inter, system-ui, -apple-system, sans-serif"},children:"Powered by"}),y.jsx($4,{})]})]})]})]})}function Tp(){const[A,n]=x.useState(typeof navigator<"u"?navigator.onLine:!0);return x.useEffect(()=>{const r=()=>n(!0),i=()=>n(!1);return window.addEventListener("online",r),window.addEventListener("offline",i),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",i)}},[]),{isOnline:A}}const Qc=5,eb=10*1024*1024,tb=({environment:A,baseUrl:n,context:r,auth:i})=>{const[l,s]=x.useState([]),[u,c]=x.useState(!1),[f,h]=x.useState(0),[B,p]=x.useState(!1),[m,C]=x.useState([]),Q=x.useRef(null),E=x.useRef(null),{isOnline:T}=Tp(),{agentId:S,setSessionId:H,setSessionToken:D,sessionId:Y,sessionToken:$,setError:U,setConnectionStatus:_,setShowRetryButton:R,setStartNewConnection:O,setIsStreaming:G,setIsWaitingForResponse:k,isStreaming:K,initialMessage:eA,isWaitingForResponse:aA,setProgressMessage:tA,setRecordingStatus:L,clearSession:W,addMessageToSession:q,getMessagesForSession:pA,updateMessageInSession:F,setInitialMessage:N,userId:J,setUserId:b,fileUploadPerSession:lA,setFileUploadPerSession:dA,setElicitationState:fA,elicitationState:hA}=st();x.useEffect(()=>{T?B?XA()&&(_(je.CONNECTED),Re()):_(je.CONNECTING):_(je.NOT_CONNECTED)},[T,B]),x.useEffect(()=>{if(Y){const uA=pA(Y)||[];uA.length<=0&&eA?.text?s([{id:Date.now().toString(),content:eA.text,role:lt.ASSISTANT,timestamp:Rr(Date.now()),isStored:!1,...eA.suggestions?.length&&{toolEscalationData:{tool_id:eA.suggestions[0].value??null,tool_name:"elicitation",details:{component:EA.SYNAPSE_COMPONENTS.PILL,input:{options:eA.suggestions.map(oA=>({id:oA.value||"",label:oA.label||"",value:oA.value||""}))}},isResponded:!1}}}]):s(uA),C([])}},[Y,eA]),x.useEffect(()=>{if(p(!1),!S)return;const uA=new EA.SynapseSDK({agentId:S,environment:A,userId:J,callbacks:{onError:oA=>{if(oA instanceof EA.SynapseError)switch(oA.code){case EA.SynapseErrorCode.SESSION:const z=oA.context;z?.stage==="handleSessionExpiry"||z?.stage==="refreshSession"?T?(U({title:"Something went wrong!",description:"Please try again."}),R(!0)):(U({title:"Your session has ended.",description:"Please start a new Chat."}),R(!0)):(_(je.NOT_CONNECTED),U({title:"Something went wrong!",description:"Please try again."}),R(!0));break;case EA.SynapseErrorCode.RECORDING:U({title:"Recording failed",description:oA?.displayMessage||"Please try again later"});break;case EA.SynapseErrorCode.CONNECTION:XA()||(_(je.NOT_CONNECTED),f<2?(h(cA=>cA+1),NA(Y,$)):(R(!0),U({title:"Trying to connect...",description:"Please wait while we try to connect"})));break;default:U({title:"Something went wrong",description:"Please try again later from onError callback"}),R(!0);break}},onSessionRefreshed:oA=>{oA?.session_id&&oA?.session_token&&(H(oA.session_id),D(oA.session_token),NA(oA.session_id,oA.session_token))}},...n&&{serverUrl:n},...r&&{context:r},...i&&{auth:i}});return Q.current=uA,p(!0),()=>{p(!1),Q.current?.endSession(),Q.current=null,E.current&&(clearTimeout(E.current),E.current=null)}},[S,A,i]),x.useEffect(()=>{const uA=l[l.length-1];!uA?.role||!Y||(uA?.role===lt.USER?q(Y,uA):!K&&!uA.isStored&&(s(oA=>{const z=[...oA];return z[z.length-1]={...uA,isStored:!0},z}),q(Y,{...uA,isStored:!0})))},[l,K]),x.useEffect(()=>{const uA=l[l.length-1];return()=>{uA&&!uA?.isStored&&Y&&q(Y,{...uA,isStored:!0})}},[]),x.useEffect(()=>(E.current&&(clearTimeout(E.current),E.current=null),aA&&!K?E.current=setTimeout(()=>{k(!1),E.current=null},3e4):K&&E.current&&(clearTimeout(E.current),E.current=null),()=>{E.current&&(clearTimeout(E.current),E.current=null)}),[aA,K,k]);const NA=async(uA,oA,z=!1)=>{try{const nA=await Q.current?.startSession({session_id:uA||"",session_token:oA||""});nA?.session_id&&nA?.session_token&&(H(nA.session_id),D(nA.session_token)),(nA?.initial_message?.text||nA?.initial_message?.suggestions?.length)&&N(nA.initial_message),nA?.user_id&&b(nA.user_id),sr()}catch(nA){const cA=nA.context,yA=cA?.stage==="handleSessionExpiry"||cA?.stage==="refreshSession"||nA instanceof EA.APIError&&nA.status===404,xA=nA instanceof EA.APIError&&nA.status===403;yA?(U(null),_(je.NOT_CONNECTED),O(!0)):xA&&!z?(W(),Re(),await NA(void 0,void 0,!0)):(U({title:"Something went wrong!",description:"Please try again later."}),R(!0))}},_A=async(uA=!1)=>{try{if(!Q.current){U({title:"SDK not initialized",description:"Please ensure agentId is configured"}),c(!1);return}if(c(!0),uA){await W(),await Q?.current?.endSession(),Re(),await NA();return}const{sessionId:oA,sessionToken:z}=st.getState();await NA(oA,z)}catch{}finally{c(!1)}},XA=()=>Q.current?.isConnected()??!1,Me=()=>{Q.current?.endSession()},Re=()=>{h(0),R(!1),O(!1),U(null)},sr=()=>{Q.current?.on(EA.SYNAPSE_REALTIME_EVENTS.MESSAGE_CHUNK,uA=>{const oA=uA;if(oA.data?.text&&oA.messageId){K||(k(!1),G(!0)),XA()&&_(je.CONNECTED);const z=oA.data.text,nA=oA.messageId;s(cA=>{const yA=cA[cA.length-1];if(yA&&yA.id===nA&&yA.role===lt.ASSISTANT){const xA=[...cA];return xA[xA.length-1]={...yA,content:yA.content+z},xA}else return[...cA,{id:nA,content:z,role:lt.ASSISTANT,timestamp:Rr(Date.now()),isStored:!1}]})}}),Q.current?.on(EA.SYNAPSE_REALTIME_EVENTS.END_OF_STREAM,()=>{G(!1),tA(null),k(!1)}),Q.current?.on(EA.SYNAPSE_REALTIME_EVENTS.CONNECTED,()=>{Re(),_(je.CONNECTED)}),Q.current?.on(EA.SYNAPSE_REALTIME_EVENTS.TOOL_CALL,uA=>{const oA=uA;if(!oA?.messageId||!oA?.data||!oA?.data?.details?.component||!oA?.data?.tool_id)return;aA&&k(!1);const z=oA.messageId,nA=oA.timestamp??Date.now();switch(oA?.data?.details?.status){case EA.SYNAPSE_EICITATION_STATUS.PROGRESS:{const cA=oA?.data?.details?._meta?.schema?.required||[],yA=oA?.data?.details?.input||{},xA=cA.reduce((qA,pe)=>(yA[pe]!==void 0&&(qA[pe]=yA[pe]),qA),{}),Be={...st.getState().elicitationState.input||{},...xA},tt=cA.find(qA=>!Be[qA]),ve=oA.data.details?._meta?.mcp_meta_fields||[];fA({active:!0,input:Be,required:cA,component:oA.data.details?.component,toolId:oA.data.tool_id??void 0,toolSelectionName:tt,messageId:z,pattern:oA.data.details?._meta?.schema?.properties?.[oA.data.details?.component]?.pattern,minLength:oA.data.details?._meta?.schema?.properties?.[oA.data.details?.component]?.minLength,maxLength:oA.data.details?._meta?.schema?.properties?.[oA.data.details?.component]?.maxLength,type:oA.data.details?._meta?.schema?.properties?.[oA.data.details?.component]?.type,disp_toast_msg:oA.data.details?._meta?.disp_toast_msg,description:oA.data.details?._meta?.schema?.properties?.[oA.data.details?.component]?.description,...ve.length&&{mcp_meta_fields:ve}});break}case EA.SYNAPSE_EICITATION_STATUS.FAILURE:{fA({active:!1});break}case EA.SYNAPSE_EICITATION_STATUS.SUCCESS:{fA({active:!1,disp_toast_msg:oA?.data?.details?._meta?.disp_toast_msg||"Successfully authenticated"});break}}s(cA=>{const yA=cA[cA.length-1];if(yA.id===z&&yA.role===lt.ASSISTANT){const xA=[...cA],Be={...yA,content:yA.content,toolEscalationData:{...oA.data,isResponded:!1},isResponseFromTool:!0};return xA[cA.length-1]=Be,F(Y,z,Be),xA}else{const xA={id:z,content:oA.data?.details?.input?.text||"",role:lt.ASSISTANT,toolEscalationData:{...oA.data,isResponded:!1},isResponseFromTool:!0,timestamp:Rr(nA),isStored:!1};return[...cA,xA]}})}),Q.current?.on(EA.SYNAPSE_REALTIME_EVENTS.DISCONNECTED,uA=>{uA?.reason!==EA.DisconnectionReason.CLIENT_CLOSED&&(f<2?(_(je.NOT_CONNECTED),h(oA=>oA+1),R(!0),U({title:"Something went wrong!",description:"Please try again."})):(_(je.NOT_CONNECTED),U({title:"Something went wrong!",description:"Please start a new Chat."}),O(!0)))}),Q.current?.on(EA.SYNAPSE_REALTIME_EVENTS.ERROR,uA=>{switch(uA?.data?.code){case EA.SYNAPSE_REALTIME_ERROR_CODES.SESSION_INACTIVE:U({title:"Session not found",description:"Please start a new session"}),O(!0),L(fe.IDLE);return;case EA.SYNAPSE_REALTIME_ERROR_CODES.SESSION_TOKEN_MISMATCH:U({title:"Session not found",description:"Please start a new chat from onError callback"}),O(!0),L(fe.IDLE);return;case EA.SYNAPSE_REALTIME_ERROR_CODES.INVALID_EVENT:return;case EA.SYNAPSE_REALTIME_ERROR_CODES.INVALID_CONTENT_TYPE:return;case EA.SYNAPSE_REALTIME_ERROR_CODES.PARSING_ERROR:if(f<1){h(z=>z+1),Lt();return}U({title:"Error parsing request",description:"please try again"}),R(!0),L(fe.IDLE);return;case EA.SYNAPSE_REALTIME_ERROR_CODES.TIMEOUT:U({title:"Request timed out",description:"please try again"}),R(!0),L(fe.IDLE);return;case EA.SYNAPSE_REALTIME_ERROR_CODES.PROMPT_FETCH_ERROR:U({title:"Something went wrong",description:"please try again"}),R(!0),L(fe.IDLE);return;case EA.SYNAPSE_REALTIME_ERROR_CODES.INVALID_FILE_REQUEST:U({title:"Something went wrong",description:"please try again"}),R(!0),L(fe.IDLE);return;case EA.SYNAPSE_REALTIME_ERROR_CODES.SERVER_ERROR:U({title:"Something went wrong",description:"please try again"}),R(!0),L(fe.IDLE);return;default:U({title:"Something went wrong",description:"please try again"}),R(!0),L(fe.IDLE);return}}),Q.current?.on(EA.SYNAPSE_REALTIME_EVENTS.AUDIO_TRANSCRIPT,async uA=>{const oA=uA;oA?.data?.text&&(s(z=>[...z,{id:Date.now().toString(),content:oA.data.text||"",role:lt.USER,timestamp:Rr(Date.now()),isStored:!0}]),L(fe.IDLE)),G(!1),k(!1),tA(null)}),Q.current?.on(EA.SYNAPSE_REALTIME_EVENTS.PROGRESS_MESSAGE,uA=>{const oA=uA;oA.data?.text&&(k(!1),tA(oA.data.text))}),Q.current?.on(EA.SYNAPSE_REALTIME_EVENTS.TOOL_START,uA=>{const oA=uA;if(oA.data?.name&&oA.messageId){const z=oA.messageId;s(nA=>{const cA=nA[nA.length-1];if(cA&&cA.id===z&&cA.role===lt.ASSISTANT){const yA=[...nA];return yA[yA.length-1]={...cA,toolCallStatus:`Calling tool: ${oA.data.name}...`},Y&&F(Y,z,{toolCallStatus:`Calling tool: ${oA.data.name}...`}),yA}return nA})}}),Q.current?.on(EA.SYNAPSE_REALTIME_EVENTS.TOOL_END,uA=>{const oA=uA;if(oA.data?.name&&oA.messageId){const z=oA.messageId;s(nA=>{const cA=nA[nA.length-1];if(cA&&cA.id===z&&cA.role===lt.ASSISTANT){const yA=[...nA];return yA[yA.length-1]={...cA,toolCallStatus:"Tool call completed."},Y&&F(Y,z,{toolCallStatus:"Tool call completed."}),yA}return nA})}})},et=async({message:uA,messageId:oA,files:z,audio:nA,toolCalled:cA,hidden:yA,selectedCard:xA,selectedComponent:Be,resend:tt})=>{if(!XA()){R(!0),U({title:"Please try again."});return}if(z&&z.length===0&&uA?.trim()===""&&!nA?.audio&&!Be&&!hA.active)return;if(z&&z.length>3){U({title:"Maximum 3 files are allowed to be sent at a time",description:"Please try again"});return}if(z&&z.length>0&&z.reduce((nt,ke)=>nt+ke.size,0)>10*1024*1024){U({title:"Total file size limit of 10MB exceeded",description:"Please reduce the size of the files or try again with less files"});return}if(z&&z.length>0&&z.length+lA>Qc){const nt=Qc-lA;U({title:`You can only upload up to ${Qc} files per session`,description:`${nt<=0?"Maximum file upload limit reached":`You have ${nt} file${nt===1?"":"s"} upload${nt===1?"":"s"} left`}`});return}else z&&z.length&&dA(lA+z.length);U(null),R(!1),XA()&&_(je.CONNECTED);const ve=l.length==2&&m.length==2?m:null;let qA=null;const pe=l.length-1,zA=pe>=0?l[pe]:null,Wt=zA?zA?.isResponseFromTool||zA.role===lt.ASSISTANT&&zA.toolEscalationData:null,JA=st.getState().elicitationState;if(JA?.active&&JA?.toolId&&JA?.messageId){const nt=JA.toolSelectionName??JA.required?.find(me=>!JA.input?.[me])??"",ke=Be?Be[nt]:uA,dt=JA.mcp_meta_fields?.reduce((me,xe)=>(nt===xe?me[xe]=ke:JA.input?.[xe]&&(me[xe]=JA.input[xe]),tt&&!me.is_resend&&(me.is_resend=tt),me),{}),it={...Object.keys(JA.input||{})?.reduce((me,xe)=>{const Ii=!Object.keys(dt||{})?.includes(xe),dl=!!JA.input?.[xe];return(tt?Ii&&dl:Ii&&JA.required?.includes(xe)&&dl)&&(me[xe]=JA.input?.[xe]),me},{})||{},...!tt&&nt&&!Object.keys(dt||{})?.includes(nt)?{[nt]:ke}:{},...Object.keys(dt||{}).length&&{mcp_meta_fields:dt}};fA({...JA,input:{...JA.input||{},...it}});try{await ge(JA.toolId,JA.messageId,it),qA=!0}catch{fA({active:!1})}}else await Q.current?.sendMessage({message:uA,files:z,audio:nA,...ve&&{initial_prompts:ve},...Wt&&!cA?{tool_declined:!0,tool_id:zA?.toolEscalationData?.tool_id||""}:{}});(uA||z&&z.length>0)&&(s(nt=>{const ke=[...nt],dt=ke.length-1,$t=ke[dt].toolEscalationData||null;if(Wt&&dt>=0&&$t&&Object.keys($t).length>0){let it;const me=$t.details;if(me?.component===EA.SYNAPSE_COMPONENTS.CARD&&me?.input?.cards){const xe=me.input.cards.find(Ii=>Ii.title===xA)||null;xe&&(it={...$t,isResponded:!0,tool_id:null,details:{...me,input:{...me.input,cards:[xe]}}})}it||(it={...$t,isResponded:!hA.active,tool_id:null}),ke[dt]={...ke[dt],toolEscalationData:it},F(Y,ke[pe].id||Date.now().toString(),ke[pe])}return yA||qA?ke:[...ke,{id:oA||Date.now().toString(),content:uA||"",files:z||[],role:lt.USER,timestamp:Rr(Date.now()),isStored:!0}]}),qA||k(!0),qA=null)},fn=uA=>uA.type.toLowerCase()&&!["application/pdf","image/jpeg","image/jpg","image/png"].includes(uA.type)?(U({title:`File type not supported: ${uA.name}`,description:"Only PDF, images (JPG, JPEG, PNG) are allowed."}),!1):uA.size>3*1024*1024?(U({title:"File size limit of 3MB exceeded",description:"Please reduce the size of the file or try again with a smaller file"}),!1):!0,dn=async()=>{if(!XA())throw new Error("Not connected to the server");try{await Q.current?.startRecording({onChunks:async uA=>{L(fe.PROCESSING),await et({audio:uA}),L(fe.TRANSCRIBING)},onError(uA){L(fe.IDLE)}}),L(fe.LISTENING)}catch(uA){throw L(fe.IDLE),uA}},re=()=>{XA()&&Q.current?.endRecording()},ge=async(uA,oA,z)=>{try{if(!XA())throw new Error("Not connected to the server");await Q.current?.callTool(uA,oA,z)}catch(nA){throw nA}},De=async()=>{Re(),await W(),await _A(!0)},Lt=async()=>{if(!XA())_(je.NOT_CONNECTED),f<2?(h(uA=>uA+1),await NA(Y,$)):f===2?(h(uA=>uA+1),R(!0),U({title:"Trying to connect..."})):(U({title:"Something went wrong!",description:"Please start a new chat."}),O(!0));else{_(je.CONNECTED),Re();const uA=l[l.length-1];uA&&uA.role===lt.USER&&Q.current?.sendMessage({message:uA.content,files:uA.files||[],messageId:uA.id})}};return{sendMessage:et,startSession:_A,incomingMessages:l,loading:u,endSession:Me,isReady:B,startRecording:dn,stopRecording:re,handleRetry:Lt,isValidFile:fn,handleStartNewConnection:De,callTool:ge,handleInitialTaskClick:async uA=>{if(!eA?.suggestions?.length||!uA)return;const oA=eA.suggestions.find(z=>z.value===uA);if(!oA||!oA.response){await et({message:uA});return}s(z=>[...z,{id:Date.now().toString(),content:uA,role:lt.USER,timestamp:Rr(Date.now()),isStored:!0}]),k(!0),await NQ(1e3),k(!1),s(z=>[...z,{id:Date.now().toString(),content:oA.response||"Please try again",role:lt.ASSISTANT,timestamp:Rr(Date.now()),isStored:!1}]),C([{role:"user",text:uA},{role:"assistant",text:oA.response}])},handleToggleFeedback:async(uA,oA,z)=>{if(XA())try{await Q.current?.sendFeedback(oA,uA,z)}catch{}},clearElicitationState:async()=>{try{await et({message:`User aborted elicitation :tool id ${hA.toolId}, message id ${hA.messageId}, ${hA.component}`,hidden:!0})}catch{}finally{fA({active:!1})}}}},nb=x.lazy(()=>Promise.resolve().then(()=>lF)),rb=x.lazy(()=>Promise.resolve().then(()=>oF).then(A=>({default:A.ConnectionStatus})));function ib({isOpen:A,agentId:n,config:r}){const[i,l]=x.useState(""),[s,u]=x.useState(!1),[c,f]=x.useState(!1),[h,B]=x.useState([]),p=x.useRef(!1),m=x.useRef(null),C=x.useRef(null),[Q,E]=x.useState(!1),{setAgentId:T,startNewConnection:S,showRetryButton:H,clearError:D,error:Y,connectionStatus:$,recordingStatus:U,isWaitingForResponse:_,isStreaming:R,setError:O,sessionId:G,agentId:k,setContext:K}=st(),{incomingMessages:eA,loading:aA,sendMessage:tA,startSession:L,isReady:W,startRecording:q,stopRecording:pA,handleRetry:F,isValidFile:N,handleToggleFeedback:J,clearElicitationState:b}=tb({environment:"production",baseUrl:r.environment==="development"&&r.baseUrl?r.baseUrl:void 0,context:r?.context,...r?.auth&&{auth:r.auth}});x.useEffect(()=>{n&&(D4(n),k4(n),T(n),r?.context&&Object.keys(r?.context||{}).length&&K(r.context),A&&W&&!p.current&&(p.current=!0,L(!1)))},[A,W,k]);const lA=()=>m.current?.querySelector("[data-radix-scroll-area-viewport]")||null,dA=()=>{const re=lA();re&&(re.scrollTo({top:re.scrollHeight,behavior:"smooth"}),E(!1))},fA=eA.length>0,hA=eA.length===1;x.useEffect(()=>{hA?setTimeout(()=>{dA()},0):dA()},[eA,R,hA]);const NA=$===EA.ConnectionStatus.CONNECTED,_A=aA||!NA||_||R,XA=aA||!NA,Me=x.useMemo(()=>U===fe.IDLE?null:U===fe.LISTENING?"Listening...":U===fe.PROCESSING?"Processing...":U===fe.TRANSCRIBING?"Transcribing...":null,[U]),Re=XA?"Connecting...":Me&&U!==fe.IDLE?Me:_||R?"Please wait for the response...":"Type a reply…",sr=async re=>{if(_A)return;const ge=re?.message??i;if(ge.trim()||s||c||re?.resend){const De=Date.now().toString();h.length>0?(await tA({files:h,message:ge.trim(),messageId:De}),B([]),f(!1)):ge.trim()?await tA({message:ge.trim(),messageId:De,resend:re?.resend}):re?.resend&&await tA({resend:re?.resend}),l(""),u(!1),f(!1),setTimeout(()=>{dA()},100)}},et=re=>{if(re&&re.length>0){const ge=re.filter(De=>!!N(De));if(ge?.length+h.length>3){O({title:"You can only upload up to 3 files at a time",description:"Please remove some files and try again."});return}if(ge?.length>0&&ge.reduce((De,Lt)=>De+Lt.size,0)>10*1024*1024){O({title:`Total file size limit of ${eb} MB exceeded`,description:"Please reduce the size of the files or try again with less files"});return}if(ge?.length>0)re=ge;else return}B(ge=>(f((ge?.length??0)+(re?.length??0)>0),[...ge,...re]))},fn=re=>{B(ge=>{const De=ge.filter((Lt,or)=>or!==re);return f(De.length>0),De})},dn=async()=>{if(s)await pA(),u(!1);else{if(_A)return;try{await q(),u(!0)}catch{}}};return y.jsx(Fp,{isOpen:A,onClose:r.onClose,showCloseButton:r.showCloseButton,title:r.title,showStartNewChatButton:S,titleImg:r.theme?.titleImg,iconUrl:r.iconUrl,onStartNewSession:()=>L(!0),sessionId:G,environment:r.environment,displayMode:r.displayMode??"widget",theme:r.theme,chatComposer:{value:i,onChange:l,onSend:sr,onFileChange:et,onRemoveFile:fn,onRecording:dn,isRecording:s,hasAttachment:c,attachmentFiles:h,isDisabled:_A,placeholder:Re,recordingStatus:U,allowed:r.allowed},children:!aA&&y.jsx(x.Suspense,{fallback:y.jsx(ab,{}),children:y.jsxs("div",{className:QA("flex-1 flex flex-col min-h-0 overflow-hidden relative synapse-chat-window",r.theme?.backgroundImage?"":"bg-surface"),children:[y.jsxs(dB,{ref:m,className:"flex-1 min-h-0 [&>[data-radix-scroll-area-viewport]>div]:!flex [&>[data-radix-scroll-area-viewport]>div]:flex-col [&>[data-radix-scroll-area-viewport]>div]:min-h-full",children:[y.jsx("div",{className:"flex-1"}),y.jsxs("div",{className:QA("transition-all duration-300 min-w-0 overflow-x-hidden",fA?"p-4 space-y-3":"p-4 space-y-4"),children:[hA&&y.jsx("div",{className:"text-xs text-[var(--color-muted-foreground)] text-center mb-2",children:"Just now"}),!hA&&y.jsx("div",{className:"text-xs text-[var(--color-muted-foreground)] text-center",children:new Date().toLocaleString("en-US",{weekday:"long",hour:"2-digit",minute:"2-digit",hour12:!0})}),y.jsx(nb,{messages:eA,onSendMessage:tA,iconUrl:r.iconUrl,onToggleFeedback:J,onClearElicitationState:b}),y.jsx("div",{ref:C})]})]}),Q&&y.jsx("div",{className:"absolute bottom-[10px] left-1/2 transform -translate-x-1/2 z-10",children:y.jsx($A,{onClick:dA,size:"icon",className:"h-10 w-10 rounded-full bg-surface/90 backdrop-blur-sm shadow-lg border border-border-subtle hover:bg-surface hover:shadow-xl transition-all duration-200",children:y.jsx(gs,{className:"w-5 h-5 text-text-primary"})})}),y.jsx(rb,{className:"mt-2",onRetry:F,showRetryButton:H,startNewConnection:S,clearError:D,error:Y,isConnected:NA})]})})})}function ab(){return y.jsxs("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden bg-surface backdrop-blur-2xl animate-pulse",children:[y.jsxs("div",{className:"flex-1 p-6 space-y-4",children:[y.jsx("div",{className:"h-16 bg-surface/80 rounded-2xl border border-border-subtle/50"}),y.jsx("div",{className:"h-16 bg-surface/80 rounded-2xl border border-border-subtle/50"}),y.jsx("div",{className:"h-16 bg-surface/80 rounded-2xl border border-border-subtle/50"})]}),y.jsx("div",{className:"h-24 border-t border-border-subtle bg-surface/80"})]})}function bc(A){if(A instanceof Error)return A;if(typeof A=="string")return new Error(A);try{return new Error(JSON.stringify(A))}catch{return new Error("Unknown error")}}class lb extends x.Component{state={error:null};static getDerivedStateFromError(n){return{error:bc(n)}}componentDidCatch(n,r){this.setState({componentStack:r?.componentStack})}render(){return this.state.error?y.jsx(ub,{error:this.state.error,componentStack:this.state.componentStack,title:this.props.title,titleImg:this.props.titleImg,iconUrl:this.props.iconUrl,onClose:this.props.onClose,showCloseButton:this.props.showCloseButton,environment:this.props.environment,displayMode:this.props.displayMode,theme:this.props.theme}):this.props.children}}function sb({error:A}){throw A}function ob(A){const[n,r]=x.useState(null);return x.useEffect(()=>{if(typeof window>"u")return;const i=s=>{!s?.error&&!s?.filename&&s?.message==="Script error."||(s?.error?r(bc(s.error)):s?.message&&r(new Error(s.message)))},l=s=>{r(bc(s.reason))};return window.addEventListener("error",i),window.addEventListener("unhandledrejection",l),()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",l)}},[]),y.jsx(lb,{...A,children:n?y.jsx(sb,{error:n}):A.children})}function ub({error:A,title:n,titleImg:r,iconUrl:i,onClose:l,showCloseButton:s,environment:u,displayMode:c,theme:f}){const h=()=>{typeof window<"u"&&window.location.reload()},B=n??"Medi Clinic",p=u??"production",m=x.useMemo(()=>f?.textColor==="white"?"text-white/60":"text-[var(--color-muted-foreground)]",[f?.textColor]);return y.jsx(Fp,{isOpen:!0,onClose:l??(()=>{}),showCloseButton:s??!1,onStartNewSession:h,title:B,titleImg:r,iconUrl:i,environment:p,displayMode:c,theme:f,children:y.jsx("div",{className:"flex-1 min-h-0 overflow-hidden flex flex-col",children:y.jsx("div",{className:"flex-1 min-h-0 flex items-center justify-center p-6",children:y.jsxs("div",{className:"w-full max-w-[320px] text-center",children:[y.jsx("div",{className:"mx-auto mb-4 grid place-items-center",children:y.jsx("div",{className:"h-16 w-16 rounded-3xl bg-popover backdrop-blur border border-border-subtle grid place-items-center",children:y.jsx(s4,{className:"h-8 w-8",style:{color:f?.primary??"hsl(var(--primary))"}})})}),y.jsx("div",{className:"text-2xl font-semibold text-text-primary",children:"Uh-oh!"}),y.jsx("div",{className:["mt-2 text-sm",m].join(" "),children:"Something went wrong. Please try again."}),y.jsx("div",{className:["mt-4 rounded-2xl border border-border-subtle/60 bg-surface/60 backdrop-blur px-4 py-3","text-left text-[11px] leading-relaxed font-mono whitespace-pre-wrap break-words",m].join(" "),children:A?.message||String(A)}),y.jsx("div",{className:"mt-5 flex items-center justify-center gap-3",children:y.jsxs($A,{type:"button",onClick:h,className:"rounded-2xl",style:{backgroundColor:f?.primary??void 0},children:[y.jsx(i4,{className:"h-4 w-4 mr-2"}),"Retry"]})})]})})})})}function cb({agentId:A,config:n}){const[r,i]=x.useState(!1);x.useEffect(()=>{i(!0)},[]);const l=()=>{i(!1),n?.onClose?.()};return y.jsx(ob,{title:n.title??"Medi Clinic",titleImg:n.theme?.titleImg,iconUrl:n.iconUrl??"https://cdn.eka.care/bot-icon.svg",onClose:l,showCloseButton:n.showCloseButton,environment:n.environment??"production",displayMode:n.displayMode,theme:n.theme,children:y.jsx(ib,{isOpen:r,agentId:A,config:{...n,environment:n.environment??"production",onClose:l,title:n.title??"Medi Clinic",iconUrl:n.iconUrl??"https://cdn.eka.care/bot-icon.svg",theme:n.theme}})})}const Hp=(A,n,r)=>{const i=r||{},l=mv.createRoot(A);return l.render(y.jsx(x.StrictMode,{children:y.jsx(cb,{agentId:n,config:i})})),l};typeof window<"u"&&(window.renderMedAssist=Hp);const Ip=x.forwardRef(({className:A,...n},r)=>y.jsx("textarea",{className:QA("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",A),ref:r,...n}));Ip.displayName="Textarea";function Np({file:A,onRemove:n,isPreview:r=!0,className:i=""}){const[l,s]=x.useState(!1),[u,c]=x.useState(""),f=A?.type?.startsWith("image/")??!1,h=A?.type==="application/pdf";x.useEffect(()=>{if(f){const m=URL.createObjectURL(A);return c(m),()=>URL.revokeObjectURL(m)}},[A,f]),x.useEffect(()=>{s(!1)},[A]);const B=()=>f?"text-green-600":"text-text-secondary",p=m=>{if(m===0)return"0 B";const C=1024,Q=["B","KB","MB","GB"],E=Math.floor(Math.log(m)/Math.log(C));return`${(m/Math.pow(C,E)).toFixed(1)} ${Q[E]}`.toLowerCase()};return!f||l?y.jsxs("div",{className:`relative group inline-flex flex-shrink-0 bg-white border border-neutral-300 rounded-lg flex items-center gap-3 px-3 py-2.5 max-w-full ${r?"hover:bg-neutral-50":""} ${i}`,children:[y.jsx("div",{className:`flex-shrink-0 ${B()}`,children:y.jsx(A4,{className:"h-5 w-5"})}),y.jsxs("div",{className:"flex-1 min-w-0 max-w-[200px]",children:[A?.name&&y.jsx("div",{className:"text-sm font-medium text-[var(--color-foreground)] truncate",children:A.name}),A?.size&&y.jsx("div",{className:"text-xs text-[var(--color-muted-foreground)]",children:p(A.size)})]}),r&&n&&y.jsx("button",{onClick:n,"aria-label":`Remove ${A.name}`,className:"flex-shrink-0 flex items-center justify-center w-5 h-5 text-[var(--color-muted-foreground)] hover:text-[var(--color-foreground)] transition-colors",children:y.jsx(nc,{className:"h-4 w-4"})})]}):y.jsxs("div",{className:`relative group flex-shrink-0 ${i}`,children:[y.jsx("div",{className:`w-20 h-20 bg-white border border-neutral-300 rounded-lg flex items-center justify-center overflow-hidden ${r?"hover:bg-neutral-100 cursor-pointer":""}`,children:u&&y.jsx("img",{src:u,alt:A.name,className:"w-full h-full object-cover",onError:()=>s(!0)})}),r&&n&&y.jsx("button",{onClick:n,"aria-label":`Remove ${A.name}`,className:"absolute top-0 right-0 bg-[var(--color-muted)] text-black rounded-full w-5 h-5 flex items-center justify-center hover:bg-[var(--color-muted-foreground)] transition-colors z-10 transform translate-x-1 -translate-y-1",children:y.jsx(nc,{className:"h-3 w-3 text-black"})})]})}function _p({files:A,onRemoveFile:n,isPreview:r=!0,className:i=""}){if(A.length===0)return null;const l=A.filter(u=>u.type?.startsWith("image/")),s=A.filter(u=>!u.type?.startsWith("image/"));return y.jsxs("div",{className:`flex flex-wrap justify-end gap-2 max-w-full ${i}`,children:[s.map(u=>{const c=A.indexOf(u);return y.jsx(Np,{file:u,onRemove:n?()=>n(c):void 0,isPreview:r},`${u.name}-${u.size}-${c}`)}),l.length>0&&y.jsx("div",{className:"flex gap-2 overflow-x-auto max-w-full p-1 scrollbar-hide",children:l.map(u=>{const c=A.indexOf(u);return y.jsx(Np,{file:u,onRemove:n?()=>n(c):void 0,isPreview:r},`${u.name}-${u.size}-${c}`)})})]})}const fb=({className:A})=>y.jsx("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:A,children:y.jsx("path",{d:"M1.46875 0.09375L16.3125 6.9375C16.75 7.125 17 7.53125 17 8C17 8.46875 16.75 8.875 16.3125 9.0625L1.46875 15.9062C1.3125 15.9688 1.1875 16 1.03125 16C0.46875 16 0 15.5312 0 14.9688C0 14.8125 0.03125 14.6875 0.09375 14.5625L2.34375 9.5C2.5 9.15625 2.8125 8.9375 3.15625 8.90625L8.0625 8.46875C8.3125 8.46875 8.5 8.25 8.5 8C8.5 7.75 8.3125 7.5625 8.0625 7.53125L3.15625 7.09375C2.8125 7.0625 2.5 6.84375 2.34375 6.5L0.09375 1.4375C0.03125 1.3125 0 1.1875 0 1.03125C0 0.46875 0.46875 0 1.03125 0C1.1875 0 1.3125 0.03125 1.46875 0.09375Z",fill:"currentColor"})}),Rp=x.forwardRef(({className:A,type:n,...r},i)=>{const l=A&&typeof A=="string"&&A.includes("placeholder:");return y.jsx("input",{type:n,className:QA("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",!l&&"placeholder:text-muted-foreground",A),ref:i,...r})});Rp.displayName="Input";const db="+91";function hb({className:A}){return y.jsx("span",{className:QA("inline-flex shrink-0 text-lg leading-none",A),role:"img","aria-label":"India",children:"🇮🇳"})}function gb({value:A,onChange:n,onKeyDown:r,placeholder:i,disabled:l,theme:s,isMobile:u,maxLength:c,isMobileValid:f,onSend:h}){return y.jsxs("div",{className:"px-2 pt-3 pb-2 space-y-2 w-full",children:[y.jsx("p",{className:"px-1 text-xs font-semibold tracking-wide text-foreground uppercase",children:"Enter your mobile number"}),y.jsxs("div",{className:"flex items-center gap-2 w-full",children:[y.jsxs("div",{className:QA("inline-flex items-center gap-1 rounded-full h-[40px] px-3 shrink-0 py-2 min-h-[50px] h-full",l&&"opacity-60",s?.textColor==="white"?"bg-white-100":"bg-black-100"),style:{fontSize:u?"16px":"14px"},children:[y.jsx(hb,{}),y.jsx("span",{className:"text-sm font-medium text-foreground",children:db}),y.jsx(gs,{className:"h-4 w-4 text-muted-foreground","aria-hidden":!0})]}),y.jsxs("div",{className:QA("flex items-center gap-1 rounded-full px-2 py-2 flex-1 min-w-0",l&&"opacity-60",s?.textColor==="white"?"bg-white-100":"bg-black-100"),children:[y.jsx(Rp,{type:"tel",autoComplete:"tel-national",value:A,onChange:n,onKeyDown:r,placeholder:i,className:QA("w-full h-full shadow-none border-0 outline-none focus-visible:ring-0 focus-visible:ring-offset-0","text-sm placeholder:text-muted-foreground bg-transparent","disabled:cursor-not-allowed rounded-none break-words overflow-wrap-anywhere whitespace-pre-wrap","text-foreground px-3 py-2 pr-11 min-h-[40px]"),style:{fontSize:u?"16px":"14px"},maxLength:c,inputMode:"numeric",autoFocus:!l,disabled:l}),y.jsx($A,{type:"button",size:"icon",onClick:h,disabled:l||!f,variant:"ghost",className:`h-10 w-10 ${f?"bg-primary":"bg-none"} hover:bg-primary/90 rounded-full transition-all duration-200 shadow-lg hover:shadow-xl hover:scale-105 active:scale-95 shrink-0 disabled:opacity-50 disabled:pointer-events-none disabled:hover:scale-100`,title:f?"Submit mobile number":"Enter a valid mobile number","aria-label":f?"Submit mobile number":"Enter a valid mobile number",children:y.jsx(QB,{className:`w-4 h-4 ${f?"text-primary-foreground":"text-primary"}`})})]})]})]})}const qn=6,Bb=30;function pb({disabled:A,isMobile:n,validation:r,onSubmit:i,onResendOtp:l}){const[s,u]=x.useState(Array(qn).fill("")),c=x.useRef([]),[f,h]=x.useState(0),B=s.join(""),p=r?.pattern??`^\\d{${qn}}$`,m=new RegExp(p),C=r?.minLength??qn,Q=r?.maxLength??qn,E=B.length===C&&m.test(B),T=x.useCallback((O,G)=>{u(k=>{const K=[...k];return K[O]=G.slice(-1),K})},[]),S=O=>{O<qn-1&&c.current[O+1]?.focus()},H=O=>{O>0&&c.current[O-1]?.focus()},D=x.useCallback(()=>c.current.map(O=>O?.value.replace(/\D/g,"").slice(-1)??""),[]),Y=(O,G)=>{const k=G.target.value.replace(/\D/g,"").slice(-1);T(O,k),k&&S(O)},$=(O,G)=>{if(G.key==="Backspace"&&!s[O]){H(O),T(O,"");return}if(G.key==="Enter"&&!G.shiftKey&&!A){G.preventDefault();const k=D(),K=k.join("");if(K.length>=C&&m.test(K))i(K);else{const eA=k.findIndex(aA=>!aA);c.current[eA===-1?0:eA]?.focus()}}},U=O=>{O.preventDefault();const G=O.clipboardData.getData("text").replace(/\D/g,"").slice(0,Q);if(!G)return;const k=[...s];for(let eA=0;eA<G.length&&eA<qn;eA++)k[eA]=G[eA];u(k);const K=Math.min(G.length,qn-1);c.current[K]?.focus()},_=()=>{if(A)return;const O=D().join("");O.length>=C&&m.test(O)&&i(O)},R=()=>{f>0||A||(u(Array(qn).fill("")),c.current[0]?.focus(),l?.(),h(Bb))};return x.useEffect(()=>{!A&&c.current[0]&&c.current[0].focus()},[A]),x.useEffect(()=>{if(f<=0)return;const O=setTimeout(()=>h(G=>G-1),1e3);return()=>clearTimeout(O)},[f]),y.jsx("div",{className:"px-4 pt-3 pb-2 space-y-3",children:y.jsxs("div",{className:"flex flex-col gap-3",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("p",{className:"text-xs font-semibold tracking-wide text-foreground uppercase",children:"Please enter the OTP"}),y.jsxs("button",{type:"button",onClick:R,disabled:A||f>0,className:QA("text-xs font-medium underline underline-offset-2","text-primary hover:opacity-90 disabled:opacity-50 disabled:no-underline disabled:cursor-not-allowed"),children:["Resend OTP",f>0?` (00:${String(f).padStart(2,"0")}s)`:""]})]}),y.jsxs("div",{className:"flex items-center w-full gap-2 justify-between",children:[y.jsx("div",{className:"flex items-center gap-2",children:s.map((O,G)=>y.jsx("input",{ref:k=>{c.current[G]=k},type:"text",inputMode:"numeric",maxLength:1,value:O,onChange:k=>Y(G,k),onKeyDown:k=>$(G,k),onPaste:U,disabled:A,style:{fontSize:n?"16px":"14px"},className:QA("h-10 w-10 rounded-full border text-center text-lg font-semibold bg-transparent text-foreground","border-border shadow-sm outline-none transition-colors","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0 focus-visible:border-transparent","disabled:cursor-not-allowed disabled:opacity-50"),"aria-label":`Digit ${G+1}`},G))}),y.jsx($A,{type:"button",size:"icon",onClick:_,disabled:A,variant:"ghost",className:`h-10 w-10 ${E?"bg-primary":"bg-none"} hover:bg-primary/90 rounded-full transition-all duration-200 shadow-lg hover:shadow-xl hover:scale-105 active:scale-95 shrink-0 disabled:opacity-50 disabled:pointer-events-none disabled:hover:scale-100`,title:E?"Submit OTP":"Enter the full OTP to submit","aria-label":E?"Submit OTP":"Enter the full OTP to submit",children:y.jsx(QB,{className:`w-4 h-4 ${E?"text-primary-foreground":"text-primary"}`})})]})]})})}const Op=10,mb=10,Cb=/^[6-9][0-9]{9}$/;function wb({component:A,value:n,onChange:r,isDisabled:i,validation:l,theme:s,isMobile:u,placeholder:c,onSend:f,onResendOtp:h}){const B=A===EA.SYNAPSE_COMPONENTS.MOBILE,p=A===EA.SYNAPSE_COMPONENTS.OTP;if(!B&&!p)return null;const m=T=>{const S=T.target.value.replace(/\D/g,""),H=l?.maxLength??Op;r(S.slice(0,H))},C=n.length===(l?.minLength??mb)&&(l?.pattern?new RegExp(l.pattern).test(n):Cb.test(n)),Q=()=>{!C||i||f()},E=T=>{T.key==="Enter"&&(T.preventDefault(),Q())};return y.jsxs(y.Fragment,{children:[B&&y.jsx(gb,{value:n,onChange:m,onSend:Q,onKeyDown:E,placeholder:c??"Enter your mobile number",disabled:i,isMobileValid:C,theme:s,isMobile:u,maxLength:l?.maxLength??Op}),p&&y.jsx(pb,{disabled:i,isMobile:u,validation:{pattern:l?.pattern,minLength:l?.minLength,maxLength:l?.maxLength},onSubmit:T=>{r(T),f({message:T})},onResendOtp:h,theme:s})]})}function yb({value:A,onChange:n,onSend:r,onFileChange:i,onRemoveFile:l,onRecording:s,isRecording:u,hasAttachment:c,attachmentFiles:f,isDisabled:h,placeholder:B,isMobile:p,recordingStatus:m,theme:C,allowed:Q,showStartNewChatButton:E,onStartNewChat:T}){const S=x.useRef(null),H=x.useRef(null),D=st(q=>q.elicitationState),Y=D.component===EA.SYNAPSE_COMPONENTS.MOBILE,$=D.component===EA.SYNAPSE_COMPONENTS.OTP,U=A.trim().length>0||c,_=Q===void 0||Q.includes("audio"),R=U||!_,O=U,G=Q===void 0||Q.includes("file"),k=(h||m!==fe.IDLE)&&!u,K=QA("rounded-full transition-all duration-200 ",u?"bg-gradient-to-r from-rose-400 via-primary to-indigo-500 text-white ring-2 ring-white/60 animate-pulse shadow-[0_0_20px_rgba(139,92,246,0.45)]":k?"text-primary/50 cursor-not-allowed shadow-none":"text-foreground hover:bg-secondary"),eA=q=>{const pA=Array.from(q.target.files||[]);pA.length>0&&i(pA)},aA=()=>{h||S.current?.click()},tA=q=>{q.key==="Enter"&&!q.shiftKey&&O&&!h&&(q.preventDefault(),r())},L=q=>{q.style.height="auto",q.style.overflow="hidden";const pA=q.scrollHeight,F=40,N=120,J=Math.max(F,Math.min(pA,N));q.style.height=J+"px",pA>N?q.style.overflow="auto":q.style.overflow="hidden"},W=q=>{L(q.currentTarget)};return x.useEffect(()=>{H.current&&L(H.current)},[A]),x.useEffect(()=>{!h&&!p&&H.current?.focus()},[h]),E&&T?y.jsx("div",{className:"px-4 py-2 flex justify-unset",children:y.jsxs("button",{type:"button",onClick:T,className:"px-6 py-3 bg-primary text-primary-foreground text-sm font-semibold rounded-lg hover:bg-primary/90 transition-colors flex items-center justify-center gap-2 disabled:opacity-60 disabled:pointer-events-none w-full",children:[y.jsx("span",{children:"Start new chat"}),y.jsx(vB,{className:"w-5 h-5","aria-hidden":!0})]})}):y.jsx(y.Fragment,{children:Y||$?y.jsx(wb,{component:D.component,value:A,onChange:n,isDisabled:h,placeholder:D.description,validation:{pattern:D.pattern,minLength:D.minLength,maxLength:D.maxLength,type:D.type},theme:C,isMobile:p,onSend:r,onResendOtp:()=>r({resend:!0})}):y.jsxs("div",{className:"px-2 py-2",children:[c&&f.length>0&&y.jsx("div",{className:"mb-2 pb-2 border-b border-border-subtle",children:y.jsx(_p,{files:f,onRemoveFile:l,isPreview:!0})}),y.jsx("input",{ref:S,type:"file",multiple:!0,max:3,accept:"image/jpeg, image/png, image/jpg, application/pdf",className:"hidden",onChange:eA,disabled:h,title:"Attach file","aria-label":"Attach file"}),y.jsxs("div",{className:"flex items-center gap-2 w-full",children:[G&&m===fe.IDLE&&y.jsx($A,{type:"button",variant:"ghost",size:"icon",onClick:aA,disabled:h,className:QA("rounded-full transition-all shrink-0",c?"bg-primary text-foreground hover:bg-primary/15":"hover:bg-secondary text-foreground"),title:"Attach file","aria-label":"Attach file",children:y.jsx(t4,{className:"w-5 h-5"})}),y.jsx("div",{className:QA("flex items-center gap-1 rounded-full px-2 py-2 flex-1 min-w-0",h&&"opacity-60",C?.textColor==="white"?"bg-white-100":"bg-black-100"),children:y.jsxs("div",{className:"flex-1 relative min-w-0",children:[y.jsx(Ip,{ref:H,onInput:W,placeholder:B,value:A,onChange:q=>n(q.target.value),rows:1,maxLength:1e3,autoFocus:!h&&!p,style:{wordBreak:"break-word",overflowWrap:"anywhere",minHeight:"40px",maxHeight:"120px",fontSize:p?"16px":"14px",lineHeight:"1.5"},onKeyPress:tA,disabled:h,title:"Enter your message","aria-label":"Enter your message",className:"w-full shadow-none border-0 outline-none focus-visible:ring-0 focus-visible:ring-offset-0 text-sm placeholder:text-muted-foreground bg-transparent disabled:cursor-not-allowed rounded-none break-words overflow-wrap-anywhere whitespace-pre-wrap text-foreground resize-none pr-11"}),u?y.jsx($A,{type:"button",variant:"ghost",size:"icon",onClick:s,className:"absolute right-0.5 top-1/2 -translate-y-1/2 rounded-full bg-gradient-to-r from-red-400 to-rose-500 text-white hover:from-red-500 hover:to-rose-600 shadow-lg transition-all duration-200 hover:scale-105 active:scale-95 shrink-0",title:"Stop recording","aria-label":"Stop recording",children:y.jsx(a4,{className:"w-4 h-4"})}):_&&!R&&y.jsx($A,{type:"button",variant:"ghost",size:"icon",onClick:s,disabled:k,className:QA("absolute right-0.5 top-1/2 -translate-y-1/2 shrink-0",K),title:"Start recording","aria-label":"Start recording",children:y.jsx(r4,{className:"w-5 h-5"})}),R&&y.jsx($A,{type:"button",size:"icon",onClick:()=>r(),disabled:h||!O,variant:"ghost",className:`absolute right-0.5 top-1/2 -translate-y-1/2 h-10 w-10 ${O?"bg-primary":"bg-none"} hover:bg-primary/90 rounded-full transition-all duration-200 shadow-lg hover:shadow-xl hover:scale-105 active:scale-95 shrink-0 disabled:opacity-50 disabled:pointer-events-none disabled:hover:scale-100`,title:O?"Send message":"Type a message to send","aria-label":O?"Send message":"Type a message to send",children:y.jsx(fb,{className:`w-4 h-4 ${O?"text-primary-foreground":"text-primary"}`})})]})})]})]})})}const Eb=Object.freeze(Object.defineProperty({__proto__:null,default:yb},Symbol.toStringTag,{value:"Module"}));function vb(A,n){const r={};return(A[A.length-1]===""?[...A,""]:A).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const Qb=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bb=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ub={};function Lp(A,n){return(Ub.jsx?bb:Qb).test(A)}const Sb=/[ \t\n\f\r]/g;function xb(A){return typeof A=="object"?A.type==="text"?Mp(A.value):!1:Mp(A)}function Mp(A){return A.replace(Sb,"")===""}class Oa{constructor(n,r,i){this.normal=r,this.property=n,i&&(this.space=i)}}Oa.prototype.normal={},Oa.prototype.property={},Oa.prototype.space=void 0;function Dp(A,n){const r={},i={};for(const l of A)Object.assign(r,l.property),Object.assign(i,l.normal);return new Oa(r,i,n)}function Uc(A){return A.toLowerCase()}class ot{constructor(n,r){this.attribute=r,this.property=n}}ot.prototype.attribute="",ot.prototype.booleanish=!1,ot.prototype.boolean=!1,ot.prototype.commaOrSpaceSeparated=!1,ot.prototype.commaSeparated=!1,ot.prototype.defined=!1,ot.prototype.mustUseProperty=!1,ot.prototype.number=!1,ot.prototype.overloadedBoolean=!1,ot.prototype.property="",ot.prototype.spaceSeparated=!1,ot.prototype.space=void 0;let Fb=0;const HA=Dr(),Ue=Dr(),Sc=Dr(),sA=Dr(),ae=Dr(),hi=Dr(),yt=Dr();function Dr(){return 2**++Fb}const xc=Object.freeze(Object.defineProperty({__proto__:null,boolean:HA,booleanish:Ue,commaOrSpaceSeparated:yt,commaSeparated:hi,number:sA,overloadedBoolean:Sc,spaceSeparated:ae},Symbol.toStringTag,{value:"Module"})),Fc=Object.keys(xc);class Tc extends ot{constructor(n,r,i,l){let s=-1;if(super(n,r),kp(this,"space",l),typeof i=="number")for(;++s<Fc.length;){const u=Fc[s];kp(this,Fc[s],(i&xc[u])===xc[u])}}}Tc.prototype.defined=!0;function kp(A,n,r){r&&(A[n]=r)}function gi(A){const n={},r={};for(const[i,l]of Object.entries(A.properties)){const s=new Tc(i,A.transform(A.attributes||{},i),l,A.space);A.mustUseProperty&&A.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),n[i]=s,r[Uc(i)]=i,r[Uc(s.attribute)]=i}return new Oa(n,r,A.space)}const Kp=gi({properties:{ariaActiveDescendant:null,ariaAtomic:Ue,ariaAutoComplete:null,ariaBusy:Ue,ariaChecked:Ue,ariaColCount:sA,ariaColIndex:sA,ariaColSpan:sA,ariaControls:ae,ariaCurrent:null,ariaDescribedBy:ae,ariaDetails:null,ariaDisabled:Ue,ariaDropEffect:ae,ariaErrorMessage:null,ariaExpanded:Ue,ariaFlowTo:ae,ariaGrabbed:Ue,ariaHasPopup:null,ariaHidden:Ue,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ae,ariaLevel:sA,ariaLive:null,ariaModal:Ue,ariaMultiLine:Ue,ariaMultiSelectable:Ue,ariaOrientation:null,ariaOwns:ae,ariaPlaceholder:null,ariaPosInSet:sA,ariaPressed:Ue,ariaReadOnly:Ue,ariaRelevant:null,ariaRequired:Ue,ariaRoleDescription:ae,ariaRowCount:sA,ariaRowIndex:sA,ariaRowSpan:sA,ariaSelected:Ue,ariaSetSize:sA,ariaSort:null,ariaValueMax:sA,ariaValueMin:sA,ariaValueNow:sA,ariaValueText:null,role:null},transform(A,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function zp(A,n){return n in A?A[n]:n}function jp(A,n){return zp(A,n.toLowerCase())}const Tb=gi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:hi,acceptCharset:ae,accessKey:ae,action:null,allow:null,allowFullScreen:HA,allowPaymentRequest:HA,allowUserMedia:HA,alt:null,as:null,async:HA,autoCapitalize:null,autoComplete:ae,autoFocus:HA,autoPlay:HA,blocking:ae,capture:null,charSet:null,checked:HA,cite:null,className:ae,cols:sA,colSpan:null,content:null,contentEditable:Ue,controls:HA,controlsList:ae,coords:sA|hi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:HA,defer:HA,dir:null,dirName:null,disabled:HA,download:Sc,draggable:Ue,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:HA,formTarget:null,headers:ae,height:sA,hidden:Sc,high:sA,href:null,hrefLang:null,htmlFor:ae,httpEquiv:ae,id:null,imageSizes:null,imageSrcSet:null,inert:HA,inputMode:null,integrity:null,is:null,isMap:HA,itemId:null,itemProp:ae,itemRef:ae,itemScope:HA,itemType:ae,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:HA,low:sA,manifest:null,max:null,maxLength:sA,media:null,method:null,min:null,minLength:sA,multiple:HA,muted:HA,name:null,nonce:null,noModule:HA,noValidate:HA,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:HA,optimum:sA,pattern:null,ping:ae,placeholder:null,playsInline:HA,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:HA,referrerPolicy:null,rel:ae,required:HA,reversed:HA,rows:sA,rowSpan:sA,sandbox:ae,scope:null,scoped:HA,seamless:HA,selected:HA,shadowRootClonable:HA,shadowRootDelegatesFocus:HA,shadowRootMode:null,shape:null,size:sA,sizes:null,slot:null,span:sA,spellCheck:Ue,src:null,srcDoc:null,srcLang:null,srcSet:null,start:sA,step:null,style:null,tabIndex:sA,target:null,title:null,translate:null,type:null,typeMustMatch:HA,useMap:null,value:Ue,width:sA,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ae,axis:null,background:null,bgColor:null,border:sA,borderColor:null,bottomMargin:sA,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:HA,declare:HA,event:null,face:null,frame:null,frameBorder:null,hSpace:sA,leftMargin:sA,link:null,longDesc:null,lowSrc:null,marginHeight:sA,marginWidth:sA,noResize:HA,noHref:HA,noShade:HA,noWrap:HA,object:null,profile:null,prompt:null,rev:null,rightMargin:sA,rules:null,scheme:null,scrolling:Ue,standby:null,summary:null,text:null,topMargin:sA,valueType:null,version:null,vAlign:null,vLink:null,vSpace:sA,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:HA,disableRemotePlayback:HA,prefix:null,property:null,results:sA,security:null,unselectable:null},space:"html",transform:jp}),Hb=gi({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:yt,accentHeight:sA,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:sA,amplitude:sA,arabicForm:null,ascent:sA,attributeName:null,attributeType:null,azimuth:sA,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:sA,by:null,calcMode:null,capHeight:sA,className:ae,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:sA,diffuseConstant:sA,direction:null,display:null,dur:null,divisor:sA,dominantBaseline:null,download:HA,dx:null,dy:null,edgeMode:null,editable:null,elevation:sA,enableBackground:null,end:null,event:null,exponent:sA,externalResourcesRequired:null,fill:null,fillOpacity:sA,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:hi,g2:hi,glyphName:hi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:sA,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:sA,horizOriginX:sA,horizOriginY:sA,id:null,ideographic:sA,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:sA,k:sA,k1:sA,k2:sA,k3:sA,k4:sA,kernelMatrix:yt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:sA,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:sA,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:sA,overlineThickness:sA,paintOrder:null,panose1:null,path:null,pathLength:sA,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ae,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:sA,pointsAtY:sA,pointsAtZ:sA,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:yt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:yt,rev:yt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:yt,requiredFeatures:yt,requiredFonts:yt,requiredFormats:yt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:sA,specularExponent:sA,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:sA,strikethroughThickness:sA,string:null,stroke:null,strokeDashArray:yt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:sA,strokeOpacity:sA,strokeWidth:null,style:null,surfaceScale:sA,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:yt,tabIndex:sA,tableValues:null,target:null,targetX:sA,targetY:sA,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:yt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:sA,underlineThickness:sA,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:sA,values:null,vAlphabetic:sA,vMathematical:sA,vectorEffect:null,vHanging:sA,vIdeographic:sA,version:null,vertAdvY:sA,vertOriginX:sA,vertOriginY:sA,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:sA,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:zp}),Gp=gi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(A,n){return"xlink:"+n.slice(5).toLowerCase()}}),Vp=gi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:jp}),Pp=gi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(A,n){return"xml:"+n.slice(3).toLowerCase()}}),Ib={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Nb=/[A-Z]/g,Yp=/-[a-z]/g,_b=/^data[-\w.:]+$/i;function Rb(A,n){const r=Uc(n);let i=n,l=ot;if(r in A.normal)return A.property[A.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&_b.test(n)){if(n.charAt(4)==="-"){const s=n.slice(5).replace(Yp,Lb);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=n.slice(4);if(!Yp.test(s)){let u=s.replace(Nb,Ob);u.charAt(0)!=="-"&&(u="-"+u),n="data"+u}}l=Tc}return new l(i,n)}function Ob(A){return"-"+A.toLowerCase()}function Lb(A){return A.charAt(1).toUpperCase()}const Mb=Dp([Kp,Tb,Gp,Vp,Pp],"html"),Hc=Dp([Kp,Hb,Gp,Vp,Pp],"svg");function Db(A){return A.join(" ").trim()}var Bi={},Ic,Xp;function kb(){if(Xp)return Ic;Xp=1;var A=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,c=/^\s+|\s+$/g,f=`
47
47
  `,h="/",B="*",p="",m="comment",C="declaration";function Q(T,S){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];S=S||{};var H=1,D=1;function Y(aA){var tA=aA.match(n);tA&&(H+=tA.length);var L=aA.lastIndexOf(f);D=~L?aA.length-L:D+aA.length}function $(){var aA={line:H,column:D};return function(tA){return tA.position=new U(aA),O(),tA}}function U(aA){this.start=aA,this.end={line:H,column:D},this.source=S.source}U.prototype.content=T;function _(aA){var tA=new Error(S.source+":"+H+":"+D+": "+aA);if(tA.reason=aA,tA.filename=S.source,tA.line=H,tA.column=D,tA.source=T,!S.silent)throw tA}function R(aA){var tA=aA.exec(T);if(tA){var L=tA[0];return Y(L),T=T.slice(L.length),tA}}function O(){R(r)}function G(aA){var tA;for(aA=aA||[];tA=k();)tA!==!1&&aA.push(tA);return aA}function k(){var aA=$();if(!(h!=T.charAt(0)||B!=T.charAt(1))){for(var tA=2;p!=T.charAt(tA)&&(B!=T.charAt(tA)||h!=T.charAt(tA+1));)++tA;if(tA+=2,p===T.charAt(tA-1))return _("End of comment missing");var L=T.slice(2,tA-2);return D+=2,Y(L),T=T.slice(tA),D+=2,aA({type:m,comment:L})}}function K(){var aA=$(),tA=R(i);if(tA){if(k(),!R(l))return _("property missing ':'");var L=R(s),W=aA({type:C,property:E(tA[0].replace(A,p)),value:L?E(L[0].replace(A,p)):p});return R(u),W}}function eA(){var aA=[];G(aA);for(var tA;tA=K();)tA!==!1&&(aA.push(tA),G(aA));return aA}return O(),eA()}function E(T){return T?T.replace(c,p):p}return Ic=Q,Ic}var qp;function Kb(){if(qp)return Bi;qp=1;var A=Bi&&Bi.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.default=r;const n=A(kb());function r(i,l){let s=null;if(!i||typeof i!="string")return s;const u=(0,n.default)(i),c=typeof l=="function";return u.forEach(f=>{if(f.type!=="declaration")return;const{property:h,value:B}=f;c?l(h,B,f):B&&(s=s||{},s[h]=B)}),s}return Bi}var La={},Jp;function zb(){if(Jp)return La;Jp=1,Object.defineProperty(La,"__esModule",{value:!0}),La.camelCase=void 0;var A=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,s=function(h){return!h||r.test(h)||A.test(h)},u=function(h,B){return B.toUpperCase()},c=function(h,B){return"".concat(B,"-")},f=function(h,B){return B===void 0&&(B={}),s(h)?h:(h=h.toLowerCase(),B.reactCompat?h=h.replace(l,c):h=h.replace(i,c),h.replace(n,u))};return La.camelCase=f,La}var Ma,Zp;function jb(){if(Zp)return Ma;Zp=1;var A=Ma&&Ma.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},n=A(Kb()),r=zb();function i(l,s){var u={};return!l||typeof l!="string"||(0,n.default)(l,function(c,f){c&&f&&(u[(0,r.camelCase)(c,s)]=f)}),u}return i.default=i,Ma=i,Ma}var Gb=jb();const Vb=ku(Gb),Wp=$p("end"),Nc=$p("start");function $p(A){return n;function n(r){const i=r&&r.position&&r.position[A]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function Pb(A){const n=Nc(A),r=Wp(A);if(n&&r)return{start:n,end:r}}function Da(A){return!A||typeof A!="object"?"":"position"in A||"type"in A?Am(A.position):"start"in A||"end"in A?Am(A):"line"in A||"column"in A?_c(A):""}function _c(A){return em(A&&A.line)+":"+em(A&&A.column)}function Am(A){return _c(A&&A.start)+"-"+_c(A&&A.end)}function em(A){return A&&typeof A=="number"?A:1}class We extends Error{constructor(n,r,i){super(),typeof r=="string"&&(i=r,r=void 0);let l="",s={},u=!1;if(r&&("line"in r&&"column"in r?s={place:r}:"start"in r&&"end"in r?s={place:r}:"type"in r?s={ancestors:[r],place:r.position}:s={...r}),typeof n=="string"?l=n:!s.cause&&n&&(u=!0,l=n.message,s.cause=n),!s.ruleId&&!s.source&&typeof i=="string"){const f=i.indexOf(":");f===-1?s.ruleId=i:(s.source=i.slice(0,f),s.ruleId=i.slice(f+1))}if(!s.place&&s.ancestors&&s.ancestors){const f=s.ancestors[s.ancestors.length-1];f&&(s.place=f.position)}const c=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=c?c.line:void 0,this.name=Da(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=u&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}We.prototype.file="",We.prototype.name="",We.prototype.reason="",We.prototype.message="",We.prototype.stack="",We.prototype.column=void 0,We.prototype.line=void 0,We.prototype.ancestors=void 0,We.prototype.cause=void 0,We.prototype.fatal=void 0,We.prototype.place=void 0,We.prototype.ruleId=void 0,We.prototype.source=void 0;const Rc={}.hasOwnProperty,Yb=new Map,Xb=/[A-Z]/g,qb=new Set(["table","tbody","thead","tfoot","tr"]),Jb=new Set(["td","th"]),tm="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Zb(A,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=n.filePath||void 0;let i;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=i2(r,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=r2(r,n.jsx,n.jsxs)}const l={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:i,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Hc:Mb,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},s=nm(l,A,void 0);return s&&typeof s!="string"?s:l.create(A,l.Fragment,{children:s||void 0},void 0)}function nm(A,n,r){if(n.type==="element")return Wb(A,n,r);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return $b(A,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return e2(A,n,r);if(n.type==="mdxjsEsm")return A2(A,n);if(n.type==="root")return t2(A,n,r);if(n.type==="text")return n2(A,n)}function Wb(A,n,r){const i=A.schema;let l=i;n.tagName.toLowerCase()==="svg"&&i.space==="html"&&(l=Hc,A.schema=l),A.ancestors.push(n);const s=im(A,n.tagName,!1),u=a2(A,n);let c=Lc(A,n);return qb.has(n.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!xb(f):!0})),rm(A,u,s,n),Oc(u,c),A.ancestors.pop(),A.schema=i,A.create(n,s,u,r)}function $b(A,n){if(n.data&&n.data.estree&&A.evaluater){const i=n.data.estree.body[0];return A.evaluater.evaluateExpression(i.expression)}ka(A,n.position)}function A2(A,n){if(n.data&&n.data.estree&&A.evaluater)return A.evaluater.evaluateProgram(n.data.estree);ka(A,n.position)}function e2(A,n,r){const i=A.schema;let l=i;n.name==="svg"&&i.space==="html"&&(l=Hc,A.schema=l),A.ancestors.push(n);const s=n.name===null?A.Fragment:im(A,n.name,!0),u=l2(A,n),c=Lc(A,n);return rm(A,u,s,n),Oc(u,c),A.ancestors.pop(),A.schema=i,A.create(n,s,u,r)}function t2(A,n,r){const i={};return Oc(i,Lc(A,n)),A.create(n,A.Fragment,i,r)}function n2(A,n){return n.value}function rm(A,n,r,i){typeof r!="string"&&r!==A.Fragment&&A.passNode&&(n.node=i)}function Oc(A,n){if(n.length>0){const r=n.length>1?n:n[0];r&&(A.children=r)}}function r2(A,n,r){return i;function i(l,s,u,c){const h=Array.isArray(u.children)?r:n;return c?h(s,u,c):h(s,u)}}function i2(A,n){return r;function r(i,l,s,u){const c=Array.isArray(s.children),f=Nc(i);return n(l,s,u,c,{columnNumber:f?f.column-1:void 0,fileName:A,lineNumber:f?f.line:void 0},void 0)}}function a2(A,n){const r={};let i,l;for(l in n.properties)if(l!=="children"&&Rc.call(n.properties,l)){const s=s2(A,l,n.properties[l]);if(s){const[u,c]=s;A.tableCellAlignToStyle&&u==="align"&&typeof c=="string"&&Jb.has(n.tagName)?i=c:r[u]=c}}if(i){const s=r.style||(r.style={});s[A.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return r}function l2(A,n){const r={};for(const i of n.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&A.evaluater){const c=i.data.estree.body[0].expression.properties[0];Object.assign(r,A.evaluater.evaluateExpression(c.argument))}else ka(A,n.position);else{const l=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&A.evaluater){const c=i.value.data.estree.body[0];s=A.evaluater.evaluateExpression(c.expression)}else ka(A,n.position);else s=i.value===null?!0:i.value;r[l]=s}return r}function Lc(A,n){const r=[];let i=-1;const l=A.passKeys?new Map:Yb;for(;++i<n.children.length;){const s=n.children[i];let u;if(A.passKeys){const f=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(f){const h=l.get(f)||0;u=f+"-"+h,l.set(f,h+1)}}const c=nm(A,s,u);c!==void 0&&r.push(c)}return r}function s2(A,n,r){const i=Rb(A.schema,n);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=i.commaSeparated?vb(r):Db(r)),i.property==="style"){let l=typeof r=="object"?r:o2(A,String(r));return A.stylePropertyNameCase==="css"&&(l=u2(l)),["style",l]}return[A.elementAttributeNameCase==="react"&&i.space?Ib[i.property]||i.property:i.attribute,r]}}function o2(A,n){try{return Vb(n,{reactCompat:!0})}catch(r){if(A.ignoreInvalidStyle)return{};const i=r,l=new We("Cannot parse `style` attribute",{ancestors:A.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=A.filePath||void 0,l.url=tm+"#cannot-parse-style-attribute",l}}function im(A,n,r){let i;if(!r)i={type:"Literal",value:n};else if(n.includes(".")){const l=n.split(".");let s=-1,u;for(;++s<l.length;){const c=Lp(l[s])?{type:"Identifier",name:l[s]}:{type:"Literal",value:l[s]};u=u?{type:"MemberExpression",object:u,property:c,computed:!!(s&&c.type==="Literal"),optional:!1}:c}i=u}else i=Lp(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(i.type==="Literal"){const l=i.value;return Rc.call(A.components,l)?A.components[l]:l}if(A.evaluater)return A.evaluater.evaluateExpression(i);ka(A)}function ka(A,n){const r=new We("Cannot handle MDX estrees without `createEvaluater`",{ancestors:A.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=A.filePath||void 0,r.url=tm+"#cannot-handle-mdx-estrees-without-createevaluater",r}function u2(A){const n={};let r;for(r in A)Rc.call(A,r)&&(n[c2(r)]=A[r]);return n}function c2(A){let n=A.replace(Xb,f2);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function f2(A){return"-"+A.toLowerCase()}const Mc={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},d2={};function h2(A,n){const r=d2,i=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,l=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return am(A,i,l)}function am(A,n,r){if(g2(A)){if("value"in A)return A.type==="html"&&!r?"":A.value;if(n&&"alt"in A&&A.alt)return A.alt;if("children"in A)return lm(A.children,n,r)}return Array.isArray(A)?lm(A,n,r):""}function lm(A,n,r){const i=[];let l=-1;for(;++l<A.length;)i[l]=am(A[l],n,r);return i.join("")}function g2(A){return!!(A&&typeof A=="object")}const sm=document.createElement("i");function Dc(A){const n="&"+A+";";sm.innerHTML=n;const r=sm.textContent;return r.charCodeAt(r.length-1)===59&&A!=="semi"||r===n?!1:r}function an(A,n,r,i){const l=A.length;let s=0,u;if(n<0?n=-n>l?0:l+n:n=n>l?l:n,r=r>0?r:0,i.length<1e4)u=Array.from(i),u.unshift(n,r),A.splice(...u);else for(r&&A.splice(n,r);s<i.length;)u=i.slice(s,s+1e4),u.unshift(n,0),A.splice(...u),s+=1e4,n+=1e4}function It(A,n){return A.length>0?(an(A,A.length,0,n),A):n}const om={}.hasOwnProperty;function B2(A){const n={};let r=-1;for(;++r<A.length;)p2(n,A[r]);return n}function p2(A,n){let r;for(r in n){const l=(om.call(A,r)?A[r]:void 0)||(A[r]={}),s=n[r];let u;if(s)for(u in s){om.call(l,u)||(l[u]=[]);const c=s[u];m2(l[u],Array.isArray(c)?c:c?[c]:[])}}}function m2(A,n){let r=-1;const i=[];for(;++r<n.length;)(n[r].add==="after"?A:i).push(n[r]);an(A,0,0,i)}function um(A,n){const r=Number.parseInt(A,n);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function pi(A){return A.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ln=Jn(/[A-Za-z]/),Et=Jn(/[\dA-Za-z]/),C2=Jn(/[#-'*+\--9=?A-Z^-~]/);function kc(A){return A!==null&&(A<32||A===127)}const Kc=Jn(/\d/),w2=Jn(/[\dA-Fa-f]/),y2=Jn(/[!-/:-@[-`{-~]/);function SA(A){return A!==null&&A<-2}function ut(A){return A!==null&&(A<0||A===32)}function VA(A){return A===-2||A===-1||A===32}const E2=Jn(new RegExp("\\p{P}|\\p{S}","u")),v2=Jn(/\s/);function Jn(A){return n;function n(r){return r!==null&&r>-1&&A.test(String.fromCharCode(r))}}function mi(A){const n=[];let r=-1,i=0,l=0;for(;++r<A.length;){const s=A.charCodeAt(r);let u="";if(s===37&&Et(A.charCodeAt(r+1))&&Et(A.charCodeAt(r+2)))l=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(u=String.fromCharCode(s));else if(s>55295&&s<57344){const c=A.charCodeAt(r+1);s<56320&&c>56319&&c<57344?(u=String.fromCharCode(s,c),l=1):u="�"}else u=String.fromCharCode(s);u&&(n.push(A.slice(i,r),encodeURIComponent(u)),i=r+l+1,u=""),l&&(r+=l,l=0)}return n.join("")+A.slice(i)}function le(A,n,r,i){const l=i?i-1:Number.POSITIVE_INFINITY;let s=0;return u;function u(f){return VA(f)?(A.enter(r),c(f)):n(f)}function c(f){return VA(f)&&s++<l?(A.consume(f),c):(A.exit(r),n(f))}}const Q2={tokenize:b2};function b2(A){const n=A.attempt(this.parser.constructs.contentInitial,i,l);let r;return n;function i(c){if(c===null){A.consume(c);return}return A.enter("lineEnding"),A.consume(c),A.exit("lineEnding"),le(A,n,"linePrefix")}function l(c){return A.enter("paragraph"),s(c)}function s(c){const f=A.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=f),r=f,u(c)}function u(c){if(c===null){A.exit("chunkText"),A.exit("paragraph"),A.consume(c);return}return SA(c)?(A.consume(c),A.exit("chunkText"),s):(A.consume(c),u)}}const U2={tokenize:S2},cm={tokenize:x2};function S2(A){const n=this,r=[];let i=0,l,s,u;return c;function c(D){if(i<r.length){const Y=r[i];return n.containerState=Y[1],A.attempt(Y[0].continuation,f,h)(D)}return h(D)}function f(D){if(i++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,l&&H();const Y=n.events.length;let $=Y,U;for(;$--;)if(n.events[$][0]==="exit"&&n.events[$][1].type==="chunkFlow"){U=n.events[$][1].end;break}S(i);let _=Y;for(;_<n.events.length;)n.events[_][1].end={...U},_++;return an(n.events,$+1,0,n.events.slice(Y)),n.events.length=_,h(D)}return c(D)}function h(D){if(i===r.length){if(!l)return m(D);if(l.currentConstruct&&l.currentConstruct.concrete)return Q(D);n.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return n.containerState={},A.check(cm,B,p)(D)}function B(D){return l&&H(),S(i),m(D)}function p(D){return n.parser.lazy[n.now().line]=i!==r.length,u=n.now().offset,Q(D)}function m(D){return n.containerState={},A.attempt(cm,C,Q)(D)}function C(D){return i++,r.push([n.currentConstruct,n.containerState]),m(D)}function Q(D){if(D===null){l&&H(),S(0),A.consume(D);return}return l=l||n.parser.flow(n.now()),A.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:s}),E(D)}function E(D){if(D===null){T(A.exit("chunkFlow"),!0),S(0),A.consume(D);return}return SA(D)?(A.consume(D),T(A.exit("chunkFlow")),i=0,n.interrupt=void 0,c):(A.consume(D),E)}function T(D,Y){const $=n.sliceStream(D);if(Y&&$.push(null),D.previous=s,s&&(s.next=D),s=D,l.defineSkip(D.start),l.write($),n.parser.lazy[D.start.line]){let U=l.events.length;for(;U--;)if(l.events[U][1].start.offset<u&&(!l.events[U][1].end||l.events[U][1].end.offset>u))return;const _=n.events.length;let R=_,O,G;for(;R--;)if(n.events[R][0]==="exit"&&n.events[R][1].type==="chunkFlow"){if(O){G=n.events[R][1].end;break}O=!0}for(S(i),U=_;U<n.events.length;)n.events[U][1].end={...G},U++;an(n.events,R+1,0,n.events.slice(_)),n.events.length=U}}function S(D){let Y=r.length;for(;Y-- >D;){const $=r[Y];n.containerState=$[1],$[0].exit.call(n,A)}r.length=D}function H(){l.write([null]),s=void 0,l=void 0,n.containerState._closeFlow=void 0}}function x2(A,n,r){return le(A,A.attempt(this.parser.constructs.document,n,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function fm(A){if(A===null||ut(A)||v2(A))return 1;if(E2(A))return 2}function zc(A,n,r){const i=[];let l=-1;for(;++l<A.length;){const s=A[l].resolveAll;s&&!i.includes(s)&&(n=s(n,r),i.push(s))}return n}const jc={name:"attention",resolveAll:F2,tokenize:T2};function F2(A,n){let r=-1,i,l,s,u,c,f,h,B;for(;++r<A.length;)if(A[r][0]==="enter"&&A[r][1].type==="attentionSequence"&&A[r][1]._close){for(i=r;i--;)if(A[i][0]==="exit"&&A[i][1].type==="attentionSequence"&&A[i][1]._open&&n.sliceSerialize(A[i][1]).charCodeAt(0)===n.sliceSerialize(A[r][1]).charCodeAt(0)){if((A[i][1]._close||A[r][1]._open)&&(A[r][1].end.offset-A[r][1].start.offset)%3&&!((A[i][1].end.offset-A[i][1].start.offset+A[r][1].end.offset-A[r][1].start.offset)%3))continue;f=A[i][1].end.offset-A[i][1].start.offset>1&&A[r][1].end.offset-A[r][1].start.offset>1?2:1;const p={...A[i][1].end},m={...A[r][1].start};dm(p,-f),dm(m,f),u={type:f>1?"strongSequence":"emphasisSequence",start:p,end:{...A[i][1].end}},c={type:f>1?"strongSequence":"emphasisSequence",start:{...A[r][1].start},end:m},s={type:f>1?"strongText":"emphasisText",start:{...A[i][1].end},end:{...A[r][1].start}},l={type:f>1?"strong":"emphasis",start:{...u.start},end:{...c.end}},A[i][1].end={...u.start},A[r][1].start={...c.end},h=[],A[i][1].end.offset-A[i][1].start.offset&&(h=It(h,[["enter",A[i][1],n],["exit",A[i][1],n]])),h=It(h,[["enter",l,n],["enter",u,n],["exit",u,n],["enter",s,n]]),h=It(h,zc(n.parser.constructs.insideSpan.null,A.slice(i+1,r),n)),h=It(h,[["exit",s,n],["enter",c,n],["exit",c,n],["exit",l,n]]),A[r][1].end.offset-A[r][1].start.offset?(B=2,h=It(h,[["enter",A[r][1],n],["exit",A[r][1],n]])):B=0,an(A,i-1,r-i+3,h),r=i+h.length-B-2;break}}for(r=-1;++r<A.length;)A[r][1].type==="attentionSequence"&&(A[r][1].type="data");return A}function T2(A,n){const r=this.parser.constructs.attentionMarkers.null,i=this.previous,l=fm(i);let s;return u;function u(f){return s=f,A.enter("attentionSequence"),c(f)}function c(f){if(f===s)return A.consume(f),c;const h=A.exit("attentionSequence"),B=fm(f),p=!B||B===2&&l||r.includes(f),m=!l||l===2&&B||r.includes(i);return h._open=!!(s===42?p:p&&(l||!m)),h._close=!!(s===42?m:m&&(B||!p)),n(f)}}function dm(A,n){A.column+=n,A.offset+=n,A._bufferIndex+=n}const H2={name:"autolink",tokenize:I2};function I2(A,n,r){let i=0;return l;function l(C){return A.enter("autolink"),A.enter("autolinkMarker"),A.consume(C),A.exit("autolinkMarker"),A.enter("autolinkProtocol"),s}function s(C){return ln(C)?(A.consume(C),u):C===64?r(C):h(C)}function u(C){return C===43||C===45||C===46||Et(C)?(i=1,c(C)):h(C)}function c(C){return C===58?(A.consume(C),i=0,f):(C===43||C===45||C===46||Et(C))&&i++<32?(A.consume(C),c):(i=0,h(C))}function f(C){return C===62?(A.exit("autolinkProtocol"),A.enter("autolinkMarker"),A.consume(C),A.exit("autolinkMarker"),A.exit("autolink"),n):C===null||C===32||C===60||kc(C)?r(C):(A.consume(C),f)}function h(C){return C===64?(A.consume(C),B):C2(C)?(A.consume(C),h):r(C)}function B(C){return Et(C)?p(C):r(C)}function p(C){return C===46?(A.consume(C),i=0,B):C===62?(A.exit("autolinkProtocol").type="autolinkEmail",A.enter("autolinkMarker"),A.consume(C),A.exit("autolinkMarker"),A.exit("autolink"),n):m(C)}function m(C){if((C===45||Et(C))&&i++<63){const Q=C===45?m:p;return A.consume(C),Q}return r(C)}}const ws={partial:!0,tokenize:N2};function N2(A,n,r){return i;function i(s){return VA(s)?le(A,l,"linePrefix")(s):l(s)}function l(s){return s===null||SA(s)?n(s):r(s)}}const hm={continuation:{tokenize:R2},exit:O2,name:"blockQuote",tokenize:_2};function _2(A,n,r){const i=this;return l;function l(u){if(u===62){const c=i.containerState;return c.open||(A.enter("blockQuote",{_container:!0}),c.open=!0),A.enter("blockQuotePrefix"),A.enter("blockQuoteMarker"),A.consume(u),A.exit("blockQuoteMarker"),s}return r(u)}function s(u){return VA(u)?(A.enter("blockQuotePrefixWhitespace"),A.consume(u),A.exit("blockQuotePrefixWhitespace"),A.exit("blockQuotePrefix"),n):(A.exit("blockQuotePrefix"),n(u))}}function R2(A,n,r){const i=this;return l;function l(u){return VA(u)?le(A,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):s(u)}function s(u){return A.attempt(hm,n,r)(u)}}function O2(A){A.exit("blockQuote")}const gm={name:"characterEscape",tokenize:L2};function L2(A,n,r){return i;function i(s){return A.enter("characterEscape"),A.enter("escapeMarker"),A.consume(s),A.exit("escapeMarker"),l}function l(s){return y2(s)?(A.enter("characterEscapeValue"),A.consume(s),A.exit("characterEscapeValue"),A.exit("characterEscape"),n):r(s)}}const Bm={name:"characterReference",tokenize:M2};function M2(A,n,r){const i=this;let l=0,s,u;return c;function c(p){return A.enter("characterReference"),A.enter("characterReferenceMarker"),A.consume(p),A.exit("characterReferenceMarker"),f}function f(p){return p===35?(A.enter("characterReferenceMarkerNumeric"),A.consume(p),A.exit("characterReferenceMarkerNumeric"),h):(A.enter("characterReferenceValue"),s=31,u=Et,B(p))}function h(p){return p===88||p===120?(A.enter("characterReferenceMarkerHexadecimal"),A.consume(p),A.exit("characterReferenceMarkerHexadecimal"),A.enter("characterReferenceValue"),s=6,u=w2,B):(A.enter("characterReferenceValue"),s=7,u=Kc,B(p))}function B(p){if(p===59&&l){const m=A.exit("characterReferenceValue");return u===Et&&!Dc(i.sliceSerialize(m))?r(p):(A.enter("characterReferenceMarker"),A.consume(p),A.exit("characterReferenceMarker"),A.exit("characterReference"),n)}return u(p)&&l++<s?(A.consume(p),B):r(p)}}const pm={partial:!0,tokenize:k2},mm={concrete:!0,name:"codeFenced",tokenize:D2};function D2(A,n,r){const i=this,l={partial:!0,tokenize:$};let s=0,u=0,c;return f;function f(U){return h(U)}function h(U){const _=i.events[i.events.length-1];return s=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,c=U,A.enter("codeFenced"),A.enter("codeFencedFence"),A.enter("codeFencedFenceSequence"),B(U)}function B(U){return U===c?(u++,A.consume(U),B):u<3?r(U):(A.exit("codeFencedFenceSequence"),VA(U)?le(A,p,"whitespace")(U):p(U))}function p(U){return U===null||SA(U)?(A.exit("codeFencedFence"),i.interrupt?n(U):A.check(pm,E,Y)(U)):(A.enter("codeFencedFenceInfo"),A.enter("chunkString",{contentType:"string"}),m(U))}function m(U){return U===null||SA(U)?(A.exit("chunkString"),A.exit("codeFencedFenceInfo"),p(U)):VA(U)?(A.exit("chunkString"),A.exit("codeFencedFenceInfo"),le(A,C,"whitespace")(U)):U===96&&U===c?r(U):(A.consume(U),m)}function C(U){return U===null||SA(U)?p(U):(A.enter("codeFencedFenceMeta"),A.enter("chunkString",{contentType:"string"}),Q(U))}function Q(U){return U===null||SA(U)?(A.exit("chunkString"),A.exit("codeFencedFenceMeta"),p(U)):U===96&&U===c?r(U):(A.consume(U),Q)}function E(U){return A.attempt(l,Y,T)(U)}function T(U){return A.enter("lineEnding"),A.consume(U),A.exit("lineEnding"),S}function S(U){return s>0&&VA(U)?le(A,H,"linePrefix",s+1)(U):H(U)}function H(U){return U===null||SA(U)?A.check(pm,E,Y)(U):(A.enter("codeFlowValue"),D(U))}function D(U){return U===null||SA(U)?(A.exit("codeFlowValue"),H(U)):(A.consume(U),D)}function Y(U){return A.exit("codeFenced"),n(U)}function $(U,_,R){let O=0;return G;function G(tA){return U.enter("lineEnding"),U.consume(tA),U.exit("lineEnding"),k}function k(tA){return U.enter("codeFencedFence"),VA(tA)?le(U,K,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(tA):K(tA)}function K(tA){return tA===c?(U.enter("codeFencedFenceSequence"),eA(tA)):R(tA)}function eA(tA){return tA===c?(O++,U.consume(tA),eA):O>=u?(U.exit("codeFencedFenceSequence"),VA(tA)?le(U,aA,"whitespace")(tA):aA(tA)):R(tA)}function aA(tA){return tA===null||SA(tA)?(U.exit("codeFencedFence"),_(tA)):R(tA)}}}function k2(A,n,r){const i=this;return l;function l(u){return u===null?r(u):(A.enter("lineEnding"),A.consume(u),A.exit("lineEnding"),s)}function s(u){return i.parser.lazy[i.now().line]?r(u):n(u)}}const Gc={name:"codeIndented",tokenize:z2},K2={partial:!0,tokenize:j2};function z2(A,n,r){const i=this;return l;function l(h){return A.enter("codeIndented"),le(A,s,"linePrefix",5)(h)}function s(h){const B=i.events[i.events.length-1];return B&&B[1].type==="linePrefix"&&B[2].sliceSerialize(B[1],!0).length>=4?u(h):r(h)}function u(h){return h===null?f(h):SA(h)?A.attempt(K2,u,f)(h):(A.enter("codeFlowValue"),c(h))}function c(h){return h===null||SA(h)?(A.exit("codeFlowValue"),u(h)):(A.consume(h),c)}function f(h){return A.exit("codeIndented"),n(h)}}function j2(A,n,r){const i=this;return l;function l(u){return i.parser.lazy[i.now().line]?r(u):SA(u)?(A.enter("lineEnding"),A.consume(u),A.exit("lineEnding"),l):le(A,s,"linePrefix",5)(u)}function s(u){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?n(u):SA(u)?l(u):r(u)}}const G2={name:"codeText",previous:P2,resolve:V2,tokenize:Y2};function V2(A){let n=A.length-4,r=3,i,l;if((A[r][1].type==="lineEnding"||A[r][1].type==="space")&&(A[n][1].type==="lineEnding"||A[n][1].type==="space")){for(i=r;++i<n;)if(A[i][1].type==="codeTextData"){A[r][1].type="codeTextPadding",A[n][1].type="codeTextPadding",r+=2,n-=2;break}}for(i=r-1,n++;++i<=n;)l===void 0?i!==n&&A[i][1].type!=="lineEnding"&&(l=i):(i===n||A[i][1].type==="lineEnding")&&(A[l][1].type="codeTextData",i!==l+2&&(A[l][1].end=A[i-1][1].end,A.splice(l+2,i-l-2),n-=i-l-2,i=l+2),l=void 0);return A}function P2(A){return A!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Y2(A,n,r){let i=0,l,s;return u;function u(p){return A.enter("codeText"),A.enter("codeTextSequence"),c(p)}function c(p){return p===96?(A.consume(p),i++,c):(A.exit("codeTextSequence"),f(p))}function f(p){return p===null?r(p):p===32?(A.enter("space"),A.consume(p),A.exit("space"),f):p===96?(s=A.enter("codeTextSequence"),l=0,B(p)):SA(p)?(A.enter("lineEnding"),A.consume(p),A.exit("lineEnding"),f):(A.enter("codeTextData"),h(p))}function h(p){return p===null||p===32||p===96||SA(p)?(A.exit("codeTextData"),f(p)):(A.consume(p),h)}function B(p){return p===96?(A.consume(p),l++,B):l===i?(A.exit("codeTextSequence"),A.exit("codeText"),n(p)):(s.type="codeTextData",h(p))}}class X2{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,r){const i=r??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(n,i):n>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(n,r,i){const l=r||0;this.setCursor(Math.trunc(n));const s=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return i&&Ka(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Ka(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Ka(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const r=this.left.splice(n,Number.POSITIVE_INFINITY);Ka(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Ka(this.left,r.reverse())}}}function Ka(A,n){let r=0;if(n.length<1e4)A.push(...n);else for(;r<n.length;)A.push(...n.slice(r,r+1e4)),r+=1e4}function Cm(A){const n={};let r=-1,i,l,s,u,c,f,h;const B=new X2(A);for(;++r<B.length;){for(;r in n;)r=n[r];if(i=B.get(r),r&&i[1].type==="chunkFlow"&&B.get(r-1)[1].type==="listItemPrefix"&&(f=i[1]._tokenizer.events,s=0,s<f.length&&f[s][1].type==="lineEndingBlank"&&(s+=2),s<f.length&&f[s][1].type==="content"))for(;++s<f.length&&f[s][1].type!=="content";)f[s][1].type==="chunkText"&&(f[s][1]._isInFirstContentOfListItem=!0,s++);if(i[0]==="enter")i[1].contentType&&(Object.assign(n,q2(B,r)),r=n[r],h=!0);else if(i[1]._container){for(s=r,l=void 0;s--;)if(u=B.get(s),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(l&&(B.get(l)[1].type="lineEndingBlank"),u[1].type="lineEnding",l=s);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;l&&(i[1].end={...B.get(l)[1].start},c=B.slice(l,r),c.unshift(i),B.splice(l,r-l+1,c))}}return an(A,0,Number.POSITIVE_INFINITY,B.slice(0)),!h}function q2(A,n){const r=A.get(n)[1],i=A.get(n)[2];let l=n-1;const s=[];let u=r._tokenizer;u||(u=i.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const c=u.events,f=[],h={};let B,p,m=-1,C=r,Q=0,E=0;const T=[E];for(;C;){for(;A.get(++l)[1]!==C;);s.push(l),C._tokenizer||(B=i.sliceStream(C),C.next||B.push(null),p&&u.defineSkip(C.start),C._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(B),C._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),p=C,C=C.next}for(C=r;++m<c.length;)c[m][0]==="exit"&&c[m-1][0]==="enter"&&c[m][1].type===c[m-1][1].type&&c[m][1].start.line!==c[m][1].end.line&&(E=m+1,T.push(E),C._tokenizer=void 0,C.previous=void 0,C=C.next);for(u.events=[],C?(C._tokenizer=void 0,C.previous=void 0):T.pop(),m=T.length;m--;){const S=c.slice(T[m],T[m+1]),H=s.pop();f.push([H,H+S.length-1]),A.splice(H,2,S)}for(f.reverse(),m=-1;++m<f.length;)h[Q+f[m][0]]=Q+f[m][1],Q+=f[m][1]-f[m][0]-1;return h}const J2={resolve:W2,tokenize:$2},Z2={partial:!0,tokenize:AU};function W2(A){return Cm(A),A}function $2(A,n){let r;return i;function i(c){return A.enter("content"),r=A.enter("chunkContent",{contentType:"content"}),l(c)}function l(c){return c===null?s(c):SA(c)?A.check(Z2,u,s)(c):(A.consume(c),l)}function s(c){return A.exit("chunkContent"),A.exit("content"),n(c)}function u(c){return A.consume(c),A.exit("chunkContent"),r.next=A.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,l}}function AU(A,n,r){const i=this;return l;function l(u){return A.exit("chunkContent"),A.enter("lineEnding"),A.consume(u),A.exit("lineEnding"),le(A,s,"linePrefix")}function s(u){if(u===null||SA(u))return r(u);const c=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?n(u):A.interrupt(i.parser.constructs.flow,r,n)(u)}}function wm(A,n,r,i,l,s,u,c,f){const h=f||Number.POSITIVE_INFINITY;let B=0;return p;function p(S){return S===60?(A.enter(i),A.enter(l),A.enter(s),A.consume(S),A.exit(s),m):S===null||S===32||S===41||kc(S)?r(S):(A.enter(i),A.enter(u),A.enter(c),A.enter("chunkString",{contentType:"string"}),E(S))}function m(S){return S===62?(A.enter(s),A.consume(S),A.exit(s),A.exit(l),A.exit(i),n):(A.enter(c),A.enter("chunkString",{contentType:"string"}),C(S))}function C(S){return S===62?(A.exit("chunkString"),A.exit(c),m(S)):S===null||S===60||SA(S)?r(S):(A.consume(S),S===92?Q:C)}function Q(S){return S===60||S===62||S===92?(A.consume(S),C):C(S)}function E(S){return!B&&(S===null||S===41||ut(S))?(A.exit("chunkString"),A.exit(c),A.exit(u),A.exit(i),n(S)):B<h&&S===40?(A.consume(S),B++,E):S===41?(A.consume(S),B--,E):S===null||S===32||S===40||kc(S)?r(S):(A.consume(S),S===92?T:E)}function T(S){return S===40||S===41||S===92?(A.consume(S),E):E(S)}}function ym(A,n,r,i,l,s){const u=this;let c=0,f;return h;function h(C){return A.enter(i),A.enter(l),A.consume(C),A.exit(l),A.enter(s),B}function B(C){return c>999||C===null||C===91||C===93&&!f||C===94&&!c&&"_hiddenFootnoteSupport"in u.parser.constructs?r(C):C===93?(A.exit(s),A.enter(l),A.consume(C),A.exit(l),A.exit(i),n):SA(C)?(A.enter("lineEnding"),A.consume(C),A.exit("lineEnding"),B):(A.enter("chunkString",{contentType:"string"}),p(C))}function p(C){return C===null||C===91||C===93||SA(C)||c++>999?(A.exit("chunkString"),B(C)):(A.consume(C),f||(f=!VA(C)),C===92?m:p)}function m(C){return C===91||C===92||C===93?(A.consume(C),c++,p):p(C)}}function Em(A,n,r,i,l,s){let u;return c;function c(m){return m===34||m===39||m===40?(A.enter(i),A.enter(l),A.consume(m),A.exit(l),u=m===40?41:m,f):r(m)}function f(m){return m===u?(A.enter(l),A.consume(m),A.exit(l),A.exit(i),n):(A.enter(s),h(m))}function h(m){return m===u?(A.exit(s),f(u)):m===null?r(m):SA(m)?(A.enter("lineEnding"),A.consume(m),A.exit("lineEnding"),le(A,h,"linePrefix")):(A.enter("chunkString",{contentType:"string"}),B(m))}function B(m){return m===u||m===null||SA(m)?(A.exit("chunkString"),h(m)):(A.consume(m),m===92?p:B)}function p(m){return m===u||m===92?(A.consume(m),B):B(m)}}function za(A,n){let r;return i;function i(l){return SA(l)?(A.enter("lineEnding"),A.consume(l),A.exit("lineEnding"),r=!0,i):VA(l)?le(A,i,r?"linePrefix":"lineSuffix")(l):n(l)}}const eU={name:"definition",tokenize:nU},tU={partial:!0,tokenize:rU};function nU(A,n,r){const i=this;let l;return s;function s(C){return A.enter("definition"),u(C)}function u(C){return ym.call(i,A,c,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(C)}function c(C){return l=pi(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),C===58?(A.enter("definitionMarker"),A.consume(C),A.exit("definitionMarker"),f):r(C)}function f(C){return ut(C)?za(A,h)(C):h(C)}function h(C){return wm(A,B,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(C)}function B(C){return A.attempt(tU,p,p)(C)}function p(C){return VA(C)?le(A,m,"whitespace")(C):m(C)}function m(C){return C===null||SA(C)?(A.exit("definition"),i.parser.defined.push(l),n(C)):r(C)}}function rU(A,n,r){return i;function i(c){return ut(c)?za(A,l)(c):r(c)}function l(c){return Em(A,s,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function s(c){return VA(c)?le(A,u,"whitespace")(c):u(c)}function u(c){return c===null||SA(c)?n(c):r(c)}}const iU={name:"hardBreakEscape",tokenize:aU};function aU(A,n,r){return i;function i(s){return A.enter("hardBreakEscape"),A.consume(s),l}function l(s){return SA(s)?(A.exit("hardBreakEscape"),n(s)):r(s)}}const lU={name:"headingAtx",resolve:sU,tokenize:oU};function sU(A,n){let r=A.length-2,i=3,l,s;return A[i][1].type==="whitespace"&&(i+=2),r-2>i&&A[r][1].type==="whitespace"&&(r-=2),A[r][1].type==="atxHeadingSequence"&&(i===r-1||r-4>i&&A[r-2][1].type==="whitespace")&&(r-=i+1===r?2:4),r>i&&(l={type:"atxHeadingText",start:A[i][1].start,end:A[r][1].end},s={type:"chunkText",start:A[i][1].start,end:A[r][1].end,contentType:"text"},an(A,i,r-i+1,[["enter",l,n],["enter",s,n],["exit",s,n],["exit",l,n]])),A}function oU(A,n,r){let i=0;return l;function l(B){return A.enter("atxHeading"),s(B)}function s(B){return A.enter("atxHeadingSequence"),u(B)}function u(B){return B===35&&i++<6?(A.consume(B),u):B===null||ut(B)?(A.exit("atxHeadingSequence"),c(B)):r(B)}function c(B){return B===35?(A.enter("atxHeadingSequence"),f(B)):B===null||SA(B)?(A.exit("atxHeading"),n(B)):VA(B)?le(A,c,"whitespace")(B):(A.enter("atxHeadingText"),h(B))}function f(B){return B===35?(A.consume(B),f):(A.exit("atxHeadingSequence"),c(B))}function h(B){return B===null||B===35||ut(B)?(A.exit("atxHeadingText"),c(B)):(A.consume(B),h)}}const uU=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],vm=["pre","script","style","textarea"],cU={concrete:!0,name:"htmlFlow",resolveTo:hU,tokenize:gU},fU={partial:!0,tokenize:pU},dU={partial:!0,tokenize:BU};function hU(A){let n=A.length;for(;n--&&!(A[n][0]==="enter"&&A[n][1].type==="htmlFlow"););return n>1&&A[n-2][1].type==="linePrefix"&&(A[n][1].start=A[n-2][1].start,A[n+1][1].start=A[n-2][1].start,A.splice(n-2,2)),A}function gU(A,n,r){const i=this;let l,s,u,c,f;return h;function h(b){return B(b)}function B(b){return A.enter("htmlFlow"),A.enter("htmlFlowData"),A.consume(b),p}function p(b){return b===33?(A.consume(b),m):b===47?(A.consume(b),s=!0,E):b===63?(A.consume(b),l=3,i.interrupt?n:F):ln(b)?(A.consume(b),u=String.fromCharCode(b),T):r(b)}function m(b){return b===45?(A.consume(b),l=2,C):b===91?(A.consume(b),l=5,c=0,Q):ln(b)?(A.consume(b),l=4,i.interrupt?n:F):r(b)}function C(b){return b===45?(A.consume(b),i.interrupt?n:F):r(b)}function Q(b){const lA="CDATA[";return b===lA.charCodeAt(c++)?(A.consume(b),c===lA.length?i.interrupt?n:K:Q):r(b)}function E(b){return ln(b)?(A.consume(b),u=String.fromCharCode(b),T):r(b)}function T(b){if(b===null||b===47||b===62||ut(b)){const lA=b===47,dA=u.toLowerCase();return!lA&&!s&&vm.includes(dA)?(l=1,i.interrupt?n(b):K(b)):uU.includes(u.toLowerCase())?(l=6,lA?(A.consume(b),S):i.interrupt?n(b):K(b)):(l=7,i.interrupt&&!i.parser.lazy[i.now().line]?r(b):s?H(b):D(b))}return b===45||Et(b)?(A.consume(b),u+=String.fromCharCode(b),T):r(b)}function S(b){return b===62?(A.consume(b),i.interrupt?n:K):r(b)}function H(b){return VA(b)?(A.consume(b),H):G(b)}function D(b){return b===47?(A.consume(b),G):b===58||b===95||ln(b)?(A.consume(b),Y):VA(b)?(A.consume(b),D):G(b)}function Y(b){return b===45||b===46||b===58||b===95||Et(b)?(A.consume(b),Y):$(b)}function $(b){return b===61?(A.consume(b),U):VA(b)?(A.consume(b),$):D(b)}function U(b){return b===null||b===60||b===61||b===62||b===96?r(b):b===34||b===39?(A.consume(b),f=b,_):VA(b)?(A.consume(b),U):R(b)}function _(b){return b===f?(A.consume(b),f=null,O):b===null||SA(b)?r(b):(A.consume(b),_)}function R(b){return b===null||b===34||b===39||b===47||b===60||b===61||b===62||b===96||ut(b)?$(b):(A.consume(b),R)}function O(b){return b===47||b===62||VA(b)?D(b):r(b)}function G(b){return b===62?(A.consume(b),k):r(b)}function k(b){return b===null||SA(b)?K(b):VA(b)?(A.consume(b),k):r(b)}function K(b){return b===45&&l===2?(A.consume(b),L):b===60&&l===1?(A.consume(b),W):b===62&&l===4?(A.consume(b),N):b===63&&l===3?(A.consume(b),F):b===93&&l===5?(A.consume(b),pA):SA(b)&&(l===6||l===7)?(A.exit("htmlFlowData"),A.check(fU,J,eA)(b)):b===null||SA(b)?(A.exit("htmlFlowData"),eA(b)):(A.consume(b),K)}function eA(b){return A.check(dU,aA,J)(b)}function aA(b){return A.enter("lineEnding"),A.consume(b),A.exit("lineEnding"),tA}function tA(b){return b===null||SA(b)?eA(b):(A.enter("htmlFlowData"),K(b))}function L(b){return b===45?(A.consume(b),F):K(b)}function W(b){return b===47?(A.consume(b),u="",q):K(b)}function q(b){if(b===62){const lA=u.toLowerCase();return vm.includes(lA)?(A.consume(b),N):K(b)}return ln(b)&&u.length<8?(A.consume(b),u+=String.fromCharCode(b),q):K(b)}function pA(b){return b===93?(A.consume(b),F):K(b)}function F(b){return b===62?(A.consume(b),N):b===45&&l===2?(A.consume(b),F):K(b)}function N(b){return b===null||SA(b)?(A.exit("htmlFlowData"),J(b)):(A.consume(b),N)}function J(b){return A.exit("htmlFlow"),n(b)}}function BU(A,n,r){const i=this;return l;function l(u){return SA(u)?(A.enter("lineEnding"),A.consume(u),A.exit("lineEnding"),s):r(u)}function s(u){return i.parser.lazy[i.now().line]?r(u):n(u)}}function pU(A,n,r){return i;function i(l){return A.enter("lineEnding"),A.consume(l),A.exit("lineEnding"),A.attempt(ws,n,r)}}const mU={name:"htmlText",tokenize:CU};function CU(A,n,r){const i=this;let l,s,u;return c;function c(F){return A.enter("htmlText"),A.enter("htmlTextData"),A.consume(F),f}function f(F){return F===33?(A.consume(F),h):F===47?(A.consume(F),$):F===63?(A.consume(F),D):ln(F)?(A.consume(F),R):r(F)}function h(F){return F===45?(A.consume(F),B):F===91?(A.consume(F),s=0,Q):ln(F)?(A.consume(F),H):r(F)}function B(F){return F===45?(A.consume(F),C):r(F)}function p(F){return F===null?r(F):F===45?(A.consume(F),m):SA(F)?(u=p,W(F)):(A.consume(F),p)}function m(F){return F===45?(A.consume(F),C):p(F)}function C(F){return F===62?L(F):F===45?m(F):p(F)}function Q(F){const N="CDATA[";return F===N.charCodeAt(s++)?(A.consume(F),s===N.length?E:Q):r(F)}function E(F){return F===null?r(F):F===93?(A.consume(F),T):SA(F)?(u=E,W(F)):(A.consume(F),E)}function T(F){return F===93?(A.consume(F),S):E(F)}function S(F){return F===62?L(F):F===93?(A.consume(F),S):E(F)}function H(F){return F===null||F===62?L(F):SA(F)?(u=H,W(F)):(A.consume(F),H)}function D(F){return F===null?r(F):F===63?(A.consume(F),Y):SA(F)?(u=D,W(F)):(A.consume(F),D)}function Y(F){return F===62?L(F):D(F)}function $(F){return ln(F)?(A.consume(F),U):r(F)}function U(F){return F===45||Et(F)?(A.consume(F),U):_(F)}function _(F){return SA(F)?(u=_,W(F)):VA(F)?(A.consume(F),_):L(F)}function R(F){return F===45||Et(F)?(A.consume(F),R):F===47||F===62||ut(F)?O(F):r(F)}function O(F){return F===47?(A.consume(F),L):F===58||F===95||ln(F)?(A.consume(F),G):SA(F)?(u=O,W(F)):VA(F)?(A.consume(F),O):L(F)}function G(F){return F===45||F===46||F===58||F===95||Et(F)?(A.consume(F),G):k(F)}function k(F){return F===61?(A.consume(F),K):SA(F)?(u=k,W(F)):VA(F)?(A.consume(F),k):O(F)}function K(F){return F===null||F===60||F===61||F===62||F===96?r(F):F===34||F===39?(A.consume(F),l=F,eA):SA(F)?(u=K,W(F)):VA(F)?(A.consume(F),K):(A.consume(F),aA)}function eA(F){return F===l?(A.consume(F),l=void 0,tA):F===null?r(F):SA(F)?(u=eA,W(F)):(A.consume(F),eA)}function aA(F){return F===null||F===34||F===39||F===60||F===61||F===96?r(F):F===47||F===62||ut(F)?O(F):(A.consume(F),aA)}function tA(F){return F===47||F===62||ut(F)?O(F):r(F)}function L(F){return F===62?(A.consume(F),A.exit("htmlTextData"),A.exit("htmlText"),n):r(F)}function W(F){return A.exit("htmlTextData"),A.enter("lineEnding"),A.consume(F),A.exit("lineEnding"),q}function q(F){return VA(F)?le(A,pA,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):pA(F)}function pA(F){return A.enter("htmlTextData"),u(F)}}const Vc={name:"labelEnd",resolveAll:vU,resolveTo:QU,tokenize:bU},wU={tokenize:UU},yU={tokenize:SU},EU={tokenize:xU};function vU(A){let n=-1;const r=[];for(;++n<A.length;){const i=A[n][1];if(r.push(A[n]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const l=i.type==="labelImage"?4:2;i.type="data",n+=l}}return A.length!==r.length&&an(A,0,A.length,r),A}function QU(A,n){let r=A.length,i=0,l,s,u,c;for(;r--;)if(l=A[r][1],s){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;A[r][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(u){if(A[r][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(s=r,l.type!=="labelLink")){i=2;break}}else l.type==="labelEnd"&&(u=r);const f={type:A[s][1].type==="labelLink"?"link":"image",start:{...A[s][1].start},end:{...A[A.length-1][1].end}},h={type:"label",start:{...A[s][1].start},end:{...A[u][1].end}},B={type:"labelText",start:{...A[s+i+2][1].end},end:{...A[u-2][1].start}};return c=[["enter",f,n],["enter",h,n]],c=It(c,A.slice(s+1,s+i+3)),c=It(c,[["enter",B,n]]),c=It(c,zc(n.parser.constructs.insideSpan.null,A.slice(s+i+4,u-3),n)),c=It(c,[["exit",B,n],A[u-2],A[u-1],["exit",h,n]]),c=It(c,A.slice(u+1)),c=It(c,[["exit",f,n]]),an(A,s,A.length,c),A}function bU(A,n,r){const i=this;let l=i.events.length,s,u;for(;l--;)if((i.events[l][1].type==="labelImage"||i.events[l][1].type==="labelLink")&&!i.events[l][1]._balanced){s=i.events[l][1];break}return c;function c(m){return s?s._inactive?p(m):(u=i.parser.defined.includes(pi(i.sliceSerialize({start:s.end,end:i.now()}))),A.enter("labelEnd"),A.enter("labelMarker"),A.consume(m),A.exit("labelMarker"),A.exit("labelEnd"),f):r(m)}function f(m){return m===40?A.attempt(wU,B,u?B:p)(m):m===91?A.attempt(yU,B,u?h:p)(m):u?B(m):p(m)}function h(m){return A.attempt(EU,B,p)(m)}function B(m){return n(m)}function p(m){return s._balanced=!0,r(m)}}function UU(A,n,r){return i;function i(p){return A.enter("resource"),A.enter("resourceMarker"),A.consume(p),A.exit("resourceMarker"),l}function l(p){return ut(p)?za(A,s)(p):s(p)}function s(p){return p===41?B(p):wm(A,u,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function u(p){return ut(p)?za(A,f)(p):B(p)}function c(p){return r(p)}function f(p){return p===34||p===39||p===40?Em(A,h,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):B(p)}function h(p){return ut(p)?za(A,B)(p):B(p)}function B(p){return p===41?(A.enter("resourceMarker"),A.consume(p),A.exit("resourceMarker"),A.exit("resource"),n):r(p)}}function SU(A,n,r){const i=this;return l;function l(c){return ym.call(i,A,s,u,"reference","referenceMarker","referenceString")(c)}function s(c){return i.parser.defined.includes(pi(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?n(c):r(c)}function u(c){return r(c)}}function xU(A,n,r){return i;function i(s){return A.enter("reference"),A.enter("referenceMarker"),A.consume(s),A.exit("referenceMarker"),l}function l(s){return s===93?(A.enter("referenceMarker"),A.consume(s),A.exit("referenceMarker"),A.exit("reference"),n):r(s)}}const FU={name:"labelStartImage",resolveAll:Vc.resolveAll,tokenize:TU};function TU(A,n,r){const i=this;return l;function l(c){return A.enter("labelImage"),A.enter("labelImageMarker"),A.consume(c),A.exit("labelImageMarker"),s}function s(c){return c===91?(A.enter("labelMarker"),A.consume(c),A.exit("labelMarker"),A.exit("labelImage"),u):r(c)}function u(c){return c===94&&"_hiddenFootnoteSupport"in i.parser.constructs?r(c):n(c)}}const HU={name:"labelStartLink",resolveAll:Vc.resolveAll,tokenize:IU};function IU(A,n,r){const i=this;return l;function l(u){return A.enter("labelLink"),A.enter("labelMarker"),A.consume(u),A.exit("labelMarker"),A.exit("labelLink"),s}function s(u){return u===94&&"_hiddenFootnoteSupport"in i.parser.constructs?r(u):n(u)}}const Pc={name:"lineEnding",tokenize:NU};function NU(A,n){return r;function r(i){return A.enter("lineEnding"),A.consume(i),A.exit("lineEnding"),le(A,n,"linePrefix")}}const ys={name:"thematicBreak",tokenize:_U};function _U(A,n,r){let i=0,l;return s;function s(h){return A.enter("thematicBreak"),u(h)}function u(h){return l=h,c(h)}function c(h){return h===l?(A.enter("thematicBreakSequence"),f(h)):i>=3&&(h===null||SA(h))?(A.exit("thematicBreak"),n(h)):r(h)}function f(h){return h===l?(A.consume(h),i++,f):(A.exit("thematicBreakSequence"),VA(h)?le(A,c,"whitespace")(h):c(h))}}const ct={continuation:{tokenize:MU},exit:kU,name:"list",tokenize:LU},RU={partial:!0,tokenize:KU},OU={partial:!0,tokenize:DU};function LU(A,n,r){const i=this,l=i.events[i.events.length-1];let s=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,u=0;return c;function c(C){const Q=i.containerState.type||(C===42||C===43||C===45?"listUnordered":"listOrdered");if(Q==="listUnordered"?!i.containerState.marker||C===i.containerState.marker:Kc(C)){if(i.containerState.type||(i.containerState.type=Q,A.enter(Q,{_container:!0})),Q==="listUnordered")return A.enter("listItemPrefix"),C===42||C===45?A.check(ys,r,h)(C):h(C);if(!i.interrupt||C===49)return A.enter("listItemPrefix"),A.enter("listItemValue"),f(C)}return r(C)}function f(C){return Kc(C)&&++u<10?(A.consume(C),f):(!i.interrupt||u<2)&&(i.containerState.marker?C===i.containerState.marker:C===41||C===46)?(A.exit("listItemValue"),h(C)):r(C)}function h(C){return A.enter("listItemMarker"),A.consume(C),A.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||C,A.check(ws,i.interrupt?r:B,A.attempt(RU,m,p))}function B(C){return i.containerState.initialBlankLine=!0,s++,m(C)}function p(C){return VA(C)?(A.enter("listItemPrefixWhitespace"),A.consume(C),A.exit("listItemPrefixWhitespace"),m):r(C)}function m(C){return i.containerState.size=s+i.sliceSerialize(A.exit("listItemPrefix"),!0).length,n(C)}}function MU(A,n,r){const i=this;return i.containerState._closeFlow=void 0,A.check(ws,l,s);function l(c){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,le(A,n,"listItemIndent",i.containerState.size+1)(c)}function s(c){return i.containerState.furtherBlankLines||!VA(c)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,u(c)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,A.attempt(OU,n,u)(c))}function u(c){return i.containerState._closeFlow=!0,i.interrupt=void 0,le(A,A.attempt(ct,n,r),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function DU(A,n,r){const i=this;return le(A,l,"listItemIndent",i.containerState.size+1);function l(s){const u=i.events[i.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===i.containerState.size?n(s):r(s)}}function kU(A){A.exit(this.containerState.type)}function KU(A,n,r){const i=this;return le(A,l,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(s){const u=i.events[i.events.length-1];return!VA(s)&&u&&u[1].type==="listItemPrefixWhitespace"?n(s):r(s)}}const Qm={name:"setextUnderline",resolveTo:zU,tokenize:jU};function zU(A,n){let r=A.length,i,l,s;for(;r--;)if(A[r][0]==="enter"){if(A[r][1].type==="content"){i=r;break}A[r][1].type==="paragraph"&&(l=r)}else A[r][1].type==="content"&&A.splice(r,1),!s&&A[r][1].type==="definition"&&(s=r);const u={type:"setextHeading",start:{...A[i][1].start},end:{...A[A.length-1][1].end}};return A[l][1].type="setextHeadingText",s?(A.splice(l,0,["enter",u,n]),A.splice(s+1,0,["exit",A[i][1],n]),A[i][1].end={...A[s][1].end}):A[i][1]=u,A.push(["exit",u,n]),A}function jU(A,n,r){const i=this;let l;return s;function s(h){let B=i.events.length,p;for(;B--;)if(i.events[B][1].type!=="lineEnding"&&i.events[B][1].type!=="linePrefix"&&i.events[B][1].type!=="content"){p=i.events[B][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||p)?(A.enter("setextHeadingLine"),l=h,u(h)):r(h)}function u(h){return A.enter("setextHeadingLineSequence"),c(h)}function c(h){return h===l?(A.consume(h),c):(A.exit("setextHeadingLineSequence"),VA(h)?le(A,f,"lineSuffix")(h):f(h))}function f(h){return h===null||SA(h)?(A.exit("setextHeadingLine"),n(h)):r(h)}}const GU={tokenize:VU};function VU(A){const n=this,r=A.attempt(ws,i,A.attempt(this.parser.constructs.flowInitial,l,le(A,A.attempt(this.parser.constructs.flow,l,A.attempt(J2,l)),"linePrefix")));return r;function i(s){if(s===null){A.consume(s);return}return A.enter("lineEndingBlank"),A.consume(s),A.exit("lineEndingBlank"),n.currentConstruct=void 0,r}function l(s){if(s===null){A.consume(s);return}return A.enter("lineEnding"),A.consume(s),A.exit("lineEnding"),n.currentConstruct=void 0,r}}const PU={resolveAll:Um()},YU=bm("string"),XU=bm("text");function bm(A){return{resolveAll:Um(A==="text"?qU:void 0),tokenize:n};function n(r){const i=this,l=this.parser.constructs[A],s=r.attempt(l,u,c);return u;function u(B){return h(B)?s(B):c(B)}function c(B){if(B===null){r.consume(B);return}return r.enter("data"),r.consume(B),f}function f(B){return h(B)?(r.exit("data"),s(B)):(r.consume(B),f)}function h(B){if(B===null)return!0;const p=l[B];let m=-1;if(p)for(;++m<p.length;){const C=p[m];if(!C.previous||C.previous.call(i,i.previous))return!0}return!1}}}function Um(A){return n;function n(r,i){let l=-1,s;for(;++l<=r.length;)s===void 0?r[l]&&r[l][1].type==="data"&&(s=l,l++):(!r[l]||r[l][1].type!=="data")&&(l!==s+2&&(r[s][1].end=r[l-1][1].end,r.splice(s+2,l-s-2),l=s+2),s=void 0);return A?A(r,i):r}}function qU(A,n){let r=0;for(;++r<=A.length;)if((r===A.length||A[r][1].type==="lineEnding")&&A[r-1][1].type==="data"){const i=A[r-1][1],l=n.sliceStream(i);let s=l.length,u=-1,c=0,f;for(;s--;){const h=l[s];if(typeof h=="string"){for(u=h.length;h.charCodeAt(u-1)===32;)c++,u--;if(u)break;u=-1}else if(h===-2)f=!0,c++;else if(h!==-1){s++;break}}if(n._contentTypeTextTrailing&&r===A.length&&(c=0),c){const h={type:r===A.length||f||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?u:i.start._bufferIndex+u,_index:i.start._index+s,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):(A.splice(r,0,["enter",h,n],["exit",h,n]),r+=2)}r++}return A}const JU=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:eU},disable:{null:[]},document:{42:ct,43:ct,45:ct,48:ct,49:ct,50:ct,51:ct,52:ct,53:ct,54:ct,55:ct,56:ct,57:ct,62:hm},flow:{35:lU,42:ys,45:[Qm,ys],60:cU,61:Qm,95:ys,96:mm,126:mm},flowInitial:{[-2]:Gc,[-1]:Gc,32:Gc},insideSpan:{null:[jc,PU]},string:{38:Bm,92:gm},text:{[-5]:Pc,[-4]:Pc,[-3]:Pc,33:FU,38:Bm,42:jc,60:[H2,mU],91:HU,92:[iU,gm],93:Vc,95:jc,96:G2}},Symbol.toStringTag,{value:"Module"}));function ZU(A,n,r){let i={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const l={},s=[];let u=[],c=[];const f={attempt:_($),check:_(U),consume:H,enter:D,exit:Y,interrupt:_(U,{interrupt:!0})},h={code:null,containerState:{},defineSkip:E,events:[],now:Q,parser:A,previous:null,sliceSerialize:m,sliceStream:C,write:p};let B=n.tokenize.call(h,f);return n.resolveAll&&s.push(n),h;function p(k){return u=It(u,k),T(),u[u.length-1]!==null?[]:(R(n,0),h.events=zc(s,h.events,h),h.events)}function m(k,K){return $U(C(k),K)}function C(k){return WU(u,k)}function Q(){const{_bufferIndex:k,_index:K,line:eA,column:aA,offset:tA}=i;return{_bufferIndex:k,_index:K,line:eA,column:aA,offset:tA}}function E(k){l[k.line]=k.column,G()}function T(){let k;for(;i._index<u.length;){const K=u[i._index];if(typeof K=="string")for(k=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===k&&i._bufferIndex<K.length;)S(K.charCodeAt(i._bufferIndex));else S(K)}}function S(k){B=B(k)}function H(k){SA(k)?(i.line++,i.column=1,i.offset+=k===-3?2:1,G()):k!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===u[i._index].length&&(i._bufferIndex=-1,i._index++)),h.previous=k}function D(k,K){const eA=K||{};return eA.type=k,eA.start=Q(),h.events.push(["enter",eA,h]),c.push(eA),eA}function Y(k){const K=c.pop();return K.end=Q(),h.events.push(["exit",K,h]),K}function $(k,K){R(k,K.from)}function U(k,K){K.restore()}function _(k,K){return eA;function eA(aA,tA,L){let W,q,pA,F;return Array.isArray(aA)?J(aA):"tokenize"in aA?J([aA]):N(aA);function N(fA){return hA;function hA(NA){const _A=NA!==null&&fA[NA],XA=NA!==null&&fA.null,Me=[...Array.isArray(_A)?_A:_A?[_A]:[],...Array.isArray(XA)?XA:XA?[XA]:[]];return J(Me)(NA)}}function J(fA){return W=fA,q=0,fA.length===0?L:b(fA[q])}function b(fA){return hA;function hA(NA){return F=O(),pA=fA,fA.partial||(h.currentConstruct=fA),fA.name&&h.parser.constructs.disable.null.includes(fA.name)?dA():fA.tokenize.call(K?Object.assign(Object.create(h),K):h,f,lA,dA)(NA)}}function lA(fA){return k(pA,F),tA}function dA(fA){return F.restore(),++q<W.length?b(W[q]):L}}}function R(k,K){k.resolveAll&&!s.includes(k)&&s.push(k),k.resolve&&an(h.events,K,h.events.length-K,k.resolve(h.events.slice(K),h)),k.resolveTo&&(h.events=k.resolveTo(h.events,h))}function O(){const k=Q(),K=h.previous,eA=h.currentConstruct,aA=h.events.length,tA=Array.from(c);return{from:aA,restore:L};function L(){i=k,h.previous=K,h.currentConstruct=eA,h.events.length=aA,c=tA,G()}}function G(){i.line in l&&i.column<2&&(i.column=l[i.line],i.offset+=l[i.line]-1)}}function WU(A,n){const r=n.start._index,i=n.start._bufferIndex,l=n.end._index,s=n.end._bufferIndex;let u;if(r===l)u=[A[r].slice(i,s)];else{if(u=A.slice(r,l),i>-1){const c=u[0];typeof c=="string"?u[0]=c.slice(i):u.shift()}s>0&&u.push(A[l].slice(0,s))}return u}function $U(A,n){let r=-1;const i=[];let l;for(;++r<A.length;){const s=A[r];let u;if(typeof s=="string")u=s;else switch(s){case-5:{u="\r";break}case-4:{u=`
48
48
  `;break}case-3:{u=`\r
49
49
  `;break}case-2:{u=n?" ":" ";break}case-1:{if(!n&&l)continue;u=" ";break}default:u=String.fromCharCode(s)}l=s===-2,i.push(u)}return i.join("")}function AS(A){const i={constructs:B2([JU,...(A||{}).extensions||[]]),content:l(Q2),defined:[],document:l(U2),flow:l(GU),lazy:{},string:l(YU),text:l(XU)};return i;function l(s){return u;function u(c){return ZU(i,s,c)}}}function eS(A){for(;!Cm(A););return A}const Sm=/[\0\t\n\r]/g;function tS(){let A=1,n="",r=!0,i;return l;function l(s,u,c){const f=[];let h,B,p,m,C;for(s=n+(typeof s=="string"?s.toString():new TextDecoder(u||void 0).decode(s)),p=0,n="",r&&(s.charCodeAt(0)===65279&&p++,r=void 0);p<s.length;){if(Sm.lastIndex=p,h=Sm.exec(s),m=h&&h.index!==void 0?h.index:s.length,C=s.charCodeAt(m),!h){n=s.slice(p);break}if(C===10&&p===m&&i)f.push(-3),i=void 0;else switch(i&&(f.push(-5),i=void 0),p<m&&(f.push(s.slice(p,m)),A+=m-p),C){case 0:{f.push(65533),A++;break}case 9:{for(B=Math.ceil(A/4)*4,f.push(-2);A++<B;)f.push(-1);break}case 10:{f.push(-4),A=1;break}default:i=!0,A=1}p=m+1}return c&&(i&&f.push(-5),n&&f.push(n),f.push(null)),f}}const nS=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function rS(A){return A.replace(nS,iS)}function iS(A,n,r){if(n)return n;if(r.charCodeAt(0)===35){const l=r.charCodeAt(1),s=l===120||l===88;return um(r.slice(s?2:1),s?16:10)}return Dc(r)||A}const xm={}.hasOwnProperty;function aS(A,n,r){return typeof n!="string"&&(r=n,n=void 0),lS(r)(eS(AS(r).document().write(tS()(A,n,!0))))}function lS(A){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(De),autolinkProtocol:O,autolinkEmail:O,atxHeading:s(fn),blockQuote:s(XA),characterEscape:O,characterReference:O,codeFenced:s(Me),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:s(Me,u),codeText:s(Re,u),codeTextData:O,data:O,codeFlowValue:O,definition:s(sr),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:s(et),hardBreakEscape:s(dn),hardBreakTrailing:s(dn),htmlFlow:s(re,u),htmlFlowData:O,htmlText:s(re,u),htmlTextData:O,image:s(ge),label:u,link:s(De),listItem:s(or),listItemValue:m,listOrdered:s(Lt,p),listUnordered:s(Lt),paragraph:s(Qo),reference:b,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:s(fn),strong:s(bo),thematicBreak:s(oA)},exit:{atxHeading:f(),atxHeadingSequence:$,autolink:f(),autolinkEmail:_A,autolinkProtocol:NA,blockQuote:f(),characterEscapeValue:G,characterReferenceMarkerHexadecimal:dA,characterReferenceMarkerNumeric:dA,characterReferenceValue:fA,characterReference:hA,codeFenced:f(T),codeFencedFence:E,codeFencedFenceInfo:C,codeFencedFenceMeta:Q,codeFlowValue:G,codeIndented:f(S),codeText:f(tA),codeTextData:G,data:G,definition:f(),definitionDestinationString:Y,definitionLabelString:H,definitionTitleString:D,emphasis:f(),hardBreakEscape:f(K),hardBreakTrailing:f(K),htmlFlow:f(eA),htmlFlowData:G,htmlText:f(aA),htmlTextData:G,image:f(W),label:pA,labelText:q,lineEnding:k,link:f(L),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:lA,resourceDestinationString:F,resourceTitleString:N,resource:J,setextHeading:f(R),setextHeadingLineSequence:_,setextHeadingText:U,strong:f(),thematicBreak:f()}};Fm(n,(A||{}).mdastExtensions||[]);const r={};return i;function i(z){let nA={type:"root",children:[]};const cA={stack:[nA],tokenStack:[],config:n,enter:c,exit:h,buffer:u,resume:B,data:r},yA=[];let xA=-1;for(;++xA<z.length;)if(z[xA][1].type==="listOrdered"||z[xA][1].type==="listUnordered")if(z[xA][0]==="enter")yA.push(xA);else{const Be=yA.pop();xA=l(z,Be,xA)}for(xA=-1;++xA<z.length;){const Be=n[z[xA][0]];xm.call(Be,z[xA][1].type)&&Be[z[xA][1].type].call(Object.assign({sliceSerialize:z[xA][2].sliceSerialize},cA),z[xA][1])}if(cA.tokenStack.length>0){const Be=cA.tokenStack[cA.tokenStack.length-1];(Be[1]||Tm).call(cA,void 0,Be[0])}for(nA.position={start:Zn(z.length>0?z[0][1].start:{line:1,column:1,offset:0}),end:Zn(z.length>0?z[z.length-2][1].end:{line:1,column:1,offset:0})},xA=-1;++xA<n.transforms.length;)nA=n.transforms[xA](nA)||nA;return nA}function l(z,nA,cA){let yA=nA-1,xA=-1,Be=!1,tt,ve,qA,pe;for(;++yA<=cA;){const zA=z[yA];switch(zA[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{zA[0]==="enter"?xA++:xA--,pe=void 0;break}case"lineEndingBlank":{zA[0]==="enter"&&(tt&&!pe&&!xA&&!qA&&(qA=yA),pe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:pe=void 0}if(!xA&&zA[0]==="enter"&&zA[1].type==="listItemPrefix"||xA===-1&&zA[0]==="exit"&&(zA[1].type==="listUnordered"||zA[1].type==="listOrdered")){if(tt){let Wt=yA;for(ve=void 0;Wt--;){const JA=z[Wt];if(JA[1].type==="lineEnding"||JA[1].type==="lineEndingBlank"){if(JA[0]==="exit")continue;ve&&(z[ve][1].type="lineEndingBlank",Be=!0),JA[1].type="lineEnding",ve=Wt}else if(!(JA[1].type==="linePrefix"||JA[1].type==="blockQuotePrefix"||JA[1].type==="blockQuotePrefixWhitespace"||JA[1].type==="blockQuoteMarker"||JA[1].type==="listItemIndent"))break}qA&&(!ve||qA<ve)&&(tt._spread=!0),tt.end=Object.assign({},ve?z[ve][1].start:zA[1].end),z.splice(ve||yA,0,["exit",tt,zA[2]]),yA++,cA++}if(zA[1].type==="listItemPrefix"){const Wt={type:"listItem",_spread:!1,start:Object.assign({},zA[1].start),end:void 0};tt=Wt,z.splice(yA,0,["enter",Wt,zA[2]]),yA++,cA++,qA=void 0,pe=!0}}}return z[nA][1]._spread=Be,cA}function s(z,nA){return cA;function cA(yA){c.call(this,z(yA),yA),nA&&nA.call(this,yA)}}function u(){this.stack.push({type:"fragment",children:[]})}function c(z,nA,cA){this.stack[this.stack.length-1].children.push(z),this.stack.push(z),this.tokenStack.push([nA,cA||void 0]),z.position={start:Zn(nA.start),end:void 0}}function f(z){return nA;function nA(cA){z&&z.call(this,cA),h.call(this,cA)}}function h(z,nA){const cA=this.stack.pop(),yA=this.tokenStack.pop();if(yA)yA[0].type!==z.type&&(nA?nA.call(this,z,yA[0]):(yA[1]||Tm).call(this,z,yA[0]));else throw new Error("Cannot close `"+z.type+"` ("+Da({start:z.start,end:z.end})+"): it’s not open");cA.position.end=Zn(z.end)}function B(){return h2(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function m(z){if(this.data.expectingFirstListItemValue){const nA=this.stack[this.stack.length-2];nA.start=Number.parseInt(this.sliceSerialize(z),10),this.data.expectingFirstListItemValue=void 0}}function C(){const z=this.resume(),nA=this.stack[this.stack.length-1];nA.lang=z}function Q(){const z=this.resume(),nA=this.stack[this.stack.length-1];nA.meta=z}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const z=this.resume(),nA=this.stack[this.stack.length-1];nA.value=z.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const z=this.resume(),nA=this.stack[this.stack.length-1];nA.value=z.replace(/(\r?\n|\r)$/g,"")}function H(z){const nA=this.resume(),cA=this.stack[this.stack.length-1];cA.label=nA,cA.identifier=pi(this.sliceSerialize(z)).toLowerCase()}function D(){const z=this.resume(),nA=this.stack[this.stack.length-1];nA.title=z}function Y(){const z=this.resume(),nA=this.stack[this.stack.length-1];nA.url=z}function $(z){const nA=this.stack[this.stack.length-1];if(!nA.depth){const cA=this.sliceSerialize(z).length;nA.depth=cA}}function U(){this.data.setextHeadingSlurpLineEnding=!0}function _(z){const nA=this.stack[this.stack.length-1];nA.depth=this.sliceSerialize(z).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function O(z){const cA=this.stack[this.stack.length-1].children;let yA=cA[cA.length-1];(!yA||yA.type!=="text")&&(yA=uA(),yA.position={start:Zn(z.start),end:void 0},cA.push(yA)),this.stack.push(yA)}function G(z){const nA=this.stack.pop();nA.value+=this.sliceSerialize(z),nA.position.end=Zn(z.end)}function k(z){const nA=this.stack[this.stack.length-1];if(this.data.atHardBreak){const cA=nA.children[nA.children.length-1];cA.position.end=Zn(z.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(nA.type)&&(O.call(this,z),G.call(this,z))}function K(){this.data.atHardBreak=!0}function eA(){const z=this.resume(),nA=this.stack[this.stack.length-1];nA.value=z}function aA(){const z=this.resume(),nA=this.stack[this.stack.length-1];nA.value=z}function tA(){const z=this.resume(),nA=this.stack[this.stack.length-1];nA.value=z}function L(){const z=this.stack[this.stack.length-1];if(this.data.inReference){const nA=this.data.referenceType||"shortcut";z.type+="Reference",z.referenceType=nA,delete z.url,delete z.title}else delete z.identifier,delete z.label;this.data.referenceType=void 0}function W(){const z=this.stack[this.stack.length-1];if(this.data.inReference){const nA=this.data.referenceType||"shortcut";z.type+="Reference",z.referenceType=nA,delete z.url,delete z.title}else delete z.identifier,delete z.label;this.data.referenceType=void 0}function q(z){const nA=this.sliceSerialize(z),cA=this.stack[this.stack.length-2];cA.label=rS(nA),cA.identifier=pi(nA).toLowerCase()}function pA(){const z=this.stack[this.stack.length-1],nA=this.resume(),cA=this.stack[this.stack.length-1];if(this.data.inReference=!0,cA.type==="link"){const yA=z.children;cA.children=yA}else cA.alt=nA}function F(){const z=this.resume(),nA=this.stack[this.stack.length-1];nA.url=z}function N(){const z=this.resume(),nA=this.stack[this.stack.length-1];nA.title=z}function J(){this.data.inReference=void 0}function b(){this.data.referenceType="collapsed"}function lA(z){const nA=this.resume(),cA=this.stack[this.stack.length-1];cA.label=nA,cA.identifier=pi(this.sliceSerialize(z)).toLowerCase(),this.data.referenceType="full"}function dA(z){this.data.characterReferenceType=z.type}function fA(z){const nA=this.sliceSerialize(z),cA=this.data.characterReferenceType;let yA;cA?(yA=um(nA,cA==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):yA=Dc(nA);const xA=this.stack[this.stack.length-1];xA.value+=yA}function hA(z){const nA=this.stack.pop();nA.position.end=Zn(z.end)}function NA(z){G.call(this,z);const nA=this.stack[this.stack.length-1];nA.url=this.sliceSerialize(z)}function _A(z){G.call(this,z);const nA=this.stack[this.stack.length-1];nA.url="mailto:"+this.sliceSerialize(z)}function XA(){return{type:"blockquote",children:[]}}function Me(){return{type:"code",lang:null,meta:null,value:""}}function Re(){return{type:"inlineCode",value:""}}function sr(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function et(){return{type:"emphasis",children:[]}}function fn(){return{type:"heading",depth:0,children:[]}}function dn(){return{type:"break"}}function re(){return{type:"html",value:""}}function ge(){return{type:"image",title:null,url:"",alt:null}}function De(){return{type:"link",title:null,url:"",children:[]}}function Lt(z){return{type:"list",ordered:z.type==="listOrdered",start:null,spread:z._spread,children:[]}}function or(z){return{type:"listItem",spread:z._spread,checked:null,children:[]}}function Qo(){return{type:"paragraph",children:[]}}function bo(){return{type:"strong",children:[]}}function uA(){return{type:"text",value:""}}function oA(){return{type:"thematicBreak"}}}function Zn(A){return{line:A.line,column:A.column,offset:A.offset}}function Fm(A,n){let r=-1;for(;++r<n.length;){const i=n[r];Array.isArray(i)?Fm(A,i):sS(A,i)}}function sS(A,n){let r;for(r in n)if(xm.call(n,r))switch(r){case"canContainEols":{const i=n[r];i&&A[r].push(...i);break}case"transforms":{const i=n[r];i&&A[r].push(...i);break}case"enter":case"exit":{const i=n[r];i&&Object.assign(A[r],i);break}}}function Tm(A,n){throw A?new Error("Cannot close `"+A.type+"` ("+Da({start:A.start,end:A.end})+"): a different token (`"+n.type+"`, "+Da({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Da({start:n.start,end:n.end})+") is still open")}function oS(A){const n=this;n.parser=r;function r(i){return aS(i,{...n.data("settings"),...A,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function uS(A,n){const r={type:"element",tagName:"blockquote",properties:{},children:A.wrap(A.all(n),!0)};return A.patch(n,r),A.applyData(n,r)}function cS(A,n){const r={type:"element",tagName:"br",properties:{},children:[]};return A.patch(n,r),[A.applyData(n,r),{type:"text",value:`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eka-care/medassist-widget",
3
3
  "description": "MedAssist Widget react application",
4
- "version": "0.0.99",
4
+ "version": "0.1.00",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"