1import{n as e,r as t,t as n}from"./rolldown-runtime-hePW80VL.js";import{B as r}from"./utils-BlvXUAK9.js";import{_ as i,t as a}from"./jsx-runtime-CbkpsQZ0.js";import{A as o,F as s,G as c,H as l,I as u,L as d,R as f,V as p,a as m,g as h,i as g,m as _,n as v,o as y,p as b,r as x,s as S,t as C,u as w,z as T}from"./Text-DjqRmEnZ.js";import{A as E,D,O,n as ee,o as k,t as te}from"./Popover-PX3YVywJ.js";import{a as ne,i as re}from"./VisuallyHidden-BC1yYl6X.js";import{a as ie,n as A,o as ae}from"./SegmentedControl-CgChbL2W.js";import{a as j}from"./InlineInput-D4U5REA1.js";import{a as M,g as oe,h as se,i as ce,n as N,o as le,r as ue,t as de}from"./Modal-BvWjsY2l.js";import{n as fe}from"./Title-BP2UPT5s.js";import{t as pe}from"./use-id-DoleCFCx.js";import{n as me,t as P}from"./Button-BlPb0QvD.js";import{C as he,S as ge,a as _e,f as ve,g as ye,i as be,p as xe,u as Se}from"./inputs-DNB4wUAw.js";import{r as Ce}from"./use-merged-ref-D2IJVWkB.js";import{n as we,t as F}from"./Group-C9hsIZXt.js";import{t as Te}from"./use-disclosure-BlhxO3WE.js";import{a as Ee,i as De,o as Oe,r as ke,t as Ae}from"./events-D-RIpHhU.js";import{t as je}from"./use-resolved-styles-api-Cj1vI6Uy.js";import{n as I,t as Me}from"./Tooltip-DdqKe480.js";import{t as L}from"./Paper-DksCIqPr.js";import{t as Ne}from"./ActionIcon-4PwUaTv_.js";import{t as Pe}from"./CloseButton-Y8GDFeHl.js";import{n as Fe}from"./Input-tPqG2Pc7.js";import{n as Ie,r as Le,t as Re}from"./use-form-gcOMQhdA.js";import{t as R}from"./Stack-Coq64YNZ.js";import{t as ze}from"./Alert-7bOzZ-SG.js";import{t as Be}from"./Anchor-DzRN6-16.js";import{_ as Ve,a as He,d as Ue,g as z,h as We,s as Ge,v as Ke,y as qe}from"./data-UmTHumKF.js";import{t as Je}from"./Center-qxd5H97i.js";import{i as Ye,n as Xe,r as Ze,t as Qe}from"./IconTrash-CHlNmt51.js";import{t as $e}from"./Image-CkZ9rptq.js";import{n as et,o as tt,r as nt}from"./helper-D9NymF7L.js";import{a as rt,n as it,o as at,v as ot}from"./QueryClientProvider-BBm4PAeV.js";import{i as st,n as ct,t as B}from"./axios-Ck6tlWK1.js";import{t as V}from"./createReactComponent-DjXh-NdD.js";import{t as lt}from"./IconInfoCircle-KJIjvkZJ.js";import{t as ut}from"./IconMail-vXrpiH0O.js";import{i as dt,n as H}from"./auth-DBmGJeXl.js";var U=t(r(),1);function W(e={}){let t=e.timeout??2e3,[n,r]=(0,U.useState)(null),[i,a]=(0,U.useState)(!1),o=(0,U.useRef)(null);(0,U.useEffect)(()=>()=>{window.clearTimeout(o.current)},[]);let s=e=>{window.clearTimeout(o.current),o.current=window.setTimeout(()=>a(!1),t),a(e)};return{copy:e=>{`clipboard`in navigator?navigator.clipboard.writeText(e).then(()=>{r(null),s(!0)}).catch(e=>r(e)):r(Error(`useClipboard: navigator.clipboard is not supported`))},reset:()=>{a(!1),r(null),window.clearTimeout(o.current)},error:n,copied:i}}function ft(e){return ge(`localStorage`,`use-local-storage`)(e)}he(`localStorage`);function pt(e,t){let n=t-e+1;return Array.from({length:n},(t,n)=>n+e)}var mt=`dots`;function ht({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:i,onChange:a,startValue:o=1}){let s=Math.max(Math.trunc(o),1),c=Math.max(Math.trunc(e),s),l=c-s+1,u=i??s,[d,f]=we({value:r,onChange:a,defaultValue:u,finalValue:u}),p=(0,U.useCallback)(e=>{f(e<s?s:e>c?c:e)},[s,c,f]),m=(0,U.useCallback)(()=>p(d+1),[d,p]),h=(0,U.useCallback)(()=>p(d-1),[d,p]),g=(0,U.useCallback)(()=>p(s),[p,s]),_=(0,U.useCallback)(()=>p(c),[c,p]);return{range:(0,U.useMemo)(()=>{if(t*2+3+n*2>=l)return pt(s,c);let e=Math.max(d-t,s+n-1),r=Math.min(d+t,c-n),i=e>s+n+1,a=r<c-n;if(!i&&a){let e=t*2+n+2;return[...pt(s,s+e-1),mt,...pt(c-(n-1),c)]}if(i&&!a){let e=n+1+2*t;return[...pt(s,s+n-1),mt,...pt(c-e,c)]}return[...pt(s,s+n-1),mt,...pt(e,r),mt,...pt(c-n+1,c)]},[l,t,d,s,c,n]),active:d,setPage:p,next:m,previous:h,first:g,last:_}}function gt(e){let t=(0,U.useRef)(void 0);return(0,U.useEffect)(()=>{t.current=e},[e]),t.current}var G=a();function _t(e){return typeof e==`string`?{value:e,label:e}:typeof e==`object`&&`value`in e&&!(`label`in e)?{value:e.value,label:`${e.value}`,disabled:e.disabled}:typeof e==`object`&&`group`in e?{group:e.group,items:e.items.map(e=>_t(e))}:typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`?{value:e,label:`${e}`}:e}function vt(e){return e?e.map(e=>_t(e)):[]}function yt(e){return e.reduce((e,t)=>
1`group`in t?{...e,...yt(t.items)}:(e[`${t.value}`]=t,e),{})}function bt(e){return`group`in e}function xt({options:e,search:t,limit:n}){let r=t.trim().toLowerCase(),i=[];for(let a=0;a<e.length;a+=1){let o=e[a];if(i.length===n)return i;bt(o)&&i.push({group:o.group,items:xt({options:o.items,search:t,limit:n-i.length})}),bt(o)||o.label.toLowerCase().includes(r)&&i.push(o)}return i}function St(e){if(e.length===0)return!0;for(let t of e)if(!(`group`in t)||t.items.length>0)return!1;return!0}function Ct(e,t=new Set){if(Array.isArray(e))for(let n of e)if(bt(n))Ct(n.items,t);else{if(n.value===void 0)throw Error(`[@mantine/core] Each option must have value property`);if(t.has(n.value))throw Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function wt(e,t){return Array.isArray(e)?e.includes(t):e===t}function Tt({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:a,renderOption:o}){if(!bt(e)){let c=wt(r,e.value),l=t&&(c?(0,G.jsx)(A,{className:le.optionsDropdownCheckIcon}):n?(0,G.jsx)(`div`,{className:le.optionsDropdownCheckPlaceholder}):null),u=(0,G.jsxs)(G.Fragment,{children:[i===`left`&&l,(0,G.jsx)(`span`,{children:e.label}),i===`right`&&l]});return(0,G.jsx)(N.Option,{value:e.value,disabled:e.disabled,className:s({[le.optionsDropdownOption]:!a}),"data-reverse":i===`right`||void 0,"data-checked":c||void 0,"aria-selected":c,active:c,children:typeof o==`function`?o({option:e,checked:c}):u})}let c=e.items.map(e=>(0,G.jsx)(Tt,{data:e,value:r,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:i,renderOption:o},`${e.value}`));return(0,G.jsx)(N.Group,{label:e.group,children:c})}function Et({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:a,maxDropdownHeight:o,floatingHeight:s,withScrollArea:c=!0,filterOptions:l=!0,withCheckIcon:u=!1,withAlignedLabels:d=!1,value:f,checkIconPosition:p,nothingFoundMessage:m,unstyled:h,labelId:g,renderOption:_,scrollAreaProps:v,"aria-label":y}){let b=M();Ct(e);let x=typeof i==`string`?(r||xt)({options:e,search:l?i:``,limit:a??1/0}):e,S=St(x),C=x.map((e,t)=>(0,G.jsx)(Tt,{data:e,withCheckIcon:u,withAlignedLabels:d,value:f,checkIconPosition:p,unstyled:h,renderOption:_},bt(e)?`group-${typeof e.group==`string`?e.group:t}`:`${e.value}`));return(0,G.jsx)(N.Dropdown,{hidden:t||n&&S,"data-composed":!0,children:(0,G.jsxs)(N.Options,{labelledBy:g,"aria-label":y,children:[c?(0,G.jsx)(se.Autosize,{mah:(s??b.floatingHeight)===`viewport`?`var(--combobox-floating-options-max-height)`:o??220,type:`scroll`,scrollbarSize:`var(--combobox-padding)`,offsetScrollbars:`y`,...v,children:C}):C,S&&m&&(0,G.jsx)(N.Empty,{children:m})]})})}function Dt(e,t,n,r){if(t===n||r===`before`&&n===t+1||r===`after`&&n===t-1)return e;let i=e.slice(),[a]=i.splice(t,1),o=t<n?n-1:n;return r===`after`&&(o+=1),i.splice(o,0,a),i}var Ot=e=>{let t=e.lastElementChild;return t?t instanceof HTMLInputElement?t:t.querySelector(`input`):null},kt=(e,t)=>{if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0};function At({value:e,onChange:t,enabled:n}){let r=(0,U.useRef)({draggedIndex:null,currentDropTarget:null}),i=(0,U.useRef)(null),a=(0,U.useRef)(null),o=(0,U.useRef)(e);o.current=e,(0,U.useEffect)(()=>{let e=i.current;e&&(i.current=null,kt(o.current,e.expectedValue)&&e.container?.querySelector(`[data-mantine-pill-index="${e.index}"]`)?.focus())});let s=(0,U.useCallback)(e=>{a.current=e},[]);return{getPillProps:e=>{if(n)return{draggable:!0,tabIndex:-1,"data-mantine-pill-index":e,"aria-keyshortcuts":`Alt+ArrowLeft Alt+ArrowRight`,onMouseDown:e=>{e.button===0&&e.stopPropagation()},onDragStart:t=>{t.stopPropagation(),t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,String(e)),r.current.draggedIndex=e;let n=t.currentTarget,i=n.getBoundingClientRect(),a=n.cloneNode(!0);a.removeAttribute(`data-dragging`),a.removeAttribute(`data-drag-over`),a.style.position=`fixed`,a.style.top=`-9999px`,a.style.left=`-9999px`,a.style.width=`${i.width}px`,a.style.height=`${i.height}px`,a.style.pointerEvents=`none`,document.body.appendChild(a),t.dataTransfer.setDragImage(a,t.clientX-i.left,t.clientY-i.top),setTimeout(()=>a.parentNode?.removeChild(a),0),requestAnimationFrame(()=>{n.setAttribute(`data-dragging`,`true`)})},onDragOver:t=>{let{draggedIndex:n}=r.current;if(n===null||n===e)return;let i=t.currentTarget,a=i.getBoundingClientRect(),o=t.clientX-a.left,s=(getComputedStyle(i).direction===`rtl`?o>a.width/2:o<a.width/2)?`before`:`after`;t.preventDefault(),t.stopPropagation(),t.dataTransfer.dropEffect=`move`;
1let c=r.current.currentDropTarget;c&&c!==i&&c.removeAttribute(`data-drag-over`),i.setAttribute(`data-drag-over`,s),r.current.currentDropTarget=i},onDragLeave:e=>{let t=e.currentTarget,n=e.relatedTarget;n&&t.contains(n)||(t.removeAttribute(`data-drag-over`),r.current.currentDropTarget===t&&(r.current.currentDropTarget=null))},onDrop:n=>{n.preventDefault(),n.stopPropagation();let i=n.currentTarget,a=i.getAttribute(`data-drag-over`);i.removeAttribute(`data-drag-over`);let{draggedIndex:s}=r.current;if(s!==null&&a&&s!==e){let n=Dt(o.current,s,e,a);n!==o.current&&t(n)}r.current.draggedIndex=null,r.current.currentDropTarget=null},onDragEnd:e=>{e.currentTarget.removeAttribute(`data-dragging`);let t=r.current.currentDropTarget;t&&t.removeAttribute(`data-drag-over`),r.current.draggedIndex=null,r.current.currentDropTarget=null},onKeyDown:n=>{if(n.key!==`ArrowLeft`&&n.key!==`ArrowRight`)return;let r=n.currentTarget,a=getComputedStyle(r).direction===`rtl`?n.key===`ArrowLeft`:n.key===`ArrowRight`,s=a?e+1:e-1;if(n.altKey){if(s<0||s>=o.current.length)return;n.preventDefault(),n.stopPropagation();let c=a?`after`:`before`,l=Dt(o.current,e,s,c);if(l===o.current)return;i.current={container:r.parentElement,index:s,expectedValue:l},t(l);return}if(s<0)return;let c=r.parentElement;if(c){if(n.preventDefault(),n.stopPropagation(),s>
1=o.current.length){Ot(c)?.focus();return}c.querySelector(`[data-mantine-pill-index="${s}"]`)?.focus()}}}},getListProps:()=>n?{ref:s}:{},handleInputKeyDown:e=>{if(!n||e.key!==`ArrowLeft`)return;let t=e.currentTarget;if(!(t.value.length===0||t.selectionStart===0&&t.selectionEnd===0))return;let r=a.current;if(!r)return;let i=r.querySelectorAll(`[data-mantine-pill-index]`);i.length!==0&&(e.preventDefault(),i[i.length-1].focus())}}}var jt={group:`m_11def92b`,root:`m_f85678b6`,image:`m_11f8ac07`,placeholder:`m_104cd71f`},Mt=(0,U.createContext)({withinGroup:!1}),Nt=u((e,{spacing:t})=>({group:{"--ag-spacing":l(t)}})),Pt=m(e=>{let t=_(`AvatarGroup`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,spacing:c,attributes:l,...u}=t,d=b({name:`AvatarGroup`,classes:jt,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:l,vars:s,varsResolver:Nt,rootSelector:`group`});return(0,G.jsx)(Mt,{value:{withinGroup:!0},children:(0,G.jsx)(x,{...d(`group`),...u})})});Pt.classes=jt,Pt.varsResolver=Nt,Pt.displayName=`@mantine/core/AvatarGroup`;function Ft(e){return(0,G.jsx)(`svg`,{...e,"data-avatar-placeholder-icon":!0,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,G.jsx)(`path`,{d:`M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}function It(e){let t=0;for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t}var Lt=[`blue`,`cyan`,`grape`,`green`,`indigo`,`lime`,`orange`,`pink`,`red`,`teal`,`violet`];function Rt(e,t=Lt){let n=It(e);return t[Math.abs(n)%t.length]}function zt(e,t=2){let n=e.split(` `);return n.length===1?e.slice(0,t).toUpperCase():n.map(e=>e[0]).slice(0,t).join(``).toUpperCase()}var Bt=u((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o,name:s,allowedInitialsColors:c})=>{let l=a===`initials`&&typeof s==`string`?Rt(s,c):a,u=e.variantColorResolver({color:l||`gray`,theme:e,gradient:i,variant:r||`light`,autoContrast:o});return{root:{"--avatar-size":p(t,`avatar-size`),"--avatar-radius":n===void 0?void 0:T(n),"--avatar-bg":l||r?u.background:void 0,"--avatar-color":l||r?u.color:void 0,"--avatar-bd":l||r?u.border:void 0}}}),Vt=g(e=>{let t=_(`Avatar`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,src:c,alt:l,radius:u,color:d,gradient:f,imageProps:p,children:m,autoContrast:h,mod:g,name:v,allowedInitialsColors:y,attributes:S,...C}=t,w=(0,U.use)(Mt),[T,E]=(0,U.useState)(!c),D=b({name:`Avatar`,props:t,classes:jt,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:S,vars:s,varsResolver:Bt});return(0,U.useEffect)(()=>E(!c),[c]),(0,G.jsx)(x,{...D(`root`),mod:[{"within-group":w.withinGroup},g],...C,children:T||!c?(0,G.jsx)(`span`,{...D(`placeholder`),title:l,children:m||typeof v==`string`&&zt(v)||(0,G.jsx)(Ft,{})}):(0,G.jsx)(`img`,{...p,...D(`image`),src:c,alt:l,onError:e=>{E(!0),p?.onError?.(e)}})})});Vt.classes=jt,Vt.varsResolver=Bt,Vt.displayName=`@mantine/core/Avatar`,Vt.Group=Pt;function Ht(e){let t=e.currentTarget;return oe(t).activeElement!==t}var Ut={refProp:`ref`},Wt=m(e=>{let{children:t,refProp:n,ref:r,...i}=_(`ComboboxPopoverTarget`,Ut,e),a=D(t);if(!a)throw Error(`ComboboxPopover.Target component children should be an element or a component that accepts ref. Fragments, str
1ings, numbers and other primitive values are not supported`);let o=M(),s=Ce(r,o.store.targetRef,O(a)),c=ce({targetType:`button`,withAriaAttributes:!0,withKeyboardNavigation:!0,withExpandedAttribute:!0,onKeyDown:a.props.onKeyDown,onClick:e=>{o.store.toggleDropdown(),a.props.onClick?.(e)},autoComplete:`off`}),l=(0,U.cloneElement)(a,{...c,...i,[n]:s});return(0,G.jsx)(te.Target,{refProp:n,children:l})});Wt.displayName=`@mantine/core/ComboboxPopoverTarget`;function Gt(e,t){return Array.isArray(e)?e.includes(t):e===t}function Kt({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:a,renderOption:o}){if(bt(e)){let s=e.items.map(e=>(0,G.jsx)(Kt,{data:e,value:r,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:i,renderOption:o},`${e.value}`));return(0,G.jsx)(N.Group,{label:e.group,children:s})}let c=Gt(r,e.value),l=t&&(c?(0,G.jsx)(A,{className:le.optionsDropdownCheckIcon}):n?(0,G.jsx)(`div`,{className:le.optionsDropdownCheckPlaceholder}):null),u=(0,G.jsxs)(G.Fragment,{children:[i===`left`&&l,(0,G.jsx)(`span`,{children:e.label}),i===`right`&&l]});return(0,G.jsx)(N.Option,{value:e.value,disabled:e.disabled,className:s({[le.optionsDropdownOption]:!a}),"data-reverse":i===`right`||void 0,"data-checked":c||void 0,"aria-selected":c,active:c,children:typeof o==`function`?o({option:e,checked:c}):u})}function qt({data:e,filter:t,search:n,limit:r,nothingFoundMessage:i,withScrollArea:a=!0,maxDropdownHeight:o,value:s,checkIconPosition:c,withCheckIcon:l=!1,withAlignedLabels:u=!1,unstyled:d,renderOption:f,scrollAreaProps:p,onSearchChange:m}){let h=(t||xt)({options:e,search:n,limit:r??1/0}),g=St(h),_=h.map((e,t)=>(0,G.jsx)(Kt,{data:e,withCheckIcon:l,withAlignedLabels:u,value:s,checkIconPosition:c,unstyled:d,renderOption:f},bt(e)?`group-${typeof e.group==`string`?e.group:t}`:`${e.value}`));return(0,G.jsxs)(N.Dropdown,{"data-composed":!0,children:[(0,G.jsx)(N.Search,{value:n,onChange:m,placeholder:`Search...`}),(0,G.jsxs)(N.Options,{children:[a?(0,G.jsx)(se.Autosize,{mah:o??220,type:`scroll`,scrollbarSize:`var(--combobox-padding)`,offsetScrollbars:`y`,...p,children:_}):_,g&&i&&(0,G.jsx)(N.Empty,{children:i})]})]})}var Jt={withCheckIcon:!0,allowDeselect:!0,checkIconPosition:`left`,hiddenInputValuesDivider:`,`},Yt=y(e=>{let t=_(`ComboboxPopover`,Jt,e),{classNames:n,styles:r,unstyled:i,vars:a,children:o,multiple:s,value:c,defaultValue:l,onChange:u,data:d,dropdownOpened:f,defaultDropdownOpened:p,onDropdownOpen:m,onDropdownClose:h,onOptionSubmit:g,comboboxProps:v,filter:y,limit:b,withScrollArea:x,maxDropdownHeight:S,selectFirstOptionOnDropdownOpen:C,withCheckIcon:w,withAlignedLabels:T,checkIconPosition:E,nothingFoundMessage:D,searchable:O,searchValue:ee,defaultSearchValue:k,onSearchChange:te,allowDeselect:ne,renderOption:re,scrollAreaProps:ie,hiddenInputProps:A,name:ae,form:j,hiddenInputValuesDivider:M,attributes:oe,...se}=t,ce=(0,U.useMemo)(()=>vt(d),[d]),le=(0,U.useMemo)(()=>yt(ce),[ce]),[de,fe]=we({value:c,defaultValue:l,finalValue:s?[]:null,onChange:u}),[pe,me]=we({value:ee,defaultValue:k,finalValue:``,onChange:te}),P=ue({opened:f,defaultOpened:p,onDropdownOpen:()=>{m?.(),O&&P.focusSearchInput(),C&&P.selectFirstOption()},onDropdownClose:()=>{h?.(),P.resetSelectedOption()}}),he=e=>{me(e),P.resetSelectedOption()},{resolvedClassNames:ge,resolvedStyles:_e}=je({props:t,styles:r,classNames:n});return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(N,{store:P,__staticSelector:`ComboboxPopover`,classNames:ge,styles:_e,unstyled:i,attributes:oe,onOptionSubmit:e=>{g?.(e);let t=le[e];if(s){let e=Array.isArray(de)?de:[];e.includes(t.value)?fe(e.filter(e=>e!==t.value)):fe([...e,t.value]),P.updateSelectedOptionIndex(`selected`)}else{let e=ne&&`${t.value}`==`${de}`?null:t.value;fe(e),P.closeDropdown()}O&&he(``)},returnFocus:!0,...v,...se,children:[o,O?(0,G.jsx)(qt,{data:ce,filter:y,search:pe,limit:b,nothingFoundMessage:D,withScrollArea:x,maxDropdownHeight:S,value:de,checkIconPosition:E,withCheckIcon:w,withAlignedLabels:T,unstyled:i,renderOption:re,scrollAreaProps:ie,onSearchChange:e=>{he(e.currentTarget.value)}}):(0,G.jsx)(Et,{data:ce,filter:y,search:void 0,limit:b,hiddenWhenEmpty:!D,withScrollArea:x,maxDropdownHeight:S,filterOptions:!1,value:de,checkIconPosition:E,withCheckIcon:w,withAlignedLabels:T,nothingFoundMessage:D,unstyled:i,renderOption:re,scrollAreaProps:ie,labelId:void 0,"aria-label":void 0})]}),(0,G.jsx)(N.HiddenInput,{name:ae,value:de,form:j,valuesDivider:M,...A})]})});Yt.classes=N.classes,Yt.displayName=`@mantine/core/ComboboxPopover`,Yt.Target=Wt;var Xt=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],Zt={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`};function Qt(e){Object.keys(Zt).forEach(t=>{e.style.setProperty(t,Zt[t],`important`)})}function $t(e){let t=window.getComputedStyle(e);
1if(t===null)return null;let n={};for(let e of Xt)n[e]=t[e];return n.boxSizing===``?null:{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)}}var K=null;function en(e,t,n=1,r=1/0){K||(K=document.createElement(`textarea`),K.setAttribute(`tabindex`,`-1`),K.setAttribute(`aria-hidden`,`true`),K.setAttribute(`aria-label`,`autosize measurement`),Qt(K)),K.parentNode===null&&document.body.appendChild(K);let{paddingSize:i,borderSize:a,sizingStyle:o}=e,{boxSizing:s}=o;Object.keys(o).forEach(e=>{K.style[e]=o[e]}),Qt(K),K.value=t;let c=s===`border-box`?K.scrollHeight+a:K.scrollHeight-i;K.value=t,c=s===`border-box`?K.scrollHeight+a:K.scrollHeight-i,K.value=`x`;let l=K.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);let d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}function tn({maxRows:e,minRows:t,onChange:n,ref:r,...i}){let a=i.value!==void 0,o=(0,U.useRef)(null),s=Ce(o,r),c=(0,U.useRef)(0),l=(0,U.useRef)(0),u=()=>{let n=o.current;if(!n)return;let r=$t(n);if(!r)return;let[i]=en(r,n.value||n.placeholder||`x`,t,e);c.current!==i&&(c.current=i,n.style.setProperty(`height`,`${i}px`,`important`))},d=(0,U.useEffectEvent)(u),f=e=>{a||u(),n?.(e)};return(0,U.useLayoutEffect)(u),(0,U.useEffect)(()=>{let e=()=>u();return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,U.useEffect)(()=>{let e=o.current;if(!e||typeof ResizeObserver>`u`)return;l.current=e.offsetWidth;let t=0,n=new ResizeObserver(()=>{o.current&&o.current.offsetWidth!==l.current&&(l.current=o.current.offsetWidth,cancelAnimationFrame(t),t=requestAnimationFrame(d))});return n.observe(e),()=>{cancelAnimationFrame(t),n.disconnect()}},[]),(0,U.useEffect)(()=>{let e=()=>u();return document.fonts.addEventListener(`loadingdone`,e),()=>document.fonts.removeEventListener(`loadingdone`,e)},[]),(0,U.useEffect)(()=>{let e=e=>{if(o.current?.form===e.target&&!a){let e=o.current.value;requestAnimationFrame(()=>{o.current&&e!==o.current.value&&u()})}};return document.body.addEventListener(`reset`,e),()=>document.body.removeEventListener(`reset`,e)},[a]),(0,G.jsx)(`textarea`,{rows:t,...i,onChange:f,ref:s})}var nn=m(e=>{let{autosize:t,maxRows:n,minRows:r,__staticSelector:i,resize:a,bottomSection:o,bottomSectionProps:s,...c}=_([`Input`,`InputWrapper`,`Textarea`],null,e),l=t&&ae()!==`test`,u=l?{maxRows:n,minRows:r}:{};return(0,G.jsx)(Le,{component:l?tn:`textarea`,...c,__staticSelector:i||`Textarea`,__bottomSection:o,__bottomSectionProps:s,multiline:!0,"data-no-overflow":t&&n===void 0||void 0,__vars:{"--input-resize":a},...u})});nn.classes=Le.classes,nn.displayName=`@mantine/core/Textarea`;var[rn,an]=ne(`List component was not found in tree`),on={root:`m_abbac491`,item:`m_abb6bec2`,itemWrapper:`m_75cd9f71`,itemIcon:`m_60f83e5b`},sn=m(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,icon:o,children:s,mod:c,...l}=_(`ListItem`,null,e),u=an(),d=o||u.icon,f={classNames:t,styles:i};return(0,G.jsx)(x,{...u.getStyles(`item`,{...f,className:n,style:r}),component:`li`,mod:[{"with-icon":!!d,centered:u.center},c],...l,children:(0,G.jsxs)(`div`,{...u.getStyles(`itemWrapper`,f),children:[d&&(0,G.jsx)(`span`,{...u.getStyles(`itemIcon`,f),children:d}),(0,G.jsx)(`span`,{...u.getStyles(`itemLabel`,f),children:s})]})})});sn.classes=on,sn.displayName=`@mantine/core/ListItem`;var cn={type:`unordered`},ln=u((e,{size:t,spacing:n})=>({root:{"--list-fz":d(t),"--list-lh":f(t),"--list-spacing":l(n)}})),un=m(e=>{let t=_(`List`,cn,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,children:c,type:l,withPadding:u,icon:d,spacing:f,center:p,listStyleType:m,mod:h,attributes:g,...v}=t,y=b({name:`List`,classes:on,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:g,vars:s,varsResolver:ln});return(0,G.jsx)(rn,{value:{center:p,icon:d,getStyles:y},children:(0,G.jsx)(x,{...y(`root`,{style:{listStyleType:m}}),component:l===`unordered`?`ul`:`ol`,mod:[{"with-padding":u,type:d?`none`:m},h],...v,children:c})})});un.classes=on,un.varsResolver=ln,un.displayName=`@mantine/core/List`,un.Item=sn;var dn={root:`m_6e45937b`,loader:`m_e8eb006c`,overlay:`m_df587f17`},fn={transitionProps:{transition:`fade`,duration:0},overlayProps:{backgroundOpacity:.75},zIndex:re(`overlay`)},pn=u((e,{zIndex:t})=>({root:{"--lo-z-index":t?.toString()}})),mn=m(e=>{let t=_(`LoadingOverlay`,fn,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,transitionProps:c,loaderProps:l,overlayProps:u,visible:d,zIndex:f,attributes:p,onEnter:m,onEntered:g,onExit:v,onExited:y,...S}=t,C=h(),w=b({name:`LoadingOverlay`,classes:dn,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:p,vars:s,varsResolver:pn}),T={...fn.overlayProps,...u};return(0,G.jsx)(me,{transition:`fade`,...c,mounted:!!d,onEnter:m,onEntered:g,onExit:v,onExited:y,children:e=>(0,G.jsxs)(x,{...w(`root`,{style:e}),...S,children:[(0,G.jsx)(fe,{unstyled:o,...l,...w(`loader`,{className:l?.className,style:l?.style})}),(0,G.jsx)(k,{...T,...w(`overlay`,{className:T?.className,style:T?.style}),darkHidden:!0,unstyled:o,color:u?.color||C.white}),(0,G.jsx)(k,{...T,...w(`overlay`,{className:T?.className,style:T?.style}),lightHidden:!0,unstyled:o,color:u?.color||C.colors.dark[5]})]})})});mn.classes=dn,mn.varsResolver=pn,mn.displayName=`@mantine/core/LoadingOverlay`;var hn={field:`m_45c4369d`},gn={type:`visible`},_n=m(e=>{let t=_(`PillsInputField`,gn,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,type:c,disabled:l,id:u,pointer:d,mod:f,attributes:p,ref:m,...h}=t,g=(0,U.use)(De),v=(0,U.use)(Fe),y=b({name:`PillsInputField`,classes:hn,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:p,rootSelector:`field`}),S=l||g?.disabled;return(0,G.jsx)(x,{component:`input`,ref:Ce(m,g?.fieldRef),"data-type":c,disabled:S,mod:[{disabled:S,pointer:d},f],...y(`field`),...h,id:v?.inputId||u,"aria-invalid":g?.hasError,"aria-describedby":v?.de
1scribedBy,type:`text`,onMouseDown:e=>!d&&e.stopPropagation()})});_n.classes=hn,_n.displayName=`@mantine/core/PillsInputField`;var vn={size:`sm`},yn=m(e=>{let{children:t,onMouseDown:n,onClick:r,size:i,disabled:a,__staticSelector:o,error:s,variant:c,...l}=_([`Input`,`InputWrapper`,`PillsInput`],vn,e),u=(0,U.useRef)(null);return(0,G.jsx)(De,{value:{fieldRef:u,size:i,disabled:a,hasError:!!s,variant:c},children:(0,G.jsx)(Le,{size:i,error:s,variant:c,component:`div`,"data-no-overflow":!0,onMouseDown:e=>{e.preventDefault(),n?.(e),u.current?.focus()},onClick:e=>{e.preventDefault(),e.currentTarget.closest(`fieldset`)?.disabled||(u.current?.focus(),r?.(e))},...l,multiline:!0,disabled:a,__staticSelector:o||`PillsInput`,withAria:!1,children:t})})});yn.displayName=`@mantine/core/PillsInput`,yn.classes=Le.classes,yn.Field=_n;function bn(e,t){let n=t.trim().toLowerCase();if(n===``)return;let r=Object.values(e).filter(e=>!e.disabled&&e.label.trim().toLowerCase()===n);return r.length===1?r[0]:void 0}function xn(e){return typeof e==`string`?e.trim().toLowerCase():e}function Sn({data:e,value:t}){let n=t.map(xn);return e.reduce((e,t)=>(bt(t)?e.push({group:t.group,items:t.items.filter(e=>n.indexOf(xn(e.value))===-1)}):n.indexOf(xn(t.value))===-1&&e.push(t),e),[])}var Cn={xs:41,sm:50,md:60,lg:72,xl:89},wn={maxValues:1/0,withCheckIcon:!0,checkIconPosition:`left`,hiddenInputValuesDivider:`,`,clearSearchOnChange:!0,openOnFocus:!0,size:`sm`},Tn=y(e=>{let t=_([`Input`,`InputWrapper`,`MultiSelect`],wn,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,size:c,value:l,defaultValue:u,onChange:d,onKeyDown:f,variant:p,data:m,dropdownOpened:h,defaultDropdownOpened:g,onDropdownOpen:v,onDropdownClose:y,selectFirstOptionOnChange:x,selectFirstOptionOnDropdownOpen:S,onOptionSubmit:C,comboboxProps:T,filter:E,limit:D,withScrollArea:O,maxDropdownHeight:ee,floatingHeight:k,searchValue:te,defaultSearchValue:ne,onSearchChange:re,readOnly:ie,disabled:A,onFocus:ae,onBlur:j,radius:M,rightSection:oe,rightSectionWidth:se,rightSectionPointerEvents:ce,rightSectionProps:le,leftSection:de,leftSectionWidth:fe,leftSectionPointerEvents:me,leftSectionProps:P,inputContainer:he,inputWrapperOrder:ge,withAsterisk:_e,labelProps:ve,descriptionProps:ye,errorProps:be,successProps:xe,wrapperProps:Se,description:Ce,label:F,error:Te,success:Ee,maxValues:De,searchable:Oe,nothingFoundMessage:Ae,withCheckIcon:I,withAlignedLabels:Me,checkIconPosition:L,hidePickedOptions:Ne,withErrorStyles:Pe,withSuccessStyles:Fe,name:Ie,form:Le,id:Re,clearable:R,clearSectionMode:ze,clearButtonProps:Be,hiddenInputProps:Ve,placeholder:He,hiddenInputValuesDivider:Ue,required:z,mod:We,renderOption:Ge,renderPill:Ke,onRemove:qe,onClear:Je,onMaxValues:Ye,scrollAreaProps:Xe,chevronColor:Ze,attributes:Qe,clearSearchOnChange:$e,openOnFocus:et,loading:tt,loadingPosition:nt,withPillsReorder:rt,...it}=t,at=pe(Re),ot=vt(m),st=yt(ot),ct=(0,U.useRef)({}),B=ue({opened:h,defaultOpened:g,onDropdownOpen:()=>{v?.(),S&&B.selectFirstOption()},onDropdownClose:()=>{y?.(),B.resetSelectedOption()}}),{styleProps:V,rest:{type:lt,autoComplete:ut,...dt}}=w(it),[H,W]=we({value:l,defaultValue:u,finalValue:[],onChange:d}),{getPillProps:ft,getListProps:pt,handleInputKeyDown:mt}=At({value:H,onChange:W,enabled:rt&&!A&&!ie}),[ht,gt]=we({value:te,defaultValue:ne,finalValue:``,onChange:re}),_t=e=>{gt(e),B.resetSelectedOption()},bt=b({name:`MultiSelect`,classes:{},props:t,classNames:n,styles:a,unstyled:o,attributes:Qe}),{resolvedClassNames:xt,resolvedStyles:St}=je({props:t,styles:a,classNames:n}),Ct=e=>{f?.(e),!e.defaultPrevented&&(e.key===` `&&!Oe&&(e.preventDefault(),B.toggleDropdown()),e.key===`Backspace`&&ht.length===0&&H.length>0&&(qe?.(H[H.length-1]),W(H.slice(0,H.length-1))),mt(e))},wt=H.map((e,t)=>{let n=st[`${e}`]||ct.current[`${e}`],r=ft(t);return Ke?(0,G.jsx)(U.Fragment,{children:Ke({option:n,value:e,onRemove:()=>{W(H.filter(t=>e!==t)),qe?.(e)},disabled:A,reorderProps:r})},`${e}-${t}`):(0,G.jsx)(ke,{withRemoveButton:!ie&&!st[`${e}`]?.disabled,onRemove:()=>{W(H.filter(t=>e!==t)),qe?.(e)},unstyled:o,disabled:A,...bt(`pill`),...r,children:n?.label||e},`${e}-${t}`)});(0,U.useEffect)(()=>{x&&B.selectFirstOption()},[x,ht]),(0,U.useEffect)(()=>
1{H.forEach(e=>{`${e}`in st&&(ct.current[`${e}`]=st[`${e}`])})},[st,H]);let Tt=(0,G.jsx)(N.ClearButton,{...Be,onClear:()=>{Je?.(),W([]),_t(``)}}),Dt=Sn({data:ot,value:H}),Ot=R&&H.length>0&&!A&&!ie,kt=Ot?{paddingInlineEnd:Cn[c]??Cn.sm}:void 0;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(N,{store:B,classNames:xt,styles:St,unstyled:o,size:c,readOnly:ie,__staticSelector:`MultiSelect`,attributes:Qe,floatingHeight:k,onOptionSubmit:e=>{C?.(e),$e&&_t(``),B.updateSelectedOptionIndex(`selected`),H.includes(st[`${e}`].value)?(W(H.filter(t=>t!==st[`${e}`].value)),qe?.(st[`${e}`].value)):H.length<De?W([...H,st[`${e}`].value]):Ye?.()},...T,children:[(0,G.jsx)(N.DropdownTarget,{children:(0,G.jsx)(yn,{...V,__staticSelector:`MultiSelect`,classNames:xt,styles:St,unstyled:o,size:c,className:r,style:i,variant:p,disabled:A,radius:M,__defaultRightSection:(0,G.jsx)(N.Chevron,{size:c,error:Te,unstyled:o,color:Ze}),__clearSection:Tt,__clearable:Ot,__clearSectionMode:ze,rightSection:oe,rightSectionPointerEvents:ce||`none`,rightSectionWidth:se,rightSectionProps:le,leftSection:de,leftSectionWidth:fe,leftSectionPointerEvents:me,leftSectionProps:P,loading:tt,loadingPosition:nt,inputContainer:he,inputWrapperOrder:ge,withAsterisk:_e,labelProps:ve,descriptionProps:ye,errorProps:be,successProps:xe,wrapperProps:Se,description:Ce,label:F,error:Te,success:Ee,withErrorStyles:Pe,withSuccessStyles:Fe,__stylesApiProps:{...t,rightSectionPointerEvents:ce||`none`,multiline:!0},pointer:!Oe,onClick:()=>Oe?B.openDropdown():B.toggleDropdown(),"data-expanded":B.dropdownOpened||void 0,id:at,required:z,mod:We,attributes:Qe,children:(0,G.jsxs)(ke.Group,{attributes:Qe,disabled:A,unstyled:o,...bt(`pillsList`,{style:kt}),...pt(),children:[wt,(0,G.jsx)(N.EventsTarget,{autoComplete:ut,withExpandedAttribute:!0,children:(0,G.jsx)(yn.Field,{...dt,id:at,placeholder:He,type:!Oe&&!He?`hidden`:`visible`,...bt(`inputField`),unstyled:o,onFocus:e=>{ae?.(e),et&&Oe&&B.openDropdown()},onBlur:e=>{j?.(e),B.closeDropdown(),_t(``)},onKeyDown:Ct,value:ht,onChange:e=>{if(Ht(e)){if(!ie){let t=bn(st,e.currentTarget.value);t&&!H.includes(t.value)&&H.length<De&&W([...H,t.value])}return}_t(e.currentTarget.value),Oe&&B.openDropdown(),x&&B.selectFirstOption()},disabled:A,readOnly:ie||!Oe,pointer:!Oe})})]})})}),(0,G.jsx)(Et,{data:Ne?Dt:ot,hidden:ie||A,filter:E,search:ht,limit:D,hiddenWhenEmpty:!Ae,withScrollArea:O,maxDropdownHeight:ee,filterOptions:Oe,value:H,checkIconPosition:L,withCheckIcon:I,withAlignedLabels:Me,nothingFoundMessage:Ae,unstyled:o,labelId:F?`${at}-label`:void 0,"aria-label":F?void 0:it[`aria-label`],renderOption:Ge,scrollAreaProps:Xe})]}),(0,G.jsx)(N.HiddenInput,{name:Ie,valuesDivider:Ue,value:H,form:Le,disabled:A,...Ve})]})});Tn.classes={...Le.classes,...N.classes},Tn.displayName=`@mantine/core/MultiSelect`;var[En,Dn]=ne(`Pagination.Root component was not found in tree`),On={root:`m_4addd315`,control:`m_326d024a`,dots:`m_4ad7767d`,items:`m_105fdbed`,label:`m_10817321`},kn={withPadding:!0},An=m(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,active:o,disabled:s,withPadding:c,mod:l,...u}=_(`PaginationControl`,kn,e),d=Dn(),f=s||d.disabled;return(0,G.jsx)(v,{disabled:f,mod:[{active:o,disabled:f,"with-padding":c},l],...d.getStyles(`control`,{className:n,style:r,classNames:t,styles:i,active:!f}),...u})});An.classes=On,An.displayName=`@mantine/core/PaginationControl`;function jn({style:e,children:t,path:n,...r}){return(0,G.jsx)(`svg`,{viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`,style:{width:`calc(var(--pagination-control-size) / 1.8)`,height:`calc(var(--pagination-control-size) / 1.8)`,...e},...r,children:(0,G.jsx)(`path`,{d:n,fill:`currentColor`})})}var Mn=e=>(0,G.jsx)(jn,{...e,path:`M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z`}),Nn=e=>(0,G.jsx)(jn,{...e,path:`M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z`}),Pn=e=>(0,G.jsx)(jn,{...e,path:`M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z`}),Fn=e=>(0,G.jsx)(jn,{...e,path:`M2.14645 11.1464C1.95118 11.3417 1.95118 11.6583 2.14645 11.8536C2.34171 12.0488 2.65829 12.0488 2.85355 11.8536L6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L2.85355 3.14645C2.65829 2.95118 2.34171 2.95118 2.14645 3.14645C1.95118 3.34171 1.95118 3.65829 2.14645 3.85355L5.79289 7.5L2.14645 11.1464ZM8.14645 11.1464C7.95118 11.3417 7.95118 11.6583 8.14645 11.8536C8.34171 12.0488 8.65829 12.0488 8.85355 11.8536L12.8536 7.85355C13.0488 7.65829 13.0488 7.34171 12.8536 7.14645L8.85355 3.14645C8.65829 2.95118 8.34171 2.95118 8.14645 3.14645C7.95118 3.34171 7.95118 3.65829 8.14645 3.85355L11.7929 7.5L8.14645 11.1464Z`}),In={icon:e=>(0,G.jsx)(jn,{...e,path:`M2 8c0-.733.6-1.333 1.333-1.333.734 0 1.334.6 1.334 1.333s-.6 1.333-1.334 1.333C2.6 9.333 2 8.733 2 8zm9.333 0c0-.733.6-1.333 1.334-1.333C13.4 6.667 14 7.267 14 8s-.6 1.333-1.333 1.333c-.734 0-1.334-.6-1.334-1.333zM6.667 8c0-.733.6-1.333 1.333-1.333s1.333.6 1.333 1.333S8.733 9.333 8 9.333 6.667 8.733 6.667 8z`})},Ln=m(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,icon:o,...s}=_(`PaginationDots`,In,e),c=Dn();return(0,G.jsx)(x,{...c.getStyles(`dots`,{className:n,style:r,styles:i,classNames:t}),...s,children:(0,G.jsx)(o,{style:{width:`calc(var(--pagination-control-size) / 1.8)`,height:`calc(var(--pagination-control-size) / 1.8)`}})})});Ln.classes=On,Ln.displayName=`@mantine/core/PaginationDots`;function Rn({icon:e,name:t,action:n,type:r}){let i={icon:e},a=e=>{let{icon:a,...o}=_(t,i,e),s=Dn(),c=r===`next`?s.active===s.total:s.active===1;return(0,G.jsx)(An,{disabled:s.disabled||c,onClick:s[n],withPadding:!1,...o,children:(0,G.jsx)(a,{className:`mantine-rotate-rtl`,
1style:{width:`calc(var(--pagination-control-size) / 1.8)`,height:`calc(var(--pagination-control-size) / 1.8)`}})})};return a.displayName=`@mantine/core/${t}`,S(a)}var zn=Rn({icon:Mn,name:`PaginationNext`,action:`onNext`,type:`next`}),Bn=Rn({icon:Nn,name:`PaginationPrevious`,action:`onPrevious`,type:`previous`}),Vn=Rn({icon:Pn,name:`PaginationFirst`,action:`onFirst`,type:`previous`}),Hn=Rn({icon:Fn,name:`PaginationLast`,action:`onLast`,type:`next`});function Un({dotsIcon:e}){let t=Dn(),n=t.range.map((n,r)=>n===`dots`?(0,G.jsx)(Ln,{icon:e},r):(0,G.jsx)(An,{active:n===t.active,"aria-current":n===t.active?`page`:void 0,onClick:()=>t.onChange(n),disabled:t.disabled,...t.getItemProps?.(n),children:t.getItemProps?.(n)?.children??n},r));return(0,G.jsx)(G.Fragment,{children:n})}Un.displayName=`@mantine/core/PaginationItems`;var Wn={formatLabel:({page:e,totalPages:t})=>`Page ${e} of ${t}`},Gn=m(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,formatLabel:o,...s}=_(`PaginationLabel`,Wn,e),c=Dn();return(0,G.jsx)(x,{...c.getStyles(`label`,{className:n,style:r,styles:i,classNames:t}),...s,children:o({page:c.active,totalPages:c.total})})});Gn.classes=On,Gn.displayName=`@mantine/core/PaginationLabel`;var Kn={siblings:1,boundaries:1},qn=u((e,{size:t,radius:n,color:r,autoContrast:i})=>({root:{"--pagination-control-radius":n===void 0?void 0:T(n),"--pagination-control-size":p(t,`pagination-control-size`),"--pagination-control-fz":d(t),"--pagination-active-bg":r?o(r,e):void 0,"--pagination-active-color":ie(i,e)?j({color:r,theme:e,autoContrast:i}):void 0}})),Jn=m(e=>{let t=_(`PaginationRoot`,Kn,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,total:c,value:l,defaultValue:u,onChange:d,disabled:f,siblings:p,boundaries:m,color:h,radius:g,onNextPage:v,onPreviousPage:y,onFirstPage:S,onLastPage:C,getItemProps:w,autoContrast:T,startValue:D,layout:O,mod:ee,attributes:k,...te}=t,ne=b({name:`Pagination`,classes:On,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:k,vars:s,varsResolver:qn}),{range:re,setPage:ie,next:A,previous:ae,active:j,first:M,last:oe}=ht({page:l,initialPage:u,onChange:d,total:c,siblings:p,boundaries:m,startValue:D});return(0,G.jsx)(En,{value:{total:c,range:re,active:j,disabled:f,layout:O,getItemProps:w,onChange:ie,onNext:E(v,A),onPrevious:E(y,ae),onFirst:E(S,M),onLast:E(C,oe),getStyles:ne},children:(0,G.jsx)(x,{...ne(`root`),mod:[{layout:O},ee],...te})})});Jn.classes=On,Jn.varsResolver=qn,Jn.displayName=`@mantine/core/PaginationRoot`;var Yn={withControls:!0,withPages:!0,siblings:1,boundaries:1,gap:8};function Xn({children:e}){let t=Dn();return(0,G.jsx)(x,{...t.getStyles(`items`),children:e})}var Zn=m(e=>{let{withEdges:t,withControls:n,getControlProps:r,nextIcon:i,previousIcon:a,lastIcon:o,firstIcon:s,dotsIcon:c,total:l,gap:u,hideWithOnePage:d,withPages:f,layout:p,formatLabel:m,...h}=_(`Pagination`,Yn,e);if(l<=0||d&&l===1)return null;let g=f?p===`responsive`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Xn,{children:(0,G.jsx)(Un,{dotsIcon:c})}),(0,G.jsx)(Gn,{formatLabel:m})]}):(0,G.jsx)(Un,{dotsIcon:c}):null;return(0,G.jsx)(Jn,{total:l,layout:p,...h,children:(0,G.jsxs)(F,{gap:u,children:[t&&(0,G.jsx)(Vn,{icon:s,...r?.(`first`)}),n&&(0,G.jsx)(Bn,{icon:a,...r?.(`previous`)}),g,n&&(0,G.jsx)(zn,{icon:i,...r?.(`next`)}),t&&(0,G.jsx)(Hn,{icon:o,...r?.(`last`)})]})})});Zn.classes=On,Zn.displayName=`@mantine/core/Pagination`,Zn.Root=Jn,Zn.Control=An,Zn.Dots=Ln,Zn.First=Vn,Zn.Last=Hn,Zn.Next=zn,Zn.Previous=Bn,Zn.Items=Un,Zn.Label=Gn;function Qn({size:e,thickness:t,sum:n,value:r,root:i,offset:a}){let o=(e*.9-t*2)/2,s=Math.PI*o*2/100,c=i||r===void 0?`${(100-n)*s}, ${n*s}`:`${r*s}, ${(100-r)*s}`;return{strokeWidth:Number.isNaN(t)?12:t,cx:e/2||0,cy:e/2||0,r:o||0,transform:i?`scale(1, -1) translate(0, -${e})`:void 0,strokeDasharray:c,strokeDashoffset:i?0:a||0}}function $n({size:e,value:t,offset:n,sum:r,thickness:i,root:a,color:s,lineRoundCaps:c,tooltip:l,getStyles:u,display:d,...f}){let p=h();return(0,G.jsx)(Me.Floating,{disabled:!l,label:l,children:(0,G.jsx)(x,{component:`circle`,...f,...u(`curve`),__vars:{"--curve-color":s?o(s,p):void 0},fill:`none`,strokeLinecap:c?`round`:`butt`,...Qn({sum:r,size:e,thickness:i,value:t,offset:n,root:a})})})}$n.displayName=`@mantine/core/Curve`;function er({size:e,thickness:t,sections:n,renderRoundedLineCaps:r,rootColor:i,sectionGap:a=0}
1){let o=n.reduce((e,t)=>e+t.value,0),s=Math.PI*((e*.9-t*2)/2)*2,c=s,l=[],u=[],d=a/360*100;for(let e=0;e<n.length;e+=1){let t=Math.max(0,n[e].value-d);l.push({sum:o,offset:c,data:{...n[e],value:t},root:!1}),c-=n[e].value/100*s}if(l.push({sum:o,offset:c,data:{color:i},root:!0}),u.push({...l[l.length-1],lineRoundCaps:!1}),l.length>2){u.push({...l[0],lineRoundCaps:r}),u.push({...l[l.length-2],lineRoundCaps:r});for(let e=1;e<=l.length-3;e+=1)u.push({...l[e],lineRoundCaps:!1})}else u.push({...l[0],lineRoundCaps:r});return u}var tr={root:`m_b32e4812`,svg:`m_d43b5134`,curve:`m_b1ca1fbf`,label:`m_b23f9dc4`};function nr(e,t){return Math.min(e||12,(t||120)/4)}var rr={size:120,thickness:12,startAngle:270},ir=u((e,{size:t,thickness:n,transitionDuration:r,startAngle:i})=>({root:{"--rp-size":c(t),"--rp-label-offset":c(n*2),"--rp-transition-duration":r?`${r}ms`:void 0},svg:{"--rp-start-angle":`${i}deg`}})),ar=m(e=>{let t=_(`RingProgress`,rr,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,label:c,sections:l,size:u,thickness:d,roundCaps:f,rootColor:p,transitionDuration:m,sectionGap:h,startAngle:g,attributes:v,...y}=t,S=b({name:`RingProgress`,classes:tr,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:v,vars:s,varsResolver:ir}),C=nr(d,u),w=er({size:u,thickness:C,sections:l,renderRoundedLineCaps:f,rootColor:p,sectionGap:h}).map(({data:e,sum:t,root:n,lineRoundCaps:r,offset:i},a)=>(0,U.createElement)($n,{...e,key:a,size:u,thickness:C,sum:t,offset:i,color:e?.color,root:n,lineRoundCaps:r,getStyles:S}));return(0,G.jsxs)(x,{...S(`root`),size:u,...y,children:[(0,G.jsx)(`svg`,{...S(`svg`),viewBox:`0 0 ${u} ${u}`,children:w}),c&&(0,G.jsx)(`div`,{...S(`label`),children:c})]})});ar.classes=tr,ar.varsResolver=ir,ar.displayName=`@mantine/core/RingProgress`;var or={size:`sm`,withCheckIcon:!0,allowDeselect:!0,checkIconPosition:`left`,openOnFocus:!0},sr=y(e=>{let t=_([`Input`,`InputWrapper`,`Select`],or,e),{classNames:n,styles:r,unstyled:i,vars:a,dropdownOpened:o,defaultDropdownOpened:s,onDropdownClose:c,onDropdownOpen:l,onFocus:u,onBlur:d,onClick:f,onChange:p,data:m,value:h,defaultValue:g,selectFirstOptionOnChange:v,selectFirstOptionOnDropdownOpen:y,onOptionSubmit:b,comboboxProps:x,readOnly:S,disabled:C,filter:w,limit:T,withScrollArea:E,maxDropdownHeight:D,floatingHeight:O,size:ee,searchable:k,rightSection:te,checkIconPosition:ne,withCheckIcon:re,withAlignedLabels:ie,nothingFoundMessage:A,name:ae,form:j,searchValue:M,defaultSearchValue:oe,onSearchChange:se,allowDeselect:ce,error:le,rightSectionPointerEvents:de,id:fe,clearable:me,clearSectionMode:P,clearButtonProps:he,hiddenInputProps:ge,renderOption:_e,onClear:ve,autoComplete:ye,scrollAreaProps:be,__defaultRightSection:xe,__clearSection:Se,__clearable:Ce,chevronColor:F,autoSelectOnBlur:Te,openOnFocus:Ee,attributes:De,...Oe}=t,ke=(0,U.useMemo)(()=>vt(m),[m]),Ae=(0,U.useRef)({}),I=(0,U.useMemo)(()=>yt(ke),[ke]),Me=pe(fe),[L,Ne,Pe]=we({value:h,defaultValue:g,finalValue:null,onChange:p}),Fe=L==null?void 0:`${L}`in I?I[`${L}`]:Ae.current[`${L}`],Ie=gt(Fe),[Re,R,ze]=we({value:M,defaultValue:oe,finalValue:Fe?Fe.label:``,onChange:se}),Be=ue({opened:o,defaultOpened:s,onDropdownOpen:()=>{l?.(),y?Be.selectFirstOption():Be.updateSelectedOptionIndex(`active`,{scrollIntoView:!0})},onDropdownClose:()=>{c?.(),setTimeout(Be.resetSelectedOption,0)}}),Ve=e=>{R(e),Be.resetSelectedOption()},{resolvedClassNames:He,resolvedStyles:Ue}=je({props:t,styles:r,classNames:n});(0,U.useEffect)(()=>{v&&Be.selectFirstOption()},[v,Re]),(0,U.useEffect)(()=>{h===null&&Ve(``),h!=null&&Fe&&(Ie?.value!==Fe.value||Ie?.label!==Fe.label)&&Ve(Fe.label)},[h,Fe]),(0,U.useEffect)(()=>{!Pe&&!ze&&Ve(L==null?``:`${L}`in I?I[`${L}`]?.label:Ae.current[`${L}`]?.label||``)},[I,L]),(0,U.useEffect)(()=>{L&&`${L}`in I&&(Ae.current[`${L}`]=I[`${L}`])},[I,L]);let z=(0,G.jsx)(N.ClearButton,{...he,onClear:()=>{Ne(null,null),Ve(``),ve?.()}}),We=me&&L!=null&&!C&&!S;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(N,{store:Be,__staticSelector:`Select`,classNames:He,styles:Ue,unstyled:i,readOnly:S,size:ee,attributes:De,floatingHeight:O,keepMounted:Te,onOptionSubmit:e=>{b?.(e);let t=ce&&`${I[e].value}`==`${L}
1`?null:I[e],n=t?t.value:null;n!==L&&Ne(n,t),!Pe&&Ve(n==null?``:t?.label||``),Be.closeDropdown()},...x,children:[(0,G.jsx)(N.Target,{targetType:k?`input`:`button`,autoComplete:ye,withExpandedAttribute:!0,children:(0,G.jsx)(Le,{id:Me,__defaultRightSection:(0,G.jsx)(N.Chevron,{size:ee,error:le,unstyled:i,color:F}),__clearSection:z,__clearable:We,__clearSectionMode:P,rightSection:te,rightSectionPointerEvents:de||`none`,...Oe,size:ee,__staticSelector:`Select`,disabled:C,readOnly:S||!k,value:Re,onChange:e=>{if(Ht(e)){if(!S){let t=bn(I,e.currentTarget.value);t&&`${t.value}`!=`${L}`&&(Ne(t.value,t),!Pe&&Ve(t.label))}return}Ve(e.currentTarget.value),Be.openDropdown(),v&&Be.selectFirstOption()},onFocus:e=>{Ee&&k&&Be.openDropdown(),u?.(e)},onBlur:e=>{Te&&Be.clickSelectedOption(),k&&Be.closeDropdown();let t=L!=null&&(`${L}`in I?I[`${L}`]:Ae.current[`${L}`]);Ve(t&&t.label||``),d?.(e)},onClick:e=>{k?Be.openDropdown():Be.toggleDropdown(),f?.(e)},classNames:He,styles:Ue,unstyled:i,pointer:!k,error:le,attributes:De})}),(0,G.jsx)(Et,{data:ke,hidden:S||C,filter:w,search:Re,limit:T,hiddenWhenEmpty:!A,withScrollArea:E,maxDropdownHeight:D,filterOptions:!!k&&Fe?.label!==Re,value:L,checkIconPosition:ne,withCheckIcon:re,withAlignedLabels:ie,nothingFoundMessage:A,unstyled:i,labelId:Oe.label?`${Me}-label`:void 0,"aria-label":Oe.label?void 0:Oe[`aria-label`],renderOption:_e,scrollAreaProps:be})]}),(0,G.jsx)(N.HiddenInput,{value:L,name:ae,form:j,disabled:C,...ge})]})});sr.classes={...Le.classes,...N.classes},sr.displayName=`@mantine/core/Select`;function cr({data:e,value:t}){let n=t.map(e=>e.trim().toLowerCase());return e.reduce((e,t)=>(bt(t)?e.push({group:t.group,items:t.items.filter(e=>n.indexOf(e.label.toLowerCase().trim())===-1)}):n.indexOf(t.label.toLowerCase().trim())===-1&&e.push(t),e),[])}function lr(e,t){return e?t.split(RegExp(`[${e.join(``)}]`)).map(e=>e.trim()).filter(e=>e!==``):[t]}function ur({splitChars:e,allowDuplicates:t,maxTags:n,value:r,currentTags:i,isDuplicate:a,onDuplicate:o}){let s=lr(e,r),c=[];if(t)c.push(...i,...s);else{c.push(...i);for(let e of s)(a?e=>a(e,c):e=>c.some(t=>t.toLowerCase()===e.toLowerCase()))(e)?o?.(e):c.push(e)}return n?c.slice(0,n):c}var dr={maxTags:1/0,acceptValueOnBlur:!0,splitChars:[`,`],hiddenInputValuesDivider:`,`,openOnFocus:!0,size:`sm`},fr=m(e=>{let t=_([`Input`,`InputWrapper`,`TagsInput`],dr,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,size:c,value:l,defaultValue:u,onChange:d,onKeyDown:f,maxTags:p,allowDuplicates:m,onDuplicate:h,variant:g,data:v,dropdownOpened:y,defaultDropdownOpened:x,onDropdownOpen:S,onDropdownClose:C,selectFirstOptionOnChange:T,selectFirstOptionOnDropdownOpen:E,onOptionSubmit:D,comboboxProps:O,filter:ee,limit:k,withScrollArea:te,maxDropdownHeight:ne,floatingHeight:re,searchValue:ie,defaultSearchValue:A,onSearchChange:ae,readOnly:j,disabled:M,splitChars:oe,onFocus:se,onBlur:ce,onPaste:le,radius:de,rightSection:fe,rightSectionWidth:me,rightSectionPointerEvents:P,rightSectionProps:he,leftSection:ge,leftSectionWidth:_e,leftSectionPointerEvents:ve,leftSectionProps:ye,inputContainer:be,inputWrapperOrder:xe,withAsterisk:Se,required:F,labelProps:Te,descriptionProps:Ee,errorProps:De,successProps:Oe,wrapperProps:Ae,description:I,label:Me,error:L,success:Ne,withErrorStyles:Pe,withSuccessStyles:Fe,name:Ie,form:Le,id:Re,clearable:R,clearSectionMode:ze,clearButtonProps:Be,hiddenInputProps:Ve,hiddenInputValuesDivider:He,mod:Ue,renderOption:z,renderPill:We,onRemove:Ge,onClear:Ke,onMaxTags:qe,scrollAreaProps:Je,acceptValueOnBlur:Ye,isDuplicate:Xe,openOnFocus:Ze,attributes:Qe,ref:$e,loading:et,loadingPosition:tt,withPillsReorder:nt,...rt}=t,it=pe(Re),at=vt(v),ot=yt(at),st=(0,U.useRef)(null),ct=Ce(st,$e),B=ue({opened:y,defaultOpened:x,onDropdownOpen:()=>{S?.(),E&&B.selectFirstOption()},onDropdownClose:()=>{C?.(),B.resetSelectedOption()}}),{styleProps:V,rest:{type:lt,autoComplete:ut,...dt}}=w(rt),[H,W]=we({value:l,defaultValue:u,finalValue:[],onChange:d}),{getPillProps:ft,getListProps:pt,handleInputKeyDown:mt}=At({value:H,onChange:W,enabled:nt&&!M&&!j}),[ht,gt]=we({value:ie,defaultValue:A,finalValue:``,onChange:ae}),_t=e=>{gt(e),B.resetSelectedOption()}
1,bt=b({name:`TagsInput`,classes:{},props:t,classNames:n,styles:a,unstyled:o}),{resolvedClassNames:xt,resolvedStyles:St}=je({props:t,styles:a,classNames:n}),Ct=e=>{if((Xe?Xe(e,H):H.some(t=>t.toLowerCase()===e.toLowerCase()))&&(h?.(e),!m)){_t(``);return}if(H.length>=p){qe?.(e);return}D?.(e),_t(``),e.length>0&&W([...H,e])},wt=e=>{if(f?.(e),e.defaultPrevented||e.isPropagationStopped())return;let t=ht.trim(),{length:n}=t;if(oe.includes(e.key)&&n>0&&(W(ur({splitChars:oe,allowDuplicates:m,maxTags:p,value:ht,currentTags:H,isDuplicate:Xe,onDuplicate:h})),_t(``),e.preventDefault()),e.key===`Enter`&&n>0&&!e.nativeEvent.isComposing){if(e.preventDefault(),document.querySelector(`#${B.listId} [data-combobox-option][data-combobox-selected]`))return;Ct(t)}e.key===`Backspace`&&n===0&&H.length>0&&!e.nativeEvent.isComposing&&!j&&(Ge?.(H[H.length-1]),W(H.slice(0,H.length-1))),mt(e)},Tt=e=>{if(le?.(e),e.preventDefault(),e.clipboardData){let t=e.clipboardData.getData(`text/plain`);W(ur({splitChars:oe,allowDuplicates:m,maxTags:p,value:`${ht}${t}`,currentTags:H,isDuplicate:Xe,onDuplicate:h})),_t(``)}},Dt=H.map((e,t)=>{let n=()=>{let n=H.slice();n.splice(t,1),W(n),Ge?.(e)},r=ft(t);return We?(0,G.jsx)(U.Fragment,{children:We({option:ot[e]||{value:e,label:e,disabled:!1},value:e,onRemove:n,disabled:M||j,reorderProps:r})},`${e}-${t}`):(0,G.jsx)(ke,{withRemoveButton:!j,onRemove:n,unstyled:o,disabled:M,attributes:Qe,...bt(`pill`),...r,children:e},`${e}-${t}`)});(0,U.useEffect)(()=>{T&&B.selectFirstOption()},[T,H,ht]);let Ot=(0,G.jsx)(N.ClearButton,{...Be,onClear:()=>{W([]),_t(``),st.current?.focus(),B.openDropdown(),Ke?.()}});return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(N,{store:B,classNames:xt,styles:St,unstyled:o,size:c,readOnly:j,__staticSelector:`TagsInput`,attributes:Qe,floatingHeight:re,onOptionSubmit:e=>{D?.(e),_t(``),H.length>=p?qe?.(e):W([...H,ot[e].value]),B.resetSelectedOption()},...O,children:[(0,G.jsx)(N.DropdownTarget,{children:(0,G.jsx)(yn,{...V,__staticSelector:`TagsInput`,classNames:xt,styles:St,unstyled:o,size:c,className:r,style:i,variant:g,disabled:M,radius:de,rightSection:fe,__clearSection:Ot,__clearable:R&&H.length>0&&!M&&!j,__clearSectionMode:ze,rightSectionWidth:me,rightSectionPointerEvents:P,rightSectionProps:he,leftSection:ge,leftSectionWidth:_e,leftSectionPointerEvents:ve,leftSectionProps:ye,loading:et,loadingPosition:tt,inputContainer:be,inputWrapperOrder:xe,withAsterisk:Se,required:F,labelProps:Te,descriptionProps:Ee,errorProps:De,successProps:Oe,wrapperProps:Ae,description:I,label:Me,error:L,success:Ne,withErrorStyles:Pe,withSuccessStyles:Fe,__stylesApiProps:{...t,multiline:!0},id:it,mod:Ue,attributes:Qe,children:(0,G.jsxs)(ke.Group,{disabled:M,unstyled:o,...bt(`pillsList`),...pt(),children:[Dt,(0,G.jsx)(N.EventsTarget,{autoComplete:ut,withExpandedAttribute:!0,children:(0,G.jsx)(yn.Field,{...dt,ref:ct,...bt(`inputField`),unstyled:o,onKeyDown:wt,onFocus:e=>{se?.(e),Ze&&B.openDropdown()},onBlur:e=>{ce?.(e),Ye&&Ct(ht),B.closeDropdown()},onPaste:Tt,value:ht,onChange:e=>{Ht(e)||_t(e.currentTarget.value)},required:F&&H.length===0,disabled:M,readOnly:j,id:it})})]})})}),(0,G.jsx)(Et,{data:cr({data:at,value:H}),hidden:j||M,filter:ee,search:ht,limit:k,hiddenWhenEmpty:!0,withScrollArea:te,maxDropdownHeight:ne,unstyled:o,labelId:Me?`${it}-label`:void 0,"aria-label":Me?void 0:rt[`aria-label`],renderOption:z,scrollAreaProps:Je})]}),(0,G.jsx)(N.HiddenInput,{name:Ie,form:Le,value:H,valuesDivider:He,disabled:M,...Ve})]})});fr.classes={...Le.classes,...N.classes},fr.displayName=`@mantine/core/TagsInput`;var pr={root:`m_d08caa0`},mr=m(e=>{let t=_(`Typography`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,attributes:s,...c}=t,l=b({name:`Typography`,classes:pr,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:s});return(0,G.jsx)(x,{...l(`root`),...c})});mr.classes=pr,mr.displayName=`@mantine/core/Typography`;var hr=class extends Ke{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}
1fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:rt(t,n.data),hasPreviousPage:at(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}};function gr(e,t){return Ve(e,hr,t)}var _r=V(`outline`,`alert-circle`,`AlertCircle`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0`,key:`svg-0`}],[`path`,{d:`M12 8v4`,key:`svg-1`}],[`path`,{d:`M12 16h.01`,key:`svg-2`}]]),vr=V(`outline`,`alert-triangle`,`AlertTriangle`,[[`path`,{d:`M12 9v4`,key:`svg-0`}],[`path`,{d:`M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0`,key:`svg-1`}],[`path`,{d:`M12 16h.01`,key:`svg-2`}]]),yr=V(`outline`,`arrow-big-up-lines`,`ArrowBigUpLines`,[[`path`,{d:`M9 12h-3.586a1 1 0 0 1 -.707 -1.707l6.586 -6.586a1 1 0 0 1 1.414 0l6.586 6.586a1 1 0 0 1 -.707 1.707h-3.586v3h-6v-3`,key:`svg-0`}],[`path`,{d:`M9 21h6`,key:`svg-1`}],[`path`,{d:`M9 18h6`,key:`svg-2`}]]),br=V(`outline`,`arrow-down`,`ArrowDown`,[[`path`,{d:`M12 5l0 14`,key:`svg-0`}],[`path`,{d:`M18 13l-6 6`,key:`svg-1`}],[`path`,{d:`M6 13l6 6`,key:`svg-2`}]]),xr=V(`outline`,`congruent-to`,`CongruentTo`,[[`path`,{d:`M5 13h14`,key:`svg-0`}],[`path`,{d:`M5 17h14`,key:`svg-1`}],[`path`,{d:`M5 7.686c2.333 -2.624 4.667 -1.856 7 .064s4.667 2.688 7 .064`,key:`svg-2`}]]),Sr=V(`outline`,`copy`,`Copy`,[[`path`,{d:`M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666`,key:`svg-0`}],[`path`,{d:`M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1`,key:`svg-1`}]]),Cr=V(`outline`,`credits`,`Credits`,[[`path`,{d:`M3 14a6 2 0 1 0 12 0a6 2 0 1 0 -12 0`,key:`svg-0`}],[`path`,{d:`M3 14v5c0 1.105 2.686 2 6 2s6 -.895 6 -2v-5`,key:`svg-1`}],[`path`,{d:`M9 5a6 2 0 1 0 12 0a6 2 0 1 0 -12 0`,key:`svg-2`}],[`path`,{d:`M9 5v3`,key:`svg-3`}],[`path`,{d:`M18.365 11.656c1.59 -.36 2.635 -.966 2.635 -1.656v-5`,key:`svg-4`}]]),wr=V(`outline`,`device-mobile`,`DeviceMobile`,[[`path`,{d:`M6 5a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2v-14`,key:`svg-0`}],[`path`,{d:`M11 4h2`,key:`svg-1`}],[`path`,{d:`M12 17v.01`,key:`svg-2`}]]),Tr=V(`outline`,`download`,`Download`,[[`path`,{d:`M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2`,key:`svg-0`}],[`path`,{d:`M7 11l5 5l5 -5`,key:`svg-1`}],[`path`,{d:`M12 4l0 12`,key:`svg-2`}]]),Er=V(`outline`,`external-link`,`ExternalLink`,[[`path`,{d:`M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6`,key:`svg-0`}],[`path`,{d:`M11 13l9 -9`,key:`svg-1`}],[`path`,{d:`M15 4h5v5`,key:`svg-2`}]]),Dr=V(`outline`,`list-details`,`ListDetails`,[[`path`,{d:`M13 5h8`,key:`svg-0`}],[`path`,{d:`M13 9h5`,key:`svg-1`}],[`path`,{d:`M13 15h8`,key:`svg-2`}],[`path`,{d:`M13 19h5`,key:`svg-3`}],[`path`,{d:`M3 5a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4`,key:`svg-4`}],[`path`,{d:`M3 15a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1l0 -4`,key:`svg-5`}]]),Or=V(`outline`,`map-pin`,`MapPin`,[[`path`,{d:`M9 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0`,key:`svg-0`}],[`path`,{d:`M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0`,key:`svg-1`}]]),kr=V(`outline`,`message`,`Message`,[[`path`,{d:`M8 9h8`,key:`svg-0`}],[`path`,{d:`M8 13h6`,key:`svg-1`}],[`path`,{d:`M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12`,key:`svg-2`}]]),Ar=V(`outline`,`refresh`,`Refresh`,[[`path`,{d:`M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4`,key:`svg-0`}],[`path`,{d:`M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4`,key:`svg-1`}]]),jr=V(`outline`,`scan-eye`,`ScanEye`,[[`path`,{d:`M7 12q 5 -7 10 0`,key:`svg-0`}],[`path`,{d:`M7 12q 5 7 10 0`,key:`svg-1`}],[`path`,{d:`M12 12h-.01`,key:`svg-2`}],[`path`,{d:`M3 7v-2a2 2 0 0 1 2 -2h2`,key:`svg-3`}],[`path`,{d:`M3 17v2a2 2 0 0 0 2 2h2`,key:`svg-4`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`svg-5`}],[`path`,{d:`M17 21h2a2 2 0 0 0 2 -2v-2`,key:`svg-6`}]]),Mr=V(`outline`,`send`,`Send`,[[`path`,{d:`M10 14l11 -11`,key:`svg-0`}],[`path`,{d:`M21 3l-6.5 18a.55 .55 0 0 1 -1 0l-3.5 -7l-7 -3.5a.55 .55 0 0 1 0 -1l18 -6.5`,key:`svg-1`}]]),Nr=V(`outline`,`sparkles`,`Sparkles`,[[`path`,{d:`M16 18a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m0 -12a2 2 0 0 1 2 2a2 2 0 0 1 2 -2a2 2 0 0 1 -2 -2a2 2 0 0 1 -2 2m-7 12a6 6 0 0 1 6 -6a6 6 0 0 1 -6 -6a6 6 0 0 1 -6 6a6 6 0 0 1 6 6`,key:`svg-0`}]]),Pr=V(`outline`,`square-check`,`SquareCheck`,[[`path`,{d:`M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14`,key:`svg-0`}],[`path`,{d:`M9 12l2 2l4 -4`,key:`svg-1`}]]),Fr=V(`outline`,`square`,`Square`,[[`path`,{d:`M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14`,key:`svg-0`}]]),Ir=V(`outline`,`swords`,`Swords`,[[`path`,{d:`M21 3v5l-11 9l-4 4l-3 -3l4 -4l9 -11l5 0`,key:`svg-0`}],[`path`,{d:`M5 13l6 6`,key:`svg-1`}],[`path`,{d:`M14.32 17.32l3.68 3.68l3 -3l-3.365 -3.365`,key:`svg-2`}],[`path`,{d:`M10 5.5l-2 -2.5h-5v5l3 2.5`,key:`svg-3`}]]),Lr=V(`outline`,`user-circle`,`UserCircle`,[[`path`,{d:`M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0`,ke
1y:`svg-0`}],[`path`,{d:`M9 10a3 3 0 1 0 6 0a3 3 0 1 0 -6 0`,key:`svg-1`}],[`path`,{d:`M6.168 18.849a4 4 0 0 1 3.832 -2.849h4a4 4 0 0 1 3.834 2.855`,key:`svg-2`}]]),Rr=V(`outline`,`user-edit`,`UserEdit`,[[`path`,{d:`M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0`,key:`svg-0`}],[`path`,{d:`M6 21v-2a4 4 0 0 1 4 -4h3.5`,key:`svg-1`}],[`path`,{d:`M18.42 15.61a2.1 2.1 0 0 1 2.97 2.97l-3.39 3.42h-3v-3l3.42 -3.39`,key:`svg-2`}]]),zr=V(`outline`,`user`,`User`,[[`path`,{d:`M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0`,key:`svg-0`}],[`path`,{d:`M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2`,key:`svg-1`}]]),Br=V(`filled`,`circle-plus-filled`,`CirclePlusFilled`,[[`path`,{d:`M4.929 4.929a10 10 0 1 1 14.141 14.141a10 10 0 0 1 -14.14 -14.14m8.071 4.071a1 1 0 1 0 -2 0v2h-2a1 1 0 1 0 0 2h2v2a1 1 0 1 0 2 0v-2h2a1 1 0 1 0 0 -2h-2v-2z`,key:`svg-0`}]]);function Vr({icpScore:e,scoreColor:t,...n}){let r=e=>{if(!e)return`gray`;switch(e.toLowerCase()){case`high`:return`green`;case`medium`:return`yellow`;case`low`:return`gray`;default:return`gray`}};return(0,G.jsxs)(R,{gap:4,bg:`gray.0`,p:`sm`,style:{borderRadius:`var(--mantine-radius-md)`},...n,children:[(0,G.jsxs)(F,{justify:`space-between`,wrap:`nowrap`,children:[(0,G.jsx)(C,{size:`xs`,children:`Raw Match Score`}),(0,G.jsx)(C,{size:`xs`,fw:500,children:e.final_icp_score})]}),(0,G.jsxs)(F,{justify:`space-between`,wrap:`nowrap`,children:[(0,G.jsxs)(F,{gap:`xs`,wrap:`nowrap`,children:[(0,G.jsx)(C,{size:`sm`,c:`dimmed`,ff:`monospace`,children:`Ã`}),(0,G.jsxs)(C,{size:`xs`,children:[`ICP Priority (`,(0,G.jsx)(C,{span:!0,c:r(e.matched_icp_priority),fw:500,children:e.matched_icp_priority}),`)`]})]}),(0,G.jsx)(C,{size:`xs`,fw:500,children:(e.icp_priority_multiplier||0).toFixed(1)})]}),(0,G.jsxs)(F,{justify:`space-between`,wrap:`nowrap`,children:[(0,G.jsxs)(F,{gap:`xs`,wrap:`nowrap`,children:[(0,G.jsx)(C,{size:`xs`,c:`dimmed`,ff:`monospace`,children:`Ã`}),(0,G.jsxs)(C,{size:`xs`,children:[`Persona Priority (`,(0,G.jsx)(C,{span:!0,c:r(e.matched_persona_priority),fw:500,children:e.matched_persona_priority}),`)`]})]}),(0,G.jsx)(C,{size:`xs`,fw:500,children:(e.persona_priority_multiplier||0).toFixed(1)})]}),(0,G.jsx)(Ye,{my:4,variant:`dashed`}),(0,G.jsxs)(F,{justify:`space-between`,wrap:`nowrap`,preventGrowOverflow:!1,children:[(0,G.jsx)(C,{size:`xs`,fw:700,children:`Final Weighted Score`}),(0,G.jsx)(I,{color:t,variant:`filled`,miw:40,children:e.score})]})]})}function Hr({icpScore:e}){return(0,G.jsxs)(un,{spacing:`xs`,size:`sm`,center:!0,children:[e.top_reasons.map((e,t)=>(0,G.jsx)(un.Item,{icon:(0,G.jsx)(Ze,{color:`green`,size:20,radius:`xl`,variant:`light`,children:(0,G.jsx)(ye,{size:14})}),children:(0,G.jsx)(C,{size:`xs`,children:e})},`reason-${t}`)),e.mismatches.map((e,t)=>(0,G.jsx)(un.Item,{icon:(0,G.jsx)(Ze,{color:`red`,size:20,radius:`xl`,variant:`light`,children:(0,G.jsx)(ve,{size:14})}),children:(0,G.jsx)(C,{size:`xs`,children:e})},`mismatch-${t}`))]})}function Ur({icpScore:e,scoreColor:t,...n}){return(0,G.jsxs)(F,{grow:!0,preventGrowOverflow:!1,wrap:`nowrap`,...n,children:[(0,G.jsxs)(R,{gap:0,align:`center`,children:[(0,G.jsx)(ar,{size:40,thickness:3,roundCaps:!0,sections:[{value:e.persona_fit||0,color:t}],label:(0,G.jsx)(Je,{children:(0,G.jsx)(C,{size:`xs`,fw:700,children:e.persona_fit})})}),(0,G.jsx)(C,{size:`xs`,c:`dimmed`,fw:500,children:`Persona`})]}),(0,G.jsxs)(R,{gap:0,align:`center`,children:[(0,G.jsx)(ar,{size:40,thickness:3,roundCaps:!0,sections:[{value:e.company_fit||0,color:t}],label:(0,G.jsx)(Je,{children:(0,G.jsx)(C,{size:`xs`,fw:700,children:e.company_fit})})}),(0,G.jsx)(C,{size:`xs`,c:`dimmed`,fw:500,children:`Company`})]}),(0,G.jsxs)(R,{gap:0,align:`center`,children:[(0,G.jsx)(ar,{size:40,thickness:3,roundCaps:!0,sections:[{value:e.confidence||0,color:`blue`}],label:(0,G.jsx)(Je,{children:(0,G.jsx)(C,{size:`xs`,fw:700,children:e.confidence})})}),(0,G.jsx)(C,{size:`xs`,c:`dimmed`,fw:500,children:`Confidence`})]})]})}function Wr({profile:e,smallVersion:t=!1,compact:n=!1}){let[r,{close:i,open:a}]=Te(!1),o=e.additional_data.icp_score,s=(e=>e>=80?`green`:e>=60?`yellow`:`gray`)(o?.score||0),c=o?o.calculated_at?(0,G.jsxs)(R,{gap:`sm`,children:[(0,G.jsxs)(F,{justify:`space-between`,align:`center`,children:[(0,G.jsx)(C,{fw:700,size:`md`,children:`ICP Analysis`}),(0,G.jsxs)(I,{color:s,variant:`outline`,children:[`Score: `,o.score]})]}),(0,G.jsxs)(F,{gap:`xs`,wrap:`nowrap`,grow:!0,align:`flex-start`,preventGrowOverflow:!1,children:[(0,G.jsxs)(x,{miw:220,children:[(0,G.jsx)(Ur,{icpScore:o,scoreColor:s,mb:`sm`}),(0,G.jsx)(Vr,{icpScore:o,scoreColor:s})]}),!t&&(0,G.jsx)(Hr,{icpScore:o})]}),!t&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Ye,{my:0}),(0,G.jsx)(C,{size:`xs`,c:`dimmed`,fs:`italic`,lh:1.3,children:o.priority_note})]})]}):(0,G.jsxs)(F,{wrap:`nowrap`,children:[(0,G.jsx)(fe,{}),(0,G.jsx)(C,{size:`sm`,children:`This profile is currently scored. This can take some minutes.`})]}):(0,G.jsx)(C,{size:`sm`,children:`This profile is not scored yet. The scores are calculated in the background.`});return(0,G.jsxs)(te,{width:o?.calculated_at&&!t?600:250,position:`bottom`,withArrow:!0,shadow:`md`,opened:r,children:[(0,G.jsx)(te.Target,{children:(0,G.jsx)(ar,{size:n?24:t?38:48,thickness:n?3:4,roundCaps:!0,sections:[{value:o?.score||0,color:s}],onMouseEnter:a,onMouseLeave:i,style:{cursor:`pointer`},label:(0,G.jsx)(C,{c:s,fw:700,ta:`center`,size:t||n?`xs`:`sm`,style:n?{fontSize:10}:void 0,children:o?.score??`-`})})}),(0,G.jsx)(te.Dropdown,{style:{pointerEvents:`none`},children:c})]})}var Gr={button:`_button_10plb_1`,buttonActive:`_buttonActive_10plb_11`,buttonDisabled:`_buttonDisabled_10plb_22`};function Kr({action:e}){return(0,G.jsx)(L,{p:`md`,className:e.disabled?Gr.buttonDisabled:e.active?Gr.buttonActive:Gr.button,onClick:e.onClick,children:(e=>{let t=(0,G.jsxs)(F,{wrap:`nowrap`,children:[(0,G.jsx)(Ze,{variant:`light`,color:e.iconColor,size:`lg`,radius:`md`,children:(0,G.jsx)(e.icon,{size:20})}),(0,G.jsxs)(x,{children:[(0,G.jsx)(C,{size:`sm`,fw:700,children:e.title}),(0,G.jsx)(C,{size:`xs`,c:`dimmed`,children:e.description})]})]});return e.disabled?(0,G.jsx)(Me,{label:`Coming soon`,children:t}):t})(e)})}var qr={drawerMain:`_drawerMain_5ceb8_1`,header:`_header_5ceb8_8`,mainContent:`_mainContent_5ceb8_12`,actions:`_actions_5ceb8_22`};function Jr({actions:e,headerSection:t,headerRightSection:n,children:r,withScroll:i=!0,...a}){let o=i?(0,G.jsx)(se,{style:{flex:1},p:`xl`,type:`scroll`,scrollbarSize:8,children:r}):r;return(0,G.jsxs)(Ee,{position:`right`,size:`980px`,padding:0,withCloseButton:!1,classNames:{body:qr.drawerMain},...a,children:[(0,G.jsx)(ee.InitialFocus,{}),(0,G.jsx)(x,{p:`xl`,py:`md`,bg:`white`,className:qr.header,children:(0,G.jsxs)(F,{align:`flex-start`,justify:`space-between`,wrap:`nowrap`,children:[(0,G.jsx)(x,{children:t}),(0,G.jsxs)(F,{align:`flex-start`,wrap:`nowrap`,gap:`md`,children:[n,(0,G.jsx)(Pe,{onClick:a.onClose,size:`lg`})]})]})}),(0,G.jsxs)(Oe,{gap:0,direction:{base:`column`,sm:`row`},className:qr.mainContent,children:[o,e&&(0,G.jsxs)(x,{className:qr.actions,p:`xl`,children:[(0,G.jsx)(C,{size:`xs`,fw:700,c:`dimmed`,tt:`uppercase`,mb:`sm`,children:`Sherloq Actions`}),(0,G.jsx)(R,{gap:`md`,children:e.map(e=>(0,G.jsx)(Kr,{action:e},e.title))})]})]})]})}function Yr(e=!0,t=!1,n=!1,r=!1,i=!1){let{data:a,error:o,isFetching:s,refetch:c}=z({queryKey:[`contact`,`lists`,n,t],queryFn:()=>B.get(`/crm/lists/`,{params:{only_my:n?`1`:null,add_profiles_count:t?`1`:null,add_all_watchlist_option:r?`1`:null,add_no_watchlist_option:i?`1`:null}}).then(e=>e.data),staleTime:1e4,meta:{errorMessage:`Failed to load contact list.`}});return{contactLists:a&&a.constructor===Array?e?a.map(e=>({value:String(e.id),label:e.name,profiles:e?.profiles,relation_type:e.relation_type})):a:[],isLoading:s,refetch:c,error:o,updateLists:async e=>B.post(`/crm/lists/`,e).then(()=>c()).catch(()=>et(`Error updating watchlist. Please try again later.`))}}var Xr=({value:e,total:t,...n})=>(0,G.jsx)(Zn,{...n,total:t,value:e===void 0?void 0:Math.min(e,Math.max(t,1))}),Zr=({label:e,children:t,...n})=>e?(0,G.jsx)(Me,{position:`top`,withArrow:!0,...n,label:e,children:t}):t;function Qr(e,t){let n=e?.enrichments??{},r=e?.data_requested?e.data_requested[t]:!1,i=t in n,a=n[t];return{requestInProgress:r,isEnriched:i,hasData:!!a&&a.length>0,contactValues:a}}function $r(e,t,n,r){return e?`lime`:t?n?r:`red`:`gray`}function ei(e,t,n,r){return e?`Enrichment in progress ...`:t?n?r.join(`, `):`Enrichment failed. No data found.`:`Not enriched yet`}function ti({data:e,icon:t,dataKey:n,colorActive:r,title:i,disabledTooltip:a,smallVersion:o=!0,onEnrich:s}){let{requestInProgress:c,isEnriched:l,hasData:u,contactValues:d}=Qr(e,n),f=$r(c,l,u,r),p=ei(c,l,u,d),m=l?Ze:Ne,h=t;return o?(0,G.jsx)(Me,{label:p,withArrow:!0,children:(0,G.jsx)(m,{variant:`light`,color:f,radius:`md`,size:`lg`,style:{cursor:l?`default`:`pointer`},onClick:e=>{e.stopPropagation(),!l&&s?.()},children:(0,G.jsx)(h,{size:16})})}):(0,G.jsxs)(F,{gap:`sm`,wrap:`nowrap`,children:[(0,G.jsx)(Ze,{variant:`light`,color:f,size:`lg`,radius:`xl`,children:(0,G.jsx)(h,{size:18,stroke:1.5})}),c?(0,G.jsxs)(F,{wrap:`nowrap`,gap:`xs`,children:[(0,G.jsx)(fe,{size:`xs`}),(0,G.jsx)(C,{size:`sm`,fw:500,children:p})]}):l?(0,G.jsx)(C,{size:`sm`,fw:500,children:p}):(0,G.jsx)(G.Fragment,{children:(0,G.jsx)(Zr,{label:a,children:(0,G.jsxs)(P,{variant:`outline`,color:`blue.6`,size:`xs`,onClick:a?void 0:s,disabled:a?!0:void 0,children:[`Find `,i||`Data`]})})})]})}var ni=[{id:`mobile`,dataKey:`mobilePhones`,title:`Mobile Number`,description:`Verified mobile contact`,credits:1,icon:wr,color:`blue`},{id:`email`,dataKey:`emails`,title:`Email Address`,description:`Business or Personal`,credits:1,icon:ut,color:`orange`}];function ri({selectedItems:e,dataKey:t,onSuccess:n,...r}){let i=(0,U.useCallback)(()=>
1{if(!t)return[];let e=ni.find(e=>e.dataKey===t);return e?[e.id]:[]},[t]),[a,o]=(0,U.useState)(i),[s,c]=(0,U.useState)(!1),{stats:l}=Vf(),u=()=>{if(!e||!a)return;let t=a.reduce((e,t)=>({...e,[t]:!0}),{}),i={contact_ids:e.map(e=>e.id),...t};c(!0),B.post(`/connections/enrichment/request/`,i).then(e=>{o([]),r.onClose(),n?.(e.data.contact_ids),nt(`Enrichment request sent successfully. It may take a few seconds to process.`)}).catch(()=>et(`Error sending request. Please try again later.`)).finally(()=>c(!1))},d=e=>{o(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},f=()=>{a.length===ni.length?o([]):o(ni.map(e=>e.id))};(0,U.useEffect)(()=>{r.opened&&o(i())},[r.opened,t,i]);let p=t=>{let n=0;for(let r of e){let{isEnriched:e}=Qr(r.additional_data.enrichment,t.dataKey);e||(n+=t.credits)}return n},m=a.reduce((e,t)=>{let n=ni.find(e=>e.id===t);return e+(n?p(n):0)},0),h=(l?.user_credits.usage_limits.enrichment||0)-(l?.user_credits.usage.enrichment||0),g=e=>{if(!l)return!1;let t=p(e);return t!==0&&h>=t},_=()=>l?l.user_credits.usage_limits.enrichment?h===0?(0,G.jsx)(ze,{color:`yellow`,icon:(0,G.jsx)(Cr,{size:20,stroke:1.5}),children:`No credits left. Please upgrade your plan to enrich more contacts.`}):null:(0,G.jsx)(ze,{color:`orange`,icon:(0,G.jsx)(yr,{size:20,stroke:1.5}),children:`Your current plan does not support enrichment. Please upgrade your plan to unlock this feature.`}):null,v=ni.map(e=>(0,G.jsx)(L,{p:`md`,bg:g(e)?a.includes(e.id)?`sherloq.0`:`white`:`gray.1`,style:g(e)?{cursor:`pointer`}:{cursor:`not-allowed`},onClick:()=>{g(e)&&d(e.id)},children:(0,G.jsxs)(F,{wrap:`nowrap`,children:[(0,G.jsx)(qe,{checked:g(e)&&a.includes(e.id),onChange:()=>{},radius:`xs`,size:`md`,disabled:!g(e)}),(0,G.jsx)(Ze,{size:40,radius:`md`,variant:`light`,color:e.color,children:(0,G.jsx)(e.icon,{size:20})}),(0,G.jsxs)(x,{style:{flex:1},children:[(0,G.jsx)(C,{fw:600,size:`sm`,children:e.title}),(0,G.jsx)(C,{size:`xs`,c:`dimmed`,children:e.description})]}),(0,G.jsxs)(R,{gap:2,align:`flex-end`,children:[(0,G.jsxs)(I,{variant:`light`,color:`gray`,size:`lg`,tt:`capitalize`,children:[e.credits,` `,e.credits===1?`Credit`:`Credits`]}),(0,G.jsx)(C,{size:`xs`,c:`dimmed`,children:p(e)===0?`Not available`:(0,G.jsxs)(G.Fragment,{children:[`Total: `,p(e),` `,p(e)===1?`Credit`:`Credits`]})})]})]})},e.id));return(0,G.jsx)(de,{centered:!0,size:`lg`,padding:`xl`,radius:`lg`,withCloseButton:!0,zIndex:300,title:(0,G.jsxs)(F,{children:[(0,G.jsx)(Ze,{size:48,radius:`xl`,color:`sherloq`,variant:`light`,children:(0,G.jsx)(Ue,{size:24,color:`#16a34a`})}),(0,G.jsxs)(R,{gap:0,children:[(0,G.jsx)(C,{fw:700,size:`lg`,children:`Enrich Contact Data`}),(0,G.jsx)(C,{c:`dimmed`,size:`sm`,children:`Select data points to find`})]})]}),...r,onClose:()=>{o(i()),r.onClose?.()},children:(0,G.jsxs)(R,{gap:`md`,mt:`md`,children:[_(),(0,G.jsxs)(F,{justify:`space-between`,children:[(0,G.jsx)(C,{size:`xs`,fw:700,c:`dimmed`,tt:`uppercase`,children:`Available data points`}),(0,G.jsx)(P,{variant:`transparent`,size:`xs`,fw:700,onClick:f,pr:0,children:`Select All`})]}),(0,G.jsx)(R,{gap:`sm`,children:v.map(e=>e)}),(0,G.jsx)(Ye,{my:`sm`}),(0,G.jsxs)(F,{justify:`space-between`,align:`center`,children:[(0,G.jsxs)(x,{children:[(0,G.jsxs)(C,{size:`sm`,fw:600,children:[`Total Cost:`,` `,(0,G.jsxs)(C,{span:!0,fw:800,children:[m,` `,m===1?`Credit`:`Credits`]})]}),(0,G.jsxs)(C,{size:`xs`,c:`dimmed`,children:[`Available:`,` `,(0,G.jsx)(C,{span:!0,fw:700,children:h})]})]}),(0,G.jsxs)(F,{children:[(0,G.jsx)(P,{variant:`default`,onClick:r.onClose,children:`Cancel`}),(0,G.jsx)(P,{radius:`md`,leftSection:(0,G.jsx)(Ue,{size:16}),disabled:a.length===0||h<m,onClick:u,loading:s,children:`Find Contact Data`})]})]})]})})}var ii=({item:e,onEnrich:t})=>(0,G.jsx)(G.Fragment,{children:(0,G.jsxs)(R,{gap:`xs`,w:280,children:[ni.map(n=>(0,G.jsx)(ti,{data:e.additional_data.enrichment,dataKey:n.dataKey,colorActive:n.color,title:n.title,icon:n.icon,smallVersion:!1,onEnrich:()=>t?.(n.dataKey)},n.id)),(0,G.jsx)(P,{fullWidth:!0,radius:`md`,leftSection:(0,G.jsx)(Ue,{size:16}),onClick:()=>t?.(null),variant:`light`,children:`Enrich Contact Data`})]})});function ai({selectedItem:e,onSuccess:t,onEnrich:n,...r}){let a=i(),[o,s]=(0,U.useState)(!1),{userList:c}=Uf(!0,!0),{watchlistTags:l,refetch:u}=Gf(),{contactLists:d}=Yr(),[f,p]=(0,U.useState)([]),m=Re({mode:`uncontrolled`,initialValues:{url:``,user:``,tags:[],comments:``,lists:[],profile_position:``},validate:{}}),h=(0,U.useRef)(m);h.current=m;let g=(0,U.useCallback)(e=>{e?(p(e.profile.current_positions.map(e=>({value:String(e.id),label:`${e.title} at ${e.company.name}`}))),h.current.setValues({tags:e.tags,user:String(e.user.id),comments:e.comments,lists:e.lists.map(e=>e.toString()),profile_position:e.profile_position?String(e.profile_position):``})):h.current.reset()},[]);(0,U.useEffect)(()=>{g(e)},[e,g]);let _=async n=>{s(!0);let r;if(e){let t=`/crm/watchlist/${e.id}/`;r=B.put(t,n)}else r=B.post(`/crm/watchlist/`,n);r.then(e=>{u(),t(),g(e.data)}).catch(()=>et(`Error updating watchlist item.`)).finally(()=>s(!1))};if(!e)return null;let v=(0,G.jsxs)(F,{align:`flex-start`,gap:`md`,wrap:`nowrap`,style:{flex:1},children:[(0,G.jsxs)(R,{gap:`xs`,align:`center`,children:[(0,G.jsx)(Vt,{src:e.profile.image,size:84,radius:`100%`}),(0,G.jsx)(Wr,{profile:e.profile})]}),(0,G.jsxs)(R,{gap:`xs`,children:[(0,G.jsx)(C,{fw:700,size:`xl`,lh:1,children:e.profile.name}),(0,G.jsx)(C,{size:`sm`,c:`dimmed`,lh:1,children:e.profile.headline}),(0,G.jsxs)(F,{gap:`xs`,mt:4,children:[(0,G.jsx)(Vt,{radius:`md`,src:e.profile.company?.logo,size:`sm`,name:e.profile.company?.name||`..`,variant:`filled`,color:`gray.4`}),(0,G.jsx)(C,{fw:600,size:`sm`,children:e.profile.company?.name||`No Company`})]}),(0,G.jsxs)(F,{gap:`xs`,c:`dimmed`,children:[(0,G.jsx)(Or,{size:14}),(0,G.jsx)(C,{size:`xs`,children:e.profile.location})]})]})]});return(0,G.jsx)(Jr,{headerSection:v,headerRightSection:(0,G.jsx)(ii,{item:e,onEnrich:n}),actions:[{title:`Deep Dive`,description:`Full analysis & insights`,icon:jr,iconColor:`green`,onClick:()=>a(`/profiles/${e.profile.public_id}/`)},{title:`Find similar`,description:`Profiles like this one`,icon:xr,iconColor:`green`,onClick:()=>a(`/watchlist`,{state:{similar_profile:e.profile.public_id}})},{title:`Go to Profile`,description:`Open LinkedIn`,icon:We,iconColor:`blue`,onClick:()=>window.open(e.profile.linkedin_url,`_blank`)},{title:`Draft DM`,description:`AI personalized message`,icon:kr,iconColor:`blue`,onClick:()=>null,disabled:!0},{title:`Download`,description:`Download contact details`,icon:Tr,iconColor:`blue`,onClick:()=>null,disabled:!0}],...r,children:(0,G.jsx)(`form`,{onSubmit:m.onSubmit(_),children:(0,G.jsxs)(L,{p:0,style:{overflow:`hidden`},children:[(0,G.jsxs)(x,{p:`md`,children:[(0,G.jsx)(C,{size:`xs`,fw:700,c:`dimmed`,tt:`uppercase`,mb:`sm`,children:`Assigned Lists`}),(0,G.jsx)(Tn,{variant:`unstyled`,placeholder:`Add to list`,disabled:o,data:d,hidePickedOptions:!0,searchable:!0,mb:`xl`,rightSectionPointerEvents:`none`,rightSection:null,pointer:!0,...m.getIn
1putProps(`lists`)},m.key(`lists`)),(0,G.jsx)(C,{size:`xs`,fw:700,c:`dimmed`,tt:`uppercase`,mb:`sm`,children:`Tags`}),(0,G.jsx)(fr,{variant:`unstyled`,placeholder:`Add tags`,disabled:o,data:l,mb:`xl`,...m.getInputProps(`tags`)},m.key(`tags`)),f.length>1&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(C,{size:`xs`,fw:700,c:`dimmed`,tt:`uppercase`,mb:`sm`,children:`Current Position`}),(0,G.jsx)(sr,{placeholder:`Select position`,...m.getInputProps(`profile_position`),disabled:o,data:f,mb:`xl`},m.key(`profile_position`))]}),c&&c.length>1&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(C,{size:`xs`,fw:700,c:`dimmed`,tt:`uppercase`,mb:`sm`,children:`Assigned user`}),(0,G.jsx)(sr,{placeholder:`Select assignee`,...m.getInputProps(`user`),disabled:o,data:c,mb:`xl`},m.key(`user`))]}),(0,G.jsx)(C,{size:`xs`,fw:700,c:`dimmed`,tt:`uppercase`,mb:`sm`,children:`Comment`}),(0,G.jsx)(nn,{placeholder:`Write a note about this profile...`,autosize:!0,minRows:2,maxRows:6,...m.getInputProps(`comments`)},m.key(`comments`))]}),(0,G.jsx)(Ye,{}),(0,G.jsx)(F,{justify:`flex-end`,p:`xs`,bg:`gray.0`,children:(0,G.jsx)(P,{size:`xs`,leftSection:(0,G.jsx)(Tr,{size:14}),type:`submit`,loading:o,children:`Save`})})]})})})}function oi({title:e,subtitle:t,buttonText:n=`Save changes`,lists:r,onUpdate:i,externallyManaged:a=!0,onUpdateSuccess:o}){let[s,c]=(0,U.useState)([]),[l,u]=(0,U.useState)([]),[d,f]=(0,U.useState)(!1),{contactLists:p,isLoading:m,updateLists:h}=Yr(!1),[g,_]=(0,U.useState)(!1);(0,U.useEffect)(()=>{let e=r;a||(e=p),e&&e.length>0?(c(e),u(Array(e.length).fill(``))):(c([]),u([]))},[r,p,a]);let v=(e,t)=>{let n=[...s];if(n[e]={...n[e],name:t},c(n),l[e]){let t=[...l];t[e]=``,u(t)}},y=(e,t)=>{let n=[...s];n[e]={...n[e],relation_type:t},c(n)},b=e=>
1{let t=s.filter((t,n)=>n!==e),n=l.filter((t,n)=>n!==e);c(t),u(n)},S=()=>{let e={id:void 0,name:``,relation_type:`N`};c([...s,e]),u([...l,``]),d&&f(!1)},w=()=>{let e=[],t={};return s.forEach(e=>{let n=e.name.trim().toLowerCase();n&&(t[n]=(t[n]||0)+1)}),s.forEach((n,r)=>{let i=n.name.trim();i===``?e[r]=`Watchlist name is required`:t[i.toLowerCase()]>1?e[r]=`Watchlist name must be unique`:e[r]=``}),e};return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(mn,{visible:a===!1&&(m||g),zIndex:1e3}),(0,G.jsxs)(x,{mih:350,children:[e&&(0,G.jsx)(C,{size:`sm`,fw:600,children:e}),t&&(0,G.jsx)(C,{size:`sm`,mb:`lg`,children:t}),s.map((e,t)=>(0,G.jsx)(L,{p:`xs`,withBorder:!0,bg:`gray.0`,mb:`xs`,children:(0,G.jsxs)(F,{wrap:`nowrap`,gap:`xs`,children:[(0,G.jsx)(Ie,{style:{flex:1},size:`sm`,placeholder:`Add the name of the Watchlist`,value:e.name,onChange:e=>v(t,e.currentTarget.value),error:l[t]||null}),(0,G.jsx)(Yt,{data:Object.entries(Ge).map(([e,t])=>({value:e,label:t})),value:e.relation_type,onChange:e=>{e&&y(t,e)},comboboxProps:{width:`max-content`,position:`bottom-start`,zIndex:400},withAlignedLabels:!0,children:(0,G.jsx)(Yt.Target,{children:(0,G.jsx)(Ne,{size:`lg`,color:e.relation_type===`T`?`lime.5`:e.relation_type===`C`?`red.5`:`gray.5`,children:e.relation_type===`T`?(0,G.jsx)(Xe,{style:{height:`80%`,width:`80%`},stroke:1.5}):e.relation_type===`C`?(0,G.jsx)(Ir,{style:{height:`80%`,width:`80%`},stroke:1.5}):(0,G.jsx)(zr,{style:{height:`80%`,width:`80%`},stroke:1.5})})})}),(0,G.jsx)(Ne,{size:32,radius:`xl`,variant:`filled`,onClick:()=>b(t),children:(0,G.jsx)(Qe,{size:18,stroke:1.5})})]})},t)),(0,G.jsx)(P,{fullWidth:!0,size:`md`,variant:`outline`,onClick:S,leftSection:(0,G.jsx)(Br,{}),style:{borderStyle:`dashed`},children:`Add Watchlist`})]}),d&&(0,G.jsx)(ze,{icon:(0,G.jsx)(lt,{size:16}),title:`Watchlist Required`,color:`red`,mt:`md`,children:`Please add at least one watchlist to proceed.`}),(0,G.jsx)(P,{fullWidth:!0,mt:`xl`,size:`md`,onClick:()=>{if(s.length===0){f(!0);return}f(!1);let e=w();u(e),!e.some(e=>e!==``)&&(a===!0?i?.(s):(_(!0),h(s).then(()=>o?.()).finally(()=>_(!1))))},children:n})]})}var si=e=>/(https?:\/\/)?([\w]+\.)?linkedin\.com\//i.test(e),ci=3;function li({w:e,value:t,onSetValue:n,textProps:r,disabled:i}){let a=ue(),[o,s]=(0,U.useState)(``),[c,l]=we({value:t,defaultValue:``,onChange:e=>{n&&n(e)}}),{data:u,isFetching:d,fetchNextPage:f,hasNextPage:p,isFetchingNextPage:m}=gr({queryKey:[`linkedin`,`profile`,`contact_selector`,o],queryFn:({pageParam:e})=>B.get(`/linkedin/search/`,{params:{search:o,cursor:e}}).then(e=>e.data),initialPageParam:null,getNextPageParam:e=>e.next_cursor||null,enabled:o.length>=ci&&!si(o),staleTime:6e4,meta:{errorMessage:`Failed to search for profiles on LinkedIn.`}}),h=u?u.pages.flatMap(e=>e.results):[],g=u?h.map(e=>(0,G.jsx)(N.Option,{value:e.linkedin_url,disabled:e.in_watchlist,children:(0,G.jsxs)(F,{gap:`sm`,wrap:`nowrap`,children:[(0,G.jsx)(Vt,{src:e.image,size:36,radius:`xl`}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(C,{size:`sm`,children:e.name}),(0,G.jsx)(C,{size:`xs`,c:`dimmed`,lineClamp:2,children:e.headline}),e.in_watchlist?(0,G.jsx)(C,{size:`xs`,c:`orange`,children:`Already in watchlist`}):null]})]})},e.linkedin_url)):[],_=()=>{c&&!si(c)&&a.openDropdown()};return(0,G.jsxs)(N,{store:a,position:`bottom`,middlewares:{size:!0},onOptionSubmit:e=>{l(e),a.closeDropdown()},disabled:i,children:[(0,G.jsx)(N.Target,{withAriaAttributes:!1,children:(0,G.jsx)(be,{w:e,value:c,placeholder:`Search here or add LinkedIn URL`,onChange:e=>{let t=e.currentTarget.value;l(t),t&&!si(t)?(a.openDropdown(),a.updateSelectedOptionIndex()):a.closeDropdown()},onSearch:e=>{s(e)},onClick:_,onFocus:_,onBlur:()=>{a.closeDropdown(),n&&c.trim()!==``&&n(c)},leftSection:null,rightSection:null,disabled:i,...r})}),(0,G.jsxs)(N.Dropdown,{style:{overflowY:`auto`},children:[(0,G.jsx)(mn,{visible:d&&!m,zIndex:1e3}),(0,G.jsxs)(N.Options,{children:[g.length>0?g:(0,G.jsx)(N.Empty,{children:(0,G.jsx)(C,{size:`sm`,c:`dimmed`,p:`xs`,children:o.length<ci?`Type at least ${ci} characters to search`:`No profiles found for your search`})}),p&&(0,G.jsx)(N.Empty,{children:(0,G.jsx)(P,{fullWidth:!0,mt:`md`,size:`compact-sm`,variant:`light`,loading:m,onClick:()=>f(),children:`Load more`})})]})]})]})}var ui=RegExp(`^(https?:\\/\\/)?((www|\\w\\w)\\.)?linkedin\\.com\\/in\\/([a-zA-Z0-9-_.~%]{3,100})\\/?(\\?.*)?$`),di=`Add Watchlist profiles`,fi=`Please enter a valid LinkedIn profile URL (e.g., https://linkedin.com/in/username)`;function pi({onSubmitValue:e,buttonText:t=di,minProfiles:n=0,loading:r,paperProps:i}){let{contactLists:a}=Yr(),[o,s]=(0,U.useState)([]),[c,l]=(0,U.useState)(``),[u,{open:d,close:f}]=Te(!1),p=(e,t)=>{s(n=>{let r=[...n];return r[e]={...r[e]||{url:``,lists:[]},...t,error:void 0},r}),l(``)},m=e=>{let t=e.filter(e=>e.url.trim()!==``);if(n&&t.length<n)return l(`Please add at least ${n} LinkedIn profile(s) to continue.`),{isValid:!1,updatedProfiles:e};let r=e.map(e=>({...e,error:e.url&&!ui.test(e.url.trim())?fi:void 0}));return{isValid:!r.some(e=>e.error),updatedProfiles:r}},h=()=>{let{isValid:t,updatedProfiles:n}=m(o);s(n),t&&e&&e(n,()=>{s([])})},g=[...o,{url:``,lists:[],error:void 0}];return(0,G.jsxs)(G.Fragment,{children:[c&&(0,G.jsx)(ze,{icon:(0,G.jsx)(_r,{size:`1rem`}),color:`red`,mb:`md`,children:c}),(0,G.jsxs)(L,{...i,children:[(0,G.jsxs)(C,{size:`sm`,fw:600,children:[`Add LinkedIn profiles to wat
1ch `,n>1&&`(at least ${n} profiles)`]}),(0,G.jsx)(C,{size:`sm`,mb:`lg`,children:`Add LinkedIn URL or search in the field within your LinkedIn contact list`}),g.map((e,t)=>(0,G.jsxs)(F,{wrap:`nowrap`,gap:`xs`,grow:!0,preventGrowOverflow:!1,mb:`sm`,children:[(0,G.jsx)(li,{value:e.url,onSetValue:e=>p(t,{url:e}),textProps:{error:e.error||``},disabled:r,w:400}),(0,G.jsx)(Se,{data:a,placeholder:`Watchlist (optional)`,value:e.lists,onSetValue:e=>p(t,{lists:e}),disabled:r,w:200,addElementLabel:`Add watchlist`,onAddElement:d}),t<o.length?(0,G.jsx)(Ne,{color:`red`,variant:`subtle`,onClick:()=>s(e=>e.filter((e,n)=>n!==t)),"aria-label":`Remove profile`,disabled:r,w:28,maw:28,children:(0,G.jsx)(Qe,{size:16})}):(0,G.jsx)(x,{w:28,maw:28})]},t))]}),(0,G.jsx)(P,{fullWidth:!0,mt:`xl`,size:`md`,onClick:h,loading:r,children:t}),(0,G.jsx)(de,{opened:u,onClose:f,title:`Watchlists`,size:`lg`,zIndex:301,overlayProps:{zIndex:300},children:(0,G.jsx)(oi,{externallyManaged:!1,onUpdateSuccess:f})})]})}function mi({selectedLists:e,onlyMyProfiles:t=!0,completeWatchlist:n=!1}){let{contactLists:r}=Yr(!0,!0,t,!0,!0),[i,a]=(0,U.useState)(``),o=t=>n&&t.value===`0`?!0:e.some(e=>e.value===t.value),s=(r?r.filter(e=>e.label.toLowerCase().includes(i.toLowerCase())):[]).map(e=>(0,G.jsx)(N.Option,{value:JSON.stringify(e),active:o(e),children:(0,G.jsxs)(F,{gap:`sm`,wrap:`nowrap`,children:[(0,G.jsx)(x,{w:16,mt:4,children:o(e)?(0,G.jsx)(Pr,{size:16}):(0,G.jsx)(Fr,{size:16})}),(0,G.jsxs)(I,{size:`md`,radius:`sm`,variant:`outline`,style:{cursor:`pointer`},color:He(e.relation_type),children:[e.label,` (`,e.profiles>1?`${e.profiles} profiles`:`${e.profiles} profile`,`)`]})]})},e.value));return(0,G.jsxs)(N.Group,{label:`Watchlists`,children:[(0,G.jsx)(N.Search,{value:i,onChange:e=>a(e.currentTarget.value),placeholder:`Search watchlists`}),(0,G.jsx)(se.Autosize,{mah:260,type:`auto`,offsetScrollbars:!0,children:s.length>0?s:(0,G.jsx)(N.Empty,{children:`No watchlist found`})})]})}function hi({selectedProfiles:e,handleProfileRemove:t,onlyMyProfiles:n=!0}){let{contactLists:r}=Yr(),[i,a]=(0,U.useState)(``),[o,s]=(0,U.useState)(1),{data:c}=z({queryKey:[`linkedin`,`sherloqai`,`posts`,`watchlist`,i,o],queryFn:()=>B.get(`/crm/watchlist/`,{params:{search:i,page_size:10,page:o,only_check:1,only_my:n?`1`:null}}).then(e=>e.data),meta:{errorMessage:`Failed to load watchlist.`}}),l=e.map(e=>(0,G.jsx)(ke,{withRemoveButton:!0,onRemove:()=>t(e),children:e.profile.name},e.id)),u=e=>e&&r?e.map(e=>{let t=r.find(t=>t.value===e.toString());return t?(0,G.jsx)(I,{size:`sm`,radius:`sm`,variant:`outline`,mr:4,mb:4,color:He(t.relation_type),children:t.label},e):null}):[],d=c?c.results.map(t=>(0,G.jsx)(N.Option,{value:JSON.stringify(t),active:e.some(e=>e.id===t.id),children:(0,G.jsxs)(F,{gap:`sm`,wrap:`nowrap`,children:[(0,G.jsx)(x,{w:16,mt:2,children:e.some(e=>e.id===t.id)?(0,G.jsx)(Pr,{size:16}):(0,G.jsx)(Fr,{size:16})}),(0,G.jsx)(Vt,{src:t.profile.image,size:36,radius:`xl`}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(C,{size:`sm`,children:t.profile.name}),(0,G.jsx)(C,{size:`xs`,c:`dimmed`,lineClamp:2,children:t.profile.headline}),u(t.lists)]})]})},t.profile.public_id)):[];return(0,G.jsxs)(N.Group,{label:`Profiles`,children:[l.length>0&&(0,G.jsx)(N.Empty,{children:(0,G.jsx)(ke.Group,{children:l})}),(0,G.jsx)(N.Search,{value:i,onChange:e=>{s(1),a(e.currentTarget.value)},placeholder:`Search profiles`}),(0,G.jsx)(se.Autosize,{mah:260,type:`auto`,offsetScrollbars:!0,children:d.length>0?d:(0,G.jsx)(N.Empty,{children:`No profile found`})}),c&&(0,G.jsx)(N.Empty,{children:(0,G.jsx)(Xr,{size:`sm`,total:c?.pages,value:o,onChange:s,mt:`sm`,hideWithOnePage:!0})})]})}function gi({selectedLists:e,onSelectedListsChange:t,selectedProfiles:n,onSelectedProfilesChange:r,onlyMyProfiles:i=!0,completeWatchlistOnEmpty:a=!0,lightVariant:o=!1}={}){let s=ue({onDropdownOpen:()=>{s.focusSearchInput()}}),[c,l]=we({value:e,defaultValue:[],onChange:t}),[u,d]=we({value:n,defaultValue:[],onChange:r}),f=e=>e&&typeof e==`object`&&`value`in e&&`label`in e,p=e=>e&&typeof e==`object`&&`id`in e&&`profile`in e,m=(e,t,n)=>{let r=e.findIndex(e=>n(e,t));return r===-1?[...e,t]:e.filter((e,t)=>
1t!==r)},h=e=>{let t=JSON.parse(e);if(f(t)){if(t.value===`0`&&a){l([]),d([]);return}let e=m(c,t,(e,t)=>e.value===t.value);a||e.find(e=>e.value===`0`)&&(t.value===`0`?(e=[t],d([])):e=e.filter(e=>e.value!==`0`)),l(e)}else if(p(t)){let e=m(u,t,(e,t)=>e.id===t.id);!a&&c.find(e=>e.value===`0`)&&l(c.filter(e=>e.value!==`0`)),d(e)}else console.warn(`Unknown item type passed to handleValueSelect:`,e)},g=e=>{let t=u.filter(t=>t.id!==e.id);d(t)},_=a?u.length===0&&c.length===0:c.find(e=>e.value===`0`)!==void 0;return(0,G.jsx)(x,{children:(0,G.jsxs)(N,{store:s,onOptionSubmit:h,hideDetached:!1,width:`min(420px, 92vw)`,children:[(0,G.jsx)(N.Target,{withAriaAttributes:!1,children:(0,G.jsx)(P,{fw:500,onClick:()=>s.toggleDropdown(),fullWidth:!0,leftSection:(0,G.jsx)(Lr,{size:18,stroke:1.5}),variant:o?`default`:`filled`,children:(()=>{let e=u.length===1?`Profile`:`Profiles`,t=c.length===1?`List`:`Lists`;return _?`All Profiles`:u.length>0&&c.length>0?`${u.length} ${e} & ${c.length} ${t}`:u.length>0?`${u.length} ${e}`:c.length>0?`${c.length} ${t}`:`Select Profiles & Lists`})()})}),(0,G.jsx)(N.Dropdown,{children:r?(0,G.jsx)(_e,{keepMounted:!1,elements:[{value:`lists`,label:`Lists`,icon:Dr,content:(0,G.jsx)(N.Options,{children:(0,G.jsx)(mi,{selectedLists:c,onlyMyProfiles:i,completeWatchlist:_})})},{value:`profiles`,label:`Profiles`,icon:Lr,content:(0,G.jsx)(N.Options,{children:(0,G.jsx)(hi,{selectedProfiles:u,handleProfileRemove:g,onlyMyProfiles:i})})}]}):(0,G.jsx)(N.Options,{children:(0,G.jsx)(mi,{selectedLists:c,onlyMyProfiles:i,completeWatchlist:_})})})]})})}var _i=({profile:e,add_link:t=!1,show_company:n=!1,dimmed:r=!1})=>(0,G.jsxs)(F,{gap:`sm`,wrap:`nowrap`,children:[(0,G.jsx)(Vt,{src:e.image,size:36,radius:`xl`,color:r?`gray.0`:void 0}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(C,{size:`sm`,component:`div`,children:t&&e.linkedin_url?(0,G.jsxs)(Be,{href:e.linkedin_url,target:`_blank`,c:r?`dimmed`:void 0,children:[e.name,` `,(0,G.jsx)(Ze,{size:`xs`,radius:`xs`,variant:`light`,children:(0,G.jsx)(Er,{style:{width:`80%`,height:`80%`}})})]}):e.name}),(0,G.jsx)(C,{size:`xs`,c:`dimmed`,lineClamp:2,children:e.headline}),n&&e.company&&(0,G.jsxs)(F,{gap:`xs`,wrap:`nowrap`,mt:`xs`,children:[(0,G.jsx)(Vt,{src:e.company.logo,size:16,radius:`xl`}),(0,G.jsx)(C,{size:`xs`,c:`dimmed`,children:e.company.name})]})]})]});function vi({profiles:e,setProfilesToAdd:t,profilesToAdd:n,total:r,onSubmitValue:i,submittingValues:a,additionalFilter:o}){let{contactLists:s}=Yr(),[c,l]=(0,U.useState)([]),[u,{open:d,close:f}]=Te(!1),[p,m]=(0,U.useState)(!1),h=(0,U.useCallback)(()=>{let t=e.filter(e=>!e.in_watchlist);return t.length>0&&t.every(e=>n.some(t=>t.public_id===e.public_id))},[e,n]);(0,U.useEffect)(()=>{if(e&&e.length>0){let e=h();m(e)}},[e,n,h]);let g=e=>{n.some(t=>t.public_id===e.public_id)?t(n.filter(t=>t.public_id!==e.public_id)):t([...n,e])},_=()=>{let r=e.filter(e=>!e.in_watchlist);if(h())t(n.filter(e=>!r.some(t=>t.public_id===e.public_id))),m(!1);else{let e=r.filter(e=>!n.some(t=>t.public_id===e.public_id));t([...n,...e]),m(!0)}},y=()=>{let e=n.filter(e=>!e.in_watchlist).map(e=>({url:e.linkedin_url,lists:c||[]}));i&&i(e,()=>{t([])})},b=e?e.map((e,t)=>(0,G.jsxs)(F,{mb:`sm`,wrap:`nowrap`,children:[(0,G.jsx)(v,{onClick:()=>g(e),disabled:e.in_watchlist,children:(0,G.jsx)(Ze,{w:24,variant:`transparent`,onClick:()=>g(e),color:e.in_watchlist?`gray.3`:void 0,children:e.in_watchlist||n.some(t=>t.public_id===e.public_id)?(0,G.jsx)(Pr,{size:20}):(0,G.jsx)(Fr,{size:20})})}),(0,G.jsx)(v,{onClick:()=>g(e),disabled:e.in_watchlist,style:{flex:1},children:(0,G.jsx)(_i,{profile:e,add_link:!0,show_company:!0,dimmed:e.in_watchlist},e.public_id)}),e.in_watchlist&&(0,G.jsx)(I,{color:`gray`,variant:`light`,size:`xs`,children:`watchlist`})]},t)):[];return(0,G.jsxs)(L,{withBorder:!0,p:`md`,shadow:`none`,children:[(0,G.jsxs)(F,{mb:`md`,grow:!0,children:[(0,G.jsx)(Se,{data:s,placeholder:`Select Watchlist (optional)`,disabled:n.length===0,value:c,onSetValue:l,addElementLabel:`Add watchlist`,onAddElement:d}),(0,G.jsxs)(P,{leftSection:(0,G.jsx)(xe,{size:14}),disabled:n.length===0,onClick:y,loading:a,children:[`Add to wat
1chlist (`,n.length,` profiles)`]})]}),(0,G.jsxs)(F,{mb:`sm`,wrap:`nowrap`,justify:`space-between`,children:[(0,G.jsxs)(F,{wrap:`nowrap`,children:[(0,G.jsx)(v,{onClick:_,children:(0,G.jsx)(Ze,{w:24,variant:`transparent`,onClick:_,children:p?(0,G.jsx)(Pr,{size:20}):(0,G.jsx)(Fr,{size:20})})}),(0,G.jsx)(v,{onClick:_,children:(0,G.jsx)(C,{size:`sm`,children:`All from current page`})})]}),o]}),b,r&&r>e.length&&(0,G.jsxs)(C,{c:`dimmed`,ta:`center`,size:`sm`,mt:`sm`,children:[r-e.length,` more profiles`]}),(0,G.jsx)(de,{opened:u,onClose:f,title:`Watchlists`,size:`lg`,zIndex:301,overlayProps:{zIndex:300},children:(0,G.jsx)(oi,{externallyManaged:!1,onUpdateSuccess:f})})]})}var yi={queued:`gray`,loading_profile:`blue`,loading_activities:`blue`,done:`green`,failed:`red`},bi=e=>{if(e===null||e<=0)return null;if(e<60)return`less than a minute`;let t=Math.round(e/60);return t<60?`~${t} min`:`~${Math.round(t/60)} h`};function xi({request:e,hideEta:t}){let n=t?null:bi(e.eta_seconds),r=e.status===`failed`;return(0,G.jsxs)(F,{gap:`xs`,wrap:`nowrap`,children:[(0,G.jsx)(Zr,{label:r&&e.error,multiline:!0,maw:240,children:(0,G.jsx)(I,{color:yi[e.status],variant:`light`,leftSection:r?(0,G.jsx)(vr,{size:12}):e.status===`queued`?null:(0,G.jsx)(fe,{size:10,color:yi[e.status]}),children:e.status_label})}),n&&(0,G.jsx)(C,{size:`xs`,c:`dimmed`,children:n})]})}var Si=function(e,t){return Si=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},Si(e,t)};function Ci(e,t){Si(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function wi(e){var t=typeof Symbol==`function`&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function Ti(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function Ei(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Ti(arguments[t]));return e}var Di=function(){function e(e,t){this.target=t,this.type=e}return e}(),Oi=function(e){Ci(t,e);function t(t,n){var r=e.call(this,`error`,n)||this;return r.message=t.message,r.error=t,r}return t}(Di),ki=function(e){Ci(t,e);function t(t,n,r){t===void 0&&(t=1e3),n===void 0&&(n=``);var i=e.call(this,`close`,r)||this;return i.wasClean=!0,i.code=t,i.reason=n,i}return t}(Di),Ai=function(){if(typeof WebSocket<`u`)return WebSocket},ji=function(e){return e!==void 0&&!!e&&e.CLOSING===2},Mi={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},Ni=function(){function e(e,t,n){var r=this;n===void 0&&(n={}),this._listeners={error:[],message:[],open:[],close:[]},this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._binaryType=`blob`,this._closeCalled=!1,this._messageQueue=[],this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=function(e){r._debug(`open event`);var t=r._options.minUptime,n=t===void 0?Mi.minUptime:t;clearTimeout(r._connectTimeout),r._uptimeTimeout=setTimeout(function(){return r._acceptOpen()},n),r._ws.binaryType=r._binaryType,r._messageQueue.forEach(function(e){return r._ws.send(e)}),r._messageQueue=[],r.onopen&&r.onopen(e),r._listeners.open.forEach(function(t){return r._callEventListener(e,t)})},this._handleMessage=function(e){r._debug(`message event`),r.onmessage&&r.onmessage(e),r._listeners.message.forEach(function(t){return r._callEventListener(e,t)})},this._handleError=function(e){r._debug(`error event`,e.message),r._disconnect(void 0,e.message===`TIMEOUT`?`timeout`:void 0),r.onerror&&r.onerror(e),r._debug(`exec error listeners`),r._listeners.error.forEach(function(t){return r._callEventListener(e,t)}),r._connect()},this._handleClose=function(e){r._debug(`close event`),r._clearTimeouts(),r._shouldReconnect&&r._connect(),r.onclose&&r.onclose(e),r._listeners.close.forEach(function(t){return r._callEventListener(e,t)})},this._url=e,this._protocols=t,this._options=n,this._options.startClosed&&(this._shouldReconnect=!1),this._connect()}return Object.defineProperty(e,"CONNECTING",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(e,"OPEN",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSING",{get:function(){return 2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSED",{get:function(){return 3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CONNECTING",{get:function(){return e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OPEN",{get:function(){return e.OPEN},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSING",{get:function(){return e.CLOSING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSED",{get:function(){return e.CLOSED},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"binaryType",{get:function(){return this._ws?this._ws.binaryType:this._binaryType},set:function(e){this._binaryType=e,this._ws&&(this._ws.binaryType=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"retryCount",{get:function(){return Math.max(this._retryCount,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bufferedAmount",{get:function(){return this._messageQueue.reduce(function(e,t){return typeof t==`string`?e+=t.length:t instanceof Blob?e+=t.size:e+=t.byteLength,e},0)+(this._ws?this._ws.bufferedAmount:0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"extensions",{get:function(){return this._ws?this._ws.extensions:``},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"protocol",{get:function(){return this._ws?this._ws.protocol:``},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"readyState",{get:function(){return this._ws?this._ws.readyState:this._options.startClosed?e.CLOSED:e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return this._ws?this._ws.url:``},enumerable:!0,configurable:!0}),e.prototype.close=function(e,t){if(e===void 0&&(e=1e3),this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),!this._ws){this._debug(`close enqueued: no ws instance`);return}if(this._ws.readyState===this.CLOSED){this._debug(`close: already closed`);return}this._ws.close(e,t)},e.prototype.reconnect=function(e,t){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,!this._ws||this._ws.readyState===this.CLOSED||this._disconnect(e,t),this._connect()},e.prototype.send=function(e){if(this._ws&&this._ws.readyState===this.OPEN)this._debug(`send`,e),this._ws.send(e);else{var t=this._options.maxEnqueuedMessages,n=t===void 0?Mi.maxEnqueuedMessages:t;this._messageQueue.length<n&&(this._debug(`enqueue`,e),this._messageQueue.push(e))}},e.prototype.addEventListener=function(e,t){this._listeners[e]&&this._listeners[e].push(t)},e.prototype.dispatchEvent=function(e){var t,n,r=this._listeners[e.type];if(r)try{for(var i=wi(r),a=i.next();!a.done;a=i.next()){var o=a.value;this._callEventListener(e,o)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return!0},e.prototype.removeEventListener=function(e,t){this._listeners[e]&&(this._listeners[e]=this._listeners[e].filter(function(e){return e!==t}))},e.prototype._debug=function(){var e=[...arguments];this._options.debug&&console.log.apply(console,Ei([`RWS>`],e))},e.prototype._getNextDelay=function(){var e=this._options,t=e.reconnectionDelayGrowFactor,n=t===void 0?Mi.reconnectionDelayGrowFactor:t,r=e.minReconnectionDelay,i=r===void 0?Mi.minReconnectionDelay:r,a=e.maxReconnectionDelay,o=a===void 0?Mi.maxReconnectionDelay:a,s=0;return this._retryCount>0&&(s=i*n**(this._retryCount-1),s>o&&(s=o)),this._debug(`next delay`,s),s},e.prototype._wait=function(){var e=this;return new Promise(function(t){setTimeout(t,e._getNextDelay())})},e.prototype._getNextUrl=function(e){if(typeof e==`string`)return Promise.resolve(e);if(typeof e==`function`){var t=e();if(typeof t==`string`)return Promise.resolve(t);if(t.then)return t}throw Error(`Invalid URL`)},e.prototype._connect=function(){var e=this;if(!this._connectLock&&this._shouldReconnect){this._connectLock=!0;var t=this._options,n=t.maxRetries,r=n===void 0?Mi.maxRetries:n,i=t.connectionTimeout,a=i===void 0?Mi.connectionTimeout:i,o=t.WebSocket,s=o===void 0?Ai():o;if(this._retryCount>=r){this._debug(`max retries reached`,this._retryCount,`>=`,r);return}if(this._retryCount++,this._debug(`connect`,this._retryCount),this._removeListeners(),!ji(s))throw Error(`No valid WebSocket class provided`);this._wait().then(function(){return e._getNextUrl(e._url)}).then(function(t){e._closeCalled||(e._debug(`connect`,{url:t,protocols:e._protocols}),e._ws=e._protocols?new s(t,e._protocols):new s(t),e._ws.binaryType=e._binaryType,e._connectLock=!1,e._addListeners(),e._connectTimeout=setTimeout(function(){return e._handleTimeout()},a))})}},e.prototype._handleTimeout=function(){this._debug(`timeout event`),this._handleError(new Oi(Error(`TIMEOUT`),this))},e.prototype._disconnect=function(e,t){if(e===void 0&&(e=1e3),this._clearTimeouts(),this._ws){this._removeListeners();try{this._ws.close(e,t),this._handleClose(new ki(e,t,this))}catch{}}},e.prototype._acceptOpen=function(){this._debug(`accept open`),this._retryCount=0},e.prototype._callEventListener=function(e,t){`handleEvent`in t?t.handleEvent(e):t(e)},e.prototype._removeListeners=function(){this._ws&&(this._debug(`removeListeners`),this._ws.removeEventListener(`open`,this._handleOpen),this._ws.removeEventListener(`close`,this._handleClose),this._ws.removeEventListener(`message`,this._handleMessage),this._ws.removeEventListener(`error`,this._handleError))},e.prototype._addListeners=function(){this._ws&&(this._debug(`addListeners`),this._ws.addEventListener(`open`,this._handleOpen),this._ws.addEventListener(`close`,this._handleClose),this._ws.addEventListener(`message`,this._handleMessage),this._ws.addEventListener(`error`,this._handleError))},e.prototype._clearTimeouts=function(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)},e}(),Pi=(0,U.createContext)(void 0),Fi=({children:e})=>{let[t,n]=(0,U.useState)(!1),[r,i]=(0,U.useState)(null),a=(0,U.useRef)({}),o=(0,U.useRef)(null),s=(0,U.useRef)(null),c=(0,U.useRef)(null),l=()=>{o.current!==null&&(o.current.send(`__ping__`),s.current=setTimeout(function(){console.log(`Ping timeout`)},2e3))},u=()=>{s.current&&clearTimeout(s.current)};return(0,U.useEffect)(()=>{ct().then(e=>i(e))},[]),(0,U.useEffect)(()=>
1{if(o.current||!r)return()=>{};let e=new Ni(`${H.wsUrl}/notifications/`);return e.onopen=()=>{n(!0),c.current&&clearInterval(c.current),c.current=setInterval(l,5e3)},e.onclose=()=>{n(!1)},e.onmessage=e=>{if(e.data===`__pong__`){u();return}let t=JSON.parse(e.data);if(a.current)for(let[,e]of Object.entries(a.current))e(t)},e.onerror=e=>{console.log(e)},o.current=e,()=>{c.current&&clearInterval(c.current),s.current&&clearTimeout(s.current),e.close()}},[r]),(0,G.jsx)(Pi,{value:{isReady:t,subscribe:(e,t)=>{a.current[e]=t},unsubscribe:e=>{e in a.current&&delete a.current[e]}},children:e})};function Ii(){let e=(0,U.use)(Pi),t=(0,U.useCallback)(e=>{if(e.event_type===`notification`&&!e.event.silent){let t=`sherloq.6`,n=0;switch(e.event.status){case`success`:t=`green`;break;case`error`:t=`red`,n=10;break;case`warning`:t=`orange`,n=5}tt.show({title:e.event.title,message:e.event.message,color:t,priority:n})}},[]);return(0,U.useEffect)(()=>(e?.subscribe(`server_notifications`,t),()=>{e?.unsubscribe(`server_notifications`)}),[e,t]),null}var Li=e=>e.status!==`done`&&e.status!==`failed`;function Ri(e){let t=it(),n=(0,U.use)(Pi),r=(0,U.useId)(),[i,a]=(0,U.useState)(null),{data:o,isPending:s,refetch:c}=z({queryKey:[`watchlist`,`pending`,e??null],queryFn:()=>B.get(`/crm/watchlist/pending/`,{params:e?{public_id:e}:void 0}).then(e=>e.data),meta:{errorMessage:`Failed to load profiles that are being added.`}}),l=o??[],u=l.filter(Li);(0,U.useEffect)(()=>{if(u.length===0)return;let e=setInterval(()=>void c(),2e4);return()=>clearInterval(e)},[u.length,c]);let d=(0,U.useCallback)(e=>{e.event_type===`notification`&&[`watchlist_request_updated`,`profile_loaded`,`activity_loaded`].includes(e.event.event_id)&&c()},[c]);(0,U.useEffect)(()=>{let e=`watchlist-requests-${r}`;return n?.subscribe(e,d),()=>{n?.unsubscribe(e)}},[n,d,r]);let f=(0,U.useCallback)(()=>t.invalidateQueries({queryKey:[`watchlist`,`pending`]}),[t]);return{requests:l,openRequests:u,request:e?l[0]??null:null,isPending:s,refetch:c,retryRequest:e=>(a(e),B.post(`/crm/watchlist/pending/${e}/retry/`).then(()=>f()).catch(e=>et(`Could not start another attempt.`,e.response)).finally(()=>a(null))),retryingId:i,dismissRequest:e=>B.delete(`/crm/watchlist/pending/${e}/`).then(()=>f()).catch(e=>et(`Could not dismiss the profile.`,e.response))}}function zi(){let{requests:e,retryRequest:t,retryingId:n,dismissRequest:r}=Ri();if(e.length===0)return null;let i=e.slice(0,10),a=e.length-i.length;return(0,G.jsxs)(L,{p:`md`,mb:`md`,children:[(0,G.jsxs)(F,{justify:`space-between`,mb:`sm`,children:[(0,G.jsxs)(C,{fw:500,children:[`Processing (`,e.length,`)`]}),(0,G.jsx)(C,{size:`xs`,c:`dimmed`,children:`Profiles are loaded one by one to stay within LinkedIn's limits.`})]}),(0,G.jsxs)(R,{gap:`xs`,children:[i.map(e=>(0,G.jsxs)(F,{justify:`space-between`,wrap:`nowrap`,children:[(0,G.jsxs)(F,{gap:`sm`,wrap:`nowrap`,style:{minWidth:0},children:[(0,G.jsx)(Vt,{src:e.image,size:`sm`,radius:`xl`}),(0,G.jsx)(C,{size:`sm`,lineClamp:1,children:e.name})]}),(0,G.jsxs)(F,{gap:`xs`,wrap:`nowrap`,children:[(0,G.jsx)(xi,{request:e}),e.status===`failed`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(P,{size:`compact-xs`,variant:`light`,leftSection:(0,G.jsx)(Ar,{size:12}),loading:n===e.id,onClick:()=>void t(e.id),children:`Try again`}),(0,G.jsx)(Me,{label:`Remove from this list`,children:(0,G.jsx)(Ne,{size:`sm`,variant:`subtle`,color:`gray`,onClick:()=>void r(e.id),children:(0,G.jsx)(ve,{size:14})})})]})]})]},e.id)),a>0&&(0,G.jsxs)(C,{size:`xs`,c:`dimmed`,children:[`+ `,a,` more`]})]})]})}var Bi={icpScoreFilter:``,scoreFilter:[1,10],activityType:``,selectedLists:[],selectedProfiles:[],withResponseFilter:``},Vi=`sherloq-activity-feed-advanced-filters`;function Hi(e){return e.withResponseFilter===`with_response`?`1`:e.withResponseFilter===`without_response`?`2`:null}function Ui(e){let t=0;return e.icpScoreFilter!==``&&(t+=1),(e.scoreFilter[0]!==1||e.scoreFilter[1]!==10)&&(t+=1),e.activityType!==``&&(t+=1),(e.selectedLists.length>0||e.selectedProfiles.length>0)&&(t+=1),e.withResponseFilter!==``&&(t+=1),t}function Wi(e,t){let[n,r]=ft({key:Vi,defaultValue:Bi,getInitialValueInEffect:!1}),[i,a]=(0,U.useState)(t),o=i?{...n,...i}:n,[s,c]=(0,U.useState)(o);return{applied:o,draft:s,updateDraft:e=>c(t=>({...t,...e})),syncDraftToApplied:()=>c(o),apply:()=>{a(void 0),r(s),e()},reset:()=>{a(void 0),c(Bi),r(Bi),e()},activeCount:Ui(o)}}function Gi(e){let{isPending:t,isError:n,error:r,data:i}=z({queryKey:[`competitor-alert`,e],queryFn:()=>B.get(`ai/competitor-alerts/${e}/`).then(e=>e.data),enabled:!!e,meta:{errorMessage:`Failed to load the competitor alert.`}});return{alert:i,isPending:t,isError:n,error:r}}function Ki(){let{data:e}=z({queryKey:[`competitor-alert-status`],queryFn:()=>B.get(`ai/competitor-alerts/status/`).then(e=>e.data),staleTime:3e5,meta:{errorMessage:`Failed to load the competitor radar status.`}});return{status:e}}function qi(e,t,n,r){let{isFetching:i,data:a,refetch:o,error:s}=z({queryKey:[`stats`,`activities`,e,t,r?.public_id,n],queryFn:async()=>
1{if(!e)return null;let i={date_range:e,list:t||null,profile_id:r?r.public_id:null,only_my:n?1:null};return B.get(`/crm/activities/stats/`,{params:i}).then(e=>e.data)},meta:{errorMessage:`Failed to load activity stats.`}});return{stats:a,isLoading:i,refetch:o,error:s}}var Ji=[`activity-scoring-status`];function Yi(){let{data:e}=z({queryKey:Ji,queryFn:()=>B.get(`ai/activities/scoring-status/`).then(e=>e.data),staleTime:3e5,meta:{errorMessage:`Failed to load the activity scoring status.`}});return{status:e}}function Xi(){let e=it();return(0,U.useCallback)(()=>e.invalidateQueries({queryKey:Ji}),[e])}function Zi(e=!1){let[t,n]=(0,U.useState)(!1),[r,i]=(0,U.useState)(``);return{addToWatchlist:(t,r=[])=>{n(!0),B.post(`/crm/watchlist/`,{public_id:t,lists:r||[]}).then(()=>{nt(`Profile ${t} was added to watchlist and is loaded in the background..`)}).catch(n=>{let r=`An error occurred while adding profile ${t} to watchlist.`;n.response?.data&&n.response?.data?.subscription_error&&(r=n.response?.data.subscription_error[0]),i(r),e||et(r,n.response)}).finally(()=>n(!1))},adding:t,error:r}}function Qi(){let{data:e,isFetching:t,isPending:n,refetch:r}=z({queryKey:[`connection`,`api`,`list`],queryFn:()=>B.get(`/connections/api/`).then(e=>e.data),meta:{errorMessage:`Failed to load connection list.`},staleTime:3e4});return{connections:e,isLoading:t||n,refetch:r}}function $i(e=!1){let t=e=>({initials:((e.first_name[0]||``)+(e.last_name[0]||``)).toUpperCase(),avatar:``,...e}),n=e=>{e.response?.status==401&&(dt(`auth-token`),window.location.replace(`/login`)),et(`Failed to load user.`)},{data:r,isFetching:i,refetch:a}=z({queryKey:[`auth`,`users`],queryFn:()=>B.get(`/user/me/`).then(e=>t(e.data)).catch(e=>{throw n(e),e}),staleTime:e?3e4:0,meta:{errorMessage:`Failed to load user.`}});return{user:r,isLoading:i,refetch:a}}var ea=()=>typeof window<`u`&&!!window.sherloqExtensionDetected,ta=500,na=5e3;function ra(){let[e,t]=(0,U.useState)(ea);return(0,U.useEffect)(()=>{if(e)return;let n=Date.now(),r=setInterval(()=>{ea()?(t(!0),clearInterval(r)):Date.now()-n>na&&clearInterval(r)},ta);return()=>clearInterval(r)},[e]),e}function ia(){let[e,t]=(0,U.useState)(!1),[n,r]=(0,U.useState)(!1),{data:i,isLoading:a,refetch:o,error:s}=z({queryKey:[`linkedin`,`connection`,`status`],queryFn:()=>B.get(`/linkedin/connect/`).then(e=>e.data),staleTime:3e4}),c=(0,U.use)(Pi),l=async()=>{try{t(!0);let e=await B.delete(`/linkedin/connect/`);return await o(),t(!1),e}catch(e){t(!1);let n=e;throw et(n?.data?.error?n.data.error:`Error disconnecting from LinkedIn.`),e}},u=async e=>(r(!0),await B.post(`/linkedin/connect/`,{auth_link:`1`,redirect_url:e}).then(e=>e.data.link).catch(()=>(et(`Error generating auth link.`),null)).finally(()=>r(!1))),d=(0,U.useCallback)(e=>{e.event_type===`notification`&&[`account_linked`,`account_unlinked`].includes(e.event.event_id)&&o()},[o]);return c?.subscribe(`li-connection`,d),{isConnected:i?i.is_connected:null,isErrored:i?i.is_errored:null,profile:i?i.profile:null,isLoading:a,isDisconnecting:e,isAuthLinkLoading:n,refetch:o,disconnect:l,authLink:u,error:s}}function aa(e,t){let n=(0,U.use)(Pi),r=(0,U.useId)(),i=(0,U.useCallback)(n=>{n.event_type===`notification`&&e.includes(n.event.event_id)&&t()},[t,e]);(0,U.useEffect)(()=>{let e=`notification-update-${r}`;return n?.subscribe(e,i),()=>{n?.unsubscribe(e)}},[n,i,r])}function oa(){let{data:e,isLoading:t,refetch:n,error:r}=z({queryKey:[`main`,`onboarding`,`status`],queryFn:()=>B.get(`/main/onboarding/status/`).then(e=>e.data),staleTime:1e4});return{isOnboarded:e?e.is_onboarded:null,isLoading:t,refetch:n,error:r}}function sa(){let e=(0,U.use)(Pi),[t,n]=(0,U.useState)([]),r=(0,U.useRef)(null),i=(0,U.useId)(),a=(0,U.useCallback)(()=>{r.current&&=(clearTimeout(r.current),null)},[]);(0,U.useEffect)(()=>()=>a(),[a]);let o=(0,U.useCallback)(()=>{a(),r.current=setTimeout(()=>n([]),5e3)},[a]),s=(0,U.useCallback)(e=>{if(e.event_type===`task_status`){if(Object.keys(e.event.payload).length===0)n([]),a();else{o();let t=Object.keys(e.event.payload).map(t=>`${t} (${e.event.payload[t]})`);n(t)}}},[a,o]);return(0,U.useEffect)(()=>{let t=`open_tasks_${i}`;return e?.subscribe(t,s),()=>{e?.unsubscribe(t)}},[e,s,i]),t}function ca(e,t,n){let{data:r,isPending:i,isError:a}=z({queryKey:[`person-activities`,e,t],queryFn:async()=>((await B.get(`/linkedin/activities/`,{params:{"profile_ids[]":[e],page_size:20}})).data?.results??[]).filter(e=>e.id!==t),enabled:n&&e!==void 0,meta:{errorMessage:`Failed to load further activities.`},staleTime:6e4});return{furtherActivities:r??[],isPending:n&&i,isError:a}}function la(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function ua(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){la(a,r,i,o,s,`next`,e)}function s(e){la(a,r,i,o,s,`throw`,e)}o(void 0)})}}
1function da(e,t,n){return(t=va(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?fa(Object(n),!0).forEach(function(t){da(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fa(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ma(e,t){if(e==null)return{};var n,r,i=ha(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ha(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function ga(){ga=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a=typeof Symbol==`function`?Symbol:{},o=a.iterator||`@@iterator`,s=a.asyncIterator||`@@asyncIterator`,c=a.toStringTag||`@@toStringTag`;function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},``)}catch{l=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof _?t:_,o=Object.create(a.prototype);return i(o,`_invoke`,{value:E(e,n,new k(r||[]))}),o}function d(e,t,n){try{return{type:`normal`,arg:e.call(t,n)}}catch(e){return{type:`throw`,arg:e}}}t.wrap=u;var f=`suspendedStart`,p=`suspendedYield`,m=`executing`,h=`completed`,g={};function _(){}function v(){}function y(){}var b={};l(b,o,function(){return this});var x=Object.getPrototypeOf,S=x&&x(x(te([])));S&&S!==n&&r.call(S,o)&&(b=S);var C=y.prototype=_.prototype=Object.create(b);function w(e){[`next`,`throw`,`return`].forEach(function(t){l(e,t,function(e){return this._invoke(t,e)})})}function T(e,t){function n(i,a,o,s){var c=d(e[i],e,a);if(c.type!==`throw`){var l=c.arg,u=l.value;return u&&typeof u==`object`&&r.call(u,`__await`)?t.resolve(u.__await).then(function(e){n(`next`,e,o,s)},function(e){n(`throw`,e,o,s)}):t.resolve(u).then(function(e){l.value=e,o(l)},function(e){return n(`throw`,e,o,s)})}s(c.arg)}var a;i(this,`_invoke`,{value:function(e,r){function i(){return new t(function(t,i){n(e,r,t,i)})}return a=a?a.then(i,i):i()}})}function E(t,n,r){var i=f;return function(a,o){if(i===m)throw Error(`Generator is already running`);if(i===h){if(a===`throw`)throw o;return{value:e,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var c=D(s,r);if(c){if(c===g)continue;return c}}if(r.method===`next`)r.sent=r._sent=r.arg;else if(r.method===`throw`){if(i===f)throw i=h,r.arg;r.dispatchException(r.arg)}else r.method===`return`&&r.abrupt(`return`,r.arg);i=m;var l=d(t,n,r);if(l.type===`normal`){if(i=r.done?h:p,l.arg===g)continue;return{value:l.arg,done:r.done}}l.type===`throw`&&(i=h,r.method=`throw`,r.arg=l.arg)}}}function D(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,r===`throw`&&t.iterator.return&&(n.method=`return`,n.arg=e,D(t,n),n.method===`throw`)||r!==`return`&&(n.method=`throw`,n.arg=TypeError(`The iterator does not provide a '`+r+`' method`)),g;var a=d(i,t.iterator,n.arg);if(a.type===`throw`)return n.method=`throw`,n.arg=a.arg,n.delegate=null,g;var o=a.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,n.method!==`return`&&(n.method=`next`,n.arg=e),n.delegate=null,g):o:(n.method=`throw`,n.arg=TypeError(`iterator result is not an object`),n.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function ee(e){var t=e.completion||{};t.type=`normal`,delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:`root`}],e.forEach(O,this),this.reset(!0)}function te(t){if(t||t===``){var n=t[o];if(n)return n.call(t);if(typeof t.next==`function`)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw TypeError(typeof t+` is not iterable`)}return v.prototype=y,i(C,`constructor`,{value:y,configurable:!0}),i(y,`constructor`,{value:v,configurable:!0}),v.displayName=l(y,c,`GeneratorFunction`),t.isGeneratorFunction=function(e){var t=typeof e==`function`&&e.constructor;return!!t&&(t===v||(t.displayName||t.name)===`GeneratorFunction`)},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,l(e,c,`GeneratorFunction`)),e.prototype=Object.create(C),e},t.awrap=function(e){return{__await:e}},w(T.prototype),l(T.prototype,s,function(){return this}),t.AsyncIterator=T,t.async=function(e,n,r,i,a){a===void 0&&(a=Promise);var o=new T(u(e,n,r,i),a);return t.isGeneratorFunction(n)?o:o.next().then(function(e){return e.done?e.value:o.next()})},w(C),l(C,c,`Generator`),l(C,o,function(){return this}),l(C,`toString`,function(){return`[object Generator]`}),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=te,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method=`next`,this.arg=e,this.tryEntries.forEac
1h(ee),!t)for(var n in this)n.charAt(0)===`t`&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if(e.type===`throw`)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return s.type=`throw`,s.arg=t,n.next=r,i&&(n.method=`next`,n.arg=e),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if(o.tryLoc===`root`)return i(`end`);if(o.tryLoc<=this.prev){var c=r.call(o,`catchLoc`),l=r.call(o,`finallyLoc`);if(c&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw Error(`try statement without catch or finally`);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,`finallyLoc`)&&this.prev<i.finallyLoc){var a=i;break}}a&&(e===`break`||e===`continue`)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method=`next`,this.next=a.finallyLoc,g):this.complete(o)},complete:function(e,t){if(e.type===`throw`)throw e.arg;return e.type===`break`||e.type===`continue`?this.next=e.arg:e.type===`return`?(this.rval=this.arg=e.arg,this.method=`return`,this.next=`end`):e.type===`normal`&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),ee(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if(r.type===`throw`){var i=r.arg;ee(n)}return i}}throw Error(`illegal catch attempt`)},delegateYield:function(t,n,r){return this.delegate={iterator:te(t),resultName:n,nextLoc:r},this.method===`next`&&(this.arg=e),g}},t}function _a(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function va(e){var t=_a(e,`string`);return typeof t==`symbol`?t:t+``}var ya={CLASSIC:`classic`,V1:`v1`},ba=ya.V1,xa=`https://cdn.paddle.com/paddle/paddle.js`,Sa=`https://cdn.paddle.com/paddle/v2/paddle.js`,Ca={url:xa},wa={url:Sa};function Ta(e){return document.querySelector(`script[src="${e}"]`)||void 0}function Ea(e){var t=document.createElement(`script`);t.src=e;var n=document.head||document.body;if(!n)throw Error(`Cannot inject Paddle.js. It needs a <head> or <body> element.`);return n.appendChild(t),t}var Da={classic:void 0,v1:void 0},Oa={classic:`PaddleClassic`,v1:`PaddleBillingV1`};function ka(e){var t=Aa(e)?.url;if(t){var n=Da[e],r=Oa[e];return n===void 0?(Da[e]=new Promise(function(n,i){if(typeof window>`u`){n(void 0);return}if(window[r]){n(window[r]);return}try{var a=Ta(t);a||=Ea(t),a.addEventListener(`load`,function(){window[r]?n(window[r]):i(Error(`Paddle.js not available`))}),a.addEventListener(`error`,function(){i(Error(`Failed to load Paddle.js - ${e}`))})}catch(e){i(e);return}}),Da[e]):n}}function Aa(e){if(e===ya.CLASSIC)return Ca;if(e===ya.V1)return wa;console.error(`[Paddle] Unknown Paddle Version`)}var ja=[`environment`,`version`],Ma=[`environment`,`version`];function Na(e,t){var n=e.environment;e.version;var r=ma(e,ja);try{n&&t.Environment.set(n),t.Initialized?t.Update(pa({},r)):t.Initialize(pa({},r))}catch(e){console.warn(`[Paddle] Paddle Initialization failed. Please check the inputs`,e)}}function Pa(e,t){var n=e.environment;e.version;var r=ma(e,Ma);try{n&&t.Environment.set(n),t.Setup(pa({},r))}catch(e){console.warn(`[Paddle] Paddle Initialization failed. Please check the inputs`,e)}}var Fa;(function(e){e.CHECKOUT_LOADED=`checkout.loaded`,e.CHECKOUT_CLOSED=`checkout.closed`,e.CHECKOUT_UPDATED=`checkout.updated`,e.CHECKOUT_COMPLETED=`checkout.completed`,e.CHECKOUT_ERROR=`checkout.error`,e.CHECKOUT_FAILED=`checkout.failed`,e.CHECKOUT_ITEMS_UPDATED=`checkout.items.updated`,e.CHECKOUT_ITEMS_REMOVED=`checkout.items.removed`,e.CHECKOUT_CUSTOMER_CREATED=`checkout.customer.created`,e.CHECKOUT_CUSTOMER_UPDATED=`checkout.customer.updated`,e.CHECKOUT_CUSTOMER_REMOVED=`checkout.customer.removed`,e.CHECKOUT_PAYMENT_SELECTED=`checkout.payment.selected`,e.CHECKOUT_PAYMENT_INITIATED=`checkout.payment.initiated`,e.CHECKOUT_PAYMENT_FAILED=`checkout.payment.failed`,e.CHECKOUT_PAYMENT_ERROR=`checkout.payment.error`,e.CHECKOUT_DISCOUNT_APPLIED=`checkout.discount.applied`,e.CHECKOUT_DISCOUNT_REMOVED=`checkout.discount.removed`,e.CHECKOUT_UPSELL_CANCELED=`checkout.upsell.canceled`})(Fa||={});var Ia;(function(e){e.DAY=`day`,e.WEEK=`week`,e.MONTH=`month`,e.YEAR=`year`})(Ia||={});var La;(function(e){e.ALIPAY=`alipay`,e.APPLE_PAY=`apple-pay`,e.CARD=`card`,e.GOOGLE_PAY=`google-pay`,e.IDEAL=`ideal`,e.PAYPAL=`paypal`,e.WECHAT_PAY=`wechat-pay`,e.WIRE_TRANSFER=`wire-transfer`,e.NONE=`
1none`})(La||={});var Ra;(function(e){e.AMERICAN_EXPRESS=`american_express`,e.DINERS_CLUB=`diners_club`,e.DISCOVER=`discover`,e.JCB=`jcb`,e.MADA=`mada`,e.MAESTRO=`maestro`,e.MASTER_CARD=`mastercard`,e.UNION_PAY=`union_pay`,e.VISA=`visa`,e.UNKNOWN=`unknown`})(Ra||={});var za;(function(e){e.DRAFT=`draft`,e.READY=`ready`,e.COMPLETED=`completed`,e.BILLED=`billed`,e.canceled=`canceled`,e.PAST_DUE=`past_due`})(za||={});function Ba(e){return Va.apply(this,arguments)}function Va(){return Va=ua(ga().mark(function e(t){var n,r;return ga().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t?.version||ba,e.next=3,ka(n);case 3:if(r=e.sent,!r){e.next=9;break}return t&&(n===ya.V1?Na(t,r):n===ya.CLASSIC&&Pa(t,r)),e.abrupt(`return`,r);case 9:return console.error(`[Paddle] Error Loading Paddle`),e.abrupt(`return`);case 11:case`end`:return e.stop()}},e)})),Va.apply(this,arguments)}function Ha(){let{data:e,isFetching:t}=z({queryKey:[`payment`,`config`],queryFn:()=>B.get(`/payment/config/`).then(e=>e.data),staleTime:1/0,meta:{errorMessage:`Failed to load config.`}});return{config:e,isLoading:t}}function Ua(e){let[t,n]=(0,U.useState)(),{config:r}=Ha();return(0,U.useEffect)(()=>{r&&Ba({environment:r.paddle.env,token:r.paddle.token,eventCallback:function(t){(t.name==`checkout.completed`||t.name==`checkout.closed`)&&e&&e(t.name)}}).then(e=>{e&&n(e)})},[r,e]),{paddle:t}}function Wa(e){return e.card_type===`convergence`?{...e,activities:e.activities.map(t=>({...t,related_post:e.post,keywords:e.keywords}))}:e}function Ga(e){let{page:t,pageSize:n,dateRange:r,timeframe:i,activityType:a,search:o,selectedLists:s,selectedProfiles:c,scoreFilter:l=[1,10],ordering:u,withRecommendations:d,withCompetitorAlerts:f,withHotPosts:p,severity:m,notificationId:h,activityId:g,icpScoreMin:_,onlyCardType:v,enabled:y=!0}=e,{isPending:b,isError:x,error:S,data:C,isFetching:w,isPlaceholderData:T,refetch:E}=z({queryKey:[`feed-cards`,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v],queryFn:async()=>{let e={group_by:`person`,page:t,page_size:n?Number(n):20,date_range:r||null,timeframe:!r&&i?i:null,type:a||null,search:o||null,list_ids:s?.length?s.map(e=>e.value):null,profile_ids:c?.length?c.map(e=>e.profile.id):null,score_min:l[0]===1?null:l[0],score_max:l[1]===10?null:l[1],ordering:u||null,with_recommendations:d||null,with_competitor_alerts:f?1:null,with_hot_posts:p?1:null,severity:m||null,notification_id:h||null,activity_id:g||null,icp_score_min:_||null,card_type:v||null},y=await B.get(`/linkedin/activities/`,{params:e});return{...y.data,results:y.data.results.map(Wa)}},meta:{errorMessage:`Failed to load activity feed.`},enabled:y,placeholderData:ot,staleTime:6e4});return{cards:C,isFetching:w,isPending:b,isError:x,error:S,isPlaceholderData:T,refetch:E}}function Ka(e,t){let[n,r]=(0,U.useState)(e),i=(0,U.useRef)(e instanceof Function?e():e);return[n,(0,U.useCallback)(e=>{JSON.stringify(i.current)!==JSON.stringify(e)&&(i.current=e,r(e),t(1))},[t])]}function qa(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Ja=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ya=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Xa={};function Za(e,t){return((t||Xa).jsx?Ya:Ja).test(e)}var Qa=/[ \t\n\f\r]/g;function $a(e){return typeof e==`object`?e.type===`text`&&eo(e.value):eo(e)}function eo(e){return e.replace(Qa,``)===``}var to=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};to.prototype.normal={},to.prototype.property={},to.prototype.space=void 0;function no(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new to(n,r,t)}function ro(e){return e.toLowerCase()}var io=class{constructor(e,t){this.attribute=t,this.property=e}};io.prototype.attribute=``,io.prototype.booleanish=!1,io.prototype.boolean=!1,io.prototype.commaOrSpaceSeparated=!1,io.prototype.commaSeparated=!1,io.prototype.defined=!1,io.prototype.mustUseProperty=!1,io.prototype.number=!1,io.prototype.overloadedBoolean=!1,io.prototype.property=``,io.prototype.spaceSeparated=!1,io.prototype.space=void 0;var ao=e({boolean:()=>q,booleanish:()=>J,commaOrSpaceSeparated:()=>lo,commaSeparated:()=>co,number:()=>Y,overloadedBoolean:()=>so,spaceSeparated:()=>X}),oo=0,q=uo(),J=uo(),so=uo(),Y=uo(),X=uo(),co=uo(),lo=uo();function uo(){return 2**++oo}var fo=Object.keys(ao),po=class extends io{constructor(e,t,n,r){let i=-1;
vendor: 4,239 bytes, line 1
1if(super(e,t),mo(this,`space`,r),typeof n==`number`)for(;++i<fo.length;){let e=fo[i];mo(this,fo[i],(n&ao[e])===ao[e])}}};po.prototype.defined=!0;function mo(e,t,n){n&&(e[t]=n)}function ho(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new po(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[ro(r)]=r,n[ro(a.attribute)]=r}return new to(t,n,e.space)}var go=ho({properties:{ariaActiveDescendant:null,ariaAtomic:J,ariaAutoComplete:null,ariaBusy:J,ariaChecked:J,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:X,ariaCurrent:null,ariaDescribedBy:X,ariaDetails:null,ariaDisabled:J,ariaDropEffect:X,ariaErrorMessage:null,ariaExpanded:J,ariaFlowTo:X,ariaGrabbed:J,ariaHasPopup:null,ariaHidden:J,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:X,ariaLevel:Y,ariaLive:null,ariaModal:J,ariaMultiLine:J,ariaMultiSelectable:J,ariaOrientation:null,ariaOwns:X,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:J,ariaReadOnly:J,ariaRelevant:null,ariaRequired:J,ariaRoleDescription:X,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:J,ariaSetSize:Y,ariaSort:null,ariaValueMax:Y,ariaValueMin:Y,ariaValueNow:Y,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function _o(e,t){return t in e?e[t]:t}function vo(e,t){return _o(e,t.toLowerCase())}var yo=ho({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:co,acceptCharset:X,accessKey:X,action:null,allow:null,allowFullScreen:q,allowPaymentRequest:q,allowUserMedia:q,alpha:q,alt:null,as:null,async:q,autoCapitalize:null,autoComplete:X,autoFocus:q,autoPlay:q,blocking:X,capture:null,charSet:null,checked:q,cite:null,className:X,closedBy:null,colorSpace:null,cols:Y,colSpan:Y,command:null,commandFor:null,content:null,contentEditable:J,controls:q,controlsList:X,coords:Y|co,crossOrigin:null,data:null,dateTime:null,decoding:null,default:q,defer:q,dir:null,dirName:null,disabled:q,download:so,draggable:J,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:q,formTarget:null,headers:X,height:Y,hidden:so,high:Y,href:null,hrefLang:null,htmlFor:X,httpEquiv:X,id:null,imageSizes:null,imageSrcSet:null,inert:q,inputMode:null,integrity:null,is:null,isMap:q,itemId:null,itemProp:X,itemRef:X,itemScope:q,itemType:X,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:q,low:Y,manifest:null,max:null,maxLength:Y,media:null,method:null,min:null,minLength:Y,multiple:q,muted:q,name:null,nonce:null,noModule:q,noValidate:q,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:q,optimum:Y,pattern:null,ping:X,placeholder:null,playsInl
1ine:q,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:q,referrerPolicy:null,rel:X,required:q,reversed:q,rows:Y,rowSpan:Y,sandbox:X,scope:null,scoped:q,seamless:q,selected:q,shadowRootClonable:q,shadowRootCustomElementRegistry:q,shadowRootDelegatesFocus:q,shadowRootMode:null,shadowRootSerializable:q,shape:null,size:Y,sizes:null,slot:null,span:Y,spellCheck:J,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Y,step:null,style:null,tabIndex:Y,target:null,title:null,translate:null,type:null,typeMustMatch:q,useMap:null,value:J,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:X,axis:null,background:null,bgColor:null,border:Y,borderColor:null,bottomMargin:Y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:q,declare:q,event:null,face:null,frame:null,frameBorder:null,hSpace:Y,leftMargin:Y,link:null,longDesc:null,lowSrc:null,marginHeight:Y,marginWidth:Y,noResize:q,noHref:q,noShade:q,noWrap:q,object:null,profile:null,prompt:null,rev:null,rightMargin:Y,rules:null,scheme:null,scrolling:J,standby:null,summary:null,text:null,topMargin:Y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Y,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:q,disablePictureInPicture:q,disableRemotePlayback:q,exportParts:co,part:X,prefix:null,property:null,results:Y,security:null,unselectable:null},space:`html`,transform:vo}),bo=ho({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`,maskType:`mask-type`,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
1-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:lo,accentHeight:Y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Y,amplitude:Y,arabicForm:null,ascent:Y,attributeName:null,attributeType:null,azimuth:Y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Y,by:null,calcMode:null,capHeight:Y,className:X,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:Y,diffuseConstant:Y,direction:null,display:null,dur:null,divisor:Y,dominantBaseline:null,download:q,dx:null,dy:null,edgeMode:null,editable:null,elevation:Y,enableBackground:null,end:null,event:null,exponent:Y,externalResourcesRequired:null,fill:null,fillOpacity:Y,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:co,g2:co,glyphName:co,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Y,horizOriginX:Y,horizOriginY:Y,id:null,ideographic:Y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Y,k:Y,k1:Y,k2:Y,k3:Y,k4:Y,kernelMatrix:lo,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Y,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Y,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:Y,overlineThickness:Y,paintOrder:null,panose1:null,path:null,pathLength:Y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:X,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:lo,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:lo,rev:lo,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:lo,requiredFeatures:lo,requiredFonts:lo,requiredFormats:lo,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,
1scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Y,specularExponent:Y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Y,strikethroughThickness:Y,string:null,stroke:null,strokeDashArray:lo,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Y,strokeOpacity:Y,strokeWidth:null,style:null,surfaceScale:Y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:lo,tabIndex:Y,tableValues:null,target:null,targetX:Y,targetY:Y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:lo,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Y,underlineThickness:Y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Y,values:null,vAlphabetic:Y,vMathematical:Y,vectorEffect:null,vHanging:Y,vIdeographic:Y,version:null,vertAdvY:Y,vertOriginX:Y,vertOriginY:Y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:_o}),xo=ho({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),So=ho({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:vo}),Co=ho({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),wo={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`},To=/[A-Z]/g,Eo=/-[a-z]/g,Do=/^data[-\w.:]+$/i;function Oo(e,t){let n=ro(t),r=t,i=io;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Do.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Eo,Ao);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Eo.test(e)){let n=e.replace(To,ko);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=po}return new i(r,t)}function ko(e){return`-`+e.toLowerCase()}function Ao(e){return e.charAt(1).toUpperCase()}var jo=no([go,yo,xo,So,Co],`html`),Mo=no([go,bo,xo,So,Co],`svg`);function No(e){return e.join(` `).trim()}var Po=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(` 2`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),Fo=n((e=>
2{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(Po());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),Io=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Lo=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Fo()),r=Io();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),Ro=Bo(`end`),zo=Bo(`start`);function Bo(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Vo(e){let t=zo(e),n=Ro(e);if(t&&n)return{start:t,end:n}}function Ho(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Wo(e.position):`start`in e||`end`in e?Wo(e):`line`in e||`column`in e?Uo(e):``}function Uo(e){return Go(e&&e.line)+`:`+Go(e&&e.column)}function Wo(e){return Uo(e&&e.start)+`-`+Uo(e&&e.end)}function Go(e){return e&&typeof e==`number`?e:1}var Ko=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Ho(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Ko.prototype.file=``,Ko.prototype.name=``,Ko.prototype.reason=``,Ko.prototype.message=``,Ko.prototype.stack=``,Ko.prototype.column=void 0,Ko.prototype.line=void 0,Ko.prototype.ancestors=void 0,Ko.prototype.cause=void 0,Ko.prototype.fatal=void 0,Ko.prototype.place=void 0,Ko.prototype.ruleId=void 0,Ko.prototype.source=void 0;var qo=t(Lo(),1),Jo={}.hasOwnProperty,Yo=new Map,Xo=/[A-Z]/g,Zo=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Qo=new Set([`td`,`th`]),$o=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function es(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=ds(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");
vendor: 67,257 bytes, lines 2-8
2if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=us(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Mo:jo,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=ts(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function ts(e,t,n){if(t.type===`element`)return ns(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return rs(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return as(e,t,n);if(t.type===`mdxjsEsm`)return is(e,t);if(t.type===`root`)return os(e,t,n);if(t.type===`text`)return ss(e,t)}function ns(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Mo,e.schema=i),e.ancestors.push(t);let a=_s(e,t.tagName,!1),o=fs(e,t),s=ms(e,t);return Zo.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!$a(e)})),cs(e,o,a,t),ls(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function rs(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}vs(e,t.position)}function is(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);vs(e,t.position)}function as(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Mo,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:_s(e,t.name,!0),o=ps(e,t),s=ms(e,t);return cs(e,o,a,t),ls(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function os(e,t,n){let r={};return ls(r,ms(e,t)),e.create(t,e.Fragment,r,n)}function ss(e,t){return t.value}function cs(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ls(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function us(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function ds(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=zo(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function fs(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Jo.call(t.properties,i)){let a=hs(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Qo.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function ps(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else vs(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else vs(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function ms(e,t){let n=[],r=-1,i=e.passKeys?new Map:Yo;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=ts(e,a,o);s!==void 0&&n.push(s)}return n}function hs(e,t,n){let r=Oo(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?qa(n):No(n)),r.property===`style`){let t=typeof n==`object`?n:gs(e,String(n));return e.stylePropertyNameCase===`css`&&(t=ys(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?wo[r.property]||r.property:r.attribute,n]}}function gs(e,t){try{return(0,qo.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Ko("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=$o+`#cannot-parse-style-attribute`,r}}function _s(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Za(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Za(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Jo.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);vs(e)}function vs(e,t){let n=new Ko("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=$o+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function ys(e){let t={},n;for(n in e)Jo.call(e,n)&&(t[bs(n)]=e[n]);return t}function bs(e){let t=e.replace(Xo,xs);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function xs(e){return`-`+e.toLowerCase()}var Ss={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`]},Cs={};function ws(e,t){let n=t||Cs;return Ts(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Ts(e,t,n){if(Ds(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Es(e.children,t,n)}return Array.isArray(e)?Es(e,t,n):``}function Es(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Ts(e[i],t,n);return r.join(``)}function Ds(e){return!!(e&&typeof e==`object`)}var Os=document.createElement(`i`);function ks(e){let t=`&`+e+`;`;Os.innerHTML=t;let n=Os.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function As(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function js(e,t){return e.length>0?(As(e,e.length,0,t),e):t}var Ms={}.hasOwnProperty;function Ns(e){let t={},n=-1;for(;++n<e.length;)Ps(t,e[n]);return t}function Ps(e,t){let n;for(n in t){let r=(Ms.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Ms.call(r,a)||(r[a]=[]);let e=i[a];Fs(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Fs(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);As(e,0,0,r)}function Is(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function Ls(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Rs=Js(/[A-Za-z]/),zs=Js(/[\dA-Za-z]/),Bs=Js(/[#-'*+\--9=?A-Z^-~]/);function Vs(e){return e!==null&&(e<32||e===127)}var Hs=Js(/\d/),Us=Js(/[\dA-Fa-f]/),Ws=Js(/[!-/:-@[-`{-~]/);function Z(e){return e!==null&&e<-2}function Gs(e){return e!==null&&(e<0||e===32)}function Q(e){return e===-2||e===-1||e===32}var Ks=Js(/\p{P}|\p{S}/u),qs=Js(/\s/);function Js(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Ys(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&zs(e.charCodeAt(n+1))&&zs(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function $(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Q(r)?(e.enter(n),s(r)):t(r)}function s(r){return Q(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Xs={tokenize:Zs};function Zs(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),$(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return Z(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Qs={tokenize:ec},$s={tokenize:tc};function ec(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return As(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check($s,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt($s,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return Z(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;As(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function tc(e,t,n){return $(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function nc(e){if(e===null||Gs(e)||qs(e))return 1;if(Ks(e))return 2}function rc(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var ic={name:`attention`,resolveAll:ac,tokenize:oc};function ac(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};sc(d,-c),sc(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=js(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=js(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=js(l,rc(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=js(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=js(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,As(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function oc(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=nc(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=nc(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function sc(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var cc={name:`autolink`,tokenize:lc};function lc(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return Rs(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||zs(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||zs(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Vs(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Bs(t)?(e.consume(t),l):n(t)}function u(e){return zs(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||zs(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var uc={partial:!0,tokenize:dc};function dc(e,t,n){return r;function r(t){return Q(t)?$(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Z(e)?t(e):n(e)}}var fc={continuation:{tokenize:mc},exit:hc,name:`blockQuote`,tokenize:pc};function pc(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Q(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function mc(e,t,n){let r=this;return i;function i(t){return Q(t)?$(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(fc,t,n)(r)}}function hc(e){e.exit(`blockQuote`)}var gc={name:`characterEscape`,tokenize:_c};function _c(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Ws(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var vc={name:`characterReference`,tokenize:yc};function yc(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=zs,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Us,u):(e.enter(`characterReferenceValue`),a=7,o=Hs,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===zs&&!ks(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var bc={partial:!0,tokenize:Cc},xc={concrete:!0,name:`codeFenced`,tokenize:Sc};function Sc(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Q(t)?$(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Z(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(bc,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),$(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Z(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Q(t)?$(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Z(t)?e.check(bc,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Z(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Q(t)?$(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Q(t)?$(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Z(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Cc(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var wc={name:`codeIndented`,tokenize:Ec},Tc={partial:!0,tokenize:Dc};function Ec(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),$(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):Z(t)?e.attempt(Tc,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Z(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Dc(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):$(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):Z(e)?i(e):n(e)}}var Oc={name:`codeText`,previous:Ac,resolve:kc,tokenize:jc};function kc(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Ac(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function jc(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Z(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Mc=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Nc(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Nc(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Nc(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);Nc(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Nc(this.left,t.reverse())}}}};function Nc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Pc(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Mc(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Fc(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return As(e,0,1/0,u.slice(0)),!l}function Fc(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Ic={resolve:Rc,tokenize:zc},Lc={partial:!0,tokenize:Bc};function Rc(e){return Pc(e),e}function zc(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Z(t)?e.check(Lc,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Bc(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),$(e,a,`linePrefix`)}function a(i){if(i===null||Z(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Vc(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Vs(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Z(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Gs(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Vs(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Hc(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Z(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Z(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Q(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Uc(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),$(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Z(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Wc(e,t){let n;return r;function r(i){return Z(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Q(i)?$(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Gc={name:`definition`,tokenize:qc},Kc={partial:!0,tokenize:Jc};function qc(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Hc.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Ls(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Gs(t)?Wc(e,l)(t):l(t)}function l(t){return Vc(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Kc,d,d)(t)}function d(t){return Q(t)?$(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Z(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Jc(e,t,n){return r;function r(t){return Gs(t)?Wc(e,i)(t):n(t)}function i(t){return Uc(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Q(t)?$(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Z(e)?t(e):n(e)}}var Yc={name:`hardBreakEscape`,tokenize:Xc};function Xc(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Z(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Zc={name:`headingAtx`,resolve:Qc,tokenize:$c};function Qc(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},As(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function $c(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Gs(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Z(n)?(e.exit(`atxHeading`),t(n)):Q(n)?$(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Gs(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var el=`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`.split(`.`),tl=[`pre`,`script`,`style`,`textarea`],nl={concrete:!0,name:`htmlFlow`,resolveTo:al,tokenize:ol},rl={partial:!0,tokenize:cl},il={partial:!0,tokenize:sl};function al(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function ol(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:ae):Rs(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Rs(a)?(e.consume(a),i=4,r.interrupt?t:ae):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:ae):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return Rs(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Gs(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&tl.includes(l)?(i=1,r.interrupt?t(s):O(s)):el.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||zs(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Q(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Rs(t)?(e.consume(t),b):Q(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||zs(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Q(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Q(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Z(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Gs(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Q(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Z(t)?O(t):Q(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),ne):t===60&&i===1?(e.consume(t),re):t===62&&i===4?(e.consume(t),j):t===63&&i===3?(e.consume(t),ae):t===93&&i===5?(e.consume(t),A):Z(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(rl,M,ee)(t)):t===null||Z(t)?(e.exit(`htmlFlowData`),ee(t)):(e.consume(t),O)}function ee(t){return e.check(il,k,M)(t)}function k(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return t===null||Z(t)?ee(t):(e.enter(`htmlFlowData`),O(t))}function ne(t){return t===45?(e.consume(t),ae):O(t)}function re(t){return t===47?(e.consume(t),o=``,ie):O(t)}function ie(t){if(t===62){let n=o.toLowerCase();return tl.includes(n)?(e.consume(t),j):O(t)}return Rs(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ie):O(t)}function A(t){return t===93?(e.consume(t),ae):O(t)}function ae(t){return t===62?(e.consume(t),j):t===45&&i===2?(e.consume(t),ae):O(t)}function j(t){return t===null||Z(t)?(e.exit(`htmlFlowData`),M(t)):(e.consume(t),j)}function M(n){return e.exit(`htmlFlow`),t(n)}}function sl(e,t,n){let r=this;return i;function i(t){return Z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function cl(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(uc,t,n)}}var ll={name:`htmlText`,tokenize:ul};function ul(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Rs(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Rs(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Z(t)?(o=d,re(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ne(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Z(t)?(o=h,re(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ne(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ne(t):Z(t)?(o=v,re(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Z(t)?(o=y,re(t)):(e.consume(t),y)}function b(e){return e===62?ne(e):y(e)}function x(t){return Rs(t)?(e.consume(t),S):n(t)}function S(t){return t===45||zs(t)?(e.consume(t),S):C(t)}function C(t){return Z(t)?(o=C,re(t)):Q(t)?(e.consume(t),C):ne(t)}function w(t){return t===45||zs(t)?(e.consume(t),w):t===47||t===62||Gs(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ne):t===58||t===95||Rs(t)?(e.consume(t),E):Z(t)?(o=T,re(t)):Q(t)?(e.consume(t),T):ne(t)}function E(t){return t===45||t===46||t===58||t===95||zs(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Z(t)?(o=D,re(t)):Q(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,ee):Z(t)?(o=O,re(t)):Q(t)?(e.consume(t),O):(e.consume(t),k)}function ee(t){return t===i?(e.consume(t),i=void 0,te):t===null?n(t):Z(t)?(o=ee,re(t)):(e.consume(t),ee)}function k(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Gs(t)?T(t):(e.consume(t),k)}function te(e){return e===47||e===62||Gs(e)?T(e):n(e)}function ne(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function re(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ie}function ie(t){return Q(t)?$(e,A,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):A(t)}function A(t){return e.enter(`htmlTextData`),o(t)}}var dl={name:`labelEnd`,resolveAll:hl,resolveTo:gl,tokenize:_l},fl={tokenize:vl},pl={tokenize:yl},ml={tokenize:bl};function hl(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&As(e,0,e.length,n),e}function gl(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=js(s,e.slice(a+1,a+r+3)),s=js(s,[[`enter`,u,t]]),s=js(s,rc(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=js(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=js(s,e.slice(o+1)),s=js(s,[[`exit`,c,t]]),As(e,a,e.length,s),e}function _l(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(Ls(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(fl,u,o?u:d)(t):t===91?e.attempt(pl,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(ml,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function vl(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Gs(t)?Wc(e,a)(t):a(t)}function a(t){return t===41?u(t):Vc(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Gs(t)?Wc(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Uc(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Gs(t)?Wc(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function yl(e,t,n){let r=this;return i;function i(t){return Hc.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Ls(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function bl(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var xl={name:`labelStartImage`,resolveAll:dl.resolveAll,tokenize:Sl};function Sl(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Cl={name:`labelStartLink`,resolveAll:dl.resolveAll,tokenize:wl};function wl(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Tl={name:`lineEnding`,tokenize:El};function El(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),$(e,t,`linePrefix`)}}var Dl={name:`thematicBreak`,tokenize:Ol};function Ol(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Z(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Q(t)?$(e,s,`whitespace`)(t):s(t))}}var kl={continuation:{tokenize:Nl},exit:Fl,name:`list`,tokenize:Ml},Al={partial:!0,tokenize:Il},jl={partial:!0,tokenize:Pl};function Ml(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Hs(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Dl,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Hs(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(uc,r.interrupt?n:u,e.attempt(Al,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Q(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Nl(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(uc,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,$(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Q(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(jl,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,$(e,e.attempt(kl,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Pl(e,t,n){let r=this;return $(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Fl(e){e.exit(this.containerState.type)}function Il(e,t,n){let r=this;return $(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Q(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Ll={name:`setextUnderline`,resolveTo:Rl,tokenize:zl};function Rl(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function zl(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Q(t)?$(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Z(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Bl={tokenize:Vl};function Vl(e){let t=this,n=e.attempt(uc,r,e.attempt(this.parser.constructs.flowInitial,i,$(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ic,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Hl={resolveAll:Kl()},Ul=Gl(`string`),Wl=Gl(`text`);function Gl(e){return{resolveAll:Kl(e===`text`?ql:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Kl(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function ql(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Jl=e({attentionMarkers:()=>nu,contentInitial:()=>Xl,disable:()=>ru,document:()=>Yl,flow:()=>Ql,flowInitial:()=>Zl,insideSpan:()=>tu,string:()=>$l,text:()=>eu}),Yl={42:kl,43:kl,45:kl,48:kl,49:kl,50:kl,51:kl,52:kl,53:kl,54:kl,55:kl,56:kl,57:kl,62:fc},Xl={91:Gc},Zl={[-2]:wc,[-1]:wc,32:wc},Ql={35:Zc,42:Dl,45:[Ll,Dl],60:nl,61:Ll,95:Dl,96:xc,126:xc},$l={38:vc,92:gc},eu={[-5]:Tl,[-4]:Tl,[-3]:Tl,33:xl,38:vc,42:ic,60:[cc,ll],91:Cl,92:[Yc,gc],93:dl,95:ic,96:Oc},tu={null:[ic,Hl]},nu={null:[42,95]},ru={null:[]};function iu(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=js(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=rc(a,l.events,l),l.events):[]}function f(e,t){return ou(p(e),t)}function p(e){return au(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){Z(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&As(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function au(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function ou(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=` 3`;break;case-3:o=`\r 4`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function su(e){let t={constructs:Ns([Jl,...(e||{}).extensions||[]]),content:n(Xs),defined:[],document:n(Qs),flow:n(Bl),lazy:{},string:n(Ul),text:n(Wl)};return t;function n(e){return n;function n(n){return iu(t,e,n)}}}function cu(e){for(;!Pc(e););return e}var lu=/[\0\t\n\r]/g;function uu(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(lu.lastIndex=u,c=lu.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var du=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function fu(e){return e.replace(du,pu)}function pu(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Is(n.slice(t?2:1),t?16:10)}return ks(n)||e}var mu={}.hasOwnProperty;function hu(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),gu(n)(cu(su(n).document().write(uu()(e,t,!0))))}function gu(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(be),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ge),blockQuote:a(fe),characterEscape:T,characterReference:T,codeFenced:a(pe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(pe,o),codeText:a(me,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(P),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(he),hardBreakEscape:a(_e),hardBreakTrailing:a(_e),htmlFlow:a(ve,o),htmlFlowData:T,htmlText:a(ve,o),htmlTextData:T,image:a(ye),label:o,link:a(be),listItem:a(Se),listItemValue:f,listOrdered:a(xe,d),listUnordered:a(xe),paragraph:a(Ce),reference:oe,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ge),strong:a(we),thematicBreak:a(Te)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:de,autolinkProtocol:ue,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:N,characterReference:le,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(te),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(ee),htmlFlowData:E,htmlText:c(k),htmlTextData:E,image:c(re),label:A,labelText:ie,lineEnding:D,link:c(ne),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:se,resourceDestinationString:ae,resourceTitleString:j,resource:M,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};vu(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];mu.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||bu).call(a,void 0,e[0])}for(r.position={start:_u(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:_u(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:_u(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||bu).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Ho({start:e.start,end:e.end})+`): itâs not open`);n.position.end=_u(e.end)}function u(){return ws(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Ls(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=F(),n.position={start:_u(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=_u(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=_u(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function re(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ie(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=fu(t),n.identifier=Ls(t).toLowerCase()}function A(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ae(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function M(){this.data.inReference=void 0}function oe(){this.data.referenceType=`collapsed`}function se(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Ls(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ce(e){this.data.characterReferenceType=e.type}function N(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Is(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=ks(t);let i=this.stack[this.stack.length-1];i.value+=r}function le(e){let t=this.stack.pop();t.position.end=_u(e.end)}function ue(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function de(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function fe(){return{type:`blockquote`,children:[]}}function pe(){return{type:`code`,lang:null,meta:null,value:``}}function me(){return{type:`inlineCode`,value:``}}function P(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function he(){return{type:`emphasis`,children:[]}}function ge(){return{type:`heading`,depth:0,children:[]}}function _e(){return{type:`break`}}function ve(){return{type:`html`,value:``}}function ye(){return{type:`image`,title:null,url:``,alt:null}}function be(){return{type:`link`,title:null,url:``,children:[]}}function xe(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Se(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Ce(){return{type:`paragraph`,children:[]}}function we(){return{type:`strong`,children:[]}}function F(){return{type:`text`,value:``}}function Te(){return{type:`thematicBreak`}}}function _u(e){return{line:e.line,column:e.column,offset:e.offset}}function vu(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?vu(e,r):yu(e,r)}}function yu(e,t){let n;for(n in t)if(mu.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function bu(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Ho({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ho({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Ho({start:t.start,end:t.end})+`) is still open`)}function xu(e){let t=this;t.parser=n;function n(n){return hu(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Su(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Cu(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:` 5`}]}function wu(e,t){let n=t.value?t.value+` 6`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function Tu(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Eu(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Du(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Ys(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Ou(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ku(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Au(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function ju(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Au(e,t);let i={src:Ys(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Mu(e,t){let n={src:Ys(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Nu(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Pu(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Au(e,t);let i={href:Ys(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Fu(e,t){let n={href:Ys(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Iu(e,t,n){let r=e.all(t),i=n?Lu(n):Ru(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:` 7`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:` 8`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Lu(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Ru(n[r])}return t}function Ru(e){return e.spread??e.children.length>1}function zu(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Bu(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Vu(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Hu(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Uu(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=zo(t.children[1]),o=Ro(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{}
8,children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Wu(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Gu(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Ku=9,qu=32;function Ju(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Yu(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Yu(t.slice(i),i>0,!1)),a.join(``)}function Yu(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Ku||t===qu;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Ku||t===qu;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Xu(e,t){let n={type:`text`,value:Ju(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Zu(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Qu={blockquote:Su,break:Cu,code:wu,delete:Tu,emphasis:Eu,footnoteReference:Du,heading:Ou,html:ku,imageReference:ju,image:Mu,inlineCode:Nu,linkReference:Pu,link:Fu,listItem:Iu,list:zu,paragraph:Bu,root:Vu,strong:Hu,table:Uu,tableCell:Gu,tableRow:Wu,text:Xu,thematicBreak:Zu,toml:$u,yaml:$u,definition:$u,footnoteDefinition:$u};function $u(){}var{defineProperty:ed}=Object,td=typeof self==`object`?self:globalThis,nd=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new td[e](t)},rd=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?ed(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof td[e]==`function`?nd(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(nd(a,o),i)};return r},id=e=>rd(new Map,e)(0),ad=``,{toString:od}={},{keys:sd,is:cd}=Object,ld=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=od.call(e).slice(8,-1);switch(n){case`Array`:return[1,ad];case`Object`:return[2,ad];case`Date`:return[3,ad];case`RegExp`:return[4,ad];case`Map`:return[5,ad];case`Set`:return[6,ad];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},ud=([e,t])=>e===0&&(t===`function`||t===`symbol`),dd=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=ld(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&cd(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of sd(o))(e||!ud(ld(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?ad:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);
vendor: 7,406 bytes, lines 8-14
8for(let[n,r]of o)(e||!(ud(ld(n))||ud(ld(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!ud(ld(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},fd=(e,{json:t,lossy:n}={})=>{let r=[];return dd(!(t||n),!!t,new Map,r)(e),r},pd=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?id(fd(e,t)):structuredClone(e):(e,t)=>id(fd(e,t));function md(e,t){let n=[{type:`text`,value:`â©`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function hd(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function gd(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||md,r=e.options.footnoteBackLabel||hd,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=Ys(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...pd(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:` 9`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:` 10`}]}}var _d=(function(e){if(e==null)return Sd;if(typeof e==`function`)return xd(e);if(typeof e==`object`)return Array.isArray(e)?vd(e):yd(e);if(typeof e==`string`)return bd(e);throw Error(`Expected function, string, or object as test`)});function vd(e){let t=[],n=-1;for(;++n<e.length;)t[n]=_d(e[n]);return xd(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function yd(e){let t=e;return xd(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function bd(e){return xd(t);function t(t){return t&&t.type===e}}function xd(e){return t;function t(t,n,r){return!!(Cd(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Sd(){return!0}function Cd(e){return typeof e==`object`&&!!e&&`type`in e}function wd(e){return e}var Td=[];function Ed(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=_d(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+wd(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Td,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Dd(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Dd(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Td:[e]}function Od(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Ed(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var kd={}.hasOwnProperty,Ad={};function jd(e,t){let n=t||Ad,r=new Map,i=new Map,a={all:s,applyData:Nd,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Qu,...n.handlers},one:o,options:n,patch:Md,wrap:Fd};return Od(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(kd.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=pd(n);return r.children=a.all(e),r}return pd(e)}return(a.options.unknownHandler||Pd)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=Id(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=Id(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function Md(e,t){e.position&&(t.position=Vo(e))}function Nd(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,pd(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function Pd(e,t){let n=t.data||{},r=`value`in t&&!(kd.call(n,`hProperties`)||kd.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Fd(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:` 11`});++r<e.length;)r&&n.push({type:`text`,value:` 12`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:` 13`}),n}function Id(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ld(e,t){let n=jd(e,t),r=n.one(e,void 0),i=gd(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:` 14`},i)),a}function Rd(e,t){return e&&`run`in e?async function(n,r){let i=Ld(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Ld(n,{file:r,...e||t})}}function zd(e){if(e)throw e}var Bd=t(n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{}
vendor: 9,376 bytes, line 14
14,c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}))(),1);function Vd(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Hd(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Ud(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Ud(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var Wd={basename:Gd,dirname:Kd,extname:qd,join:Jd,sep:`/`};function Gd(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Zd(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Kd(e){if(Zd(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function qd(e){Zd(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Jd(...e){let t=-1,n;for(;++t<e.length;)Zd(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Yd(n)}function Yd(e){Zd(e);let t=e.codePointAt(0)===47,n=Xd(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Xd(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Zd(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Qd={cwd:$d};function $d(){return`/`}function ef(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function tf(e){if(typeof e==`string`)e=new URL(e);else if(!ef(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return nf(e)}function nf(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var rf=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],af=class{constructor(e){let t;t=e?ef(e)?{path:e}:typeof e==`string`||lf(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Qd.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<rf.length;){let e=rf[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)rf.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Wd.basename(this.path):void 0}set basename(e){sf(e,`basename`),of(e,`basename`),this.path=Wd.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Wd.dirname(this.path):void 0}set dirname(e){cf(this.basename,`dirname`),this.path=Wd.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Wd.extname(this.path):void 0}set extname(e){if(of(e,`extname`),cf(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=Wd.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){ef(e)&&(e=tf(e)),sf(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Wd.basename(this.path,this.extname):void 0}set stem(e){sf(e,`stem`),of(e,`stem`),this.path=Wd.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Ko(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function of(e,t){if(e&&e.includes(Wd.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Wd.sep+"`")}function sf(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function cf(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function lf(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var uf=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),df={}.hasOwnProperty,ff=new class e extends uf{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Hd()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Bd.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(hf(`data`,this.frozen),this.namespace[e]=t,this):df.call(this.namespace,e)&&this.namespace[e]||void 0:e?(hf(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=vf(e),n=this.parser||this.Parser;return pf(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),pf(`process`,this.parser||this.Parser),mf(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=vf(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);bf(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),pf(`processSync`,this.parser||this.Parser),mf(`processSync`,this.compiler||this.Compiler),this.process(e,r),_f(`processSync`,`process`,t),n;function r(e,r){t=!0,zd(e),n=r}}run(e,t,n){gf(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=vf(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),_f(`runSync`,`run`,n),r;function i(e,t){zd(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=vf(t),r=this.compiler||this.Compiler;return mf(`stringify`,r),gf(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(hf(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,Bd.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];
14Vd(o)&&Vd(r)&&(r=(0,Bd.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function pf(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function mf(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function hf(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function gf(e){if(!Vd(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function _f(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function vf(e){return yf(e)?e:new af(e)}function yf(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function bf(e){return typeof e==`string`||xf(e)}function xf(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Sf=[],Cf={allowDangerousHtml:!0},wf=/^(https?|ircs?|mailto|xmpp)$/i,Tf=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function Ef(e){let t=Df(e),n=Of(e);return kf(t.runSync(t.parse(n),n),e)}function Df(e){let t=e.rehypePlugins||Sf,n=e.remarkPlugins||Sf,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Cf}:Cf;return ff().use(xu).use(n).use(Rd,r).use(t)}function Of(e){let t=e.children||``,n=new af;return typeof t==`string`?n.value=t:``+t,n}function kf(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Af;for(let e of Tf)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return Od(e,l),es(e,{Fragment:G.Fragment,components:i,ignoreInvalidStyle:!0,jsx:G.jsx,jsxs:G.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Ss)if(Object.hasOwn(Ss,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Ss[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function Af(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||wf.test(e.slice(0,t))?e:``}var jf={messageContent:`_messageContent_12bcl_1`,blockquoteWrapper:`_blockquoteWrapper_12bcl_21`,blockquoteContent:`_blockquoteContent_12bcl_37`,blockquoteCopyButton:`_blockquoteCopyButton_12bcl_43`,messageUser:`_messageUser_12bcl_56`,messageIconUser:`_messageIconUser_12bcl_62`,messageAi:`_messageAi_12bcl_68`,messageIconAi:`_messageIconAi_12bcl_74`};function Mf({node:e,children:t,...n}){let r=W({timeout:2e3}),i=(0,U.useRef)(null),a=()=>{if(i.current){let e=(i.current.innerText||i.current.textContent||``).trim();r.copy(e)}};return(0,G.jsxs)(x,{component:`blockquote`,className:jf.blockquoteWrapper,...n,children:[(0,G.jsx)(x,{ref:i,className:jf.blockquoteContent,children:t}),(0,G.jsx)(x,{className:jf.blockquoteCopyButton,children:(0,G.jsx)(Me,{label:r.copied?`Copied content`:`Copy content`,withArrow:!0,position:`left`,children:(0,G.jsx)(Ne,{variant:`subtle`,color:r.copied?`teal`:`gray`,size:`sm`,onClick:a,"aria-label":`Copy blockquote content`,children:r.copied?(0,G.jsx)(ye,{size:16}):(0,G.jsx)(Sr,{size:16})})})})]})}function Nf({message:e,speed:t=100,chunkSize:n=3,onUpdate:r,onFinish:i}
14){let[a,o]=(0,U.useState)(``),[s,c]=(0,U.useState)(0),l=(0,U.useRef)(!1);return(0,U.useEffect)(()=>{o(``),c(0),l.current=!1},[e]),(0,U.useEffect)(()=>{let a=e.split(` `);if(s<a.length){let e=setTimeout(()=>{let e=a.slice(s,s+n).join(` `);o(t=>t+(t?` `:``)+e),c(e=>e+n),r?.()},t);return()=>clearTimeout(e)}l.current||(l.current=!0,i?.())},[s,e,t,n,r,i]),(0,G.jsx)(mr,{className:jf.messageContent,children:(0,G.jsx)(Ef,{components:{blockquote:Mf},children:a})})}function Pf({message:e,isLast:t,simulateStream:n,onFinishStream:r,onUpdateStream:i,lastAnswerEl:a}){return(0,G.jsxs)(Oe,{wrap:`nowrap`,gap:`sm`,justify:e.is_user?`flex-end`:`flex-start`,children:[!e.is_user&&(0,G.jsx)(Ze,{radius:`50%`,size:`lg`,variant:`white`,color:`dark`,className:jf.messageIconAi,children:(0,G.jsx)(Nr,{style:{width:`70%`,height:`70%`}})}),(0,G.jsxs)(L,{p:`md`,w:`85%`,className:e.is_user?jf.messageUser:jf.messageAi,children:[(0,G.jsxs)(Oe,{wrap:`nowrap`,gap:`xs`,children:[(0,G.jsx)(`div`,{style:{flex:1},children:t&&n&&e.message&&!e.is_user?(0,G.jsx)(Nf,{message:e.message,onFinish:r,onUpdate:i}):e.image?(0,G.jsx)($e,{radius:`md`,h:150,w:`auto`,src:`data:image/png;base64, ${e.image}`}):(0,G.jsx)(mr,{className:jf.messageContent,children:(0,G.jsx)(Ef,{components:{blockquote:Mf},children:e.message})})}),t&&!e.is_user&&a]}),e.hint&&(0,G.jsx)(L,{bg:`gray.0`,p:`sm`,mt:`sm`,children:(0,G.jsxs)(F,{gap:`sm`,align:`flex-start`,wrap:`nowrap`,children:[(0,G.jsx)(Ze,{variant:`transparent`,color:`gray.6`,size:`xs`,children:(0,G.jsx)(lt,{size:18,stroke:1.5})}),(0,G.jsx)(C,{size:`xs`,c:`dimmed`,fs:`italic`,lh:1.3,children:e.hint})]})})]}),e.is_user&&(0,G.jsx)(Ze,{radius:`50%`,size:`lg`,className:jf.messageIconUser,children:(0,G.jsx)(Rr,{style:{width:`70%`,height:`70%`}})})]})}function Ff({history:e,newChatMessage:t,isAnswering:n,isStreaming:r,lastAnswerEl:i,scrollProps:a,stackProps:o,simulateStream:s=!0,loadingInfo:c}){let l=(0,U.useRef)(null),u=(0,U.useRef)(!0),d=(0,U.useRef)(!1),[f,p]=(0,U.useState)(!1),m=(0,U.useCallback)((e=!0)=>{let t=l.current;t&&(d.current=!0,t.scrollTo({top:t.scrollHeight,behavior:e?`smooth`:`auto`}))},[]),h=(0,U.useCallback)(({y:e})=>{if(d.current){d.current=!1;return}let t=l.current;if(!t)return;let n=e+t.clientHeight>=t.scrollHeight-50;u.current=n,p(!n)},[]);(0,U.useEffect)(()=>{let e=l.current;if(!e)return;let t=new ResizeObserver(()=>{u.current&&m(!1)}),n=e.querySelector(`.mantine-ScrollArea-viewport > div`);return n&&t.observe(n),()=>t.disconnect()},[m]);let g=()=>n?(0,G.jsxs)(G.Fragment,{children:[t&&(0,G.jsx)(Pf,{message:{message:t,is_user:!0},isLast:!1}),(0,G.jsxs)(x,{children:[c&&c.length>0&&(0,G.jsx)(R,{gap:4,children:c.map(e=>(0,G.jsxs)(F,{wrap:`nowrap`,children:[(0,G.jsx)(fe,{size:12,color:`gray`}),(0,G.jsx)(C,{size:`xs`,c:`dimmed`,children:e.description??e.name??e.id})]},e.id))}),!r&&(0,G.jsx)(fe,{size:30,type:`dots`})]})]}):null;return e?(0,G.jsxs)(se.Autosize,{viewportRef:l,type:`scroll`,scrollbarSize:8,onScrollPositionChange:h,pos:`relative`,...a,children:[(0,G.jsxs)(R,{py:`md`,...o,children:[e.map((t,n)=>(0,G.jsx)(Pf,{message:t,isLast:n===e.length-1,simulateStream:s,lastAnswerEl:i},n)),g()]}),(0,G.jsx)(x,{style:{bottom:10,left:`50%`,transform:`translateX(-50%)`},pos:`absolute`,children:(0,G.jsx)(me,{transition:`slide-up`,mounted:f,children:e=>(0,G.jsx)(Ne,{style:{...e,boxShadow:`var(--mantine-shadow-sm)`},onClick:()=>{u.current=!0,m(!0)},radius:`xl`,size:`lg`,children:(0,G.jsx)(br,{size:20})})})})]}):null}var If={wrapperElement:`_wrapperElement_1l9ax_1`,inputElement:`_inputElement_1l9ax_13`,sectionRight:`_sectionRight_1l9ax_24`};function Lf({isLoading:e,isDisabled:t=!1,placeholder:n=`Ask Sherloq AI ...`,onSendInput:r,...i}){let[a,o]=(0,U.useState)(``),s=()=>{a.length==0||e||t||(r(a),o(``))};return(0,G.jsxs)(x,{w:`100%`,mt:`md`,...i,children:[(0,G.jsx)(nn,{autosize:!0,minRows:1,maxRows:3,w:`100%`,classNames:{wrapper:If.wrapperElement,input:If.inputElement,section:If.sectionRight},value:a,disabled:e||t,onChange:e=>o(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&a.length>0&&(e.preventDefault(),s())},placeholder:n,"data-autofocus":!0,rightSection:(0,G.jsx)(Ne,{title:`Send message to Sherloq AI`,variant:`filled`,size:`md`,radiu
14s:`xl`,disabled:!a||t,onClick:s,loading:e,children:(0,G.jsx)(Mr,{style:{width:`80%`,height:`80%`},stroke:1.5})})}),(0,G.jsx)(C,{c:`dimmed`,size:`xs`,ta:`center`,my:`xs`,children:`Sherloq AI can make mistakes. Please verify important information.`})]})}function Rf({sessionId:e,wsUrl:t,maxRetries:n=5,onMessageReceived:r,onSessionCreated:i,onError:a}){let[o,s]=(0,U.useState)(null),[c,l]=(0,U.useState)(`disconnected`),[u,d]=(0,U.useState)(e),f=(0,U.useRef)(null),p=(0,U.useRef)(0),m=(0,U.useRef)(null),h=(0,U.useRef)(null),g=(0,U.useCallback)(()=>{if(f.current?.readyState===WebSocket.OPEN||!o)return;l(p.current>0?`reconnecting`:`connecting`);let e=u===null?t:`${t}${u}/`,s=new WebSocket(e);s.onopen=()=>{l(`connected`),p.current=0,h.current=setInterval(()=>{s.readyState===WebSocket.OPEN&&s.send(JSON.stringify({type:`ping`}))},3e4)},s.onmessage=e=>{try{let t=JSON.parse(e.data);if(t.type===`session_info`){d(t.session_id),i?.(t.session_id);return}if(t.type===`error`){a?.(t.message);return}if(t.type===`pong`)return;r?.(t)}catch(e){console.error(`Failed to parse incoming WebSocket message`,e),a?.(`Failed to parse incoming chat message`)}},s.onclose=()=>{if(h.current&&clearInterval(h.current),p.current>=n){l(`error`),console.error(`WebSocket connection failed after ${n} attempts.`);return}l(`disconnected`);let e=Math.min(1e3*2**p.current,3e4);m.current=setTimeout(()=>{p.current+=1,g()},e)},s.onerror=()=>{s.close()},f.current=s},[t,u,n,r,i,o,a]),_=(0,U.useCallback)(()=>{m.current&&clearTimeout(m.current),h.current&&clearInterval(h.current),f.current&&=(f.current.onclose=null,f.current.close(),null),l(`disconnected`),p.current=0},[]);return(0,U.useEffect)(()=>{ct().then(e=>s(e))},[]),(0,U.useEffect)(()=>{d(e)},[e]),(0,U.useEffect)(()=>(g(),()=>_()),[g,_]),{status:c,activeSessionId:u,sendMessage:(0,U.useCallback)((e,t,n)=>{f.current?.readyState===WebSocket.OPEN?f.current.send(JSON.stringify({type:n||`message`,content:e,...t?{data:t}:{}})):console.warn(`WebSocket is not connected. Message not sent.`)},[]),disconnect:_,connect:g}}function zf({publicIdentifier:e,activityId:t,onHasMessage:n}){let[r,i]=(0,U.useState)(!1),[a,o]=(0,U.useState)(!1),[s,c]=(0,U.useState)(null),[l,u]=(0,U.useState)([]),[d,f]=(0,U.useState)([]),[p,m]=(0,U.useState)(e);function h(){i(!1),o(!1),u([])}e!==p&&(m(e),c(null),f([]),h(),n?.(!1)),(0,U.useEffect)(()=>{st(`profile-chat-message`)},[e]);let{data:g,refetch:_}=z({queryKey:[`profileChat`,`chat-list`,e],queryFn:()=>B.get(`/ai/profiles/${e}/chat-list/`).then(e=>e.data).catch(e=>{e.response?.status===404?console.log(`Profile not found.`):et(`Failed to load chat history.`,e.response)}),enabled:e!=null&&e!=`na`}),{isFetching:v,data:y}=z({queryKey:[`profileChat`,`history`,e,s],queryFn:()=>B.get(`/ai/profiles/${e}/chat/`,{params:{chat_id:s}}).then(e=>e.data),meta:{errorMessage:`Failed to load chat history.`},enabled:s!=null});(0,U.useEffect)(()=>{y&&(f(y.history??[]),n?.(y.history?.length>0))},[y,n]);let b=(0,U.useCallback)(e=>{switch(e.type){case`tool_start`:u(t=>{let n=t?.find(t=>t.id===e.tool);return n?(n.name=e.info?.name,n.description=e.info?.description,[...t]):[...t,{id:e.tool,name:e.info?.name,description:e.info?.description}]});break;case`tool_end`:u(t=>t.filter(t=>t.id!==e.tool));break;case`streaming`:case`done`:o(e.type===`streaming`),u([]),e.type===`done`&&i(!1),f(t=>{let n=[...t],r=n[n.length-1];return r&&!r.is_user?r.message=e.content:n.push({is_user:!1,message:e.content}),n});break;case`stopped`:o(!1),i(!1),u([]),f(e=>{let t=[...e];return t.length>0&&!t[t.length-1].is_user&&t.pop(),t.length>0&&t[t.length-1].is_user&&t.pop(),t});break;default:console.error(`Unhandled event:`,e.type)}},[]),x=(0,U.useCallback)(e=>{c(e),_()},[_]),S=(0,U.useCallback)(e=>{console.error(`WebSocket error:`,e),h(),et(e)},[]),{sendMessage:C,status:w}=Rf({sessionId:s,wsUrl:`${H.wsUrl}/deep_dive_chat/${e}/`,onMessageReceived:b,onSessionCreated:x,onError:S}),T=(0,U.useCallback)(e=>{c(e),e??(f([]),n?.(!1))},[n]);return{isGenerating:r,isStreaming:a,isFetching:v,isConnected:w===`connected`,sessionId:s,activeToolInfo:l,chatHistory:d??[],chatList:g,onSelectSessionId:T,onSendInput:e=>{if(!e||w!=`connected`||r||v||a)return;let o=null;t&&(o={type:`activity`,activity_id:t}),n?.(!0),i(!0),f(t=>[...t,{is_user:!0,message:e}]),C(e,o)},onStopGenerating:()=>{console.log(`stop generating`),C(`stop`,{},`stop`)}}}function Bf({url:e,onSuccess:t,successMessage:n,queryKey:r=[],name:i=`data`,resetFormOnSuccess:a=!1,usePost:o=!1,...s}){let[c,l]=(0,U.useState)(!1),u=Re(s),d=(0,U.useRef)(u);d.current=u;let{isFetching:f,data:p,refetch:m,isError:h}=z({queryKey:r,queryFn:async()=>r.length===0?null:(await B.get(e)).data,meta:{errorMessage:`Failed to load ${i}.`}});return(0,U.useEffect)(()=>{p?d.current.setValues(p):d.current.reset()}
14,[p]),{form:u,isFetching:f,isUpdating:c,refetch:m,formData:p,submitForm:u.onSubmit(async s=>{l(!0),(o?B.post(e,s):B.put(e,s)).then(()=>{nt(n??`Successfully updated ${i}.`),t?.(),a&&u.reset(),r.length>0&&m()}).catch(e=>{e.response?.data&&typeof e.response.data==`object`&&u.setErrors(e.response.data),et(`Failed to update ${i}.`)}).finally(()=>l(!1))}),isError:h}}var Vf=()=>{let{isLoading:e,data:t,refetch:n}=z({queryKey:[`dashboard`,`stats`],queryFn:()=>B.get(`/crm/stats/`).then(e=>e.data),meta:{errorMessage:`Failed to load stats.`}});return{isLoading:e,stats:t,refetch:n}};function Hf(){let{data:e,refetch:t}=z({queryKey:[`dashboard`,`stats`],queryFn:()=>B.get(`/crm/stats/`).then(e=>e.data),meta:{errorMessage:`Failed to load subscription status.`},staleTime:3e4});if(!e)return{canUpgrade:null,hasSubscription:null,subscriptionName:null,allWatchlistUsed:null,limitReached:null,activeFeatures:null,stats:e,refetch:t};let n=e.user_credits.current_plan?.can_upgrade??!1,r=e.user_credits.current_plan?.name??null;return{canUpgrade:n,hasSubscription:e.user_credits.current_plan!==null,subscriptionName:r,allWatchlistUsed:e.user_credits.watchlist_size>=e.user_credits.max_watchlist_size,limitReached:{credits:(e.user_credits.usage.credits||0)>=(e.user_credits.usage_limits.credits||0),scoring:(e.user_credits.usage.scoring||0)>=(e.user_credits.usage_limits.scoring||0),enrichment:(e.user_credits.usage.enrichment||0)>=(e.user_credits.usage_limits.enrichment||0)},activeFeatures:e.user_credits.features??[],stats:e,refetch:t}}function Uf(e=!0,t=!1,n=!1){let r={highlight_current_user:t?`1`:null,add_team_entry:n?`1`:null},{data:i,error:a,isFetching:o,refetch:s}=z({queryKey:[`team`,`users`,t,n],queryFn:()=>B.get(`/team/users/`,{params:r}).then(e=>e.data),staleTime:9e5,meta:{errorMessage:`Failed to load user list.`}});return{userList:i&&i.constructor===Array?e?i.map(e=>({value:e.id?String(e.id):``,label:e.name})):i:[],isLoading:o,refetch:s,error:a}}function Wf(){let[e,t]=(0,U.useState)(null),[n,{open:r,close:i}]=Te(!1);return{openWatchlistItem:e=>{B.get(`/crm/watchlist/${e}/`).then(e=>{t(e.data),r()}).catch(()=>{window.open(`https://www.linkedin.com/in/${e}`,`_blank`)?.focus()})},selectedItem:e,opened:n,close:i}}function Gf(){let{isFetching:e,data:t,refetch:n,error:r}=z({queryKey:[`watchlist`,`tags`],queryFn:()=>B.get(`/crm/tags/`).then(e=>e.data),staleTime:9e5,meta:{errorMessage:`Failed to load watchlist tags.`}});return(0,U.useEffect)(()=>{r&&tt.show({title:`Error`,message:`Failed to load tags list.`,color:`red`})},[r]),{watchlistTags:t&&t.constructor===Array?t:[],isLoading:e,refetch:n,error:r}}function Kf(e){let[t,n]=(0,U.useState)(!1),{config:r}=Ha(),{refetch:i}=Hf(),a=t=>{i(),t!=`checkout.closed`&&o?.Checkout.close(),e?.onSuccess&&e.onSuccess()},{paddle:o}=Ua(a),s=(e,t,n,i)=>{if(e.checkout_transaction_id){if(!o){console.log(`Paddle not initialized`);return}o.Checkout.open({transactionId:e.checkout_transaction_id,customer:{email:r?.customer.email},settings:{locale:`en`},customData:{tolt_referral:window.tolt_referral}})}else if(e.additional_charges!=null){let r=e.trial_ends&&t&&!t.free_trial;Ae.openConfirmModal({title:`Please confirm the charges`,children:r?(0,G.jsxs)(ze,{color:`orange`,title:`Immediate billing required`,children:[`The `,t.name,` plan does not include a free trial. Switching now will end your trial immediately and charge you `,(0,G.jsxs)(`b`,{children:[e.next_charges,` â¬`]}),`.`]}):(0,G.jsxs)(C,{size:`sm`,children:[e.additional_charges>0&&(0,G.jsxs)(G.Fragment,{children:[`By changing the plan, you will be charged`,` `,(0,G.jsxs)(`b`,{children:[e.additional_charges,` â¬`]}),` immediately.`,(0,G.jsx)(`br`,{})]}),`The next regular billing amount will be adjusted to`,` `,(0,G.jsxs)(`b`,{children:[e.next_charges,` â¬`]}),`. Please confirm the changes, to change your plan.`]}),labels:{confirm:`Confirm`,cancel:`Cancel`},onConfirm:()=>{c(t,n,!0,i)}})}else a()},c=(e,t,r=!1,i=null)=>{o&&(n(!0),B.patch(`/payment/subscription/`,{selected_product_id:e?.id,selected_yearly:t,approve_charges:r,selected_seat_count:i}).then(n=>s(n.data,e,t,i)).catch(()=>et(`Failed to update subscription.`)).finally(()=>n(!1)))};return{changeSubscriptionPlan:c,cancelSubscription:()=>{o&&Ae.openConfirmModal({title:`Cancel subscription`,children:(0,G.jsx)(C,{size:`sm`,children:`Are you sure you want to cancel your subscription?`}),labels:{confirm:`Cancel subscription`,cancel:`Cancel`},confirmProps:{color:`red`},onConfirm:()=>{n(!0),B.delete(`/payment/subscription/`).then(()=>a()).catch(()=>et(`Failed to cancel subscription.`)).finally(()=>n(!1))}})},resumeSubscription:()=>{o&&Ae.openConfirmModal({title:`Resume subscription`,children:(0,G.jsx)(C,{size:`sm`,children:`Are you sure you want to resume your subscription?`}),labels:{confirm:`Resume subscription`,cancel:`Cancel`},confirmProps:{color:`blue`},onConfirm:()=>{n(!0),B.post(`/payment/subscription/`,{}).then(()=>a()).catch(()=>et(`Failed to resume subscription.`)).finally(()=>n(!1))}})},isUpdating:t,paddleClient:o,isEnabled:!!o}}function qf(){let{stats:e,isLoading:t}=Vf();return{signalCount:e?.dashboard_signal_count??0,leadCount:e?.dashboard_lead_count??0,hasHighFitLead:e?.dashboard_has_high_fit_lead??!1,isLoading:t}}export{Pr as $,Hi as A,ai as B,Zi as C,Gi as D,qi as E,vi as F,Xr as G,ni as H,_i as I,Kr as J,Yr as K,gi as L,Ii as M,Pi as N,Ki as O,Fi as P,Fr as Q,pi as R,Qi as S,Xi as T,ti as U,ri as V,Zr as W,zr as X,Wr as Y,Ir as Z,oa as _,un as _t,Uf as a,Dr as at,ra as b,ft as bt,Bf as c,Sr as ct,Ff as d,gr as dt,Nr as et,Ka as f,fr as ft,sa as g,mn as gt,ca as h,Tn as ht,Wf as i,kr as it,zi as j,Wi as k,zf as l,xr as lt,Ua as m,ar as mt,Kf as n,jr as nt,Hf as o,Er as ot,Ga as p,sr as pt,Jr as q,Gf as r,Ar as rt,Vf as s,Tr as st,qf as t,Mr as tt,Lf as u,vr as ut,aa as v,nn as vt,Yi as w,$i as x,W as xt,ia as y,Vt as yt,oi as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.